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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
fde288d984e552f5a1915ef955f712a83f05fc19
| 5,488,968,274,860 |
32b1e369407247ba40eb39137d20492361dd1751
|
/src/main/java/com/pony/MobileInterface/util/ProductOrderNumberGenerator.java
|
b6c7bf8afaa5004a9afe93a876b506475552fe99
|
[] |
no_license
|
KyleQiao1992/pony
|
https://github.com/KyleQiao1992/pony
|
c181b7f821f3044888c943203d4edbfcac04e109
|
ff8b0d99374309204b825c5b87c1bfa641343450
|
refs/heads/master
| 2021-01-12T18:34:14.083000 | 2017-06-05T13:55:49 | 2017-06-05T13:55:49 | 81,730,918 | 1 | 1 | null | false | 2017-05-30T04:09:55 | 2017-02-12T14:17:17 | 2017-02-17T06:27:47 | 2017-05-30T04:09:55 | 575 | 1 | 2 | 0 |
Java
| null | null |
package com.pony.MobileInterface.util;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
/**
* Created by Administrator on 2017/4/16 0016.
*/
public class ProductOrderNumberGenerator {
public static String getProductOrderNumber(){
DateFormat format1 = new SimpleDateFormat("ddHHmmss"); //M一定要大写!!!!
String productOrderNumber = format1.format(new Date());
productOrderNumber+= (int)((Math.random()*9+1)*100000);
return productOrderNumber;
}
// public static void main(String [] args) {
// System.out.println(getProductOrderNumber());
// }
}
|
UTF-8
|
Java
| 658 |
java
|
ProductOrderNumberGenerator.java
|
Java
|
[
{
"context": "eFormat;\nimport java.util.Date;\n\n/**\n * Created by Administrator on 2017/4/16 0016.\n */\npublic class ProductOrderN",
"end": 159,
"score": 0.5687611103057861,
"start": 146,
"tag": "NAME",
"value": "Administrator"
}
] | null |
[] |
package com.pony.MobileInterface.util;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
/**
* Created by Administrator on 2017/4/16 0016.
*/
public class ProductOrderNumberGenerator {
public static String getProductOrderNumber(){
DateFormat format1 = new SimpleDateFormat("ddHHmmss"); //M一定要大写!!!!
String productOrderNumber = format1.format(new Date());
productOrderNumber+= (int)((Math.random()*9+1)*100000);
return productOrderNumber;
}
// public static void main(String [] args) {
// System.out.println(getProductOrderNumber());
// }
}
| 658 | 0.689062 | 0.65625 | 25 | 24.6 | 24.58292 | 76 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.36 | false | false |
3
|
1c1b58b4303a60d2fed0f4e936f06e4785144fd5
| 9,715,216,080,529 |
95fea1989be3c685648c5488aaf9251ca7668510
|
/pms-srv/pms-srv-test/src/main/java/com/evry/fs/payment/pms/srv/testdata/ProjectDetailsTestDataConstants.java
|
123a750d7e07611054fead3caa39a9f378c0544d
|
[] |
no_license
|
tosurya01/Project_Management_System_SOAP
|
https://github.com/tosurya01/Project_Management_System_SOAP
|
4bb427f57793f143bbe8a8b3810d25a497f7913d
|
dd73eac7bc3a93f0183f5cc64aeb97d78b2c278b
|
refs/heads/master
| 2020-05-18T19:42:05.277000 | 2019-05-07T11:07:19 | 2019-05-07T11:07:19 | 184,613,996 | 0 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.evry.fs.payment.pms.srv.testdata;
public final class ProjectDetailsTestDataConstants {
// Positive senario
public static final Integer PROJECT_ID = 3245;
public static final String PROJECT_NAME = "payments";
public static final String PROJECT_STATUS = "Y";
public static final Integer ESTIMATED_HRS = 50;
public static final Integer LOGGED_HRS = 20;
public static final Integer REMAINING_HRS = 30;
public static final Boolean TRUE = true;
// Negitive senario
public static final Integer WRONG_PROJECT_ID = 7865;
public static final String WRONG_PROJECT_NAME = "GRS";
public static final String WRONG_PROJECT_STATUS = "N";
public static final Integer WRONG_ESTIMATED_HRS = 30;
public static final Integer WRONG_LOGGED_HRS = 10;
public static final Integer WRONG_REMAINING_HRS = 20;
public static final Boolean FALSE = false;
}
|
UTF-8
|
Java
| 856 |
java
|
ProjectDetailsTestDataConstants.java
|
Java
|
[] | null |
[] |
package com.evry.fs.payment.pms.srv.testdata;
public final class ProjectDetailsTestDataConstants {
// Positive senario
public static final Integer PROJECT_ID = 3245;
public static final String PROJECT_NAME = "payments";
public static final String PROJECT_STATUS = "Y";
public static final Integer ESTIMATED_HRS = 50;
public static final Integer LOGGED_HRS = 20;
public static final Integer REMAINING_HRS = 30;
public static final Boolean TRUE = true;
// Negitive senario
public static final Integer WRONG_PROJECT_ID = 7865;
public static final String WRONG_PROJECT_NAME = "GRS";
public static final String WRONG_PROJECT_STATUS = "N";
public static final Integer WRONG_ESTIMATED_HRS = 30;
public static final Integer WRONG_LOGGED_HRS = 10;
public static final Integer WRONG_REMAINING_HRS = 20;
public static final Boolean FALSE = false;
}
| 856 | 0.76986 | 0.746495 | 21 | 39.761906 | 18.657068 | 55 | true | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.47619 | false | false |
3
|
b5fdd112213e55cde6311d2fad87eac7db4cf2b4
| 13,434,657,762,105 |
54ea4b551d0cf8b7dd185faa6d796dac509d921e
|
/gmall-api/src/main/java/com/lichen/gmall/service/SpuService.java
|
5e6f1d6317f2ca6ea9b2c1009518e02a4fbad000
|
[] |
no_license
|
AndaCinder/gmall
|
https://github.com/AndaCinder/gmall
|
dd93bd1a8a29472891309af92671cf2e546165a2
|
8022ddadd5866115e50cbe70d2c3f46828894182
|
refs/heads/master
| 2022-09-15T15:34:31.952000 | 2020-05-10T16:02:33 | 2020-05-10T16:02:33 | 191,106,030 | 0 | 0 | null | false | 2022-09-01T23:10:06 | 2019-06-10T05:58:30 | 2020-05-10T16:02:36 | 2022-09-01T23:10:05 | 20,535 | 0 | 0 | 8 |
CSS
| false | false |
package com.lichen.gmall.service;
import com.lichen.gmall.bean.*;
import java.util.List;
import java.util.Map;
public interface SpuService {
List<SpuInfo> spuList(String catalog3Id);
List<BaseSaleAttr> baseSaleAttrList();
void saveSpu(SpuInfo spuInfo);
List<SpuImage> getSpuImageList(String spuId);
List<SpuSaleAttr> getSpuSaleAttrList(String spuId);
void deleteSpu(String spuId);
List<SpuSaleAttr> getSpuSaleAttrListBySpuId(String spuId);
List<SpuSaleAttr> getSpuSaleAttrListCheckBySku(Map<String, String> idMap);
List<SkuInfo> getSkuSaleAttrValueListBySpu(String spuId);
//
List<SpuImage> getSkuImageListBySpuId(String spuId);
List<SpuSaleAttrValue> spuSaleAttrValueList(SpuSaleAttr spuSaleAttr);
}
|
UTF-8
|
Java
| 762 |
java
|
SpuService.java
|
Java
|
[] | null |
[] |
package com.lichen.gmall.service;
import com.lichen.gmall.bean.*;
import java.util.List;
import java.util.Map;
public interface SpuService {
List<SpuInfo> spuList(String catalog3Id);
List<BaseSaleAttr> baseSaleAttrList();
void saveSpu(SpuInfo spuInfo);
List<SpuImage> getSpuImageList(String spuId);
List<SpuSaleAttr> getSpuSaleAttrList(String spuId);
void deleteSpu(String spuId);
List<SpuSaleAttr> getSpuSaleAttrListBySpuId(String spuId);
List<SpuSaleAttr> getSpuSaleAttrListCheckBySku(Map<String, String> idMap);
List<SkuInfo> getSkuSaleAttrValueListBySpu(String spuId);
//
List<SpuImage> getSkuImageListBySpuId(String spuId);
List<SpuSaleAttrValue> spuSaleAttrValueList(SpuSaleAttr spuSaleAttr);
}
| 762 | 0.761155 | 0.759843 | 31 | 23.580645 | 25.520105 | 78 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.516129 | false | false |
3
|
2b9979c01d42aa2bde594c8df6b4e91c99f33d96
| 13,469,017,497,662 |
548f5f690f2dc48a6892ff76d5392b045601cd96
|
/src/main/java/com/clancey/apollo/common/utils/TreeUtil.java
|
19925be109007c7fd4404d5a731a30d9e81d558c
|
[] |
no_license
|
LvGY518/apollo
|
https://github.com/LvGY518/apollo
|
40417882914eba60dd4cdfedd0b199e71fc93e8d
|
6c2e8fd849b4318175ef16ed9efad9d92f58b317
|
refs/heads/master
| 2020-05-01T05:22:02.305000 | 2019-03-23T15:48:45 | 2019-03-23T15:48:45 | 177,299,631 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.clancey.apollo.common.utils;
import com.clancey.apollo.common.base.LevelCode;
import java.util.ArrayList;
import java.util.List;
/**
* @author ChenShuai
* @date 2018/9/13 14:39
*/
public class TreeUtil {
/**
* 生成树
* @param array
* @param codeSpan
* @param <T>
* @return
*/
@SuppressWarnings("unchecked")
public static <T extends LevelCode> List<T> generateTree(List<T> array, final int codeSpan) {
if (array.isEmpty()) {
return new ArrayList<>();
}
//找出最短的合法levelCode长度
int codeStartLength = getMinimumCodeLength(array, codeSpan);
List<T> result = new ArrayList<>();
for (T t : array) {
String levelCode = t.getLevelCode();
if (levelCode.length() == codeStartLength) {
t.setChildren(generateChildren(array, levelCode, codeSpan));
result.add(t);
}
}
return result;
}
/**
* 生成子节点
* @param array
* @param levelCode
* @param codeSpan
* @param <T>
* @return
*/
@SuppressWarnings("unchecked")
private static <T extends LevelCode> List<T> generateChildren(List<T> array, String levelCode, final int codeSpan) {
List<T> result = new ArrayList<>();
for (T t : array) {
String tempLevelCode = t.getLevelCode();
if (tempLevelCode.startsWith(levelCode) && tempLevelCode.length() - levelCode.length() == codeSpan) {
t.setChildren(generateChildren(array, tempLevelCode, codeSpan));
result.add(t);
}
}
return result;
}
private static <T extends LevelCode> int getMinimumCodeLength(List<T> array, int codeSpan) {
int minimumCode = -1;
for (T t : array) {
int codeLength = t.getLevelCode().length();
//只处理满足levelCode层级要求的数据
if (codeLength % codeSpan != 0) {
continue;
}
//如果当前长度小于最小levelCode长度,则替换
if (codeLength < minimumCode) {
minimumCode = codeLength;
continue;
}
//如果当前的比对是初始值,则设置为最小值
if (minimumCode == -1) {
minimumCode = codeLength;
}
}
//最小的编码长度必须大于等于codeSpan
return minimumCode > codeSpan ? minimumCode : codeSpan;
}
}
|
UTF-8
|
Java
| 2,561 |
java
|
TreeUtil.java
|
Java
|
[
{
"context": ".ArrayList;\nimport java.util.List;\n\n/**\n * @author ChenShuai\n * @date 2018/9/13 14:39\n */\npublic class TreeUti",
"end": 169,
"score": 0.9441800117492676,
"start": 160,
"tag": "NAME",
"value": "ChenShuai"
}
] | null |
[] |
package com.clancey.apollo.common.utils;
import com.clancey.apollo.common.base.LevelCode;
import java.util.ArrayList;
import java.util.List;
/**
* @author ChenShuai
* @date 2018/9/13 14:39
*/
public class TreeUtil {
/**
* 生成树
* @param array
* @param codeSpan
* @param <T>
* @return
*/
@SuppressWarnings("unchecked")
public static <T extends LevelCode> List<T> generateTree(List<T> array, final int codeSpan) {
if (array.isEmpty()) {
return new ArrayList<>();
}
//找出最短的合法levelCode长度
int codeStartLength = getMinimumCodeLength(array, codeSpan);
List<T> result = new ArrayList<>();
for (T t : array) {
String levelCode = t.getLevelCode();
if (levelCode.length() == codeStartLength) {
t.setChildren(generateChildren(array, levelCode, codeSpan));
result.add(t);
}
}
return result;
}
/**
* 生成子节点
* @param array
* @param levelCode
* @param codeSpan
* @param <T>
* @return
*/
@SuppressWarnings("unchecked")
private static <T extends LevelCode> List<T> generateChildren(List<T> array, String levelCode, final int codeSpan) {
List<T> result = new ArrayList<>();
for (T t : array) {
String tempLevelCode = t.getLevelCode();
if (tempLevelCode.startsWith(levelCode) && tempLevelCode.length() - levelCode.length() == codeSpan) {
t.setChildren(generateChildren(array, tempLevelCode, codeSpan));
result.add(t);
}
}
return result;
}
private static <T extends LevelCode> int getMinimumCodeLength(List<T> array, int codeSpan) {
int minimumCode = -1;
for (T t : array) {
int codeLength = t.getLevelCode().length();
//只处理满足levelCode层级要求的数据
if (codeLength % codeSpan != 0) {
continue;
}
//如果当前长度小于最小levelCode长度,则替换
if (codeLength < minimumCode) {
minimumCode = codeLength;
continue;
}
//如果当前的比对是初始值,则设置为最小值
if (minimumCode == -1) {
minimumCode = codeLength;
}
}
//最小的编码长度必须大于等于codeSpan
return minimumCode > codeSpan ? minimumCode : codeSpan;
}
}
| 2,561 | 0.55214 | 0.546323 | 82 | 28.353659 | 25.365797 | 120 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.390244 | false | false |
3
|
ad026a61739c3c7a7dbdda4a9fa70ad1cc4162ce
| 22,230,750,788,559 |
480c579af469c6d42607c73a7076c8101e6e7bca
|
/src/test/java/com/antti/task/unit/controller/item/BuilderTest.java
|
4dcdaa14ef79485780af7082eab98e9c512b1ff4
|
[] |
no_license
|
anttiranta/feeds-reader-java
|
https://github.com/anttiranta/feeds-reader-java
|
ac47be861eacb1500a421f02210feca0edf28440
|
c8d0f8599b199cd4abb7b06b6d66ced4914e9346
|
refs/heads/master
| 2020-12-07T22:26:12.152000 | 2020-07-23T18:25:02 | 2020-07-23T18:25:02 | 232,816,183 | 0 | 0 | null | false | 2020-10-13T18:44:38 | 2020-01-09T13:31:19 | 2020-07-23T18:25:20 | 2020-10-13T18:44:36 | 213 | 0 | 0 | 1 |
Java
| false | false |
package com.antti.task.unit.controller.item;
import java.util.Optional;
import javax.servlet.http.HttpServletRequest;
import org.junit.Test;
import static org.junit.Assert.*;
import com.antti.task.controller.item.Builder;
import com.antti.task.entity.Item;
import com.antti.task.repository.ItemRepository;
import org.junit.Before;
import static org.mockito.Mockito.*;
public class BuilderTest {
private ItemRepository itemRepository;
private HttpServletRequest request;
private Builder builder;
@Before
public void setUp(){
itemRepository = mock(ItemRepository.class);
request = mock(HttpServletRequest.class);
builder = new Builder(itemRepository);
}
@Test
public void testBuildWithProperId() {
Long itemId = Long.valueOf(1);
Item item = (new Item()).setId(itemId);
when(request.getParameter("id")).thenReturn(String.valueOf(itemId));
when(itemRepository.findById(itemId))
.thenReturn(Optional.of(item));
Item buildResult = builder.build(request);
assertEquals(
itemId,
buildResult.getId()
);
verify(request, times(2)).getParameter("id");
}
@Test
public void testBuildWithInvalidId() {
Long itemId = Long.valueOf(2);
Item item = new Item();
when(request.getParameter("id")).thenReturn(String.valueOf(itemId));
when(itemRepository.findById(itemId))
.thenReturn(Optional.of(item));
Item buildResult = builder.build(request);
assertEquals(
null,
buildResult.getId()
);
verify(request, times(2)).getParameter("id");
}
}
|
UTF-8
|
Java
| 1,791 |
java
|
BuilderTest.java
|
Java
|
[] | null |
[] |
package com.antti.task.unit.controller.item;
import java.util.Optional;
import javax.servlet.http.HttpServletRequest;
import org.junit.Test;
import static org.junit.Assert.*;
import com.antti.task.controller.item.Builder;
import com.antti.task.entity.Item;
import com.antti.task.repository.ItemRepository;
import org.junit.Before;
import static org.mockito.Mockito.*;
public class BuilderTest {
private ItemRepository itemRepository;
private HttpServletRequest request;
private Builder builder;
@Before
public void setUp(){
itemRepository = mock(ItemRepository.class);
request = mock(HttpServletRequest.class);
builder = new Builder(itemRepository);
}
@Test
public void testBuildWithProperId() {
Long itemId = Long.valueOf(1);
Item item = (new Item()).setId(itemId);
when(request.getParameter("id")).thenReturn(String.valueOf(itemId));
when(itemRepository.findById(itemId))
.thenReturn(Optional.of(item));
Item buildResult = builder.build(request);
assertEquals(
itemId,
buildResult.getId()
);
verify(request, times(2)).getParameter("id");
}
@Test
public void testBuildWithInvalidId() {
Long itemId = Long.valueOf(2);
Item item = new Item();
when(request.getParameter("id")).thenReturn(String.valueOf(itemId));
when(itemRepository.findById(itemId))
.thenReturn(Optional.of(item));
Item buildResult = builder.build(request);
assertEquals(
null,
buildResult.getId()
);
verify(request, times(2)).getParameter("id");
}
}
| 1,791 | 0.619766 | 0.617532 | 65 | 26.553846 | 19.414532 | 76 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.523077 | false | false |
3
|
77ce1757e53a4b0bbf031cfcb33f29131f0d8c54
| 26,173,530,760,831 |
4c9fb2fa41d1a21ccfe11e97408675e12d2c49e6
|
/Rider.java
|
34aca43ce1020d7e3f938c5aca493125d4ed6495
|
[] |
no_license
|
yuliya-kovalenko/motogp
|
https://github.com/yuliya-kovalenko/motogp
|
f27ee0ca7999e7b54915038b9d684ee0abef12f7
|
2791d5a72baac6f7fc5976d262ed1c8c9dba74a4
|
refs/heads/master
| 2020-06-24T11:17:08.415000 | 2019-08-13T05:54:43 | 2019-08-13T05:54:43 | 198,949,209 | 1 | 0 | null | false | 2019-08-13T05:54:44 | 2019-07-26T05:00:55 | 2019-08-11T22:04:26 | 2019-08-13T05:54:43 | 12 | 0 | 0 | 1 |
Java
| false | false |
public class Rider implements Comparable<Rider> {
String firstName;
String lastName;
int age;
int championships;
String nationality;
String placeOfBirth;
public Rider(String firstName, String lastName, int age, int championships,
String nationality, String placeOfBirth) {
this.firstName = firstName;
this.lastName = lastName;
this.age = age;
this.championships = championships;
this.nationality = nationality;
this.placeOfBirth = placeOfBirth;
}
public String getFirstName() {
return firstName;
}
public String getLastName() {
return lastName;
}
public int getAge() {
return age;
}
public int getChampionships() {
return championships;
}
public String getNationality() {
return nationality;
}
public String getPlaceOfBirth() {
return placeOfBirth;
}
public int compareTo(Rider anotherRider) {
return getLastName().compareTo(anotherRider.getLastName());
}
}
|
UTF-8
|
Java
| 919 |
java
|
Rider.java
|
Java
|
[
{
"context": "onality, String placeOfBirth) {\n\t\tthis.firstName = firstName;\n\t\tthis.lastName = lastName;\n\t\tthis.age = age;\n\t\t",
"end": 314,
"score": 0.9958038926124573,
"start": 305,
"tag": "NAME",
"value": "firstName"
},
{
"context": " {\n\t\tthis.firstName = firstName;\n\t\tthis.lastName = lastName;\n\t\tthis.age = age;\n\t\tthis.championships = champio",
"end": 342,
"score": 0.9936267137527466,
"start": 334,
"tag": "NAME",
"value": "lastName"
}
] | null |
[] |
public class Rider implements Comparable<Rider> {
String firstName;
String lastName;
int age;
int championships;
String nationality;
String placeOfBirth;
public Rider(String firstName, String lastName, int age, int championships,
String nationality, String placeOfBirth) {
this.firstName = firstName;
this.lastName = lastName;
this.age = age;
this.championships = championships;
this.nationality = nationality;
this.placeOfBirth = placeOfBirth;
}
public String getFirstName() {
return firstName;
}
public String getLastName() {
return lastName;
}
public int getAge() {
return age;
}
public int getChampionships() {
return championships;
}
public String getNationality() {
return nationality;
}
public String getPlaceOfBirth() {
return placeOfBirth;
}
public int compareTo(Rider anotherRider) {
return getLastName().compareTo(anotherRider.getLastName());
}
}
| 919 | 0.735582 | 0.735582 | 46 | 18.97826 | 17.925558 | 76 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.652174 | false | false |
3
|
5b5cceb12f62f05d3b65d51fb6a3cac298596c94
| 1,546,188,294,145 |
ae2c2ea06a5dd66837cde8bbb48575546a6c886d
|
/client/src/main/java/org/jivesoftware/phone/client/HangUpEvent.java
|
7b900dccfaa8ee926383af48a64dd14a2f4e6e49
|
[] |
no_license
|
carloca68/asterisk-im
|
https://github.com/carloca68/asterisk-im
|
ef5ebd5e74b063351dfea440234dbb33e8f231f8
|
c0c94e8e6d4e4d777f0dba2ff0781a7e489100a8
|
refs/heads/master
| 2021-01-21T15:31:27.389000 | 2015-07-01T11:16:12 | 2015-07-01T11:16:12 | 38,365,314 | 0 | 1 | null | true | 2015-07-01T10:33:03 | 2015-07-01T10:33:03 | 2015-01-14T20:12:10 | 2014-12-17T14:24:35 | 12,224 | 0 | 0 | 0 | null | null | null |
/**
* $RCSfile: HangUpEvent.java,v $
* $Revision: 1.5 $
* $Date: 2005/06/25 02:09:35 $
*
* Copyright (C) 1999-2004 Jive Software. All rights reserved.
*
* This software is the proprietary information of Jive Software. Use is subject to license terms.
*/
package org.jivesoftware.phone.client;
import org.jivesoftware.phone.client.event.PhoneEventPacketExtension;
/**
* Event is dispatched when the current xmpp user hangs up his phone
*
* @author Andrew Wright
*/
public class HangUpEvent extends PhoneEventPacketExtension {
public HangUpEvent(String callID, String device) {
super(callID, device);
}
/**
* Returns {@link EventStatus#HANG_UP}
*
* @return {@link EventStatus#HANG_UP}
*/
public EventStatus getEventStatus() {
return EventStatus.HANG_UP;
}
/**
* Always returns null, there is no child element for this event
*
* @return Returns null
*/
protected String getEventChildXML() {
return null;
}
}
|
UTF-8
|
Java
| 1,020 |
java
|
HangUpEvent.java
|
Java
|
[
{
"context": "current xmpp user hangs up his phone\n *\n * @author Andrew Wright\n */\npublic class HangUpEvent extends PhoneEventPa",
"end": 474,
"score": 0.9998440742492676,
"start": 461,
"tag": "NAME",
"value": "Andrew Wright"
}
] | null |
[] |
/**
* $RCSfile: HangUpEvent.java,v $
* $Revision: 1.5 $
* $Date: 2005/06/25 02:09:35 $
*
* Copyright (C) 1999-2004 Jive Software. All rights reserved.
*
* This software is the proprietary information of Jive Software. Use is subject to license terms.
*/
package org.jivesoftware.phone.client;
import org.jivesoftware.phone.client.event.PhoneEventPacketExtension;
/**
* Event is dispatched when the current xmpp user hangs up his phone
*
* @author <NAME>
*/
public class HangUpEvent extends PhoneEventPacketExtension {
public HangUpEvent(String callID, String device) {
super(callID, device);
}
/**
* Returns {@link EventStatus#HANG_UP}
*
* @return {@link EventStatus#HANG_UP}
*/
public EventStatus getEventStatus() {
return EventStatus.HANG_UP;
}
/**
* Always returns null, there is no child element for this event
*
* @return Returns null
*/
protected String getEventChildXML() {
return null;
}
}
| 1,013 | 0.659804 | 0.636275 | 44 | 22.181818 | 24.904612 | 98 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.204545 | false | false |
3
|
2c606b7a25dcac4a6869879c6b28c6c2707fcf9a
| 9,036,611,248,443 |
52790a2482187396c600e604567d0a1c2b36a581
|
/src/main/java/cn/com/myproject/learn/leetcode/editor/cn/FindTheDuplicateNumber.java
|
3d971a37d85ec01583dee963be93973ab3d6d32d
|
[
"Apache-2.0"
] |
permissive
|
liyang2012/qd
|
https://github.com/liyang2012/qd
|
f2deba3048e738aa30f0eda08a9a26ab0b987652
|
fe77cdbd38621d58ef7d27c40b82602a64f8f705
|
refs/heads/master
| 2023-07-14T20:17:42.030000 | 2023-06-27T10:41:16 | 2023-06-27T10:41:16 | 239,151,980 | 0 | 0 |
Apache-2.0
| false | 2023-06-14T22:25:41 | 2020-02-08T15:11:36 | 2022-02-09T06:32:58 | 2023-06-14T22:25:38 | 2,712 | 0 | 0 | 3 |
Java
| false | false |
//Given an array nums containing n + 1 integers where each integer is between 1
//and n (inclusive), prove that at least one duplicate number must exist. Assume t
//hat there is only one duplicate number, find the duplicate one.
//
// Example 1:
//
//
//Input: [1,3,4,2,2]
//Output: 2
//
//
// Example 2:
//
//
//Input: [3,1,3,4,2]
//Output: 3
//
// Note:
//
//
// You must not modify the array (assume the array is read only).
// You must use only constant, O(1) extra space.
// Your runtime complexity should be less than O(n2).
// There is only one duplicate number in the array, but it could be repeated mor
//e than once.
//
// Related Topics 数组 双指针 二分查找
package cn.com.myproject.learn.leetcode.editor.cn;
public class FindTheDuplicateNumber{
public static void main(String[] args) {
Solution solution = new FindTheDuplicateNumber().new Solution();
String s = new String("1");
s.intern();
}
//leetcode submit region begin(Prohibit modification and deletion)
class Solution {
/**
* 弗洛伊德的乌龟和兔子(循环检测)
* FIXME
* @param nums
* @return
*/
public int findDuplicate(int[] nums) {
int l = nums[0];
int r = nums[0];
do {
l = nums[l];
r = nums[nums[r]];
} while (l != r);
int p1 = nums[0];
int p2 = l;
while (p1 != p2) {
p1 = nums[p1];
p2 = nums[p2];
}
return p1;
}
/**
* 二分法
* @param nums
* @return
*/
public int findDuplicate1(int[] nums) {
int n = nums.length;
int l = 1, r = n - 1, ans = -1;
while (l <= r) {
int mid = (l + r) >> 1;
int cnt = 0;
for (int i = 0; i < n; ++i) {
if (nums[i] <= mid) {
cnt++;
}
}
if (cnt <= mid) {
l = mid + 1;
} else {
r = mid - 1;
ans = mid;
}
}
return ans;
}
/***
* 二进制
* @param nums
* @return
*/
public int findDuplicate2(int[] nums) {
int n = nums.length, ans = 0;
int bit_max = 31;
while (((n - 1) >> bit_max) == 0) {
bit_max -= 1;
}
for (int bit = 0; bit <= bit_max; ++bit) {
int x = 0, y = 0;
for (int i = 0; i < n; ++i) {
if ((nums[i] & (1 << bit)) != 0) {
x += 1;
}
if (i >= 1 && ((i & (1 << bit)) != 0)) {
y += 1;
}
}
if (x > y) {
ans |= 1 << bit;
}
}
return ans;
}
}
//leetcode submit region end(Prohibit modification and deletion)
}
|
UTF-8
|
Java
| 3,191 |
java
|
FindTheDuplicateNumber.java
|
Java
|
[] | null |
[] |
//Given an array nums containing n + 1 integers where each integer is between 1
//and n (inclusive), prove that at least one duplicate number must exist. Assume t
//hat there is only one duplicate number, find the duplicate one.
//
// Example 1:
//
//
//Input: [1,3,4,2,2]
//Output: 2
//
//
// Example 2:
//
//
//Input: [3,1,3,4,2]
//Output: 3
//
// Note:
//
//
// You must not modify the array (assume the array is read only).
// You must use only constant, O(1) extra space.
// Your runtime complexity should be less than O(n2).
// There is only one duplicate number in the array, but it could be repeated mor
//e than once.
//
// Related Topics 数组 双指针 二分查找
package cn.com.myproject.learn.leetcode.editor.cn;
public class FindTheDuplicateNumber{
public static void main(String[] args) {
Solution solution = new FindTheDuplicateNumber().new Solution();
String s = new String("1");
s.intern();
}
//leetcode submit region begin(Prohibit modification and deletion)
class Solution {
/**
* 弗洛伊德的乌龟和兔子(循环检测)
* FIXME
* @param nums
* @return
*/
public int findDuplicate(int[] nums) {
int l = nums[0];
int r = nums[0];
do {
l = nums[l];
r = nums[nums[r]];
} while (l != r);
int p1 = nums[0];
int p2 = l;
while (p1 != p2) {
p1 = nums[p1];
p2 = nums[p2];
}
return p1;
}
/**
* 二分法
* @param nums
* @return
*/
public int findDuplicate1(int[] nums) {
int n = nums.length;
int l = 1, r = n - 1, ans = -1;
while (l <= r) {
int mid = (l + r) >> 1;
int cnt = 0;
for (int i = 0; i < n; ++i) {
if (nums[i] <= mid) {
cnt++;
}
}
if (cnt <= mid) {
l = mid + 1;
} else {
r = mid - 1;
ans = mid;
}
}
return ans;
}
/***
* 二进制
* @param nums
* @return
*/
public int findDuplicate2(int[] nums) {
int n = nums.length, ans = 0;
int bit_max = 31;
while (((n - 1) >> bit_max) == 0) {
bit_max -= 1;
}
for (int bit = 0; bit <= bit_max; ++bit) {
int x = 0, y = 0;
for (int i = 0; i < n; ++i) {
if ((nums[i] & (1 << bit)) != 0) {
x += 1;
}
if (i >= 1 && ((i & (1 << bit)) != 0)) {
y += 1;
}
}
if (x > y) {
ans |= 1 << bit;
}
}
return ans;
}
}
//leetcode submit region end(Prohibit modification and deletion)
}
| 3,191 | 0.39821 | 0.379354 | 122 | 24.655737 | 19.47961 | 82 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.442623 | false | false |
3
|
722cf924a70fc3d51c437f8b9f9bf8fab98b93b5
| 7,292,854,527,079 |
5f870690cb5b13c3afb363f606ef4b4680a2e263
|
/valamis-lrs-tincan/src/main/java/com/arcusys/valamis/lrs/util/Nameprep.java
|
e33d23283dc9a7ec1b0444197291b13b44732691
|
[] |
no_license
|
robcanini/valamis-lrs
|
https://github.com/robcanini/valamis-lrs
|
1cac60c468c513166e8fda7299ce2ca7cdc6fd8c
|
748795315fe530a56a611effd691763e331f59c9
|
refs/heads/master
| 2021-06-19T15:13:03.701000 | 2017-07-27T08:19:18 | 2017-07-27T08:19:18 | 118,146,959 | 1 | 0 | null | true | 2018-01-19T16:07:34 | 2018-01-19T16:07:34 | 2017-04-21T09:22:59 | 2017-07-27T08:19:18 | 564 | 0 | 0 | 0 | null | false | null |
package com.arcusys.valamis.lrs.util;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. The ASF licenses this file to You
* under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License. For additional information regarding
* copyright in this work, please see the NOTICE file in the top level
* directory of this distribution.
*/
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.BitSet;
/**
* Implements the Nameprep protocol
*/
public class Nameprep {
public static String prep(String s, boolean allowunassigned) {
NameprepCodepointIterator r = null;
try {
StringBuffer buf = new StringBuffer();
CodepointIterator ci = CodepointIterator.forCharSequence(s);
r = new NameprepCodepointIterator(ci, allowunassigned);
while (r.hasNext()) {
int i = r.next();
if (i != -1)
buf.append((char) i);
}
return Normalizer.normalize(buf.toString(), Normalizer.Form.KC).toString();
} catch (Throwable e) {
throw new RuntimeException(e);
}
}
public static String prep(String s) {
return prep(s, false);
}
public static final BitSet B1 = new ChainableBitSet()
.set2('\u00AD', '\u034F', '\u1806', '\u180B', '\u180C', '\u180D', '\u200B',
'\u200C', '\u200D', '\u2060', '\uFE00', '\uFE01', '\uFE02', '\uFE03',
'\uFE04', '\uFE05', '\uFE06', '\uFE07', '\uFE08', '\uFE09', '\uFE0A',
'\uFE0B', '\uFE0C', '\uFE0D', '\uFE0E', '\uFE0F', '\uFEFF',
// Not listed in B1, but treated as map-to-nothing by others
0x8F, 0xA0, 0x86, 0x8b, 0x80, 0x81, 0x88
);
public static final int[][] B2 = loadb2();
public static final int[] B2(int c) {
return (B2[c] != null) ? B2[c] : null;
}
private static int[] parse(String rep) {
String[] tokens = rep.trim().split(" ");
int[] i = new int[tokens.length];
for (int n = 0; n < tokens.length; n++) {
i[n] = Integer.parseInt(tokens[n], 16);
}
return i;
}
private static final String B2DAT = "/org/apache/abdera/util/iri/data/B2.dat";
public static int[][] loadb2() {
int[][] map = new int[120764][];
try {
InputStream in = Nameprep.class.getResourceAsStream(B2DAT);
InputStreamReader rdr = new InputStreamReader(in);
BufferedReader bufr = new BufferedReader(rdr);
String line = null;
while ((line = bufr.readLine()) != null) {
String[] tokens = line.trim().split("\\s*;\\s*");
int n = Integer.parseInt(tokens[0], 16);
int[] i = parse(tokens[1]);
map[n] = i;
}
} catch (IOException e) {
}
return map;
}
public static final BitSet UNASSIGNED = new ChainableBitSet()
.set2('\u0221')
.set2('\u0234', '\u024F')
.set2('\u02AE', '\u02AF')
.set2('\u02EF', '\u02FF')
.set2('\u0350', '\u035F')
.set2('\u0370', '\u0373')
.set2('\u0376', '\u0379')
.set2('\u037B', '\u037D')
.set2('\u037F', '\u0383')
.set2('\u038B')
.set2('\u038D')
.set2('\u03A2')
.set2('\u03CF')
.set2('\u03F7', '\u03FF')
.set2('\u0487')
.set2('\u04CF')
.set2('\u04F6', '\u04F7')
.set2('\u04FA', '\u04FF')
.set2('\u0510', '\u0530')
.set2('\u0557', '\u0558')
.set2('\u0560')
.set2('\u0588')
.set2('\u058B', '\u0590')
.set2('\u05A2')
.set2('\u05BA')
.set2('\u05C5', '\u05CF')
.set2('\u05EB', '\u05EF')
.set2('\u05F5', '\u060B')
.set2('\u060D', '\u061A')
.set2('\u061C', '\u061E')
.set2('\u0620')
.set2('\u063B', '\u063F')
.set2('\u0656', '\u065F')
.set2('\u06EE', '\u06EF')
.set2('\u06FF')
.set2('\u070E')
.set2('\u072D', '\u072F')
.set2('\u074B', '\u077F')
.set2('\u07B2', '\u0900')
.set2('\u0904')
.set2('\u093A', '\u093B')
.set2('\u094E', '\u094F')
.set2('\u0955', '\u0957')
.set2('\u0971', '\u0980')
.set2('\u0984')
.set2('\u098D', '\u098E')
.set2('\u0991', '\u0992')
.set2('\u09A9')
.set2('\u09B1')
.set2('\u09B3', '\u09B5')
.set2('\u09BA', '\u09BB')
.set2('\u09BD')
.set2('\u09C5', '\u09C6')
.set2('\u09C9', '\u09CA')
.set2('\u09CE', '\u09D6')
.set2('\u09D8', '\u09DB')
.set2('\u09DE')
.set2('\u09E4', '\u09E5')
.set2('\u09FB', '\u0A01')
.set2('\u0A03', '\u0A04')
.set2('\u0A0B', '\u0A0E')
.set2('\u0A11', '\u0A12')
.set2('\u0A29')
.set2('\u0A31')
.set2('\u0A34')
.set2('\u0A37')
.set2('\u0A3A', '\u0A3B')
.set2('\u0A3D')
.set2('\u0A43', '\u0A46')
.set2('\u0A49', '\u0A4A')
.set2('\u0A4E', '\u0A58')
.set2('\u0A5D')
.set2('\u0A5F', '\u0A65')
.set2('\u0A75', '\u0A80')
.set2('\u0A84')
.set2('\u0A8C')
.set2('\u0A8E')
.set2('\u0A92')
.set2('\u0AA9')
.set2('\u0AB1')
.set2('\u0AB4')
.set2('\u0ABA', '\u0ABB')
.set2('\u0AC6')
.set2('\u0ACA')
.set2('\u0ACE', '\u0ACF')
.set2('\u0AD1', '\u0ADF')
.set2('\u0AE1', '\u0AE5')
.set2('\u0AF0', '\u0B00')
.set2('\u0B04')
.set2('\u0B0D', '\u0B0E')
.set2('\u0B11', '\u0B12')
.set2('\u0B29')
.set2('\u0B31')
.set2('\u0B34', '\u0B35')
.set2('\u0B3A', '\u0B3B')
.set2('\u0B44', '\u0B46')
.set2('\u0B49', '\u0B4A')
.set2('\u0B4E', '\u0B55')
.set2('\u0B58', '\u0B5B')
.set2('\u0B5E')
.set2('\u0B62', '\u0B65')
.set2('\u0B71', '\u0B81')
.set2('\u0B84')
.set2('\u0B8B', '\u0B8D')
.set2('\u0B91')
.set2('\u0B96', '\u0B98')
.set2('\u0B9B')
.set2('\u0B9D')
.set2('\u0BA0', '\u0BA2')
.set2('\u0BA5', '\u0BA7')
.set2('\u0BAB', '\u0BAD')
.set2('\u0BB6')
.set2('\u0BBA', '\u0BBD')
.set2('\u0BC3', '\u0BC5')
.set2('\u0BC9')
.set2('\u0BCE', '\u0BD6')
.set2('\u0BD8', '\u0BE6')
.set2('\u0BF3', '\u0C00')
.set2('\u0C04')
.set2('\u0C0D')
.set2('\u0C11')
.set2('\u0C29')
.set2('\u0C34')
.set2('\u0C3A', '\u0C3D')
.set2('\u0C45')
.set2('\u0C49')
.set2('\u0C4E', '\u0C54')
.set2('\u0C57', '\u0C5F')
.set2('\u0C62', '\u0C65')
.set2('\u0C70', '\u0C81')
.set2('\u0C84')
.set2('\u0C8D')
.set2('\u0C91')
.set2('\u0CA9')
.set2('\u0CB4')
.set2('\u0CBA', '\u0CBD')
.set2('\u0CC5')
.set2('\u0CC9')
.set2('\u0CCE', '\u0CD4')
.set2('\u0CD7', '\u0CDD')
.set2('\u0CDF')
.set2('\u0CE2', '\u0CE5')
.set2('\u0CF0', '\u0D01')
.set2('\u0D04')
.set2('\u0D0D')
.set2('\u0D11')
.set2('\u0D29')
.set2('\u0D3A', '\u0D3D')
.set2('\u0D44', '\u0D45')
.set2('\u0D49')
.set2('\u0D4E', '\u0D56')
.set2('\u0D58', '\u0D5F')
.set2('\u0D62', '\u0D65')
.set2('\u0D70', '\u0D81')
.set2('\u0D84')
.set2('\u0D97', '\u0D99')
.set2('\u0DB2')
.set2('\u0DBC')
.set2('\u0DBE', '\u0DBF')
.set2('\u0DC7', '\u0DC9')
.set2('\u0DCB', '\u0DCE')
.set2('\u0DD5')
.set2('\u0DD7')
.set2('\u0DE0', '\u0DF1')
.set2('\u0DF5', '\u0E00')
.set2('\u0E3B', '\u0E3E')
.set2('\u0E5C', '\u0E80')
.set2('\u0E83')
.set2('\u0E85', '\u0E86')
.set2('\u0E89')
.set2('\u0E8B', '\u0E8C')
.set2('\u0E8E', '\u0E93')
.set2('\u0E98')
.set2('\u0EA0')
.set2('\u0EA4')
.set2('\u0EA6')
.set2('\u0EA8', '\u0EA9')
.set2('\u0EAC')
.set2('\u0EBA')
.set2('\u0EBE', '\u0EBF')
.set2('\u0EC5')
.set2('\u0EC7')
.set2('\u0ECE', '\u0ECF')
.set2('\u0EDA', '\u0EDB')
.set2('\u0EDE', '\u0EFF')
.set2('\u0F48')
.set2('\u0F6B', '\u0F70')
.set2('\u0F8C', '\u0F8F')
.set2('\u0F98')
.set2('\u0FBD')
.set2('\u0FCD', '\u0FCE')
.set2('\u0FD0', '\u0FFF')
.set2('\u1022')
.set2('\u1028')
.set2('\u102B')
.set2('\u1033', '\u1035')
.set2('\u103A', '\u103F')
.set2('\u105A', '\u109F')
.set2('\u10C6', '\u10CF')
.set2('\u10F9', '\u10FA')
.set2('\u10FC', '\u10FF')
.set2('\u115A', '\u115E')
.set2('\u11A3', '\u11A7')
.set2('\u11FA', '\u11FF')
.set2('\u1207')
.set2('\u1247')
.set2('\u1249')
.set2('\u124E', '\u124F')
.set2('\u1257')
.set2('\u1259')
.set2('\u125E', '\u125F')
.set2('\u1287')
.set2('\u1289')
.set2('\u128E', '\u128F')
.set2('\u12AF')
.set2('\u12B1')
.set2('\u12B6', '\u12B7')
.set2('\u12BF')
.set2('\u12C1')
.set2('\u12C6', '\u12C7')
.set2('\u12CF')
.set2('\u12D7')
.set2('\u12EF')
.set2('\u130F')
.set2('\u1311')
.set2('\u1316', '\u1317')
.set2('\u131F')
.set2('\u1347')
.set2('\u135B', '\u1360')
.set2('\u137D', '\u139F')
.set2('\u13F5', '\u1400')
.set2('\u1677', '\u167F')
.set2('\u169D', '\u169F')
.set2('\u16F1', '\u16FF')
.set2('\u170D')
.set2('\u1715', '\u171F')
.set2('\u1737', '\u173F')
.set2('\u1754', '\u175F')
.set2('\u176D')
.set2('\u1771')
.set2('\u1774', '\u177F')
.set2('\u17DD', '\u17DF')
.set2('\u17EA', '\u17FF')
.set2('\u180F')
.set2('\u181A', '\u181F')
.set2('\u1878', '\u187F')
.set2('\u18AA', '\u1DFF')
.set2('\u1E9C', '\u1E9F')
.set2('\u1EFA', '\u1EFF')
.set2('\u1F16', '\u1F17')
.set2('\u1F1E', '\u1F1F')
.set2('\u1F46', '\u1F47')
.set2('\u1F4E', '\u1F4F')
.set2('\u1F58')
.set2('\u1F5A')
.set2('\u1F5C')
.set2('\u1F5E')
.set2('\u1F7E', '\u1F7F')
.set2('\u1FB5')
.set2('\u1FC5')
.set2('\u1FD4', '\u1FD5')
.set2('\u1FDC')
.set2('\u1FF0', '\u1FF1')
.set2('\u1FF5')
.set2('\u1FFF')
.set2('\u2053', '\u2056')
.set2('\u2058', '\u205E')
.set2('\u2064', '\u2069')
.set2('\u2072', '\u2073')
.set2('\u208F', '\u209F')
.set2('\u20B2', '\u20CF')
.set2('\u20EB', '\u20FF')
.set2('\u213B', '\u213C')
.set2('\u214C', '\u2152')
.set2('\u2184', '\u218F')
.set2('\u23CF', '\u23FF')
.set2('\u2427', '\u243F')
.set2('\u244B', '\u245F')
.set2('\u24FF')
.set2('\u2614', '\u2615')
.set2('\u2618')
.set2('\u267E', '\u267F')
.set2('\u268A', '\u2700')
.set2('\u2705')
.set2('\u270A', '\u270B')
.set2('\u2728')
.set2('\u274C')
.set2('\u274E')
.set2('\u2753', '\u2755')
.set2('\u2757')
.set2('\u275F', '\u2760')
.set2('\u2795', '\u2797')
.set2('\u27B0')
.set2('\u27BF', '\u27CF')
.set2('\u27EC', '\u27EF')
.set2('\u2B00', '\u2E7F')
.set2('\u2E9A')
.set2('\u2EF4', '\u2EFF')
.set2('\u2FD6', '\u2FEF')
.set2('\u2FFC', '\u2FFF')
.set2('\u3040')
.set2('\u3097', '\u3098')
.set2('\u3100', '\u3104')
.set2('\u312D', '\u3130')
.set2('\u318F')
.set2('\u31B8', '\u31EF')
.set2('\u321D', '\u321F')
.set2('\u3244', '\u3250')
.set2('\u327C', '\u327E')
.set2('\u32CC', '\u32CF')
.set2('\u32FF')
.set2('\u3377', '\u337A')
.set2('\u33DE', '\u33DF')
.set2('\u33FF')
.set2('\u4DB6', '\u4DFF')
.set2('\u9FA6', '\u9FFF')
.set2('\uA48D', '\uA48F')
.set2('\uA4C7', '\uABFF')
.set2('\uD7A4', '\uD7FF')
.set2('\uFA2E', '\uFA2F')
.set2('\uFA6B', '\uFAFF')
.set2('\uFB07', '\uFB12')
.set2('\uFB18', '\uFB1C')
.set2('\uFB37')
.set2('\uFB3D')
.set2('\uFB3F')
.set2('\uFB42')
.set2('\uFB45')
.set2('\uFBB2', '\uFBD2')
.set2('\uFD40', '\uFD4F')
.set2('\uFD90', '\uFD91')
.set2('\uFDC8', '\uFDCF')
.set2('\uFDFD', '\uFDFF')
.set2('\uFE10', '\uFE1F')
.set2('\uFE24', '\uFE2F')
.set2('\uFE47', '\uFE48')
.set2('\uFE53')
.set2('\uFE67')
.set2('\uFE6C', '\uFE6F')
.set2('\uFE75')
.set2('\uFEFD', '\uFEFE')
.set2('\uFF00')
.set2('\uFFBF', '\uFFC1')
.set2('\uFFC8', '\uFFC9')
.set2('\uFFD0', '\uFFD1')
.set2('\uFFD8', '\uFFD9')
.set2('\uFFDD', '\uFFDF')
.set2('\uFFE7')
.set2('\uFFEF', '\uFFF8')
.set2(0x10000, 0x102FF)
.set2(0x1031F)
.set2(0x10324, 0x1032F)
.set2(0x1034B, 0x103FF)
.set2(0x10426, 0x10427)
.set2(0x1044E, 0x1CFFF)
.set2(0x1D0F6, 0x1D0FF)
.set2(0x1D127, 0x1D129)
.set2(0x1D1DE, 0x1D3FF)
.set2(0x1D455)
.set2(0x1D49D)
.set2(0x1D4A0, 0x1D4A1)
.set2(0x1D4A3, 0x1D4A4)
.set2(0x1D4A7, 0x1D4A8)
.set2(0x1D4AD)
.set2(0x1D4BA)
.set2(0x1D4BC)
.set2(0x1D4C1)
.set2(0x1D4C4)
.set2(0x1D506)
.set2(0x1D50B, 0x1D50C)
.set2(0x1D515)
.set2(0x1D51D)
.set2(0x1D53A)
.set2(0x1D53F)
.set2(0x1D545)
.set2(0x1D547, 0x1D549)
.set2(0x1D551)
.set2(0x1D6A4, 0x1D6A7)
.set2(0x1D7CA, 0x1D7CD)
.set2(0x1D800, 0x1FFFD)
.set2(0x2A6D7, 0x2F7FF)
.set2(0x2FA1E, 0x2FFFD)
.set2(0x30000, 0x3FFFD)
.set2(0x40000, 0x4FFFD)
.set2(0x50000, 0x5FFFD)
.set2(0x60000, 0x6FFFD)
.set2(0x70000, 0x7FFFD)
.set2(0x80000, 0x8FFFD)
.set2(0x90000, 0x9FFFD)
.set2(0xA0000, 0xAFFFD)
.set2(0xB0000, 0xBFFFD)
.set2(0xC0000, 0xCFFFD)
.set2(0xD0000, 0xDFFFD)
.set2(0xE0000)
.set2(0xE0002, 0xE001F)
.set2(0xE0080, 0xEFFFD);
public static final ChainableBitSet PROHIBITED = new ChainableBitSet()
// c.1.2
.set2('\u00A0').set2('\u1680').set2('\u2000', '\u200B')
.set2('\u202F').set2('\u205F').set2('\u3000')
// c.2.2
.set2('\u0080', '\u009F').set2('\u06DD').set2('\u070F')
.set2('\u180E').set2('\u200C').set2('\u200D').set2('\u2028')
.set2('\u2029').set2('\u2060').set2('\u2061').set2('\u2062')
.set2('\u2063').set2('\u206A', '\u206F').set2('\uFEFF')
.set2('\uFFF9', '\uFFFC').set2(0x1D173, 0x1D17A)
// c.3
.set2('\uE000', '\uF8FF').set2(0xF0000, 0xFFFFD).set2(0x100000, 0x10FFFD)
// c.4
.set2('\uFDD0', '\uFDEF').set2('\uFFFE', '\uFFFF').set2(0x1FFFE, 0x1FFFF)
.set2(0x2FFFE, 0x2FFFF).set2(0x3FFFE, 0x3FFFF).set2(0x4FFFE, 0x4FFFF)
.set2(0x5FFFE, 0x5FFFF).set2(0x6FFFE, 0x6FFFF).set2(0x7FFFE, 0x7FFFF)
.set2(0x8FFFE, 0x8FFFF).set2(0x9FFFE, 0x9FFFF).set2(0xAFFFE, 0xAFFFF)
.set2(0xBFFFE, 0xBFFFF).set2(0xCFFFE, 0xCFFFF).set2(0xDFFFE, 0xDFFFF)
.set2(0xEFFFE, 0xEFFFF).set2(0xFFFFE, 0xFFFFF).set2(0x10FFFE, 0x10FFFF)
// c.5
.set2('\uD800', '\uDFFF')
// c.6
.set2('\uFFF9', '\uFFFD')
// c.7
.set2('\u2FF0', '\u2FFB')
// c.8
.set2('\u0340').set2('\u0341').set2('\u200E')
.set2('\u200F').set2('\u202A').set2('\u202B')
.set2('\u202C').set2('\u202D').set2('\u202E')
.set2('\u206A').set2('\u206B').set2('\u206C')
.set2('\u206D').set2('\u206E').set2('\u206F')
// c.9
.set2(0xE0001).set2(0xE0020, 0xE007F)
// unassigned
.set2(UNASSIGNED);
public static final BitSet RandAL = new ChainableBitSet()
.set2('\u05BE').set2('\u05C0').set2('\u05C3')
.set2('\u05D0', '\u05EA').set2('\u05F0', '\u05F4')
.set2('\u061B').set2('\u061F').set2('\u0621', '\u063A')
.set2('\u0640', '\u064A').set2('\u066D', '\u066F').set2('\u0671', '\u06D5')
.set2('\u06DD').set2('\u06E5', '\u06E6').set2('\u06FA', '\u06FE')
.set2('\u0700', '\u070D').set2('\u0710').set2('\u0712', '\u072C')
.set2('\u0780', '\u07A5').set2('\u07B1').set2('\u200F')
.set2('\uFB1D').set2('\uFB1F', '\uFB28').set2('\uFB2A', '\uFB36')
.set2('\uFB38', '\uFB3C').set2('\uFB3E').set2('\uFB40', '\uFB41')
.set2('\uFB43', '\uFB44').set2('\uFB46', '\uFBB1').set2('\uFBD3', '\uFD3D')
.set2('\uFD50', '\uFD8F').set2('\uFD92', '\uFDC7').set2('\uFDF0', '\uFDFC')
.set2('\uFE70', '\uFE74').set2('\uFE76', '\uFEFC');
public static final BitSet LCat = new ChainableBitSet()
.set2('\u0041', '\u005A')
.set2('\u0061', '\u007A')
.set2('\u00AA')
.set2('\u00B5')
.set2('\u00BA')
.set2('\u00C0', '\u00D6')
.set2('\u00D8', '\u00F6')
.set2('\u00F8', '\u0220')
.set2('\u0222', '\u0233')
.set2('\u0250', '\u02AD')
.set2('\u02B0', '\u02B8')
.set2('\u02BB', '\u02C1')
.set2('\u02D0', '\u02D1')
.set2('\u02E0', '\u02E4')
.set2('\u02EE')
.set2('\u037A')
.set2('\u0386')
.set2('\u0388', '\u038A')
.set2('\u038C')
.set2('\u038E', '\u03A1')
.set2('\u03A3', '\u03CE')
.set2('\u03D0', '\u03F5')
.set2('\u0400', '\u0482')
.set2('\u048A', '\u04CE')
.set2('\u04D0', '\u04F5')
.set2('\u04F8', '\u04F9')
.set2('\u0500', '\u050F')
.set2('\u0531', '\u0556')
.set2('\u0559', '\u055F')
.set2('\u0561', '\u0587')
.set2('\u0589')
.set2('\u0903')
.set2('\u0905', '\u0939')
.set2('\u093D', '\u0940')
.set2('\u0949', '\u094C')
.set2('\u0950')
.set2('\u0958', '\u0961')
.set2('\u0964', '\u0970')
.set2('\u0982', '\u0983')
.set2('\u0985', '\u098C')
.set2('\u098F', '\u0990')
.set2('\u0993', '\u09A8')
.set2('\u09AA', '\u09B0')
.set2('\u09B2')
.set2('\u09B6', '\u09B9')
.set2('\u09BE', '\u09C0')
.set2('\u09C7', '\u09C8')
.set2('\u09CB', '\u09CC')
.set2('\u09D7')
.set2('\u09DC', '\u09DD')
.set2('\u09DF', '\u09E1')
.set2('\u09E6', '\u09F1')
.set2('\u09F4', '\u09FA')
.set2('\u0A05', '\u0A0A')
.set2('\u0A0F', '\u0A10')
.set2('\u0A13', '\u0A28')
.set2('\u0A2A', '\u0A30')
.set2('\u0A32', '\u0A33')
.set2('\u0A35', '\u0A36')
.set2('\u0A38', '\u0A39')
.set2('\u0A3E', '\u0A40')
.set2('\u0A59', '\u0A5C')
.set2('\u0A5E')
.set2('\u0A66', '\u0A6F')
.set2('\u0A72', '\u0A74')
.set2('\u0A83')
.set2('\u0A85', '\u0A8B')
.set2('\u0A8D')
.set2('\u0A8F', '\u0A91')
.set2('\u0A93', '\u0AA8')
.set2('\u0AAA', '\u0AB0')
.set2('\u0AB2', '\u0AB3')
.set2('\u0AB5', '\u0AB9')
.set2('\u0ABD', '\u0AC0')
.set2('\u0AC9')
.set2('\u0ACB', '\u0ACC')
.set2('\u0AD0')
.set2('\u0AE0')
.set2('\u0AE6', '\u0AEF')
.set2('\u0B02', '\u0B03')
.set2('\u0B05', '\u0B0C')
.set2('\u0B0F', '\u0B10')
.set2('\u0B13', '\u0B28')
.set2('\u0B2A', '\u0B30')
.set2('\u0B32', '\u0B33')
.set2('\u0B36', '\u0B39')
.set2('\u0B3D', '\u0B3E')
.set2('\u0B40')
.set2('\u0B47', '\u0B48')
.set2('\u0B4B', '\u0B4C')
.set2('\u0B57')
.set2('\u0B5C', '\u0B5D')
.set2('\u0B5F', '\u0B61')
.set2('\u0B66', '\u0B70')
.set2('\u0B83')
.set2('\u0B85', '\u0B8A')
.set2('\u0B8E', '\u0B90')
.set2('\u0B92', '\u0B95')
.set2('\u0B99', '\u0B9A')
.set2('\u0B9C')
.set2('\u0B9E', '\u0B9F')
.set2('\u0BA3', '\u0BA4')
.set2('\u0BA8', '\u0BAA')
.set2('\u0BAE', '\u0BB5')
.set2('\u0BB7', '\u0BB9')
.set2('\u0BBE', '\u0BBF')
.set2('\u0BC1', '\u0BC2')
.set2('\u0BC6', '\u0BC8')
.set2('\u0BCA', '\u0BCC')
.set2('\u0BD7')
.set2('\u0BE7', '\u0BF2')
.set2('\u0C01', '\u0C03')
.set2('\u0C05', '\u0C0C')
.set2('\u0C0E', '\u0C10')
.set2('\u0C12', '\u0C28')
.set2('\u0C2A', '\u0C33')
.set2('\u0C35', '\u0C39')
.set2('\u0C41', '\u0C44')
.set2('\u0C60', '\u0C61')
.set2('\u0C66', '\u0C6F')
.set2('\u0C82', '\u0C83')
.set2('\u0C85', '\u0C8C')
.set2('\u0C8E', '\u0C90')
.set2('\u0C92', '\u0CA8')
.set2('\u0CAA', '\u0CB3')
.set2('\u0CB5', '\u0CB9')
.set2('\u0CBE')
.set2('\u0CC0', '\u0CC4')
.set2('\u0CC7', '\u0CC8')
.set2('\u0CCA', '\u0CCB')
.set2('\u0CD5', '\u0CD6')
.set2('\u0CDE')
.set2('\u0CE0', '\u0CE1')
.set2('\u0CE6', '\u0CEF')
.set2('\u0D02', '\u0D03')
.set2('\u0D05', '\u0D0C')
.set2('\u0D0E', '\u0D10')
.set2('\u0D12', '\u0D28')
.set2('\u0D2A', '\u0D39')
.set2('\u0D3E', '\u0D40')
.set2('\u0D46', '\u0D48')
.set2('\u0D4A', '\u0D4C')
.set2('\u0D57')
.set2('\u0D60', '\u0D61')
.set2('\u0D66', '\u0D6F')
.set2('\u0D82', '\u0D83')
.set2('\u0D85', '\u0D96')
.set2('\u0D9A', '\u0DB1')
.set2('\u0DB3', '\u0DBB')
.set2('\u0DBD')
.set2('\u0DC0', '\u0DC6')
.set2('\u0DCF', '\u0DD1')
.set2('\u0DD8', '\u0DDF')
.set2('\u0DF2', '\u0DF4')
.set2('\u0E01', '\u0E30')
.set2('\u0E32', '\u0E33')
.set2('\u0E40', '\u0E46')
.set2('\u0E4F', '\u0E5B')
.set2('\u0E81', '\u0E82')
.set2('\u0E84')
.set2('\u0E87', '\u0E88')
.set2('\u0E8A')
.set2('\u0E8D')
.set2('\u0E94', '\u0E97')
.set2('\u0E99', '\u0E9F')
.set2('\u0EA1', '\u0EA3')
.set2('\u0EA5')
.set2('\u0EA7')
.set2('\u0EAA', '\u0EAB')
.set2('\u0EAD', '\u0EB0')
.set2('\u0EB2', '\u0EB3')
.set2('\u0EBD')
.set2('\u0EC0', '\u0EC4')
.set2('\u0EC6')
.set2('\u0ED0', '\u0ED9')
.set2('\u0EDC', '\u0EDD')
.set2('\u0F00', '\u0F17')
.set2('\u0F1A', '\u0F34')
.set2('\u0F36')
.set2('\u0F38')
.set2('\u0F3E', '\u0F47')
.set2('\u0F49', '\u0F6A')
.set2('\u0F7F')
.set2('\u0F85')
.set2('\u0F88', '\u0F8B')
.set2('\u0FBE', '\u0FC5')
.set2('\u0FC7', '\u0FCC')
.set2('\u0FCF')
.set2('\u1000', '\u1021')
.set2('\u1023', '\u1027')
.set2('\u1029', '\u102A')
.set2('\u102C')
.set2('\u1031')
.set2('\u1038')
.set2('\u1040', '\u1057')
.set2('\u10A0', '\u10C5')
.set2('\u10D0', '\u10F8')
.set2('\u10FB')
.set2('\u1100', '\u1159')
.set2('\u115F', '\u11A2')
.set2('\u11A8', '\u11F9')
.set2('\u1200', '\u1206')
.set2('\u1208', '\u1246')
.set2('\u1248')
.set2('\u124A', '\u124D')
.set2('\u1250', '\u1256')
.set2('\u1258')
.set2('\u125A', '\u125D')
.set2('\u1260', '\u1286')
.set2('\u1288')
.set2('\u128A', '\u128D')
.set2('\u1290', '\u12AE')
.set2('\u12B0')
.set2('\u12B2', '\u12B5')
.set2('\u12B8', '\u12BE')
.set2('\u12C0')
.set2('\u12C2', '\u12C5')
.set2('\u12C8', '\u12CE')
.set2('\u12D0', '\u12D6')
.set2('\u12D8', '\u12EE')
.set2('\u12F0', '\u130E')
.set2('\u1310')
.set2('\u1312', '\u1315')
.set2('\u1318', '\u131E')
.set2('\u1320', '\u1346')
.set2('\u1348', '\u135A')
.set2('\u1361', '\u137C')
.set2('\u13A0', '\u13F4')
.set2('\u1401', '\u1676')
.set2('\u1681', '\u169A')
.set2('\u16A0', '\u16F0')
.set2('\u1700', '\u170C')
.set2('\u170E', '\u1711')
.set2('\u1720', '\u1731')
.set2('\u1735', '\u1736')
.set2('\u1740', '\u1751')
.set2('\u1760', '\u176C')
.set2('\u176E', '\u1770')
.set2('\u1780', '\u17B6')
.set2('\u17BE', '\u17C5')
.set2('\u17C7', '\u17C8')
.set2('\u17D4', '\u17DA')
.set2('\u17DC')
.set2('\u17E0', '\u17E9')
.set2('\u1810', '\u1819')
.set2('\u1820', '\u1877')
.set2('\u1880', '\u18A8')
.set2('\u1E00', '\u1E9B')
.set2('\u1EA0', '\u1EF9')
.set2('\u1F00', '\u1F15')
.set2('\u1F18', '\u1F1D')
.set2('\u1F20', '\u1F45')
.set2('\u1F48', '\u1F4D')
.set2('\u1F50', '\u1F57')
.set2('\u1F59')
.set2('\u1F5B')
.set2('\u1F5D')
.set2('\u1F5F', '\u1F7D')
.set2('\u1F80', '\u1FB4')
.set2('\u1FB6', '\u1FBC')
.set2('\u1FBE')
.set2('\u1FC2', '\u1FC4')
.set2('\u1FC6', '\u1FCC')
.set2('\u1FD0', '\u1FD3')
.set2('\u1FD6', '\u1FDB')
.set2('\u1FE0', '\u1FEC')
.set2('\u1FF2', '\u1FF4')
.set2('\u1FF6', '\u1FFC')
.set2('\u200E')
.set2('\u2071')
.set2('\u207F')
.set2('\u2102')
.set2('\u2107')
.set2('\u210A', '\u2113')
.set2('\u2115')
.set2('\u2119', '\u211D')
.set2('\u2124')
.set2('\u2126')
.set2('\u2128')
.set2('\u212A', '\u212D')
.set2('\u212F', '\u2131')
.set2('\u2133', '\u2139')
.set2('\u213D', '\u213F')
.set2('\u2145', '\u2149')
.set2('\u2160', '\u2183')
.set2('\u2336', '\u237A')
.set2('\u2395')
.set2('\u249C', '\u24E9')
.set2('\u3005', '\u3007')
.set2('\u3021', '\u3029')
.set2('\u3031', '\u3035')
.set2('\u3038', '\u303C')
.set2('\u3041', '\u3096')
.set2('\u309D', '\u309F')
.set2('\u30A1', '\u30FA')
.set2('\u30FC', '\u30FF')
.set2('\u3105', '\u312C')
.set2('\u3131', '\u318E')
.set2('\u3190', '\u31B7')
.set2('\u31F0', '\u321C')
.set2('\u3220', '\u3243')
.set2('\u3260', '\u327B')
.set2('\u327F', '\u32B0')
.set2('\u32C0', '\u32CB')
.set2('\u32D0', '\u32FE')
.set2('\u3300', '\u3376')
.set2('\u337B', '\u33DD')
.set2('\u33E0', '\u33FE')
.set2('\u3400', '\u4DB5')
.set2('\u4E00', '\u9FA5')
.set2('\uA000', '\uA48C')
.set2('\uAC00', '\uD7A3')
.set2('\uD800', '\uFA2D')
.set2('\uFA30', '\uFA6A')
.set2('\uFB00', '\uFB06')
.set2('\uFB13', '\uFB17')
.set2('\uFF21', '\uFF3A')
.set2('\uFF41', '\uFF5A')
.set2('\uFF66', '\uFFBE')
.set2('\uFFC2', '\uFFC7')
.set2('\uFFCA', '\uFFCF')
.set2('\uFFD2', '\uFFD7')
.set2('\uFFDA', '\uFFDC')
.set2(0x10300, 0x1031E)
.set2(0x10320, 0x10323)
.set2(0x10330, 0x1034A)
.set2(0x10400, 0x10425)
.set2(0x10428, 0x1044D)
.set2(0x1D000, 0x1D0F5)
.set2(0x1D100, 0x1D126)
.set2(0x1D12A, 0x1D166)
.set2(0x1D16A, 0x1D172)
.set2(0x1D183, 0x1D184)
.set2(0x1D18C, 0x1D1A9)
.set2(0x1D1AE, 0x1D1DD)
.set2(0x1D400, 0x1D454)
.set2(0x1D456, 0x1D49C)
.set2(0x1D49E, 0x1D49F)
.set2(0x1D4A2)
.set2(0x1D4A5, 0x1D4A6)
.set2(0x1D4A9, 0x1D4AC)
.set2(0x1D4AE, 0x1D4B9)
.set2(0x1D4BB)
.set2(0x1D4BD, 0x1D4C0)
.set2(0x1D4C2, 0x1D4C3)
.set2(0x1D4C5, 0x1D505)
.set2(0x1D507, 0x1D50A)
.set2(0x1D50D, 0x1D514)
.set2(0x1D516, 0x1D51C)
.set2(0x1D51E, 0x1D539)
.set2(0x1D53B, 0x1D53E)
.set2(0x1D540, 0x1D544)
.set2(0x1D546)
.set2(0x1D54A, 0x1D550)
.set2(0x1D552, 0x1D6A3)
.set2(0x1D6A8, 0x1D7C9)
.set2(0x20000, 0x2A6D6)
.set2(0x2F800, 0x2FA1D)
.set2(0xF0000, 0xFFFFD)
.set2(0x100000, 0x10FFFD);
}
|
UTF-8
|
Java
| 32,866 |
java
|
Nameprep.java
|
Java
|
[] | null |
[] |
package com.arcusys.valamis.lrs.util;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. The ASF licenses this file to You
* under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License. For additional information regarding
* copyright in this work, please see the NOTICE file in the top level
* directory of this distribution.
*/
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.BitSet;
/**
* Implements the Nameprep protocol
*/
public class Nameprep {
public static String prep(String s, boolean allowunassigned) {
NameprepCodepointIterator r = null;
try {
StringBuffer buf = new StringBuffer();
CodepointIterator ci = CodepointIterator.forCharSequence(s);
r = new NameprepCodepointIterator(ci, allowunassigned);
while (r.hasNext()) {
int i = r.next();
if (i != -1)
buf.append((char) i);
}
return Normalizer.normalize(buf.toString(), Normalizer.Form.KC).toString();
} catch (Throwable e) {
throw new RuntimeException(e);
}
}
public static String prep(String s) {
return prep(s, false);
}
public static final BitSet B1 = new ChainableBitSet()
.set2('\u00AD', '\u034F', '\u1806', '\u180B', '\u180C', '\u180D', '\u200B',
'\u200C', '\u200D', '\u2060', '\uFE00', '\uFE01', '\uFE02', '\uFE03',
'\uFE04', '\uFE05', '\uFE06', '\uFE07', '\uFE08', '\uFE09', '\uFE0A',
'\uFE0B', '\uFE0C', '\uFE0D', '\uFE0E', '\uFE0F', '\uFEFF',
// Not listed in B1, but treated as map-to-nothing by others
0x8F, 0xA0, 0x86, 0x8b, 0x80, 0x81, 0x88
);
public static final int[][] B2 = loadb2();
public static final int[] B2(int c) {
return (B2[c] != null) ? B2[c] : null;
}
private static int[] parse(String rep) {
String[] tokens = rep.trim().split(" ");
int[] i = new int[tokens.length];
for (int n = 0; n < tokens.length; n++) {
i[n] = Integer.parseInt(tokens[n], 16);
}
return i;
}
private static final String B2DAT = "/org/apache/abdera/util/iri/data/B2.dat";
public static int[][] loadb2() {
int[][] map = new int[120764][];
try {
InputStream in = Nameprep.class.getResourceAsStream(B2DAT);
InputStreamReader rdr = new InputStreamReader(in);
BufferedReader bufr = new BufferedReader(rdr);
String line = null;
while ((line = bufr.readLine()) != null) {
String[] tokens = line.trim().split("\\s*;\\s*");
int n = Integer.parseInt(tokens[0], 16);
int[] i = parse(tokens[1]);
map[n] = i;
}
} catch (IOException e) {
}
return map;
}
public static final BitSet UNASSIGNED = new ChainableBitSet()
.set2('\u0221')
.set2('\u0234', '\u024F')
.set2('\u02AE', '\u02AF')
.set2('\u02EF', '\u02FF')
.set2('\u0350', '\u035F')
.set2('\u0370', '\u0373')
.set2('\u0376', '\u0379')
.set2('\u037B', '\u037D')
.set2('\u037F', '\u0383')
.set2('\u038B')
.set2('\u038D')
.set2('\u03A2')
.set2('\u03CF')
.set2('\u03F7', '\u03FF')
.set2('\u0487')
.set2('\u04CF')
.set2('\u04F6', '\u04F7')
.set2('\u04FA', '\u04FF')
.set2('\u0510', '\u0530')
.set2('\u0557', '\u0558')
.set2('\u0560')
.set2('\u0588')
.set2('\u058B', '\u0590')
.set2('\u05A2')
.set2('\u05BA')
.set2('\u05C5', '\u05CF')
.set2('\u05EB', '\u05EF')
.set2('\u05F5', '\u060B')
.set2('\u060D', '\u061A')
.set2('\u061C', '\u061E')
.set2('\u0620')
.set2('\u063B', '\u063F')
.set2('\u0656', '\u065F')
.set2('\u06EE', '\u06EF')
.set2('\u06FF')
.set2('\u070E')
.set2('\u072D', '\u072F')
.set2('\u074B', '\u077F')
.set2('\u07B2', '\u0900')
.set2('\u0904')
.set2('\u093A', '\u093B')
.set2('\u094E', '\u094F')
.set2('\u0955', '\u0957')
.set2('\u0971', '\u0980')
.set2('\u0984')
.set2('\u098D', '\u098E')
.set2('\u0991', '\u0992')
.set2('\u09A9')
.set2('\u09B1')
.set2('\u09B3', '\u09B5')
.set2('\u09BA', '\u09BB')
.set2('\u09BD')
.set2('\u09C5', '\u09C6')
.set2('\u09C9', '\u09CA')
.set2('\u09CE', '\u09D6')
.set2('\u09D8', '\u09DB')
.set2('\u09DE')
.set2('\u09E4', '\u09E5')
.set2('\u09FB', '\u0A01')
.set2('\u0A03', '\u0A04')
.set2('\u0A0B', '\u0A0E')
.set2('\u0A11', '\u0A12')
.set2('\u0A29')
.set2('\u0A31')
.set2('\u0A34')
.set2('\u0A37')
.set2('\u0A3A', '\u0A3B')
.set2('\u0A3D')
.set2('\u0A43', '\u0A46')
.set2('\u0A49', '\u0A4A')
.set2('\u0A4E', '\u0A58')
.set2('\u0A5D')
.set2('\u0A5F', '\u0A65')
.set2('\u0A75', '\u0A80')
.set2('\u0A84')
.set2('\u0A8C')
.set2('\u0A8E')
.set2('\u0A92')
.set2('\u0AA9')
.set2('\u0AB1')
.set2('\u0AB4')
.set2('\u0ABA', '\u0ABB')
.set2('\u0AC6')
.set2('\u0ACA')
.set2('\u0ACE', '\u0ACF')
.set2('\u0AD1', '\u0ADF')
.set2('\u0AE1', '\u0AE5')
.set2('\u0AF0', '\u0B00')
.set2('\u0B04')
.set2('\u0B0D', '\u0B0E')
.set2('\u0B11', '\u0B12')
.set2('\u0B29')
.set2('\u0B31')
.set2('\u0B34', '\u0B35')
.set2('\u0B3A', '\u0B3B')
.set2('\u0B44', '\u0B46')
.set2('\u0B49', '\u0B4A')
.set2('\u0B4E', '\u0B55')
.set2('\u0B58', '\u0B5B')
.set2('\u0B5E')
.set2('\u0B62', '\u0B65')
.set2('\u0B71', '\u0B81')
.set2('\u0B84')
.set2('\u0B8B', '\u0B8D')
.set2('\u0B91')
.set2('\u0B96', '\u0B98')
.set2('\u0B9B')
.set2('\u0B9D')
.set2('\u0BA0', '\u0BA2')
.set2('\u0BA5', '\u0BA7')
.set2('\u0BAB', '\u0BAD')
.set2('\u0BB6')
.set2('\u0BBA', '\u0BBD')
.set2('\u0BC3', '\u0BC5')
.set2('\u0BC9')
.set2('\u0BCE', '\u0BD6')
.set2('\u0BD8', '\u0BE6')
.set2('\u0BF3', '\u0C00')
.set2('\u0C04')
.set2('\u0C0D')
.set2('\u0C11')
.set2('\u0C29')
.set2('\u0C34')
.set2('\u0C3A', '\u0C3D')
.set2('\u0C45')
.set2('\u0C49')
.set2('\u0C4E', '\u0C54')
.set2('\u0C57', '\u0C5F')
.set2('\u0C62', '\u0C65')
.set2('\u0C70', '\u0C81')
.set2('\u0C84')
.set2('\u0C8D')
.set2('\u0C91')
.set2('\u0CA9')
.set2('\u0CB4')
.set2('\u0CBA', '\u0CBD')
.set2('\u0CC5')
.set2('\u0CC9')
.set2('\u0CCE', '\u0CD4')
.set2('\u0CD7', '\u0CDD')
.set2('\u0CDF')
.set2('\u0CE2', '\u0CE5')
.set2('\u0CF0', '\u0D01')
.set2('\u0D04')
.set2('\u0D0D')
.set2('\u0D11')
.set2('\u0D29')
.set2('\u0D3A', '\u0D3D')
.set2('\u0D44', '\u0D45')
.set2('\u0D49')
.set2('\u0D4E', '\u0D56')
.set2('\u0D58', '\u0D5F')
.set2('\u0D62', '\u0D65')
.set2('\u0D70', '\u0D81')
.set2('\u0D84')
.set2('\u0D97', '\u0D99')
.set2('\u0DB2')
.set2('\u0DBC')
.set2('\u0DBE', '\u0DBF')
.set2('\u0DC7', '\u0DC9')
.set2('\u0DCB', '\u0DCE')
.set2('\u0DD5')
.set2('\u0DD7')
.set2('\u0DE0', '\u0DF1')
.set2('\u0DF5', '\u0E00')
.set2('\u0E3B', '\u0E3E')
.set2('\u0E5C', '\u0E80')
.set2('\u0E83')
.set2('\u0E85', '\u0E86')
.set2('\u0E89')
.set2('\u0E8B', '\u0E8C')
.set2('\u0E8E', '\u0E93')
.set2('\u0E98')
.set2('\u0EA0')
.set2('\u0EA4')
.set2('\u0EA6')
.set2('\u0EA8', '\u0EA9')
.set2('\u0EAC')
.set2('\u0EBA')
.set2('\u0EBE', '\u0EBF')
.set2('\u0EC5')
.set2('\u0EC7')
.set2('\u0ECE', '\u0ECF')
.set2('\u0EDA', '\u0EDB')
.set2('\u0EDE', '\u0EFF')
.set2('\u0F48')
.set2('\u0F6B', '\u0F70')
.set2('\u0F8C', '\u0F8F')
.set2('\u0F98')
.set2('\u0FBD')
.set2('\u0FCD', '\u0FCE')
.set2('\u0FD0', '\u0FFF')
.set2('\u1022')
.set2('\u1028')
.set2('\u102B')
.set2('\u1033', '\u1035')
.set2('\u103A', '\u103F')
.set2('\u105A', '\u109F')
.set2('\u10C6', '\u10CF')
.set2('\u10F9', '\u10FA')
.set2('\u10FC', '\u10FF')
.set2('\u115A', '\u115E')
.set2('\u11A3', '\u11A7')
.set2('\u11FA', '\u11FF')
.set2('\u1207')
.set2('\u1247')
.set2('\u1249')
.set2('\u124E', '\u124F')
.set2('\u1257')
.set2('\u1259')
.set2('\u125E', '\u125F')
.set2('\u1287')
.set2('\u1289')
.set2('\u128E', '\u128F')
.set2('\u12AF')
.set2('\u12B1')
.set2('\u12B6', '\u12B7')
.set2('\u12BF')
.set2('\u12C1')
.set2('\u12C6', '\u12C7')
.set2('\u12CF')
.set2('\u12D7')
.set2('\u12EF')
.set2('\u130F')
.set2('\u1311')
.set2('\u1316', '\u1317')
.set2('\u131F')
.set2('\u1347')
.set2('\u135B', '\u1360')
.set2('\u137D', '\u139F')
.set2('\u13F5', '\u1400')
.set2('\u1677', '\u167F')
.set2('\u169D', '\u169F')
.set2('\u16F1', '\u16FF')
.set2('\u170D')
.set2('\u1715', '\u171F')
.set2('\u1737', '\u173F')
.set2('\u1754', '\u175F')
.set2('\u176D')
.set2('\u1771')
.set2('\u1774', '\u177F')
.set2('\u17DD', '\u17DF')
.set2('\u17EA', '\u17FF')
.set2('\u180F')
.set2('\u181A', '\u181F')
.set2('\u1878', '\u187F')
.set2('\u18AA', '\u1DFF')
.set2('\u1E9C', '\u1E9F')
.set2('\u1EFA', '\u1EFF')
.set2('\u1F16', '\u1F17')
.set2('\u1F1E', '\u1F1F')
.set2('\u1F46', '\u1F47')
.set2('\u1F4E', '\u1F4F')
.set2('\u1F58')
.set2('\u1F5A')
.set2('\u1F5C')
.set2('\u1F5E')
.set2('\u1F7E', '\u1F7F')
.set2('\u1FB5')
.set2('\u1FC5')
.set2('\u1FD4', '\u1FD5')
.set2('\u1FDC')
.set2('\u1FF0', '\u1FF1')
.set2('\u1FF5')
.set2('\u1FFF')
.set2('\u2053', '\u2056')
.set2('\u2058', '\u205E')
.set2('\u2064', '\u2069')
.set2('\u2072', '\u2073')
.set2('\u208F', '\u209F')
.set2('\u20B2', '\u20CF')
.set2('\u20EB', '\u20FF')
.set2('\u213B', '\u213C')
.set2('\u214C', '\u2152')
.set2('\u2184', '\u218F')
.set2('\u23CF', '\u23FF')
.set2('\u2427', '\u243F')
.set2('\u244B', '\u245F')
.set2('\u24FF')
.set2('\u2614', '\u2615')
.set2('\u2618')
.set2('\u267E', '\u267F')
.set2('\u268A', '\u2700')
.set2('\u2705')
.set2('\u270A', '\u270B')
.set2('\u2728')
.set2('\u274C')
.set2('\u274E')
.set2('\u2753', '\u2755')
.set2('\u2757')
.set2('\u275F', '\u2760')
.set2('\u2795', '\u2797')
.set2('\u27B0')
.set2('\u27BF', '\u27CF')
.set2('\u27EC', '\u27EF')
.set2('\u2B00', '\u2E7F')
.set2('\u2E9A')
.set2('\u2EF4', '\u2EFF')
.set2('\u2FD6', '\u2FEF')
.set2('\u2FFC', '\u2FFF')
.set2('\u3040')
.set2('\u3097', '\u3098')
.set2('\u3100', '\u3104')
.set2('\u312D', '\u3130')
.set2('\u318F')
.set2('\u31B8', '\u31EF')
.set2('\u321D', '\u321F')
.set2('\u3244', '\u3250')
.set2('\u327C', '\u327E')
.set2('\u32CC', '\u32CF')
.set2('\u32FF')
.set2('\u3377', '\u337A')
.set2('\u33DE', '\u33DF')
.set2('\u33FF')
.set2('\u4DB6', '\u4DFF')
.set2('\u9FA6', '\u9FFF')
.set2('\uA48D', '\uA48F')
.set2('\uA4C7', '\uABFF')
.set2('\uD7A4', '\uD7FF')
.set2('\uFA2E', '\uFA2F')
.set2('\uFA6B', '\uFAFF')
.set2('\uFB07', '\uFB12')
.set2('\uFB18', '\uFB1C')
.set2('\uFB37')
.set2('\uFB3D')
.set2('\uFB3F')
.set2('\uFB42')
.set2('\uFB45')
.set2('\uFBB2', '\uFBD2')
.set2('\uFD40', '\uFD4F')
.set2('\uFD90', '\uFD91')
.set2('\uFDC8', '\uFDCF')
.set2('\uFDFD', '\uFDFF')
.set2('\uFE10', '\uFE1F')
.set2('\uFE24', '\uFE2F')
.set2('\uFE47', '\uFE48')
.set2('\uFE53')
.set2('\uFE67')
.set2('\uFE6C', '\uFE6F')
.set2('\uFE75')
.set2('\uFEFD', '\uFEFE')
.set2('\uFF00')
.set2('\uFFBF', '\uFFC1')
.set2('\uFFC8', '\uFFC9')
.set2('\uFFD0', '\uFFD1')
.set2('\uFFD8', '\uFFD9')
.set2('\uFFDD', '\uFFDF')
.set2('\uFFE7')
.set2('\uFFEF', '\uFFF8')
.set2(0x10000, 0x102FF)
.set2(0x1031F)
.set2(0x10324, 0x1032F)
.set2(0x1034B, 0x103FF)
.set2(0x10426, 0x10427)
.set2(0x1044E, 0x1CFFF)
.set2(0x1D0F6, 0x1D0FF)
.set2(0x1D127, 0x1D129)
.set2(0x1D1DE, 0x1D3FF)
.set2(0x1D455)
.set2(0x1D49D)
.set2(0x1D4A0, 0x1D4A1)
.set2(0x1D4A3, 0x1D4A4)
.set2(0x1D4A7, 0x1D4A8)
.set2(0x1D4AD)
.set2(0x1D4BA)
.set2(0x1D4BC)
.set2(0x1D4C1)
.set2(0x1D4C4)
.set2(0x1D506)
.set2(0x1D50B, 0x1D50C)
.set2(0x1D515)
.set2(0x1D51D)
.set2(0x1D53A)
.set2(0x1D53F)
.set2(0x1D545)
.set2(0x1D547, 0x1D549)
.set2(0x1D551)
.set2(0x1D6A4, 0x1D6A7)
.set2(0x1D7CA, 0x1D7CD)
.set2(0x1D800, 0x1FFFD)
.set2(0x2A6D7, 0x2F7FF)
.set2(0x2FA1E, 0x2FFFD)
.set2(0x30000, 0x3FFFD)
.set2(0x40000, 0x4FFFD)
.set2(0x50000, 0x5FFFD)
.set2(0x60000, 0x6FFFD)
.set2(0x70000, 0x7FFFD)
.set2(0x80000, 0x8FFFD)
.set2(0x90000, 0x9FFFD)
.set2(0xA0000, 0xAFFFD)
.set2(0xB0000, 0xBFFFD)
.set2(0xC0000, 0xCFFFD)
.set2(0xD0000, 0xDFFFD)
.set2(0xE0000)
.set2(0xE0002, 0xE001F)
.set2(0xE0080, 0xEFFFD);
public static final ChainableBitSet PROHIBITED = new ChainableBitSet()
// c.1.2
.set2('\u00A0').set2('\u1680').set2('\u2000', '\u200B')
.set2('\u202F').set2('\u205F').set2('\u3000')
// c.2.2
.set2('\u0080', '\u009F').set2('\u06DD').set2('\u070F')
.set2('\u180E').set2('\u200C').set2('\u200D').set2('\u2028')
.set2('\u2029').set2('\u2060').set2('\u2061').set2('\u2062')
.set2('\u2063').set2('\u206A', '\u206F').set2('\uFEFF')
.set2('\uFFF9', '\uFFFC').set2(0x1D173, 0x1D17A)
// c.3
.set2('\uE000', '\uF8FF').set2(0xF0000, 0xFFFFD).set2(0x100000, 0x10FFFD)
// c.4
.set2('\uFDD0', '\uFDEF').set2('\uFFFE', '\uFFFF').set2(0x1FFFE, 0x1FFFF)
.set2(0x2FFFE, 0x2FFFF).set2(0x3FFFE, 0x3FFFF).set2(0x4FFFE, 0x4FFFF)
.set2(0x5FFFE, 0x5FFFF).set2(0x6FFFE, 0x6FFFF).set2(0x7FFFE, 0x7FFFF)
.set2(0x8FFFE, 0x8FFFF).set2(0x9FFFE, 0x9FFFF).set2(0xAFFFE, 0xAFFFF)
.set2(0xBFFFE, 0xBFFFF).set2(0xCFFFE, 0xCFFFF).set2(0xDFFFE, 0xDFFFF)
.set2(0xEFFFE, 0xEFFFF).set2(0xFFFFE, 0xFFFFF).set2(0x10FFFE, 0x10FFFF)
// c.5
.set2('\uD800', '\uDFFF')
// c.6
.set2('\uFFF9', '\uFFFD')
// c.7
.set2('\u2FF0', '\u2FFB')
// c.8
.set2('\u0340').set2('\u0341').set2('\u200E')
.set2('\u200F').set2('\u202A').set2('\u202B')
.set2('\u202C').set2('\u202D').set2('\u202E')
.set2('\u206A').set2('\u206B').set2('\u206C')
.set2('\u206D').set2('\u206E').set2('\u206F')
// c.9
.set2(0xE0001).set2(0xE0020, 0xE007F)
// unassigned
.set2(UNASSIGNED);
public static final BitSet RandAL = new ChainableBitSet()
.set2('\u05BE').set2('\u05C0').set2('\u05C3')
.set2('\u05D0', '\u05EA').set2('\u05F0', '\u05F4')
.set2('\u061B').set2('\u061F').set2('\u0621', '\u063A')
.set2('\u0640', '\u064A').set2('\u066D', '\u066F').set2('\u0671', '\u06D5')
.set2('\u06DD').set2('\u06E5', '\u06E6').set2('\u06FA', '\u06FE')
.set2('\u0700', '\u070D').set2('\u0710').set2('\u0712', '\u072C')
.set2('\u0780', '\u07A5').set2('\u07B1').set2('\u200F')
.set2('\uFB1D').set2('\uFB1F', '\uFB28').set2('\uFB2A', '\uFB36')
.set2('\uFB38', '\uFB3C').set2('\uFB3E').set2('\uFB40', '\uFB41')
.set2('\uFB43', '\uFB44').set2('\uFB46', '\uFBB1').set2('\uFBD3', '\uFD3D')
.set2('\uFD50', '\uFD8F').set2('\uFD92', '\uFDC7').set2('\uFDF0', '\uFDFC')
.set2('\uFE70', '\uFE74').set2('\uFE76', '\uFEFC');
public static final BitSet LCat = new ChainableBitSet()
.set2('\u0041', '\u005A')
.set2('\u0061', '\u007A')
.set2('\u00AA')
.set2('\u00B5')
.set2('\u00BA')
.set2('\u00C0', '\u00D6')
.set2('\u00D8', '\u00F6')
.set2('\u00F8', '\u0220')
.set2('\u0222', '\u0233')
.set2('\u0250', '\u02AD')
.set2('\u02B0', '\u02B8')
.set2('\u02BB', '\u02C1')
.set2('\u02D0', '\u02D1')
.set2('\u02E0', '\u02E4')
.set2('\u02EE')
.set2('\u037A')
.set2('\u0386')
.set2('\u0388', '\u038A')
.set2('\u038C')
.set2('\u038E', '\u03A1')
.set2('\u03A3', '\u03CE')
.set2('\u03D0', '\u03F5')
.set2('\u0400', '\u0482')
.set2('\u048A', '\u04CE')
.set2('\u04D0', '\u04F5')
.set2('\u04F8', '\u04F9')
.set2('\u0500', '\u050F')
.set2('\u0531', '\u0556')
.set2('\u0559', '\u055F')
.set2('\u0561', '\u0587')
.set2('\u0589')
.set2('\u0903')
.set2('\u0905', '\u0939')
.set2('\u093D', '\u0940')
.set2('\u0949', '\u094C')
.set2('\u0950')
.set2('\u0958', '\u0961')
.set2('\u0964', '\u0970')
.set2('\u0982', '\u0983')
.set2('\u0985', '\u098C')
.set2('\u098F', '\u0990')
.set2('\u0993', '\u09A8')
.set2('\u09AA', '\u09B0')
.set2('\u09B2')
.set2('\u09B6', '\u09B9')
.set2('\u09BE', '\u09C0')
.set2('\u09C7', '\u09C8')
.set2('\u09CB', '\u09CC')
.set2('\u09D7')
.set2('\u09DC', '\u09DD')
.set2('\u09DF', '\u09E1')
.set2('\u09E6', '\u09F1')
.set2('\u09F4', '\u09FA')
.set2('\u0A05', '\u0A0A')
.set2('\u0A0F', '\u0A10')
.set2('\u0A13', '\u0A28')
.set2('\u0A2A', '\u0A30')
.set2('\u0A32', '\u0A33')
.set2('\u0A35', '\u0A36')
.set2('\u0A38', '\u0A39')
.set2('\u0A3E', '\u0A40')
.set2('\u0A59', '\u0A5C')
.set2('\u0A5E')
.set2('\u0A66', '\u0A6F')
.set2('\u0A72', '\u0A74')
.set2('\u0A83')
.set2('\u0A85', '\u0A8B')
.set2('\u0A8D')
.set2('\u0A8F', '\u0A91')
.set2('\u0A93', '\u0AA8')
.set2('\u0AAA', '\u0AB0')
.set2('\u0AB2', '\u0AB3')
.set2('\u0AB5', '\u0AB9')
.set2('\u0ABD', '\u0AC0')
.set2('\u0AC9')
.set2('\u0ACB', '\u0ACC')
.set2('\u0AD0')
.set2('\u0AE0')
.set2('\u0AE6', '\u0AEF')
.set2('\u0B02', '\u0B03')
.set2('\u0B05', '\u0B0C')
.set2('\u0B0F', '\u0B10')
.set2('\u0B13', '\u0B28')
.set2('\u0B2A', '\u0B30')
.set2('\u0B32', '\u0B33')
.set2('\u0B36', '\u0B39')
.set2('\u0B3D', '\u0B3E')
.set2('\u0B40')
.set2('\u0B47', '\u0B48')
.set2('\u0B4B', '\u0B4C')
.set2('\u0B57')
.set2('\u0B5C', '\u0B5D')
.set2('\u0B5F', '\u0B61')
.set2('\u0B66', '\u0B70')
.set2('\u0B83')
.set2('\u0B85', '\u0B8A')
.set2('\u0B8E', '\u0B90')
.set2('\u0B92', '\u0B95')
.set2('\u0B99', '\u0B9A')
.set2('\u0B9C')
.set2('\u0B9E', '\u0B9F')
.set2('\u0BA3', '\u0BA4')
.set2('\u0BA8', '\u0BAA')
.set2('\u0BAE', '\u0BB5')
.set2('\u0BB7', '\u0BB9')
.set2('\u0BBE', '\u0BBF')
.set2('\u0BC1', '\u0BC2')
.set2('\u0BC6', '\u0BC8')
.set2('\u0BCA', '\u0BCC')
.set2('\u0BD7')
.set2('\u0BE7', '\u0BF2')
.set2('\u0C01', '\u0C03')
.set2('\u0C05', '\u0C0C')
.set2('\u0C0E', '\u0C10')
.set2('\u0C12', '\u0C28')
.set2('\u0C2A', '\u0C33')
.set2('\u0C35', '\u0C39')
.set2('\u0C41', '\u0C44')
.set2('\u0C60', '\u0C61')
.set2('\u0C66', '\u0C6F')
.set2('\u0C82', '\u0C83')
.set2('\u0C85', '\u0C8C')
.set2('\u0C8E', '\u0C90')
.set2('\u0C92', '\u0CA8')
.set2('\u0CAA', '\u0CB3')
.set2('\u0CB5', '\u0CB9')
.set2('\u0CBE')
.set2('\u0CC0', '\u0CC4')
.set2('\u0CC7', '\u0CC8')
.set2('\u0CCA', '\u0CCB')
.set2('\u0CD5', '\u0CD6')
.set2('\u0CDE')
.set2('\u0CE0', '\u0CE1')
.set2('\u0CE6', '\u0CEF')
.set2('\u0D02', '\u0D03')
.set2('\u0D05', '\u0D0C')
.set2('\u0D0E', '\u0D10')
.set2('\u0D12', '\u0D28')
.set2('\u0D2A', '\u0D39')
.set2('\u0D3E', '\u0D40')
.set2('\u0D46', '\u0D48')
.set2('\u0D4A', '\u0D4C')
.set2('\u0D57')
.set2('\u0D60', '\u0D61')
.set2('\u0D66', '\u0D6F')
.set2('\u0D82', '\u0D83')
.set2('\u0D85', '\u0D96')
.set2('\u0D9A', '\u0DB1')
.set2('\u0DB3', '\u0DBB')
.set2('\u0DBD')
.set2('\u0DC0', '\u0DC6')
.set2('\u0DCF', '\u0DD1')
.set2('\u0DD8', '\u0DDF')
.set2('\u0DF2', '\u0DF4')
.set2('\u0E01', '\u0E30')
.set2('\u0E32', '\u0E33')
.set2('\u0E40', '\u0E46')
.set2('\u0E4F', '\u0E5B')
.set2('\u0E81', '\u0E82')
.set2('\u0E84')
.set2('\u0E87', '\u0E88')
.set2('\u0E8A')
.set2('\u0E8D')
.set2('\u0E94', '\u0E97')
.set2('\u0E99', '\u0E9F')
.set2('\u0EA1', '\u0EA3')
.set2('\u0EA5')
.set2('\u0EA7')
.set2('\u0EAA', '\u0EAB')
.set2('\u0EAD', '\u0EB0')
.set2('\u0EB2', '\u0EB3')
.set2('\u0EBD')
.set2('\u0EC0', '\u0EC4')
.set2('\u0EC6')
.set2('\u0ED0', '\u0ED9')
.set2('\u0EDC', '\u0EDD')
.set2('\u0F00', '\u0F17')
.set2('\u0F1A', '\u0F34')
.set2('\u0F36')
.set2('\u0F38')
.set2('\u0F3E', '\u0F47')
.set2('\u0F49', '\u0F6A')
.set2('\u0F7F')
.set2('\u0F85')
.set2('\u0F88', '\u0F8B')
.set2('\u0FBE', '\u0FC5')
.set2('\u0FC7', '\u0FCC')
.set2('\u0FCF')
.set2('\u1000', '\u1021')
.set2('\u1023', '\u1027')
.set2('\u1029', '\u102A')
.set2('\u102C')
.set2('\u1031')
.set2('\u1038')
.set2('\u1040', '\u1057')
.set2('\u10A0', '\u10C5')
.set2('\u10D0', '\u10F8')
.set2('\u10FB')
.set2('\u1100', '\u1159')
.set2('\u115F', '\u11A2')
.set2('\u11A8', '\u11F9')
.set2('\u1200', '\u1206')
.set2('\u1208', '\u1246')
.set2('\u1248')
.set2('\u124A', '\u124D')
.set2('\u1250', '\u1256')
.set2('\u1258')
.set2('\u125A', '\u125D')
.set2('\u1260', '\u1286')
.set2('\u1288')
.set2('\u128A', '\u128D')
.set2('\u1290', '\u12AE')
.set2('\u12B0')
.set2('\u12B2', '\u12B5')
.set2('\u12B8', '\u12BE')
.set2('\u12C0')
.set2('\u12C2', '\u12C5')
.set2('\u12C8', '\u12CE')
.set2('\u12D0', '\u12D6')
.set2('\u12D8', '\u12EE')
.set2('\u12F0', '\u130E')
.set2('\u1310')
.set2('\u1312', '\u1315')
.set2('\u1318', '\u131E')
.set2('\u1320', '\u1346')
.set2('\u1348', '\u135A')
.set2('\u1361', '\u137C')
.set2('\u13A0', '\u13F4')
.set2('\u1401', '\u1676')
.set2('\u1681', '\u169A')
.set2('\u16A0', '\u16F0')
.set2('\u1700', '\u170C')
.set2('\u170E', '\u1711')
.set2('\u1720', '\u1731')
.set2('\u1735', '\u1736')
.set2('\u1740', '\u1751')
.set2('\u1760', '\u176C')
.set2('\u176E', '\u1770')
.set2('\u1780', '\u17B6')
.set2('\u17BE', '\u17C5')
.set2('\u17C7', '\u17C8')
.set2('\u17D4', '\u17DA')
.set2('\u17DC')
.set2('\u17E0', '\u17E9')
.set2('\u1810', '\u1819')
.set2('\u1820', '\u1877')
.set2('\u1880', '\u18A8')
.set2('\u1E00', '\u1E9B')
.set2('\u1EA0', '\u1EF9')
.set2('\u1F00', '\u1F15')
.set2('\u1F18', '\u1F1D')
.set2('\u1F20', '\u1F45')
.set2('\u1F48', '\u1F4D')
.set2('\u1F50', '\u1F57')
.set2('\u1F59')
.set2('\u1F5B')
.set2('\u1F5D')
.set2('\u1F5F', '\u1F7D')
.set2('\u1F80', '\u1FB4')
.set2('\u1FB6', '\u1FBC')
.set2('\u1FBE')
.set2('\u1FC2', '\u1FC4')
.set2('\u1FC6', '\u1FCC')
.set2('\u1FD0', '\u1FD3')
.set2('\u1FD6', '\u1FDB')
.set2('\u1FE0', '\u1FEC')
.set2('\u1FF2', '\u1FF4')
.set2('\u1FF6', '\u1FFC')
.set2('\u200E')
.set2('\u2071')
.set2('\u207F')
.set2('\u2102')
.set2('\u2107')
.set2('\u210A', '\u2113')
.set2('\u2115')
.set2('\u2119', '\u211D')
.set2('\u2124')
.set2('\u2126')
.set2('\u2128')
.set2('\u212A', '\u212D')
.set2('\u212F', '\u2131')
.set2('\u2133', '\u2139')
.set2('\u213D', '\u213F')
.set2('\u2145', '\u2149')
.set2('\u2160', '\u2183')
.set2('\u2336', '\u237A')
.set2('\u2395')
.set2('\u249C', '\u24E9')
.set2('\u3005', '\u3007')
.set2('\u3021', '\u3029')
.set2('\u3031', '\u3035')
.set2('\u3038', '\u303C')
.set2('\u3041', '\u3096')
.set2('\u309D', '\u309F')
.set2('\u30A1', '\u30FA')
.set2('\u30FC', '\u30FF')
.set2('\u3105', '\u312C')
.set2('\u3131', '\u318E')
.set2('\u3190', '\u31B7')
.set2('\u31F0', '\u321C')
.set2('\u3220', '\u3243')
.set2('\u3260', '\u327B')
.set2('\u327F', '\u32B0')
.set2('\u32C0', '\u32CB')
.set2('\u32D0', '\u32FE')
.set2('\u3300', '\u3376')
.set2('\u337B', '\u33DD')
.set2('\u33E0', '\u33FE')
.set2('\u3400', '\u4DB5')
.set2('\u4E00', '\u9FA5')
.set2('\uA000', '\uA48C')
.set2('\uAC00', '\uD7A3')
.set2('\uD800', '\uFA2D')
.set2('\uFA30', '\uFA6A')
.set2('\uFB00', '\uFB06')
.set2('\uFB13', '\uFB17')
.set2('\uFF21', '\uFF3A')
.set2('\uFF41', '\uFF5A')
.set2('\uFF66', '\uFFBE')
.set2('\uFFC2', '\uFFC7')
.set2('\uFFCA', '\uFFCF')
.set2('\uFFD2', '\uFFD7')
.set2('\uFFDA', '\uFFDC')
.set2(0x10300, 0x1031E)
.set2(0x10320, 0x10323)
.set2(0x10330, 0x1034A)
.set2(0x10400, 0x10425)
.set2(0x10428, 0x1044D)
.set2(0x1D000, 0x1D0F5)
.set2(0x1D100, 0x1D126)
.set2(0x1D12A, 0x1D166)
.set2(0x1D16A, 0x1D172)
.set2(0x1D183, 0x1D184)
.set2(0x1D18C, 0x1D1A9)
.set2(0x1D1AE, 0x1D1DD)
.set2(0x1D400, 0x1D454)
.set2(0x1D456, 0x1D49C)
.set2(0x1D49E, 0x1D49F)
.set2(0x1D4A2)
.set2(0x1D4A5, 0x1D4A6)
.set2(0x1D4A9, 0x1D4AC)
.set2(0x1D4AE, 0x1D4B9)
.set2(0x1D4BB)
.set2(0x1D4BD, 0x1D4C0)
.set2(0x1D4C2, 0x1D4C3)
.set2(0x1D4C5, 0x1D505)
.set2(0x1D507, 0x1D50A)
.set2(0x1D50D, 0x1D514)
.set2(0x1D516, 0x1D51C)
.set2(0x1D51E, 0x1D539)
.set2(0x1D53B, 0x1D53E)
.set2(0x1D540, 0x1D544)
.set2(0x1D546)
.set2(0x1D54A, 0x1D550)
.set2(0x1D552, 0x1D6A3)
.set2(0x1D6A8, 0x1D7C9)
.set2(0x20000, 0x2A6D6)
.set2(0x2F800, 0x2FA1D)
.set2(0xF0000, 0xFFFFD)
.set2(0x100000, 0x10FFFD);
}
| 32,866 | 0.404704 | 0.254458 | 919 | 34.763874 | 13.041482 | 89 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.73123 | false | false |
3
|
0b5b95f51a5830f38dcf3d2f2d2cc8ca709ef896
| 12,833,362,345,587 |
39a3ed36c9f6ebdd526f742a5a35de5c8c3f2442
|
/src/org/usfirst/frc/team4486/robot/OI.java
|
2c4df1e8a2a0716b5071dc975a0a9c69b3f0e94f
|
[] |
no_license
|
al2699/Team4486-Stronghold-Code
|
https://github.com/al2699/Team4486-Stronghold-Code
|
270f0c4ed82f3260a094435bceb6a72019928860
|
6e48f8c9e71ab7f1b0e20a37f698d77286a8c1e9
|
refs/heads/master
| 2018-12-31T17:22:23.367000 | 2017-01-11T22:24:11 | 2017-01-11T22:24:11 | 70,091,336 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
// Written by the AT-Team
package org.usfirst.frc.team4486.robot;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.buttons.JoystickButton;
import org.usfirst.frc.team4486.robot.commands.GetDown;
import org.usfirst.frc.team4486.robot.commands.GetIntake;
import org.usfirst.frc.team4486.robot.commands.GetIntakeOut;
import org.usfirst.frc.team4486.robot.commands.IntakeForMovement;
import org.usfirst.frc.team4486.robot.commands.PawLowering;
import org.usfirst.frc.team4486.robot.commands.PawRaising;
import org.usfirst.frc.team4486.robot.commands.ReverseDrive;
import org.usfirst.frc.team4486.robot.commands.GetHigh;
import org.usfirst.frc.team4486.robot.commands.Shoot;
import org.usfirst.frc.team4486.robot.commands.IntakeForLowGoal;
import org.usfirst.frc.team4486.robot.commands.IntakeRev;
//import org.usfirst.frc.team4486.robot.commands.ShooterSequence;
import org.usfirst.frc.team4486.robot.commands.ShooterSequence;
import org.usfirst.frc.team4486.robot.subsystems.PawSystem;
import org.usfirst.frc.team4486.robot.subsystems.PneumaticsSystem;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
/**
* This class is the glue that binds the controls on the physical operator
* interface to the commands and command groups that allow control of the robot.
*/
public class OI {
// controllers
public static Joystick driveController = new Joystick(RobotMap.DRIVE_CONTROLLER_PORT);
public static Joystick manipulatorController = new Joystick(RobotMap.MANIPULATOR_CONTROLLER_PORT);
//buttons
public static JoystickButton reverseButton = new JoystickButton(driveController,RobotMap.REVERSE_BUTTON);
public static JoystickButton wedgeButton = new JoystickButton(manipulatorController,RobotMap.WEAGE_HIGH_BUTTON);
public static JoystickButton wedgeButton2 = new JoystickButton(manipulatorController,RobotMap.WEAGE_LOW_BUTTON_2);
public static JoystickButton shooterButtonseq = new JoystickButton(manipulatorController, RobotMap.SHOOT_BUTTON);
public static JoystickButton turboButton = new JoystickButton(driveController,RobotMap.TURBO_BUTTON );
public static JoystickButton pawButtonUp = new JoystickButton(manipulatorController, RobotMap.PAW_BUTTON_HIGH);
public static JoystickButton pawButtonDown = new JoystickButton(manipulatorController, RobotMap.PAW_BUTTON_LOW);
public static JoystickButton intakeButtonOut = new JoystickButton(manipulatorController, RobotMap.INTAKE_BUTTON_REV);
public static JoystickButton intakeButtonIn = new JoystickButton(manipulatorController, RobotMap.INTAKE_BUTTON_Rev);
public static JoystickButton shooterButton = new JoystickButton(manipulatorController,RobotMap.MAN_SHOOT);
public static JoystickButton shooterFor = new JoystickButton(manipulatorController, RobotMap.SHOOTER_FOR);
public static JoystickButton MovementButton = new JoystickButton(manipulatorController, RobotMap.MOVEMENT_BUTTON);
public OI(){
reverseButton.whileHeld(new ReverseDrive());
wedgeButton.whenPressed(new GetHigh());
wedgeButton2.whenPressed(new GetDown());
shooterButton.whileHeld(new IntakeRev()); //Used
intakeButtonOut.whileHeld(new IntakeForLowGoal()); //Old button for useless reverse (at least think so rn)
//intakeButtonOut.whileHeld(new IntakeForMovement());
pawButtonUp.whenPressed(new PawRaising());
pawButtonDown.whenPressed(new PawLowering());
MovementButton.whileHeld(new IntakeForMovement());
shooterFor.whileActive(new Shoot());
}
public static void updateSmartDashboard(){
SmartDashboard.putBoolean("ReverseEnable",reverseButton.get());
SmartDashboard.putBoolean("TurboEnable",turboButton.get());
SmartDashboard.putBoolean("WedgeUP",PneumaticsSystem.getState());
SmartDashboard.putBoolean("PawUp",PawSystem.getState());
//SmartDashboard.putNumber("Intake stop delay", RobotPreferences.INTAKECONSTANT);
}
}
|
UTF-8
|
Java
| 3,854 |
java
|
OI.java
|
Java
|
[] | null |
[] |
// Written by the AT-Team
package org.usfirst.frc.team4486.robot;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.buttons.JoystickButton;
import org.usfirst.frc.team4486.robot.commands.GetDown;
import org.usfirst.frc.team4486.robot.commands.GetIntake;
import org.usfirst.frc.team4486.robot.commands.GetIntakeOut;
import org.usfirst.frc.team4486.robot.commands.IntakeForMovement;
import org.usfirst.frc.team4486.robot.commands.PawLowering;
import org.usfirst.frc.team4486.robot.commands.PawRaising;
import org.usfirst.frc.team4486.robot.commands.ReverseDrive;
import org.usfirst.frc.team4486.robot.commands.GetHigh;
import org.usfirst.frc.team4486.robot.commands.Shoot;
import org.usfirst.frc.team4486.robot.commands.IntakeForLowGoal;
import org.usfirst.frc.team4486.robot.commands.IntakeRev;
//import org.usfirst.frc.team4486.robot.commands.ShooterSequence;
import org.usfirst.frc.team4486.robot.commands.ShooterSequence;
import org.usfirst.frc.team4486.robot.subsystems.PawSystem;
import org.usfirst.frc.team4486.robot.subsystems.PneumaticsSystem;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
/**
* This class is the glue that binds the controls on the physical operator
* interface to the commands and command groups that allow control of the robot.
*/
public class OI {
// controllers
public static Joystick driveController = new Joystick(RobotMap.DRIVE_CONTROLLER_PORT);
public static Joystick manipulatorController = new Joystick(RobotMap.MANIPULATOR_CONTROLLER_PORT);
//buttons
public static JoystickButton reverseButton = new JoystickButton(driveController,RobotMap.REVERSE_BUTTON);
public static JoystickButton wedgeButton = new JoystickButton(manipulatorController,RobotMap.WEAGE_HIGH_BUTTON);
public static JoystickButton wedgeButton2 = new JoystickButton(manipulatorController,RobotMap.WEAGE_LOW_BUTTON_2);
public static JoystickButton shooterButtonseq = new JoystickButton(manipulatorController, RobotMap.SHOOT_BUTTON);
public static JoystickButton turboButton = new JoystickButton(driveController,RobotMap.TURBO_BUTTON );
public static JoystickButton pawButtonUp = new JoystickButton(manipulatorController, RobotMap.PAW_BUTTON_HIGH);
public static JoystickButton pawButtonDown = new JoystickButton(manipulatorController, RobotMap.PAW_BUTTON_LOW);
public static JoystickButton intakeButtonOut = new JoystickButton(manipulatorController, RobotMap.INTAKE_BUTTON_REV);
public static JoystickButton intakeButtonIn = new JoystickButton(manipulatorController, RobotMap.INTAKE_BUTTON_Rev);
public static JoystickButton shooterButton = new JoystickButton(manipulatorController,RobotMap.MAN_SHOOT);
public static JoystickButton shooterFor = new JoystickButton(manipulatorController, RobotMap.SHOOTER_FOR);
public static JoystickButton MovementButton = new JoystickButton(manipulatorController, RobotMap.MOVEMENT_BUTTON);
public OI(){
reverseButton.whileHeld(new ReverseDrive());
wedgeButton.whenPressed(new GetHigh());
wedgeButton2.whenPressed(new GetDown());
shooterButton.whileHeld(new IntakeRev()); //Used
intakeButtonOut.whileHeld(new IntakeForLowGoal()); //Old button for useless reverse (at least think so rn)
//intakeButtonOut.whileHeld(new IntakeForMovement());
pawButtonUp.whenPressed(new PawRaising());
pawButtonDown.whenPressed(new PawLowering());
MovementButton.whileHeld(new IntakeForMovement());
shooterFor.whileActive(new Shoot());
}
public static void updateSmartDashboard(){
SmartDashboard.putBoolean("ReverseEnable",reverseButton.get());
SmartDashboard.putBoolean("TurboEnable",turboButton.get());
SmartDashboard.putBoolean("WedgeUP",PneumaticsSystem.getState());
SmartDashboard.putBoolean("PawUp",PawSystem.getState());
//SmartDashboard.putNumber("Intake stop delay", RobotPreferences.INTAKECONSTANT);
}
}
| 3,854 | 0.817852 | 0.800467 | 75 | 50.373333 | 38.465145 | 118 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.666667 | false | false |
3
|
d8f81de55391dea9686c7cc02a329217b3687e3e
| 12,833,362,349,396 |
1b280f8167dab27fa9c0aff3d05e5504badf6ed8
|
/src/test/java/org/op4j/test/auto/Test.java
|
0f916d174c2dddacb4d39023e8dafdbaadf905df
|
[
"Apache-2.0"
] |
permissive
|
shyding/op4j
|
https://github.com/shyding/op4j
|
bcf2d600bbea83c2bb0fe48142a0fa5abe2bb1d9
|
b577596dfe462089d3dd169666defc6de7ad289a
|
refs/heads/master
| 2021-05-16T18:54:01.108000 | 2012-05-13T22:24:48 | 2012-05-13T22:24:48 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package org.op4j.test.auto;
import java.beans.Expression;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.javaruntype.type.Type;
import org.junit.Ignore;
import org.op4j.Op;
import org.op4j.exceptions.ExecutionException;
@Ignore
public class Test {
public static final <T> Object testOn(T target,
List<TestOperation> operations) {
Object result = Op.on(target);
return executeOperations(result, operations);
}
// public static final Object testOnAll(Object[] onParams,
// List<TestOperation> operations) {
// Object result = Op.onAll(onParams);
// return executeOperations(result, operations);
// }
public static final <T> Object testOnArrayOf(Type<T> type, T[] target,
List<TestOperation> operations) {
Object result = Op.onArrayOf(type, target);
return executeOperations(result, operations);
}
//
// public static final <T> Object testOnArrayOfArrayOf(Type<T> type, T[][] target,
// List<TestOperation> operations) {
// Object result = Op.onArrayOfArrayOf(type, target);
// return executeOperations(result, operations);
// }
//
// public static final <T> Object testOnArrayOfList(List<T>[] target,
// List<TestOperation> operations) {
// Object result = Op.onArrayOfList(target);
// return executeOperations(result, operations);
// }
//
// public static final <T, U> Object testOnArrayOfMap(Map<T, U>[] target,
// List<TestOperation> operations) {
// Object result = Op.onArrayOfMap(target);
// return executeOperations(result, operations);
// }
//
// public static final <T> Object testOnArrayOfSet(Set<T>[] target,
// List<TestOperation> operations) {
// Object result = Op.onArrayOfSet(target);
// return executeOperations(result, operations);
// }
public static final <T> Object testOnList(List<T> target,
List<TestOperation> operations) {
Object result = Op.onList(target);
return executeOperations(result, operations);
}
//
// public static final <T> Object testOnListOfArrayOf(Type<T> type, List<T[]> target,
// List<TestOperation> operations) {
// Object result = Op.onListOfArrayOf(type, target);
// return executeOperations(result, operations);
// }
//
// public static final <T> Object testOnListOfList(List<? extends List<T>> target,
// List<TestOperation> operations) {
// Object result = Op.onListOfList(target);
// return executeOperations(result, operations);
// }
//
// public static final <T, U> Object testOnListOfMap(List<? extends Map<T, U>> target,
// List<TestOperation> operations) {
// Object result = Op.onListOfMap(target);
// return executeOperations(result, operations);
// }
//
// public static final <T> Object testOnListOfSet(List<? extends Set<T>> target,
// List<TestOperation> operations) {
// Object result = Op.onListOfSet(target);
// return executeOperations(result, operations);
// }
public static final <T, U> Object testOnMap(Map<T, U> target,
List<TestOperation> operations) {
Object result = Op.onMap(target);
return executeOperations(result, operations);
}
// public static final <T, U> Object testOnMapOfArrayOf(Type<U> valueType, Map<T, U[]> target,
// List<TestOperation> operations) {
// Object result = Op.onMapOfArrayOf(valueType, target);
// return executeOperations(result, operations);
// }
//
// public static final <T, U> Object testOnMapOfList(Map<T, ? extends List<U>> target,
// List<TestOperation> operations) {
// Object result = Op.onMapOfList(target);
// return executeOperations(result, operations);
// }
//
// public static final <T, U, V> Object testOnMapOfMap(Map<T, ? extends Map<U, V>> target,
// List<TestOperation> operations) {
// Object result = Op.onMapOfMap(target);
// return executeOperations(result, operations);
// }
//
// public static final <T, U> Object testOnMapOfSet(Map<T, ? extends Set<U>> target,
// List<TestOperation> operations) {
// Object result = Op.onMapOfSet(target);
// return executeOperations(result, operations);
// }
public static final <T> Object testOnSet(Set<T> target,
List<TestOperation> operations) {
Object result = Op.onSet(target);
return executeOperations(result, operations);
}
//
// public static final <T> Object testOnSetOfArrayOf(Type<T> type, Set<T[]> target,
// List<TestOperation> operations) {
// Object result = Op.onSetOfArrayOf(type, target);
// return executeOperations(result, operations);
// }
//
// public static final <T> Object testOnSetOfList(Set<? extends List<T>> target,
// List<TestOperation> operations) {
// Object result = Op.onSetOfList(target);
// return executeOperations(result, operations);
// }
//
// public static final <T, U> Object testOnSetOfMap(Set<? extends Map<T, U>> target,
// List<TestOperation> operations) {
// Object result = Op.onSetOfMap(target);
// return executeOperations(result, operations);
// }
//
// public static final <T> Object testOnSetOfSet(Set<? extends Set<T>> target,
// List<TestOperation> operations) {
// Object result = Op.onSetOfSet(target);
// return executeOperations(result, operations);
// }
static final Object executeOperations(Object rootOperator, List<TestOperation> operations) {
try {
Object result = rootOperator;
for (TestOperation operation : operations) {
if (operation.getParams() == null || operation.getParams().length == 0) {
result = new Expression(result, operation.getMethodName(), null).getValue();
} else {
result = new Expression(result, operation.getMethodName(), operation.getParams()).getValue();
}
}
return result;
} catch (Exception e) {
throw new ExecutionException("Error executing op4j chained operations" ,e);
}
}
}
|
UTF-8
|
Java
| 6,040 |
java
|
Test.java
|
Java
|
[] | null |
[] |
package org.op4j.test.auto;
import java.beans.Expression;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.javaruntype.type.Type;
import org.junit.Ignore;
import org.op4j.Op;
import org.op4j.exceptions.ExecutionException;
@Ignore
public class Test {
public static final <T> Object testOn(T target,
List<TestOperation> operations) {
Object result = Op.on(target);
return executeOperations(result, operations);
}
// public static final Object testOnAll(Object[] onParams,
// List<TestOperation> operations) {
// Object result = Op.onAll(onParams);
// return executeOperations(result, operations);
// }
public static final <T> Object testOnArrayOf(Type<T> type, T[] target,
List<TestOperation> operations) {
Object result = Op.onArrayOf(type, target);
return executeOperations(result, operations);
}
//
// public static final <T> Object testOnArrayOfArrayOf(Type<T> type, T[][] target,
// List<TestOperation> operations) {
// Object result = Op.onArrayOfArrayOf(type, target);
// return executeOperations(result, operations);
// }
//
// public static final <T> Object testOnArrayOfList(List<T>[] target,
// List<TestOperation> operations) {
// Object result = Op.onArrayOfList(target);
// return executeOperations(result, operations);
// }
//
// public static final <T, U> Object testOnArrayOfMap(Map<T, U>[] target,
// List<TestOperation> operations) {
// Object result = Op.onArrayOfMap(target);
// return executeOperations(result, operations);
// }
//
// public static final <T> Object testOnArrayOfSet(Set<T>[] target,
// List<TestOperation> operations) {
// Object result = Op.onArrayOfSet(target);
// return executeOperations(result, operations);
// }
public static final <T> Object testOnList(List<T> target,
List<TestOperation> operations) {
Object result = Op.onList(target);
return executeOperations(result, operations);
}
//
// public static final <T> Object testOnListOfArrayOf(Type<T> type, List<T[]> target,
// List<TestOperation> operations) {
// Object result = Op.onListOfArrayOf(type, target);
// return executeOperations(result, operations);
// }
//
// public static final <T> Object testOnListOfList(List<? extends List<T>> target,
// List<TestOperation> operations) {
// Object result = Op.onListOfList(target);
// return executeOperations(result, operations);
// }
//
// public static final <T, U> Object testOnListOfMap(List<? extends Map<T, U>> target,
// List<TestOperation> operations) {
// Object result = Op.onListOfMap(target);
// return executeOperations(result, operations);
// }
//
// public static final <T> Object testOnListOfSet(List<? extends Set<T>> target,
// List<TestOperation> operations) {
// Object result = Op.onListOfSet(target);
// return executeOperations(result, operations);
// }
public static final <T, U> Object testOnMap(Map<T, U> target,
List<TestOperation> operations) {
Object result = Op.onMap(target);
return executeOperations(result, operations);
}
// public static final <T, U> Object testOnMapOfArrayOf(Type<U> valueType, Map<T, U[]> target,
// List<TestOperation> operations) {
// Object result = Op.onMapOfArrayOf(valueType, target);
// return executeOperations(result, operations);
// }
//
// public static final <T, U> Object testOnMapOfList(Map<T, ? extends List<U>> target,
// List<TestOperation> operations) {
// Object result = Op.onMapOfList(target);
// return executeOperations(result, operations);
// }
//
// public static final <T, U, V> Object testOnMapOfMap(Map<T, ? extends Map<U, V>> target,
// List<TestOperation> operations) {
// Object result = Op.onMapOfMap(target);
// return executeOperations(result, operations);
// }
//
// public static final <T, U> Object testOnMapOfSet(Map<T, ? extends Set<U>> target,
// List<TestOperation> operations) {
// Object result = Op.onMapOfSet(target);
// return executeOperations(result, operations);
// }
public static final <T> Object testOnSet(Set<T> target,
List<TestOperation> operations) {
Object result = Op.onSet(target);
return executeOperations(result, operations);
}
//
// public static final <T> Object testOnSetOfArrayOf(Type<T> type, Set<T[]> target,
// List<TestOperation> operations) {
// Object result = Op.onSetOfArrayOf(type, target);
// return executeOperations(result, operations);
// }
//
// public static final <T> Object testOnSetOfList(Set<? extends List<T>> target,
// List<TestOperation> operations) {
// Object result = Op.onSetOfList(target);
// return executeOperations(result, operations);
// }
//
// public static final <T, U> Object testOnSetOfMap(Set<? extends Map<T, U>> target,
// List<TestOperation> operations) {
// Object result = Op.onSetOfMap(target);
// return executeOperations(result, operations);
// }
//
// public static final <T> Object testOnSetOfSet(Set<? extends Set<T>> target,
// List<TestOperation> operations) {
// Object result = Op.onSetOfSet(target);
// return executeOperations(result, operations);
// }
static final Object executeOperations(Object rootOperator, List<TestOperation> operations) {
try {
Object result = rootOperator;
for (TestOperation operation : operations) {
if (operation.getParams() == null || operation.getParams().length == 0) {
result = new Expression(result, operation.getMethodName(), null).getValue();
} else {
result = new Expression(result, operation.getMethodName(), operation.getParams()).getValue();
}
}
return result;
} catch (Exception e) {
throw new ExecutionException("Error executing op4j chained operations" ,e);
}
}
}
| 6,040 | 0.662748 | 0.661921 | 163 | 35.055214 | 27.262022 | 98 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.895705 | false | false |
3
|
43197914b76ead4e1d2a5fa95289ddc70f875a80
| 6,210,522,734,722 |
bc6cdd5ba7d326a8e8b08961d375c7a6c9ae50d9
|
/src/main/java/com/ericsson/ei/rules/RulesObject.java
|
df137e7192fb5fb563e81f0a485a5248f8ca72a2
|
[
"Apache-2.0"
] |
permissive
|
aprudyus/eiffel-intelligence
|
https://github.com/aprudyus/eiffel-intelligence
|
04f40753f694ca479da4bf24dc37c023f8e340d3
|
6bf96c03c32b10359e2be7cefc85badc4030de78
|
refs/heads/master
| 2021-07-09T10:13:14.975000 | 2017-10-08T21:15:52 | 2017-10-08T21:15:52 | 103,252,148 | 0 | 0 | null | true | 2017-09-12T09:43:01 | 2017-09-12T09:43:01 | 2017-08-30T13:10:36 | 2017-09-11T12:54:34 | 138 | 0 | 0 | 0 | null | null | null |
package com.ericsson.ei.rules;
import com.fasterxml.jackson.databind.JsonNode;
public class RulesObject {
private JsonNode rulesObject;
public RulesObject(JsonNode rulesObject) {
super();
this.rulesObject = rulesObject;
}
public JsonNode getJsonRulesObject() {
return rulesObject;
}
public String getMatchIdRules() {
return rulesObject.get("MatchIdRules").toString();
}
public String getIdRule() {
return rulesObject.get("IdRule").textValue();
}
public String getIdentifyRules() {
return rulesObject.get("IdentifyRules").textValue();
}
public String getExtractionRules() {
return rulesObject.get("ExtractionRules").textValue();
}
public String getMergeRules() {
return rulesObject.get("MergeResolverRules").textValue();
}
public String fetchProcessRules() {
return rulesObject.get("ProcessRules").textValue();
}
public boolean equals(Object other) {
if (other instanceof RulesObject) {
return rulesObject.equals(((RulesObject) other).getJsonRulesObject());
}
return (this == other);
}
public boolean isStartEventRules() {
String value = rulesObject.get("StartEvent").textValue().toLowerCase();
return value.equals("yes");
}
}
|
UTF-8
|
Java
| 1,347 |
java
|
RulesObject.java
|
Java
|
[
{
"context": "package com.ericsson.ei.rules;\n\nimport com.fasterxml.jackson.datab",
"end": 16,
"score": 0.7578016519546509,
"start": 12,
"tag": "USERNAME",
"value": "eric"
}
] | null |
[] |
package com.ericsson.ei.rules;
import com.fasterxml.jackson.databind.JsonNode;
public class RulesObject {
private JsonNode rulesObject;
public RulesObject(JsonNode rulesObject) {
super();
this.rulesObject = rulesObject;
}
public JsonNode getJsonRulesObject() {
return rulesObject;
}
public String getMatchIdRules() {
return rulesObject.get("MatchIdRules").toString();
}
public String getIdRule() {
return rulesObject.get("IdRule").textValue();
}
public String getIdentifyRules() {
return rulesObject.get("IdentifyRules").textValue();
}
public String getExtractionRules() {
return rulesObject.get("ExtractionRules").textValue();
}
public String getMergeRules() {
return rulesObject.get("MergeResolverRules").textValue();
}
public String fetchProcessRules() {
return rulesObject.get("ProcessRules").textValue();
}
public boolean equals(Object other) {
if (other instanceof RulesObject) {
return rulesObject.equals(((RulesObject) other).getJsonRulesObject());
}
return (this == other);
}
public boolean isStartEventRules() {
String value = rulesObject.get("StartEvent").textValue().toLowerCase();
return value.equals("yes");
}
}
| 1,347 | 0.648849 | 0.648849 | 53 | 24.415094 | 23.681402 | 82 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.301887 | false | false |
3
|
fce4018f0bb8869e5d28c5cf869f82c7864c7387
| 30,751,965,863,900 |
4276a177aa989299bd4942359cd31d4b6c0d6181
|
/src/main/java/com/kanaxis/sms/dao/SubjectDao.java
|
0d17fe9a594e73b632b4a3bd69bee0dbcccf7359
|
[] |
no_license
|
madhu-horoppa/SMSKanaxis
|
https://github.com/madhu-horoppa/SMSKanaxis
|
e75ea1a3952fb80cdb606cb4fed19c73122b83ad
|
721a939d02d94b8b6f85b7859de4e3cbe8247596
|
refs/heads/master
| 2020-04-15T04:42:09.438000 | 2016-03-27T04:54:45 | 2016-03-27T04:54:45 | 42,056,315 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.kanaxis.sms.dao;
import com.kanaxis.sms.util.ResultData;
public interface SubjectDao {
public ResultData addSubjects(String subjectsDetails);
public ResultData getAllsubjects();
public ResultData getSubjectsByClass(String class_id);
public ResultData updateSubjects(String class_id, String subjectName,
String subject_id);
}
|
UTF-8
|
Java
| 351 |
java
|
SubjectDao.java
|
Java
|
[] | null |
[] |
package com.kanaxis.sms.dao;
import com.kanaxis.sms.util.ResultData;
public interface SubjectDao {
public ResultData addSubjects(String subjectsDetails);
public ResultData getAllsubjects();
public ResultData getSubjectsByClass(String class_id);
public ResultData updateSubjects(String class_id, String subjectName,
String subject_id);
}
| 351 | 0.80057 | 0.80057 | 16 | 20.9375 | 23.535793 | 70 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.9375 | false | false |
3
|
428bc9c1477fad83ce54d129c5a6b7c5a971fa6f
| 29,798,483,132,865 |
ea9a7cc2c5438eae3ef5bb10694f640f469b6146
|
/OnlineShopBackend/src/main/java/com/shop/demo/repository/ProductRepository.java
|
dfbf03a206d911db0f54ded8413ffbd246c3bdd0
|
[] |
no_license
|
BoyanVD/Online_Shop_Backend
|
https://github.com/BoyanVD/Online_Shop_Backend
|
ba1d4b22ece62a1b2fcc599380f8bd1dd86149d6
|
9ef2707defc84d028badf990c4f8fdb40e5fce74
|
refs/heads/master
| 2020-09-16T15:03:55.910000 | 2019-11-25T15:35:14 | 2019-11-25T15:35:14 | 223,808,060 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.shop.demo.repository;
import com.shop.demo.model.entity.Product;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
public interface ProductRepository extends JpaRepository<Product, Long> {
public List<Product> findAll();
public Product findProductById(Long id);
public List<Product> findProductsBySellerId(Long sellerId);
public List<Product> findProductsByIdIn(List<Long> listOfProductIds);
public Product findProductBySeller_IdAndAndName(Long sellerId, String name);
public Product findProductByIdAndSeller_Id(Long productId, Long sellerId);
public Long deleteByIdAndSeller_Id(Long productId, Long sellerId);
}
|
UTF-8
|
Java
| 800 |
java
|
ProductRepository.java
|
Java
|
[] | null |
[] |
package com.shop.demo.repository;
import com.shop.demo.model.entity.Product;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
public interface ProductRepository extends JpaRepository<Product, Long> {
public List<Product> findAll();
public Product findProductById(Long id);
public List<Product> findProductsBySellerId(Long sellerId);
public List<Product> findProductsByIdIn(List<Long> listOfProductIds);
public Product findProductBySeller_IdAndAndName(Long sellerId, String name);
public Product findProductByIdAndSeller_Id(Long productId, Long sellerId);
public Long deleteByIdAndSeller_Id(Long productId, Long sellerId);
}
| 800 | 0.815 | 0.815 | 26 | 29.76923 | 29.597696 | 78 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.653846 | false | false |
3
|
487d4519cb1d82f4232b73dbe44cc64dfdc915f4
| 14,800,457,336,778 |
2e1f147ffc358f039479d73cdda1b2405922c645
|
/src/main/java/com/pangu/Util/HttpUtil.java
|
c29686d29bbf8156e71d162895c1b187d12aa165
|
[] |
no_license
|
EarWheat/Pangu
|
https://github.com/EarWheat/Pangu
|
67df962848baae6455002ff5bc44ed34043e1006
|
b64598001c12b395bb4ca3654842afff45572b8d
|
refs/heads/master
| 2022-07-11T05:59:38.848000 | 2022-06-16T02:14:52 | 2022-06-16T02:14:52 | 229,016,824 | 0 | 0 | null | false | 2022-06-29T17:59:29 | 2019-12-19T09:10:17 | 2021-10-04T08:27:27 | 2022-06-29T17:59:28 | 59 | 0 | 0 | 3 |
Java
| false | false |
package com.pangu.Util;
/**
* @author liuzhaoluliuzhaolu
* @date 2021/6/21 下午5:08
* @desc Http工具类
* @prd
* @Modification History:
* Date Author Description
* ------------------------------------------ *
*/
public class HttpUtil {
}
|
UTF-8
|
Java
| 268 |
java
|
HttpUtil.java
|
Java
|
[
{
"context": "package com.pangu.Util;\n\n/**\n * @author liuzhaoluliuzhaolu\n * @date 2021/6/21 下午5:08\n * @desc Http工具类\n * @pr",
"end": 58,
"score": 0.9992761611938477,
"start": 40,
"tag": "USERNAME",
"value": "liuzhaoluliuzhaolu"
}
] | null |
[] |
package com.pangu.Util;
/**
* @author liuzhaoluliuzhaolu
* @date 2021/6/21 下午5:08
* @desc Http工具类
* @prd
* @Modification History:
* Date Author Description
* ------------------------------------------ *
*/
public class HttpUtil {
}
| 268 | 0.511628 | 0.472868 | 13 | 18.846153 | 14.970978 | 47 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.076923 | false | false |
3
|
2fcc3867928406bfd28107541ed372a61698bf0d
| 11,003,706,227,006 |
a497bb0084e9c9fcedaf39cc5bcd33c8d646a354
|
/2.JavaCore/src/com/javarush/task/task18/task1820/Solution.java
|
9b54539dc37533158ff536ec6b6ac962edebca4e
|
[] |
no_license
|
RomanKulik/JavaRush
|
https://github.com/RomanKulik/JavaRush
|
5e7cc2ce03e4d363a0c4a445b4506a54adcf990a
|
ba4681d62b33add93007408474a6e704ed9bb800
|
refs/heads/master
| 2022-11-08T02:08:04.139000 | 2022-10-13T19:34:58 | 2022-10-13T19:34:58 | 139,819,700 | 3 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.javarush.task.task18.task1820;
/*
Округление чисел
Округление чисел
Считать с консоли 2 имени файла.
Первый файл содержит вещественные(дробные) числа, разделенные пробелом. Например, 3.1415.
Округлить числа до целых и записать через пробел во второй файл.
Закрыть потоки.
Принцип округления:
3.49 => 3
3.50 => 4
3.51 => 4
-3.49 => -3
-3.50 => -3
-3.51 => -4
Требования:
1. Программа должна два раза считать имена файлов с консоли.
2. Для первого файла создай поток для чтения. Для второго - поток для записи.
3. Считать числа из первого файла, округлить их и записать через пробел во второй.
4. Должны соблюдаться принципы округления, указанные в задании.
5. Созданные для файлов потоки должны быть закрыты.
*/
import java.io.*;;
import java.util.ArrayList;
import java.util.List;
public class Solution {
public static void main(String[] args) throws IOException {
try (BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
InputStream in = new FileInputStream(reader.readLine()/*"d:/11.txt"*/); // 3.49 3.50 3.51 -3.49 -3.50 -3.51
FileOutputStream out = new FileOutputStream(reader.readLine()/*"d:/12.txt"*/)) { // empty
copyDoubleFromIn_ToIntInOut(in, out);
} catch (IOException e) {
System.out.println(e);
}
}
private static void copyDoubleFromIn_ToIntInOut(InputStream in, FileOutputStream out) throws IOException {
byte[] inBuff = new byte[in.available()];
in.read(inBuff);
for (double d : byteArrToDoubleList(inBuff)) {
Integer number = (int) Math.round(d);
out.write((number.toString() + " ").getBytes());
}
out.flush();
}
private static List<Double> byteArrToDoubleList(byte[] buff) {
List<Double> doubles = new ArrayList<>();
StringBuilder sb = new StringBuilder();
for (byte b : buff) {
if (b != (byte) ' ') {
sb.append((char) b);
} else {
doubles.add(Double.parseDouble(sb.toString()));
sb = new StringBuilder();
}
}
doubles.add(Double.parseDouble(sb.toString()));
return doubles;
}
}
/*public class Solution {
public static void main(String[] args) {
}
}*/
|
UTF-8
|
Java
| 2,812 |
java
|
Solution.java
|
Java
|
[] | null |
[] |
package com.javarush.task.task18.task1820;
/*
Округление чисел
Округление чисел
Считать с консоли 2 имени файла.
Первый файл содержит вещественные(дробные) числа, разделенные пробелом. Например, 3.1415.
Округлить числа до целых и записать через пробел во второй файл.
Закрыть потоки.
Принцип округления:
3.49 => 3
3.50 => 4
3.51 => 4
-3.49 => -3
-3.50 => -3
-3.51 => -4
Требования:
1. Программа должна два раза считать имена файлов с консоли.
2. Для первого файла создай поток для чтения. Для второго - поток для записи.
3. Считать числа из первого файла, округлить их и записать через пробел во второй.
4. Должны соблюдаться принципы округления, указанные в задании.
5. Созданные для файлов потоки должны быть закрыты.
*/
import java.io.*;;
import java.util.ArrayList;
import java.util.List;
public class Solution {
public static void main(String[] args) throws IOException {
try (BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
InputStream in = new FileInputStream(reader.readLine()/*"d:/11.txt"*/); // 3.49 3.50 3.51 -3.49 -3.50 -3.51
FileOutputStream out = new FileOutputStream(reader.readLine()/*"d:/12.txt"*/)) { // empty
copyDoubleFromIn_ToIntInOut(in, out);
} catch (IOException e) {
System.out.println(e);
}
}
private static void copyDoubleFromIn_ToIntInOut(InputStream in, FileOutputStream out) throws IOException {
byte[] inBuff = new byte[in.available()];
in.read(inBuff);
for (double d : byteArrToDoubleList(inBuff)) {
Integer number = (int) Math.round(d);
out.write((number.toString() + " ").getBytes());
}
out.flush();
}
private static List<Double> byteArrToDoubleList(byte[] buff) {
List<Double> doubles = new ArrayList<>();
StringBuilder sb = new StringBuilder();
for (byte b : buff) {
if (b != (byte) ' ') {
sb.append((char) b);
} else {
doubles.add(Double.parseDouble(sb.toString()));
sb = new StringBuilder();
}
}
doubles.add(Double.parseDouble(sb.toString()));
return doubles;
}
}
/*public class Solution {
public static void main(String[] args) {
}
}*/
| 2,812 | 0.632759 | 0.605603 | 75 | 29.933332 | 29.482349 | 120 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.36 | false | false |
3
|
726a6acde7a8b0706ae146ac966975f2bc904954
| 2,224,793,085,932 |
ae5d7cf8a6bab1f2663d203a2481f608f75c18f8
|
/webflux/src/main/java/com/helena128/webflux/config/WebClientConfiguration.java
|
93e9b05b3a3e76792fefae3971868f4dfd87dd0e
|
[] |
no_license
|
helena128/ReactiveDemo
|
https://github.com/helena128/ReactiveDemo
|
35efc448726b25d68afbe6ff44db1b0ed3975b93
|
ccb937e7be6e32000fcc9529f0eca81f5032959b
|
refs/heads/master
| 2023-01-12T13:14:22.222000 | 2020-11-16T17:32:14 | 2020-11-16T17:32:14 | 313,057,466 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.helena128.webflux.config;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.reactive.function.client.WebClient;
@Configuration
public class WebClientConfiguration {
@Value("${external.api.url}")
private String apiUrl;
@Bean
public WebClient webClient() {
return WebClient.builder().baseUrl(apiUrl).build();
}
}
|
UTF-8
|
Java
| 509 |
java
|
WebClientConfiguration.java
|
Java
|
[
{
"context": "package com.helena128.webflux.config;\n\nimport org.springframework.beans",
"end": 21,
"score": 0.6942797303199768,
"start": 14,
"tag": "USERNAME",
"value": "lena128"
}
] | null |
[] |
package com.helena128.webflux.config;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.reactive.function.client.WebClient;
@Configuration
public class WebClientConfiguration {
@Value("${external.api.url}")
private String apiUrl;
@Bean
public WebClient webClient() {
return WebClient.builder().baseUrl(apiUrl).build();
}
}
| 509 | 0.770138 | 0.764244 | 19 | 25.789474 | 23.761045 | 66 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.368421 | false | false |
3
|
3144eda7475e5b69335981faa866418a25eadeeb
| 5,411,658,809,880 |
24ad530924a079d72bf63f52150f8b514807d17e
|
/core/src/main/java/org/neo4j/ogm/session/request/strategy/impl/NodeDeleteStatements.java
|
b04e66ca31b1730cf185848372be67f9e506edba
|
[
"Apache-2.0",
"GPL-3.0-only"
] |
permissive
|
neo4j/neo4j-ogm
|
https://github.com/neo4j/neo4j-ogm
|
bf05ac139a00e6dcffb9bf8484913c1e9a42a5d1
|
c51a7637c8e591c2ecfb57463b945d078a6dfff4
|
refs/heads/master
| 2023-09-06T05:25:12.374000 | 2023-08-28T13:24:12 | 2023-08-28T13:24:12 | 24,224,646 | 351 | 224 |
Apache-2.0
| false | 2023-07-26T14:39:14 | 2014-09-19T09:43:23 | 2023-07-25T13:53:14 | 2023-07-26T14:39:13 | 18,513 | 314 | 159 | 3 |
Java
| false | false |
/*
* Copyright (c) 2002-2023 "Neo4j,"
* Neo4j Sweden AB [http://neo4j.com]
*
* This file is part of Neo4j.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.neo4j.ogm.session.request.strategy.impl;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
import org.neo4j.ogm.cypher.Filter;
import org.neo4j.ogm.cypher.query.CypherQuery;
import org.neo4j.ogm.cypher.query.DefaultRowModelRequest;
import org.neo4j.ogm.metadata.ClassInfo;
import org.neo4j.ogm.metadata.FieldInfo;
import org.neo4j.ogm.request.OptimisticLockingConfig;
import org.neo4j.ogm.session.request.FilteredQuery;
import org.neo4j.ogm.session.request.FilteredQueryBuilder;
import org.neo4j.ogm.session.request.strategy.DeleteStatements;
/**
* @author Luanne Misquitta
* @author Michael J. Simons
*/
public class NodeDeleteStatements implements DeleteStatements {
@Override
public CypherQuery delete(Long id) {
return new DefaultRowModelRequest("MATCH (n) WHERE ID(n) = $id OPTIONAL MATCH (n)-[r0]-() DELETE r0, n",
Collections.singletonMap("id", id));
}
@Override
public CypherQuery delete(Long id, Object object, ClassInfo classInfo) {
FieldInfo versionField = classInfo.getVersionField();
Long version = (Long) versionField.read(object);
OptimisticLockingConfig optimisticLockingConfig = new OptimisticLockingConfig(1,
classInfo.staticLabels().toArray(new String[] {}), versionField.property(),
Optional.ofNullable(classInfo.primaryIndexField()).map(FieldInfo::propertyName).orElse(null));
Map<String, Object> params = new HashMap<>();
params.put("id", id);
params.put("version", version);
params.put("type", "node");
return new DefaultRowModelRequest("MATCH (n) "
+ " WHERE id(n) = $id AND n.`" + versionField.property() + "` = $version "
+ "SET "
+ " n.`" + versionField.property() + "` = n.`" + versionField.property() + "` + 1 "
+ "WITH n "
+ " WHERE n.`" + versionField.property() + "` = $version + 1 "
+ "OPTIONAL MATCH (n)-[r0]-() "
+ "DELETE r0, n "
+ "RETURN DISTINCT id(n) AS id", // Use DISTINCT because node may have multiple relationships
params,
optimisticLockingConfig);
}
@Override
public CypherQuery delete(Collection<Long> ids) {
return new DefaultRowModelRequest("MATCH (n) WHERE ID(n) in $ids OPTIONAL MATCH (n)-[r0]-() DELETE r0, n",
Collections.singletonMap("ids", ids));
}
@Override
public CypherQuery deleteAll() {
return new DefaultRowModelRequest("MATCH (n) OPTIONAL MATCH (n)-[r0]-() DELETE r0, n", Collections.emptyMap());
}
@Override
public CypherQuery delete(String label) {
return new DefaultRowModelRequest(
String.format("MATCH (n:`%s`) OPTIONAL MATCH (n)-[r0]-() DELETE r0, n", label), Collections.emptyMap());
}
@Override
public CypherQuery delete(String label, Iterable<Filter> filters) {
FilteredQuery query = FilteredQueryBuilder.buildNodeQuery(label, filters);
query.setReturnClause(" OPTIONAL MATCH (n)-[r0]-() DELETE r0, n");
return new DefaultRowModelRequest(query.statement(), query.parameters());
}
@Override
public CypherQuery deleteAndList(String label, Iterable<Filter> filters) {
FilteredQuery query = FilteredQueryBuilder.buildNodeQuery(label, filters);
query.setReturnClause(" OPTIONAL MATCH (n)-[r0]-() DELETE r0, n RETURN ID(n)");
return new DefaultRowModelRequest(query.statement(), query.parameters());
}
}
|
UTF-8
|
Java
| 4,263 |
java
|
NodeDeleteStatements.java
|
Java
|
[
{
"context": "request.strategy.DeleteStatements;\n\n/**\n * @author Luanne Misquitta\n * @author Michael J. Simons\n */\npublic class Nod",
"end": 1346,
"score": 0.9998915195465088,
"start": 1330,
"tag": "NAME",
"value": "Luanne Misquitta"
},
{
"context": "ments;\n\n/**\n * @author Luanne Misquitta\n * @author Michael J. Simons\n */\npublic class NodeDeleteStatements implements ",
"end": 1375,
"score": 0.9998814463615417,
"start": 1358,
"tag": "NAME",
"value": "Michael J. Simons"
}
] | null |
[] |
/*
* Copyright (c) 2002-2023 "Neo4j,"
* Neo4j Sweden AB [http://neo4j.com]
*
* This file is part of Neo4j.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.neo4j.ogm.session.request.strategy.impl;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
import org.neo4j.ogm.cypher.Filter;
import org.neo4j.ogm.cypher.query.CypherQuery;
import org.neo4j.ogm.cypher.query.DefaultRowModelRequest;
import org.neo4j.ogm.metadata.ClassInfo;
import org.neo4j.ogm.metadata.FieldInfo;
import org.neo4j.ogm.request.OptimisticLockingConfig;
import org.neo4j.ogm.session.request.FilteredQuery;
import org.neo4j.ogm.session.request.FilteredQueryBuilder;
import org.neo4j.ogm.session.request.strategy.DeleteStatements;
/**
* @author <NAME>
* @author <NAME>
*/
public class NodeDeleteStatements implements DeleteStatements {
@Override
public CypherQuery delete(Long id) {
return new DefaultRowModelRequest("MATCH (n) WHERE ID(n) = $id OPTIONAL MATCH (n)-[r0]-() DELETE r0, n",
Collections.singletonMap("id", id));
}
@Override
public CypherQuery delete(Long id, Object object, ClassInfo classInfo) {
FieldInfo versionField = classInfo.getVersionField();
Long version = (Long) versionField.read(object);
OptimisticLockingConfig optimisticLockingConfig = new OptimisticLockingConfig(1,
classInfo.staticLabels().toArray(new String[] {}), versionField.property(),
Optional.ofNullable(classInfo.primaryIndexField()).map(FieldInfo::propertyName).orElse(null));
Map<String, Object> params = new HashMap<>();
params.put("id", id);
params.put("version", version);
params.put("type", "node");
return new DefaultRowModelRequest("MATCH (n) "
+ " WHERE id(n) = $id AND n.`" + versionField.property() + "` = $version "
+ "SET "
+ " n.`" + versionField.property() + "` = n.`" + versionField.property() + "` + 1 "
+ "WITH n "
+ " WHERE n.`" + versionField.property() + "` = $version + 1 "
+ "OPTIONAL MATCH (n)-[r0]-() "
+ "DELETE r0, n "
+ "RETURN DISTINCT id(n) AS id", // Use DISTINCT because node may have multiple relationships
params,
optimisticLockingConfig);
}
@Override
public CypherQuery delete(Collection<Long> ids) {
return new DefaultRowModelRequest("MATCH (n) WHERE ID(n) in $ids OPTIONAL MATCH (n)-[r0]-() DELETE r0, n",
Collections.singletonMap("ids", ids));
}
@Override
public CypherQuery deleteAll() {
return new DefaultRowModelRequest("MATCH (n) OPTIONAL MATCH (n)-[r0]-() DELETE r0, n", Collections.emptyMap());
}
@Override
public CypherQuery delete(String label) {
return new DefaultRowModelRequest(
String.format("MATCH (n:`%s`) OPTIONAL MATCH (n)-[r0]-() DELETE r0, n", label), Collections.emptyMap());
}
@Override
public CypherQuery delete(String label, Iterable<Filter> filters) {
FilteredQuery query = FilteredQueryBuilder.buildNodeQuery(label, filters);
query.setReturnClause(" OPTIONAL MATCH (n)-[r0]-() DELETE r0, n");
return new DefaultRowModelRequest(query.statement(), query.parameters());
}
@Override
public CypherQuery deleteAndList(String label, Iterable<Filter> filters) {
FilteredQuery query = FilteredQueryBuilder.buildNodeQuery(label, filters);
query.setReturnClause(" OPTIONAL MATCH (n)-[r0]-() DELETE r0, n RETURN ID(n)");
return new DefaultRowModelRequest(query.statement(), query.parameters());
}
}
| 4,242 | 0.673704 | 0.663617 | 106 | 39.21698 | 32.972546 | 119 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.660377 | false | false |
3
|
c41470e99650ce7a9980a9e6ccef2e1044869234
| 27,341,761,828,473 |
d02efdb9497473df7f2bd329c2b69fe13b59102a
|
/app-service/src/main/java/com/cosmoplat/example/service/RedisExampleService.java
|
ee3a69e71b538fbc719b95aefe62207210aef484
|
[] |
no_license
|
adsfskk/industry-app-framework
|
https://github.com/adsfskk/industry-app-framework
|
88bb62748b1799d8b44384978733c5a73081f42f
|
772377a3d18d1807093e9d065894db9a7a3c027b
|
refs/heads/master
| 2022-11-28T15:16:05.570000 | 2020-07-07T08:08:35 | 2020-07-07T08:08:35 | 276,517,081 | 0 | 1 | null | true | 2020-07-02T01:15:14 | 2020-07-02T01:15:13 | 2020-07-02T01:15:11 | 2020-07-01T11:46:59 | 51 | 0 | 0 | 0 | null | false | false |
package com.cosmoplat.example.service;
/**
* @author 27279
*/
public interface RedisExampleService {
/**
* @param rediskey
* @return
*/
Object andRedis(String rediskey);
/**
*
* @param rediskey
*/
void removeRedis(String rediskey);
}
|
UTF-8
|
Java
| 286 |
java
|
RedisExampleService.java
|
Java
|
[
{
"context": "ge com.cosmoplat.example.service;\n\n/**\n * @author 27279\n */\npublic interface RedisExampleService {\n\n /",
"end": 60,
"score": 0.9949439764022827,
"start": 55,
"tag": "USERNAME",
"value": "27279"
}
] | null |
[] |
package com.cosmoplat.example.service;
/**
* @author 27279
*/
public interface RedisExampleService {
/**
* @param rediskey
* @return
*/
Object andRedis(String rediskey);
/**
*
* @param rediskey
*/
void removeRedis(String rediskey);
}
| 286 | 0.583916 | 0.566434 | 19 | 14.052631 | 13.949057 | 39 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.157895 | false | false |
3
|
3c81418c052bc9adf388c9e5ba673193c0e088ac
| 5,471,788,364,528 |
cbf430cc6c7a201842029f41359d1d092fc56111
|
/cadpage/src/net/anei/cadpage/parsers/NJ/NJCamdenCountyAParser.java
|
81c1c367479df8c1f6569d1af03278c30fb91ff4
|
[] |
no_license
|
JBassett/cadpage
|
https://github.com/JBassett/cadpage
|
65be96632d2179af7717143ab233ce3b8d3e7319
|
3c0c97f269b855f3d7e4a6976cd179d76df60d6e
|
refs/heads/master
| 2016-09-06T08:52:10.364000 | 2015-01-28T05:45:14 | 2015-01-28T05:45:14 | 29,971,570 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package net.anei.cadpage.parsers.NJ;
import java.util.Properties;
import net.anei.cadpage.parsers.dispatch.DispatchArchonixParser;
public class NJCamdenCountyAParser extends DispatchArchonixParser {
public NJCamdenCountyAParser() {
super(CITY_CODES, "CAMDEN COUNTY", "NJ");
}
@Override
public String getFilter() {
return "cccademail@camdencounty.com";
}
private static final Properties CITY_CODES = buildCodeTable(new String[]{
"01", "Audubon",
"01 01", "Audubon",
"02", "Audubon Park",
"02 02", "Audubon Park",
"03", "Barrington",
"03 03", "Barrington",
"04", "Bellmawr",
"04 04", "Bellmawr",
"05", "Berlin",
"05 05", "Berlin",
"06", "Berlin Twp",
"06 06", "Berlin Twp",
"07", "Brooklawn",
"07 07", "Brooklawn",
"08", "Camden City",
"08 08", "Camden City",
"09", "Chesilhurst",
"09 09", "Chesilhurst",
"10", "Clementon",
"10 10", "Clementon",
"11", "Collingswood",
"11 11", "Collingswood",
"12", "Cherry Hill",
"12 12", "Cherry Hill",
"13", "Gibbsboro",
"13 13", "Gibbsboro",
"14", "Gloucester City",
"14 14", "Gloucester City",
"15", "Gloucester Twp",
"15 15", "Gloucester Twp",
"16", "Haddon Twp",
"16 16", "Haddon Twp",
"17", "Haddonfield",
"17 17", "Haddonfield",
"18", "Haddon Heights",
"18 18", "Haddon Heights",
"19", "Hi-Nella",
"19 19", "Hi-Nella",
"20", "Laurel Springs",
"20 20", "Laurel Springs",
"21", "Lawnside",
"21 21", "Lawnside",
"22", "Lindenwold",
"22 22", "Lindenwold",
"23", "Magnolia",
"23 23", "Magnolia",
"24", "Merchantville",
"24 24", "Merchantville",
"25", "Mount Ephraim",
"25 25", "Mount Ephraim",
"26", "Oaklyn",
"26 26", "Oaklyn",
"27", "Pennsauken Twp",
"27 27", "Pennsauken Twp",
"28", "Pine Hill",
"28 28", "Pine Hill",
"29", "Pine Valley",
"29 29", "Pine Valley",
"30", "Runnemede",
"30 30", "Runnemede",
"31", "Somerdale",
"31 31", "Somerdale",
"32", "Stratford",
"32 32", "Stratford",
"33", "Tavistock",
"33 33", "Tavistock",
"34", "Voorhees Twp",
"34 34", "Voorhees Twp",
"35", "Waterford Twp",
"35 35", "Waterford Twp",
"36", "Winslow Twp",
"36 36", "Winslow Twp",
"37", "Woodlyne",
"37 37", "Woodlyne",
"44", "",
"44 44", "",
"63", "",
"63 63", ""
});
}
|
UTF-8
|
Java
| 2,560 |
java
|
NJCamdenCountyAParser.java
|
Java
|
[
{
"context": "verride\n public String getFilter() {\n return \"cccademail@camdencounty.com\";\n }\n\n private static final Properties CITY_COD",
"end": 376,
"score": 0.9999241232872009,
"start": 349,
"tag": "EMAIL",
"value": "cccademail@camdencounty.com"
},
{
"context": "w String[]{\n \"01\", \"Audubon\",\n \"01 01\", \"Audubon\",\n \"02\", \"Audubon Park\",\n \"02 02\", \"Audu",
"end": 505,
"score": 0.7282907366752625,
"start": 498,
"tag": "NAME",
"value": "Audubon"
},
{
"context": "Park\",\n \"02 02\", \"Audubon Park\",\n \"03\", \"Barrington\",\n \"03 03\", \"Barrington\",\n \"04\", \"Bellma",
"end": 590,
"score": 0.7662169337272644,
"start": 580,
"tag": "NAME",
"value": "Barrington"
},
{
"context": "n Park\",\n \"03\", \"Barrington\",\n \"03 03\", \"Barrington\",\n \"04\", \"Bellmawr\",\n \"04 04\", \"Bellm",
"end": 614,
"score": 0.7757226824760437,
"start": 607,
"tag": "NAME",
"value": "Barring"
},
{
"context": "ngton\",\n \"03 03\", \"Barrington\",\n \"04\", \"Bellmawr\",\n \"04 04\", \"Bellmawr\",\n \"05\", \"Berl",
"end": 638,
"score": 0.537554144859314,
"start": 635,
"tag": "NAME",
"value": "ell"
},
{
"context": ",\n \"03 03\", \"Barrington\",\n \"04\", \"Bellmawr\",\n \"04 04\", \"Bellmawr\",\n \"05\", \"Berlin\",",
"end": 642,
"score": 0.6844921112060547,
"start": 641,
"tag": "NAME",
"value": "r"
},
{
"context": " \"Bellmawr\",\n \"05\", \"Berlin\",\n \"05 05\", \"Berlin\",\n \"06\", \"Berlin Twp\",\n \"06 06\", \"Ber",
"end": 710,
"score": 0.535900354385376,
"start": 707,
"tag": "NAME",
"value": "Ber"
},
{
"context": "lin Twp\",\n \"07\", \"Brooklawn\",\n \"07 07\", \"Brooklawn\",\n \"08\", \"Camden City\",\n \"08 08\", \"C",
"end": 815,
"score": 0.6406041979789734,
"start": 810,
"tag": "NAME",
"value": "Brook"
},
{
"context": " City\",\n \"08 08\", \"Camden City\",\n \"09\", \"Chesilhurst\",\n \"09 09\", \"Chesilhurst\",\n \"10\", \"Cleme",
"end": 903,
"score": 0.8441678881645203,
"start": 892,
"tag": "NAME",
"value": "Chesilhurst"
},
{
"context": "City\",\n \"09\", \"Chesilhurst\",\n \"09 09\", \"Chesilhurst\",\n \"10\", \"Clementon\",\n \"10 10\", \"Clement",
"end": 931,
"score": 0.6661162972450256,
"start": 921,
"tag": "NAME",
"value": "hesilhurst"
},
{
"context": "hurst\",\n \"09 09\", \"Chesilhurst\",\n \"10\", \"Clementon\",\n \"10 10\", \"Clementon\",\n \"11\", \"Colling",
"end": 957,
"score": 0.9995852112770081,
"start": 948,
"tag": "NAME",
"value": "Clementon"
},
{
"context": "ilhurst\",\n \"10\", \"Clementon\",\n \"10 10\", \"Clementon\",\n \"11\", \"Collingswood\",\n \"11 11\", \"Coll",
"end": 983,
"score": 0.9992194175720215,
"start": 974,
"tag": "NAME",
"value": "Clementon"
},
{
"context": "ementon\",\n \"10 10\", \"Clementon\",\n \"11\", \"Collingswood\",\n \"11 11\", \"Collingswood\",\n \"12\", \"Cher",
"end": 1012,
"score": 0.9978519678115845,
"start": 1000,
"tag": "NAME",
"value": "Collingswood"
},
{
"context": "nton\",\n \"11\", \"Collingswood\",\n \"11 11\", \"Collingswood\",\n \"12\", \"Cherry Hill\",\n \"12 12\", \"Cherr",
"end": 1041,
"score": 0.9941569566726685,
"start": 1029,
"tag": "NAME",
"value": "Collingswood"
},
{
"context": "wood\",\n \"11 11\", \"Collingswood\",\n \"12\", \"Cherry Hill\",\n \"12 12\", \"Cherry Hill\",\n \"13\", \"Gibbs",
"end": 1069,
"score": 0.9981716871261597,
"start": 1058,
"tag": "NAME",
"value": "Cherry Hill"
},
{
"context": "swood\",\n \"12\", \"Cherry Hill\",\n \"12 12\", \"Cherry Hill\",\n \"13\", \"Gibbsboro\",\n \"13 13\", \"Gibbsbo",
"end": 1097,
"score": 0.9959940314292908,
"start": 1086,
"tag": "NAME",
"value": "Cherry Hill"
},
{
"context": "ty\",\n \"15\", \"Gloucester Twp\",\n \"15 15\", \"Gloucester Twp\",\n \"16\", \"Haddon Twp\",\n \"16 16\", \"Hadd",
"end": 1273,
"score": 0.9387539029121399,
"start": 1261,
"tag": "NAME",
"value": "Gloucester T"
},
{
"context": "wp\",\n \"15 15\", \"Gloucester Twp\",\n \"16\", \"Haddon Twp\",\n \"16 16\", \"Haddon Twp\",\n \"17\", \"Haddon",
"end": 1302,
"score": 0.926488995552063,
"start": 1292,
"tag": "NAME",
"value": "Haddon Twp"
},
{
"context": "er Twp\",\n \"16\", \"Haddon Twp\",\n \"16 16\", \"Haddon Twp\",\n \"17\", \"Haddonfield\",\n \"17 17\", \"Haddo",
"end": 1329,
"score": 0.9720973372459412,
"start": 1319,
"tag": "NAME",
"value": "Haddon Twp"
},
{
"context": "on Twp\",\n \"16 16\", \"Haddon Twp\",\n \"17\", \"Haddonfield\",\n \"17 17\", \"Haddonfield\",\n \"18\", \"Haddo",
"end": 1357,
"score": 0.9989852905273438,
"start": 1346,
"tag": "NAME",
"value": "Haddonfield"
},
{
"context": "n Twp\",\n \"17\", \"Haddonfield\",\n \"17 17\", \"Haddonfield\",\n \"18\", \"Haddon Heights\",\n \"18 18\", \"Ha",
"end": 1385,
"score": 0.9992249011993408,
"start": 1374,
"tag": "NAME",
"value": "Haddonfield"
},
{
"context": "field\",\n \"17 17\", \"Haddonfield\",\n \"18\", \"Haddon Heights\",\n \"18 18\", \"Haddon Heights\",\n \"19\", \"Hi",
"end": 1416,
"score": 0.9985878467559814,
"start": 1402,
"tag": "NAME",
"value": "Haddon Heights"
},
{
"context": "ld\",\n \"18\", \"Haddon Heights\",\n \"18 18\", \"Haddon Heights\",\n \"19\", \"Hi-Nella\",\n \"19 19\", \"Hi-Nella",
"end": 1447,
"score": 0.9962916374206543,
"start": 1433,
"tag": "NAME",
"value": "Haddon Heights"
},
{
"context": "ts\",\n \"18 18\", \"Haddon Heights\",\n \"19\", \"Hi-Nella\",\n \"19 19\", \"Hi-Nella\",\n \"20\", \"Laurel S",
"end": 1472,
"score": 0.9986070990562439,
"start": 1464,
"tag": "NAME",
"value": "Hi-Nella"
},
{
"context": " Heights\",\n \"19\", \"Hi-Nella\",\n \"19 19\", \"Hi-Nella\",\n \"20\", \"Laurel Springs\",\n \"20 20\", \"La",
"end": 1497,
"score": 0.9934349060058594,
"start": 1489,
"tag": "NAME",
"value": "Hi-Nella"
},
{
"context": "gs\",\n \"20 20\", \"Laurel Springs\",\n \"21\", \"Lawnside\",\n \"21 21\", \"Lawnside\",\n \"22\", \"Lindenwo",
"end": 1584,
"score": 0.8707065582275391,
"start": 1576,
"tag": "NAME",
"value": "Lawnside"
},
{
"context": " Springs\",\n \"21\", \"Lawnside\",\n \"21 21\", \"Lawnside\",\n \"22\", \"Lindenwold\",\n \"22 22\", \"Linden",
"end": 1609,
"score": 0.9279047846794128,
"start": 1601,
"tag": "NAME",
"value": "Lawnside"
},
{
"context": "Lawnside\",\n \"21 21\", \"Lawnside\",\n \"22\", \"Lindenwold\",\n \"22 22\", \"Lindenwold\",\n \"23\", \"Magnol",
"end": 1636,
"score": 0.9983175992965698,
"start": 1626,
"tag": "NAME",
"value": "Lindenwold"
},
{
"context": "wnside\",\n \"22\", \"Lindenwold\",\n \"22 22\", \"Lindenwold\",\n \"23\", \"Magnolia\",\n \"23 23\", \"Magnolia",
"end": 1663,
"score": 0.9982481598854065,
"start": 1653,
"tag": "NAME",
"value": "Lindenwold"
},
{
"context": "enwold\",\n \"22 22\", \"Lindenwold\",\n \"23\", \"Magnolia\",\n \"23 23\", \"Magnolia\",\n \"24\", \"Merchant",
"end": 1688,
"score": 0.9994766116142273,
"start": 1680,
"tag": "NAME",
"value": "Magnolia"
},
{
"context": "ndenwold\",\n \"23\", \"Magnolia\",\n \"23 23\", \"Magnolia\",\n \"24\", \"Merchantville\",\n \"24 24\", \"Mer",
"end": 1713,
"score": 0.9995520710945129,
"start": 1705,
"tag": "NAME",
"value": "Magnolia"
},
{
"context": "Magnolia\",\n \"23 23\", \"Magnolia\",\n \"24\", \"Merchantville\",\n \"24 24\", \"Merchantville\",\n \"25\", \"Mou",
"end": 1743,
"score": 0.9733608961105347,
"start": 1730,
"tag": "NAME",
"value": "Merchantville"
},
{
"context": "lia\",\n \"24\", \"Merchantville\",\n \"24 24\", \"Merchantville\",\n \"25\", \"Mount Ephraim\",\n \"25 25\", \"Mou",
"end": 1773,
"score": 0.9539274573326111,
"start": 1760,
"tag": "NAME",
"value": "Merchantville"
},
{
"context": "lle\",\n \"24 24\", \"Merchantville\",\n \"25\", \"Mount Ephraim\",\n \"25 25\", \"Mount Ephraim\",\n \"26\", \"Oak",
"end": 1803,
"score": 0.9931915402412415,
"start": 1790,
"tag": "NAME",
"value": "Mount Ephraim"
},
{
"context": "lle\",\n \"25\", \"Mount Ephraim\",\n \"25 25\", \"Mount Ephraim\",\n \"26\", \"Oaklyn\",\n \"26 26\", \"Oaklyn\",\n ",
"end": 1833,
"score": 0.9914718866348267,
"start": 1820,
"tag": "NAME",
"value": "Mount Ephraim"
},
{
"context": "aim\",\n \"25 25\", \"Mount Ephraim\",\n \"26\", \"Oaklyn\",\n \"26 26\", \"Oaklyn\",\n \"27\", \"Pennsauken",
"end": 1856,
"score": 0.9834652543067932,
"start": 1850,
"tag": "NAME",
"value": "Oaklyn"
},
{
"context": "nt Ephraim\",\n \"26\", \"Oaklyn\",\n \"26 26\", \"Oaklyn\",\n \"27\", \"Pennsauken Twp\",\n \"27 27\", \"Pe",
"end": 1879,
"score": 0.9712308049201965,
"start": 1873,
"tag": "NAME",
"value": "Oaklyn"
},
{
"context": " \"Oaklyn\",\n \"26 26\", \"Oaklyn\",\n \"27\", \"Pennsauken Twp\",\n \"27 27\", \"Pennsauken Twp\",\n \"28\", \"Pi",
"end": 1910,
"score": 0.9127089381217957,
"start": 1896,
"tag": "NAME",
"value": "Pennsauken Twp"
},
{
"context": "yn\",\n \"27\", \"Pennsauken Twp\",\n \"27 27\", \"Pennsauken Twp\",\n \"28\", \"Pine Hill\",\n \"28 28\", \"Pine Hi",
"end": 1941,
"score": 0.8722853064537048,
"start": 1927,
"tag": "NAME",
"value": "Pennsauken Twp"
},
{
"context": "wp\",\n \"27 27\", \"Pennsauken Twp\",\n \"28\", \"Pine Hill\",\n \"28 28\", \"Pine Hill\",\n \"29\", \"Pine Va",
"end": 1967,
"score": 0.9974292516708374,
"start": 1958,
"tag": "NAME",
"value": "Pine Hill"
},
{
"context": "ken Twp\",\n \"28\", \"Pine Hill\",\n \"28 28\", \"Pine Hill\",\n \"29\", \"Pine Valley\",\n \"29 29\", \"Pine ",
"end": 1993,
"score": 0.9974677562713623,
"start": 1984,
"tag": "NAME",
"value": "Pine Hill"
},
{
"context": "ne Hill\",\n \"28 28\", \"Pine Hill\",\n \"29\", \"Pine Valley\",\n \"29 29\", \"Pine Valley\",\n \"30\", \"Runne",
"end": 2021,
"score": 0.9654527306556702,
"start": 2010,
"tag": "NAME",
"value": "Pine Valley"
},
{
"context": " Hill\",\n \"29\", \"Pine Valley\",\n \"29 29\", \"Pine Valley\",\n \"30\", \"Runnemede\",\n \"30 30\", \"Runneme",
"end": 2049,
"score": 0.8975709676742554,
"start": 2038,
"tag": "NAME",
"value": "Pine Valley"
},
{
"context": "alley\",\n \"29 29\", \"Pine Valley\",\n \"30\", \"Runnemede\",\n \"30 30\", \"Runnemede\",\n \"31\", \"Somerda",
"end": 2075,
"score": 0.9988569021224976,
"start": 2066,
"tag": "NAME",
"value": "Runnemede"
},
{
"context": " Valley\",\n \"30\", \"Runnemede\",\n \"30 30\", \"Runnemede\",\n \"31\", \"Somerdale\",\n \"31 31\", \"Somerda",
"end": 2101,
"score": 0.9989997148513794,
"start": 2092,
"tag": "NAME",
"value": "Runnemede"
},
{
"context": "nnemede\",\n \"30 30\", \"Runnemede\",\n \"31\", \"Somerdale\",\n \"31 31\", \"Somerdale\",\n \"32\", \"Stratfo",
"end": 2127,
"score": 0.9862467646598816,
"start": 2118,
"tag": "NAME",
"value": "Somerdale"
},
{
"context": "nnemede\",\n \"31\", \"Somerdale\",\n \"31 31\", \"Somerdale\",\n \"32\", \"Stratford\",\n \"32 32\", \"Stratfo",
"end": 2153,
"score": 0.9917593598365784,
"start": 2144,
"tag": "NAME",
"value": "Somerdale"
},
{
"context": "merdale\",\n \"31 31\", \"Somerdale\",\n \"32\", \"Stratford\",\n \"32 32\", \"Stratford\",\n \"33\", \"Tavisto",
"end": 2179,
"score": 0.9978095889091492,
"start": 2170,
"tag": "NAME",
"value": "Stratford"
},
{
"context": "merdale\",\n \"32\", \"Stratford\",\n \"32 32\", \"Stratford\",\n \"33\", \"Tavistock\",\n \"33 33\", \"Tavisto",
"end": 2205,
"score": 0.997372567653656,
"start": 2196,
"tag": "NAME",
"value": "Stratford"
},
{
"context": "ratford\",\n \"32 32\", \"Stratford\",\n \"33\", \"Tavistock\",\n \"33 33\", \"Tavistock\",\n \"34\", \"Voorhee",
"end": 2231,
"score": 0.9902268052101135,
"start": 2222,
"tag": "NAME",
"value": "Tavistock"
},
{
"context": "ratford\",\n \"33\", \"Tavistock\",\n \"33 33\", \"Tavistock\",\n \"34\", \"Voorhees Twp\",\n \"34 34\", \"Voor",
"end": 2257,
"score": 0.9690923690795898,
"start": 2248,
"tag": "NAME",
"value": "Tavistock"
},
{
"context": "vistock\",\n \"33 33\", \"Tavistock\",\n \"34\", \"Voorhees Twp\",\n \"34 34\", \"Voorhees Twp\",\n \"35\", \"",
"end": 2282,
"score": 0.8973227739334106,
"start": 2274,
"tag": "NAME",
"value": "Voorhees"
},
{
"context": "tock\",\n \"34\", \"Voorhees Twp\",\n \"34 34\", \"Voorhees Twp\",\n \"35\", \"Waterford Twp\",\n \"35 35\", ",
"end": 2311,
"score": 0.8117531538009644,
"start": 2303,
"tag": "NAME",
"value": "Voorhees"
},
{
"context": "Twp\",\n \"35 35\", \"Waterford Twp\",\n \"36\", \"Winslow Twp\",\n \"36 36\", \"Winslow Twp\",\n \"37\", ",
"end": 2396,
"score": 0.5872402191162109,
"start": 2392,
"tag": "NAME",
"value": "Wins"
},
{
"context": "w Twp\",\n \"36 36\", \"Winslow Twp\",\n \"37\", \"Woodlyne\",\n \"37 37\", \"Woodlyne\",\n \"44\", \"\",\n \"",
"end": 2456,
"score": 0.7314459085464478,
"start": 2448,
"tag": "NAME",
"value": "Woodlyne"
}
] | null |
[] |
package net.anei.cadpage.parsers.NJ;
import java.util.Properties;
import net.anei.cadpage.parsers.dispatch.DispatchArchonixParser;
public class NJCamdenCountyAParser extends DispatchArchonixParser {
public NJCamdenCountyAParser() {
super(CITY_CODES, "CAMDEN COUNTY", "NJ");
}
@Override
public String getFilter() {
return "<EMAIL>";
}
private static final Properties CITY_CODES = buildCodeTable(new String[]{
"01", "Audubon",
"01 01", "Audubon",
"02", "Audubon Park",
"02 02", "Audubon Park",
"03", "Barrington",
"03 03", "Barrington",
"04", "Bellmawr",
"04 04", "Bellmawr",
"05", "Berlin",
"05 05", "Berlin",
"06", "Berlin Twp",
"06 06", "Berlin Twp",
"07", "Brooklawn",
"07 07", "Brooklawn",
"08", "Camden City",
"08 08", "Camden City",
"09", "Chesilhurst",
"09 09", "Chesilhurst",
"10", "Clementon",
"10 10", "Clementon",
"11", "Collingswood",
"11 11", "Collingswood",
"12", "<NAME>",
"12 12", "<NAME>",
"13", "Gibbsboro",
"13 13", "Gibbsboro",
"14", "Gloucester City",
"14 14", "Gloucester City",
"15", "Gloucester Twp",
"15 15", "<NAME>wp",
"16", "<NAME>",
"16 16", "<NAME>",
"17", "Haddonfield",
"17 17", "Haddonfield",
"18", "<NAME>",
"18 18", "<NAME>",
"19", "Hi-Nella",
"19 19", "Hi-Nella",
"20", "Laurel Springs",
"20 20", "Laurel Springs",
"21", "Lawnside",
"21 21", "Lawnside",
"22", "Lindenwold",
"22 22", "Lindenwold",
"23", "Magnolia",
"23 23", "Magnolia",
"24", "Merchantville",
"24 24", "Merchantville",
"25", "<NAME>",
"25 25", "<NAME>",
"26", "Oaklyn",
"26 26", "Oaklyn",
"27", "<NAME>",
"27 27", "<NAME>",
"28", "<NAME>",
"28 28", "<NAME>",
"29", "<NAME>",
"29 29", "<NAME>",
"30", "Runnemede",
"30 30", "Runnemede",
"31", "Somerdale",
"31 31", "Somerdale",
"32", "Stratford",
"32 32", "Stratford",
"33", "Tavistock",
"33 33", "Tavistock",
"34", "Voorhees Twp",
"34 34", "Voorhees Twp",
"35", "Waterford Twp",
"35 35", "Waterford Twp",
"36", "Winslow Twp",
"36 36", "Winslow Twp",
"37", "Woodlyne",
"37 37", "Woodlyne",
"44", "",
"44 44", "",
"63", "",
"63 63", ""
});
}
| 2,454 | 0.512891 | 0.421484 | 101 | 24.346535 | 12.216233 | 75 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.613861 | false | false |
3
|
06864efe3b19e5d6c6764a32e6cf2f61b4828ecf
| 18,760,417,188,121 |
a608205c96ebbb906218c0e8f02a7ffd8879674e
|
/Prototype_/src/main/java/hu/alkfejl2019/prototype/entities/User.java
|
c4787db832786b107400442088b2e797e11a4bc5
|
[] |
no_license
|
KDany/alkfejl2019
|
https://github.com/KDany/alkfejl2019
|
5b3d735476732300dc597b86dcbff09b6cb0a485
|
12c7740dfb48f36356f06723776f3a94c72c48c5
|
refs/heads/master
| 2023-01-09T04:34:45.125000 | 2019-12-09T00:00:41 | 2019-12-09T00:00:41 | 212,767,055 | 0 | 0 | null | false | 2023-01-07T12:35:24 | 2019-10-04T08:16:29 | 2019-12-09T00:00:55 | 2023-01-07T12:35:24 | 35,639 | 0 | 0 | 28 |
Java
| false | false |
package hu.alkfejl2019.prototype.entities;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
@Entity
@Table(name = "users")
@Data
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode
public class User extends BaseEntity implements Serializable {
@Column
@NotNull
private String name;
@Column(unique = true)
@NotNull
private String email;
@NotNull
@Column
private String password;
@Column
@Enumerated(EnumType.STRING)
private Role role;
@JsonIgnore
@OneToMany(mappedBy = "user")
private List<CookBook> cookBooks = new ArrayList<>();
public enum Role {
ROLE_ADMIN,
ROLE_USER
}
}
|
UTF-8
|
Java
| 1,079 |
java
|
User.java
|
Java
|
[] | null |
[] |
package hu.alkfejl2019.prototype.entities;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
@Entity
@Table(name = "users")
@Data
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode
public class User extends BaseEntity implements Serializable {
@Column
@NotNull
private String name;
@Column(unique = true)
@NotNull
private String email;
@NotNull
@Column
private String password;
@Column
@Enumerated(EnumType.STRING)
private Role role;
@JsonIgnore
@OneToMany(mappedBy = "user")
private List<CookBook> cookBooks = new ArrayList<>();
public enum Role {
ROLE_ADMIN,
ROLE_USER
}
}
| 1,079 | 0.785913 | 0.782206 | 54 | 18.888889 | 15.499901 | 62 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.87037 | false | false |
3
|
5193a67cce8ef86ff7a1345b05e7b7257dc77b93
| 9,766,755,635,078 |
955e0ab6080b7653dca270f62c9322b719990f3e
|
/src/main/java/com/aps/service/crud/CrudServiceImpl.java
|
62a5c19db73b6b9aae54f79fcfd03b9ff17bc7b7
|
[] |
no_license
|
anderson-souza/micronaut-crud
|
https://github.com/anderson-souza/micronaut-crud
|
86a20fbcf983c4881d1c88d4d9412d3bf936d10b
|
e29690b98a684a00adfd1775dc49208194e0f57e
|
refs/heads/main
| 2023-07-14T15:59:39.917000 | 2021-08-25T14:06:48 | 2021-08-25T14:06:48 | 388,780,038 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.aps.service.crud;
import com.aps.exceptions.NotFoundException;
import com.aps.model.DefaultEntity;
import io.micronaut.data.model.Page;
import io.micronaut.data.model.Pageable;
import io.micronaut.data.repository.PageableRepository;
import static com.google.common.base.Preconditions.checkNotNull;
public abstract class CrudServiceImpl<T extends DefaultEntity> implements CrudService<T> {
private final PageableRepository<T, Long> defaultCrudRepository;
protected CrudServiceImpl(PageableRepository<T, Long> defaultCrudRepository) {
this.defaultCrudRepository = defaultCrudRepository;
}
@Override
public Iterable<T> getAll() {
return defaultCrudRepository.findAll();
}
@Override
public Page<T> getAllPaginated(Pageable pageable) {
return defaultCrudRepository.findAll(pageable);
}
@Override
public T getById(Long id) throws NotFoundException {
preGetById(id);
return defaultCrudRepository.findById(id).orElseThrow(NotFoundException::new);
}
@Override
public T save(T t) {
preSave(t);
return defaultCrudRepository.save(t);
}
@Override
public T update(Long id, T t) {
preUpdate(id, t);
t.setId(id);
return defaultCrudRepository.update(t);
}
@Override
public void deleteById(Long id) {
preDelete(id);
defaultCrudRepository.deleteById(id);
}
@Override
public void preGetById(Long id) {
checkNotNull(id, "Id não pode ser Nulo");
}
@Override
public void preSave(T t) {
checkNotNull(t, "Entidade não pode ser nulo");
}
@Override
public void preUpdate(Long id, T t) {
checkNotNull(id, "Id não pode ser nulo");
checkNotNull(t, "Entidade não pode ser nula");
}
@Override
public void preDelete(Long id) {
checkNotNull(id, "Id não pode ser nulo");
}
}
|
UTF-8
|
Java
| 1,940 |
java
|
CrudServiceImpl.java
|
Java
|
[] | null |
[] |
package com.aps.service.crud;
import com.aps.exceptions.NotFoundException;
import com.aps.model.DefaultEntity;
import io.micronaut.data.model.Page;
import io.micronaut.data.model.Pageable;
import io.micronaut.data.repository.PageableRepository;
import static com.google.common.base.Preconditions.checkNotNull;
public abstract class CrudServiceImpl<T extends DefaultEntity> implements CrudService<T> {
private final PageableRepository<T, Long> defaultCrudRepository;
protected CrudServiceImpl(PageableRepository<T, Long> defaultCrudRepository) {
this.defaultCrudRepository = defaultCrudRepository;
}
@Override
public Iterable<T> getAll() {
return defaultCrudRepository.findAll();
}
@Override
public Page<T> getAllPaginated(Pageable pageable) {
return defaultCrudRepository.findAll(pageable);
}
@Override
public T getById(Long id) throws NotFoundException {
preGetById(id);
return defaultCrudRepository.findById(id).orElseThrow(NotFoundException::new);
}
@Override
public T save(T t) {
preSave(t);
return defaultCrudRepository.save(t);
}
@Override
public T update(Long id, T t) {
preUpdate(id, t);
t.setId(id);
return defaultCrudRepository.update(t);
}
@Override
public void deleteById(Long id) {
preDelete(id);
defaultCrudRepository.deleteById(id);
}
@Override
public void preGetById(Long id) {
checkNotNull(id, "Id não pode ser Nulo");
}
@Override
public void preSave(T t) {
checkNotNull(t, "Entidade não pode ser nulo");
}
@Override
public void preUpdate(Long id, T t) {
checkNotNull(id, "Id não pode ser nulo");
checkNotNull(t, "Entidade não pode ser nula");
}
@Override
public void preDelete(Long id) {
checkNotNull(id, "Id não pode ser nulo");
}
}
| 1,940 | 0.674935 | 0.674935 | 74 | 25.148649 | 23.852407 | 90 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.472973 | false | false |
3
|
3bdac0bda7cbe517c5369e2fea88b95b1fb81160
| 9,766,755,634,691 |
e8d456b6894f680d14fcc168ef9d22af1ecc283e
|
/library-basicres/src/main/java/com/sim/basicres/views/SplitEditText.java
|
be755a96d58beef919450de9c980c07bf5a43afd
|
[] |
no_license
|
HelloSim/TravelTool
|
https://github.com/HelloSim/TravelTool
|
20d8d5299ca56a3afa155fff614c510cb6e5a4eb
|
b0ac9c43cfde9609f825df6c98d488049421f040
|
refs/heads/main
| 2023-06-01T14:29:19.748000 | 2021-06-21T10:39:22 | 2021-06-21T10:39:22 | 297,370,236 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.sim.basicres.views;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.Rect;
import android.graphics.RectF;
import android.text.InputFilter;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.util.DisplayMetrics;
import android.util.TypedValue;
import androidx.annotation.IntDef;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.widget.AppCompatEditText;
import com.sim.basicres.R;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
/**
* @author Sim --- 一个灵活的分割编辑框。常常应用于 验证码输入、密码输入 等场景
*/
public class SplitEditText extends AppCompatEditText {
/**
* 画笔
*/
private Paint mPaint;
/**
* 画笔宽度
*/
private float mStrokeWidth;
/**
* 边框颜色
*/
private int mBorderColor = 0xFF666666;
/**
* 输入的边框颜色
*/
private int mInputBorderColor = 0xFF1E90FF;
/**
* 焦点的边框颜色
*/
private int mFocusBorderColor;
/**
* 框的背景颜色
*/
private int mBoxBackgroundColor;
/**
* 框的圆角大小
*/
private float mBorderCornerRadius;
/**
* 框与框之间的间距大小
*/
private float mBorderSpacing;
/**
* 输入框宽度
*/
private float mBoxWidth;
/**
* 输入框高度
*/
private float mBoxHeight;
/**
* 允许输入的最大长度
*/
private int mMaxLength = 6;
/**
* 文本长度
*/
private int mTextLength;
/**
* 路径
*/
private Path mPath;
private RectF mRectF;
private float[] mRadiusFirstArray;
private float[] mRadiusLastArray;
/**
* 边框风格
*/
private @BorderStyle
int mBorderStyle = BorderStyle.BOX;
/**
* 边框风格
*/
@Retention(RetentionPolicy.SOURCE)
@IntDef({BorderStyle.BOX, BorderStyle.LINE})
public @interface BorderStyle {
/**
* 框
*/
int BOX = 0;
/**
* 线
*/
int LINE = 1;
}
/**
* 文本风格
*/
private @TextStyle
int mTextStyle = TextStyle.PLAIN_TEXT;
/**
* 文本风格
*/
@Retention(RetentionPolicy.SOURCE)
@IntDef({TextStyle.PLAIN_TEXT, TextStyle.CIPHER_TEXT})
public @interface TextStyle {
/**
* 明文
*/
int PLAIN_TEXT = 0;
/**
* 密文
*/
int CIPHER_TEXT = 1;
}
/**
* 密文掩码
*/
private String mCipherMask;
/**
* 是否是粗体
*/
private boolean isFakeBoldText;
private static final String DEFAULT_CIPHER_MASK = "*";
private boolean isDraw;
private OnTextInputListener mOnTextInputListener;
public SplitEditText(@NonNull Context context) {
this(context, null);
}
public SplitEditText(@NonNull Context context, @Nullable AttributeSet attrs) {
this(context, attrs, android.R.attr.editTextStyle);
}
public SplitEditText(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
init(context, attrs);
}
private void init(@NonNull Context context, @Nullable AttributeSet attrs) {
DisplayMetrics displayMetrics = getResources().getDisplayMetrics();
mStrokeWidth = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 1f, displayMetrics);
mBorderSpacing = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 8f, displayMetrics);
setPadding(0, 0, 0, 0);
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.common_splitEditText);
final int count = a.getIndexCount();
for (int i = 0; i < count; i++) {
int attr = a.getIndex(i);
if (attr == R.styleable.common_splitEditText_common_setStrokeWidth) {
mStrokeWidth = a.getDimension(attr, mStrokeWidth);
} else if (attr == R.styleable.common_splitEditText_common_setBorderColor) {
mBorderColor = a.getColor(attr, mBorderColor);
} else if (attr == R.styleable.common_splitEditText_common_setInputBorderColor) {
mInputBorderColor = a.getColor(attr, mInputBorderColor);
} else if (attr == R.styleable.common_splitEditText_common_setFocusBorderColor) {
mFocusBorderColor = a.getColor(attr, mFocusBorderColor);
} else if (attr == R.styleable.common_splitEditText_common_setBoxBackgroundColor) {
mBoxBackgroundColor = a.getColor(attr, mBoxBackgroundColor);
} else if (attr == R.styleable.common_splitEditText_common_setBorderCornerRadius) {
mBorderCornerRadius = a.getDimension(attr, mBorderCornerRadius);
} else if (attr == R.styleable.common_splitEditText_common_setBorderSpacing) {
mBorderSpacing = a.getDimension(attr, mBorderSpacing);
} else if (attr == R.styleable.common_splitEditText_common_setMaxLength) {
mMaxLength = a.getInt(attr, mMaxLength);
} else if (attr == R.styleable.common_splitEditText_common_setBorderStyle) {
mBorderStyle = a.getInt(attr, mBorderStyle);
} else if (attr == R.styleable.common_splitEditText_common_setTextStyle) {
mTextStyle = a.getInt(attr, mTextStyle);
} else if (attr == R.styleable.common_splitEditText_common_setCipherMask) {
mCipherMask = a.getString(attr);
} else if (attr == R.styleable.common_splitEditText_common_setFakeBoldText) {
isFakeBoldText = a.getBoolean(attr, false);
}
}
a.recycle();
mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
mPaint.setAntiAlias(true);
mPaint.setTextAlign(Paint.Align.CENTER);
mPath = new Path();
mRadiusFirstArray = new float[8];
mRadiusLastArray = new float[8];
mRectF = new RectF(0, 0, 0, 0);
if (TextUtils.isEmpty(mCipherMask)) {
mCipherMask = DEFAULT_CIPHER_MASK;
} else if (mCipherMask.length() > 1) {
mCipherMask = mCipherMask.substring(0, 1);
}
setBackground(null);
setCursorVisible(false);
setFilters(new InputFilter[]{new InputFilter.LengthFilter(mMaxLength)});
}
@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
super.onSizeChanged(w, h, oldw, oldh);
int width = w - getPaddingLeft() - getPaddingRight();
int height = h - getPaddingTop() - getPaddingBottom();
updateSizeChanged(width, height);
}
private void updateSizeChanged(int width, int height) {
//如果框与框之间的间距小于0或者总间距大于控件可用宽度则将间距重置为0
if (mBorderSpacing < 0 || (mMaxLength - 1) * mBorderSpacing > width) {
mBorderSpacing = 0;
}
//计算出每个框的宽度
mBoxWidth = (width - (mMaxLength - 1) * mBorderSpacing) / mMaxLength - mStrokeWidth;
mBoxHeight = height - mStrokeWidth;
}
@Override
protected void onDraw(Canvas canvas) {
//移除super.onDraw(canvas);不绘制EditText相关的
//绘制边框
drawBorders(canvas);
}
private void drawBorders(Canvas canvas) {
isDraw = true;
//遍历绘制未输入文本的框边界
for (int i = mTextLength; i < mMaxLength; i++) {
drawBorder(canvas, i, mBorderColor);
}
int color = mInputBorderColor != 0 ? mInputBorderColor : mBorderColor;
//遍历绘制已输入文本的框边界
for (int i = 0; i < mTextLength; i++) {
drawBorder(canvas, i, color);
}
//绘制焦点框边界
if (mTextLength < mMaxLength && mFocusBorderColor != 0 && isFocused()) {
drawBorder(canvas, mTextLength, mFocusBorderColor);
}
}
private void drawBorder(Canvas canvas, int position, int borderColor) {
mPaint.setStrokeWidth(mStrokeWidth);
mPaint.setStyle(Paint.Style.STROKE);
mPaint.setFakeBoldText(false);
mPaint.setColor(borderColor);
//计算出对应的矩形
float left = getPaddingLeft() + mStrokeWidth / 2 + (mBoxWidth + mBorderSpacing) * position;
float top = getPaddingTop() + mStrokeWidth / 2;
mRectF.set(left, top, left + mBoxWidth, top + mBoxHeight);
//边框风格
switch (mBorderStyle) {
case BorderStyle.BOX:
drawBorderBox(canvas, position, borderColor);
break;
case BorderStyle.LINE:
drawBorderLine(canvas);
break;
}
if (mTextLength > position && !TextUtils.isEmpty(getText())) {
drawText(canvas, position);
}
}
private void drawText(Canvas canvas, int position) {
mPaint.setStrokeWidth(0);
mPaint.setColor(Color.BLACK);
mPaint.setStyle(Paint.Style.FILL_AND_STROKE);
mPaint.setTextSize(getTextSize());
mPaint.setFakeBoldText(isFakeBoldText);
float x = mRectF.centerX();
//y轴坐标 = 中心线 + 文字高度的一半 - 基线到文字底部的距离(也就是bottom)
float y = mRectF.centerY() + (mPaint.getFontMetrics().bottom - mPaint.getFontMetrics().top) / 2 - mPaint.getFontMetrics().bottom;
switch (mTextStyle) {
case TextStyle.PLAIN_TEXT:
canvas.drawText(String.valueOf(getText().charAt(position)), x, y, mPaint);
break;
case TextStyle.CIPHER_TEXT:
canvas.drawText(mCipherMask, x, y, mPaint);
break;
}
}
/**
* 绘制框风格
*
* @param canvas
* @param position
*/
private void drawBorderBox(Canvas canvas, int position, int borderColor) {
if (mBorderCornerRadius > 0) {//当边框带有圆角时
if (mBorderSpacing == 0) {//当边框之间的间距为0时,只需要开始一个和最后一个框有圆角
if (position == 0 || position == mMaxLength - 1) {
if (mBoxBackgroundColor != 0) {
mPaint.setStyle(Paint.Style.FILL);
mPaint.setColor(mBoxBackgroundColor);
canvas.drawPath(getRoundRectPath(mRectF, position == 0), mPaint);
}
mPaint.setStyle(Paint.Style.STROKE);
mPaint.setColor(borderColor);
canvas.drawPath(getRoundRectPath(mRectF, position == 0), mPaint);
} else {
if (mBoxBackgroundColor != 0) {
mPaint.setStyle(Paint.Style.FILL);
mPaint.setColor(mBoxBackgroundColor);
canvas.drawRect(mRectF, mPaint);
}
mPaint.setStyle(Paint.Style.STROKE);
mPaint.setColor(borderColor);
canvas.drawRect(mRectF, mPaint);
}
} else {
if (mBoxBackgroundColor != 0) {
mPaint.setStyle(Paint.Style.FILL);
mPaint.setColor(mBoxBackgroundColor);
canvas.drawRoundRect(mRectF, mBorderCornerRadius, mBorderCornerRadius, mPaint);
}
mPaint.setStyle(Paint.Style.STROKE);
mPaint.setColor(borderColor);
canvas.drawRoundRect(mRectF, mBorderCornerRadius, mBorderCornerRadius, mPaint);
}
} else {
if (mBoxBackgroundColor != 0) {
mPaint.setStyle(Paint.Style.FILL);
mPaint.setColor(mBoxBackgroundColor);
canvas.drawRect(mRectF, mPaint);
}
mPaint.setStyle(Paint.Style.STROKE);
mPaint.setColor(borderColor);
canvas.drawRect(mRectF, mPaint);
}
}
/**
* 绘制线风格
*
* @param canvas
*/
private void drawBorderLine(Canvas canvas) {
float y = getPaddingTop() + mBoxHeight;
canvas.drawLine(mRectF.left, y, mRectF.right, y, mPaint);
}
private Path getRoundRectPath(RectF rectF, boolean isFirst) {
mPath.reset();
if (isFirst) {
//左上角
mRadiusFirstArray[0] = mBorderCornerRadius;
mRadiusFirstArray[1] = mBorderCornerRadius;
//左下角
mRadiusFirstArray[6] = mBorderCornerRadius;
mRadiusFirstArray[7] = mBorderCornerRadius;
mPath.addRoundRect(rectF, mRadiusFirstArray, Path.Direction.CW);
} else {
//右上角
mRadiusLastArray[2] = mBorderCornerRadius;
mRadiusLastArray[3] = mBorderCornerRadius;
//右下角
mRadiusLastArray[4] = mBorderCornerRadius;
mRadiusLastArray[5] = mBorderCornerRadius;
mPath.addRoundRect(rectF, mRadiusLastArray, Path.Direction.CW);
}
return mPath;
}
@Override
protected void onTextChanged(CharSequence text, int start, int lengthBefore, int lengthAfter) {
super.onTextChanged(text, start, lengthBefore, lengthAfter);
mTextLength = text.length();
refreshView();
//改变监听
if (mOnTextInputListener != null) {
mOnTextInputListener.onTextInputChanged(text.toString(), mTextLength);
if (mTextLength == mMaxLength) {
mOnTextInputListener.onTextInputCompleted(text.toString());
}
}
}
@Override
protected void onSelectionChanged(int selStart, int selEnd) {
super.onSelectionChanged(selStart, selEnd);
if (selStart == selEnd) {
setSelection(getText() == null ? 0 : getText().length());
}
}
@Override
protected void onFocusChanged(boolean focused, int direction, Rect previouslyFocusedRect) {
super.onFocusChanged(focused, direction, previouslyFocusedRect);
//焦点改变时刷新状态
refreshView();
}
@Override
protected void onDetachedFromWindow() {
super.onDetachedFromWindow();
isDraw = false;
}
public int getBorderColor() {
return mBorderColor;
}
public int getInputBorderColor() {
return mInputBorderColor;
}
public int getFocusBorderColor() {
return mFocusBorderColor;
}
public int getBoxBackgroundColor() {
return mBoxBackgroundColor;
}
public float getBorderCornerRadius() {
return mBorderCornerRadius;
}
public float getBorderSpacing() {
return mBorderSpacing;
}
@BorderStyle
public int getBorderStyle() {
return mBorderStyle;
}
public void setBorderColor(int borderColor) {
this.mBorderColor = borderColor;
refreshView();
}
public void setInputBorderColor(int inputBorderColor) {
this.mInputBorderColor = inputBorderColor;
refreshView();
}
public void setFocusBorderColor(int focusBorderColor) {
this.mFocusBorderColor = focusBorderColor;
refreshView();
}
public void setBoxBackgroundColor(int boxBackgroundColor) {
this.mBoxBackgroundColor = boxBackgroundColor;
refreshView();
}
public void setBorderCornerRadius(float borderCornerRadius) {
this.mBorderCornerRadius = borderCornerRadius;
refreshView();
}
public void setBorderSpacing(float borderSpacing) {
this.mBorderSpacing = borderSpacing;
refreshView();
}
public void setBorderStyle(@TextStyle int borderStyle) {
this.mBorderStyle = borderStyle;
refreshView();
}
@TextStyle
public int getTextStyle() {
return mTextStyle;
}
public void setTextStyle(@TextStyle int textStyle) {
this.mTextStyle = textStyle;
refreshView();
}
public String getCipherMask() {
return mCipherMask;
}
/**
* 是否粗体
*
* @param fakeBoldText
*/
public void setFakeBoldText(boolean fakeBoldText) {
isFakeBoldText = fakeBoldText;
refreshView();
}
/**
* 设置密文掩码 不设置时,默认为{@link #DEFAULT_CIPHER_MASK}
*
* @param cipherMask
*/
public void setCipherMask(String cipherMask) {
this.mCipherMask = cipherMask;
refreshView();
}
/**
* 刷新视图
*/
private void refreshView() {
if (isDraw) {
invalidate();
}
}
/**
* 设置文本输入监听
*
* @param onTextInputListener
*/
public void setOnTextInputListener(OnTextInputListener onTextInputListener) {
this.mOnTextInputListener = onTextInputListener;
}
public static abstract class OnSimpleTextInputListener implements OnTextInputListener {
@Override
public void onTextInputChanged(String text, int length) {
}
}
/**
* 文本输入监听
*/
public interface OnTextInputListener {
/**
* Text改变监听
*
* @param text
* @param length
*/
void onTextInputChanged(String text, int length);
/**
* Text输入完成
*
* @param text
*/
void onTextInputCompleted(String text);
}
}
|
UTF-8
|
Java
| 17,807 |
java
|
SplitEditText.java
|
Java
|
[
{
"context": "a.lang.annotation.RetentionPolicy;\n\n/**\n * @author Sim --- 一个灵活的分割编辑框。常常应用于 验证码输入、密码输入 等场景\n */\npublic cl",
"end": 748,
"score": 0.9861302971839905,
"start": 745,
"tag": "NAME",
"value": "Sim"
}
] | null |
[] |
package com.sim.basicres.views;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.Rect;
import android.graphics.RectF;
import android.text.InputFilter;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.util.DisplayMetrics;
import android.util.TypedValue;
import androidx.annotation.IntDef;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.widget.AppCompatEditText;
import com.sim.basicres.R;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
/**
* @author Sim --- 一个灵活的分割编辑框。常常应用于 验证码输入、密码输入 等场景
*/
public class SplitEditText extends AppCompatEditText {
/**
* 画笔
*/
private Paint mPaint;
/**
* 画笔宽度
*/
private float mStrokeWidth;
/**
* 边框颜色
*/
private int mBorderColor = 0xFF666666;
/**
* 输入的边框颜色
*/
private int mInputBorderColor = 0xFF1E90FF;
/**
* 焦点的边框颜色
*/
private int mFocusBorderColor;
/**
* 框的背景颜色
*/
private int mBoxBackgroundColor;
/**
* 框的圆角大小
*/
private float mBorderCornerRadius;
/**
* 框与框之间的间距大小
*/
private float mBorderSpacing;
/**
* 输入框宽度
*/
private float mBoxWidth;
/**
* 输入框高度
*/
private float mBoxHeight;
/**
* 允许输入的最大长度
*/
private int mMaxLength = 6;
/**
* 文本长度
*/
private int mTextLength;
/**
* 路径
*/
private Path mPath;
private RectF mRectF;
private float[] mRadiusFirstArray;
private float[] mRadiusLastArray;
/**
* 边框风格
*/
private @BorderStyle
int mBorderStyle = BorderStyle.BOX;
/**
* 边框风格
*/
@Retention(RetentionPolicy.SOURCE)
@IntDef({BorderStyle.BOX, BorderStyle.LINE})
public @interface BorderStyle {
/**
* 框
*/
int BOX = 0;
/**
* 线
*/
int LINE = 1;
}
/**
* 文本风格
*/
private @TextStyle
int mTextStyle = TextStyle.PLAIN_TEXT;
/**
* 文本风格
*/
@Retention(RetentionPolicy.SOURCE)
@IntDef({TextStyle.PLAIN_TEXT, TextStyle.CIPHER_TEXT})
public @interface TextStyle {
/**
* 明文
*/
int PLAIN_TEXT = 0;
/**
* 密文
*/
int CIPHER_TEXT = 1;
}
/**
* 密文掩码
*/
private String mCipherMask;
/**
* 是否是粗体
*/
private boolean isFakeBoldText;
private static final String DEFAULT_CIPHER_MASK = "*";
private boolean isDraw;
private OnTextInputListener mOnTextInputListener;
public SplitEditText(@NonNull Context context) {
this(context, null);
}
public SplitEditText(@NonNull Context context, @Nullable AttributeSet attrs) {
this(context, attrs, android.R.attr.editTextStyle);
}
public SplitEditText(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
init(context, attrs);
}
private void init(@NonNull Context context, @Nullable AttributeSet attrs) {
DisplayMetrics displayMetrics = getResources().getDisplayMetrics();
mStrokeWidth = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 1f, displayMetrics);
mBorderSpacing = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 8f, displayMetrics);
setPadding(0, 0, 0, 0);
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.common_splitEditText);
final int count = a.getIndexCount();
for (int i = 0; i < count; i++) {
int attr = a.getIndex(i);
if (attr == R.styleable.common_splitEditText_common_setStrokeWidth) {
mStrokeWidth = a.getDimension(attr, mStrokeWidth);
} else if (attr == R.styleable.common_splitEditText_common_setBorderColor) {
mBorderColor = a.getColor(attr, mBorderColor);
} else if (attr == R.styleable.common_splitEditText_common_setInputBorderColor) {
mInputBorderColor = a.getColor(attr, mInputBorderColor);
} else if (attr == R.styleable.common_splitEditText_common_setFocusBorderColor) {
mFocusBorderColor = a.getColor(attr, mFocusBorderColor);
} else if (attr == R.styleable.common_splitEditText_common_setBoxBackgroundColor) {
mBoxBackgroundColor = a.getColor(attr, mBoxBackgroundColor);
} else if (attr == R.styleable.common_splitEditText_common_setBorderCornerRadius) {
mBorderCornerRadius = a.getDimension(attr, mBorderCornerRadius);
} else if (attr == R.styleable.common_splitEditText_common_setBorderSpacing) {
mBorderSpacing = a.getDimension(attr, mBorderSpacing);
} else if (attr == R.styleable.common_splitEditText_common_setMaxLength) {
mMaxLength = a.getInt(attr, mMaxLength);
} else if (attr == R.styleable.common_splitEditText_common_setBorderStyle) {
mBorderStyle = a.getInt(attr, mBorderStyle);
} else if (attr == R.styleable.common_splitEditText_common_setTextStyle) {
mTextStyle = a.getInt(attr, mTextStyle);
} else if (attr == R.styleable.common_splitEditText_common_setCipherMask) {
mCipherMask = a.getString(attr);
} else if (attr == R.styleable.common_splitEditText_common_setFakeBoldText) {
isFakeBoldText = a.getBoolean(attr, false);
}
}
a.recycle();
mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
mPaint.setAntiAlias(true);
mPaint.setTextAlign(Paint.Align.CENTER);
mPath = new Path();
mRadiusFirstArray = new float[8];
mRadiusLastArray = new float[8];
mRectF = new RectF(0, 0, 0, 0);
if (TextUtils.isEmpty(mCipherMask)) {
mCipherMask = DEFAULT_CIPHER_MASK;
} else if (mCipherMask.length() > 1) {
mCipherMask = mCipherMask.substring(0, 1);
}
setBackground(null);
setCursorVisible(false);
setFilters(new InputFilter[]{new InputFilter.LengthFilter(mMaxLength)});
}
@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
super.onSizeChanged(w, h, oldw, oldh);
int width = w - getPaddingLeft() - getPaddingRight();
int height = h - getPaddingTop() - getPaddingBottom();
updateSizeChanged(width, height);
}
private void updateSizeChanged(int width, int height) {
//如果框与框之间的间距小于0或者总间距大于控件可用宽度则将间距重置为0
if (mBorderSpacing < 0 || (mMaxLength - 1) * mBorderSpacing > width) {
mBorderSpacing = 0;
}
//计算出每个框的宽度
mBoxWidth = (width - (mMaxLength - 1) * mBorderSpacing) / mMaxLength - mStrokeWidth;
mBoxHeight = height - mStrokeWidth;
}
@Override
protected void onDraw(Canvas canvas) {
//移除super.onDraw(canvas);不绘制EditText相关的
//绘制边框
drawBorders(canvas);
}
private void drawBorders(Canvas canvas) {
isDraw = true;
//遍历绘制未输入文本的框边界
for (int i = mTextLength; i < mMaxLength; i++) {
drawBorder(canvas, i, mBorderColor);
}
int color = mInputBorderColor != 0 ? mInputBorderColor : mBorderColor;
//遍历绘制已输入文本的框边界
for (int i = 0; i < mTextLength; i++) {
drawBorder(canvas, i, color);
}
//绘制焦点框边界
if (mTextLength < mMaxLength && mFocusBorderColor != 0 && isFocused()) {
drawBorder(canvas, mTextLength, mFocusBorderColor);
}
}
private void drawBorder(Canvas canvas, int position, int borderColor) {
mPaint.setStrokeWidth(mStrokeWidth);
mPaint.setStyle(Paint.Style.STROKE);
mPaint.setFakeBoldText(false);
mPaint.setColor(borderColor);
//计算出对应的矩形
float left = getPaddingLeft() + mStrokeWidth / 2 + (mBoxWidth + mBorderSpacing) * position;
float top = getPaddingTop() + mStrokeWidth / 2;
mRectF.set(left, top, left + mBoxWidth, top + mBoxHeight);
//边框风格
switch (mBorderStyle) {
case BorderStyle.BOX:
drawBorderBox(canvas, position, borderColor);
break;
case BorderStyle.LINE:
drawBorderLine(canvas);
break;
}
if (mTextLength > position && !TextUtils.isEmpty(getText())) {
drawText(canvas, position);
}
}
private void drawText(Canvas canvas, int position) {
mPaint.setStrokeWidth(0);
mPaint.setColor(Color.BLACK);
mPaint.setStyle(Paint.Style.FILL_AND_STROKE);
mPaint.setTextSize(getTextSize());
mPaint.setFakeBoldText(isFakeBoldText);
float x = mRectF.centerX();
//y轴坐标 = 中心线 + 文字高度的一半 - 基线到文字底部的距离(也就是bottom)
float y = mRectF.centerY() + (mPaint.getFontMetrics().bottom - mPaint.getFontMetrics().top) / 2 - mPaint.getFontMetrics().bottom;
switch (mTextStyle) {
case TextStyle.PLAIN_TEXT:
canvas.drawText(String.valueOf(getText().charAt(position)), x, y, mPaint);
break;
case TextStyle.CIPHER_TEXT:
canvas.drawText(mCipherMask, x, y, mPaint);
break;
}
}
/**
* 绘制框风格
*
* @param canvas
* @param position
*/
private void drawBorderBox(Canvas canvas, int position, int borderColor) {
if (mBorderCornerRadius > 0) {//当边框带有圆角时
if (mBorderSpacing == 0) {//当边框之间的间距为0时,只需要开始一个和最后一个框有圆角
if (position == 0 || position == mMaxLength - 1) {
if (mBoxBackgroundColor != 0) {
mPaint.setStyle(Paint.Style.FILL);
mPaint.setColor(mBoxBackgroundColor);
canvas.drawPath(getRoundRectPath(mRectF, position == 0), mPaint);
}
mPaint.setStyle(Paint.Style.STROKE);
mPaint.setColor(borderColor);
canvas.drawPath(getRoundRectPath(mRectF, position == 0), mPaint);
} else {
if (mBoxBackgroundColor != 0) {
mPaint.setStyle(Paint.Style.FILL);
mPaint.setColor(mBoxBackgroundColor);
canvas.drawRect(mRectF, mPaint);
}
mPaint.setStyle(Paint.Style.STROKE);
mPaint.setColor(borderColor);
canvas.drawRect(mRectF, mPaint);
}
} else {
if (mBoxBackgroundColor != 0) {
mPaint.setStyle(Paint.Style.FILL);
mPaint.setColor(mBoxBackgroundColor);
canvas.drawRoundRect(mRectF, mBorderCornerRadius, mBorderCornerRadius, mPaint);
}
mPaint.setStyle(Paint.Style.STROKE);
mPaint.setColor(borderColor);
canvas.drawRoundRect(mRectF, mBorderCornerRadius, mBorderCornerRadius, mPaint);
}
} else {
if (mBoxBackgroundColor != 0) {
mPaint.setStyle(Paint.Style.FILL);
mPaint.setColor(mBoxBackgroundColor);
canvas.drawRect(mRectF, mPaint);
}
mPaint.setStyle(Paint.Style.STROKE);
mPaint.setColor(borderColor);
canvas.drawRect(mRectF, mPaint);
}
}
/**
* 绘制线风格
*
* @param canvas
*/
private void drawBorderLine(Canvas canvas) {
float y = getPaddingTop() + mBoxHeight;
canvas.drawLine(mRectF.left, y, mRectF.right, y, mPaint);
}
private Path getRoundRectPath(RectF rectF, boolean isFirst) {
mPath.reset();
if (isFirst) {
//左上角
mRadiusFirstArray[0] = mBorderCornerRadius;
mRadiusFirstArray[1] = mBorderCornerRadius;
//左下角
mRadiusFirstArray[6] = mBorderCornerRadius;
mRadiusFirstArray[7] = mBorderCornerRadius;
mPath.addRoundRect(rectF, mRadiusFirstArray, Path.Direction.CW);
} else {
//右上角
mRadiusLastArray[2] = mBorderCornerRadius;
mRadiusLastArray[3] = mBorderCornerRadius;
//右下角
mRadiusLastArray[4] = mBorderCornerRadius;
mRadiusLastArray[5] = mBorderCornerRadius;
mPath.addRoundRect(rectF, mRadiusLastArray, Path.Direction.CW);
}
return mPath;
}
@Override
protected void onTextChanged(CharSequence text, int start, int lengthBefore, int lengthAfter) {
super.onTextChanged(text, start, lengthBefore, lengthAfter);
mTextLength = text.length();
refreshView();
//改变监听
if (mOnTextInputListener != null) {
mOnTextInputListener.onTextInputChanged(text.toString(), mTextLength);
if (mTextLength == mMaxLength) {
mOnTextInputListener.onTextInputCompleted(text.toString());
}
}
}
@Override
protected void onSelectionChanged(int selStart, int selEnd) {
super.onSelectionChanged(selStart, selEnd);
if (selStart == selEnd) {
setSelection(getText() == null ? 0 : getText().length());
}
}
@Override
protected void onFocusChanged(boolean focused, int direction, Rect previouslyFocusedRect) {
super.onFocusChanged(focused, direction, previouslyFocusedRect);
//焦点改变时刷新状态
refreshView();
}
@Override
protected void onDetachedFromWindow() {
super.onDetachedFromWindow();
isDraw = false;
}
public int getBorderColor() {
return mBorderColor;
}
public int getInputBorderColor() {
return mInputBorderColor;
}
public int getFocusBorderColor() {
return mFocusBorderColor;
}
public int getBoxBackgroundColor() {
return mBoxBackgroundColor;
}
public float getBorderCornerRadius() {
return mBorderCornerRadius;
}
public float getBorderSpacing() {
return mBorderSpacing;
}
@BorderStyle
public int getBorderStyle() {
return mBorderStyle;
}
public void setBorderColor(int borderColor) {
this.mBorderColor = borderColor;
refreshView();
}
public void setInputBorderColor(int inputBorderColor) {
this.mInputBorderColor = inputBorderColor;
refreshView();
}
public void setFocusBorderColor(int focusBorderColor) {
this.mFocusBorderColor = focusBorderColor;
refreshView();
}
public void setBoxBackgroundColor(int boxBackgroundColor) {
this.mBoxBackgroundColor = boxBackgroundColor;
refreshView();
}
public void setBorderCornerRadius(float borderCornerRadius) {
this.mBorderCornerRadius = borderCornerRadius;
refreshView();
}
public void setBorderSpacing(float borderSpacing) {
this.mBorderSpacing = borderSpacing;
refreshView();
}
public void setBorderStyle(@TextStyle int borderStyle) {
this.mBorderStyle = borderStyle;
refreshView();
}
@TextStyle
public int getTextStyle() {
return mTextStyle;
}
public void setTextStyle(@TextStyle int textStyle) {
this.mTextStyle = textStyle;
refreshView();
}
public String getCipherMask() {
return mCipherMask;
}
/**
* 是否粗体
*
* @param fakeBoldText
*/
public void setFakeBoldText(boolean fakeBoldText) {
isFakeBoldText = fakeBoldText;
refreshView();
}
/**
* 设置密文掩码 不设置时,默认为{@link #DEFAULT_CIPHER_MASK}
*
* @param cipherMask
*/
public void setCipherMask(String cipherMask) {
this.mCipherMask = cipherMask;
refreshView();
}
/**
* 刷新视图
*/
private void refreshView() {
if (isDraw) {
invalidate();
}
}
/**
* 设置文本输入监听
*
* @param onTextInputListener
*/
public void setOnTextInputListener(OnTextInputListener onTextInputListener) {
this.mOnTextInputListener = onTextInputListener;
}
public static abstract class OnSimpleTextInputListener implements OnTextInputListener {
@Override
public void onTextInputChanged(String text, int length) {
}
}
/**
* 文本输入监听
*/
public interface OnTextInputListener {
/**
* Text改变监听
*
* @param text
* @param length
*/
void onTextInputChanged(String text, int length);
/**
* Text输入完成
*
* @param text
*/
void onTextInputCompleted(String text);
}
}
| 17,807 | 0.595546 | 0.591737 | 571 | 28.886164 | 25.922207 | 137 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.555166 | false | false |
3
|
b9ea91929adc9059f447e807882980786cfd436b
| 23,098,334,154,950 |
b33bccd9479dc0c19bddac7312690559c77240f1
|
/wm/src/main/java/com/dzb/wm/service/JoinService.java
|
2175db2b0ec58a6d0ec837a3fb8776a01308910e
|
[] |
no_license
|
suahe/hymakeWeb
|
https://github.com/suahe/hymakeWeb
|
38810f7ab813458cf839b2c67e64520c44a8811a
|
d800b9c0cc2bfefaf01d4178d1113fad52dc0d9f
|
refs/heads/master
| 2023-02-06T11:48:46.979000 | 2020-12-29T05:44:47 | 2020-12-29T05:44:47 | 325,197,488 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.dzb.wm.service;
import java.util.Date;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.dzb.console.security.UserInfoUtil;
import com.dzb.console.service.BaseTypeService;
import com.dzb.console.util.IDUtil;
import com.dzb.wm.entity.JoinEntity;
import com.dzb.wm.mapper.JoinMapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
/**
* @Description t_join 表Service类
* @author daizb@hymake.com
* @date 2020-06-26 00:31:49
* @version 1.0
* @remark create by ca
*/
@Service("JoinService")
@Transactional
public class JoinService {
private static final Logger log = LoggerFactory.getLogger(JoinService.class);
@Autowired
private JoinMapper joinMapper;
@Autowired
private BaseTypeService baseTypeService;
/**
* @Description 查询信息列表
* @param page
* @param rows
* @param joinEntity
* @return
* @author daizb@hymake.com
* @date 2020-06-26 00:31:49
*/
public PageInfo<JoinEntity> getPagination(Integer offset, Integer limit, JoinEntity joinEntity) {
log.debug("查询信息列表");
PageHelper.offsetPage(offset, limit);
PageInfo<JoinEntity> pi = new PageInfo<JoinEntity>(joinMapper.selectPagination(joinEntity));
List<JoinEntity> list = pi.getList();
list = baseTypeService.translate(list, "ZPLX", "joinType", "joinTypeName");
list = baseTypeService.translate(list, "GZDD", "workplace", "workplaceName");
pi.setList(list);
return pi;
}
/**
* @Description 通过主键查询信息
* @param joinId
* @return
* @author daizb@hymake.com
* @date 2020-06-26 00:31:49
*/
public JoinEntity getByPkey(long joinId){
log.debug("通过主键查询信息");
JoinEntity joinEntity = joinMapper.selectByPkey(joinId);
joinEntity = baseTypeService.translate(joinEntity, "ZPLX", "joinType", "joinTypeName");
joinEntity = baseTypeService.translate(joinEntity, "GZDD", "workplace", "workplaceName");
return joinEntity;
}
/**
* @Description 新增信息
* @param joinEntity
* @return
* @author daizb@hymake.com
* @date 2020-06-26 00:31:49
*/
public int insert(JoinEntity joinEntity) {
log.debug("新增信息");
joinEntity.setJoinId(IDUtil.getSnowflakeId());
joinEntity.setUpdateUserid(UserInfoUtil.getUserId());
joinEntity.setUpdateTime(new Date());
return joinMapper.insert(joinEntity);
}
/**
* @Description 编辑信息
* @param joinEntity
* @return
* @author daizb@hymake.com
* @date 2020-06-26 00:31:49
*/
public int update(JoinEntity joinEntity){
log.debug("编辑信息");
joinEntity.setUpdateUserid(UserInfoUtil.getUserId());
joinEntity.setUpdateTime(new Date());
return joinMapper.update(joinEntity);
}
/**
* @Description 删除信息
* @param joinId
* @return
* @author daizb@hymake.com
* @date 2020-06-26 00:31:49
*/
public int delete(long joinId){
log.debug("删除信息");
return joinMapper.delete(joinId);
}
/**
* @Description 更新发布状态
* @param joinId
* @param pushTime
* @return
* @author 38840472@qq.com
* @date 2020-06-26 13:06:24
*/
public int updatePushTimeByJoinId(long joinId, Date pushTime) {
JoinEntity joinEntity = new JoinEntity();
joinEntity.setJoinId(joinId);
joinEntity.setPushTime(pushTime);
return joinMapper.updatePushTimeByJoinId(joinEntity);
}
}
|
UTF-8
|
Java
| 3,534 |
java
|
JoinService.java
|
Java
|
[
{
"context": ";\n\n/**\n * @Description t_join 表Service类\n * @author daizb@hymake.com\n * @date 2020-06-26 00:31:49\n * @version 1.0\n * @",
"end": 658,
"score": 0.9999242424964905,
"start": 642,
"tag": "EMAIL",
"value": "daizb@hymake.com"
},
{
"context": "rows\n\t * @param joinEntity\n\t * @return\n\t * @author daizb@hymake.com\n\t * @date 2020-06-26 00:31:49\n\t */\n\tpublic PageIn",
"end": 1104,
"score": 0.9999268054962158,
"start": 1088,
"tag": "EMAIL",
"value": "daizb@hymake.com"
},
{
"context": "通过主键查询信息\n\t * @param joinId\n\t * @return\n\t * @author daizb@hymake.com\n\t * @date 2020-06-26 00:31:49\n\t */\n\tpublic JoinEn",
"end": 1725,
"score": 0.9999266266822815,
"start": 1709,
"tag": "EMAIL",
"value": "daizb@hymake.com"
},
{
"context": "新增信息\n\t * @param joinEntity\n\t * @return\n\t * @author daizb@hymake.com\n\t * @date 2020-06-26 00:31:49\n\t */\n\tpublic int in",
"end": 2187,
"score": 0.9999266862869263,
"start": 2171,
"tag": "EMAIL",
"value": "daizb@hymake.com"
},
{
"context": "编辑信息\n\t * @param joinEntity\n\t * @return\n\t * @author daizb@hymake.com\n\t * @date 2020-06-26 00:31:49\n\t */\n\tpublic int up",
"end": 2568,
"score": 0.9999277591705322,
"start": 2552,
"tag": "EMAIL",
"value": "daizb@hymake.com"
},
{
"context": "ion 删除信息\n\t * @param joinId\n\t * @return\n\t * @author daizb@hymake.com\n\t * @date 2020-06-26 00:31:49\n\t */\n\tpublic int de",
"end": 2897,
"score": 0.9999285936355591,
"start": 2881,
"tag": "EMAIL",
"value": "daizb@hymake.com"
},
{
"context": "oinId\n\t * @param pushTime\n\t * @return\n\t * @author 38840472@qq.com\n\t * @date 2020-06-26 13:06:24\n\t */\n\tpublic int up",
"end": 3136,
"score": 0.999897301197052,
"start": 3121,
"tag": "EMAIL",
"value": "38840472@qq.com"
}
] | null |
[] |
package com.dzb.wm.service;
import java.util.Date;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.dzb.console.security.UserInfoUtil;
import com.dzb.console.service.BaseTypeService;
import com.dzb.console.util.IDUtil;
import com.dzb.wm.entity.JoinEntity;
import com.dzb.wm.mapper.JoinMapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
/**
* @Description t_join 表Service类
* @author <EMAIL>
* @date 2020-06-26 00:31:49
* @version 1.0
* @remark create by ca
*/
@Service("JoinService")
@Transactional
public class JoinService {
private static final Logger log = LoggerFactory.getLogger(JoinService.class);
@Autowired
private JoinMapper joinMapper;
@Autowired
private BaseTypeService baseTypeService;
/**
* @Description 查询信息列表
* @param page
* @param rows
* @param joinEntity
* @return
* @author <EMAIL>
* @date 2020-06-26 00:31:49
*/
public PageInfo<JoinEntity> getPagination(Integer offset, Integer limit, JoinEntity joinEntity) {
log.debug("查询信息列表");
PageHelper.offsetPage(offset, limit);
PageInfo<JoinEntity> pi = new PageInfo<JoinEntity>(joinMapper.selectPagination(joinEntity));
List<JoinEntity> list = pi.getList();
list = baseTypeService.translate(list, "ZPLX", "joinType", "joinTypeName");
list = baseTypeService.translate(list, "GZDD", "workplace", "workplaceName");
pi.setList(list);
return pi;
}
/**
* @Description 通过主键查询信息
* @param joinId
* @return
* @author <EMAIL>
* @date 2020-06-26 00:31:49
*/
public JoinEntity getByPkey(long joinId){
log.debug("通过主键查询信息");
JoinEntity joinEntity = joinMapper.selectByPkey(joinId);
joinEntity = baseTypeService.translate(joinEntity, "ZPLX", "joinType", "joinTypeName");
joinEntity = baseTypeService.translate(joinEntity, "GZDD", "workplace", "workplaceName");
return joinEntity;
}
/**
* @Description 新增信息
* @param joinEntity
* @return
* @author <EMAIL>
* @date 2020-06-26 00:31:49
*/
public int insert(JoinEntity joinEntity) {
log.debug("新增信息");
joinEntity.setJoinId(IDUtil.getSnowflakeId());
joinEntity.setUpdateUserid(UserInfoUtil.getUserId());
joinEntity.setUpdateTime(new Date());
return joinMapper.insert(joinEntity);
}
/**
* @Description 编辑信息
* @param joinEntity
* @return
* @author <EMAIL>
* @date 2020-06-26 00:31:49
*/
public int update(JoinEntity joinEntity){
log.debug("编辑信息");
joinEntity.setUpdateUserid(UserInfoUtil.getUserId());
joinEntity.setUpdateTime(new Date());
return joinMapper.update(joinEntity);
}
/**
* @Description 删除信息
* @param joinId
* @return
* @author <EMAIL>
* @date 2020-06-26 00:31:49
*/
public int delete(long joinId){
log.debug("删除信息");
return joinMapper.delete(joinId);
}
/**
* @Description 更新发布状态
* @param joinId
* @param pushTime
* @return
* @author <EMAIL>
* @date 2020-06-26 13:06:24
*/
public int updatePushTimeByJoinId(long joinId, Date pushTime) {
JoinEntity joinEntity = new JoinEntity();
joinEntity.setJoinId(joinId);
joinEntity.setPushTime(pushTime);
return joinMapper.updatePushTimeByJoinId(joinEntity);
}
}
| 3,472 | 0.724956 | 0.692736 | 136 | 24.110294 | 21.920872 | 98 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.433824 | false | false |
3
|
545f8d76f77c5e7d963bff8d081e6fa78e8299ce
| 26,938,034,924,154 |
1e3768890ef8d23645ed0aef96f3553efe9f200c
|
/src/com/main/controller/MainCtr.java
|
9b6b42a675da1d14f8eef4dc21000dabd5038a2a
|
[] |
no_license
|
sonnke/javafx-file-reader
|
https://github.com/sonnke/javafx-file-reader
|
a8763408dee2b579e30ebb82effe2fe45652a79e
|
37e117ba5825fdf22e81e4182eef7404e4cd7d25
|
refs/heads/master
| 2020-12-10T00:12:23.903000 | 2020-01-26T00:32:10 | 2020-01-26T00:32:10 | 233,453,813 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.main.controller;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Scanner;
public class MainCtr {
private String fileName = null;
public MainCtr(String filename) {
this.fileName = filename;
}
public Boolean addUser(String user) {
try{
PrintWriter outputStream = new PrintWriter( new FileOutputStream(this.fileName,true));
//Write to a file
outputStream.println(user);
outputStream.close();
return true;
}catch(FileNotFoundException e){
System.out.println(e.getMessage());
return false;
}
}
//Let's read file
public ArrayList<String> readFile(){
ArrayList<String> lines = new ArrayList<String>();
try {
Scanner outPutStream = new Scanner(new File(this.fileName));
while(outPutStream.hasNextLine()){
lines.add(outPutStream.nextLine());
}
//Close stream
outPutStream.close();
return lines;
}catch(FileNotFoundException e){
System.out.println(e.getMessage());
return lines;
}
}
}
|
UTF-8
|
Java
| 1,104 |
java
|
MainCtr.java
|
Java
|
[] | null |
[] |
package com.main.controller;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Scanner;
public class MainCtr {
private String fileName = null;
public MainCtr(String filename) {
this.fileName = filename;
}
public Boolean addUser(String user) {
try{
PrintWriter outputStream = new PrintWriter( new FileOutputStream(this.fileName,true));
//Write to a file
outputStream.println(user);
outputStream.close();
return true;
}catch(FileNotFoundException e){
System.out.println(e.getMessage());
return false;
}
}
//Let's read file
public ArrayList<String> readFile(){
ArrayList<String> lines = new ArrayList<String>();
try {
Scanner outPutStream = new Scanner(new File(this.fileName));
while(outPutStream.hasNextLine()){
lines.add(outPutStream.nextLine());
}
//Close stream
outPutStream.close();
return lines;
}catch(FileNotFoundException e){
System.out.println(e.getMessage());
return lines;
}
}
}
| 1,104 | 0.706522 | 0.706522 | 50 | 21.08 | 18.231665 | 89 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.26 | false | false |
3
|
32f3cc36e1bd7bad387c13db39f1883542f70e92
| 13,675,175,937,280 |
080e0e0e6b17110df802cc429fdd23927c20820b
|
/app/src/main/java/in/co/geekninja/charithranweshikal/InternetListener.java
|
21f5e040ecdc1834019fc2bb9e87632a6e540f0c
|
[] |
no_license
|
minto5050/Alchemist
|
https://github.com/minto5050/Alchemist
|
5c75803d9cbc8a1052fa183fd4478f64293a8102
|
28be6dc5e784a6a005e7a96828a7120dc2e87eb7
|
refs/heads/master
| 2020-12-12T09:45:20.676000 | 2019-09-17T07:24:36 | 2019-09-17T07:24:36 | 52,656,836 | 0 | 2 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package in.co.geekninja.charithranweshikal;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import in.co.geekninja.charithranweshikal.Services.Fetcher;
import in.co.geekninja.charithranweshikal.Storage.SharedPrefs;
/**
* This broadcast listener listens when the device is connected to the internet or disconnected from
* To download the new articles and save them locally
* Created by PS on 8/27/2016.
*/
public class InternetListener extends BroadcastReceiver {
/**
* The method for checking if the internet connection is available or not.
* @param context The context
* @return <code>true</code> if the network is available and <code>false</code> otherwise
*/
public boolean isNetworkAvailable(Context context) {
ConnectivityManager connectivityManager
= (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo activeNetworkInfo = connectivityManager.getActiveNetworkInfo();
return activeNetworkInfo != null && activeNetworkInfo.isConnected();
}
/**
* Upon receiving the broadcast and if the network is available:-
* <br>The app will start to download 400 articles from the last paging token</br>
* @param context The context
* @param intent The data sent for the broadcast receivers
*/
@Override
public void onReceive(Context context, Intent intent) {
if (isNetworkAvailable(context)) {
SharedPreferences sp = SharedPrefs.getInstance(context);
String until = sp.getString(SharedPrefs.UNTIL, "NoN");
String pagingToken = sp.getString(SharedPrefs.PAGING_TOKEN, "NoN");
Fetcher.startActionNext(context,until,pagingToken);
}
}
}
|
UTF-8
|
Java
| 1,920 |
java
|
InternetListener.java
|
Java
|
[] | null |
[] |
package in.co.geekninja.charithranweshikal;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import in.co.geekninja.charithranweshikal.Services.Fetcher;
import in.co.geekninja.charithranweshikal.Storage.SharedPrefs;
/**
* This broadcast listener listens when the device is connected to the internet or disconnected from
* To download the new articles and save them locally
* Created by PS on 8/27/2016.
*/
public class InternetListener extends BroadcastReceiver {
/**
* The method for checking if the internet connection is available or not.
* @param context The context
* @return <code>true</code> if the network is available and <code>false</code> otherwise
*/
public boolean isNetworkAvailable(Context context) {
ConnectivityManager connectivityManager
= (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo activeNetworkInfo = connectivityManager.getActiveNetworkInfo();
return activeNetworkInfo != null && activeNetworkInfo.isConnected();
}
/**
* Upon receiving the broadcast and if the network is available:-
* <br>The app will start to download 400 articles from the last paging token</br>
* @param context The context
* @param intent The data sent for the broadcast receivers
*/
@Override
public void onReceive(Context context, Intent intent) {
if (isNetworkAvailable(context)) {
SharedPreferences sp = SharedPrefs.getInstance(context);
String until = sp.getString(SharedPrefs.UNTIL, "NoN");
String pagingToken = sp.getString(SharedPrefs.PAGING_TOKEN, "NoN");
Fetcher.startActionNext(context,until,pagingToken);
}
}
}
| 1,920 | 0.728125 | 0.722917 | 46 | 40.739132 | 30.437702 | 100 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.456522 | false | false |
3
|
066ad7dc6c6e0f6600a988eb046dc557ea01fa62
| 26,474,178,443,203 |
86b96f70421b465b5037af010d9ff6350f2af770
|
/longestsubstring.java
|
ba914af3d44e20d811f73f812b93f5ebb72ca495
|
[] |
no_license
|
meet-github-1/programmin1
|
https://github.com/meet-github-1/programmin1
|
552595d93af550e6d131a7b7c1bdb5e9fca21903
|
2a8c18b58d299aed38031f095e338b2b82abf0a0
|
refs/heads/master
| 2023-06-23T19:01:37.874000 | 2021-07-27T05:08:37 | 2021-07-27T05:08:37 | 389,856,518 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
import java.util.*;
import java.lang.*;
class longestsubstring{
static int findlongest(String s,int k){
int len=s.length();
if(len==0 || len<k) return 0;
if(k<=1) return len;
Map<Character,Integer> mp=new HashMap<Character,Integer>();
for(int i=0;i<len;i++){
mp.put(s.charAt(i),mp.getOrDefault(s.charAt(i),0)+1);
}
int l=0;
while(l<len && mp.get(s.charAt(l))>=k){
l++;
}
if(l>=len){
return l;
}
int l1=findlongest(s.substring(0,l),k);
while(l<len && mp.get(s.charAt(l))<k){
l++;
}
int l2=findlongest(s.substring(l,len),k);
//p
return Math.max(l1,l2);
}
public static void main(String[] args){
Scanner in=new Scanner(System.in);
String s=in.next();
int k=in.nextInt();
System.out.println(findlongest(s,k));
}
}
|
UTF-8
|
Java
| 942 |
java
|
longestsubstring.java
|
Java
|
[] | null |
[] |
import java.util.*;
import java.lang.*;
class longestsubstring{
static int findlongest(String s,int k){
int len=s.length();
if(len==0 || len<k) return 0;
if(k<=1) return len;
Map<Character,Integer> mp=new HashMap<Character,Integer>();
for(int i=0;i<len;i++){
mp.put(s.charAt(i),mp.getOrDefault(s.charAt(i),0)+1);
}
int l=0;
while(l<len && mp.get(s.charAt(l))>=k){
l++;
}
if(l>=len){
return l;
}
int l1=findlongest(s.substring(0,l),k);
while(l<len && mp.get(s.charAt(l))<k){
l++;
}
int l2=findlongest(s.substring(l,len),k);
//p
return Math.max(l1,l2);
}
public static void main(String[] args){
Scanner in=new Scanner(System.in);
String s=in.next();
int k=in.nextInt();
System.out.println(findlongest(s,k));
}
}
| 942 | 0.505308 | 0.492569 | 33 | 27.545454 | 17.123598 | 67 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1 | false | false |
3
|
bfd7b1f6e5d6203467a2265af4eea85191305e15
| 12,601,434,064,236 |
a716acd96dee129d50337e00ebf7c9af00ffc0aa
|
/src/main/java/com/butakka/infrastructure/routing/AbstractRouterStrategyConfigurer.java
|
776c5e6894d95c67c0b3b04dc299c145e172ae31
|
[
"MIT"
] |
permissive
|
esolomka/butakka
|
https://github.com/esolomka/butakka
|
6452b8d6d928b5600bb67d4c3c3d415dbdf38443
|
dcb79f868da390bad2665e24d8fa3594d98ce13b
|
refs/heads/master
| 2020-05-29T11:36:30.763000 | 2015-03-08T18:07:53 | 2015-03-08T18:07:53 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.butakka.infrastructure.routing;
import com.butakka.annotations.RouterActor;
import com.butakka.infrastructure.context.ActorDefinerContext;
import com.butakka.infrastructure.context.SupervisorStrategyContext;
import org.springframework.beans.factory.annotation.Autowired;
/**
* Created by Jesus Barquín on 8/03/15.
*/
public abstract class AbstractRouterStrategyConfigurer implements RouterStrategyConfigurer{
@Autowired
protected SupervisorStrategyContext supervisorStrategyContext;
@Autowired
protected ActorDefinerContext actorDefinerContext;
abstract public void configure(RouterActor annotation);
protected boolean hasSupervision(String actorId){
return supervisorStrategyContext.lookupDeciderByActorId(actorId) != null;
}
}
|
UTF-8
|
Java
| 788 |
java
|
AbstractRouterStrategyConfigurer.java
|
Java
|
[
{
"context": "s.factory.annotation.Autowired;\n\n/**\n * Created by Jesus Barquín on 8/03/15.\n */\npublic abstract class AbstractRou",
"end": 316,
"score": 0.9998611211776733,
"start": 303,
"tag": "NAME",
"value": "Jesus Barquín"
}
] | null |
[] |
package com.butakka.infrastructure.routing;
import com.butakka.annotations.RouterActor;
import com.butakka.infrastructure.context.ActorDefinerContext;
import com.butakka.infrastructure.context.SupervisorStrategyContext;
import org.springframework.beans.factory.annotation.Autowired;
/**
* Created by <NAME> on 8/03/15.
*/
public abstract class AbstractRouterStrategyConfigurer implements RouterStrategyConfigurer{
@Autowired
protected SupervisorStrategyContext supervisorStrategyContext;
@Autowired
protected ActorDefinerContext actorDefinerContext;
abstract public void configure(RouterActor annotation);
protected boolean hasSupervision(String actorId){
return supervisorStrategyContext.lookupDeciderByActorId(actorId) != null;
}
}
| 780 | 0.814485 | 0.808132 | 26 | 29.26923 | 30.44359 | 91 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.346154 | false | false |
3
|
38a7a372ae5f3354a57eef788891c3e8a34d8727
| 12,601,434,061,682 |
2003a264c841eb0c6e3496cd39181550cddcf54f
|
/src/Algorithm/Algo.java
|
adbc9c70e1d47119c5d0068318e72258ac414c65
|
[
"MIT"
] |
permissive
|
armanaxh/Page-Replacement-Algorithm-Simulation
|
https://github.com/armanaxh/Page-Replacement-Algorithm-Simulation
|
3db801a3f4b00a1530fab4c7d4976a4d50631ec0
|
ff6ee4ddce535b8945ca372f7fc18ac6deded280
|
refs/heads/master
| 2021-05-13T23:16:55.020000 | 2018-01-06T22:11:13 | 2018-01-06T22:11:13 | 116,510,948 | 1 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package Algorithm;
import controller.Result;
import core.MemorySimulator;
import core.ProgramSimulator;
/**
* Created by armanaxh on 1/3/18.
*/
public abstract class Algo {
protected MemorySimulator memorySim;
protected ProgramSimulator programSim;
protected Result result;
public Algo(MemorySimulator memorySim, ProgramSimulator programSim) {
this.memorySim = memorySim;
this.programSim = programSim;
this.result = new Result();
}
public abstract Algo calc();
public Result getResult(){
return this.result;
}
}
|
UTF-8
|
Java
| 584 |
java
|
Algo.java
|
Java
|
[
{
"context": ";\nimport core.ProgramSimulator;\n\n/**\n * Created by armanaxh on 1/3/18.\n */\npublic abstract class Algo {\n p",
"end": 132,
"score": 0.9990249872207642,
"start": 124,
"tag": "USERNAME",
"value": "armanaxh"
}
] | null |
[] |
package Algorithm;
import controller.Result;
import core.MemorySimulator;
import core.ProgramSimulator;
/**
* Created by armanaxh on 1/3/18.
*/
public abstract class Algo {
protected MemorySimulator memorySim;
protected ProgramSimulator programSim;
protected Result result;
public Algo(MemorySimulator memorySim, ProgramSimulator programSim) {
this.memorySim = memorySim;
this.programSim = programSim;
this.result = new Result();
}
public abstract Algo calc();
public Result getResult(){
return this.result;
}
}
| 584 | 0.69863 | 0.691781 | 26 | 21.461538 | 18.134605 | 73 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.5 | false | false |
3
|
d7674fe965d3b805ae02143cfed5222008ba529a
| 2,044,404,487,618 |
2f3c04382a66dbf222c8587edd67a5df4bc80422
|
/src/com/softproideas/app/admin/users/service/UsersServiceImpl.java
|
7d9e4e34000c79e58098dba606c62d05cf884a4a
|
[] |
no_license
|
arnoldbendaa/cppro
|
https://github.com/arnoldbendaa/cppro
|
d3ab6181cc51baad2b80876c65e11e92c569f0cc
|
f55958b85a74ad685f1360ae33c881b50d6e5814
|
refs/heads/master
| 2020-03-23T04:18:00.265000 | 2018-09-11T08:15:28 | 2018-09-11T08:15:28 | 141,074,966 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
/*******************************************************************************
* Copyright ©2015. IT Services Jacek Kurasiewicz, Warsaw, Poland. All Rights
* Reserved.
*
* Republication, redistribution, granting a license to other parties, using,
* copying, modifying this software and its documentation is prohibited without the
* prior written consent of IT Services Jacek Kurasiewicz.
* Contact The Office of IT Services Jacek Kurasiewicz, ul. Koszykowa 60/62 lok.
* 43, 00-673 Warszawa, jk@softpro.pl, +48 512-25-67-67, for commercial licensing
* opportunities.
*
* IN NO EVENT SHALL IT SERVICES JACEK KURASIEWICZ BE LIABLE TO ANY PARTY FOR
* DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST
* PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
* IT SERVICES JACEK KURASIEWICZ HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*
* IT SERVICES JACEK KURASIEWICZ SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
* BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY,
* PROVIDED HEREUNDER IS PROVIDED "AS IS". IT SERVICES JACEK KURASIEWICZ HAS NO
* OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
* MODIFICATIONS.
*******************************************************************************/
package com.softproideas.app.admin.users.service;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.cedar.cp.api.base.CPException;
import com.cedar.cp.api.base.ValidationException;
import com.cedar.cp.dto.dimension.ImmediateChildrenELO;
import com.cedar.cp.dto.model.AllModelsELO;
import com.cedar.cp.dto.model.BudgetHierarchyRootNodeForModelELO;
import com.cedar.cp.dto.role.AllHiddenRolesELO;
import com.cedar.cp.dto.user.AllUsersELO;
import com.cedar.cp.dto.user.UserEditorSessionCSO;
import com.cedar.cp.dto.user.UserEditorSessionSSO;
import com.cedar.cp.dto.user.UserImpl;
import com.cedar.cp.dto.user.UserPK;
import com.cedar.cp.dto.xmlform.AllXmlFormsELO;
import com.cedar.cp.ejb.api.user.UserEditorSessionServer;
import com.cedar.cp.ejb.impl.user.UserEditorSessionSEJB;
import com.softproideas.app.admin.profiles.model.ProfileDTO;
import com.softproideas.app.admin.profiles.service.ProfilesService;
import com.softproideas.app.admin.users.mapper.UsersMapper;
import com.softproideas.app.admin.users.model.UserDetailsDTO;
import com.softproideas.app.admin.users.util.UsersValidatorUtil;
import com.softproideas.app.core.flatform.model.FlatFormExtendedCoreDTO;
import com.softproideas.app.core.profile.service.ProfileService;
import com.softproideas.app.core.users.model.UserCoreDTO;
import com.softproideas.common.exceptions.ServiceException;
import com.softproideas.common.models.FormDeploymentDataDTO;
import com.softproideas.commons.context.CPContextHolder;
import com.softproideas.commons.model.ResponseMessage;
import com.softproideas.commons.model.error.ValidationError;
import com.softproideas.commons.model.tree.NodeLazyDTO;
@Service("usersService")
public class UsersServiceImpl implements UsersService {
private static Logger logger = LoggerFactory.getLogger(UsersServiceImpl.class);
@Autowired
CPContextHolder cpContextHolder;
@Autowired
ProfilesService profilesService;
@Autowired
ProfileService profileService;
UserEditorSessionSEJB server = new UserEditorSessionSEJB();
/**
* Returns list of available users
*/
@Override
public List<UserCoreDTO> browseUsers() throws ServiceException {
AllUsersELO allUsersELO = cpContextHolder.getListSessionServer().getAllUsers();
return UsersMapper.mapAllUsersELO(allUsersELO);
}
/**
* Method save changing or create new data user details
* @throws SQLException
*/
public ResponseMessage save(int userId, UserDetailsDTO user) throws ServiceException, SQLException {
ResponseMessage message = null;
// UserEditorSessionServer server = cpContextHolder.getUserEditorSessionServer();
UserImpl userImpl = getItemData(userId, server);
List<Object[]> beforeSave = userImpl.getUserAssignments();
ValidationError error = UsersValidatorUtil.validateUserDetails(userImpl, user);
List<FlatFormExtendedCoreDTO> oldFormList = UsersMapper.mapListObjectXml(userImpl.getUserXmlForms());
String method;
if (user.getUserId() != -1) {
method = "edit";
} else {
method = "create";
}
if (error.getFieldErrors().isEmpty()) {
userImpl = UsersMapper.mapUserImpl(userImpl, user);
userId = saveOrUpdateUser(userImpl, server, userId);
message = new ResponseMessage(true);
} else {
error.setMessage("Error during " + method + " User.");
message = error;
}
List<Object[]> afterSave = userImpl.getUserAssignments();
// create new mobile profile for user
message = createMobileProfileForUser(user, userId);
// delete profiles
message = deleteMobileProfiles(user, userId);
updateProfilesAfterUserSave(oldFormList, user.getXmlForm(), beforeSave, afterSave, userId);
return message;
}
private ResponseMessage deleteMobileProfiles(UserDetailsDTO user, int userId) {
ResponseMessage message = new ResponseMessage(true);
try {
List<ProfileDTO> profiles = user.getMobileProfiles();
for (ProfileDTO p: profiles) {
if (p.isForDeletion() == true) {
profilesService.deleteProfile(userId, p.getProfileId());
}
}
} catch (Exception e) {
if (message.getMessage() != null) {
message.setMessage(message.getMessage() + ",\n" + e.getMessage());
} else {
message.setMessage(e.getMessage());
}
message.setError(true);
e.printStackTrace();
}
return message;
}
private ResponseMessage createMobileProfileForUser(UserDetailsDTO user, int userId) {
ResponseMessage message = new ResponseMessage(true);
if (user.getProfilesToSave() != null) {
try {
List<FormDeploymentDataDTO> profilesToSave = user.getProfilesToSave();
for (FormDeploymentDataDTO p: profilesToSave) {
profilesService.createMobileProfileForUser(userId, p);
}
} catch (Exception e) {
if (message.getMessage() != null) {
message.setMessage(message.getMessage() + ",\n" + e.getMessage());
} else {
message.setMessage(e.getMessage());
}
message.setError(true);
e.printStackTrace();
}
}
return message;
}
private int saveOrUpdateUser(UserImpl userImpl, UserEditorSessionSEJB server, int userId) {
if (userImpl.getPrimaryKey() == null) {
UserPK usr = null;
try {
usr = server.insert(new UserEditorSessionCSO(userId, userImpl));
} catch (CPException e) {
e.printStackTrace();
} catch (ValidationException e) {
e.printStackTrace();
}
userId = usr.getUserId();
} else {
try {
server.update(new UserEditorSessionCSO(userId, userImpl));
} catch (CPException e) {
e.printStackTrace();
} catch (ValidationException e) {
e.printStackTrace();
}
}
return userId;
}
private void updateProfilesAfterUserSave(List<FlatFormExtendedCoreDTO> oldFormList, List<FlatFormExtendedCoreDTO> newFormList, List<Object[]> beforeSave, List<Object[]> afterSave, int userId) throws ServiceException, SQLException {
List<Integer> modelsIds = getModelIdsForProfiles(afterSave, beforeSave);
List<Integer> listDeleted = getModelIdsForProfiles(beforeSave, afterSave);
if (listDeleted.size() > 0) {
List<Integer> userIds = new ArrayList<Integer>();
userIds.add(userId);
profileService.deleteProfiles(listDeleted, userIds); // uncomment to enable automatic delete profiles
}
for (Integer modelId: modelsIds) {
profileService.createProfiles(modelId, userId);
}
List<Integer> formToSubstractList = new ArrayList<Integer>();
List<Integer> formToAddList = new ArrayList<Integer>();
// Create new profiles
newFormList: for (FlatFormExtendedCoreDTO newFormRefImpl: newFormList) {
for (FlatFormExtendedCoreDTO oldUserRefImpl: oldFormList) {
if (newFormRefImpl.getFlatFormId() == oldUserRefImpl.getFlatFormId()) {
continue newFormList; // exists in old and new userlist
}
}
formToAddList.add(newFormRefImpl.getFlatFormId());
}
// Delete old profiles
oldFormList: for (FlatFormExtendedCoreDTO oldFormRefImpl: oldFormList) {
for (FlatFormExtendedCoreDTO newUserRefImpl: newFormList) {
if (newUserRefImpl.getFlatFormId() == oldFormRefImpl.getFlatFormId()) {
continue oldFormList; // exists in old and new userlist
}
}
formToSubstractList.add(oldFormRefImpl.getFlatFormId());
}
if (formToAddList.size() > 0) {
profileService.insertProfileForUser(formToAddList, userId, modelsIds);
}
if (formToSubstractList.size() > 0) {
profileService.deleteProfilesForUser(formToSubstractList, userId);
}
}
/**
* Method returns user details in DTO
*/
@Override
public UserDetailsDTO fetchUsersDetails(int userId) throws ServiceException {
// UserEditorSessionServer server = cpContextHolder.getUserEditorSessionServer();
UserImpl userImpl = getItemData(userId, server);
AllXmlFormsELO availableXmlForm = cpContextHolder.getListSessionServer().getAllXmlForms();
AllHiddenRolesELO elo = cpContextHolder.getListSessionServer().getAllHiddenRoles();
UserDetailsDTO usersDetailsDTO = UsersMapper.mapUserDetails(userImpl, elo, availableXmlForm);
List<ProfileDTO> mobileProfiles = profilesService.browseMobileProfiles(userId);
usersDetailsDTO.setMobileProfiles(mobileProfiles);
return usersDetailsDTO;
}
/**
* Method return user item data
*/
private UserImpl getItemData(int userId, UserEditorSessionSEJB server) throws ServiceException {
try {
UserEditorSessionSSO userEditorSessionSSO;
if (userId != -1) {
UserPK userPK = new UserPK(userId);
userEditorSessionSSO = server.getItemData(userId,userPK);
} else {
userEditorSessionSSO = server.getNewItemData(userId);
}
UserImpl userImpl = userEditorSessionSSO.getEditorData();
return userImpl;
} catch (CPException e) {
logger.error("Error during get users!", e);
throw new ServiceException("Error during get users!", e);
} catch (ValidationException e) {
logger.error("Validation error during get users!", e);
throw new ServiceException("Validation error during get users!", e);
}
}
/**
* Delete user from database.
*/
@Override
public ResponseMessage delete(int userId) throws ServiceException {
UserPK userPK = new UserPK(userId);
try {
// cpContextHolder.getUserEditorSessionServer().delete(userPK);
server.delete(cpContextHolder.getUserId(),userPK);
profileService.deleteAllProfilesForUser(userId);
ResponseMessage responseMessage = new ResponseMessage(true);
return responseMessage;
} catch (ValidationException e) {
logger.error("Validation error during dalete user with Id =" + e + "!");
ValidationError error = new ValidationError(e.getMessage());
return error;
} catch (CPException e) {
logger.error("Error during delete user =" + e + "!");
throw new ServiceException("Error during dalete user with Id =" + e + "!");
}
}
/**
* Get User Assignment for user
* @param userId
* @return
* @throws ServiceException
*/
// private UserImpl getUserImpl(int userId) throws ServiceException {
// try {
// UserEditorSessionServer server = cpContextHolder.getUserEditorSessionServer();
// UserPK userPK = new UserPK(userId);
// UserEditorSessionSSO userEditorSessionSSO = server.getItemData(userPK);
// UserImpl userImpl = userEditorSessionSSO.getEditorData();
// return userImpl;
// } catch (CPException e) {
// logger.error("Error during get users!", e);
// throw new ServiceException("Error during get users!", e);
// } catch (ValidationException e) {
// logger.error("Validation error during get users!", e);
// throw new ServiceException("Validation error during get users!", e);
// }
// }
/**
* Get modelRootSecurity for user
*/
@Override
public List<NodeLazyDTO> browseSecurityModelRoot() throws ServiceException {
AllModelsELO modelsList = cpContextHolder.getListSessionServer().getAllModels();
List<NodeLazyDTO> modelRoot = UsersMapper.mapAllModelsELO(modelsList);
return modelRoot;
}
/**
* Get modelsSecurity for user
*/
@Override
public List<NodeLazyDTO> browseSecurityModels(int userId, int modelId) throws ServiceException {
// UserEditorSessionServer server = cpContextHolder.getUserEditorSessionServer();
UserImpl userImpl = getItemData(userId, server);
BudgetHierarchyRootNodeForModelELO hierarchiesforModelELO = cpContextHolder.getListSessionServer().getBudgetHierarchyRootNodeForModel(modelId);
List<NodeLazyDTO> models = UsersMapper.mapHierarchiesForModelELO(hierarchiesforModelELO, userImpl);
return models;
}
/**
* Get structure and structureElement - Security for user
*/
@Override
public List<NodeLazyDTO> browseSecurityStructureElement(int userId, int structureId, int structureElementId) throws ServiceException {
// UserEditorSessionServer server = cpContextHolder.getUserEditorSessionServer();
UserImpl userImpl = getItemData(userId, server);
ImmediateChildrenELO structureElement = cpContextHolder.getListSessionServer().getImmediateChildren(structureId, structureElementId);
List<NodeLazyDTO> element = UsersMapper.mapImmediateChildrenELO(structureElement, userImpl);
return element;
}
private List<Integer> getModelIdsForProfiles(List<Object[]> longerListOfModels, List<Object[]> shorterListOfModels) {
List<Integer> list = new ArrayList<Integer>();
for (int i = 0; i < longerListOfModels.size(); i++) {
if (shorterListOfModels.size() == 0) {
for (int k = 0; k < longerListOfModels.size(); k++) {
list.add((Integer) longerListOfModels.get(k)[0]);
}
}
for (int j = 0; j < shorterListOfModels.size(); j++) {
if (longerListOfModels.get(i)[0].equals(shorterListOfModels.get(j)[0])) {
break;
}
if (j == shorterListOfModels.size() - 1) {
list.add((Integer) longerListOfModels.get(i)[0]);
}
}
}
return list;
}
}
|
UTF-8
|
Java
| 16,045 |
java
|
UsersServiceImpl.java
|
Java
|
[
{
"context": "******************\n * Copyright ©2015. IT Services Jacek Kurasiewicz, Warsaw, Poland. All Rights\n * Reserved.\n *\n * Re",
"end": 130,
"score": 0.9806900024414062,
"start": 113,
"tag": "NAME",
"value": "Jacek Kurasiewicz"
},
{
"context": "urasiewicz, ul. Koszykowa 60/62 lok.\n * 43, 00-673 Warszawa, jk@softpro.pl, +48 512-25-67-67, for commerci",
"end": 496,
"score": 0.6851041913032532,
"start": 491,
"tag": "NAME",
"value": "Warsz"
},
{
"context": ", ul. Koszykowa 60/62 lok.\n * 43, 00-673 Warszawa, jk@softpro.pl, +48 512-25-67-67, for commercial licensing\n * op",
"end": 514,
"score": 0.9998942017555237,
"start": 501,
"tag": "EMAIL",
"value": "jk@softpro.pl"
}
] | null |
[] |
/*******************************************************************************
* Copyright ©2015. IT Services <NAME>, Warsaw, Poland. All Rights
* Reserved.
*
* Republication, redistribution, granting a license to other parties, using,
* copying, modifying this software and its documentation is prohibited without the
* prior written consent of IT Services Jacek Kurasiewicz.
* Contact The Office of IT Services Jacek Kurasiewicz, ul. Koszykowa 60/62 lok.
* 43, 00-673 Warszawa, <EMAIL>, +48 512-25-67-67, for commercial licensing
* opportunities.
*
* IN NO EVENT SHALL IT SERVICES JACEK KURASIEWICZ BE LIABLE TO ANY PARTY FOR
* DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST
* PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
* IT SERVICES JACEK KURASIEWICZ HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*
* IT SERVICES JACEK KURASIEWICZ SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
* BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY,
* PROVIDED HEREUNDER IS PROVIDED "AS IS". IT SERVICES JACEK KURASIEWICZ HAS NO
* OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
* MODIFICATIONS.
*******************************************************************************/
package com.softproideas.app.admin.users.service;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.cedar.cp.api.base.CPException;
import com.cedar.cp.api.base.ValidationException;
import com.cedar.cp.dto.dimension.ImmediateChildrenELO;
import com.cedar.cp.dto.model.AllModelsELO;
import com.cedar.cp.dto.model.BudgetHierarchyRootNodeForModelELO;
import com.cedar.cp.dto.role.AllHiddenRolesELO;
import com.cedar.cp.dto.user.AllUsersELO;
import com.cedar.cp.dto.user.UserEditorSessionCSO;
import com.cedar.cp.dto.user.UserEditorSessionSSO;
import com.cedar.cp.dto.user.UserImpl;
import com.cedar.cp.dto.user.UserPK;
import com.cedar.cp.dto.xmlform.AllXmlFormsELO;
import com.cedar.cp.ejb.api.user.UserEditorSessionServer;
import com.cedar.cp.ejb.impl.user.UserEditorSessionSEJB;
import com.softproideas.app.admin.profiles.model.ProfileDTO;
import com.softproideas.app.admin.profiles.service.ProfilesService;
import com.softproideas.app.admin.users.mapper.UsersMapper;
import com.softproideas.app.admin.users.model.UserDetailsDTO;
import com.softproideas.app.admin.users.util.UsersValidatorUtil;
import com.softproideas.app.core.flatform.model.FlatFormExtendedCoreDTO;
import com.softproideas.app.core.profile.service.ProfileService;
import com.softproideas.app.core.users.model.UserCoreDTO;
import com.softproideas.common.exceptions.ServiceException;
import com.softproideas.common.models.FormDeploymentDataDTO;
import com.softproideas.commons.context.CPContextHolder;
import com.softproideas.commons.model.ResponseMessage;
import com.softproideas.commons.model.error.ValidationError;
import com.softproideas.commons.model.tree.NodeLazyDTO;
@Service("usersService")
public class UsersServiceImpl implements UsersService {
private static Logger logger = LoggerFactory.getLogger(UsersServiceImpl.class);
@Autowired
CPContextHolder cpContextHolder;
@Autowired
ProfilesService profilesService;
@Autowired
ProfileService profileService;
UserEditorSessionSEJB server = new UserEditorSessionSEJB();
/**
* Returns list of available users
*/
@Override
public List<UserCoreDTO> browseUsers() throws ServiceException {
AllUsersELO allUsersELO = cpContextHolder.getListSessionServer().getAllUsers();
return UsersMapper.mapAllUsersELO(allUsersELO);
}
/**
* Method save changing or create new data user details
* @throws SQLException
*/
public ResponseMessage save(int userId, UserDetailsDTO user) throws ServiceException, SQLException {
ResponseMessage message = null;
// UserEditorSessionServer server = cpContextHolder.getUserEditorSessionServer();
UserImpl userImpl = getItemData(userId, server);
List<Object[]> beforeSave = userImpl.getUserAssignments();
ValidationError error = UsersValidatorUtil.validateUserDetails(userImpl, user);
List<FlatFormExtendedCoreDTO> oldFormList = UsersMapper.mapListObjectXml(userImpl.getUserXmlForms());
String method;
if (user.getUserId() != -1) {
method = "edit";
} else {
method = "create";
}
if (error.getFieldErrors().isEmpty()) {
userImpl = UsersMapper.mapUserImpl(userImpl, user);
userId = saveOrUpdateUser(userImpl, server, userId);
message = new ResponseMessage(true);
} else {
error.setMessage("Error during " + method + " User.");
message = error;
}
List<Object[]> afterSave = userImpl.getUserAssignments();
// create new mobile profile for user
message = createMobileProfileForUser(user, userId);
// delete profiles
message = deleteMobileProfiles(user, userId);
updateProfilesAfterUserSave(oldFormList, user.getXmlForm(), beforeSave, afterSave, userId);
return message;
}
private ResponseMessage deleteMobileProfiles(UserDetailsDTO user, int userId) {
ResponseMessage message = new ResponseMessage(true);
try {
List<ProfileDTO> profiles = user.getMobileProfiles();
for (ProfileDTO p: profiles) {
if (p.isForDeletion() == true) {
profilesService.deleteProfile(userId, p.getProfileId());
}
}
} catch (Exception e) {
if (message.getMessage() != null) {
message.setMessage(message.getMessage() + ",\n" + e.getMessage());
} else {
message.setMessage(e.getMessage());
}
message.setError(true);
e.printStackTrace();
}
return message;
}
private ResponseMessage createMobileProfileForUser(UserDetailsDTO user, int userId) {
ResponseMessage message = new ResponseMessage(true);
if (user.getProfilesToSave() != null) {
try {
List<FormDeploymentDataDTO> profilesToSave = user.getProfilesToSave();
for (FormDeploymentDataDTO p: profilesToSave) {
profilesService.createMobileProfileForUser(userId, p);
}
} catch (Exception e) {
if (message.getMessage() != null) {
message.setMessage(message.getMessage() + ",\n" + e.getMessage());
} else {
message.setMessage(e.getMessage());
}
message.setError(true);
e.printStackTrace();
}
}
return message;
}
private int saveOrUpdateUser(UserImpl userImpl, UserEditorSessionSEJB server, int userId) {
if (userImpl.getPrimaryKey() == null) {
UserPK usr = null;
try {
usr = server.insert(new UserEditorSessionCSO(userId, userImpl));
} catch (CPException e) {
e.printStackTrace();
} catch (ValidationException e) {
e.printStackTrace();
}
userId = usr.getUserId();
} else {
try {
server.update(new UserEditorSessionCSO(userId, userImpl));
} catch (CPException e) {
e.printStackTrace();
} catch (ValidationException e) {
e.printStackTrace();
}
}
return userId;
}
private void updateProfilesAfterUserSave(List<FlatFormExtendedCoreDTO> oldFormList, List<FlatFormExtendedCoreDTO> newFormList, List<Object[]> beforeSave, List<Object[]> afterSave, int userId) throws ServiceException, SQLException {
List<Integer> modelsIds = getModelIdsForProfiles(afterSave, beforeSave);
List<Integer> listDeleted = getModelIdsForProfiles(beforeSave, afterSave);
if (listDeleted.size() > 0) {
List<Integer> userIds = new ArrayList<Integer>();
userIds.add(userId);
profileService.deleteProfiles(listDeleted, userIds); // uncomment to enable automatic delete profiles
}
for (Integer modelId: modelsIds) {
profileService.createProfiles(modelId, userId);
}
List<Integer> formToSubstractList = new ArrayList<Integer>();
List<Integer> formToAddList = new ArrayList<Integer>();
// Create new profiles
newFormList: for (FlatFormExtendedCoreDTO newFormRefImpl: newFormList) {
for (FlatFormExtendedCoreDTO oldUserRefImpl: oldFormList) {
if (newFormRefImpl.getFlatFormId() == oldUserRefImpl.getFlatFormId()) {
continue newFormList; // exists in old and new userlist
}
}
formToAddList.add(newFormRefImpl.getFlatFormId());
}
// Delete old profiles
oldFormList: for (FlatFormExtendedCoreDTO oldFormRefImpl: oldFormList) {
for (FlatFormExtendedCoreDTO newUserRefImpl: newFormList) {
if (newUserRefImpl.getFlatFormId() == oldFormRefImpl.getFlatFormId()) {
continue oldFormList; // exists in old and new userlist
}
}
formToSubstractList.add(oldFormRefImpl.getFlatFormId());
}
if (formToAddList.size() > 0) {
profileService.insertProfileForUser(formToAddList, userId, modelsIds);
}
if (formToSubstractList.size() > 0) {
profileService.deleteProfilesForUser(formToSubstractList, userId);
}
}
/**
* Method returns user details in DTO
*/
@Override
public UserDetailsDTO fetchUsersDetails(int userId) throws ServiceException {
// UserEditorSessionServer server = cpContextHolder.getUserEditorSessionServer();
UserImpl userImpl = getItemData(userId, server);
AllXmlFormsELO availableXmlForm = cpContextHolder.getListSessionServer().getAllXmlForms();
AllHiddenRolesELO elo = cpContextHolder.getListSessionServer().getAllHiddenRoles();
UserDetailsDTO usersDetailsDTO = UsersMapper.mapUserDetails(userImpl, elo, availableXmlForm);
List<ProfileDTO> mobileProfiles = profilesService.browseMobileProfiles(userId);
usersDetailsDTO.setMobileProfiles(mobileProfiles);
return usersDetailsDTO;
}
/**
* Method return user item data
*/
private UserImpl getItemData(int userId, UserEditorSessionSEJB server) throws ServiceException {
try {
UserEditorSessionSSO userEditorSessionSSO;
if (userId != -1) {
UserPK userPK = new UserPK(userId);
userEditorSessionSSO = server.getItemData(userId,userPK);
} else {
userEditorSessionSSO = server.getNewItemData(userId);
}
UserImpl userImpl = userEditorSessionSSO.getEditorData();
return userImpl;
} catch (CPException e) {
logger.error("Error during get users!", e);
throw new ServiceException("Error during get users!", e);
} catch (ValidationException e) {
logger.error("Validation error during get users!", e);
throw new ServiceException("Validation error during get users!", e);
}
}
/**
* Delete user from database.
*/
@Override
public ResponseMessage delete(int userId) throws ServiceException {
UserPK userPK = new UserPK(userId);
try {
// cpContextHolder.getUserEditorSessionServer().delete(userPK);
server.delete(cpContextHolder.getUserId(),userPK);
profileService.deleteAllProfilesForUser(userId);
ResponseMessage responseMessage = new ResponseMessage(true);
return responseMessage;
} catch (ValidationException e) {
logger.error("Validation error during dalete user with Id =" + e + "!");
ValidationError error = new ValidationError(e.getMessage());
return error;
} catch (CPException e) {
logger.error("Error during delete user =" + e + "!");
throw new ServiceException("Error during dalete user with Id =" + e + "!");
}
}
/**
* Get User Assignment for user
* @param userId
* @return
* @throws ServiceException
*/
// private UserImpl getUserImpl(int userId) throws ServiceException {
// try {
// UserEditorSessionServer server = cpContextHolder.getUserEditorSessionServer();
// UserPK userPK = new UserPK(userId);
// UserEditorSessionSSO userEditorSessionSSO = server.getItemData(userPK);
// UserImpl userImpl = userEditorSessionSSO.getEditorData();
// return userImpl;
// } catch (CPException e) {
// logger.error("Error during get users!", e);
// throw new ServiceException("Error during get users!", e);
// } catch (ValidationException e) {
// logger.error("Validation error during get users!", e);
// throw new ServiceException("Validation error during get users!", e);
// }
// }
/**
* Get modelRootSecurity for user
*/
@Override
public List<NodeLazyDTO> browseSecurityModelRoot() throws ServiceException {
AllModelsELO modelsList = cpContextHolder.getListSessionServer().getAllModels();
List<NodeLazyDTO> modelRoot = UsersMapper.mapAllModelsELO(modelsList);
return modelRoot;
}
/**
* Get modelsSecurity for user
*/
@Override
public List<NodeLazyDTO> browseSecurityModels(int userId, int modelId) throws ServiceException {
// UserEditorSessionServer server = cpContextHolder.getUserEditorSessionServer();
UserImpl userImpl = getItemData(userId, server);
BudgetHierarchyRootNodeForModelELO hierarchiesforModelELO = cpContextHolder.getListSessionServer().getBudgetHierarchyRootNodeForModel(modelId);
List<NodeLazyDTO> models = UsersMapper.mapHierarchiesForModelELO(hierarchiesforModelELO, userImpl);
return models;
}
/**
* Get structure and structureElement - Security for user
*/
@Override
public List<NodeLazyDTO> browseSecurityStructureElement(int userId, int structureId, int structureElementId) throws ServiceException {
// UserEditorSessionServer server = cpContextHolder.getUserEditorSessionServer();
UserImpl userImpl = getItemData(userId, server);
ImmediateChildrenELO structureElement = cpContextHolder.getListSessionServer().getImmediateChildren(structureId, structureElementId);
List<NodeLazyDTO> element = UsersMapper.mapImmediateChildrenELO(structureElement, userImpl);
return element;
}
private List<Integer> getModelIdsForProfiles(List<Object[]> longerListOfModels, List<Object[]> shorterListOfModels) {
List<Integer> list = new ArrayList<Integer>();
for (int i = 0; i < longerListOfModels.size(); i++) {
if (shorterListOfModels.size() == 0) {
for (int k = 0; k < longerListOfModels.size(); k++) {
list.add((Integer) longerListOfModels.get(k)[0]);
}
}
for (int j = 0; j < shorterListOfModels.size(); j++) {
if (longerListOfModels.get(i)[0].equals(shorterListOfModels.get(j)[0])) {
break;
}
if (j == shorterListOfModels.size() - 1) {
list.add((Integer) longerListOfModels.get(i)[0]);
}
}
}
return list;
}
}
| 16,028 | 0.657629 | 0.655011 | 374 | 41.90107 | 32.837036 | 235 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.671123 | false | false |
3
|
de0b5bc41f88a4dda0af13f3413bef98dc9e666c
| 8,727,373,561,100 |
9cbc8b7fc4bcd5af7a9725e2d731009192c0ffd2
|
/src/com/cn/ncist/rq/question/vo/QuestionModel.java
|
fa7240b0ca5d6a303bcc0b384bd76cce31af0740
|
[] |
no_license
|
mawencai-oss/LYGLSystem
|
https://github.com/mawencai-oss/LYGLSystem
|
7a65b429f1a497b48ed24cf1b5ae269196385d32
|
016351e6047f742529a01cb2bbf69c602fa18cae
|
refs/heads/master
| 2021-06-20T06:17:10.557000 | 2017-08-02T04:34:38 | 2017-08-02T04:34:38 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.cn.ncist.rq.question.vo;
public class QuestionModel {
private Integer question_id ;
private String question_content ;
private String question_answer ;
private String question_label ;
public Integer getQuestion_id() {
return question_id;
}
public void setQuestion_id(Integer questionId) {
question_id = questionId;
}
public String getQuestion_content() {
return question_content;
}
public void setQuestion_content(String questionContent) {
question_content = questionContent;
}
public String getQuestion_answer() {
return question_answer;
}
public void setQuestion_answer(String questionAnswer) {
question_answer = questionAnswer;
}
public String getQuestion_label() {
return question_label;
}
public void setQuestion_label(String questionLabel) {
question_label = questionLabel;
}
}
|
UTF-8
|
Java
| 833 |
java
|
QuestionModel.java
|
Java
|
[] | null |
[] |
package com.cn.ncist.rq.question.vo;
public class QuestionModel {
private Integer question_id ;
private String question_content ;
private String question_answer ;
private String question_label ;
public Integer getQuestion_id() {
return question_id;
}
public void setQuestion_id(Integer questionId) {
question_id = questionId;
}
public String getQuestion_content() {
return question_content;
}
public void setQuestion_content(String questionContent) {
question_content = questionContent;
}
public String getQuestion_answer() {
return question_answer;
}
public void setQuestion_answer(String questionAnswer) {
question_answer = questionAnswer;
}
public String getQuestion_label() {
return question_label;
}
public void setQuestion_label(String questionLabel) {
question_label = questionLabel;
}
}
| 833 | 0.758703 | 0.758703 | 33 | 24.272728 | 17.966759 | 58 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.515152 | false | false |
3
|
3c19291c2980acd5f6cc6f479b10ec93132a3ec8
| 25,228,637,897,820 |
1a2b471746a7e665d0a4103ece9d0927476a7d96
|
/src/BL/BL_W/ShiftLogic.java
|
fae520b0849a663421d83a297f9117ed6c3ccef4
|
[] |
no_license
|
NaamaDayan/Nituz3
|
https://github.com/NaamaDayan/Nituz3
|
13e7c8461c02bc4606e1e3e97a850e5e4978714c
|
ab2a8e66381aff92ab68c07a771193a842f0568c
|
refs/heads/master
| 2020-03-18T09:31:30.494000 | 2018-05-28T23:07:46 | 2018-05-28T23:07:46 | 134,567,843 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package BL.BL_W;
import BL.BL_T.Entities.Place;
import DAL.DAL_W.WorkersDatabase;
import BL.BL_W.Entities_W.Role;
import BL.BL_W.Entities_W.Shift;
import BL.BL_W.Entities_W.Worker;
import java.sql.Date;
import java.sql.SQLException;
import java.util.*;
public class ShiftLogic {
public static boolean removeAvailableShifts(Worker worker, Shift shift) {
return WorkersDatabase.removeAvailableShifts(worker, shift);
}
public static boolean insertWorkerToAvailableShift(Worker worker, Shift shift) {
return WorkersDatabase.makeWorkerAvailableForShift(worker, shift);
}
public static boolean removeWorkerShift(Worker worker, Shift shift) {
return WorkersDatabase.removeWorkerShifts(worker, shift);
}
public static boolean insertShift(Shift s) {
return WorkersDatabase.insertShift(s);
}
public static Map<Worker, Role> selectAssignedWorkers(Shift shift) {
return WorkersDatabase.selectAssignedWorkers(shift);
}
public static List<Worker> selectAvailableWorkers(Shift shift) {
return WorkersDatabase.selectAvailableWorkers(shift);
}
// public static boolean shiftExists(Shift newShift) throws SQLException {
// return WorkersDatabase.shiftExists(newShift);
// }
public static Shift getShift(Date date, Shift.ShiftDayPart dayPart, Place place){
return WorkersDatabase.getShift(date,dayPart,place);
}
public static boolean scheduleWorker(Shift newShift, Worker worker, Role role) {
return WorkersDatabase.scheduleWorker(newShift, worker, role);
}
public static boolean isWorkerAssignedForShift(Worker worker, Shift shift){
return WorkersDatabase.isWorkerAssignedForShift(worker,shift);
}
public static Worker getShiftManager(Shift newShift) {
return WorkersDatabase.getShiftManager(newShift);
}
public static List<Role> getRolesOfShift(Shift shift) {
return WorkersDatabase.getRolesOfShift(shift);
}
}
|
UTF-8
|
Java
| 1,998 |
java
|
ShiftLogic.java
|
Java
|
[] | null |
[] |
package BL.BL_W;
import BL.BL_T.Entities.Place;
import DAL.DAL_W.WorkersDatabase;
import BL.BL_W.Entities_W.Role;
import BL.BL_W.Entities_W.Shift;
import BL.BL_W.Entities_W.Worker;
import java.sql.Date;
import java.sql.SQLException;
import java.util.*;
public class ShiftLogic {
public static boolean removeAvailableShifts(Worker worker, Shift shift) {
return WorkersDatabase.removeAvailableShifts(worker, shift);
}
public static boolean insertWorkerToAvailableShift(Worker worker, Shift shift) {
return WorkersDatabase.makeWorkerAvailableForShift(worker, shift);
}
public static boolean removeWorkerShift(Worker worker, Shift shift) {
return WorkersDatabase.removeWorkerShifts(worker, shift);
}
public static boolean insertShift(Shift s) {
return WorkersDatabase.insertShift(s);
}
public static Map<Worker, Role> selectAssignedWorkers(Shift shift) {
return WorkersDatabase.selectAssignedWorkers(shift);
}
public static List<Worker> selectAvailableWorkers(Shift shift) {
return WorkersDatabase.selectAvailableWorkers(shift);
}
// public static boolean shiftExists(Shift newShift) throws SQLException {
// return WorkersDatabase.shiftExists(newShift);
// }
public static Shift getShift(Date date, Shift.ShiftDayPart dayPart, Place place){
return WorkersDatabase.getShift(date,dayPart,place);
}
public static boolean scheduleWorker(Shift newShift, Worker worker, Role role) {
return WorkersDatabase.scheduleWorker(newShift, worker, role);
}
public static boolean isWorkerAssignedForShift(Worker worker, Shift shift){
return WorkersDatabase.isWorkerAssignedForShift(worker,shift);
}
public static Worker getShiftManager(Shift newShift) {
return WorkersDatabase.getShiftManager(newShift);
}
public static List<Role> getRolesOfShift(Shift shift) {
return WorkersDatabase.getRolesOfShift(shift);
}
}
| 1,998 | 0.735736 | 0.735736 | 62 | 31.225807 | 30.462255 | 85 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.612903 | false | false |
3
|
e03f096583245522d484bad56b3fa7090b3fd9b7
| 32,573,031,977,007 |
bbe10639bb9c8f32422122c993530959534560e1
|
/delivery/app-release_source_from_JADX/com/google/android/gms/nearby/messages/Messages.java
|
81c8836149c6acab571133147497ab432aaf9c78
|
[
"Apache-2.0"
] |
permissive
|
ANDROFAST/delivery_articulos
|
https://github.com/ANDROFAST/delivery_articulos
|
dae74482e41b459963186b6e7e3d6553999c5706
|
ddcc8b06d7ea2895ccda2e13c179c658703fec96
|
refs/heads/master
| 2020-04-07T15:13:18.470000 | 2018-11-21T02:15:19 | 2018-11-21T02:15:19 | 158,476,390 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.google.android.gms.nearby.messages;
import com.google.android.gms.common.api.GoogleApiClient;
import com.google.android.gms.common.api.PendingResult;
import com.google.android.gms.common.api.Status;
public interface Messages {
PendingResult<Status> getPermissionStatus(GoogleApiClient googleApiClient);
PendingResult<Status> publish(GoogleApiClient googleApiClient, Message message);
PendingResult<Status> publish(GoogleApiClient googleApiClient, Message message, PublishOptions publishOptions);
@Deprecated
PendingResult<Status> publish(GoogleApiClient googleApiClient, Message message, Strategy strategy);
PendingResult<Status> registerStatusCallback(GoogleApiClient googleApiClient, StatusCallback statusCallback);
PendingResult<Status> subscribe(GoogleApiClient googleApiClient, MessageListener messageListener);
@Deprecated
PendingResult<Status> subscribe(GoogleApiClient googleApiClient, MessageListener messageListener, Strategy strategy);
@Deprecated
PendingResult<Status> subscribe(GoogleApiClient googleApiClient, MessageListener messageListener, Strategy strategy, MessageFilter messageFilter);
PendingResult<Status> subscribe(GoogleApiClient googleApiClient, MessageListener messageListener, SubscribeOptions subscribeOptions);
PendingResult<Status> unpublish(GoogleApiClient googleApiClient, Message message);
PendingResult<Status> unregisterStatusCallback(GoogleApiClient googleApiClient, StatusCallback statusCallback);
PendingResult<Status> unsubscribe(GoogleApiClient googleApiClient, MessageListener messageListener);
}
|
UTF-8
|
Java
| 1,623 |
java
|
Messages.java
|
Java
|
[] | null |
[] |
package com.google.android.gms.nearby.messages;
import com.google.android.gms.common.api.GoogleApiClient;
import com.google.android.gms.common.api.PendingResult;
import com.google.android.gms.common.api.Status;
public interface Messages {
PendingResult<Status> getPermissionStatus(GoogleApiClient googleApiClient);
PendingResult<Status> publish(GoogleApiClient googleApiClient, Message message);
PendingResult<Status> publish(GoogleApiClient googleApiClient, Message message, PublishOptions publishOptions);
@Deprecated
PendingResult<Status> publish(GoogleApiClient googleApiClient, Message message, Strategy strategy);
PendingResult<Status> registerStatusCallback(GoogleApiClient googleApiClient, StatusCallback statusCallback);
PendingResult<Status> subscribe(GoogleApiClient googleApiClient, MessageListener messageListener);
@Deprecated
PendingResult<Status> subscribe(GoogleApiClient googleApiClient, MessageListener messageListener, Strategy strategy);
@Deprecated
PendingResult<Status> subscribe(GoogleApiClient googleApiClient, MessageListener messageListener, Strategy strategy, MessageFilter messageFilter);
PendingResult<Status> subscribe(GoogleApiClient googleApiClient, MessageListener messageListener, SubscribeOptions subscribeOptions);
PendingResult<Status> unpublish(GoogleApiClient googleApiClient, Message message);
PendingResult<Status> unregisterStatusCallback(GoogleApiClient googleApiClient, StatusCallback statusCallback);
PendingResult<Status> unsubscribe(GoogleApiClient googleApiClient, MessageListener messageListener);
}
| 1,623 | 0.834874 | 0.834874 | 34 | 46.735294 | 50.170479 | 150 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.970588 | false | false |
3
|
91a590ba0ffafbe5490ecb917211c03cca6e120d
| 180,388,690,142 |
a14aacd714ece121001b3ec7803ea93c747bae2e
|
/src/com/fetal_movement/model/FetalMovementDAO_interface.java
|
be8e458aaa45c756e6212722568d66db221db629
|
[] |
no_license
|
ericshiu/mimimi
|
https://github.com/ericshiu/mimimi
|
aee27fe6b58ef507fce21c313f8b04359c3d9ee4
|
6e2ab7148fc658c4d948629f2f6f18eb4ae0f0a2
|
refs/heads/master
| 2020-12-02T21:11:19.448000 | 2018-03-06T03:30:16 | 2018-03-06T03:30:16 | 96,266,964 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.fetal_movement.model;
import java.util.List;
import com.member.model.MemberVO;
import com.point_record.model.PointRecordVO;
public interface FetalMovementDAO_interface {
public void insert(FetalMovementVO fetal_movementVO, PointRecordVO pointRecordVO, MemberVO memberVO);
public void update(FetalMovementVO fetal_movementVO);
public void delete(String fm_no);
public FetalMovementVO findByPrimaryKey(String fm_no);
public List<FetalMovementVO> getAll();
}
|
UTF-8
|
Java
| 492 |
java
|
FetalMovementDAO_interface.java
|
Java
|
[] | null |
[] |
package com.fetal_movement.model;
import java.util.List;
import com.member.model.MemberVO;
import com.point_record.model.PointRecordVO;
public interface FetalMovementDAO_interface {
public void insert(FetalMovementVO fetal_movementVO, PointRecordVO pointRecordVO, MemberVO memberVO);
public void update(FetalMovementVO fetal_movementVO);
public void delete(String fm_no);
public FetalMovementVO findByPrimaryKey(String fm_no);
public List<FetalMovementVO> getAll();
}
| 492 | 0.792683 | 0.792683 | 18 | 26.333334 | 28.178005 | 102 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.666667 | false | false |
12
|
d9065dc82ce0808f6403e2bf3f184c8ed1e9a3c1
| 21,534,966,063,613 |
d866c060f4752eafb10664b0855e02d112537788
|
/webuy-learning/webuy-learning-sharing/src/main/java/com/weweibuy/webuy/learning/sharing/mapper/DispatchBillSettlementInfoMapper.java
|
3032245a2273c382eb80e80cfac7ad528e5621c6
|
[] |
no_license
|
weweibuy/weweibuy
|
https://github.com/weweibuy/weweibuy
|
75910a4fa229efda39b626740f0f8138db4d4cb2
|
d48ec7ce9135293991703ecfae4bfc3b08112e85
|
refs/heads/master
| 2023-07-20T06:27:57.327000 | 2022-12-24T14:13:16 | 2022-12-24T14:13:16 | 150,745,949 | 14 | 5 | null | false | 2023-09-05T22:03:32 | 2018-09-28T13:37:34 | 2023-05-05T09:38:59 | 2023-09-05T22:03:32 | 26,003 | 13 | 5 | 9 |
Java
| false | false |
package com.weweibuy.webuy.learning.sharing.mapper;
import com.weweibuy.webuy.learning.sharing.model.po.DispatchBillSettlementInfo;
import com.weweibuy.webuy.learning.sharing.model.po.DispatchBillSettlementInfoExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface DispatchBillSettlementInfoMapper {
long countByExample(DispatchBillSettlementInfoExample example);
int deleteByExample(DispatchBillSettlementInfoExample example);
int deleteByPrimaryKey(Long id);
int insert(DispatchBillSettlementInfo record);
int insertSelective(DispatchBillSettlementInfo record);
List<DispatchBillSettlementInfo> selectByExample(DispatchBillSettlementInfoExample example);
DispatchBillSettlementInfo selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") DispatchBillSettlementInfo record, @Param("example") DispatchBillSettlementInfoExample example);
int updateByExample(@Param("record") DispatchBillSettlementInfo record, @Param("example") DispatchBillSettlementInfoExample example);
int updateByPrimaryKeySelective(DispatchBillSettlementInfo record);
int updateByPrimaryKey(DispatchBillSettlementInfo record);
}
|
UTF-8
|
Java
| 1,212 |
java
|
DispatchBillSettlementInfoMapper.java
|
Java
|
[] | null |
[] |
package com.weweibuy.webuy.learning.sharing.mapper;
import com.weweibuy.webuy.learning.sharing.model.po.DispatchBillSettlementInfo;
import com.weweibuy.webuy.learning.sharing.model.po.DispatchBillSettlementInfoExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface DispatchBillSettlementInfoMapper {
long countByExample(DispatchBillSettlementInfoExample example);
int deleteByExample(DispatchBillSettlementInfoExample example);
int deleteByPrimaryKey(Long id);
int insert(DispatchBillSettlementInfo record);
int insertSelective(DispatchBillSettlementInfo record);
List<DispatchBillSettlementInfo> selectByExample(DispatchBillSettlementInfoExample example);
DispatchBillSettlementInfo selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") DispatchBillSettlementInfo record, @Param("example") DispatchBillSettlementInfoExample example);
int updateByExample(@Param("record") DispatchBillSettlementInfo record, @Param("example") DispatchBillSettlementInfoExample example);
int updateByPrimaryKeySelective(DispatchBillSettlementInfo record);
int updateByPrimaryKey(DispatchBillSettlementInfo record);
}
| 1,212 | 0.834984 | 0.834984 | 30 | 39.433334 | 41.81123 | 146 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.6 | false | false |
12
|
bbfcb86a2b4f71dbbdf5a08d4758383fd36fd89b
| 29,377,576,360,945 |
fd2708b02e7d9841aa622b4243e43967ea2eb4ec
|
/leet-code/src/main/java/每日一题/实现strStr.java
|
21ba8e1590fc0153704930f2405b94c8dbfebf82
|
[] |
no_license
|
johnraychina/learn-algorithms
|
https://github.com/johnraychina/learn-algorithms
|
86b9b16a13b1028f767a92419a381b57a768067e
|
5a78fdbd44deaad874c709252d8653043cdd70da
|
refs/heads/master
| 2023-01-22T20:25:52.075000 | 2023-01-08T04:35:49 | 2023-01-08T04:35:49 | 165,871,381 | 0 | 3 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package 每日一题;
/**
* 实现strStr()函数。
* <p>
* 给你两个字符串haystack 和 needle ,请你在 haystack 字符串中找出 needle 字符串出现的第一个位置(下标从 0 开始)。
* 如果不存在,则返回 -1 。
* <p>
* 说明:
* <p>
* 当needle是空字符串时,我们应当返回什么值呢?这是一个在面试中很好的问题。
* <p>
* 对于本题而言,当needle是空字符串时我们应当返回 0 。这
* 与 C 语言的strstr()以及 Java 的indexOf()定义相符。
* <p>
* 来源:力扣(LeetCode)
* 链接:https://leetcode-cn.com/problems/implement-strstr
* 著作权归领扣网络所有。商业转载请联系官方授权,非商业转载请注明出处。
*/
public class 实现strStr {
public static void main(String[] args) {
System.out.println(strStr("football team", "bal"));
System.out.println(kmp("football team", "bal"));
}
public static class KMPMatcher {
private final int[][] dfa; //dfa of pattern string
private final int M; //length of pattern
private static final int R = 256; //ascii radix
public KMPMatcher(String patStr) {
// build dfa from pattern string
M = patStr.length();
char[] pat = patStr.toCharArray();
// dfa['A'][j] = next state of state j after matching 'A'
dfa = new int[R][M];
int x = 0;
for (int j = 0; j < M; j++) {
for (int c = 0; c < R; c++) { //iterate each character in radix
dfa[c][j] = dfa[c][x]; //if character does not match pat[j], back up state
}
dfa[pat[j]][j] = j + 1; //if match pat[j], forward state j -> j+1
x = dfa[pat[j]][x]; //next state of x
}
}
public int search(String txt) {
int n = txt.length();
int i, j = 0;
for (i = 0; i < n && j < M; i++) {
j = dfa[txt.charAt(i)][j];
}
if (j == M) return i - M;
return n;
}
}
//KMP算法
public static int kmp(String txtStr, String patStr) {
KMPMatcher matcher = new KMPMatcher(patStr);
return matcher.search(txtStr);
}
public static int strStr(String longStr, String shortStr) {
if (shortStr.length() == 0) {
return 0;
}
int len = longStr.length();
int sLen = shortStr.length();
for (int i = 0; i < len - sLen; i++) {
int j = 0;
while (j < sLen && longStr.charAt(i + j) == shortStr.charAt(j)) {
j++;
}
if (j == sLen) {
return i;
}
}
return -1;
}
}
|
UTF-8
|
Java
| 2,795 |
java
|
实现strStr.java
|
Java
|
[] | null |
[] |
package 每日一题;
/**
* 实现strStr()函数。
* <p>
* 给你两个字符串haystack 和 needle ,请你在 haystack 字符串中找出 needle 字符串出现的第一个位置(下标从 0 开始)。
* 如果不存在,则返回 -1 。
* <p>
* 说明:
* <p>
* 当needle是空字符串时,我们应当返回什么值呢?这是一个在面试中很好的问题。
* <p>
* 对于本题而言,当needle是空字符串时我们应当返回 0 。这
* 与 C 语言的strstr()以及 Java 的indexOf()定义相符。
* <p>
* 来源:力扣(LeetCode)
* 链接:https://leetcode-cn.com/problems/implement-strstr
* 著作权归领扣网络所有。商业转载请联系官方授权,非商业转载请注明出处。
*/
public class 实现strStr {
public static void main(String[] args) {
System.out.println(strStr("football team", "bal"));
System.out.println(kmp("football team", "bal"));
}
public static class KMPMatcher {
private final int[][] dfa; //dfa of pattern string
private final int M; //length of pattern
private static final int R = 256; //ascii radix
public KMPMatcher(String patStr) {
// build dfa from pattern string
M = patStr.length();
char[] pat = patStr.toCharArray();
// dfa['A'][j] = next state of state j after matching 'A'
dfa = new int[R][M];
int x = 0;
for (int j = 0; j < M; j++) {
for (int c = 0; c < R; c++) { //iterate each character in radix
dfa[c][j] = dfa[c][x]; //if character does not match pat[j], back up state
}
dfa[pat[j]][j] = j + 1; //if match pat[j], forward state j -> j+1
x = dfa[pat[j]][x]; //next state of x
}
}
public int search(String txt) {
int n = txt.length();
int i, j = 0;
for (i = 0; i < n && j < M; i++) {
j = dfa[txt.charAt(i)][j];
}
if (j == M) return i - M;
return n;
}
}
//KMP算法
public static int kmp(String txtStr, String patStr) {
KMPMatcher matcher = new KMPMatcher(patStr);
return matcher.search(txtStr);
}
public static int strStr(String longStr, String shortStr) {
if (shortStr.length() == 0) {
return 0;
}
int len = longStr.length();
int sLen = shortStr.length();
for (int i = 0; i < len - sLen; i++) {
int j = 0;
while (j < sLen && longStr.charAt(i + j) == shortStr.charAt(j)) {
j++;
}
if (j == sLen) {
return i;
}
}
return -1;
}
}
| 2,795 | 0.495709 | 0.488353 | 83 | 28.481928 | 23.118011 | 94 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.506024 | false | false |
12
|
653f3955ecebadd4eafbdf9674c27fe6af918038
| 10,840,497,456,779 |
43f455228715985139e21d7e4490534279cb8b24
|
/app/src/main/java/com/flashlight13/clocks/logic/RequestCodesHolder.java
|
8486078cac83e018a6863a8b6817e51b306ab9f7
|
[] |
no_license
|
FlashLight13/SmartWatch
|
https://github.com/FlashLight13/SmartWatch
|
5e81d588f738ca8ad52138cccaeccbd0f7be2f31
|
ae68e56bf652cfdc2db0cdce59fbe695fca119d1
|
refs/heads/master
| 2020-03-30T16:41:30.776000 | 2015-10-01T17:07:22 | 2015-10-01T17:07:22 | 30,789,064 | 2 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.flashlight13.clocks.logic;
/**
* Created by Антон on 06.04.2015.
*/
public class RequestCodesHolder {
public static final int CLOCK_SETTINGS_ACTIVITY_REQUEST_CODE = 1;
public static final int CUSTOM_CLOCK_ACTIVITY_REQUEST_CODE = 2;
}
|
UTF-8
|
Java
| 262 |
java
|
RequestCodesHolder.java
|
Java
|
[
{
"context": " com.flashlight13.clocks.logic;\n\n/**\n * Created by Антон on 06.04.2015.\n */\npublic class RequestCodesHolde",
"end": 63,
"score": 0.999468982219696,
"start": 58,
"tag": "NAME",
"value": "Антон"
}
] | null |
[] |
package com.flashlight13.clocks.logic;
/**
* Created by Антон on 06.04.2015.
*/
public class RequestCodesHolder {
public static final int CLOCK_SETTINGS_ACTIVITY_REQUEST_CODE = 1;
public static final int CUSTOM_CLOCK_ACTIVITY_REQUEST_CODE = 2;
}
| 262 | 0.7393 | 0.692607 | 9 | 27.555555 | 26.085804 | 69 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.333333 | false | false |
12
|
cf92598a01a4defa174456b3a09f411cd5b5c5f3
| 12,592,844,158,646 |
fa93ca85439d80ed66715566089b5c83b8a6dcf3
|
/maimaiwebservice/src/main/java/maimaiweb/com/maimai/service/service/impl/SelectListServiceImpl.java
|
ef37c6da6e57379738d3ad5f2355ec4b84c96fda
|
[] |
no_license
|
zqh359569442/maimaicomcn
|
https://github.com/zqh359569442/maimaicomcn
|
27b2e454c0daf5b52224024e942e6a5830336ef1
|
284a52e196a7726f28bd58aef6c1b370de625b05
|
refs/heads/master
| 2021-08-28T12:15:14.030000 | 2017-12-12T07:13:13 | 2017-12-12T07:13:13 | 113,831,413 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package maimaiweb.com.maimai.service.service.impl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import maimaiweb.com.maimai.dao.mapper.MmSelectProject;
import maimaiweb.com.maimai.dao.mapper.dto.TbItem;
import maimaiweb.com.maimai.service.domain.PageResult;
import maimaiweb.com.maimai.service.service.SelectListService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
@Service
public class SelectListServiceImpl implements SelectListService {
@Autowired
public MmSelectProject selectProject;
public PageResult searchList(Integer page, Integer rows) {
PageHelper.startPage(1,1);
List<TbItem> result = selectProject.selectByExample();
if(result==null &&result.size()<1){
return new PageResult(0,null);
}
PageInfo<TbItem> pageInfo =new PageInfo<TbItem>(result);
PageResult pageResult = new PageResult();
pageResult.setTotal(pageInfo.getTotal());
pageResult.setRows(pageInfo.getList());
return pageResult;
}
public void setPageInfo(Integer page, Integer rows){
}
public void setMmSelectProject(MmSelectProject selectProject) {
this.selectProject = selectProject;
}
}
|
UTF-8
|
Java
| 1,338 |
java
|
SelectListServiceImpl.java
|
Java
|
[] | null |
[] |
package maimaiweb.com.maimai.service.service.impl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import maimaiweb.com.maimai.dao.mapper.MmSelectProject;
import maimaiweb.com.maimai.dao.mapper.dto.TbItem;
import maimaiweb.com.maimai.service.domain.PageResult;
import maimaiweb.com.maimai.service.service.SelectListService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
@Service
public class SelectListServiceImpl implements SelectListService {
@Autowired
public MmSelectProject selectProject;
public PageResult searchList(Integer page, Integer rows) {
PageHelper.startPage(1,1);
List<TbItem> result = selectProject.selectByExample();
if(result==null &&result.size()<1){
return new PageResult(0,null);
}
PageInfo<TbItem> pageInfo =new PageInfo<TbItem>(result);
PageResult pageResult = new PageResult();
pageResult.setTotal(pageInfo.getTotal());
pageResult.setRows(pageInfo.getList());
return pageResult;
}
public void setPageInfo(Integer page, Integer rows){
}
public void setMmSelectProject(MmSelectProject selectProject) {
this.selectProject = selectProject;
}
}
| 1,338 | 0.745889 | 0.7429 | 39 | 33.307693 | 23.490482 | 67 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.641026 | false | false |
12
|
4855af2dc5fe6b5054101025ae3f6627a760148e
| 9,122,510,563,668 |
e22fcb90e91e6384d8db9f495904170fe011ac54
|
/smartwidget/src/main/java/com/hhh/smartwidget/dialog/adjust/AdjustStyle.java
|
11856ef264f23283ec310b79c8d78de1e242eb82
|
[
"Apache-2.0"
] |
permissive
|
3HJack/SmartWidget
|
https://github.com/3HJack/SmartWidget
|
7e0c2baa1edb2d763ec4f96ba60512c0b00bef8f
|
16a43fa285a17dc798e2778f2b319b408e3d1dd4
|
refs/heads/master
| 2020-07-16T15:51:58.983000 | 2020-04-28T10:11:36 | 2020-04-28T10:28:19 | 205,818,643 | 20 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.hhh.smartwidget.dialog.adjust;
import androidx.annotation.NonNull;
import com.hhh.smartwidget.dialog.SmartDialog;
public interface AdjustStyle {
void apply(@NonNull SmartDialog dialog);
}
|
UTF-8
|
Java
| 205 |
java
|
AdjustStyle.java
|
Java
|
[] | null |
[] |
package com.hhh.smartwidget.dialog.adjust;
import androidx.annotation.NonNull;
import com.hhh.smartwidget.dialog.SmartDialog;
public interface AdjustStyle {
void apply(@NonNull SmartDialog dialog);
}
| 205 | 0.809756 | 0.809756 | 9 | 21.777779 | 19.724648 | 46 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.444444 | false | false |
12
|
f49c920f1c56a0f238ebcc7edcf0035e202953dc
| 11,519,102,324,051 |
d91dc4eb7fb29176b174bf0f0310385de342c32b
|
/app/src/main/java/com/example/whensaturdaycome/persuratan/adapter/Adaptersuratkel.java
|
61d61f5e146faae95f87daf7c9cbb6e8263c641e
|
[] |
no_license
|
aritrisnawan/Persuratan
|
https://github.com/aritrisnawan/Persuratan
|
2efca754c453091ff51c8ad656ca44b482ce1eca
|
fe3a5e1139c25fd76704572395577e993a27b63e
|
refs/heads/master
| 2020-03-27T17:12:56.416000 | 2018-08-31T05:33:33 | 2018-08-31T05:33:33 | 146,836,231 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.example.whensaturdaycome.persuratan.adapter;
import android.content.Context;
import android.graphics.Color;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import com.example.whensaturdaycome.persuratan.R;
import com.example.whensaturdaycome.persuratan.data.Suratkel;
import java.util.List;
public class Adaptersuratkel extends BaseAdapter {
private Context contextt;
private List<Suratkel> suratkelList;
private LayoutInflater layoutInflater;
public Adaptersuratkel (List<Suratkel> suratkelList, Context context){
this.suratkelList = suratkelList;
layoutInflater = LayoutInflater.from(context);
this.contextt = context;
}
@Override
public int getCount() {
return suratkelList.size();
}
@Override
public Object getItem(int position) {
return suratkelList.get(position);
}
@Override
public long getItemId(int position) {
return 0;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
convertView = layoutInflater.inflate(R.layout.item_suratkel,parent,false);
TextView no_surat;
TextView tujuan;
no_surat = (TextView)convertView.findViewById(R.id.itemsuratkel);
no_surat.setTextColor(Color.parseColor("#FF6C6B6B"));
Suratkel suratkel=(Suratkel) getItem(position);
no_surat.setText(suratkel.getNo_surat());
tujuan = (TextView)convertView.findViewById(R.id.itemsuratkell);
tujuan.setTextColor(Color.parseColor("#FF6C6B6B"));
Suratkel suratkell=(Suratkel) getItem(position);
tujuan.setText(suratkell.getTujuan());
return convertView;
}
}
|
UTF-8
|
Java
| 1,810 |
java
|
Adaptersuratkel.java
|
Java
|
[] | null |
[] |
package com.example.whensaturdaycome.persuratan.adapter;
import android.content.Context;
import android.graphics.Color;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import com.example.whensaturdaycome.persuratan.R;
import com.example.whensaturdaycome.persuratan.data.Suratkel;
import java.util.List;
public class Adaptersuratkel extends BaseAdapter {
private Context contextt;
private List<Suratkel> suratkelList;
private LayoutInflater layoutInflater;
public Adaptersuratkel (List<Suratkel> suratkelList, Context context){
this.suratkelList = suratkelList;
layoutInflater = LayoutInflater.from(context);
this.contextt = context;
}
@Override
public int getCount() {
return suratkelList.size();
}
@Override
public Object getItem(int position) {
return suratkelList.get(position);
}
@Override
public long getItemId(int position) {
return 0;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
convertView = layoutInflater.inflate(R.layout.item_suratkel,parent,false);
TextView no_surat;
TextView tujuan;
no_surat = (TextView)convertView.findViewById(R.id.itemsuratkel);
no_surat.setTextColor(Color.parseColor("#FF6C6B6B"));
Suratkel suratkel=(Suratkel) getItem(position);
no_surat.setText(suratkel.getNo_surat());
tujuan = (TextView)convertView.findViewById(R.id.itemsuratkell);
tujuan.setTextColor(Color.parseColor("#FF6C6B6B"));
Suratkel suratkell=(Suratkel) getItem(position);
tujuan.setText(suratkell.getTujuan());
return convertView;
}
}
| 1,810 | 0.714917 | 0.71105 | 58 | 30.206896 | 23.578012 | 82 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.637931 | false | false |
12
|
6ea09a793d06732787927bc4b2fcb78256d912cd
| 5,858,335,396,239 |
531024cc7633e749b5ffa10c7de9e52886f9e875
|
/app/src/main/java/com/example/lenovo/gmegeeknews/view/zhihuview/CalendarView.java
|
325b3042a5798594d1dddb8017e5f2acd4659236
|
[] |
no_license
|
BeiFenKu/GeekNews
|
https://github.com/BeiFenKu/GeekNews
|
fcca55f89896b5c77070e3e820cbe908a7d12904
|
6be3916e38c006934dd53ecccdfa9fdacff92277
|
refs/heads/master
| 2020-06-13T09:31:05.252000 | 2019-04-24T00:16:58 | 2019-04-24T00:16:58 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.example.lenovo.gmegeeknews.view.zhihuview;
import com.example.lenovo.gmegeeknews.base.BaseMvpView;
public interface CalendarView extends BaseMvpView {
}
|
UTF-8
|
Java
| 167 |
java
|
CalendarView.java
|
Java
|
[] | null |
[] |
package com.example.lenovo.gmegeeknews.view.zhihuview;
import com.example.lenovo.gmegeeknews.base.BaseMvpView;
public interface CalendarView extends BaseMvpView {
}
| 167 | 0.838323 | 0.838323 | 6 | 26.833334 | 26.529333 | 55 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.333333 | false | false |
12
|
14c26774e6762e8934c7b6b318f632d00a6de8b5
| 6,012,954,282,378 |
3d54fc7ae9ef5f5f57078d9f09fdbe53e08aefbc
|
/Java/Projetos/Java 01/src/pkg01/Java013.java
|
1207153438ac9c27fdfba81aeda01e918b44099d
|
[] |
no_license
|
ThomasLossio/Codigos-durante-a-faculdade
|
https://github.com/ThomasLossio/Codigos-durante-a-faculdade
|
ee5f13adb14967acd3b4309d566715519a6f2205
|
33ee1edaa936182ad918199d21abb5f82f942c55
|
refs/heads/master
| 2021-09-18T13:18:25 | 2018-07-14T23:53:25 | 2018-07-14T23:53:25 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package pkg01;
/**
*
* @author Geral
*/
public class Java013 {
public static void main(String[] thomas){
float media = 4.0f;
if(media>=7){
System.out.println("Aprovado!");
} else {
System.out.println("Reprovado!");
}
}
}
|
UTF-8
|
Java
| 475 |
java
|
Java013.java
|
Java
|
[
{
"context": "the editor.\n */\n\npackage pkg01;\n\n/**\n *\n * @author Geral\n */\npublic class Java013 {\n public static void",
"end": 225,
"score": 0.999528706073761,
"start": 220,
"tag": "NAME",
"value": "Geral"
}
] | null |
[] |
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package pkg01;
/**
*
* @author Geral
*/
public class Java013 {
public static void main(String[] thomas){
float media = 4.0f;
if(media>=7){
System.out.println("Aprovado!");
} else {
System.out.println("Reprovado!");
}
}
}
| 475 | 0.597895 | 0.581053 | 22 | 20.59091 | 21.504036 | 79 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.318182 | false | false |
12
|
67dc59185242cf27833a55a110f8b75ad67cfeac
| 3,959,959,859,596 |
2d72c1ba614610e941a653e6ec5c209d4541305d
|
/src/main/java/com/example/springintroduction/SpringIntroductionApplication.java
|
3c420230ef6f4da8d7d0f6aff944a8de6012596a
|
[] |
no_license
|
AnatolSich/Spring-introduction
|
https://github.com/AnatolSich/Spring-introduction
|
b4ccc68c31676921a5add9c119073c819e592ba5
|
0bbd8afd55f5808ad36e9b7d07118057792d1cf2
|
refs/heads/master
| 2023-04-09T01:45:30.363000 | 2021-04-27T12:36:41 | 2021-04-27T12:36:41 | 361,366,370 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.example.springintroduction;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ImportResource;
import org.springframework.jms.annotation.EnableJms;
@EnableJms
@SpringBootApplication
@ImportResource("classpath:application-context.xml")
public class SpringIntroductionApplication {
public static void main(String[] args) {
SpringApplication.run(SpringIntroductionApplication.class, args);
}
}
|
UTF-8
|
Java
| 526 |
java
|
SpringIntroductionApplication.java
|
Java
|
[] | null |
[] |
package com.example.springintroduction;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ImportResource;
import org.springframework.jms.annotation.EnableJms;
@EnableJms
@SpringBootApplication
@ImportResource("classpath:application-context.xml")
public class SpringIntroductionApplication {
public static void main(String[] args) {
SpringApplication.run(SpringIntroductionApplication.class, args);
}
}
| 526 | 0.846008 | 0.846008 | 17 | 29.941177 | 25.700699 | 68 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.647059 | false | false |
12
|
27d0254a23050dd458bbdf92e6b5e3eb8382c992
| 1,752,346,685,493 |
8b39a8fa8b1e5cd6874de83f22b7905593021a04
|
/railwayWeb/src/main/java/com/tschool/railwayweb/util/exception/RefreshException.java
|
b953e73283b1e9602c16139620d869e8ea5c4c3d
|
[] |
no_license
|
Stalin45/railwayWeb
|
https://github.com/Stalin45/railwayWeb
|
6107f3c120f911ae3b0f27225bc935bbd4b459c0
|
e99302d51c5e21c70f2f0a900b79f1ba64d6582b
|
refs/heads/master
| 2020-04-08T12:37:53.607000 | 2014-05-05T15:21:23 | 2014-05-05T15:21:23 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.tschool.railwayweb.util.exception;
public class RefreshException extends Exception {
public RefreshException(Throwable cause) {
super(cause);
}
}
|
UTF-8
|
Java
| 180 |
java
|
RefreshException.java
|
Java
|
[] | null |
[] |
package com.tschool.railwayweb.util.exception;
public class RefreshException extends Exception {
public RefreshException(Throwable cause) {
super(cause);
}
}
| 180 | 0.716667 | 0.716667 | 8 | 21.5 | 20.670027 | 49 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.25 | false | false |
12
|
e4f782190b96f9d2ae57664d1571c94b2db252b9
| 9,689,446,285,119 |
a1716550caf93efa4d226342e3532b7ec1e33594
|
/app/src/main/java/com/example/administrator/myapplication/NotiActivity.java
|
56ee7d7c2f58c8769885291e6303e035a76a513d
|
[] |
no_license
|
pjl12138/MyApplication18
|
https://github.com/pjl12138/MyApplication18
|
1b6dd73a045357d93c13fa2d053befab48447972
|
d8638335492dbe605ccf1771403efa7e762e0e78
|
refs/heads/master
| 2021-01-21T11:45:20.727000 | 2017-05-19T01:39:31 | 2017-05-19T01:39:31 | 91,753,110 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.example.administrator.myapplication;
import android.app.Activity;
import android.os.Bundle;
public class NotiActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_noti);
}
}
|
UTF-8
|
Java
| 323 |
java
|
NotiActivity.java
|
Java
|
[] | null |
[] |
package com.example.administrator.myapplication;
import android.app.Activity;
import android.os.Bundle;
public class NotiActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_noti);
}
}
| 323 | 0.752322 | 0.752322 | 13 | 23.846153 | 20.839483 | 56 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.384615 | false | false |
12
|
93444eb66e254e6acbade8c8aed719652949944d
| 26,895,085,267,124 |
fa45a61fba9bbcdf817034ecf6e059e1ab0c260a
|
/src/main/java/com/cxf/sell/service/BasicService.java
|
930334878b18fdafb5d815efdc7f76ac0dcc66b1
|
[] |
no_license
|
momosv/sell
|
https://github.com/momosv/sell
|
9517a45f21e474ca09ffed256e6f9956a12f62c7
|
7a21b00a2804bfe5c6de2fb771831cdd9eb17df4
|
refs/heads/master
| 2020-03-19T05:19:57.374000 | 2018-06-07T09:02:02 | 2018-06-07T09:02:02 | 135,921,240 | 0 | 2 | null | null | null | null | null | null | null | null | null | null | null | null | null |
/**
* @Title: BasicService.java
* @Package com.yjw.andy.service
* @Description: TODO
* @author 余健文
* @date 2016年9月19日
*/
package com.cxf.sell.service;
import java.util.List;
import java.util.Map;
/**
*
* @param <T>
* @param <E>
*/
public interface BasicService<T ,E > {
int countByExample(E example);
int deleteByExample(E example);
int deleteByPrimaryKey(Class<T> clazz, String id) throws InstantiationException, IllegalAccessException;
@Deprecated
List<T> selectByExample(Class<T> clazz, E example)throws Exception;
T selectOneByExample(E example) throws Exception;
List<T> selectByExample(E example) throws Exception;
List<T> selectJoint(E example) throws Exception;
T selectByPrimaryKey(Class<T> clazz, String ids)throws Exception;
List<T> selectByPrimaryKey(Class<T> clazz, String[] ids) throws Exception;
List<T> selectByPrimaryKey(Class<T> clazz, List<String> ids) throws Exception;
int updateByExample(T record, E example);
Object getFieldValueByName(String fieldName, Object o);
String[] getFieldName(Object o);
Object[] getFieldValues(Object o);
public int insertBatch(List<T> list);
public int updateBatch(List<T> list);
Map<String, Object> getFieldMapValues(List<T> list, boolean selective);
int updateBatch(List<T> list, boolean selective);
List<T> findAll(Class<T> t) throws Exception ;
int insertOne(T record);
int updateOne(T record);
public int updateOne(T t, boolean selective);
int updateByExample(T record, E example, boolean selective);
int deleteByPrimaryKey(Class<T> clazz, List<String> id) throws InstantiationException, IllegalAccessException;
int deleteByPrimaryKey(Class<T> clazz, String[] id) throws IllegalAccessException, InstantiationException;
}
|
UTF-8
|
Java
| 1,803 |
java
|
BasicService.java
|
Java
|
[
{
"context": "yjw.andy.service\n * @Description: TODO\n * @author 余健文\n * @date 2016年9月19日\n */\npackage com.cxf.sell.serv",
"end": 104,
"score": 0.9998348951339722,
"start": 101,
"tag": "NAME",
"value": "余健文"
}
] | null |
[] |
/**
* @Title: BasicService.java
* @Package com.yjw.andy.service
* @Description: TODO
* @author 余健文
* @date 2016年9月19日
*/
package com.cxf.sell.service;
import java.util.List;
import java.util.Map;
/**
*
* @param <T>
* @param <E>
*/
public interface BasicService<T ,E > {
int countByExample(E example);
int deleteByExample(E example);
int deleteByPrimaryKey(Class<T> clazz, String id) throws InstantiationException, IllegalAccessException;
@Deprecated
List<T> selectByExample(Class<T> clazz, E example)throws Exception;
T selectOneByExample(E example) throws Exception;
List<T> selectByExample(E example) throws Exception;
List<T> selectJoint(E example) throws Exception;
T selectByPrimaryKey(Class<T> clazz, String ids)throws Exception;
List<T> selectByPrimaryKey(Class<T> clazz, String[] ids) throws Exception;
List<T> selectByPrimaryKey(Class<T> clazz, List<String> ids) throws Exception;
int updateByExample(T record, E example);
Object getFieldValueByName(String fieldName, Object o);
String[] getFieldName(Object o);
Object[] getFieldValues(Object o);
public int insertBatch(List<T> list);
public int updateBatch(List<T> list);
Map<String, Object> getFieldMapValues(List<T> list, boolean selective);
int updateBatch(List<T> list, boolean selective);
List<T> findAll(Class<T> t) throws Exception ;
int insertOne(T record);
int updateOne(T record);
public int updateOne(T t, boolean selective);
int updateByExample(T record, E example, boolean selective);
int deleteByPrimaryKey(Class<T> clazz, List<String> id) throws InstantiationException, IllegalAccessException;
int deleteByPrimaryKey(Class<T> clazz, String[] id) throws IllegalAccessException, InstantiationException;
}
| 1,803 | 0.73311 | 0.729202 | 73 | 23.534246 | 29.446529 | 111 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.808219 | false | false |
12
|
8b4cdb7a6692312f56f29411bbcc86fa5b835773
| 1,846,835,946,433 |
1a98d2b0c9bac58e7344c74a1da78420467b6a9d
|
/app/src/main/java/com/treasure_ct/happiness_xt/activity/user/UserEditUserInfoActivity.java
|
583dd02dfb4ee66855304628f47696326f07d4ad
|
[] |
no_license
|
treasurect/Happiness_XT
|
https://github.com/treasurect/Happiness_XT
|
079d8ded715beaa0e4e7a1e3b3354e8bb1127a76
|
f42ab32a636f85f2017b78ab2d4b7f290b28883c
|
refs/heads/master
| 2021-01-23T04:13:33.549000 | 2017-06-01T17:36:44 | 2017-06-01T17:36:44 | 86,706,542 | 4 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.treasure_ct.happiness_xt.activity.user;
import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Bundle;
import android.provider.MediaStore;
import android.text.InputType;
import android.view.View;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.RadioButton;
import android.widget.TextView;
import android.widget.Toast;
import com.facebook.drawee.view.SimpleDraweeView;
import com.treasure_ct.happiness_xt.BaseActivity;
import com.treasure_ct.happiness_xt.R;
import com.treasure_ct.happiness_xt.bean.UserInfoBean;
import com.treasure_ct.happiness_xt.utils.LogUtil;
import com.treasure_ct.happiness_xt.utils.StringContents;
import com.treasure_ct.happiness_xt.utils.Tools;
import com.treasure_ct.happiness_xt.widget.CustomCircleImageView;
import java.io.Serializable;
import java.util.List;
import java.util.regex.Pattern;
import cn.bmob.v3.BmobQuery;
import cn.bmob.v3.datatype.BmobFile;
import cn.bmob.v3.exception.BmobException;
import cn.bmob.v3.listener.CountListener;
import cn.bmob.v3.listener.FindListener;
import cn.bmob.v3.listener.SaveListener;
import cn.bmob.v3.listener.UpdateListener;
import cn.bmob.v3.listener.UploadFileListener;
public class UserEditUserInfoActivity extends BaseActivity implements View.OnClickListener {
private TextView editPhone;
private EditText editNick;
private EditText editPwd;
private EditText editAge;
private EditText editDesc;
private RadioButton sex_man;
private RadioButton sex_woman;
private TextView btnEnter;
private int sex;
/**
* 大陆手机号码11位数,匹配格式:前三位固定格式+后8位任意数
* 此方法中前三位格式有:
* 13+任意数
* 15+除4的任意数
* 18+除1和4的任意数
* 17+除9的任意数
* 147
*/
private Pattern p = Pattern.compile("^((13[0-9])|(15[^4])|(18[0,2,3,5-9])|(17[0-8])|(147))\\d{8}$");
private String edit_type;
private ImageView pass_visible;
private boolean isHind = true;
private SimpleDraweeView editIcon;
private String mFileUrl;
private String userPhone;
private String mObjectId;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_user_edit_user_info);
initTitle();//基础activity里初始化标题栏
Tools.setTranslucentStatus(this);//沉浸模式
title.setText("信息修改");
initFindId();
receiveIntentData();
initClick();
}
@Override
protected void onResume() {
super.onResume();
BmobQuery<UserInfoBean> query = new BmobQuery<>();
query.addWhereEqualTo("user_name", userPhone);
query.findObjects(new FindListener<UserInfoBean>() {
@Override
public void done(List<UserInfoBean> list, BmobException e) {
editIcon.setImageURI(Uri.parse(list.get(0).getUser_icon()));
}
});
}
private void initFindId() {
editPhone = (TextView) findViewById(R.id.mine_edit_phone);
editNick = (EditText) findViewById(R.id.mine_edit_nickname);
editPwd = (EditText) findViewById(R.id.mine_edit_password);
editAge = (EditText) findViewById(R.id.mine_edit_age);
editDesc = (EditText) findViewById(R.id.mine_edit_userDesc);
sex_man = (RadioButton) findViewById(R.id.mine_edit_sex_man);
sex_woman = (RadioButton) findViewById(R.id.mine_edit_sex_woman);
btnEnter = (TextView) findViewById(R.id.btn_user_edit_enter);
pass_visible = (ImageView) findViewById(R.id.mine_edit_pass_visible);
editIcon = (SimpleDraweeView) findViewById(R.id.mine_edit_icon);
}
private void receiveIntentData() {
Intent intent = getIntent();
if (!Tools.isNull(intent.getStringExtra("UserPhone"))) {
userPhone = intent.getStringExtra("UserPhone");
editPhone.setText(userPhone);
editNick.setText(userPhone);
} else {
editNick.setText("小王");
}
if (!Tools.isNull(intent.getStringExtra("edit_type"))) {
edit_type = intent.getStringExtra("edit_type");
if (edit_type.equals("normal")) {
btn_back.setVisibility(View.VISIBLE);
btn_back.setOnClickListener(this);
btnEnter.setText("修改资料");
}
}
editAge.setText("0");
sex_man.setChecked(true);
}
private void initClick() {
btnEnter.setOnClickListener(this);
btn_back.setOnClickListener(this);
pass_visible.setOnClickListener(this);
editIcon.setOnClickListener(this);
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.btn_user_edit_enter:
if (Tools.isNull(editPwd.getText().toString().trim())) {
Toast.makeText(this, "请输入密码", Toast.LENGTH_SHORT).show();
return;
}
if (Tools.isNull(editNick.getText().toString().trim())) {
Toast.makeText(this, "请输入昵称", Toast.LENGTH_SHORT).show();
return;
}
if (Tools.isNull(editAge.getText().toString().trim())) {
Toast.makeText(this, "请输入年龄", Toast.LENGTH_SHORT).show();
return;
}
if (Tools.isNull(editDesc.getText().toString().trim())) {
Toast.makeText(this, "让更多人认识你", Toast.LENGTH_SHORT).show();
return;
}
if (!Tools.isNull(edit_type)) {
if (edit_type.equals("normal")) {
updateAccount();
} else {
editRegister();
}
}
break;
case R.id.btn_back:
UserEditUserInfoActivity.this.finish();
break;
case R.id.mine_edit_pass_visible:
if (isHind) {
isHind = false;
initNoHindPassInput();
} else {
initHindPassInput();
isHind = true;
}
break;
case R.id.mine_edit_icon:
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(intent, 200);
break;
}
}
//不隐藏密码
private void initNoHindPassInput() {
pass_visible.setImageResource(R.mipmap.icon_eye_open);
editPwd.setInputType(InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD);
editPwd.setSelection(editPwd.getText().length());
}
//隐藏密码
private void initHindPassInput() {
pass_visible.setImageResource(R.mipmap.icon_eye_close);
editPwd.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);
editPwd.setSelection(editPwd.getText().length());
}
private void updateAccount() {
BmobQuery<UserInfoBean> query = new BmobQuery<UserInfoBean>();
query.addWhereEqualTo("user_name", editPhone.getText().toString());
query.findObjects(new FindListener<UserInfoBean>() {
@Override
public void done(List<UserInfoBean> object, BmobException e) {
if (e == null) {
for (UserInfoBean gameScore : object) {
toUpdate(gameScore.getObjectId());
}
}
}
});
}
private void toUpdate(String objectId) {
if (sex_man.isChecked()) {
sex = 0;
} else if (sex_woman.isChecked()) {
sex = 1;
}
final UserInfoBean infoBean = new UserInfoBean();
infoBean.setUser_name(editPhone.getText().toString().trim());
infoBean.setNick_name(editNick.getText().toString().trim() + "");
infoBean.setUser_pwd(editPwd.getText().toString().trim());
infoBean.setAge(Integer.parseInt(editAge.getText().toString().trim()));
infoBean.setSex(sex);
infoBean.setUser_desc(editDesc.getText().toString().trim() + "");
infoBean.setUser_icon("暂无头像");
infoBean.update(objectId, new UpdateListener() {
@Override
public void done(BmobException e) {
if (e == null) {
Toast.makeText(UserEditUserInfoActivity.this, "更新成功", Toast.LENGTH_SHORT).show();
//存入SharedPreferences
SharedPreferences preferences = getSharedPreferences("user", MODE_PRIVATE);
SharedPreferences.Editor editor = preferences.edit();
editor.putString("token", "login");
editor.putString("user_icon", "暂无头像");
editor.putString("user_name", infoBean.getUser_name());
editor.putString("user_nick", infoBean.getNick_name());
editor.putString("user_pwd", infoBean.getUser_pwd());
editor.putString("user_age", String.valueOf(infoBean.getAge()));
editor.putString("user_sex", String.valueOf(infoBean.getSex()));
editor.putString("user_desc", infoBean.getUser_desc());
editor.apply();
//发送登录成功 广播
Intent intent = new Intent();
intent.setAction(StringContents.ACTION_COMMENTDATA);
intent.putExtra("label", "login");
sendBroadcast(intent);
UserEditUserInfoActivity.this.finish();
} else {
Toast.makeText(UserEditUserInfoActivity.this, "更新失败" + e.getMessage(), Toast.LENGTH_SHORT).show();
}
}
});
}
private void editRegister() {
/**
* 查询是否重复
*/
BmobQuery<UserInfoBean> query = new BmobQuery<>();
query.addWhereEqualTo("user_name", editPhone.getText().toString().trim());
query.count(UserInfoBean.class, new CountListener() {
@Override
public void done(Integer integer, BmobException e) {
if (e == null) {
if (integer > 0) {
Toast.makeText(UserEditUserInfoActivity.this, "手机号已被注册", Toast.LENGTH_SHORT).show();
UserEditUserInfoActivity.this.finish();
} else {
toRegister();
}
} else {
Toast.makeText(UserEditUserInfoActivity.this, "原因:" + e.getMessage(), Toast.LENGTH_SHORT).show();
}
}
});
}
private void toRegister() {
/**
* 注册
*/
if (sex_man.isChecked()) {
sex = 0;
} else if (sex_woman.isChecked()) {
sex = 1;
}
final UserInfoBean infoBean = new UserInfoBean();
infoBean.setUser_name(editPhone.getText().toString().trim());
infoBean.setNick_name(editNick.getText().toString().trim() + "");
infoBean.setUser_pwd(editPwd.getText().toString().trim());
infoBean.setAge(Integer.parseInt(editAge.getText().toString().trim()));
infoBean.setSex(sex);
infoBean.setUser_desc(editDesc.getText().toString().trim() + "");
infoBean.setUser_icon("暂无头像");
infoBean.save(new SaveListener<String>() {
@Override
public void done(String s, BmobException e) {
if (e == null) {
Toast.makeText(UserEditUserInfoActivity.this, "恭喜你,注册成功", Toast.LENGTH_SHORT).show();
//存入SharedPreferences
SharedPreferences preferences = getSharedPreferences("user", MODE_PRIVATE);
SharedPreferences.Editor editor = preferences.edit();
editor.putString("token", "login");
editor.putString("user_icon", "暂无头像");
editor.putString("user_name", infoBean.getUser_name());
editor.putString("user_nick", infoBean.getNick_name());
editor.putString("user_pwd", infoBean.getUser_pwd());
editor.putString("user_age", String.valueOf(infoBean.getAge()));
editor.putString("user_sex", String.valueOf(infoBean.getSex()));
editor.putString("user_desc", infoBean.getUser_desc());
editor.apply();
//发送登录成功 广播
Intent intent = new Intent();
intent.setAction(StringContents.ACTION_COMMENTDATA);
intent.putExtra("label", "login");
sendBroadcast(intent);
UserEditUserInfoActivity.this.finish();
} else {
Toast.makeText(UserEditUserInfoActivity.this, "很遗憾,注册失败\n原因:" + e.getMessage(), Toast.LENGTH_SHORT).show();
}
}
});
}
@Override
public void onBackPressed() {
if (!Tools.isNull(edit_type)) {
if (edit_type.equals("normal")) {
super.onBackPressed();
} else if (edit_type.equals("register")) {
Toast.makeText(this, "请提交自己的信息", Toast.LENGTH_SHORT).show();
}
}
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == 200) {
if (resultCode == Activity.RESULT_OK) {
Bitmap bitmap = (Bitmap) data.getExtras().get("data");
final BmobFile bmobFile = new BmobFile(Tools.compressImage(bitmap));
bmobFile.uploadblock(new UploadFileListener() {
@Override
public void done(BmobException e) {
if (e == null) {
mFileUrl = bmobFile.getFileUrl();
editIcon.setImageURI(Uri.parse(mFileUrl));
BmobQuery<UserInfoBean> query = new BmobQuery<>();
query.addWhereEqualTo("user_name", userPhone);
query.findObjects(new FindListener<UserInfoBean>() {
@Override
public void done(List<UserInfoBean> list, BmobException e) {
mObjectId = list.get(0).getObjectId();
UserInfoBean userInfoBean = new UserInfoBean();
userInfoBean.setUser_icon(mFileUrl);
userInfoBean.update(mObjectId, new UpdateListener() {
@Override
public void done(BmobException e) {
if (e == null){
SharedPreferences.Editor editor = getSharedPreferences("user", MODE_PRIVATE).edit();
editor.putString("user_icon",mFileUrl);
editor.apply();
}
}
});
}
});
}
}
});
}
}
}
}
|
UTF-8
|
Java
| 16,025 |
java
|
UserEditUserInfoActivity.java
|
Java
|
[
{
"context": ");\n editor.putString(\"token\", \"login\");\n editor.putString(\"user_ico",
"end": 8814,
"score": 0.6116418838500977,
"start": 8809,
"tag": "KEY",
"value": "login"
},
{
"context": ";\n editor.putString(\"user_pwd\", infoBean.getUser_pwd());\n editor.pu",
"end": 9082,
"score": 0.5812366604804993,
"start": 9078,
"tag": "PASSWORD",
"value": "info"
}
] | null |
[] |
package com.treasure_ct.happiness_xt.activity.user;
import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Bundle;
import android.provider.MediaStore;
import android.text.InputType;
import android.view.View;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.RadioButton;
import android.widget.TextView;
import android.widget.Toast;
import com.facebook.drawee.view.SimpleDraweeView;
import com.treasure_ct.happiness_xt.BaseActivity;
import com.treasure_ct.happiness_xt.R;
import com.treasure_ct.happiness_xt.bean.UserInfoBean;
import com.treasure_ct.happiness_xt.utils.LogUtil;
import com.treasure_ct.happiness_xt.utils.StringContents;
import com.treasure_ct.happiness_xt.utils.Tools;
import com.treasure_ct.happiness_xt.widget.CustomCircleImageView;
import java.io.Serializable;
import java.util.List;
import java.util.regex.Pattern;
import cn.bmob.v3.BmobQuery;
import cn.bmob.v3.datatype.BmobFile;
import cn.bmob.v3.exception.BmobException;
import cn.bmob.v3.listener.CountListener;
import cn.bmob.v3.listener.FindListener;
import cn.bmob.v3.listener.SaveListener;
import cn.bmob.v3.listener.UpdateListener;
import cn.bmob.v3.listener.UploadFileListener;
public class UserEditUserInfoActivity extends BaseActivity implements View.OnClickListener {
private TextView editPhone;
private EditText editNick;
private EditText editPwd;
private EditText editAge;
private EditText editDesc;
private RadioButton sex_man;
private RadioButton sex_woman;
private TextView btnEnter;
private int sex;
/**
* 大陆手机号码11位数,匹配格式:前三位固定格式+后8位任意数
* 此方法中前三位格式有:
* 13+任意数
* 15+除4的任意数
* 18+除1和4的任意数
* 17+除9的任意数
* 147
*/
private Pattern p = Pattern.compile("^((13[0-9])|(15[^4])|(18[0,2,3,5-9])|(17[0-8])|(147))\\d{8}$");
private String edit_type;
private ImageView pass_visible;
private boolean isHind = true;
private SimpleDraweeView editIcon;
private String mFileUrl;
private String userPhone;
private String mObjectId;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_user_edit_user_info);
initTitle();//基础activity里初始化标题栏
Tools.setTranslucentStatus(this);//沉浸模式
title.setText("信息修改");
initFindId();
receiveIntentData();
initClick();
}
@Override
protected void onResume() {
super.onResume();
BmobQuery<UserInfoBean> query = new BmobQuery<>();
query.addWhereEqualTo("user_name", userPhone);
query.findObjects(new FindListener<UserInfoBean>() {
@Override
public void done(List<UserInfoBean> list, BmobException e) {
editIcon.setImageURI(Uri.parse(list.get(0).getUser_icon()));
}
});
}
private void initFindId() {
editPhone = (TextView) findViewById(R.id.mine_edit_phone);
editNick = (EditText) findViewById(R.id.mine_edit_nickname);
editPwd = (EditText) findViewById(R.id.mine_edit_password);
editAge = (EditText) findViewById(R.id.mine_edit_age);
editDesc = (EditText) findViewById(R.id.mine_edit_userDesc);
sex_man = (RadioButton) findViewById(R.id.mine_edit_sex_man);
sex_woman = (RadioButton) findViewById(R.id.mine_edit_sex_woman);
btnEnter = (TextView) findViewById(R.id.btn_user_edit_enter);
pass_visible = (ImageView) findViewById(R.id.mine_edit_pass_visible);
editIcon = (SimpleDraweeView) findViewById(R.id.mine_edit_icon);
}
private void receiveIntentData() {
Intent intent = getIntent();
if (!Tools.isNull(intent.getStringExtra("UserPhone"))) {
userPhone = intent.getStringExtra("UserPhone");
editPhone.setText(userPhone);
editNick.setText(userPhone);
} else {
editNick.setText("小王");
}
if (!Tools.isNull(intent.getStringExtra("edit_type"))) {
edit_type = intent.getStringExtra("edit_type");
if (edit_type.equals("normal")) {
btn_back.setVisibility(View.VISIBLE);
btn_back.setOnClickListener(this);
btnEnter.setText("修改资料");
}
}
editAge.setText("0");
sex_man.setChecked(true);
}
private void initClick() {
btnEnter.setOnClickListener(this);
btn_back.setOnClickListener(this);
pass_visible.setOnClickListener(this);
editIcon.setOnClickListener(this);
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.btn_user_edit_enter:
if (Tools.isNull(editPwd.getText().toString().trim())) {
Toast.makeText(this, "请输入密码", Toast.LENGTH_SHORT).show();
return;
}
if (Tools.isNull(editNick.getText().toString().trim())) {
Toast.makeText(this, "请输入昵称", Toast.LENGTH_SHORT).show();
return;
}
if (Tools.isNull(editAge.getText().toString().trim())) {
Toast.makeText(this, "请输入年龄", Toast.LENGTH_SHORT).show();
return;
}
if (Tools.isNull(editDesc.getText().toString().trim())) {
Toast.makeText(this, "让更多人认识你", Toast.LENGTH_SHORT).show();
return;
}
if (!Tools.isNull(edit_type)) {
if (edit_type.equals("normal")) {
updateAccount();
} else {
editRegister();
}
}
break;
case R.id.btn_back:
UserEditUserInfoActivity.this.finish();
break;
case R.id.mine_edit_pass_visible:
if (isHind) {
isHind = false;
initNoHindPassInput();
} else {
initHindPassInput();
isHind = true;
}
break;
case R.id.mine_edit_icon:
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(intent, 200);
break;
}
}
//不隐藏密码
private void initNoHindPassInput() {
pass_visible.setImageResource(R.mipmap.icon_eye_open);
editPwd.setInputType(InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD);
editPwd.setSelection(editPwd.getText().length());
}
//隐藏密码
private void initHindPassInput() {
pass_visible.setImageResource(R.mipmap.icon_eye_close);
editPwd.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);
editPwd.setSelection(editPwd.getText().length());
}
private void updateAccount() {
BmobQuery<UserInfoBean> query = new BmobQuery<UserInfoBean>();
query.addWhereEqualTo("user_name", editPhone.getText().toString());
query.findObjects(new FindListener<UserInfoBean>() {
@Override
public void done(List<UserInfoBean> object, BmobException e) {
if (e == null) {
for (UserInfoBean gameScore : object) {
toUpdate(gameScore.getObjectId());
}
}
}
});
}
private void toUpdate(String objectId) {
if (sex_man.isChecked()) {
sex = 0;
} else if (sex_woman.isChecked()) {
sex = 1;
}
final UserInfoBean infoBean = new UserInfoBean();
infoBean.setUser_name(editPhone.getText().toString().trim());
infoBean.setNick_name(editNick.getText().toString().trim() + "");
infoBean.setUser_pwd(editPwd.getText().toString().trim());
infoBean.setAge(Integer.parseInt(editAge.getText().toString().trim()));
infoBean.setSex(sex);
infoBean.setUser_desc(editDesc.getText().toString().trim() + "");
infoBean.setUser_icon("暂无头像");
infoBean.update(objectId, new UpdateListener() {
@Override
public void done(BmobException e) {
if (e == null) {
Toast.makeText(UserEditUserInfoActivity.this, "更新成功", Toast.LENGTH_SHORT).show();
//存入SharedPreferences
SharedPreferences preferences = getSharedPreferences("user", MODE_PRIVATE);
SharedPreferences.Editor editor = preferences.edit();
editor.putString("token", "login");
editor.putString("user_icon", "暂无头像");
editor.putString("user_name", infoBean.getUser_name());
editor.putString("user_nick", infoBean.getNick_name());
editor.putString("user_pwd", <PASSWORD>Bean.getUser_pwd());
editor.putString("user_age", String.valueOf(infoBean.getAge()));
editor.putString("user_sex", String.valueOf(infoBean.getSex()));
editor.putString("user_desc", infoBean.getUser_desc());
editor.apply();
//发送登录成功 广播
Intent intent = new Intent();
intent.setAction(StringContents.ACTION_COMMENTDATA);
intent.putExtra("label", "login");
sendBroadcast(intent);
UserEditUserInfoActivity.this.finish();
} else {
Toast.makeText(UserEditUserInfoActivity.this, "更新失败" + e.getMessage(), Toast.LENGTH_SHORT).show();
}
}
});
}
private void editRegister() {
/**
* 查询是否重复
*/
BmobQuery<UserInfoBean> query = new BmobQuery<>();
query.addWhereEqualTo("user_name", editPhone.getText().toString().trim());
query.count(UserInfoBean.class, new CountListener() {
@Override
public void done(Integer integer, BmobException e) {
if (e == null) {
if (integer > 0) {
Toast.makeText(UserEditUserInfoActivity.this, "手机号已被注册", Toast.LENGTH_SHORT).show();
UserEditUserInfoActivity.this.finish();
} else {
toRegister();
}
} else {
Toast.makeText(UserEditUserInfoActivity.this, "原因:" + e.getMessage(), Toast.LENGTH_SHORT).show();
}
}
});
}
private void toRegister() {
/**
* 注册
*/
if (sex_man.isChecked()) {
sex = 0;
} else if (sex_woman.isChecked()) {
sex = 1;
}
final UserInfoBean infoBean = new UserInfoBean();
infoBean.setUser_name(editPhone.getText().toString().trim());
infoBean.setNick_name(editNick.getText().toString().trim() + "");
infoBean.setUser_pwd(editPwd.getText().toString().trim());
infoBean.setAge(Integer.parseInt(editAge.getText().toString().trim()));
infoBean.setSex(sex);
infoBean.setUser_desc(editDesc.getText().toString().trim() + "");
infoBean.setUser_icon("暂无头像");
infoBean.save(new SaveListener<String>() {
@Override
public void done(String s, BmobException e) {
if (e == null) {
Toast.makeText(UserEditUserInfoActivity.this, "恭喜你,注册成功", Toast.LENGTH_SHORT).show();
//存入SharedPreferences
SharedPreferences preferences = getSharedPreferences("user", MODE_PRIVATE);
SharedPreferences.Editor editor = preferences.edit();
editor.putString("token", "login");
editor.putString("user_icon", "暂无头像");
editor.putString("user_name", infoBean.getUser_name());
editor.putString("user_nick", infoBean.getNick_name());
editor.putString("user_pwd", infoBean.getUser_pwd());
editor.putString("user_age", String.valueOf(infoBean.getAge()));
editor.putString("user_sex", String.valueOf(infoBean.getSex()));
editor.putString("user_desc", infoBean.getUser_desc());
editor.apply();
//发送登录成功 广播
Intent intent = new Intent();
intent.setAction(StringContents.ACTION_COMMENTDATA);
intent.putExtra("label", "login");
sendBroadcast(intent);
UserEditUserInfoActivity.this.finish();
} else {
Toast.makeText(UserEditUserInfoActivity.this, "很遗憾,注册失败\n原因:" + e.getMessage(), Toast.LENGTH_SHORT).show();
}
}
});
}
@Override
public void onBackPressed() {
if (!Tools.isNull(edit_type)) {
if (edit_type.equals("normal")) {
super.onBackPressed();
} else if (edit_type.equals("register")) {
Toast.makeText(this, "请提交自己的信息", Toast.LENGTH_SHORT).show();
}
}
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == 200) {
if (resultCode == Activity.RESULT_OK) {
Bitmap bitmap = (Bitmap) data.getExtras().get("data");
final BmobFile bmobFile = new BmobFile(Tools.compressImage(bitmap));
bmobFile.uploadblock(new UploadFileListener() {
@Override
public void done(BmobException e) {
if (e == null) {
mFileUrl = bmobFile.getFileUrl();
editIcon.setImageURI(Uri.parse(mFileUrl));
BmobQuery<UserInfoBean> query = new BmobQuery<>();
query.addWhereEqualTo("user_name", userPhone);
query.findObjects(new FindListener<UserInfoBean>() {
@Override
public void done(List<UserInfoBean> list, BmobException e) {
mObjectId = list.get(0).getObjectId();
UserInfoBean userInfoBean = new UserInfoBean();
userInfoBean.setUser_icon(mFileUrl);
userInfoBean.update(mObjectId, new UpdateListener() {
@Override
public void done(BmobException e) {
if (e == null){
SharedPreferences.Editor editor = getSharedPreferences("user", MODE_PRIVATE).edit();
editor.putString("user_icon",mFileUrl);
editor.apply();
}
}
});
}
});
}
}
});
}
}
}
}
| 16,031 | 0.547834 | 0.543866 | 379 | 40.232189 | 26.697838 | 132 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.717678 | false | false |
12
|
cbee9d0472238e165a0e6b3c9f7220061ecb64bb
| 6,597,069,770,466 |
c6b9856e1489bf6541bb744c9f35de924fbbe6aa
|
/javaTest2/Note/src/gcd/app/Gcd.java
|
602f13197da102d653bcdafbbcdf8170dada12af
|
[] |
no_license
|
syw78/Java_Study
|
https://github.com/syw78/Java_Study
|
276161de8a43789b04e3956a29309741a8182c96
|
005206e1d471331137e61ec01e52c40e7ac44965
|
refs/heads/master
| 2020-07-16T08:13:35.116000 | 2019-10-07T09:05:20 | 2019-10-07T09:05:20 | 205,752,933 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package gcd.app;
import java.util.Scanner;
public class Gcd {
public static void main(String[] args) {
//1. x,y 값을 입력받는다(1~100)
int x=inputValue();
int y=inputValue();
int temp=0;
//2. x,y값의 대소결정한다.(큰값 : x , 작은값 : y)
if(x<y) {
temp=x;
x=y;
y=temp;
}
//3.최대 공약수 구하기
while(true) {
if(y==0) {
System.out.println("최대공약수는"+x);
break;
}
else {
temp=x%y;
x=y;
y=temp;
}
}
}
public static int inputValue() {
int value=0;
do{
System.out.println("1~100까지 수를 입력요망");
Scanner scan=new Scanner(System.in);
value=scan.nextInt();
}while((value<1 && value>100));
return value;
}
}
|
UHC
|
Java
| 773 |
java
|
Gcd.java
|
Java
|
[] | null |
[] |
package gcd.app;
import java.util.Scanner;
public class Gcd {
public static void main(String[] args) {
//1. x,y 값을 입력받는다(1~100)
int x=inputValue();
int y=inputValue();
int temp=0;
//2. x,y값의 대소결정한다.(큰값 : x , 작은값 : y)
if(x<y) {
temp=x;
x=y;
y=temp;
}
//3.최대 공약수 구하기
while(true) {
if(y==0) {
System.out.println("최대공약수는"+x);
break;
}
else {
temp=x%y;
x=y;
y=temp;
}
}
}
public static int inputValue() {
int value=0;
do{
System.out.println("1~100까지 수를 입력요망");
Scanner scan=new Scanner(System.in);
value=scan.nextInt();
}while((value<1 && value>100));
return value;
}
}
| 773 | 0.534107 | 0.507983 | 46 | 13.978261 | 12.168186 | 41 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.956522 | false | false |
12
|
4d7fe756376266edc3c7e714539c163464f0a00c
| 20,014,547,604,828 |
48e54c5cbd622a427908f48d8861ab0cafb239ea
|
/src/test/java/camt/se494/course/service/CourseServiceImplTest.java
|
f082ecf98a1347569431f99de1623d3f2b3f9184
|
[] |
no_license
|
chertpong/se494-homework1
|
https://github.com/chertpong/se494-homework1
|
7dfeb68d322627cc772570be5d022cf6b8e10882
|
e42141a9fed2c52345e23a01a2ba6816da33344d
|
refs/heads/master
| 2020-05-02T05:30:14.216000 | 2015-10-15T10:57:58 | 2015-10-15T10:57:58 | 43,546,501 | 0 | 0 | null | true | 2015-10-02T10:08:37 | 2015-10-02T10:08:36 | 2015-10-02T03:01:10 | 2015-10-02T03:06:55 | 0 | 0 | 0 | 0 | null | null | null |
package camt.se494.course.service;
import camt.se494.course.dao.CourseEnrolmentDao;
import camt.se494.course.entity.Course;
import camt.se494.course.entity.CourseEnrolment;
import camt.se494.course.entity.CourseReport;
import org.junit.Test;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.CoreMatchers.*;
import static org.mockito.Mockito.*;
/**
* Created by Chertpong on 14/10/2558.
*/
public class CourseServiceImplTest {
@Test
public void testGetCourseReport() throws Exception {
CourseServiceImpl courseService = spy(CourseServiceImpl.class);
CourseEnrolmentDao courseEnrolmentDao = mock(CourseEnrolmentDao.class);
courseService.setCourseEnrolmentDao(courseEnrolmentDao);
Course course = new Course();
CourseReport courseReport = new CourseReport();
courseReport.setCourse(course);
when(courseEnrolmentDao.getCourseEnrolments(course,2558)).thenReturn(Arrays.asList());
assertThat(courseService.getCourseReport(course,2558),is(courseReport));
}
@Test
public void testGetCourseGpa() throws Exception {
CourseServiceImpl courseService = spy(CourseServiceImpl.class);
List<CourseEnrolment> courseEnrolments = new ArrayList<>();
assertThat(courseService.getCourseGpa(courseEnrolments),is(0.00));
}
}
|
UTF-8
|
Java
| 1,427 |
java
|
CourseServiceImplTest.java
|
Java
|
[
{
"context": "rt static org.mockito.Mockito.*;\n/**\n * Created by Chertpong on 14/10/2558.\n */\npublic class CourseServiceImpl",
"end": 481,
"score": 0.9774378538131714,
"start": 472,
"tag": "USERNAME",
"value": "Chertpong"
}
] | null |
[] |
package camt.se494.course.service;
import camt.se494.course.dao.CourseEnrolmentDao;
import camt.se494.course.entity.Course;
import camt.se494.course.entity.CourseEnrolment;
import camt.se494.course.entity.CourseReport;
import org.junit.Test;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.CoreMatchers.*;
import static org.mockito.Mockito.*;
/**
* Created by Chertpong on 14/10/2558.
*/
public class CourseServiceImplTest {
@Test
public void testGetCourseReport() throws Exception {
CourseServiceImpl courseService = spy(CourseServiceImpl.class);
CourseEnrolmentDao courseEnrolmentDao = mock(CourseEnrolmentDao.class);
courseService.setCourseEnrolmentDao(courseEnrolmentDao);
Course course = new Course();
CourseReport courseReport = new CourseReport();
courseReport.setCourse(course);
when(courseEnrolmentDao.getCourseEnrolments(course,2558)).thenReturn(Arrays.asList());
assertThat(courseService.getCourseReport(course,2558),is(courseReport));
}
@Test
public void testGetCourseGpa() throws Exception {
CourseServiceImpl courseService = spy(CourseServiceImpl.class);
List<CourseEnrolment> courseEnrolments = new ArrayList<>();
assertThat(courseService.getCourseGpa(courseEnrolments),is(0.00));
}
}
| 1,427 | 0.75473 | 0.730904 | 39 | 35.589745 | 26.985008 | 94 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.692308 | false | false |
12
|
c67b740cff1ef4410e7c6e8678fba7d3ddefcf9f
| 17,961,553,297,068 |
dd563d0d0f9cedb38339805672bf941f30e30013
|
/src/com/company/行为型/职责链模式/实例/ZongJingLi.java
|
83b0467d525fed0e6670420e39e0aa070d0a187d
|
[] |
no_license
|
StevenJack1/DesignPatterns
|
https://github.com/StevenJack1/DesignPatterns
|
8fe2e8191be05319b90651001ee2f4a7ba9f044c
|
b7fdc2f7fc8f34198856ce8ba9b8686e936f6bfb
|
refs/heads/master
| 2021-05-21T10:22:26.924000 | 2020-04-03T06:59:20 | 2020-04-03T06:59:20 | 252,652,497 | 2 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.company.行为型.职责链模式.实例;
public class ZongJingLi extends Manager {
public ZongJingLi(String name) {
super(name);
}
@Override
public void handlerRequest(Request request) {
if (request.getType() == "请假"){
System.out.println("总经理可以处理任何时间的请假");
} else if (request.getType().equals("加薪") && request.getNumber() <= 500){
System.out.println(request.getNumber()+"元的加薪可以接收");
} else if (request.getType().equals("加薪") && request.getNumber() > 500){
System.out.println(request.getNumber()+"不被接受");
}
}
}
|
GB18030
|
Java
| 686 |
java
|
ZongJingLi.java
|
Java
|
[
{
"context": "package com.company.行为型.职责链模式.实例;\n\npublic class ZongJingLi extends Manager {\n public ZongJingLi(String na",
"end": 58,
"score": 0.7523887753486633,
"start": 48,
"tag": "NAME",
"value": "ZongJingLi"
},
{
"context": "blic class ZongJingLi extends Manager {\n public ZongJingLi(String name) {\n super(name);\n }\n\n\n @",
"end": 98,
"score": 0.8094365000724792,
"start": 88,
"tag": "NAME",
"value": "ZongJingLi"
}
] | null |
[] |
package com.company.行为型.职责链模式.实例;
public class ZongJingLi extends Manager {
public ZongJingLi(String name) {
super(name);
}
@Override
public void handlerRequest(Request request) {
if (request.getType() == "请假"){
System.out.println("总经理可以处理任何时间的请假");
} else if (request.getType().equals("加薪") && request.getNumber() <= 500){
System.out.println(request.getNumber()+"元的加薪可以接收");
} else if (request.getType().equals("加薪") && request.getNumber() > 500){
System.out.println(request.getNumber()+"不被接受");
}
}
}
| 686 | 0.599668 | 0.589701 | 19 | 30.68421 | 26.766146 | 81 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.263158 | false | false |
12
|
ae2b54b0de30024ffd9d173f9e816af826d59e6f
| 16,329,465,719,457 |
080173631a570e7d032a1d500c54d21df6356a5a
|
/FBPM/RM/fcs-rm-facade-wsp/src/main/java/com/born/fcs/rm/ws/order/report/project/BatchSaveOrder.java
|
9704d97aac06c2bba45975f6f10378e4e5717a5e
|
[] |
no_license
|
cckmit/fcs
|
https://github.com/cckmit/fcs
|
d3d577284859b517f3ecc0519b25e2a8add64ca2
|
6ea55733a4aeade931149ee02bc9d3867301d047
|
refs/heads/master
| 2022-04-28T12:09:00.393000 | 2018-02-08T03:55:32 | 2018-02-08T03:55:32 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.born.fcs.rm.ws.order.report.project;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import com.born.fcs.rm.ws.order.report.ReportOrder;
/**
*
* 基层定期报表批量保存
*
* @author lirz
*
* 2016-8-10 上午10:32:16
*/
public class BatchSaveOrder extends ReportOrder {
private static final long serialVersionUID = -3887709141304114262L;
/** 报送年 */
// private int reportYear;
/** 报送月 */
// private int reportMonth;
@Override
public void check() {
validateGreaterThan(super.getReportYear(), "报送年");
validateGreaterThan(super.getReportMonth(), "报送月");
}
/**
* @return
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE);
}
}
|
UTF-8
|
Java
| 880 |
java
|
BatchSaveOrder.java
|
Java
|
[
{
"context": "ReportOrder;\n\n/**\n * \n * 基层定期报表批量保存\n * \n * @author lirz\n * \n * 2016-8-10 上午10:32:16\n */\npublic class Batc",
"end": 255,
"score": 0.9995211362838745,
"start": 251,
"tag": "USERNAME",
"value": "lirz"
}
] | null |
[] |
package com.born.fcs.rm.ws.order.report.project;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import com.born.fcs.rm.ws.order.report.ReportOrder;
/**
*
* 基层定期报表批量保存
*
* @author lirz
*
* 2016-8-10 上午10:32:16
*/
public class BatchSaveOrder extends ReportOrder {
private static final long serialVersionUID = -3887709141304114262L;
/** 报送年 */
// private int reportYear;
/** 报送月 */
// private int reportMonth;
@Override
public void check() {
validateGreaterThan(super.getReportYear(), "报送年");
validateGreaterThan(super.getReportMonth(), "报送月");
}
/**
* @return
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE);
}
}
| 880 | 0.71274 | 0.674279 | 40 | 19.799999 | 22.450167 | 84 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1 | false | false |
12
|
19d26d4fec267662164a8968e6a71e2a5deda933
| 14,594,298,938,010 |
29b5e8c48cc30e956f4bf033773e2b48ba30e4fb
|
/lifecycling/src/main/java/me/tatiyanupanwong/supasin/libraries/android/lifecycling/Lifecycling.java
|
75f470117945c97be916145f377078c6afc2f86a
|
[
"Apache-2.0"
] |
permissive
|
SupasinTatiyanupanwongArchive/lifecycling-android
|
https://github.com/SupasinTatiyanupanwongArchive/lifecycling-android
|
98e8948e702bf3743a32e280dc62e2ee4edd231b
|
8dd816692b8cf32e2d2d39fc2f77e8cfaa6be940
|
refs/heads/master
| 2023-02-28T22:58:21.974000 | 2021-02-03T14:49:12 | 2021-02-03T14:49:12 | 160,052,698 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
/*
* Copyright 2015-2016 Supasin Tatiyanupanwong
*
* 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 me.tatiyanupanwong.supasin.libraries.android.lifecycling;
import android.util.Log;
/**
* @author Supasin Tatiyanupanwong (supast49@aware.postbox.in.th)
*/
public final class Lifecycling {
private static final String TAG = "Lifecycling";
private static boolean sDebug = false;
private Lifecycling() {}
/**
* Control whether the {@link Lifecycling}'s debugging logs are turned on.
*
* If enabled, you will see output in logcat as the lifecycle events being dispatched.
*/
@SuppressWarnings("unused") // Public API
public static void enableDebugLogging(boolean enabled) {
sDebug = enabled;
}
static void logEvent(LifecycleOwner owner, Lifecycle.Event event) {
if (sDebug) {
String sourceStr = owner.getClass().getSimpleName()
+ "{" + Integer.toHexString(System.identityHashCode(owner)) + "}";
Log.d(TAG, "Dispatching event " + event.name() + " of " + sourceStr);
}
}
}
|
UTF-8
|
Java
| 1,621 |
java
|
Lifecycling.java
|
Java
|
[
{
"context": "/*\n * Copyright 2015-2016 Supasin Tatiyanupanwong\n *\n * Licensed under the Apache License, Version ",
"end": 49,
"score": 0.9998883008956909,
"start": 26,
"tag": "NAME",
"value": "Supasin Tatiyanupanwong"
},
{
"context": "cycling;\n\nimport android.util.Log;\n\n/**\n * @author Supasin Tatiyanupanwong (supast49@aware.postbox.in.th)\n */\npublic final c",
"end": 744,
"score": 0.9998875856399536,
"start": 721,
"tag": "NAME",
"value": "Supasin Tatiyanupanwong"
},
{
"context": "til.Log;\n\n/**\n * @author Supasin Tatiyanupanwong (supast49@aware.postbox.in.th)\n */\npublic final class Lifecycling {\n\n privat",
"end": 774,
"score": 0.999934732913971,
"start": 746,
"tag": "EMAIL",
"value": "supast49@aware.postbox.in.th"
}
] | null |
[] |
/*
* Copyright 2015-2016 <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 me.tatiyanupanwong.supasin.libraries.android.lifecycling;
import android.util.Log;
/**
* @author <NAME> (<EMAIL>)
*/
public final class Lifecycling {
private static final String TAG = "Lifecycling";
private static boolean sDebug = false;
private Lifecycling() {}
/**
* Control whether the {@link Lifecycling}'s debugging logs are turned on.
*
* If enabled, you will see output in logcat as the lifecycle events being dispatched.
*/
@SuppressWarnings("unused") // Public API
public static void enableDebugLogging(boolean enabled) {
sDebug = enabled;
}
static void logEvent(LifecycleOwner owner, Lifecycle.Event event) {
if (sDebug) {
String sourceStr = owner.getClass().getSimpleName()
+ "{" + Integer.toHexString(System.identityHashCode(owner)) + "}";
Log.d(TAG, "Dispatching event " + event.name() + " of " + sourceStr);
}
}
}
| 1,566 | 0.684146 | 0.675509 | 50 | 31.42 | 30.448704 | 90 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.3 | false | false |
12
|
714f68c67a6c67de270f6306541dc6fb693b8b64
| 15,307,263,446,038 |
c239126fbf798460bb5a337322b2a452f4e7ae78
|
/pawan_project/src/main/java/com/java/MapDemo.java
|
402e71923e723125b9430ac29e3d2ebd5110fcc7
|
[] |
no_license
|
pkprawah/sample-java-program
|
https://github.com/pkprawah/sample-java-program
|
905da61ae1fe66e1b4d273f89f541c52e3d93ede
|
1e3d76fb8604f92f4d048c7fb191406e03efa99a
|
refs/heads/master
| 2022-03-14T00:36:20.913000 | 2022-02-23T09:35:29 | 2022-02-23T09:35:29 | 211,013,291 | 0 | 0 | null | false | 2023-09-05T22:01:37 | 2019-09-26T06:12:39 | 2022-02-23T09:27:38 | 2023-09-05T22:01:36 | 178 | 0 | 0 | 1 |
Java
| false | false |
package com.java;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
public class MapDemo {
public static void main(String[] args) {
List<String> numbers = Arrays.asList("1", "2", "3", "4", "5", "6");
/* List<Integer> evenList=numbers.stream()
.flatMap(string -> Integer.valueOf(string)).filter(number -> number%2==0)
.collect(Collectors.toList());*/
// System.out.println("Even list ::"+evenList);
}
}
|
UTF-8
|
Java
| 482 |
java
|
MapDemo.java
|
Java
|
[] | null |
[] |
package com.java;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
public class MapDemo {
public static void main(String[] args) {
List<String> numbers = Arrays.asList("1", "2", "3", "4", "5", "6");
/* List<Integer> evenList=numbers.stream()
.flatMap(string -> Integer.valueOf(string)).filter(number -> number%2==0)
.collect(Collectors.toList());*/
// System.out.println("Even list ::"+evenList);
}
}
| 482 | 0.63278 | 0.616183 | 22 | 20.90909 | 23.366467 | 78 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.818182 | false | false |
12
|
233c8c75a9ade3d0e49e580a7e0359a3c5b40ae2
| 15,307,263,444,677 |
17adbe946a7f657c279556cd666839b19a46bad9
|
/java - faculdade/lista1/src/Questao8/Teste.java
|
52e2622beeda0367ee865cd5ff59b0bda8e7b040
|
[] |
no_license
|
jaquelinebonoto/EstagioVemSer
|
https://github.com/jaquelinebonoto/EstagioVemSer
|
bfd4acce7ef6d00e2112b4d16b862dcf5761be88
|
48db9877fa84a87dc03bd35f9ffa45bf680cd534
|
refs/heads/master
| 2020-04-26T18:23:32.682000 | 2018-11-07T18:46:57 | 2018-11-07T18:46:57 | 173,743,623 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package Questao8;
public class Teste {
public static void main(String[] args) {
Pagamento vetor [] = new Pagamento[5];
Cheque c1 = new Cheque(1234, 1267, 0);
Cheque cheques[] = new Cheque[4];
cheques[2] = new Cheque(1235, 12, 1245);
vetor[0] = new PagamentoCheque("12/11/2008", c1, 100.0);
vetor[1] = new PagamentoCheque ("", null, 0.0);
vetor[2] = new PagamentoCheque ("16/11/2008", new Cheque(1234, 1, 3453), 150.0);
vetor[3] = new PagamentoCheque ("", null, 0.0);
vetor[4] = new PagamentoCheque ("18/11/2008", cheques[1], 50.0);
for(int i=0; i<vetor.length; i++)
System.out.println(vetor[i].toString());
}
}
|
UTF-8
|
Java
| 707 |
java
|
Teste.java
|
Java
|
[] | null |
[] |
package Questao8;
public class Teste {
public static void main(String[] args) {
Pagamento vetor [] = new Pagamento[5];
Cheque c1 = new Cheque(1234, 1267, 0);
Cheque cheques[] = new Cheque[4];
cheques[2] = new Cheque(1235, 12, 1245);
vetor[0] = new PagamentoCheque("12/11/2008", c1, 100.0);
vetor[1] = new PagamentoCheque ("", null, 0.0);
vetor[2] = new PagamentoCheque ("16/11/2008", new Cheque(1234, 1, 3453), 150.0);
vetor[3] = new PagamentoCheque ("", null, 0.0);
vetor[4] = new PagamentoCheque ("18/11/2008", cheques[1], 50.0);
for(int i=0; i<vetor.length; i++)
System.out.println(vetor[i].toString());
}
}
| 707 | 0.579915 | 0.466761 | 19 | 36.157894 | 26.220247 | 88 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.526316 | false | false |
12
|
4c74506caaec8a8e77aaa478e8c5ffae54a9cdf1
| 283,467,853,273 |
6d67d3e38026ab3c0b26e31898035e574e4fc26b
|
/src/main/java/com/benjiweber/html/values/PixelMeasurement.java
|
9cbae2a0e575c1450cccc567647b898aa9130843
|
[] |
no_license
|
benjiman/java-html-dsl
|
https://github.com/benjiman/java-html-dsl
|
5796a9c91b6c5dedd91d6a7aa7756bdf47420b33
|
8204b299e4f5338b06525284052a331cfc7646fa
|
refs/heads/master
| 2021-06-14T09:13:05.282000 | 2021-02-28T15:11:13 | 2021-02-28T15:11:13 | 41,144,468 | 76 | 13 | null | false | 2021-02-28T15:11:32 | 2015-08-21T08:20:57 | 2021-02-28T15:11:16 | 2021-02-28T15:11:32 | 102 | 66 | 11 | 1 |
Java
| false | false |
package com.benjiweber.html.values;
public class PixelMeasurement {
public final int numberOfPixels;
public PixelMeasurement(int numberOfPixels) {
this.numberOfPixels = numberOfPixels;
}
public static PixelMeasurement px(int num) { return new PixelMeasurement(num); }
@Override
public String toString() {
return "" + numberOfPixels;
}
}
|
UTF-8
|
Java
| 385 |
java
|
PixelMeasurement.java
|
Java
|
[
{
"context": "package com.benjiweber.html.values;\n\npublic class PixelMeasurement {\n",
"end": 19,
"score": 0.5985173583030701,
"start": 17,
"tag": "USERNAME",
"value": "we"
}
] | null |
[] |
package com.benjiweber.html.values;
public class PixelMeasurement {
public final int numberOfPixels;
public PixelMeasurement(int numberOfPixels) {
this.numberOfPixels = numberOfPixels;
}
public static PixelMeasurement px(int num) { return new PixelMeasurement(num); }
@Override
public String toString() {
return "" + numberOfPixels;
}
}
| 385 | 0.696104 | 0.696104 | 16 | 23.0625 | 23.450663 | 84 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.3125 | false | false |
12
|
67d169eb0fec89c6c51ce097e00558df3575bda0
| 19,619,410,676,477 |
6bf5c29aab83fa9ed48b860be185a4196e62ec1b
|
/TimeSpaceComplexity/Complexity.java
|
47d448ef616dc9da1a79cdebdcd2bea020575b7e
|
[] |
no_license
|
Snehomoy100/Java-Sessions
|
https://github.com/Snehomoy100/Java-Sessions
|
a76dcb733b330e3c3d6fac61204b6b830492fae0
|
d05ba68e0c8763f93421527f34e5af7ccf5731a1
|
refs/heads/main
| 2023-05-05T18:07:12.276000 | 2022-08-31T14:27:35 | 2022-08-31T14:27:35 | 370,429,927 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
public class Complexity {
public static void main(String[] args) {
int i;
for(i = 0; i<5; ++i){
System.out.println(i);
}
}
}
|
UTF-8
|
Java
| 169 |
java
|
Complexity.java
|
Java
|
[] | null |
[] |
public class Complexity {
public static void main(String[] args) {
int i;
for(i = 0; i<5; ++i){
System.out.println(i);
}
}
}
| 169 | 0.473373 | 0.461538 | 8 | 20.125 | 14.234092 | 44 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.5 | false | false |
12
|
e186db63dc1643864b84e57b7be3d17662917d2b
| 15,281,493,641,936 |
e834b11f60cd14112cd37a5f5a8d2d38b63397f3
|
/main/java/com/aem/community/core/service/CommentsServiceImpl.java
|
d10eca0a764a7a91b9b908d7d9395624daefb7e9
|
[] |
no_license
|
dsoporan/internshipAEM
|
https://github.com/dsoporan/internshipAEM
|
8a3b813b7c1669b517d507286bc846f609c88c72
|
e3c7b404b9ac62b4d020aab023f033a07b04dbe2
|
refs/heads/master
| 2020-07-24T00:26:42.780000 | 2019-09-11T08:00:25 | 2019-09-11T08:00:25 | 207,748,733 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.aem.community.core.service;
import com.aem.community.core.constants.MyConstants;
import com.aem.community.core.models.Comment;
import org.apache.sling.commons.json.JSONArray;
import org.apache.sling.commons.json.JSONException;
import org.apache.sling.commons.json.JSONObject;
import java.util.ArrayList;
import java.util.List;
public class CommentsServiceImpl implements CommentsService {
@Override
public List<Comment> getCommentsFromJson(String jsonString, String postId) {
List<Comment> commentsList = new ArrayList<Comment>();
try {
JSONArray jsonArray = new JSONArray(jsonString);
for(int index = 0; index < jsonArray.length(); index++){
JSONObject jsonObject = jsonArray.getJSONObject(index);
if (jsonObject.getString(MyConstants.POST_ID).equals(postId)) {
Comment comment = new Comment.Builder()
.setId(jsonObject.getString(MyConstants.ID))
.setName(jsonObject.getString(MyConstants.NAME))
.setEmail(jsonObject.getString(MyConstants.EMAIL))
.setBody(jsonObject.getString(MyConstants.BODY))
.build();
commentsList.add(comment);
}
}
} catch (JSONException e) {
e.printStackTrace();
}
return commentsList;
}
}
|
UTF-8
|
Java
| 1,498 |
java
|
CommentsServiceImpl.java
|
Java
|
[] | null |
[] |
package com.aem.community.core.service;
import com.aem.community.core.constants.MyConstants;
import com.aem.community.core.models.Comment;
import org.apache.sling.commons.json.JSONArray;
import org.apache.sling.commons.json.JSONException;
import org.apache.sling.commons.json.JSONObject;
import java.util.ArrayList;
import java.util.List;
public class CommentsServiceImpl implements CommentsService {
@Override
public List<Comment> getCommentsFromJson(String jsonString, String postId) {
List<Comment> commentsList = new ArrayList<Comment>();
try {
JSONArray jsonArray = new JSONArray(jsonString);
for(int index = 0; index < jsonArray.length(); index++){
JSONObject jsonObject = jsonArray.getJSONObject(index);
if (jsonObject.getString(MyConstants.POST_ID).equals(postId)) {
Comment comment = new Comment.Builder()
.setId(jsonObject.getString(MyConstants.ID))
.setName(jsonObject.getString(MyConstants.NAME))
.setEmail(jsonObject.getString(MyConstants.EMAIL))
.setBody(jsonObject.getString(MyConstants.BODY))
.build();
commentsList.add(comment);
}
}
} catch (JSONException e) {
e.printStackTrace();
}
return commentsList;
}
}
| 1,498 | 0.601469 | 0.600801 | 38 | 37.421051 | 27.413626 | 80 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.473684 | false | false |
12
|
317b0be6b28168a9d142ebdd31471def24cc98d1
| 15,814,069,590,817 |
8df1452011e9502cb60a51db7cb8e31f166bb42a
|
/src/ca/bytetube/day14_exception/ArrayTools.java
|
2023edaf395edda35e54f3ffe1c6535944f9bd01
|
[] |
no_license
|
isisisisisitch/javadev11
|
https://github.com/isisisisisitch/javadev11
|
6440c997d8aece0ae0aa24f849d4265dce93b6b9
|
dfce71f4ac01bb9a0791a5595abb924245e3310f
|
refs/heads/master
| 2023-04-14T05:42:29.192000 | 2021-04-12T02:06:02 | 2021-04-12T02:06:02 | 332,923,766 | 1 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package ca.bytetube.day14_exception;
public class ArrayTools {
public static int getElement(int[] arr, int index) throws NullPointerException, ArrayIndexOutOfBoundsException{
if (arr == null) {
throw new NullPointerException("arr is null !");
}
if (index < 0 || index > arr.length - 1) {
throw new ArrayIndexOutOfBoundsException("error index,"+index+"does not exisit");
}
int ele = arr[index];
return ele;
}
}
|
UTF-8
|
Java
| 497 |
java
|
ArrayTools.java
|
Java
|
[] | null |
[] |
package ca.bytetube.day14_exception;
public class ArrayTools {
public static int getElement(int[] arr, int index) throws NullPointerException, ArrayIndexOutOfBoundsException{
if (arr == null) {
throw new NullPointerException("arr is null !");
}
if (index < 0 || index > arr.length - 1) {
throw new ArrayIndexOutOfBoundsException("error index,"+index+"does not exisit");
}
int ele = arr[index];
return ele;
}
}
| 497 | 0.616162 | 0.608081 | 18 | 26.5 | 32.762192 | 115 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.5 | false | false |
12
|
74a35b251625306a558984fba02b98f34e6b255a
| 463,856,517,121 |
05be38447857654784d207204cb0e548c82a9f81
|
/src/main/java/com/sample/app/FilterDemo.java
|
d62954c63f016d8553aa414d758e51da74bb0ae5
|
[] |
no_license
|
harikrishna553/rxjava
|
https://github.com/harikrishna553/rxjava
|
6f26670a340cf0b06f4397104b7b0bd9403ce532
|
6c16499e946e7a4dcfeb5433aaa40d6dd56d7711
|
refs/heads/master
| 2022-09-08T20:34:23.020000 | 2020-05-31T07:07:58 | 2020-05-31T07:07:58 | 266,188,843 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.sample.app;
import java.util.concurrent.TimeUnit;
import io.reactivex.rxjava3.core.Observable;
public class FilterDemo {
private static void sleep(int noOfSeconds) {
try {
Thread.currentThread().sleep(noOfSeconds * 1000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public static void main(String args[]) {
Observable.interval(1, TimeUnit.SECONDS).filter(item -> item % 4 == 0)
.subscribe(item -> System.out.println(item));
while (true) {
sleep(20);
}
}
}
|
UTF-8
|
Java
| 559 |
java
|
FilterDemo.java
|
Java
|
[] | null |
[] |
package com.sample.app;
import java.util.concurrent.TimeUnit;
import io.reactivex.rxjava3.core.Observable;
public class FilterDemo {
private static void sleep(int noOfSeconds) {
try {
Thread.currentThread().sleep(noOfSeconds * 1000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public static void main(String args[]) {
Observable.interval(1, TimeUnit.SECONDS).filter(item -> item % 4 == 0)
.subscribe(item -> System.out.println(item));
while (true) {
sleep(20);
}
}
}
| 559 | 0.690519 | 0.67263 | 27 | 19.666666 | 20.821997 | 72 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.481481 | false | false |
12
|
3a35ad1f17a71af7573ffdd084ab9889e7b7c4f2
| 18,425,409,715,066 |
4cb828505b77fc4e3b513e53df720b9cfaae4152
|
/src/com/decimatepvp/hub/commands/JoinTestServerCommand.java
|
3e3ba3469d66e756c969c65698eb557d2bae2995
|
[] |
no_license
|
Alexandra321/hub
|
https://github.com/Alexandra321/hub
|
5b48b7d144e658e1bef2025fa278b68bafd6ff2d
|
4820026a6fec18e1e8f75c752c62fb34fc5fc024
|
refs/heads/master
| 2021-07-12T01:32:59.408000 | 2017-10-13T14:52:56 | 2017-10-13T14:52:56 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.decimatepvp.hub.commands;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import com.decimatepvp.hub.core.DecimateHub;
import com.google.common.io.ByteArrayDataOutput;
import com.google.common.io.ByteStreams;
public class JoinTestServerCommand implements CommandExecutor {
@Override
public boolean onCommand(CommandSender arg0, Command arg1, String arg2, String[] arg3) {
if(arg0 instanceof Player && arg0.isOp()){
if(arg3.length == 0){
send((Player)arg0);
}else{
try{
Player player = Bukkit.getServer().getPlayer(arg3[0]);
send(player);
}catch(Exception ex){
arg0.sendMessage(ChatColor.RED + "Player not found.");
}
}
}else{
arg0.sendMessage(ChatColor.RED + "You do not have permission to use this command.");
}
return false;
}
private void send(Player player){
ByteArrayDataOutput out = ByteStreams.newDataOutput();
out.writeUTF("Connect");
out.writeUTF("test");
player.sendPluginMessage(DecimateHub.getInstance(), "BungeeCord", out.toByteArray());
}
}
|
UTF-8
|
Java
| 1,207 |
java
|
JoinTestServerCommand.java
|
Java
|
[] | null |
[] |
package com.decimatepvp.hub.commands;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import com.decimatepvp.hub.core.DecimateHub;
import com.google.common.io.ByteArrayDataOutput;
import com.google.common.io.ByteStreams;
public class JoinTestServerCommand implements CommandExecutor {
@Override
public boolean onCommand(CommandSender arg0, Command arg1, String arg2, String[] arg3) {
if(arg0 instanceof Player && arg0.isOp()){
if(arg3.length == 0){
send((Player)arg0);
}else{
try{
Player player = Bukkit.getServer().getPlayer(arg3[0]);
send(player);
}catch(Exception ex){
arg0.sendMessage(ChatColor.RED + "Player not found.");
}
}
}else{
arg0.sendMessage(ChatColor.RED + "You do not have permission to use this command.");
}
return false;
}
private void send(Player player){
ByteArrayDataOutput out = ByteStreams.newDataOutput();
out.writeUTF("Connect");
out.writeUTF("test");
player.sendPluginMessage(DecimateHub.getInstance(), "BungeeCord", out.toByteArray());
}
}
| 1,207 | 0.729909 | 0.719138 | 46 | 25.23913 | 25.082632 | 89 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.086957 | false | false |
12
|
402955d59c2dd1f9588182e34657509c707a09c5
| 11,501,922,438,733 |
51041bbb465dbb174164434d8f5844cded5466ec
|
/skiworld/skiworld-ejb/src/main/java/Service/EquipementSkierEJBRemote.java
|
0b68d4f6dfaa0b0afa9e995349e8769bcf7516f3
|
[] |
no_license
|
idluom/worldServer
|
https://github.com/idluom/worldServer
|
3df669d7152c553b4d0f66cdd03965e052744593
|
f47ffd61db67ab18f915c545af9aeceeaf611949
|
refs/heads/master
| 2021-06-17T18:20:06.478000 | 2017-05-18T21:13:30 | 2017-05-18T21:13:30 | 83,998,102 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package Service;
import javax.ejb.Remote;
import Entity.EquipementSkier;
@Remote
public interface EquipementSkierEJBRemote {
public void addEquipmentSkier(EquipementSkier E);
public void deleteEquipementSkier(EquipementSkier E);
public void updateEquipementSkier(EquipementSkier E);
public EquipementSkier findEquipementSkierById(Long id);
}
|
UTF-8
|
Java
| 360 |
java
|
EquipementSkierEJBRemote.java
|
Java
|
[] | null |
[] |
package Service;
import javax.ejb.Remote;
import Entity.EquipementSkier;
@Remote
public interface EquipementSkierEJBRemote {
public void addEquipmentSkier(EquipementSkier E);
public void deleteEquipementSkier(EquipementSkier E);
public void updateEquipementSkier(EquipementSkier E);
public EquipementSkier findEquipementSkierById(Long id);
}
| 360 | 0.813889 | 0.813889 | 14 | 23.714285 | 22.22106 | 56 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.5 | false | false |
12
|
c4461dcb83eafb0c23c3bc7826265eac22baf705
| 4,982,162,085,842 |
d190e39ed3bd1c2c73cff57441ff345d20359b97
|
/01_java/src/ch04_repetition/exam/Quiz05.java
|
e898b7252feed6a917c27a1c692f538a9210aef8
|
[] |
no_license
|
odh3126/project
|
https://github.com/odh3126/project
|
728d85512607a43e5913a41a49812a6d0346d2d2
|
ebe2456efb473e9dadb3a253699a1888b6907e39
|
refs/heads/master
| 2021-06-20T13:52:53.520000 | 2019-09-02T15:23:10 | 2019-09-02T15:23:10 | 197,679,699 | 0 | 0 | null | false | 2021-04-22T19:23:43 | 2019-07-19T01:23:49 | 2019-09-02T15:23:17 | 2021-04-22T19:23:43 | 16,137 | 0 | 0 | 2 |
Java
| false | false |
/**
화면에서 수를 입력받고 입력받은 수가 몇자리인지 출력하는 프로그램을 작성하시오
입력 : 8722
8722은 4자리입니다.
입력 : 872
872은 3자리입니다.
*/
package ch04_repetition.exam;
public class Quiz05 {
public static void main(String[] args) {
}
}
|
UTF-8
|
Java
| 326 |
java
|
Quiz05.java
|
Java
|
[] | null |
[] |
/**
화면에서 수를 입력받고 입력받은 수가 몇자리인지 출력하는 프로그램을 작성하시오
입력 : 8722
8722은 4자리입니다.
입력 : 872
872은 3자리입니다.
*/
package ch04_repetition.exam;
public class Quiz05 {
public static void main(String[] args) {
}
}
| 326 | 0.620536 | 0.53125 | 16 | 12 | 14.066805 | 44 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.625 | false | false |
12
|
e31291dab5f72eb1801db313c01ea3cd1772a545
| 28,123,445,872,488 |
02becaf7316be858dda32f162fecfc2a8dc0c1c7
|
/src/main/java/com/commandcenter/common/schedule/LogAnalyseDealSchedule.java
|
9e59ab1661bda75bc33eea96fd173d8f42d8b693
|
[] |
no_license
|
Alanbobo/mpa
|
https://github.com/Alanbobo/mpa
|
37bd185c4c2057837689737e6f028306a74167fa
|
1f6604e3475ec4c23c816ff65656add09a5082fb
|
refs/heads/master
| 2023-04-07T05:02:40.806000 | 2021-04-17T07:09:15 | 2021-04-17T07:09:15 | 358,807,942 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.commandcenter.common.schedule;
import com.commandcenter.common.utils.DateUtil;
import com.commandcenter.common.utils.SmtUtils;
import com.commandcenter.model.logmodel.MpaLogAnalyse;
import com.commandcenter.service.logservice.MpaLogAnalyseService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.util.ResourceUtils;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.net.URLDecoder;
import java.util.*;
/**
* @author r25437
* @create 2018-12-26 9:03
* @desc 调用日志处理后台进程,每天凌晨1点开始处理
**/
@Component
public class LogAnalyseDealSchedule {
protected static Logger logger = LoggerFactory.getLogger(LogAnalyseDealSchedule.class);
@Value("${logback.logdir}")
private String logbackDir;
@Value("${loganalyseschedule.enable}")
private String scheduledEnable;
@Autowired
private MpaLogAnalyseService mpaLogAnalyseService;
@Autowired
private SmtUtils smtUtils;
@Scheduled(cron = "${cron.log.time}")
public void logAnalyseScheduled(){
if(!Boolean.parseBoolean(scheduledEnable)){
return;
}
//强行写次日志,以防日期切换后,无人调用服务,日志未切分的问题
logger.info("logAnalyseScheduled consumeTime = 10 ms ,userName=null" );
FileReader fr = null;
BufferedReader br = null;
try {
//File path = new File(URLDecoder.decode(ResourceUtils.getURL("classpath:").getPath(), "utf-8"));
//String logPath = path.getParentFile().getParentFile().getParentFile().getParentFile().getAbsolutePath()+"\\logs\\mpa\\info";
String logPath = logbackDir+"/info";
logger.info("logAnalyseScheduled path=="+logbackDir+",logPath=="+logPath);
//logger.info("logAnalyseScheduled path=="+path+",logPath=="+logPath);
File fileDir = new File(logPath);
if(!fileDir.exists() || fileDir.isFile()){
return;
}
//logger.info("logAnalyseScheduled path=="+path+",logPath=="+logPath+",fileDir.listFiles.length=="+fileDir.listFiles().length);
logger.info("logAnalyseScheduled path=="+logbackDir+",logPath=="+logPath+",fileDir.listFiles.length=="+fileDir.listFiles().length);
Date yesterday = DateUtil.addDay(new Date(), -1);
String yesterDayStr = DateUtil.format(yesterday);
List<MpaLogAnalyse> mpaLogAnalyseList = new ArrayList<>();
for(File file:fileDir.listFiles()){
//如果是昨天的文件,进行处理
if(file.getName().contains("consumeTimeLog") && file.getName().contains(yesterDayStr)){
fr = new FileReader(file);
br = new BufferedReader(fr);
String str2 = br.readLine();
while(str2 != null) {
StringBuilder sBuilder = new StringBuilder();
MpaLogAnalyse mpaLogAnalyse = new MpaLogAnalyse();
String[] str = str2.split(" ");
sBuilder.append(str[0]).append(" ").append(str[1]);
String dateStr = sBuilder.toString();
String interName = str[4].substring(1,str[4].length()-1);
String[] splitStr = str[str.length-1].split("=");
String staffGuid = "";
if(splitStr.length>1){
staffGuid = splitStr[1];
}
if(interName!=null && !"".equals(interName.trim())) {
mpaLogAnalyse.setLogTime(yesterDayStr);
mpaLogAnalyse.setOpName(interName);
mpaLogAnalyse.setOpStaff(staffGuid);
mpaLogAnalyse.setOpTime(DateUtil.parse(dateStr, "yyyy-MM-dd HH:mm:ss"));
mpaLogAnalyseList.add(mpaLogAnalyse);
}
System.out.println("dateStr============"+dateStr+",interName ================== "+interName + "," + staffGuid);
str2 = br.readLine();
}
fr.close();
br.close();
}
}
//先删除logtime是昨天的数据,即先删除后插入。以防止重复处理
mpaLogAnalyseService.deleteMpaLogAnalyseByLogTime(yesterDayStr);
mpaLogAnalyseList.stream().forEach(mpaLogAnalyseService::insertNonEmptyMpaLogAnalyse);
for(MpaLogAnalyse t : mpaLogAnalyseList) {
smtUtils.sendFuncMessage(t.getOpName(), DateUtil.format(t.getOpTime(), DateUtil.getFullDateTimePattern()));
}
//logger.info("path:" + path.getParentFile().getParentFile().getParentFile().getParentFile().getAbsolutePath()+"\\logs\\mpa\\info");
logger.info("path:" + logbackDir+"/info");
}catch (Exception e){
e.printStackTrace();
}finally {
try {
if (fr != null) {
fr.close();
}
if(br != null){
br.close();
}
}catch (Exception e){
e.printStackTrace();
}
}
}
}
|
UTF-8
|
Java
| 5,632 |
java
|
LogAnalyseDealSchedule.java
|
Java
|
[
{
"context": "et.URLDecoder;\nimport java.util.*;\n\n/**\n * @author r25437\n * @create 2018-12-26 9:03\n * @desc 调用日志处理后台进程,每天",
"end": 746,
"score": 0.9993556141853333,
"start": 740,
"tag": "USERNAME",
"value": "r25437"
}
] | null |
[] |
package com.commandcenter.common.schedule;
import com.commandcenter.common.utils.DateUtil;
import com.commandcenter.common.utils.SmtUtils;
import com.commandcenter.model.logmodel.MpaLogAnalyse;
import com.commandcenter.service.logservice.MpaLogAnalyseService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.util.ResourceUtils;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.net.URLDecoder;
import java.util.*;
/**
* @author r25437
* @create 2018-12-26 9:03
* @desc 调用日志处理后台进程,每天凌晨1点开始处理
**/
@Component
public class LogAnalyseDealSchedule {
protected static Logger logger = LoggerFactory.getLogger(LogAnalyseDealSchedule.class);
@Value("${logback.logdir}")
private String logbackDir;
@Value("${loganalyseschedule.enable}")
private String scheduledEnable;
@Autowired
private MpaLogAnalyseService mpaLogAnalyseService;
@Autowired
private SmtUtils smtUtils;
@Scheduled(cron = "${cron.log.time}")
public void logAnalyseScheduled(){
if(!Boolean.parseBoolean(scheduledEnable)){
return;
}
//强行写次日志,以防日期切换后,无人调用服务,日志未切分的问题
logger.info("logAnalyseScheduled consumeTime = 10 ms ,userName=null" );
FileReader fr = null;
BufferedReader br = null;
try {
//File path = new File(URLDecoder.decode(ResourceUtils.getURL("classpath:").getPath(), "utf-8"));
//String logPath = path.getParentFile().getParentFile().getParentFile().getParentFile().getAbsolutePath()+"\\logs\\mpa\\info";
String logPath = logbackDir+"/info";
logger.info("logAnalyseScheduled path=="+logbackDir+",logPath=="+logPath);
//logger.info("logAnalyseScheduled path=="+path+",logPath=="+logPath);
File fileDir = new File(logPath);
if(!fileDir.exists() || fileDir.isFile()){
return;
}
//logger.info("logAnalyseScheduled path=="+path+",logPath=="+logPath+",fileDir.listFiles.length=="+fileDir.listFiles().length);
logger.info("logAnalyseScheduled path=="+logbackDir+",logPath=="+logPath+",fileDir.listFiles.length=="+fileDir.listFiles().length);
Date yesterday = DateUtil.addDay(new Date(), -1);
String yesterDayStr = DateUtil.format(yesterday);
List<MpaLogAnalyse> mpaLogAnalyseList = new ArrayList<>();
for(File file:fileDir.listFiles()){
//如果是昨天的文件,进行处理
if(file.getName().contains("consumeTimeLog") && file.getName().contains(yesterDayStr)){
fr = new FileReader(file);
br = new BufferedReader(fr);
String str2 = br.readLine();
while(str2 != null) {
StringBuilder sBuilder = new StringBuilder();
MpaLogAnalyse mpaLogAnalyse = new MpaLogAnalyse();
String[] str = str2.split(" ");
sBuilder.append(str[0]).append(" ").append(str[1]);
String dateStr = sBuilder.toString();
String interName = str[4].substring(1,str[4].length()-1);
String[] splitStr = str[str.length-1].split("=");
String staffGuid = "";
if(splitStr.length>1){
staffGuid = splitStr[1];
}
if(interName!=null && !"".equals(interName.trim())) {
mpaLogAnalyse.setLogTime(yesterDayStr);
mpaLogAnalyse.setOpName(interName);
mpaLogAnalyse.setOpStaff(staffGuid);
mpaLogAnalyse.setOpTime(DateUtil.parse(dateStr, "yyyy-MM-dd HH:mm:ss"));
mpaLogAnalyseList.add(mpaLogAnalyse);
}
System.out.println("dateStr============"+dateStr+",interName ================== "+interName + "," + staffGuid);
str2 = br.readLine();
}
fr.close();
br.close();
}
}
//先删除logtime是昨天的数据,即先删除后插入。以防止重复处理
mpaLogAnalyseService.deleteMpaLogAnalyseByLogTime(yesterDayStr);
mpaLogAnalyseList.stream().forEach(mpaLogAnalyseService::insertNonEmptyMpaLogAnalyse);
for(MpaLogAnalyse t : mpaLogAnalyseList) {
smtUtils.sendFuncMessage(t.getOpName(), DateUtil.format(t.getOpTime(), DateUtil.getFullDateTimePattern()));
}
//logger.info("path:" + path.getParentFile().getParentFile().getParentFile().getParentFile().getAbsolutePath()+"\\logs\\mpa\\info");
logger.info("path:" + logbackDir+"/info");
}catch (Exception e){
e.printStackTrace();
}finally {
try {
if (fr != null) {
fr.close();
}
if(br != null){
br.close();
}
}catch (Exception e){
e.printStackTrace();
}
}
}
}
| 5,632 | 0.576979 | 0.570381 | 123 | 43.357723 | 32.934063 | 144 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.691057 | false | false |
12
|
f4719d645d8a9a677c4bc1d355c8272a930446ef
| 5,892,695,158,350 |
7e7f5e87b311c984790520d4a18e890e340d1ca6
|
/FXController.java
|
8922e0c042bf33f2d7c86e3eb90814ee17818621
|
[] |
no_license
|
royglez/proyecto-tesis
|
https://github.com/royglez/proyecto-tesis
|
1b81eae82d30c03de07404f9cb2cabd545d1eeba
|
11389d688a74b0f6766aad044eae8a7728216426
|
refs/heads/master
| 2021-01-10T20:01:14.471000 | 2013-11-08T23:25:51 | 2013-11-08T23:25:51 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package application;
import org.opencv.core.Mat;
import org.opencv.core.Rect;
import facefinder.ImageSource;
import facefinder.ObjectsFinder;
import javafx.animation.AnimationTimer;
import javafx.application.Application;
import javafx.beans.property.SimpleObjectProperty;
import javafx.embed.swing.SwingFXUtils;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.control.Label;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.paint.Color;
import javafx.stage.Stage;
public class FXController extends Application {
SimpleObjectProperty<Image> imageProperty = new SimpleObjectProperty<Image>();
ObjectsFinder faceFinder = new ObjectsFinder(System.getProperty("user.dir") + "/resources/haarcascade_frontalface_alt.xml");
ObjectsFinder eyeFinder = new ObjectsFinder(System.getProperty("user.dir") + "/resources/haarcascade_lefteye_2splits.xml");
@FXML private ImageView imagePanel;
@FXML private Label leftEyeLbl;
@FXML private Label rightEyeLbl;
private AnimationTimer cameraImages = new AnimationTimer() {
@Override
public void handle(long arg0) {
Mat img = ImageSource.getInstance().getImage();
if(img != null) {
faceFinder.findObject(img);
if(faceFinder.getDetectedObject()){
Mat leftFace = new Mat(faceFinder.getROI(), new Rect(0,0,faceFinder.getROI().width()/2,faceFinder.getROI().height()/2));
Mat rightFace = new Mat(faceFinder.getROI(), new Rect(faceFinder.getROI().width()/2,0,faceFinder.getROI().width()/2,faceFinder.getROI().height()/2));
eyeFinder.findObject(leftFace);
if(eyeFinder.getDetectedObject() == true){
leftEyeLbl.textProperty().set("Open");
leftEyeLbl.setTextFill(Color.web("#33FF33"));
}else{
leftEyeLbl.textProperty().set("Closed");
leftEyeLbl.setTextFill(Color.web("#990000"));
}
eyeFinder.findObject(rightFace);
if(eyeFinder.getDetectedObject() == true){
rightEyeLbl.textProperty().set("Open");
rightEyeLbl.setTextFill(Color.web("#33FF33"));
}else{
rightEyeLbl.textProperty().set("Closed");
rightEyeLbl.setTextFill(Color.web("#990000"));
}
Image image = SwingFXUtils.toFXImage(ImageSource.matToBufferedImage(img), null); //Convert from BufferedImage to FX Image
setImage(image);
}
}
}
};
public final void setImage(Image img){
imageProperty.set(img);
}
@FXML protected void handleShowImageBtn(ActionEvent event) {
imagePanel.imageProperty().bind(imageProperty);
this.faceFinder.setScaleFactor(1.9);
this.faceFinder.setMinNeighbors(3);
this.faceFinder.setMinSizeFactor(30);
this.faceFinder.setMaxSizeFactor(1.8);
this.eyeFinder.setScaleFactor(3);
this.eyeFinder.setMinNeighbors(2);
this.eyeFinder.setMinSizeFactor(80);
this.eyeFinder.setMaxSizeFactor(2);
this.cameraImages.start();
}
@FXML protected void handleCalibrateImageBtn(ActionEvent event) {
System.out.println("Calibrate Image");
}
@Override
public void start(Stage arg0) throws Exception {
}
}
|
UTF-8
|
Java
| 3,083 |
java
|
FXController.java
|
Java
|
[] | null |
[] |
package application;
import org.opencv.core.Mat;
import org.opencv.core.Rect;
import facefinder.ImageSource;
import facefinder.ObjectsFinder;
import javafx.animation.AnimationTimer;
import javafx.application.Application;
import javafx.beans.property.SimpleObjectProperty;
import javafx.embed.swing.SwingFXUtils;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.control.Label;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.paint.Color;
import javafx.stage.Stage;
public class FXController extends Application {
SimpleObjectProperty<Image> imageProperty = new SimpleObjectProperty<Image>();
ObjectsFinder faceFinder = new ObjectsFinder(System.getProperty("user.dir") + "/resources/haarcascade_frontalface_alt.xml");
ObjectsFinder eyeFinder = new ObjectsFinder(System.getProperty("user.dir") + "/resources/haarcascade_lefteye_2splits.xml");
@FXML private ImageView imagePanel;
@FXML private Label leftEyeLbl;
@FXML private Label rightEyeLbl;
private AnimationTimer cameraImages = new AnimationTimer() {
@Override
public void handle(long arg0) {
Mat img = ImageSource.getInstance().getImage();
if(img != null) {
faceFinder.findObject(img);
if(faceFinder.getDetectedObject()){
Mat leftFace = new Mat(faceFinder.getROI(), new Rect(0,0,faceFinder.getROI().width()/2,faceFinder.getROI().height()/2));
Mat rightFace = new Mat(faceFinder.getROI(), new Rect(faceFinder.getROI().width()/2,0,faceFinder.getROI().width()/2,faceFinder.getROI().height()/2));
eyeFinder.findObject(leftFace);
if(eyeFinder.getDetectedObject() == true){
leftEyeLbl.textProperty().set("Open");
leftEyeLbl.setTextFill(Color.web("#33FF33"));
}else{
leftEyeLbl.textProperty().set("Closed");
leftEyeLbl.setTextFill(Color.web("#990000"));
}
eyeFinder.findObject(rightFace);
if(eyeFinder.getDetectedObject() == true){
rightEyeLbl.textProperty().set("Open");
rightEyeLbl.setTextFill(Color.web("#33FF33"));
}else{
rightEyeLbl.textProperty().set("Closed");
rightEyeLbl.setTextFill(Color.web("#990000"));
}
Image image = SwingFXUtils.toFXImage(ImageSource.matToBufferedImage(img), null); //Convert from BufferedImage to FX Image
setImage(image);
}
}
}
};
public final void setImage(Image img){
imageProperty.set(img);
}
@FXML protected void handleShowImageBtn(ActionEvent event) {
imagePanel.imageProperty().bind(imageProperty);
this.faceFinder.setScaleFactor(1.9);
this.faceFinder.setMinNeighbors(3);
this.faceFinder.setMinSizeFactor(30);
this.faceFinder.setMaxSizeFactor(1.8);
this.eyeFinder.setScaleFactor(3);
this.eyeFinder.setMinNeighbors(2);
this.eyeFinder.setMinSizeFactor(80);
this.eyeFinder.setMaxSizeFactor(2);
this.cameraImages.start();
}
@FXML protected void handleCalibrateImageBtn(ActionEvent event) {
System.out.println("Calibrate Image");
}
@Override
public void start(Stage arg0) throws Exception {
}
}
| 3,083 | 0.731755 | 0.717807 | 97 | 30.783504 | 30.447598 | 154 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.835052 | false | false |
12
|
4a22c4d783c52dcaddc20edf6baf814f63c30dfc
| 5,892,695,155,102 |
4b9b1516d70057f12bd88b9a6c4c7dbddb9ed8fb
|
/irs-maven/src/main/java/com/lpr/dao/SalItemMapper.java
|
a44514ff218e5c8a5523da6de3cf9c518e640f7a
|
[] |
no_license
|
LPRGDDD/OA
|
https://github.com/LPRGDDD/OA
|
071856253ba77fbe26ea34c65b5098dabbeb1de2
|
7c1ff99035b7a6b794c350c1a787b48b0f8b7def
|
refs/heads/master
| 2020-04-01T00:02:23.689000 | 2018-11-13T15:58:13 | 2018-11-13T15:58:13 | 152,174,147 | 0 | 0 | null | false | 2018-10-12T01:37:43 | 2018-10-09T02:17:07 | 2018-10-10T01:15:41 | 2018-10-12T01:37:43 | 6,512 | 0 | 0 | 0 |
JavaScript
| false | null |
package com.lpr.dao;
import java.util.List;
import java.util.Map;
import com.lpr.entity.SalItem;
/**
* 薪酬项目定义表
* @author 刘培然
*
*/
public interface SalItemMapper {
/**
* 根据薪酬编号删除
* @param itemId薪酬编号
* @return
*/
int deleteByPrimaryKey(Integer itemId);
/**
* 薪酬项目定义表添加
* @param record
* @return
*/
int insert(SalItem salitem);
/**
* 薪酬项目定义表添加
* @param record
* @return
*/
int insertSelective(SalItem record);
/**
* 根据薪酬编号查询,编辑之前的查询
* @param itemId薪酬编号
* @return
*/
SalItem selectByPrimaryKey(Integer itemId);
/**
* 薪酬项目定义表修改
* @param record
* @return
*/
int updateByPrimaryKeySelective(SalItem record);
/**
*薪酬项目定义表 修改
* @param record
* @return
*/
int updateByPrimaryKey(SalItem record);
/**
* 薪酬定义表的查询
* @return
*/
public List<Map<String, Object>> findAll();
/**
* 薪酬项目定义表的修改
* @param salitem
* @return
*/
public int update(SalItem salitem);
/**
* 根据薪酬项目编号删除
* @param itemId薪酬编号
* @return
*/
public int delete(int itemId);
}
|
GB18030
|
Java
| 1,443 |
java
|
SalItemMapper.java
|
Java
|
[
{
"context": ".lpr.entity.SalItem;\r\n/**\r\n * 薪酬项目定义表\r\n * @author 刘培然\r\n *\r\n */\r\npublic interface SalItemMapper {\r\n\t/**\r",
"end": 136,
"score": 0.9995806813240051,
"start": 133,
"tag": "NAME",
"value": "刘培然"
}
] | null |
[] |
package com.lpr.dao;
import java.util.List;
import java.util.Map;
import com.lpr.entity.SalItem;
/**
* 薪酬项目定义表
* @author 刘培然
*
*/
public interface SalItemMapper {
/**
* 根据薪酬编号删除
* @param itemId薪酬编号
* @return
*/
int deleteByPrimaryKey(Integer itemId);
/**
* 薪酬项目定义表添加
* @param record
* @return
*/
int insert(SalItem salitem);
/**
* 薪酬项目定义表添加
* @param record
* @return
*/
int insertSelective(SalItem record);
/**
* 根据薪酬编号查询,编辑之前的查询
* @param itemId薪酬编号
* @return
*/
SalItem selectByPrimaryKey(Integer itemId);
/**
* 薪酬项目定义表修改
* @param record
* @return
*/
int updateByPrimaryKeySelective(SalItem record);
/**
*薪酬项目定义表 修改
* @param record
* @return
*/
int updateByPrimaryKey(SalItem record);
/**
* 薪酬定义表的查询
* @return
*/
public List<Map<String, Object>> findAll();
/**
* 薪酬项目定义表的修改
* @param salitem
* @return
*/
public int update(SalItem salitem);
/**
* 根据薪酬项目编号删除
* @param itemId薪酬编号
* @return
*/
public int delete(int itemId);
}
| 1,443 | 0.530612 | 0.530612 | 68 | 16.044117 | 12.544549 | 52 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.294118 | false | false |
12
|
71905f0f8d4c8ec20ae1b017c4c7bc5d00901d75
| 20,151,986,616,891 |
0031ba8b6d46429fd8c91d7218e69e667d2701d7
|
/back/src/main/java/com/ssafy/happyhouse/model/service/MemberService.java
|
9ae74df33ccc2adc925e559c162f3a032cf59927
|
[] |
no_license
|
wnsgml0756/house-web-project
|
https://github.com/wnsgml0756/house-web-project
|
889887be1a219857d342d8d01e660aaa24e46b2e
|
c40c668c5f14bf9e980555cf36b04d71e017ebd5
|
refs/heads/main
| 2023-06-08T00:15:19.954000 | 2021-06-18T07:16:53 | 2021-06-18T07:16:53 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.ssafy.happyhouse.model.service;
import java.util.List;
import java.util.Map;
import com.ssafy.happyhouse.model.HouseDeal;
import com.ssafy.happyhouse.model.MemberDto;
public interface MemberService {
// 로그인
public MemberDto login(MemberDto memberDto) throws Exception;
public int memberRegister(MemberDto memberDto);
public int memberModify(MemberDto memberDto);
public int memberDelete(String userid);
public List<MemberDto> memberList();
public MemberDto memberInfo(String userid);
public String memberFind(Map<String, String> map);
public int memberLike(String userid, String dealno);
public List<HouseDeal> getLike(String userid);
}
|
UTF-8
|
Java
| 698 |
java
|
MemberService.java
|
Java
|
[] | null |
[] |
package com.ssafy.happyhouse.model.service;
import java.util.List;
import java.util.Map;
import com.ssafy.happyhouse.model.HouseDeal;
import com.ssafy.happyhouse.model.MemberDto;
public interface MemberService {
// 로그인
public MemberDto login(MemberDto memberDto) throws Exception;
public int memberRegister(MemberDto memberDto);
public int memberModify(MemberDto memberDto);
public int memberDelete(String userid);
public List<MemberDto> memberList();
public MemberDto memberInfo(String userid);
public String memberFind(Map<String, String> map);
public int memberLike(String userid, String dealno);
public List<HouseDeal> getLike(String userid);
}
| 698 | 0.768786 | 0.768786 | 25 | 25.68 | 21.917519 | 62 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.08 | false | false |
12
|
0bd8ac01a393b8c0c96e86546e38f2adec57d198
| 37,125,697,313,830 |
c9befdd8b64f8414375fb75d99f01eb6684d679d
|
/Lab1/es3/Main.java
|
c06230642776698d65c6d75fbd0d859a03b5ea70
|
[] |
no_license
|
sia4/flc_labs
|
https://github.com/sia4/flc_labs
|
31ae8c4bf8a41906e1226697dd767f9491652e62
|
dd898dda931fad0342d8a583dbfe4427b2cd9a09
|
refs/heads/master
| 2020-03-20T07:15:33.663000 | 2018-06-14T08:17:18 | 2018-06-14T08:17:18 | 137,276,446 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
import java.io.*;
import java.lang.*;
class Es3 {
public static void main(String argv[]) {
if (argv.length == 0) {
System.out.println("Usage : java Yylex <inputfile>");
}
else {
/* Header html */
System.out.println("<HTML>");
System.out.println("<BODY bgcolor = #FFFFFF>");
for (int i = 0; i < argv.length; i++) {
/* 1 - Scanner declaration */
Yylex scanner = null;
try {
/* Write the page title and open the <code> tag */
System.out.println("<H2>"+argv[0]+"</H2>");
System.out.println("<CODE>");
/* 2 - scanner = new Yylex() -> Scanner instantiation using the constructor Yylex()
3 - new java.io.FileReader(argv[i]) -> Pass to the scanner the file to be scanned */
scanner = new Yylex( new java.io.FileReader(argv[i]) );
/* 4 - Scan file until the end of file is reached: in this case
function yylex() returns Yylex.YYEOF
IMP: The function yylex returns an integer constant because in the .jflex file the directive
%integer was used, otherwise yylex returns a class of type YyToken */
while ( scanner.yylex() != Yylex.YYEOF );
/* Chiude il tag <code> */
System.out.println("</CODE>");
}
catch (java.io.FileNotFoundException e) {
System.out.println("File not found : \"" + argv[i] + "\"");
}
catch (java.io.IOException e) {
System.out.println("IO error scanning file \"" + argv[i] + "\"");
System.out.println(e);
}
catch (Exception e) {
System.out.println("Unexpected exception:");
e.printStackTrace();
}
}
/* Footer Html */
System.out.println("</BODY>");
System.out.println("</HTML>");
}
}
}
|
UTF-8
|
Java
| 2,167 |
java
|
Main.java
|
Java
|
[] | null |
[] |
import java.io.*;
import java.lang.*;
class Es3 {
public static void main(String argv[]) {
if (argv.length == 0) {
System.out.println("Usage : java Yylex <inputfile>");
}
else {
/* Header html */
System.out.println("<HTML>");
System.out.println("<BODY bgcolor = #FFFFFF>");
for (int i = 0; i < argv.length; i++) {
/* 1 - Scanner declaration */
Yylex scanner = null;
try {
/* Write the page title and open the <code> tag */
System.out.println("<H2>"+argv[0]+"</H2>");
System.out.println("<CODE>");
/* 2 - scanner = new Yylex() -> Scanner instantiation using the constructor Yylex()
3 - new java.io.FileReader(argv[i]) -> Pass to the scanner the file to be scanned */
scanner = new Yylex( new java.io.FileReader(argv[i]) );
/* 4 - Scan file until the end of file is reached: in this case
function yylex() returns Yylex.YYEOF
IMP: The function yylex returns an integer constant because in the .jflex file the directive
%integer was used, otherwise yylex returns a class of type YyToken */
while ( scanner.yylex() != Yylex.YYEOF );
/* Chiude il tag <code> */
System.out.println("</CODE>");
}
catch (java.io.FileNotFoundException e) {
System.out.println("File not found : \"" + argv[i] + "\"");
}
catch (java.io.IOException e) {
System.out.println("IO error scanning file \"" + argv[i] + "\"");
System.out.println(e);
}
catch (Exception e) {
System.out.println("Unexpected exception:");
e.printStackTrace();
}
}
/* Footer Html */
System.out.println("</BODY>");
System.out.println("</HTML>");
}
}
}
| 2,167 | 0.464698 | 0.460083 | 50 | 42.34 | 29.089249 | 112 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.42 | false | false |
12
|
9e6d016aa2bebc506b79340d809fc95e136904e5
| 28,999,619,243,822 |
5bb4621fff4147c0ef8a93086dc9d48acd350e40
|
/src/com/threedr/thomasci/Inventory.java
|
22be8f45278bcef40ed21d91f56b518366c8efb3
|
[
"MIT"
] |
permissive
|
ChrisIThomas/3DR
|
https://github.com/ChrisIThomas/3DR
|
43848dbc195fd54fcd83b03caba7e3a0f384633f
|
f934dcd598a3c4b31b191a5bf66100faa148875e
|
refs/heads/master
| 2020-12-02T05:27:21.073000 | 2017-08-09T09:38:58 | 2017-08-09T09:38:58 | 71,781,613 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.threedr.thomasci;
public class Inventory {
private Item[] gear;
private int coins;
private boolean alchemy;
private int health = 0, speed = 0, aspeed = 0;
//0-7 armor
//8-11 hotbar
//12-21 inventory slots
//22-26 alchemy slots
//27-30 quiver slots
public Inventory() {
gear = new Item[31];
coins = 0;
//armour
/*gear[0] = Item.newItem(0, "Def");
((ItemWearable) gear[0]).setColour(0.45f, 0.25f, 0.0f);
gear[1] = Item.newItem(1, "Def");
((ItemWearable) gear[1]).setColour(0.95f, 0.95f, 0.95f);
gear[2] = Item.newItem(8, "Def");
gear[3] = Item.newItem(2, "Def");
((ItemWearable) gear[3]).setColour(0.85f, 0.85f, 0.85f);
gear[4] = Item.newItem(3, "Def");
((ItemWearable) gear[4]).setColour(0.15f, 0.45f, 0.15f);
gear[5] = Item.newItem(5, "Def");
((ItemWearable) gear[5]).setColour(0.15f, 0.45f, 0.15f);*/
}
public void update() {
for (int i = 0; i < gear.length; i++) {
if (gear[i] != null) {
if (gear[i].shouldDelete()) gear[i] = null;
}
}
}
public Item getItem(int slot) {
return gear[slot];
}
public Item[] getItems() {
return gear;
}
public void changeCoins(int count) {
coins += count;
}
public void setCoins(int num) {
coins = num;
}
public int getCoins() {
return coins;
}
//this will return the slot the item is in
public int hasItem(int type) {
for (int i = 0; i < gear.length; i++) {
if (gear[i] != null) {
if (gear[i].getID() == type) {
return i;
}
}
}
return -1;
}
public void setItem(Item i, int slot) {
if (slot >= 0 && slot < 31) {
if (slot <= 7) {
if (i instanceof ItemWearable) {
if (((ItemWearable) i).getSlot() == slot) {
gear[slot] = i;
}
} else if (i == null) {
gear[slot] = i;
}
health = 0;
} else {
gear[slot] = i;
}
alchemy = false;
for (int k = 0; k < gear.length; k++) {
if (gear[k] != null) {
if (gear[k].getID() == 23) {
alchemy = true;
break;
}
}
}
}
health = 0;
aspeed = 0;
speed = 0;
for (int j = 0; j < 8; j++) {
if (gear[j] != null) {
if (gear[j].getEnchantments() != null) {
health += gear[j].getEnchantments().getAmount(8);
aspeed += gear[j].getEnchantments().getAmount(7);
speed += gear[j].getEnchantments().getAmount(6);
}
}
}
}
public Item putItem(Item i) {
for (int k = 0; k < 14; k++) {
if (gear[k + 8] == null) {
gear[k + 8] = i;
return null;
}
}
return i;
}
public String write() {
String inv = "";
for (int i = 0; i < gear.length; i++) {
System.out.println(i);
if (gear[i] != null) {
inv += gear[i].write();
}
if (i < gear.length - 1) inv += ",";
}
return inv;
}
public static Inventory createInventory(String idata) {
Inventory inv = new Inventory();
String[] dat = idata.split(",");
for (int i = 0; i < dat.length; i++) {
if (dat[i].length() != 0) {
System.out.println(i);
inv.setItem(Item.createItem(dat[i]), i);
}
}
return inv;
}
public boolean hasAlchemy() {
return alchemy;
}
public boolean hasQuiver() {
if (gear[7] != null) {
return gear[7].getID() == 33;
}
return false;
}
public int getHealth() {
return health;
}
public int getSpeed() {
return speed;
}
public int getASpeed() {
return aspeed;
}
}
|
UTF-8
|
Java
| 3,338 |
java
|
Inventory.java
|
Java
|
[] | null |
[] |
package com.threedr.thomasci;
public class Inventory {
private Item[] gear;
private int coins;
private boolean alchemy;
private int health = 0, speed = 0, aspeed = 0;
//0-7 armor
//8-11 hotbar
//12-21 inventory slots
//22-26 alchemy slots
//27-30 quiver slots
public Inventory() {
gear = new Item[31];
coins = 0;
//armour
/*gear[0] = Item.newItem(0, "Def");
((ItemWearable) gear[0]).setColour(0.45f, 0.25f, 0.0f);
gear[1] = Item.newItem(1, "Def");
((ItemWearable) gear[1]).setColour(0.95f, 0.95f, 0.95f);
gear[2] = Item.newItem(8, "Def");
gear[3] = Item.newItem(2, "Def");
((ItemWearable) gear[3]).setColour(0.85f, 0.85f, 0.85f);
gear[4] = Item.newItem(3, "Def");
((ItemWearable) gear[4]).setColour(0.15f, 0.45f, 0.15f);
gear[5] = Item.newItem(5, "Def");
((ItemWearable) gear[5]).setColour(0.15f, 0.45f, 0.15f);*/
}
public void update() {
for (int i = 0; i < gear.length; i++) {
if (gear[i] != null) {
if (gear[i].shouldDelete()) gear[i] = null;
}
}
}
public Item getItem(int slot) {
return gear[slot];
}
public Item[] getItems() {
return gear;
}
public void changeCoins(int count) {
coins += count;
}
public void setCoins(int num) {
coins = num;
}
public int getCoins() {
return coins;
}
//this will return the slot the item is in
public int hasItem(int type) {
for (int i = 0; i < gear.length; i++) {
if (gear[i] != null) {
if (gear[i].getID() == type) {
return i;
}
}
}
return -1;
}
public void setItem(Item i, int slot) {
if (slot >= 0 && slot < 31) {
if (slot <= 7) {
if (i instanceof ItemWearable) {
if (((ItemWearable) i).getSlot() == slot) {
gear[slot] = i;
}
} else if (i == null) {
gear[slot] = i;
}
health = 0;
} else {
gear[slot] = i;
}
alchemy = false;
for (int k = 0; k < gear.length; k++) {
if (gear[k] != null) {
if (gear[k].getID() == 23) {
alchemy = true;
break;
}
}
}
}
health = 0;
aspeed = 0;
speed = 0;
for (int j = 0; j < 8; j++) {
if (gear[j] != null) {
if (gear[j].getEnchantments() != null) {
health += gear[j].getEnchantments().getAmount(8);
aspeed += gear[j].getEnchantments().getAmount(7);
speed += gear[j].getEnchantments().getAmount(6);
}
}
}
}
public Item putItem(Item i) {
for (int k = 0; k < 14; k++) {
if (gear[k + 8] == null) {
gear[k + 8] = i;
return null;
}
}
return i;
}
public String write() {
String inv = "";
for (int i = 0; i < gear.length; i++) {
System.out.println(i);
if (gear[i] != null) {
inv += gear[i].write();
}
if (i < gear.length - 1) inv += ",";
}
return inv;
}
public static Inventory createInventory(String idata) {
Inventory inv = new Inventory();
String[] dat = idata.split(",");
for (int i = 0; i < dat.length; i++) {
if (dat[i].length() != 0) {
System.out.println(i);
inv.setItem(Item.createItem(dat[i]), i);
}
}
return inv;
}
public boolean hasAlchemy() {
return alchemy;
}
public boolean hasQuiver() {
if (gear[7] != null) {
return gear[7].getID() == 33;
}
return false;
}
public int getHealth() {
return health;
}
public int getSpeed() {
return speed;
}
public int getASpeed() {
return aspeed;
}
}
| 3,338 | 0.550929 | 0.516177 | 166 | 19.108435 | 16.076258 | 60 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.728916 | false | false |
12
|
a25ced186df896c7e5b142ecf645164a13f4f0db
| 36,679,020,734,474 |
a7555ed95f4347f69e11191fb464356ba86cc5d8
|
/appky-application/src/main/java/org/lorislab/appky/application/model/UserProfile.java
|
e6d793906881fa6984ee7b8c1a44d8f4df844890
|
[
"Apache-2.0"
] |
permissive
|
lorislab-archived/appky
|
https://github.com/lorislab-archived/appky
|
d20c597def9054401a7830bc699a11bed45bcc34
|
9280b3a166471fdd1488a163fff3e5c9186c53f9
|
refs/heads/master
| 2021-05-29T08:12:01.612000 | 2014-06-27T20:53:41 | 2014-06-27T20:53:41 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
/*
* Copyright 2014 lorislab.org.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.lorislab.appky.application.model;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import javax.persistence.*;
import org.lorislab.jel.jpa.model.TraceablePersistent;
/**
* The user profile.
*
* @author Andrej Petras <andrej@ajka-andrej.com>
*/
@Entity
@Table(name = "AY_USER_PROFILE")
public class UserProfile extends TraceablePersistent {
/**
* The UID for this class.
*/
private static final long serialVersionUID = 5745546844622663915L;
/**
* The first name.
*/
@Column(name = "C_FIRSTNAME")
private String firstName;
/**
* The middle name.
*/
@Column(name = "C_MIDDLENAME")
private String middleName;
/**
* The last name.
*/
@Column(name = "C_LASTNAME")
private String lastName;
/**
* The enabled flag.
*/
@Column(name = "C_ENABLED")
private boolean enabled;
/**
* The deleted flag.
*/
@Column(name = "C_DELETED")
private boolean deleted;
/**
* The email.
*/
@Column(name = "C_EMAIL", unique = true)
private String email;
/**
* The locale.
*/
@Column(name = "C_LANG")
private Locale locale;
/**
* The list of user configuration parameter.
*/
@OneToMany(cascade = CascadeType.ALL, orphanRemoval = true, fetch = FetchType.EAGER)
@OrderColumn(name = "C_INDEX")
@JoinColumn(name = "C_USER_GUID")
private List<UserConfigParam> properties;
/**
* The user roles list.
*/
@ManyToMany(cascade = CascadeType.REFRESH, fetch = FetchType.LAZY)
@JoinTable(name = "AY_USER_ROLES",
uniqueConstraints = {
@UniqueConstraint(columnNames = {"C_USER_ID", "C_ROLE_ID"})},
joinColumns = {
@JoinColumn(name = "C_USER_ID")},
inverseJoinColumns = {
@JoinColumn(name = "C_ROLE_ID")})
private List<Role> roles;
/**
* The default constructor.
*/
public UserProfile() {
properties = new ArrayList<>();
roles = new ArrayList<>();
}
/**
* Gets the locale.
*
* @return the locale.
*/
public Locale getLocale() {
return locale;
}
/**
* Sets the locale.
*
* @param locale the locale.
*/
public void setLocale(Locale locale) {
this.locale = locale;
}
/**
* Returns
* <code>true</code> if the user was deleted.
*
* @return <code>true</code> if the user was deleted.
*/
public boolean isDeleted() {
return deleted;
}
/**
* Sets the deleted flag.
*
* @param deleted the deleted flag.
*/
public void setDeleted(boolean deleted) {
this.deleted = deleted;
}
/**
* Returns
* <code>true</code> if the user was enabled.
*
* @return <code>true</code> if the user was enabled.
*/
public boolean isEnabled() {
return enabled;
}
/**
* Sets the enabled flag.
*
* @param enabled the enabled flag.
*/
public void setEnabled(boolean enabled) {
this.enabled = enabled;
}
/**
* Gets the first name.
*
* @return the first name.
*/
public String getFirstName() {
return firstName;
}
/**
* Sets the first name.
*
* @param firstName the first name.
*/
public void setFirstName(String firstName) {
this.firstName = firstName;
}
/**
* Gets the middle name.
*
* @return the middle name.
*/
public String getMiddleName() {
return middleName;
}
/**
* Sets the middle name.
*
* @param middleName the middle name.
*/
public void setMiddleName(String middleName) {
this.middleName = middleName;
}
/**
* Gets the last name.
*
* @return the last name.
*/
public String getLastName() {
return lastName;
}
/**
* Sets the last name.
*
* @param lastName the last name.
*/
public void setLastName(String lastName) {
this.lastName = lastName;
}
/**
* Gets the email.
*
* @return the email.
*/
public String getEmail() {
return email;
}
/**
* Sets the email.
*
* @param email the email.
*/
public void setEmail(String email) {
this.email = email;
}
/**
* Gets the user configuration parameters.
*
* @return the user configuration parameters.
*/
public List<UserConfigParam> getProperties() {
return properties;
}
/**
* Sets the user configuration parameters.
*
* @param properties the user configuration parameters.
*/
public void setProperties(List<UserConfigParam> properties) {
this.properties = properties;
}
/**
* Gets the roles.
*
* @return the roles.
*/
public List<Role> getRoles() {
return roles;
}
/**
* Sets the roles.
*
* @param roles the roles.
*/
public void setRoles(List<Role> roles) {
this.roles = roles;
}
}
|
UTF-8
|
Java
| 5,749 |
java
|
UserProfile.java
|
Java
|
[
{
"context": "ersistent;\n\n/**\n * The user profile.\n *\n * @author Andrej Petras <andrej@ajka-andrej.com>\n */\n@Entity\n@Table(name ",
"end": 857,
"score": 0.9999035000801086,
"start": 844,
"tag": "NAME",
"value": "Andrej Petras"
},
{
"context": " * The user profile.\n *\n * @author Andrej Petras <andrej@ajka-andrej.com>\n */\n@Entity\n@Table(name = \"AY_USER_PROFILE\")\npub",
"end": 881,
"score": 0.9999348521232605,
"start": 859,
"tag": "EMAIL",
"value": "andrej@ajka-andrej.com"
}
] | null |
[] |
/*
* Copyright 2014 lorislab.org.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.lorislab.appky.application.model;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import javax.persistence.*;
import org.lorislab.jel.jpa.model.TraceablePersistent;
/**
* The user profile.
*
* @author <NAME> <<EMAIL>>
*/
@Entity
@Table(name = "AY_USER_PROFILE")
public class UserProfile extends TraceablePersistent {
/**
* The UID for this class.
*/
private static final long serialVersionUID = 5745546844622663915L;
/**
* The first name.
*/
@Column(name = "C_FIRSTNAME")
private String firstName;
/**
* The middle name.
*/
@Column(name = "C_MIDDLENAME")
private String middleName;
/**
* The last name.
*/
@Column(name = "C_LASTNAME")
private String lastName;
/**
* The enabled flag.
*/
@Column(name = "C_ENABLED")
private boolean enabled;
/**
* The deleted flag.
*/
@Column(name = "C_DELETED")
private boolean deleted;
/**
* The email.
*/
@Column(name = "C_EMAIL", unique = true)
private String email;
/**
* The locale.
*/
@Column(name = "C_LANG")
private Locale locale;
/**
* The list of user configuration parameter.
*/
@OneToMany(cascade = CascadeType.ALL, orphanRemoval = true, fetch = FetchType.EAGER)
@OrderColumn(name = "C_INDEX")
@JoinColumn(name = "C_USER_GUID")
private List<UserConfigParam> properties;
/**
* The user roles list.
*/
@ManyToMany(cascade = CascadeType.REFRESH, fetch = FetchType.LAZY)
@JoinTable(name = "AY_USER_ROLES",
uniqueConstraints = {
@UniqueConstraint(columnNames = {"C_USER_ID", "C_ROLE_ID"})},
joinColumns = {
@JoinColumn(name = "C_USER_ID")},
inverseJoinColumns = {
@JoinColumn(name = "C_ROLE_ID")})
private List<Role> roles;
/**
* The default constructor.
*/
public UserProfile() {
properties = new ArrayList<>();
roles = new ArrayList<>();
}
/**
* Gets the locale.
*
* @return the locale.
*/
public Locale getLocale() {
return locale;
}
/**
* Sets the locale.
*
* @param locale the locale.
*/
public void setLocale(Locale locale) {
this.locale = locale;
}
/**
* Returns
* <code>true</code> if the user was deleted.
*
* @return <code>true</code> if the user was deleted.
*/
public boolean isDeleted() {
return deleted;
}
/**
* Sets the deleted flag.
*
* @param deleted the deleted flag.
*/
public void setDeleted(boolean deleted) {
this.deleted = deleted;
}
/**
* Returns
* <code>true</code> if the user was enabled.
*
* @return <code>true</code> if the user was enabled.
*/
public boolean isEnabled() {
return enabled;
}
/**
* Sets the enabled flag.
*
* @param enabled the enabled flag.
*/
public void setEnabled(boolean enabled) {
this.enabled = enabled;
}
/**
* Gets the first name.
*
* @return the first name.
*/
public String getFirstName() {
return firstName;
}
/**
* Sets the first name.
*
* @param firstName the first name.
*/
public void setFirstName(String firstName) {
this.firstName = firstName;
}
/**
* Gets the middle name.
*
* @return the middle name.
*/
public String getMiddleName() {
return middleName;
}
/**
* Sets the middle name.
*
* @param middleName the middle name.
*/
public void setMiddleName(String middleName) {
this.middleName = middleName;
}
/**
* Gets the last name.
*
* @return the last name.
*/
public String getLastName() {
return lastName;
}
/**
* Sets the last name.
*
* @param lastName the last name.
*/
public void setLastName(String lastName) {
this.lastName = lastName;
}
/**
* Gets the email.
*
* @return the email.
*/
public String getEmail() {
return email;
}
/**
* Sets the email.
*
* @param email the email.
*/
public void setEmail(String email) {
this.email = email;
}
/**
* Gets the user configuration parameters.
*
* @return the user configuration parameters.
*/
public List<UserConfigParam> getProperties() {
return properties;
}
/**
* Sets the user configuration parameters.
*
* @param properties the user configuration parameters.
*/
public void setProperties(List<UserConfigParam> properties) {
this.properties = properties;
}
/**
* Gets the roles.
*
* @return the roles.
*/
public List<Role> getRoles() {
return roles;
}
/**
* Sets the roles.
*
* @param roles the roles.
*/
public void setRoles(List<Role> roles) {
this.roles = roles;
}
}
| 5,727 | 0.572795 | 0.568099 | 263 | 20.859316 | 18.465443 | 88 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.186312 | false | false |
12
|
28b9e8f91458d70ce1e32a28e3cc6cd88042969a
| 10,101,763,129,813 |
39007837cbf066e0b94e49477101b74d875d43a3
|
/MyWeather/app/src/main/java/com/example/windows10timt/myweather/data/AdapterLayout5.java
|
b4d70eb5b790ceac5dd469b8ba261389ceac2a0e
|
[] |
no_license
|
veovuive/MyProject
|
https://github.com/veovuive/MyProject
|
b49948f3f28292c472c3c6d7c264d7a01fe9b560
|
a18bbed146482c61abb11ddf8488bcfddba03c84
|
refs/heads/master
| 2021-01-11T20:51:00.785000 | 2017-01-17T09:17:30 | 2017-01-17T09:17:30 | 79,196,968 | 0 | 1 | null | false | 2017-01-17T09:22:40 | 2017-01-17T06:37:50 | 2017-01-17T09:04:02 | 2017-01-17T09:21:31 | 0 | 0 | 0 | 1 |
Java
| null | null |
package com.example.windows10timt.myweather.data;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.example.windows10timt.myweather.AdapterMylist;
import com.example.windows10timt.myweather.R;
/**
* Created by Windows 10 TIMT on 12/21/2016.
*/
public class AdapterLayout5 extends RecyclerView.Adapter<AdapterLayout5.MyViewHolder> {
private Atmosphere atmosphere;
private Astronomy astronomy;
public static final int LAYOUT_1 = 0;
public static final int LAYOUT_2 = 1;
public static final int LAYOUT_3 = 2;
public static final int LAYOUT_4 = 3;
public AdapterLayout5(Atmosphere atmosphere, Astronomy astronomy) {
this.atmosphere = atmosphere;
this.astronomy = astronomy;
}
@Override
public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
if (viewType == LAYOUT_1) {
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.row_details_1, parent, false);
return new MyViewHolder(view);
}
if (viewType == LAYOUT_2) {
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.row_details_2, parent, false);
return new MyViewHolder(view);
}
if (viewType == LAYOUT_3) {
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.row_details_3, parent, false);
return new MyViewHolder(view);
}
if (viewType == LAYOUT_4) {
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.row_details_4, parent, false);
return new MyViewHolder(view);
}
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_list_layout, parent, false);
return new MyViewHolder(view);
}
@Override
public void onBindViewHolder(MyViewHolder holder, int position) {
if (getItemViewType(position) == LAYOUT_1){
TextView mHumidity = (TextView) holder.itemView.findViewById(R.id.mHumidity);
String humidity = atmosphere.getHumidity();
mHumidity.setText(humidity+" %");
}
if (getItemViewType(position) == LAYOUT_2){
TextView mVisibility = (TextView) holder.itemView.findViewById(R.id.mVisibility);
String visibility = atmosphere.getVisibility();
mVisibility.setText(visibility+" km");
}
if (getItemViewType(position) == LAYOUT_3){
TextView mSunrise = (TextView) holder.itemView.findViewById(R.id.mSunrise);
String sunrise = astronomy.getSunrise();
mSunrise.setText(sunrise);
}
if (getItemViewType(position) == LAYOUT_4){
TextView mSunset = (TextView) holder.itemView.findViewById(R.id.mSunset);
String sunset = astronomy.getSunset();
mSunset.setText(sunset);
}
}
@Override
public int getItemViewType(int position) {
if (position == 0) {
return LAYOUT_1;
}
if (position == 1) {
return LAYOUT_2;
}
if (position == 2) {
return LAYOUT_3;
}
if (position == 3) {
return LAYOUT_4;
}
return super.getItemViewType(position);
}
@Override
public int getItemCount() {
return 4;
}
public class MyViewHolder extends RecyclerView.ViewHolder {
public MyViewHolder(View itemView) {
super(itemView);
}
}
}
|
UTF-8
|
Java
| 3,626 |
java
|
AdapterLayout5.java
|
Java
|
[] | null |
[] |
package com.example.windows10timt.myweather.data;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.example.windows10timt.myweather.AdapterMylist;
import com.example.windows10timt.myweather.R;
/**
* Created by Windows 10 TIMT on 12/21/2016.
*/
public class AdapterLayout5 extends RecyclerView.Adapter<AdapterLayout5.MyViewHolder> {
private Atmosphere atmosphere;
private Astronomy astronomy;
public static final int LAYOUT_1 = 0;
public static final int LAYOUT_2 = 1;
public static final int LAYOUT_3 = 2;
public static final int LAYOUT_4 = 3;
public AdapterLayout5(Atmosphere atmosphere, Astronomy astronomy) {
this.atmosphere = atmosphere;
this.astronomy = astronomy;
}
@Override
public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
if (viewType == LAYOUT_1) {
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.row_details_1, parent, false);
return new MyViewHolder(view);
}
if (viewType == LAYOUT_2) {
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.row_details_2, parent, false);
return new MyViewHolder(view);
}
if (viewType == LAYOUT_3) {
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.row_details_3, parent, false);
return new MyViewHolder(view);
}
if (viewType == LAYOUT_4) {
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.row_details_4, parent, false);
return new MyViewHolder(view);
}
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_list_layout, parent, false);
return new MyViewHolder(view);
}
@Override
public void onBindViewHolder(MyViewHolder holder, int position) {
if (getItemViewType(position) == LAYOUT_1){
TextView mHumidity = (TextView) holder.itemView.findViewById(R.id.mHumidity);
String humidity = atmosphere.getHumidity();
mHumidity.setText(humidity+" %");
}
if (getItemViewType(position) == LAYOUT_2){
TextView mVisibility = (TextView) holder.itemView.findViewById(R.id.mVisibility);
String visibility = atmosphere.getVisibility();
mVisibility.setText(visibility+" km");
}
if (getItemViewType(position) == LAYOUT_3){
TextView mSunrise = (TextView) holder.itemView.findViewById(R.id.mSunrise);
String sunrise = astronomy.getSunrise();
mSunrise.setText(sunrise);
}
if (getItemViewType(position) == LAYOUT_4){
TextView mSunset = (TextView) holder.itemView.findViewById(R.id.mSunset);
String sunset = astronomy.getSunset();
mSunset.setText(sunset);
}
}
@Override
public int getItemViewType(int position) {
if (position == 0) {
return LAYOUT_1;
}
if (position == 1) {
return LAYOUT_2;
}
if (position == 2) {
return LAYOUT_3;
}
if (position == 3) {
return LAYOUT_4;
}
return super.getItemViewType(position);
}
@Override
public int getItemCount() {
return 4;
}
public class MyViewHolder extends RecyclerView.ViewHolder {
public MyViewHolder(View itemView) {
super(itemView);
}
}
}
| 3,626 | 0.630998 | 0.617485 | 105 | 33.533333 | 29.127983 | 112 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.552381 | false | false |
12
|
d6ae939571664c3c0d5755822037aae61b6f1b17
| 13,554,916,833,595 |
8a7ace4c2fd97229a82110563b09c27e7144d2cb
|
/src/main/java/ExcpetionHandling/App.java
|
3842bc9242d94c0192a6d33f809c7bb9fe7a4a21
|
[] |
no_license
|
sittingbuzz/sandbox
|
https://github.com/sittingbuzz/sandbox
|
9cfae5f75f84396e2316c8c26b0cc9b718318306
|
7bdf9d47e71ba46b9b37a68e28f24daf00eb47b3
|
refs/heads/master
| 2020-03-31T23:17:04.241000 | 2018-10-19T16:53:06 | 2018-10-19T16:53:06 | 152,649,178 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package ExcpetionHandling;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.*;
@SpringBootApplication
public class App {
public static void main(String... args) {
SpringApplication.run(App.class, args);
}
}
class MyException extends Exception {
MyException(String error) {
super(error);
}
}
@RestController
class MyController {
MyService myService;
public MyController(MyService myService) {
this.myService = myService;
}
@GetMapping("/exception")
public Integer genereException() throws MyException {
int result = myService.add(-2);
return result;
}
/*
@ExceptionHandler(MyException.class)
@ResponseStatus(HttpStatus.BAD_REQUEST)
public String exception(MyException exp) {
return exp.getMessage();
}
*/
}
@ControllerAdvice
class ApiExceptionHandler {
@ExceptionHandler(MyException.class)
public ResponseEntity<String> handleException(MyException exp) {
return new ResponseEntity<>(exp.getMessage(), HttpStatus.BAD_REQUEST);
}
}
@Service
class MyService {
public MyService() {
}
int add(int a) throws MyException {
if ( a < 0 ) throw new MyException("a is negative");
return a + 2;
}
}
|
UTF-8
|
Java
| 1,523 |
java
|
App.java
|
Java
|
[] | null |
[] |
package ExcpetionHandling;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.*;
@SpringBootApplication
public class App {
public static void main(String... args) {
SpringApplication.run(App.class, args);
}
}
class MyException extends Exception {
MyException(String error) {
super(error);
}
}
@RestController
class MyController {
MyService myService;
public MyController(MyService myService) {
this.myService = myService;
}
@GetMapping("/exception")
public Integer genereException() throws MyException {
int result = myService.add(-2);
return result;
}
/*
@ExceptionHandler(MyException.class)
@ResponseStatus(HttpStatus.BAD_REQUEST)
public String exception(MyException exp) {
return exp.getMessage();
}
*/
}
@ControllerAdvice
class ApiExceptionHandler {
@ExceptionHandler(MyException.class)
public ResponseEntity<String> handleException(MyException exp) {
return new ResponseEntity<>(exp.getMessage(), HttpStatus.BAD_REQUEST);
}
}
@Service
class MyService {
public MyService() {
}
int add(int a) throws MyException {
if ( a < 0 ) throw new MyException("a is negative");
return a + 2;
}
}
| 1,523 | 0.700591 | 0.698621 | 69 | 21.072464 | 21.151159 | 78 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.275362 | false | false |
12
|
e9b455e8c59f16ef98c28ac5d5e1313c18205a6a
| 13,554,916,833,931 |
76afd171f7f9a91005dd2dd500a97e4126e2f38a
|
/src-gen/org/example/layeredstyle/layeredStyle/Domain.java
|
747a44e07c48d278c1f30bc1ea2bff18d298b1b6
|
[] |
no_license
|
ucamiand/XtendDSL
|
https://github.com/ucamiand/XtendDSL
|
ac934e71c2ff25ce8d618562f871def7e125dfcd
|
053cfda06f74d932946e635a8a1c3fc4ccd2a868
|
refs/heads/master
| 2020-06-12T22:01:46.285000 | 2019-06-29T18:49:33 | 2019-06-29T18:49:33 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
/**
* generated by Xtext 2.17.0
*/
package org.example.layeredstyle.layeredStyle;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EObject;
/**
* <!-- begin-user-doc -->
* A representation of the model object '<em><b>Domain</b></em>'.
* <!-- end-user-doc -->
*
* <p>
* The following features are supported:
* </p>
* <ul>
* <li>{@link org.example.layeredstyle.layeredStyle.Domain#getModule <em>Module</em>}</li>
* </ul>
*
* @see org.example.layeredstyle.layeredStyle.LayeredStylePackage#getDomain()
* @model
* @generated
*/
public interface Domain extends EObject
{
/**
* Returns the value of the '<em><b>Module</b></em>' containment reference list.
* The list contents are of type {@link org.example.layeredstyle.layeredStyle.Module}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the value of the '<em>Module</em>' containment reference list.
* @see org.example.layeredstyle.layeredStyle.LayeredStylePackage#getDomain_Module()
* @model containment="true"
* @generated
*/
EList<org.example.layeredstyle.layeredStyle.Module> getModule();
} // Domain
|
UTF-8
|
Java
| 1,139 |
java
|
Domain.java
|
Java
|
[] | null |
[] |
/**
* generated by Xtext 2.17.0
*/
package org.example.layeredstyle.layeredStyle;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EObject;
/**
* <!-- begin-user-doc -->
* A representation of the model object '<em><b>Domain</b></em>'.
* <!-- end-user-doc -->
*
* <p>
* The following features are supported:
* </p>
* <ul>
* <li>{@link org.example.layeredstyle.layeredStyle.Domain#getModule <em>Module</em>}</li>
* </ul>
*
* @see org.example.layeredstyle.layeredStyle.LayeredStylePackage#getDomain()
* @model
* @generated
*/
public interface Domain extends EObject
{
/**
* Returns the value of the '<em><b>Module</b></em>' containment reference list.
* The list contents are of type {@link org.example.layeredstyle.layeredStyle.Module}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the value of the '<em>Module</em>' containment reference list.
* @see org.example.layeredstyle.layeredStyle.LayeredStylePackage#getDomain_Module()
* @model containment="true"
* @generated
*/
EList<org.example.layeredstyle.layeredStyle.Module> getModule();
} // Domain
| 1,139 | 0.675154 | 0.671642 | 40 | 27.475 | 29.086069 | 92 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.1 | false | false |
12
|
c1cb9832e6f8b85d8d94e4313dab8f82568b6df5
| 38,525,856,651,458 |
dfceb0753eef8351b7dae3294f6674d7efd5ad62
|
/src/main/java/com/gzjky/dao/writedao/MonthlyReportsWriteMapper.java
|
996ac5cb75d9e3bd015d72f07c38644f2e9cc56c
|
[] |
no_license
|
wengui/gzjky_dao
|
https://github.com/wengui/gzjky_dao
|
f32d99f0626508e37af84ed965dd8e4f1a40ebf6
|
27c308b4a8e36ef8ffab7ea0992b216d9532364b
|
refs/heads/master
| 2021-01-10T01:39:10.310000 | 2016-04-05T07:27:31 | 2016-04-05T07:27:31 | 49,264,044 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.gzjky.dao.writedao;
import com.gzjky.bean.gen.MonthlyReports;
public interface MonthlyReportsWriteMapper {
int insert(MonthlyReports record);
int insertSelective(MonthlyReports record);
}
|
UTF-8
|
Java
| 218 |
java
|
MonthlyReportsWriteMapper.java
|
Java
|
[] | null |
[] |
package com.gzjky.dao.writedao;
import com.gzjky.bean.gen.MonthlyReports;
public interface MonthlyReportsWriteMapper {
int insert(MonthlyReports record);
int insertSelective(MonthlyReports record);
}
| 218 | 0.770642 | 0.770642 | 9 | 22.444445 | 20.271004 | 47 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.444444 | false | false |
12
|
cd298d9d3b44cd45bfd373609fc543d254cdf073
| 34,273,839,041,526 |
fa91450deb625cda070e82d5c31770be5ca1dec6
|
/Diff-Raw-Data/2/2_beff0520c5d93ce3411994e363a56f1ef8fa83f1/Throw_c/2_beff0520c5d93ce3411994e363a56f1ef8fa83f1_Throw_c_s.java
|
ba420d10e5d97ec496da65e7581700eda474a916
|
[] |
no_license
|
zhongxingyu/Seer
|
https://github.com/zhongxingyu/Seer
|
48e7e5197624d7afa94d23f849f8ea2075bcaec0
|
c11a3109fdfca9be337e509ecb2c085b60076213
|
refs/heads/master
| 2023-07-06T12:48:55.516000 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | false | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | 2023-06-21T00:53:27 | 2023-06-22T07:55:57 | 2,849,868 | 2 | 2 | 0 | null | false | false |
/*
* This file is part of the Polyglot extensible compiler framework.
*
* Copyright (c) 2000-2007 Polyglot project group, Cornell University
* Copyright (c) 2006-2007 IBM Corporation
*
*/
package polyglot.ast;
import java.util.Collections;
import java.util.List;
import polyglot.types.*;
import polyglot.util.*;
import polyglot.visit.*;
import x10.errors.Errors;
/**
* A <code>Throw</code> is an immutable representation of a <code>throw</code>
* statement. Such a statement contains a single <code>Expr</code> which
* evaluates to the object being thrown.
*/
public class Throw_c extends Stmt_c implements Throw
{
protected Expr expr;
public Throw_c(Position pos, Expr expr) {
super(pos);
assert(expr != null);
this.expr = expr;
}
/** Get the expression to throw. */
public Expr expr() {
return this.expr;
}
/** Set the expression to throw. */
public Throw expr(Expr expr) {
Throw_c n = (Throw_c) copy();
n.expr = expr;
return n;
}
/** Reconstruct the statement. */
protected Throw_c reconstruct(Expr expr) {
if (expr != this.expr) {
Throw_c n = (Throw_c) copy();
n.expr = expr;
return n;
}
return this;
}
/** Visit the children of the statement. */
public Node visitChildren(NodeVisitor v) {
Expr expr = (Expr) visitChild(this.expr, v);
return reconstruct(expr);
}
/** Type check the statement. */
public Node typeCheck(ContextVisitor tc) {
if (! expr.type().isThrowable()) {
Errors.issue(tc.job(),
new SemanticException("Can only throw subclasses of \"" +tc.typeSystem().Throwable() + "\".", expr.position()),
this);
}
return this;
}
public String toString() {
return "throw " + expr + ";";
}
/** Write the statement to an output file. */
public void prettyPrint(CodeWriter w, PrettyPrinter tr) {
w.write("throw ");
print(expr, w, tr);
w.write(";");
}
public Term firstChild() {
return expr;
}
public <S> List<S> acceptCFG(CFGBuilder v, List<S> succs) {
v.visitCFG(expr, this, EXIT);
// Throw edges will be handled by visitor.
return Collections.<S>emptyList();
}
public List<Type> throwTypes(TypeSystem ts) {
// if the exception that a throw statement is given to throw is null,
// then a NullPointerException will be thrown.
return CollectionUtil.list(expr.type(), ts.NullPointerException());
}
}
|
UTF-8
|
Java
| 2,580 |
java
|
2_beff0520c5d93ce3411994e363a56f1ef8fa83f1_Throw_c_s.java
|
Java
|
[] | null |
[] |
/*
* This file is part of the Polyglot extensible compiler framework.
*
* Copyright (c) 2000-2007 Polyglot project group, Cornell University
* Copyright (c) 2006-2007 IBM Corporation
*
*/
package polyglot.ast;
import java.util.Collections;
import java.util.List;
import polyglot.types.*;
import polyglot.util.*;
import polyglot.visit.*;
import x10.errors.Errors;
/**
* A <code>Throw</code> is an immutable representation of a <code>throw</code>
* statement. Such a statement contains a single <code>Expr</code> which
* evaluates to the object being thrown.
*/
public class Throw_c extends Stmt_c implements Throw
{
protected Expr expr;
public Throw_c(Position pos, Expr expr) {
super(pos);
assert(expr != null);
this.expr = expr;
}
/** Get the expression to throw. */
public Expr expr() {
return this.expr;
}
/** Set the expression to throw. */
public Throw expr(Expr expr) {
Throw_c n = (Throw_c) copy();
n.expr = expr;
return n;
}
/** Reconstruct the statement. */
protected Throw_c reconstruct(Expr expr) {
if (expr != this.expr) {
Throw_c n = (Throw_c) copy();
n.expr = expr;
return n;
}
return this;
}
/** Visit the children of the statement. */
public Node visitChildren(NodeVisitor v) {
Expr expr = (Expr) visitChild(this.expr, v);
return reconstruct(expr);
}
/** Type check the statement. */
public Node typeCheck(ContextVisitor tc) {
if (! expr.type().isThrowable()) {
Errors.issue(tc.job(),
new SemanticException("Can only throw subclasses of \"" +tc.typeSystem().Throwable() + "\".", expr.position()),
this);
}
return this;
}
public String toString() {
return "throw " + expr + ";";
}
/** Write the statement to an output file. */
public void prettyPrint(CodeWriter w, PrettyPrinter tr) {
w.write("throw ");
print(expr, w, tr);
w.write(";");
}
public Term firstChild() {
return expr;
}
public <S> List<S> acceptCFG(CFGBuilder v, List<S> succs) {
v.visitCFG(expr, this, EXIT);
// Throw edges will be handled by visitor.
return Collections.<S>emptyList();
}
public List<Type> throwTypes(TypeSystem ts) {
// if the exception that a throw statement is given to throw is null,
// then a NullPointerException will be thrown.
return CollectionUtil.list(expr.type(), ts.NullPointerException());
}
}
| 2,580 | 0.607364 | 0.600388 | 103 | 24.038836 | 23.599787 | 125 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.699029 | false | false |
12
|
c3f81cf913fecd01b60934a1c7ab7b7e04416193
| 3,513,283,285,517 |
6d7bc098b22157d59778d76ec607efaa78b6833d
|
/Maria_Full_FUHUB/Maria_Full_FUHUB/src/java/entity/InformationEntity.java
|
193874f160ea995ca7c1d1367a4cf7f7f32eeac5
|
[] |
no_license
|
FantasticBoyZ/LAB231
|
https://github.com/FantasticBoyZ/LAB231
|
72f217c2ac8f3dd1573954be2d3ef625b53867aa
|
230fe1080c2c3070a8ca70f945510fc36708c20a
|
refs/heads/main
| 2023-04-06T20:45:13.698000 | 2021-04-19T09:07:44 | 2021-04-19T09:07:44 | 359,392,104 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
/*
* Copyright(C) 2005, FPT University
* Lab Java Web:
* Maria Bagnarelli's Cafe
*
* Record of change:
* DATE Version AUTHOR DESCRIPTION
* 2021-02-20 1.0 TungDT First Implement
*/
package entity;
/**
* This class used to create attribute of Information
*
* @author Dương Thanh Tùng
*/
public class InformationEntity {
/**
* Create attributes
*/
private String shortDescription, address, tel, email, openingHours, signature;
/**
* Create constructor with no parameters
*/
public InformationEntity() {
}
/**
* Create constructor with parameters
*
* @param shortDescription <code>String</code>
* @param address <code>String</code>
* @param tel <code>String</code>
* @param email <code>String</code>
* @param openingHours <code>String</code>
* @param signature <code>String</code>
*/
public InformationEntity(String shortDescription, String address, String tel, String email, String openingHours, String signature) {
this.shortDescription = shortDescription;
this.address = address;
this.tel = tel;
this.email = email;
this.openingHours = openingHours;
this.signature = signature;
}
/**
* This method used to get ShortDescription
*
* @return shortDescription
*/
public String getShortDescription() {
return shortDescription;
}
/**
* This method used to set ShortDescription
*
* @param shortDescription <code>String</code>
*/
public void setShortDescription(String shortDescription) {
this.shortDescription = shortDescription;
}
/**
* This method used to get Address
*
* @return address
*/
public String getAddress() {
return address;
}
/**
* This method used to set Address
*
* @param address <code>String</code>
*/
public void setAddress(String address) {
this.address = address;
}
/**
* This method used to get Tel
*
* @return tel
*/
public String getTel() {
return tel;
}
/**
* This method used to set Tel
*
* @param tel <code>String</code>
*/
public void setTel(String tel) {
this.tel = tel;
}
/**
* This method used to get Email
*
* @return email
*/
public String getEmail() {
return email;
}
/**
* This method used to set Email
*
* @param email <code>String</code>
*/
public void setEmail(String email) {
this.email = email;
}
/**
* This method used to get OpeningHours
*
* @return openingHours
*/
public String getOpeningHours() {
return openingHours;
}
/**
* This method used to set OpeningHours
*
* @param openingHours <code>String</code>
*/
public void setOpeningHours(String openingHours) {
this.openingHours = openingHours;
}
/**
* This method used to get Signature
*
* @return signature
*/
public String getSignature() {
return signature;
}
/**
* This method used to set Signature
*
* @param signature <code>String</code>
*/
public void setSignature(String signature) {
this.signature = signature;
}
}
|
UTF-8
|
Java
| 3,530 |
java
|
InformationEntity.java
|
Java
|
[
{
"context": "University\t\t\t\t\t\t\t\n * Lab Java Web:\t\t\t\t\t\t\t\n * Maria Bagnarelli's Cafe\n *\t\t\t\t\t\t\t\n * Record of change:\t\t\t\t\t\t\t\n * D",
"end": 107,
"score": 0.9978559017181396,
"start": 89,
"tag": "NAME",
"value": "Maria Bagnarelli's"
},
{
"context": "d to create attribute of Information\n *\n * @author Dương Thanh Tùng\n */\npublic class InformationEntity {\n\n /**\n ",
"end": 455,
"score": 0.9998582601547241,
"start": 439,
"tag": "NAME",
"value": "Dương Thanh Tùng"
}
] | null |
[] |
/*
* Copyright(C) 2005, FPT University
* Lab Java Web:
* <NAME> Cafe
*
* Record of change:
* DATE Version AUTHOR DESCRIPTION
* 2021-02-20 1.0 TungDT First Implement
*/
package entity;
/**
* This class used to create attribute of Information
*
* @author <NAME>
*/
public class InformationEntity {
/**
* Create attributes
*/
private String shortDescription, address, tel, email, openingHours, signature;
/**
* Create constructor with no parameters
*/
public InformationEntity() {
}
/**
* Create constructor with parameters
*
* @param shortDescription <code>String</code>
* @param address <code>String</code>
* @param tel <code>String</code>
* @param email <code>String</code>
* @param openingHours <code>String</code>
* @param signature <code>String</code>
*/
public InformationEntity(String shortDescription, String address, String tel, String email, String openingHours, String signature) {
this.shortDescription = shortDescription;
this.address = address;
this.tel = tel;
this.email = email;
this.openingHours = openingHours;
this.signature = signature;
}
/**
* This method used to get ShortDescription
*
* @return shortDescription
*/
public String getShortDescription() {
return shortDescription;
}
/**
* This method used to set ShortDescription
*
* @param shortDescription <code>String</code>
*/
public void setShortDescription(String shortDescription) {
this.shortDescription = shortDescription;
}
/**
* This method used to get Address
*
* @return address
*/
public String getAddress() {
return address;
}
/**
* This method used to set Address
*
* @param address <code>String</code>
*/
public void setAddress(String address) {
this.address = address;
}
/**
* This method used to get Tel
*
* @return tel
*/
public String getTel() {
return tel;
}
/**
* This method used to set Tel
*
* @param tel <code>String</code>
*/
public void setTel(String tel) {
this.tel = tel;
}
/**
* This method used to get Email
*
* @return email
*/
public String getEmail() {
return email;
}
/**
* This method used to set Email
*
* @param email <code>String</code>
*/
public void setEmail(String email) {
this.email = email;
}
/**
* This method used to get OpeningHours
*
* @return openingHours
*/
public String getOpeningHours() {
return openingHours;
}
/**
* This method used to set OpeningHours
*
* @param openingHours <code>String</code>
*/
public void setOpeningHours(String openingHours) {
this.openingHours = openingHours;
}
/**
* This method used to get Signature
*
* @return signature
*/
public String getSignature() {
return signature;
}
/**
* This method used to set Signature
*
* @param signature <code>String</code>
*/
public void setSignature(String signature) {
this.signature = signature;
}
}
| 3,505 | 0.557981 | 0.554012 | 157 | 21.464968 | 21.479521 | 136 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.464968 | false | false |
12
|
3233d96e8b36ba4ce3db13f3fb153727242baaed
| 26,268,020,042,024 |
6a2d8668115080c8dd6c7aede832492006619350
|
/app/src/main/java/com/zyc/zcontrol/deviceItem/a1/A1Fragment.java
|
31767d616643b9d173138e72d61fe802eb7ee414
|
[] |
no_license
|
konosubakonoakua/SmartControl_Android_MQTT
|
https://github.com/konosubakonoakua/SmartControl_Android_MQTT
|
0c674f14b004c2bbfbdc6cd77319257832497d32
|
76a8e3564dbdaac04a87df1884bea4164435e894
|
refs/heads/master
| 2023-08-05T05:39:27.458000 | 2023-07-20T02:13:12 | 2023-07-20T02:13:12 | 234,287,543 | 0 | 0 | null | true | 2023-07-20T11:38:05 | 2020-01-16T09:49:53 | 2021-11-16T07:48:18 | 2023-07-20T11:38:02 | 219,229 | 0 | 0 | 0 |
Java
| false | false |
package com.zyc.zcontrol.deviceItem.a1;
import android.animation.ObjectAnimator;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.LinearInterpolator;
import android.widget.ImageView;
import android.widget.SeekBar;
import android.widget.Switch;
import android.widget.TextView;
import androidx.appcompat.app.AlertDialog;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.fragment.app.Fragment;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import com.zyc.zcontrol.R;
import com.zyc.zcontrol.deviceItem.DeviceClass.DeviceA1;
import com.zyc.zcontrol.deviceItem.DeviceClass.DeviceFragment;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* A simple {@link Fragment} subclass.
*/
public class A1Fragment extends DeviceFragment {
public final static String Tag = "A1Fragment";
DeviceA1 device;
//region 控件
private SwipeRefreshLayout mSwipeLayout;
Switch tbtn_switch;
TextView tv_task;
TextView tv_speed;
TextView tv_seekbar_tooltip;
SeekBar seekBar;
//region imageview及动画效果
ImageView iv_fan;
private ObjectAnimator objectAnimator;
//endregion
//endregion
public A1Fragment() {
// Required empty public constructor
}
@SuppressLint("ValidFragment")
public A1Fragment(DeviceA1 device) {
super(device.getName(), device.getMac());
this.device = device;
}
//region Handler
@SuppressLint("HandlerLeak")
Handler handler = new Handler() {
@Override
public void handleMessage(Message msg) {// handler接收到消息后就会执行此方法
switch (msg.what) {
case 1:
Send("{\"mac\":\"" + device.getMac() + "\",\"on\":null,\"speed\":null}");
break;
case 2:
Log.d(Tag, "send seekbar:" + msg.arg1);
Send("{\"mac\":\"" + device.getMac() + "\",\"speed\":" + msg.arg1 + "}");
break;
}
}
};
//endregion
@SuppressLint("ClickableViewAccessibility")
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
final View view = inflater.inflate(R.layout.a1_fragment, container, false);
//region 控件初始化
//region 图片及动画
iv_fan = view.findViewById(R.id.iv_fan);
objectAnimator = ObjectAnimator.ofFloat(iv_fan, "rotation", 0f, 360f);//添加旋转动画,旋转中心默认为控件中点
objectAnimator.setDuration(3600);//设置动画时间
objectAnimator.setInterpolator(new LinearInterpolator());//动画时间线性渐变
objectAnimator.setRepeatCount(ObjectAnimator.INFINITE);
objectAnimator.setRepeatMode(ObjectAnimator.RESTART);
//endregion
//region 控制按钮/跳转定时任务界面等
tbtn_switch = view.findViewById(R.id.tbtn_button);
tbtn_switch.setOnClickListener(MainButtonListener);
tv_seekbar_tooltip = view.findViewById(R.id.tv_seekbar_tooltip);
tv_speed = view.findViewById(R.id.tv_speed);
tv_task = view.findViewById(R.id.tv_task);
tv_task.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(getContext(), A1PlugActivity.class);
intent.putExtra("mac", device.getMac());
startActivity(intent);
}
});
tv_task.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View v) {
// Intent intent = new Intent(getContext(), A1LedActivity.class);
// intent.putExtra("mac", device.getMac());
// startActivity(intent);
AlertDialog alertDialog = new AlertDialog.Builder(getActivity())
.setTitle("请到设备设置页面")
.setMessage("颜色设置功能入口调整至设备设置页面,\r\n请点击右上角笔图标进入设备设置页面修改led颜色")
.setPositiveButton("知道了", null)
.create();
alertDialog.show();
return false;
}
});
//endregion
//region 拖动条 处理viewpage/SwipeRefreshLayout滑动冲突事件
seekBar = view.findViewById(R.id.seekBarR);
//region 处理viewpage/SwipeRefreshLayout滑动冲突事件
seekBar.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
view.getParent().requestDisallowInterceptTouchEvent(true);
if (event.getAction() == MotionEvent.ACTION_UP) mSwipeLayout.setEnabled(true);
else mSwipeLayout.setEnabled(false);
return false;
}
});
//endregion
seekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
if (fromUser) {
tv_seekbar_tooltip.setVisibility(View.VISIBLE);
tv_seekbar_tooltip.setText(seekBar.getProgress() + "");
tv_seekbar_tooltip.setText(progress + "");
int padding = seekBar.getPaddingStart();
int min = 1;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
min = seekBar.getMin();
}
ConstraintLayout.LayoutParams lp = (ConstraintLayout.LayoutParams) tv_seekbar_tooltip.getLayoutParams();
lp.leftMargin = padding + (seekBar.getWidth() - padding * 2) * (progress - min) / (seekBar.getMax() - min); //计算偏移量
lp.leftMargin *= 2; //布局结果导致textview居中显示,leftMargin显示只有一半显示效果
tv_seekbar_tooltip.setLayoutParams(lp);
}
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
}
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
Message msg = new Message();
msg.arg1 = seekBar.getProgress();
msg.what = 2;
handler.sendMessageDelayed(msg, 1);
tv_seekbar_tooltip.setVisibility(View.INVISIBLE);
}
});
//endregion
//region 更新当前状态
mSwipeLayout = (SwipeRefreshLayout) view.findViewById(R.id.swipeRefreshLayout);
mSwipeLayout.setColorSchemeResources(R.color.colorAccent, R.color.colorPrimaryDark, R.color.colorAccent, R.color.colorPrimary);
mSwipeLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
handler.sendEmptyMessageDelayed(1, 0);
mSwipeLayout.setRefreshing(false);
}
});
//endregion
//region log 相关
setLogTextView((TextView) view.findViewById(R.id.tv_log));
//endregion
//endregion
super.onCreateView(inflater, container, savedInstanceState);
return view;
}
//region 按钮事件
// region 开关
private View.OnClickListener MainButtonListener = new View.OnClickListener() {
@Override
public void onClick(View arg0) {
Send("{\"mac\":\"" + device.getMac() + "\",\"on\":" + String.valueOf(((Switch) arg0).isChecked() ? 1 : 0) + "}");
}
};
//endregion
//endregion
void Send(String message) {
boolean b = getActivity().getSharedPreferences("Setting_" + device.getMac(), 0).getBoolean("always_UDP", false);
super.Send(b, device.getSendMqttTopic(), message);
}
//数据接收处理函数
public void Receive(String ip, int port, String topic, String message) {
super.Receive(ip, port, topic, message);
//region 接收availability数据,非Json,单独处理
if (topic != null && topic.endsWith("availability")) {
String regexp = "device/(.*?)/([0123456789abcdef]{12})/(.*)";
Pattern pattern = Pattern.compile(regexp);
Matcher matcher = pattern.matcher(topic);
if (matcher.find() && matcher.groupCount() == 3) {
String device_mac = matcher.group(2);
if (device_mac.equals(device.getMac())) {
device.setOnline(message.equals("1"));
Log(device.isOnline() ? "设备在线" : "设备离线" + "(请确认设备是否有连接mqtt服务器)");
}
return;
}
}
//endregion
try {
JSONObject jsonObject = new JSONObject(message);
if (!jsonObject.has("mac") || !jsonObject.getString("mac").equals(device.getMac())) {
return;
}
if (jsonObject.has("name")) device.setName(jsonObject.getString("name"));
//region 解析on
if (jsonObject.has("on")) {
int on = jsonObject.getInt("on");
tbtn_switch.setChecked(on != 0);
if (tbtn_switch.isChecked()) objectAnimator.start();
else objectAnimator.pause();
}
//endregion
//region 解析speed
if (jsonObject.has("speed")) {
int speed = jsonObject.getInt("speed");
seekBar.setProgress(speed);
objectAnimator.setDuration(7000 - speed * 68);
tv_speed.setText("风速:" + String.format("%03d", speed) + "%");
}
//endregion
} catch (JSONException e) {
e.printStackTrace();
}
}
//region 事件监听调用函数,主要为在子类中重写此函数实现在service建立成功/mqtt连接成功/失败时执行功能
//Service建立成功时调用 此函数需要时在子类中重写
public void ServiceConnected() {
handler.sendEmptyMessageDelayed(1, 300);
}
//mqtt连接成功时调用 此函数需要时在子类中重写
public void MqttConnected() {
handler.sendEmptyMessageDelayed(1, 0);
}
//mqtt连接断开时调用 此函数需要时在子类中重写
public void MqttDisconnected() {
handler.sendEmptyMessageDelayed(1, 0);
}
//endregion
}
|
UTF-8
|
Java
| 11,151 |
java
|
A1Fragment.java
|
Java
|
[] | null |
[] |
package com.zyc.zcontrol.deviceItem.a1;
import android.animation.ObjectAnimator;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.LinearInterpolator;
import android.widget.ImageView;
import android.widget.SeekBar;
import android.widget.Switch;
import android.widget.TextView;
import androidx.appcompat.app.AlertDialog;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.fragment.app.Fragment;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import com.zyc.zcontrol.R;
import com.zyc.zcontrol.deviceItem.DeviceClass.DeviceA1;
import com.zyc.zcontrol.deviceItem.DeviceClass.DeviceFragment;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* A simple {@link Fragment} subclass.
*/
public class A1Fragment extends DeviceFragment {
public final static String Tag = "A1Fragment";
DeviceA1 device;
//region 控件
private SwipeRefreshLayout mSwipeLayout;
Switch tbtn_switch;
TextView tv_task;
TextView tv_speed;
TextView tv_seekbar_tooltip;
SeekBar seekBar;
//region imageview及动画效果
ImageView iv_fan;
private ObjectAnimator objectAnimator;
//endregion
//endregion
public A1Fragment() {
// Required empty public constructor
}
@SuppressLint("ValidFragment")
public A1Fragment(DeviceA1 device) {
super(device.getName(), device.getMac());
this.device = device;
}
//region Handler
@SuppressLint("HandlerLeak")
Handler handler = new Handler() {
@Override
public void handleMessage(Message msg) {// handler接收到消息后就会执行此方法
switch (msg.what) {
case 1:
Send("{\"mac\":\"" + device.getMac() + "\",\"on\":null,\"speed\":null}");
break;
case 2:
Log.d(Tag, "send seekbar:" + msg.arg1);
Send("{\"mac\":\"" + device.getMac() + "\",\"speed\":" + msg.arg1 + "}");
break;
}
}
};
//endregion
@SuppressLint("ClickableViewAccessibility")
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
final View view = inflater.inflate(R.layout.a1_fragment, container, false);
//region 控件初始化
//region 图片及动画
iv_fan = view.findViewById(R.id.iv_fan);
objectAnimator = ObjectAnimator.ofFloat(iv_fan, "rotation", 0f, 360f);//添加旋转动画,旋转中心默认为控件中点
objectAnimator.setDuration(3600);//设置动画时间
objectAnimator.setInterpolator(new LinearInterpolator());//动画时间线性渐变
objectAnimator.setRepeatCount(ObjectAnimator.INFINITE);
objectAnimator.setRepeatMode(ObjectAnimator.RESTART);
//endregion
//region 控制按钮/跳转定时任务界面等
tbtn_switch = view.findViewById(R.id.tbtn_button);
tbtn_switch.setOnClickListener(MainButtonListener);
tv_seekbar_tooltip = view.findViewById(R.id.tv_seekbar_tooltip);
tv_speed = view.findViewById(R.id.tv_speed);
tv_task = view.findViewById(R.id.tv_task);
tv_task.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(getContext(), A1PlugActivity.class);
intent.putExtra("mac", device.getMac());
startActivity(intent);
}
});
tv_task.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View v) {
// Intent intent = new Intent(getContext(), A1LedActivity.class);
// intent.putExtra("mac", device.getMac());
// startActivity(intent);
AlertDialog alertDialog = new AlertDialog.Builder(getActivity())
.setTitle("请到设备设置页面")
.setMessage("颜色设置功能入口调整至设备设置页面,\r\n请点击右上角笔图标进入设备设置页面修改led颜色")
.setPositiveButton("知道了", null)
.create();
alertDialog.show();
return false;
}
});
//endregion
//region 拖动条 处理viewpage/SwipeRefreshLayout滑动冲突事件
seekBar = view.findViewById(R.id.seekBarR);
//region 处理viewpage/SwipeRefreshLayout滑动冲突事件
seekBar.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
view.getParent().requestDisallowInterceptTouchEvent(true);
if (event.getAction() == MotionEvent.ACTION_UP) mSwipeLayout.setEnabled(true);
else mSwipeLayout.setEnabled(false);
return false;
}
});
//endregion
seekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
if (fromUser) {
tv_seekbar_tooltip.setVisibility(View.VISIBLE);
tv_seekbar_tooltip.setText(seekBar.getProgress() + "");
tv_seekbar_tooltip.setText(progress + "");
int padding = seekBar.getPaddingStart();
int min = 1;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
min = seekBar.getMin();
}
ConstraintLayout.LayoutParams lp = (ConstraintLayout.LayoutParams) tv_seekbar_tooltip.getLayoutParams();
lp.leftMargin = padding + (seekBar.getWidth() - padding * 2) * (progress - min) / (seekBar.getMax() - min); //计算偏移量
lp.leftMargin *= 2; //布局结果导致textview居中显示,leftMargin显示只有一半显示效果
tv_seekbar_tooltip.setLayoutParams(lp);
}
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
}
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
Message msg = new Message();
msg.arg1 = seekBar.getProgress();
msg.what = 2;
handler.sendMessageDelayed(msg, 1);
tv_seekbar_tooltip.setVisibility(View.INVISIBLE);
}
});
//endregion
//region 更新当前状态
mSwipeLayout = (SwipeRefreshLayout) view.findViewById(R.id.swipeRefreshLayout);
mSwipeLayout.setColorSchemeResources(R.color.colorAccent, R.color.colorPrimaryDark, R.color.colorAccent, R.color.colorPrimary);
mSwipeLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
handler.sendEmptyMessageDelayed(1, 0);
mSwipeLayout.setRefreshing(false);
}
});
//endregion
//region log 相关
setLogTextView((TextView) view.findViewById(R.id.tv_log));
//endregion
//endregion
super.onCreateView(inflater, container, savedInstanceState);
return view;
}
//region 按钮事件
// region 开关
private View.OnClickListener MainButtonListener = new View.OnClickListener() {
@Override
public void onClick(View arg0) {
Send("{\"mac\":\"" + device.getMac() + "\",\"on\":" + String.valueOf(((Switch) arg0).isChecked() ? 1 : 0) + "}");
}
};
//endregion
//endregion
void Send(String message) {
boolean b = getActivity().getSharedPreferences("Setting_" + device.getMac(), 0).getBoolean("always_UDP", false);
super.Send(b, device.getSendMqttTopic(), message);
}
//数据接收处理函数
public void Receive(String ip, int port, String topic, String message) {
super.Receive(ip, port, topic, message);
//region 接收availability数据,非Json,单独处理
if (topic != null && topic.endsWith("availability")) {
String regexp = "device/(.*?)/([0123456789abcdef]{12})/(.*)";
Pattern pattern = Pattern.compile(regexp);
Matcher matcher = pattern.matcher(topic);
if (matcher.find() && matcher.groupCount() == 3) {
String device_mac = matcher.group(2);
if (device_mac.equals(device.getMac())) {
device.setOnline(message.equals("1"));
Log(device.isOnline() ? "设备在线" : "设备离线" + "(请确认设备是否有连接mqtt服务器)");
}
return;
}
}
//endregion
try {
JSONObject jsonObject = new JSONObject(message);
if (!jsonObject.has("mac") || !jsonObject.getString("mac").equals(device.getMac())) {
return;
}
if (jsonObject.has("name")) device.setName(jsonObject.getString("name"));
//region 解析on
if (jsonObject.has("on")) {
int on = jsonObject.getInt("on");
tbtn_switch.setChecked(on != 0);
if (tbtn_switch.isChecked()) objectAnimator.start();
else objectAnimator.pause();
}
//endregion
//region 解析speed
if (jsonObject.has("speed")) {
int speed = jsonObject.getInt("speed");
seekBar.setProgress(speed);
objectAnimator.setDuration(7000 - speed * 68);
tv_speed.setText("风速:" + String.format("%03d", speed) + "%");
}
//endregion
} catch (JSONException e) {
e.printStackTrace();
}
}
//region 事件监听调用函数,主要为在子类中重写此函数实现在service建立成功/mqtt连接成功/失败时执行功能
//Service建立成功时调用 此函数需要时在子类中重写
public void ServiceConnected() {
handler.sendEmptyMessageDelayed(1, 300);
}
//mqtt连接成功时调用 此函数需要时在子类中重写
public void MqttConnected() {
handler.sendEmptyMessageDelayed(1, 0);
}
//mqtt连接断开时调用 此函数需要时在子类中重写
public void MqttDisconnected() {
handler.sendEmptyMessageDelayed(1, 0);
}
//endregion
}
| 11,151 | 0.593586 | 0.587116 | 302 | 33.798012 | 28.123819 | 135 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.582781 | false | false |
12
|
f48c8ae0f2e1fd7e1c637a28826f3bebaca90383
| 35,192,962,026,310 |
155d7e5c1543f6d102479de8e54527f4b77a1b38
|
/server-core/src/main/java/io/onedev/server/web/asset/selectionpopover/SelectionPopoverResourceReference.java
|
62f5c9d7c8e839ebee6de9928982c08bcf67db3d
|
[
"MIT"
] |
permissive
|
theonedev/onedev
|
https://github.com/theonedev/onedev
|
0945cbe8c2ebeeee781ab88ea11363217bf1d0b7
|
1ec9918988611d5eb284a21d7e94e071c7b48aa7
|
refs/heads/main
| 2023-08-22T22:37:29.554000 | 2023-08-22T14:52:13 | 2023-08-22T14:52:13 | 156,317,154 | 12,162 | 880 |
MIT
| false | 2023-08-07T02:33:21 | 2018-11-06T02:57:01 | 2023-08-07T01:39:22 | 2023-08-07T02:15:24 | 205,120 | 11,450 | 773 | 0 |
Java
| false | false |
package io.onedev.server.web.asset.selectionpopover;
import java.util.ArrayList;
import java.util.List;
import org.apache.wicket.Application;
import org.apache.wicket.markup.head.CssHeaderItem;
import org.apache.wicket.markup.head.HeaderItem;
import org.apache.wicket.markup.head.JavaScriptHeaderItem;
import org.apache.wicket.request.resource.CssResourceReference;
import org.apache.wicket.request.resource.JavaScriptResourceReference;
public class SelectionPopoverResourceReference extends JavaScriptResourceReference {
private static final long serialVersionUID = 1L;
public SelectionPopoverResourceReference() {
super(SelectionPopoverResourceReference.class, "jquery.selectionpopover.js");
}
@Override
public List<HeaderItem> getDependencies() {
List<HeaderItem> dependencies = new ArrayList<>();
dependencies.add(JavaScriptHeaderItem.forReference(Application.get().getJavaScriptLibrarySettings().getJQueryReference()));
dependencies.add(CssHeaderItem.forReference(new CssResourceReference(
SelectionPopoverResourceReference.class, "jquery.selectionpopover.css")));
return dependencies;
}
}
|
UTF-8
|
Java
| 1,123 |
java
|
SelectionPopoverResourceReference.java
|
Java
|
[] | null |
[] |
package io.onedev.server.web.asset.selectionpopover;
import java.util.ArrayList;
import java.util.List;
import org.apache.wicket.Application;
import org.apache.wicket.markup.head.CssHeaderItem;
import org.apache.wicket.markup.head.HeaderItem;
import org.apache.wicket.markup.head.JavaScriptHeaderItem;
import org.apache.wicket.request.resource.CssResourceReference;
import org.apache.wicket.request.resource.JavaScriptResourceReference;
public class SelectionPopoverResourceReference extends JavaScriptResourceReference {
private static final long serialVersionUID = 1L;
public SelectionPopoverResourceReference() {
super(SelectionPopoverResourceReference.class, "jquery.selectionpopover.js");
}
@Override
public List<HeaderItem> getDependencies() {
List<HeaderItem> dependencies = new ArrayList<>();
dependencies.add(JavaScriptHeaderItem.forReference(Application.get().getJavaScriptLibrarySettings().getJQueryReference()));
dependencies.add(CssHeaderItem.forReference(new CssResourceReference(
SelectionPopoverResourceReference.class, "jquery.selectionpopover.css")));
return dependencies;
}
}
| 1,123 | 0.827248 | 0.826358 | 30 | 36.433334 | 32.817356 | 125 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.266667 | false | false |
12
|
1bc91b63f8dabbd76a49f0a704ec435cc5d01601
| 3,513,283,287,092 |
b55bab6cf6c90927ed0f6ec677ebeb9d4db83806
|
/Tree Data Structure/Min Depth of Binary Tree/Min Depth of Binary Tree.java
|
5323454398f4fb4eb52c418a764013cec769e295
|
[] |
no_license
|
asatulsinha4/interviewbit-solutions
|
https://github.com/asatulsinha4/interviewbit-solutions
|
a2dded1e17c062c4757dd7854adb48efef3e5f79
|
d68f9c2e20933d9612d5ee3c944ad39e483b6819
|
refs/heads/main
| 2023-05-31T02:14:15.883000 | 2021-06-23T18:52:13 | 2021-06-23T18:52:13 | 365,693,297 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
/*
Given a binary tree, find its minimum depth.
The minimum depth is the number of nodes along the shortest path from the root node down to the nearest leaf node.
NOTE : The path has to end on a leaf node.
Example :
1
/
2
min depth = 2.
*/
/**
* Definition for binary tree
* class TreeNode {
* int val;
* TreeNode left;
* TreeNode right;
* TreeNode(int x) {
* val = x;
* left=null;
* right=null;
* }
* }
*/
public class Solution {
public int min_depth = Integer.MAX_VALUE;
public int minDepth(TreeNode A) {
helper(A,0);
return min_depth;
}
public void helper(TreeNode node,int depth){
if(node!=null){
depth++;
if(node.left==null && node.right==null){
min_depth = Math.min(min_depth,depth);
}
helper(node.left,depth);
helper(node.right,depth);
}
}
}
|
UTF-8
|
Java
| 956 |
java
|
Min Depth of Binary Tree.java
|
Java
|
[] | null |
[] |
/*
Given a binary tree, find its minimum depth.
The minimum depth is the number of nodes along the shortest path from the root node down to the nearest leaf node.
NOTE : The path has to end on a leaf node.
Example :
1
/
2
min depth = 2.
*/
/**
* Definition for binary tree
* class TreeNode {
* int val;
* TreeNode left;
* TreeNode right;
* TreeNode(int x) {
* val = x;
* left=null;
* right=null;
* }
* }
*/
public class Solution {
public int min_depth = Integer.MAX_VALUE;
public int minDepth(TreeNode A) {
helper(A,0);
return min_depth;
}
public void helper(TreeNode node,int depth){
if(node!=null){
depth++;
if(node.left==null && node.right==null){
min_depth = Math.min(min_depth,depth);
}
helper(node.left,depth);
helper(node.right,depth);
}
}
}
| 956 | 0.542887 | 0.538703 | 46 | 19.782608 | 20.919008 | 114 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.413043 | false | false |
12
|
24f410a4ab0aec83ecdc51cd008babd3cd146e8e
| 37,306,085,965,816 |
43f97f56138b321cfbd56afe12f3160a45fac764
|
/03-java-spring/02-spring-data-i/02-show/mvc/src/main/java/com/HopeA/mvc/models/Min.java
|
0f68b1c31d4c3134bfcea2cf1421795594937f84
|
[] |
no_license
|
java-june-2021/HopeA-Assignments
|
https://github.com/java-june-2021/HopeA-Assignments
|
a43ca8ebf81aef313c8280358db14f89813504d5
|
aa5d89551273b366f8b5256b2daf331a31637d33
|
refs/heads/master
| 2023-06-24T14:05:30.226000 | 2021-07-23T02:31:05 | 2021-07-23T02:31:05 | 375,159,950 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.HopeA.mvc.models;
public @interface Min {
int value();
}
|
UTF-8
|
Java
| 73 |
java
|
Min.java
|
Java
|
[] | null |
[] |
package com.HopeA.mvc.models;
public @interface Min {
int value();
}
| 73 | 0.684932 | 0.684932 | 7 | 9.428572 | 11.44998 | 29 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.428571 | false | false |
12
|
d84da0c06529bf193e591b75b3af327a7024686c
| 37,357,625,574,975 |
c65f220f1ec07e80fec9ac9dc2eec921777f6b34
|
/app/src/main/java/com/webingate/paysmartcustomerapp/customerapp/Travels.java
|
f2d6a53ff52080862edbef6de93fe49aa167fd75
|
[] |
no_license
|
WIGRepositories/PaysmartCustomerApp
|
https://github.com/WIGRepositories/PaysmartCustomerApp
|
78082695ebcf1b3d6cf14f73b8ae1726c8fe247c
|
5a8692f3b5accf4934ffe9adaa86ca2e735fde51
|
refs/heads/DEV
| 2020-04-04T09:04:24.322000 | 2019-07-31T11:24:30 | 2019-07-31T11:24:30 | 155,805,691 | 0 | 2 | null | false | 2019-06-23T13:49:30 | 2018-11-02T02:50:59 | 2019-06-21T12:50:52 | 2019-06-23T13:49:30 | 6,635 | 0 | 0 | 0 |
Java
| false | false |
package com.webingate.paysmartcustomerapp.customerapp;
import android.annotation.SuppressLint;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.SearchView;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;
import com.webingate.paysmartcustomerapp.R;
public class Travels extends Fragment {
// Declare Variables
TravelsAdapter adapter;
private static final String ARG_SECTION_NUMBER = "section_number";
@BindView(R.id.search)
SearchView editsearch;
@BindView(R.id.listview)
ListView list;
@BindView(R.id.layout)
LinearLayout layout;
Unbinder unbinder;
public static Travels newInstance(int SectionNumber) {
Travels home = new Travels();
Bundle args = new Bundle();
args.putInt(ARG_SECTION_NUMBER, SectionNumber);
home.setArguments(args);
return home;
}
@SuppressLint("NewApi")
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@SuppressLint("NewApi")
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.stops, container, false);
// Generate sample data
// Locate the ListView in listview_main.xml
list = (ListView) v.findViewById(R.id.listview);
/* TravelModel travelModel=new TravelModel();
travelModel.setName("Alhind Tours And Travels");
travelModel.setTime("6:30AM");
travelModel.setSubTitle("VOLVO AC MULTIAXLE SEMI SLEEPER 2+2");
travelModel.setPrice("1100$");
arraylist.add(travelModel);
travelModel=new TravelModel();
travelModel.setName("Khallada Tours And Travels");
travelModel.setTime("9:30AM");
travelModel.setSubTitle("VOLVO AC SLEEPER 2+2");
travelModel.setPrice("1900$");
arraylist.add(travelModel);
travelModel=new TravelModel();
travelModel.setName("Orange Tours And Travels");
travelModel.setTime("8:30AM");
travelModel.setSubTitle("VOLVO AC MULTIAXLE SEMI SLEEPER 2+2");
travelModel.setPrice("1200$");
arraylist.add(travelModel);
travelModel=new TravelModel();
travelModel.setName("Deepak Tours And Travels");
travelModel.setTime("3:30AM");
travelModel.setSubTitle("VOLVO NON AC SEATER 2+2");
travelModel.setPrice("800$");
arraylist.add(travelModel);
travelModel=new TravelModel();
travelModel.setName("Laxman Tours And Travels");
travelModel.setTime("7:30AM");
travelModel.setSubTitle("VOLVO AC MULTIAXLE SEMI SLEEPER 2+2");
travelModel.setPrice("1100$");
arraylist.add(travelModel);
travelModel=new TravelModel();
travelModel.setName("Suneel Tours And Travels");
travelModel.setTime("6:50AM");
travelModel.setSubTitle("VOLVO AC MULTIAXLE SEMI SLEEPER 2+2");
travelModel.setPrice("1100$");
arraylist.add(travelModel);*/
// Pass results to ListViewAdapter Class
adapter = new TravelsAdapter(getContext(), ApplicationConstants.travelsArraylist);
// Binds the Adapter to the ListView
list.setAdapter(adapter);
// Locate the EditText in listview_main.xml
//editsearch.setVisibility(View.GONE);
list.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view,
int position, long id) {
// TODO Auto-generated method stub
ApplicationConstants.travel = ApplicationConstants.travelsArraylist.get(position);
ApplicationConstants.FRAGMENT = ApplicationConstants.BUSLAYOUT;
goPage(ApplicationConstants.FRAGMENT);
}
});
unbinder = ButterKnife.bind(this, v);
return v;
}
private void goPage(int page) {
// Handle navigation view item clicks here.
Fragment fragment = null;
Class fragmentClass = null;
switch (page) {
case ApplicationConstants.BUSLAYOUT:
fragmentClass = BusLayout.class;
break;
}
try {
fragment = (Fragment) fragmentClass.newInstance();
} catch (Exception e) {
e.printStackTrace();
}
// Insert the fragment by replacing any existing fragment
FragmentManager fragmentManager = getActivity().getSupportFragmentManager();
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
/* fragmentTransaction.setCustomAnimations(
R.anim.rotate_forward,
R.anim.rotate_backward);*/
fragmentTransaction.replace(R.id.flContent, fragment);
fragmentTransaction.commit();
}
@Override
public void onDestroyView() {
super.onDestroyView();
unbinder.unbind();
}
}
|
UTF-8
|
Java
| 5,435 |
java
|
Travels.java
|
Java
|
[] | null |
[] |
package com.webingate.paysmartcustomerapp.customerapp;
import android.annotation.SuppressLint;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.SearchView;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;
import com.webingate.paysmartcustomerapp.R;
public class Travels extends Fragment {
// Declare Variables
TravelsAdapter adapter;
private static final String ARG_SECTION_NUMBER = "section_number";
@BindView(R.id.search)
SearchView editsearch;
@BindView(R.id.listview)
ListView list;
@BindView(R.id.layout)
LinearLayout layout;
Unbinder unbinder;
public static Travels newInstance(int SectionNumber) {
Travels home = new Travels();
Bundle args = new Bundle();
args.putInt(ARG_SECTION_NUMBER, SectionNumber);
home.setArguments(args);
return home;
}
@SuppressLint("NewApi")
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@SuppressLint("NewApi")
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.stops, container, false);
// Generate sample data
// Locate the ListView in listview_main.xml
list = (ListView) v.findViewById(R.id.listview);
/* TravelModel travelModel=new TravelModel();
travelModel.setName("Alhind Tours And Travels");
travelModel.setTime("6:30AM");
travelModel.setSubTitle("VOLVO AC MULTIAXLE SEMI SLEEPER 2+2");
travelModel.setPrice("1100$");
arraylist.add(travelModel);
travelModel=new TravelModel();
travelModel.setName("Khallada Tours And Travels");
travelModel.setTime("9:30AM");
travelModel.setSubTitle("VOLVO AC SLEEPER 2+2");
travelModel.setPrice("1900$");
arraylist.add(travelModel);
travelModel=new TravelModel();
travelModel.setName("Orange Tours And Travels");
travelModel.setTime("8:30AM");
travelModel.setSubTitle("VOLVO AC MULTIAXLE SEMI SLEEPER 2+2");
travelModel.setPrice("1200$");
arraylist.add(travelModel);
travelModel=new TravelModel();
travelModel.setName("Deepak Tours And Travels");
travelModel.setTime("3:30AM");
travelModel.setSubTitle("VOLVO NON AC SEATER 2+2");
travelModel.setPrice("800$");
arraylist.add(travelModel);
travelModel=new TravelModel();
travelModel.setName("Laxman Tours And Travels");
travelModel.setTime("7:30AM");
travelModel.setSubTitle("VOLVO AC MULTIAXLE SEMI SLEEPER 2+2");
travelModel.setPrice("1100$");
arraylist.add(travelModel);
travelModel=new TravelModel();
travelModel.setName("Suneel Tours And Travels");
travelModel.setTime("6:50AM");
travelModel.setSubTitle("VOLVO AC MULTIAXLE SEMI SLEEPER 2+2");
travelModel.setPrice("1100$");
arraylist.add(travelModel);*/
// Pass results to ListViewAdapter Class
adapter = new TravelsAdapter(getContext(), ApplicationConstants.travelsArraylist);
// Binds the Adapter to the ListView
list.setAdapter(adapter);
// Locate the EditText in listview_main.xml
//editsearch.setVisibility(View.GONE);
list.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view,
int position, long id) {
// TODO Auto-generated method stub
ApplicationConstants.travel = ApplicationConstants.travelsArraylist.get(position);
ApplicationConstants.FRAGMENT = ApplicationConstants.BUSLAYOUT;
goPage(ApplicationConstants.FRAGMENT);
}
});
unbinder = ButterKnife.bind(this, v);
return v;
}
private void goPage(int page) {
// Handle navigation view item clicks here.
Fragment fragment = null;
Class fragmentClass = null;
switch (page) {
case ApplicationConstants.BUSLAYOUT:
fragmentClass = BusLayout.class;
break;
}
try {
fragment = (Fragment) fragmentClass.newInstance();
} catch (Exception e) {
e.printStackTrace();
}
// Insert the fragment by replacing any existing fragment
FragmentManager fragmentManager = getActivity().getSupportFragmentManager();
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
/* fragmentTransaction.setCustomAnimations(
R.anim.rotate_forward,
R.anim.rotate_backward);*/
fragmentTransaction.replace(R.id.flContent, fragment);
fragmentTransaction.commit();
}
@Override
public void onDestroyView() {
super.onDestroyView();
unbinder.unbind();
}
}
| 5,435 | 0.657222 | 0.646918 | 157 | 33.624203 | 22.907293 | 98 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.643312 | false | false |
12
|
6d99fc07dc0160d3b4b0a6eb8e67aaebd0f5bf59
| 16,045,997,885,362 |
fdb27904cc14ec5a30da073cb1d73d6e09c8eac6
|
/src/controllers/EditTestController.java
|
02a4d1184798f522dfd8d31ff1fb0fc978eba519
|
[
"MIT"
] |
permissive
|
johanthejohan/gitfix3
|
https://github.com/johanthejohan/gitfix3
|
c8e61e126bb2c259f747f09c989fe18c89fc1e41
|
c73f39aec79dcbb9d7f1c6290aad0f84622ed0be
|
refs/heads/master
| 2019-07-15T21:53:23.769000 | 2017-05-30T12:57:53 | 2017-05-30T12:57:53 | 92,832,799 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package controllers;
import entities.Question;
import entities.Test;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.fxml.Initializable;
import javafx.scene.Scene;
import javafx.scene.control.*;
import javafx.scene.text.Font;
import javafx.stage.Stage;
import services.TestService;
import java.io.IOException;
import java.net.URL;
import java.time.LocalDate;
import java.util.List;
import java.util.ResourceBundle;
public class EditTestController implements Initializable {
@FXML
private TextField titleField;
@FXML
private DatePicker startDatePicker;
@FXML
private DatePicker endDatePicker;
@FXML
private TextField timeField;
@FXML
private CheckBox selfCorrectingCheckBox;
@FXML
private CheckBox showResultCheckBox;
@FXML
private Label messageLabel;
@FXML
private ListView<Question> questionListView;
@FXML
private Button bCancel;
@FXML
private Button bSave;
@FXML
private Button bAdd;
@FXML
private Button bEdit;
@FXML
private Button bRemove;
private Test test;
@Override
public void initialize(URL location, ResourceBundle resources) {
messageLabel.setVisible(false);
bCancel.setOnAction(e -> cancelAction());
bSave.setOnAction(e -> saveAction());
bAdd.setOnAction(e -> addAction());
bEdit.setOnAction(e -> editAction());
bRemove.setOnAction(e -> removeAction());
System.setProperty("prism.lcdtext", "false");
System.setProperty("prism.text", "t2k");
titleField.setText(test.getTitle());
startDatePicker.setValue(test.getStartDate());
endDatePicker.setValue(test.getEndDate());
timeField.setText(String.valueOf(test.getTime()));
selfCorrectingCheckBox.setSelected(test.isSelfCorrecting());
showResultCheckBox.setSelected(test.isShowResult());
questionListView.getItems().addAll(test.getQuestionList());
timeField.textProperty().addListener((observable, oldValue, newValue) -> {
if (!newValue.matches("\\d*")) {
timeField.setText(newValue.replaceAll("[^\\d]", ""));
}
});
}
public void saveAction() {
if (validation()) {
String title = titleField.getText();
LocalDate startDate = startDatePicker.getValue();
LocalDate endDate = endDatePicker.getValue();
boolean selfCorrecting = selfCorrectingCheckBox.isSelected();
boolean showResult = showResultCheckBox.isSelected();
List<Question> questionList = questionListView.getItems();
int time = 0;
if (timeField.getText() != null) time = Integer.parseInt(timeField.getText());
TestService testService = new TestService();
testService.editTest(test.getTestId(), title, startDate, endDate, time, selfCorrecting, showResult, questionList);
Stage stage = (Stage) titleField.getScene().getWindow();
stage.close();
}
}
public void addAction() {
try {
AddQuestionController questionController = new AddQuestionController();
questionController.setQuestionListView(questionListView);
FXMLLoader loader = new FXMLLoader(getClass().getResource("../view/addQuestion.fxml"));
loader.setController(questionController);
Stage stage = new Stage();
stage.setScene(new Scene(loader.load(), 820, 550));
stage.setTitle("Add Question");
stage.show();
} catch (IOException e) {
e.printStackTrace();
}
}
public void editAction() {
Question selectedQuestion = questionListView.getSelectionModel().getSelectedItem();
if (selectedQuestion != null) {
try {
EditQuestionController questionController = new EditQuestionController();
questionController.setQuestion(selectedQuestion);
questionController.setQuestionListView(questionListView);
FXMLLoader loader = new FXMLLoader(getClass().getResource("../view/editQuestion.fxml"));
loader.setController(questionController);
Stage stage = new Stage();
stage.setScene(new Scene(loader.load(), 800, 600));
stage.setTitle("Edit Question");
stage.show();
messageLabel.setVisible(false);
} catch (IOException e) {
e.printStackTrace();
}
} else {
messageLabel.setVisible(true);
messageLabel.setText("No Question selected!");
}
}
public void removeAction() {
Question selectedQuestion = questionListView.getSelectionModel().getSelectedItem();
if (selectedQuestion != null) {
questionListView.getItems().remove(selectedQuestion);
messageLabel.setVisible(false);
} else {
messageLabel.setVisible(true);
messageLabel.setText("No Question selected!");
}
}
public void cancelAction() {
Stage stage = (Stage) titleField.getScene().getWindow();
stage.close();
}
private boolean validation() {
String title = titleField.getText().trim();
LocalDate startDate = startDatePicker.getValue();
LocalDate endDate = endDatePicker.getValue();
if (title.length() > 0) {
if (startDate != null && endDate != null) {
if (startDate.isBefore(endDate)) {
return true;
} else {
messageLabel.setVisible(true);
messageLabel.setText("Start Date must be before End Date!");
}
} else {
messageLabel.setVisible(true);
messageLabel.setText("Date fields cannot be blank!");
}
} else {
messageLabel.setVisible(true);
messageLabel.setText("Title field cannot be blank!");
}
return false;
}
public void setTest(Test test) {
this.test = test;
}
}
|
UTF-8
|
Java
| 6,184 |
java
|
EditTestController.java
|
Java
|
[] | null |
[] |
package controllers;
import entities.Question;
import entities.Test;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.fxml.Initializable;
import javafx.scene.Scene;
import javafx.scene.control.*;
import javafx.scene.text.Font;
import javafx.stage.Stage;
import services.TestService;
import java.io.IOException;
import java.net.URL;
import java.time.LocalDate;
import java.util.List;
import java.util.ResourceBundle;
public class EditTestController implements Initializable {
@FXML
private TextField titleField;
@FXML
private DatePicker startDatePicker;
@FXML
private DatePicker endDatePicker;
@FXML
private TextField timeField;
@FXML
private CheckBox selfCorrectingCheckBox;
@FXML
private CheckBox showResultCheckBox;
@FXML
private Label messageLabel;
@FXML
private ListView<Question> questionListView;
@FXML
private Button bCancel;
@FXML
private Button bSave;
@FXML
private Button bAdd;
@FXML
private Button bEdit;
@FXML
private Button bRemove;
private Test test;
@Override
public void initialize(URL location, ResourceBundle resources) {
messageLabel.setVisible(false);
bCancel.setOnAction(e -> cancelAction());
bSave.setOnAction(e -> saveAction());
bAdd.setOnAction(e -> addAction());
bEdit.setOnAction(e -> editAction());
bRemove.setOnAction(e -> removeAction());
System.setProperty("prism.lcdtext", "false");
System.setProperty("prism.text", "t2k");
titleField.setText(test.getTitle());
startDatePicker.setValue(test.getStartDate());
endDatePicker.setValue(test.getEndDate());
timeField.setText(String.valueOf(test.getTime()));
selfCorrectingCheckBox.setSelected(test.isSelfCorrecting());
showResultCheckBox.setSelected(test.isShowResult());
questionListView.getItems().addAll(test.getQuestionList());
timeField.textProperty().addListener((observable, oldValue, newValue) -> {
if (!newValue.matches("\\d*")) {
timeField.setText(newValue.replaceAll("[^\\d]", ""));
}
});
}
public void saveAction() {
if (validation()) {
String title = titleField.getText();
LocalDate startDate = startDatePicker.getValue();
LocalDate endDate = endDatePicker.getValue();
boolean selfCorrecting = selfCorrectingCheckBox.isSelected();
boolean showResult = showResultCheckBox.isSelected();
List<Question> questionList = questionListView.getItems();
int time = 0;
if (timeField.getText() != null) time = Integer.parseInt(timeField.getText());
TestService testService = new TestService();
testService.editTest(test.getTestId(), title, startDate, endDate, time, selfCorrecting, showResult, questionList);
Stage stage = (Stage) titleField.getScene().getWindow();
stage.close();
}
}
public void addAction() {
try {
AddQuestionController questionController = new AddQuestionController();
questionController.setQuestionListView(questionListView);
FXMLLoader loader = new FXMLLoader(getClass().getResource("../view/addQuestion.fxml"));
loader.setController(questionController);
Stage stage = new Stage();
stage.setScene(new Scene(loader.load(), 820, 550));
stage.setTitle("Add Question");
stage.show();
} catch (IOException e) {
e.printStackTrace();
}
}
public void editAction() {
Question selectedQuestion = questionListView.getSelectionModel().getSelectedItem();
if (selectedQuestion != null) {
try {
EditQuestionController questionController = new EditQuestionController();
questionController.setQuestion(selectedQuestion);
questionController.setQuestionListView(questionListView);
FXMLLoader loader = new FXMLLoader(getClass().getResource("../view/editQuestion.fxml"));
loader.setController(questionController);
Stage stage = new Stage();
stage.setScene(new Scene(loader.load(), 800, 600));
stage.setTitle("Edit Question");
stage.show();
messageLabel.setVisible(false);
} catch (IOException e) {
e.printStackTrace();
}
} else {
messageLabel.setVisible(true);
messageLabel.setText("No Question selected!");
}
}
public void removeAction() {
Question selectedQuestion = questionListView.getSelectionModel().getSelectedItem();
if (selectedQuestion != null) {
questionListView.getItems().remove(selectedQuestion);
messageLabel.setVisible(false);
} else {
messageLabel.setVisible(true);
messageLabel.setText("No Question selected!");
}
}
public void cancelAction() {
Stage stage = (Stage) titleField.getScene().getWindow();
stage.close();
}
private boolean validation() {
String title = titleField.getText().trim();
LocalDate startDate = startDatePicker.getValue();
LocalDate endDate = endDatePicker.getValue();
if (title.length() > 0) {
if (startDate != null && endDate != null) {
if (startDate.isBefore(endDate)) {
return true;
} else {
messageLabel.setVisible(true);
messageLabel.setText("Start Date must be before End Date!");
}
} else {
messageLabel.setVisible(true);
messageLabel.setText("Date fields cannot be blank!");
}
} else {
messageLabel.setVisible(true);
messageLabel.setText("Title field cannot be blank!");
}
return false;
}
public void setTest(Test test) {
this.test = test;
}
}
| 6,184 | 0.616753 | 0.614327 | 181 | 33.165745 | 25.671213 | 126 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.651934 | false | false |
12
|
d5cea320c27672b90347cf1fcb9932a34918074f
| 23,991,687,324,153 |
e92cc76df8a7fd4cc3a9f2c18e3646adba16c0f2
|
/Consumer/src/main/java/vn/tecapro/example/springjms/service/OrderService.java
|
bccad9d68922b06e2d1045d3b9dadbd1b320a7f5
|
[] |
no_license
|
chenhuang511/queue-pubsub-client
|
https://github.com/chenhuang511/queue-pubsub-client
|
f727d34f0ccf467a3633433998bde134132c9e0d
|
105ae9244c50067a1b8825bae01e1b5468fd363d
|
refs/heads/master
| 2022-07-08T22:46:24.320000 | 2016-07-28T06:57:19 | 2016-07-28T06:57:19 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package vn.tecapro.example.springjms.service;
import vn.tecapro.example.springjms.model.Product;
/**
* Created by HoangTD on 7/26/2016.
*/
public interface OrderService {
public void processOrder(Product product);
}
|
UTF-8
|
Java
| 224 |
java
|
OrderService.java
|
Java
|
[
{
"context": "xample.springjms.model.Product;\n\n/**\n * Created by HoangTD on 7/26/2016.\n */\npublic interface OrderService {",
"end": 124,
"score": 0.9995697140693665,
"start": 117,
"tag": "USERNAME",
"value": "HoangTD"
}
] | null |
[] |
package vn.tecapro.example.springjms.service;
import vn.tecapro.example.springjms.model.Product;
/**
* Created by HoangTD on 7/26/2016.
*/
public interface OrderService {
public void processOrder(Product product);
}
| 224 | 0.758929 | 0.727679 | 10 | 21.4 | 20.655266 | 50 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.3 | false | false |
12
|
33aea40a91d0b3e185c489b9006fc696281cdef2
| 28,037,546,513,890 |
071e60a9537ab5baf3c0ab911202a4da02a7fc6f
|
/src/test/java/com/stashya/web/rest/KResourceIntTest.java
|
bbe1acec5bf9fb44b98b92f94047eeb52e01a1ac
|
[] |
no_license
|
BulkSecurityGeneratorProject/newblog
|
https://github.com/BulkSecurityGeneratorProject/newblog
|
c94c1d7a8d41303b2ad74fdafee1e7648d59f56f
|
788cb44d03e77e2b7c78f27e8e1c093c77a97ce8
|
refs/heads/master
| 2022-12-11T09:44:56.486000 | 2017-06-30T11:03:14 | 2017-06-30T11:03:14 | 296,606,927 | 0 | 0 | null | true | 2020-09-18T11:53:03 | 2020-09-18T11:53:02 | 2017-06-30T10:50:57 | 2017-06-30T11:06:06 | 4,178 | 0 | 0 | 0 | null | false | false |
package com.stashya.web.rest;
import com.stashya.AbstractCassandraTest;
import com.stashya.BlogApp;
import com.stashya.domain.K;
import com.stashya.repository.KRepository;
import com.stashya.web.rest.errors.ExceptionTranslator;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.MockitoAnnotations;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.data.web.PageableHandlerMethodArgumentResolver;
import org.springframework.http.MediaType;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import java.util.List;
import java.util.UUID;
import static org.assertj.core.api.Assertions.assertThat;
import static org.hamcrest.Matchers.hasItem;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*;
/**
* Test class for the KResource REST controller.
*
* @see KResource
*/
@RunWith(SpringRunner.class)
@SpringBootTest(classes = BlogApp.class)
public class KResourceIntTest extends AbstractCassandraTest {
@Autowired
private KRepository kRepository;
@Autowired
private MappingJackson2HttpMessageConverter jacksonMessageConverter;
@Autowired
private PageableHandlerMethodArgumentResolver pageableArgumentResolver;
@Autowired
private ExceptionTranslator exceptionTranslator;
private MockMvc restKMockMvc;
private K k;
@Before
public void setup() {
MockitoAnnotations.initMocks(this);
KResource kResource = new KResource(kRepository);
this.restKMockMvc = MockMvcBuilders.standaloneSetup(kResource)
.setCustomArgumentResolvers(pageableArgumentResolver)
.setControllerAdvice(exceptionTranslator)
.setMessageConverters(jacksonMessageConverter).build();
}
/**
* Create an entity for this test.
*
* This is a static method, as tests for other entities might also need it,
* if they test an entity which requires the current entity.
*/
public static K createEntity() {
K k = new K();
return k;
}
@Before
public void initTest() {
kRepository.deleteAll();
k = createEntity();
}
@Test
public void createK() throws Exception {
int databaseSizeBeforeCreate = kRepository.findAll().size();
// Create the K
restKMockMvc.perform(post("/api/ks")
.contentType(TestUtil.APPLICATION_JSON_UTF8)
.content(TestUtil.convertObjectToJsonBytes(k)))
.andExpect(status().isCreated());
// Validate the K in the database
List<K> kList = kRepository.findAll();
assertThat(kList).hasSize(databaseSizeBeforeCreate + 1);
K testK = kList.get(kList.size() - 1);
}
@Test
public void createKWithExistingId() throws Exception {
int databaseSizeBeforeCreate = kRepository.findAll().size();
// Create the K with an existing ID
k.setId(UUID.randomUUID());
// An entity with an existing ID cannot be created, so this API call must fail
restKMockMvc.perform(post("/api/ks")
.contentType(TestUtil.APPLICATION_JSON_UTF8)
.content(TestUtil.convertObjectToJsonBytes(k)))
.andExpect(status().isBadRequest());
// Validate the Alice in the database
List<K> kList = kRepository.findAll();
assertThat(kList).hasSize(databaseSizeBeforeCreate);
}
@Test
public void getAllKS() throws Exception {
// Initialize the database
kRepository.save(k);
// Get all the kList
restKMockMvc.perform(get("/api/ks"))
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))
.andExpect(jsonPath("$.[*].id").value(hasItem(k.getId().toString())));
}
@Test
public void getK() throws Exception {
// Initialize the database
kRepository.save(k);
// Get the k
restKMockMvc.perform(get("/api/ks/{id}", k.getId()))
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))
.andExpect(jsonPath("$.id").value(k.getId().toString()));
}
@Test
public void getNonExistingK() throws Exception {
// Get the k
restKMockMvc.perform(get("/api/ks/{id}", UUID.randomUUID().toString()))
.andExpect(status().isNotFound());
}
@Test
public void updateK() throws Exception {
// Initialize the database
kRepository.save(k);
int databaseSizeBeforeUpdate = kRepository.findAll().size();
// Update the k
K updatedK = kRepository.findOne(k.getId());
restKMockMvc.perform(put("/api/ks")
.contentType(TestUtil.APPLICATION_JSON_UTF8)
.content(TestUtil.convertObjectToJsonBytes(updatedK)))
.andExpect(status().isOk());
// Validate the K in the database
List<K> kList = kRepository.findAll();
assertThat(kList).hasSize(databaseSizeBeforeUpdate);
K testK = kList.get(kList.size() - 1);
}
@Test
public void updateNonExistingK() throws Exception {
int databaseSizeBeforeUpdate = kRepository.findAll().size();
// Create the K
// If the entity doesn't have an ID, it will be created instead of just being updated
restKMockMvc.perform(put("/api/ks")
.contentType(TestUtil.APPLICATION_JSON_UTF8)
.content(TestUtil.convertObjectToJsonBytes(k)))
.andExpect(status().isCreated());
// Validate the K in the database
List<K> kList = kRepository.findAll();
assertThat(kList).hasSize(databaseSizeBeforeUpdate + 1);
}
@Test
public void deleteK() throws Exception {
// Initialize the database
kRepository.save(k);
int databaseSizeBeforeDelete = kRepository.findAll().size();
// Get the k
restKMockMvc.perform(delete("/api/ks/{id}", k.getId())
.accept(TestUtil.APPLICATION_JSON_UTF8))
.andExpect(status().isOk());
// Validate the database is empty
List<K> kList = kRepository.findAll();
assertThat(kList).hasSize(databaseSizeBeforeDelete - 1);
}
@Test
public void equalsVerifier() throws Exception {
TestUtil.equalsVerifier(K.class);
K k1 = new K();
k1.setId(UUID.randomUUID());
K k2 = new K();
k2.setId(k1.getId());
assertThat(k1).isEqualTo(k2);
k2.setId(UUID.randomUUID());
assertThat(k1).isNotEqualTo(k2);
k1.setId(null);
assertThat(k1).isNotEqualTo(k2);
}
}
|
UTF-8
|
Java
| 7,069 |
java
|
KResourceIntTest.java
|
Java
|
[] | null |
[] |
package com.stashya.web.rest;
import com.stashya.AbstractCassandraTest;
import com.stashya.BlogApp;
import com.stashya.domain.K;
import com.stashya.repository.KRepository;
import com.stashya.web.rest.errors.ExceptionTranslator;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.MockitoAnnotations;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.data.web.PageableHandlerMethodArgumentResolver;
import org.springframework.http.MediaType;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import java.util.List;
import java.util.UUID;
import static org.assertj.core.api.Assertions.assertThat;
import static org.hamcrest.Matchers.hasItem;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*;
/**
* Test class for the KResource REST controller.
*
* @see KResource
*/
@RunWith(SpringRunner.class)
@SpringBootTest(classes = BlogApp.class)
public class KResourceIntTest extends AbstractCassandraTest {
@Autowired
private KRepository kRepository;
@Autowired
private MappingJackson2HttpMessageConverter jacksonMessageConverter;
@Autowired
private PageableHandlerMethodArgumentResolver pageableArgumentResolver;
@Autowired
private ExceptionTranslator exceptionTranslator;
private MockMvc restKMockMvc;
private K k;
@Before
public void setup() {
MockitoAnnotations.initMocks(this);
KResource kResource = new KResource(kRepository);
this.restKMockMvc = MockMvcBuilders.standaloneSetup(kResource)
.setCustomArgumentResolvers(pageableArgumentResolver)
.setControllerAdvice(exceptionTranslator)
.setMessageConverters(jacksonMessageConverter).build();
}
/**
* Create an entity for this test.
*
* This is a static method, as tests for other entities might also need it,
* if they test an entity which requires the current entity.
*/
public static K createEntity() {
K k = new K();
return k;
}
@Before
public void initTest() {
kRepository.deleteAll();
k = createEntity();
}
@Test
public void createK() throws Exception {
int databaseSizeBeforeCreate = kRepository.findAll().size();
// Create the K
restKMockMvc.perform(post("/api/ks")
.contentType(TestUtil.APPLICATION_JSON_UTF8)
.content(TestUtil.convertObjectToJsonBytes(k)))
.andExpect(status().isCreated());
// Validate the K in the database
List<K> kList = kRepository.findAll();
assertThat(kList).hasSize(databaseSizeBeforeCreate + 1);
K testK = kList.get(kList.size() - 1);
}
@Test
public void createKWithExistingId() throws Exception {
int databaseSizeBeforeCreate = kRepository.findAll().size();
// Create the K with an existing ID
k.setId(UUID.randomUUID());
// An entity with an existing ID cannot be created, so this API call must fail
restKMockMvc.perform(post("/api/ks")
.contentType(TestUtil.APPLICATION_JSON_UTF8)
.content(TestUtil.convertObjectToJsonBytes(k)))
.andExpect(status().isBadRequest());
// Validate the Alice in the database
List<K> kList = kRepository.findAll();
assertThat(kList).hasSize(databaseSizeBeforeCreate);
}
@Test
public void getAllKS() throws Exception {
// Initialize the database
kRepository.save(k);
// Get all the kList
restKMockMvc.perform(get("/api/ks"))
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))
.andExpect(jsonPath("$.[*].id").value(hasItem(k.getId().toString())));
}
@Test
public void getK() throws Exception {
// Initialize the database
kRepository.save(k);
// Get the k
restKMockMvc.perform(get("/api/ks/{id}", k.getId()))
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))
.andExpect(jsonPath("$.id").value(k.getId().toString()));
}
@Test
public void getNonExistingK() throws Exception {
// Get the k
restKMockMvc.perform(get("/api/ks/{id}", UUID.randomUUID().toString()))
.andExpect(status().isNotFound());
}
@Test
public void updateK() throws Exception {
// Initialize the database
kRepository.save(k);
int databaseSizeBeforeUpdate = kRepository.findAll().size();
// Update the k
K updatedK = kRepository.findOne(k.getId());
restKMockMvc.perform(put("/api/ks")
.contentType(TestUtil.APPLICATION_JSON_UTF8)
.content(TestUtil.convertObjectToJsonBytes(updatedK)))
.andExpect(status().isOk());
// Validate the K in the database
List<K> kList = kRepository.findAll();
assertThat(kList).hasSize(databaseSizeBeforeUpdate);
K testK = kList.get(kList.size() - 1);
}
@Test
public void updateNonExistingK() throws Exception {
int databaseSizeBeforeUpdate = kRepository.findAll().size();
// Create the K
// If the entity doesn't have an ID, it will be created instead of just being updated
restKMockMvc.perform(put("/api/ks")
.contentType(TestUtil.APPLICATION_JSON_UTF8)
.content(TestUtil.convertObjectToJsonBytes(k)))
.andExpect(status().isCreated());
// Validate the K in the database
List<K> kList = kRepository.findAll();
assertThat(kList).hasSize(databaseSizeBeforeUpdate + 1);
}
@Test
public void deleteK() throws Exception {
// Initialize the database
kRepository.save(k);
int databaseSizeBeforeDelete = kRepository.findAll().size();
// Get the k
restKMockMvc.perform(delete("/api/ks/{id}", k.getId())
.accept(TestUtil.APPLICATION_JSON_UTF8))
.andExpect(status().isOk());
// Validate the database is empty
List<K> kList = kRepository.findAll();
assertThat(kList).hasSize(databaseSizeBeforeDelete - 1);
}
@Test
public void equalsVerifier() throws Exception {
TestUtil.equalsVerifier(K.class);
K k1 = new K();
k1.setId(UUID.randomUUID());
K k2 = new K();
k2.setId(k1.getId());
assertThat(k1).isEqualTo(k2);
k2.setId(UUID.randomUUID());
assertThat(k1).isNotEqualTo(k2);
k1.setId(null);
assertThat(k1).isNotEqualTo(k2);
}
}
| 7,069 | 0.665158 | 0.661197 | 214 | 32.032711 | 25.198166 | 93 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.397196 | false | false |
12
|
03ea4cf3d65b2840f5397279063f12ac5085aa4c
| 9,912,784,528,742 |
5c2c1692afa95ef3f3947be791cb9741ab3dacd1
|
/Unidade3/src/br/ufscar/si/poo/cap3/excecoes/TesteDivisao.java
|
725a3941cb532ef172c5475e0bd53c78916881f7
|
[] |
no_license
|
delanobeder/POO-Java
|
https://github.com/delanobeder/POO-Java
|
d353449f04dc3e3d0be3caf77055ef049bd8da15
|
8ffb01da0173e08a3b58fbe5d775e116a52f2463
|
refs/heads/master
| 2021-05-27T08:20:53.053000 | 2013-11-06T15:17:57 | 2013-11-06T15:17:57 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package br.ufscar.si.poo.cap3.excecoes;
/**
* Classe TesteDivisao
*
* @author Delano Medeiros Beder
*/
public class TesteDivisao {
public double divisao(double num, int den) throws DivideByZeroException {
if (den == 0) {
throw new DivideByZeroException();
}
return num / den;
}
public void usaDivisao(double x, int y) throws DivideByZeroException {
try {
divisao(x, y);
} catch (DivideByZeroException dbze) {
throw dbze;
}
}
}
|
UTF-8
|
Java
| 535 |
java
|
TesteDivisao.java
|
Java
|
[
{
"context": "cecoes;\n\n\n/**\n * Classe TesteDivisao\n *\n * @author Delano Medeiros Beder\n */\npublic class TesteDivisao {\n\n public doubl",
"end": 104,
"score": 0.999891459941864,
"start": 83,
"tag": "NAME",
"value": "Delano Medeiros Beder"
}
] | null |
[] |
package br.ufscar.si.poo.cap3.excecoes;
/**
* Classe TesteDivisao
*
* @author <NAME>
*/
public class TesteDivisao {
public double divisao(double num, int den) throws DivideByZeroException {
if (den == 0) {
throw new DivideByZeroException();
}
return num / den;
}
public void usaDivisao(double x, int y) throws DivideByZeroException {
try {
divisao(x, y);
} catch (DivideByZeroException dbze) {
throw dbze;
}
}
}
| 520 | 0.588785 | 0.585047 | 25 | 20.4 | 21.683174 | 77 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.32 | false | false |
12
|
47dae168da238625562ea8c533c7c5aa7bdd481d
| 25,821,343,427,227 |
411e6927d353277f446493d0db4a9313c7f7bf3d
|
/src/main/java/io/github/suppliers/service/mapper/RegisteredSupplierMapper.java
|
9fabf5f04342ccbe78a36188150501e19a9add2c
|
[
"MIT"
] |
permissive
|
prepayments/prepayments_supplier_catalogue
|
https://github.com/prepayments/prepayments_supplier_catalogue
|
b121e540d516708b62a09c6eb20118bfe674e022
|
8c6ad6deddc98423319a7d392d2b7ad421573073
|
refs/heads/master
| 2020-05-18T08:34:35.825000 | 2019-05-14T15:57:12 | 2019-05-14T15:57:12 | 184,298,607 | 0 | 0 | null | false | 2019-04-30T16:49:20 | 2019-04-30T16:47:36 | 2019-04-30T16:48:33 | 2019-04-30T16:49:19 | 0 | 0 | 0 | 0 |
Java
| false | false |
package io.github.suppliers.service.mapper;
import io.github.suppliers.domain.RegisteredSupplier;
import io.github.suppliers.service.dto.RegisteredSupplierDTO;
import org.mapstruct.Mapper;
/**
* Mapper for the entity RegisteredSupplier and its DTO RegisteredSupplierDTO.
*/
@Mapper(componentModel = "spring", uses = {})
public interface RegisteredSupplierMapper extends EntityMapper<RegisteredSupplierDTO, RegisteredSupplier> {
default RegisteredSupplier fromId(Long id) {
if (id == null) {
return null;
}
RegisteredSupplier registeredSupplier = new RegisteredSupplier();
registeredSupplier.setId(id);
return registeredSupplier;
}
}
|
UTF-8
|
Java
| 699 |
java
|
RegisteredSupplierMapper.java
|
Java
|
[] | null |
[] |
package io.github.suppliers.service.mapper;
import io.github.suppliers.domain.RegisteredSupplier;
import io.github.suppliers.service.dto.RegisteredSupplierDTO;
import org.mapstruct.Mapper;
/**
* Mapper for the entity RegisteredSupplier and its DTO RegisteredSupplierDTO.
*/
@Mapper(componentModel = "spring", uses = {})
public interface RegisteredSupplierMapper extends EntityMapper<RegisteredSupplierDTO, RegisteredSupplier> {
default RegisteredSupplier fromId(Long id) {
if (id == null) {
return null;
}
RegisteredSupplier registeredSupplier = new RegisteredSupplier();
registeredSupplier.setId(id);
return registeredSupplier;
}
}
| 699 | 0.738197 | 0.738197 | 22 | 30.772728 | 29.673882 | 107 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.454545 | false | false |
12
|
0f62ab8a88821f4ac2fe582359c0d4483bde9924
| 678,604,864,614 |
623dffc8e04d52c3ae1b7b77196c75d5d6103e76
|
/src/org/unbiquitous/uos/core/messageEngine/messages/Notify.java
|
7c0895051a4ee9063898512856b2d35fe3759113
|
[] |
no_license
|
lhsantos/uos_core
|
https://github.com/lhsantos/uos_core
|
9248660d2786a3617a98d82e4cff1be0404dfaa9
|
f9e0608c80f8c70350437b774531e84c4cd37af5
|
refs/heads/master
| 2021-01-18T11:23:19.475000 | 2014-08-23T18:31:21 | 2014-08-23T18:31:21 | 25,847,869 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package org.unbiquitous.uos.core.messageEngine.messages;
import static org.unbiquitous.uos.core.ClassLoaderUtils.compare;
import java.util.HashMap;
import java.util.Map;
import org.unbiquitous.json.JSONException;
import org.unbiquitous.json.JSONObject;
public class Notify extends Message {
private String eventKey;
private String driver;
private String instanceId;
private Map<String, Object> parameters;
public Notify() {
setType(Message.Type.NOTIFY);
}
public Notify(String eventKey) {
this();
this.eventKey = eventKey;
}
public Notify(String eventKey, String driver) {
this(eventKey);
this.driver = driver;
}
public Notify(String eventKey, String driver, String instanceId) {
this(eventKey, driver);
this.instanceId = instanceId;
}
/**
* @return the eventKey
*/
public String getEventKey() {
return eventKey;
}
/**
* @param eventKey the eventKey to set
*/
public void setEventKey(String eventKey) {
this.eventKey = eventKey;
}
/**
* @return the parameters
*/
public Map<String, Object> getParameters() {
return parameters;
}
/**
* @param parameters the parameters to set
*/
public void setParameters(Map<String, Object> parameters) {
this.parameters = parameters;
}
public Notify addParameter(String key, String value){
return this.addParameter(key, (Object)value);
}
public Notify addParameter(String key, Number value){
return this.addParameter(key, (Object)value);
}
private Notify addParameter(String key, Object value){
if (parameters == null){
parameters = new HashMap<String, Object>();
}
parameters.put(key, value);
return this;
}
public Object getParameter(String key){
if (parameters != null){
return parameters.get(key);
}
return null;
}
@Override
public boolean equals(Object obj) {
if (obj == null){
return false;
}
if (!( obj instanceof Notify)){
return false;
}
Notify temp = (Notify) obj;
if(!compare(this.eventKey,temp.eventKey)) return false;
if(!compare(this.driver,temp.driver)) return false;
if(!compare(this.instanceId,temp.instanceId)) return false;
if(!compare(this.parameters,temp.parameters)) return false;
return true;
}
@Override
public int hashCode() {
int hash = 0;
if (this.eventKey != null){
hash += this.eventKey.hashCode();
}
if (this.driver != null){
hash += this.driver.hashCode();
}
if (this.instanceId != null){
hash += this.instanceId.hashCode();
}
return hash;
}
/**
* @return the driver
*/
public String getDriver() {
return driver;
}
/**
* @param driver the driver to set
*/
public void setDriver(String driver) {
this.driver = driver;
}
/**
* @return the instanceId
*/
public String getInstanceId() {
return instanceId;
}
/**
* @param instanceId the instanceId to set
*/
public void setInstanceId(String instanceId) {
this.instanceId = instanceId;
}
public JSONObject toJSON() throws JSONException {
JSONObject json = super.toJSON();
json.put("eventKey",this.eventKey);
json.put("driver",this.driver);
json.put("instanceId",this.instanceId);
if (this.parameters != null)
json.put("parameters",this.parameters);
return json;
}
public static Notify fromJSON(JSONObject json) throws JSONException {
Notify e = new Notify();
Message.fromJSON(e, json);
e.setEventKey(json.optString("eventKey",null));
e.setDriver(json.optString("driver",null));
e.setInstanceId(json.optString("instanceId",null));
if(json.has("parameters")){
e.parameters = json.optJSONObject("parameters").toMap();
}
return e;
}
@Override
public String toString() {
try {
return toJSON().toString();
} catch (JSONException e) {
return super.toString();
}
}
}
|
UTF-8
|
Java
| 3,955 |
java
|
Notify.java
|
Java
|
[] | null |
[] |
package org.unbiquitous.uos.core.messageEngine.messages;
import static org.unbiquitous.uos.core.ClassLoaderUtils.compare;
import java.util.HashMap;
import java.util.Map;
import org.unbiquitous.json.JSONException;
import org.unbiquitous.json.JSONObject;
public class Notify extends Message {
private String eventKey;
private String driver;
private String instanceId;
private Map<String, Object> parameters;
public Notify() {
setType(Message.Type.NOTIFY);
}
public Notify(String eventKey) {
this();
this.eventKey = eventKey;
}
public Notify(String eventKey, String driver) {
this(eventKey);
this.driver = driver;
}
public Notify(String eventKey, String driver, String instanceId) {
this(eventKey, driver);
this.instanceId = instanceId;
}
/**
* @return the eventKey
*/
public String getEventKey() {
return eventKey;
}
/**
* @param eventKey the eventKey to set
*/
public void setEventKey(String eventKey) {
this.eventKey = eventKey;
}
/**
* @return the parameters
*/
public Map<String, Object> getParameters() {
return parameters;
}
/**
* @param parameters the parameters to set
*/
public void setParameters(Map<String, Object> parameters) {
this.parameters = parameters;
}
public Notify addParameter(String key, String value){
return this.addParameter(key, (Object)value);
}
public Notify addParameter(String key, Number value){
return this.addParameter(key, (Object)value);
}
private Notify addParameter(String key, Object value){
if (parameters == null){
parameters = new HashMap<String, Object>();
}
parameters.put(key, value);
return this;
}
public Object getParameter(String key){
if (parameters != null){
return parameters.get(key);
}
return null;
}
@Override
public boolean equals(Object obj) {
if (obj == null){
return false;
}
if (!( obj instanceof Notify)){
return false;
}
Notify temp = (Notify) obj;
if(!compare(this.eventKey,temp.eventKey)) return false;
if(!compare(this.driver,temp.driver)) return false;
if(!compare(this.instanceId,temp.instanceId)) return false;
if(!compare(this.parameters,temp.parameters)) return false;
return true;
}
@Override
public int hashCode() {
int hash = 0;
if (this.eventKey != null){
hash += this.eventKey.hashCode();
}
if (this.driver != null){
hash += this.driver.hashCode();
}
if (this.instanceId != null){
hash += this.instanceId.hashCode();
}
return hash;
}
/**
* @return the driver
*/
public String getDriver() {
return driver;
}
/**
* @param driver the driver to set
*/
public void setDriver(String driver) {
this.driver = driver;
}
/**
* @return the instanceId
*/
public String getInstanceId() {
return instanceId;
}
/**
* @param instanceId the instanceId to set
*/
public void setInstanceId(String instanceId) {
this.instanceId = instanceId;
}
public JSONObject toJSON() throws JSONException {
JSONObject json = super.toJSON();
json.put("eventKey",this.eventKey);
json.put("driver",this.driver);
json.put("instanceId",this.instanceId);
if (this.parameters != null)
json.put("parameters",this.parameters);
return json;
}
public static Notify fromJSON(JSONObject json) throws JSONException {
Notify e = new Notify();
Message.fromJSON(e, json);
e.setEventKey(json.optString("eventKey",null));
e.setDriver(json.optString("driver",null));
e.setInstanceId(json.optString("instanceId",null));
if(json.has("parameters")){
e.parameters = json.optJSONObject("parameters").toMap();
}
return e;
}
@Override
public String toString() {
try {
return toJSON().toString();
} catch (JSONException e) {
return super.toString();
}
}
}
| 3,955 | 0.652086 | 0.651833 | 186 | 19.263441 | 18.786591 | 70 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.801075 | false | false |
12
|
e104e0a9e7dd8cbd5f6fb6bd5175bfd27b9d1793
| 21,663,815,084,697 |
eb1dcb2cd143de1dc4ab141d80b4faac70adb7f2
|
/java8-labs-home/java8-lambdas/src/main/java/org/lompo/labs/java8/lambdas/constructorreference/ConstuctorReferenceWithBiFunction.java
|
bf2951c5958c81837889549df5efd8eeeca0284b
|
[] |
no_license
|
alainlompo/java-8-focus-labs
|
https://github.com/alainlompo/java-8-focus-labs
|
ee34cfac7c0e8e73f6068dc664f2fdf69c37dc07
|
2553f28cf8a1533d49cacccc2aacf5bb8a12e111
|
refs/heads/master
| 2021-01-13T17:27:28.411000 | 2017-03-09T16:55:13 | 2017-03-09T16:55:13 | 37,966,059 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package org.lompo.labs.java8.lambdas.constructorreference;
import java.util.function.BiFunction;
import org.lompo.labs.java8.lambdas.Peach;
/**
* Illustrates the uses of constructor reference in BiFunction definitions, along with
* its lambda equivalent
* @author LOMPO
*
*/
public class ConstuctorReferenceWithBiFunction {
// BiFunction with constructor reference
public static final BiFunction<String, Integer, Peach> REFINED_FACTORY = Peach::new;
// Lambda expression with type inference
public static final BiFunction<String, Integer, Peach> FINE_FACTORY = (color, weight) -> new Peach(color,weight);
public static Peach getFinePeach(String color, int weight, BiFunction<String, Integer, Peach> factory) {
return factory.apply(color, weight);
}
public static void main(String[] args) {
Peach refinedPeach = getFinePeach("Green", 450, REFINED_FACTORY);
Peach finePeach = getFinePeach("Green", 450, FINE_FACTORY);
assert (finePeach.getColor().equals(refinedPeach.getColor())) && (finePeach.getWeight() == refinedPeach.getWeight());
}
}
|
UTF-8
|
Java
| 1,078 |
java
|
ConstuctorReferenceWithBiFunction.java
|
Java
|
[
{
"context": "ns, along with\n * its lambda equivalent\n * @author LOMPO\n *\n */\npublic class ConstuctorReferenceWithBiFunc",
"end": 275,
"score": 0.9062597155570984,
"start": 270,
"tag": "USERNAME",
"value": "LOMPO"
}
] | null |
[] |
package org.lompo.labs.java8.lambdas.constructorreference;
import java.util.function.BiFunction;
import org.lompo.labs.java8.lambdas.Peach;
/**
* Illustrates the uses of constructor reference in BiFunction definitions, along with
* its lambda equivalent
* @author LOMPO
*
*/
public class ConstuctorReferenceWithBiFunction {
// BiFunction with constructor reference
public static final BiFunction<String, Integer, Peach> REFINED_FACTORY = Peach::new;
// Lambda expression with type inference
public static final BiFunction<String, Integer, Peach> FINE_FACTORY = (color, weight) -> new Peach(color,weight);
public static Peach getFinePeach(String color, int weight, BiFunction<String, Integer, Peach> factory) {
return factory.apply(color, weight);
}
public static void main(String[] args) {
Peach refinedPeach = getFinePeach("Green", 450, REFINED_FACTORY);
Peach finePeach = getFinePeach("Green", 450, FINE_FACTORY);
assert (finePeach.getColor().equals(refinedPeach.getColor())) && (finePeach.getWeight() == refinedPeach.getWeight());
}
}
| 1,078 | 0.752319 | 0.744898 | 33 | 31.666666 | 36.620632 | 119 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.484848 | false | false |
12
|
3c03b56e68d8b851f5e35cd6edb283101a300db5
| 16,939,351,025,949 |
081db3741025a3bff71e87147adc5361f65406a8
|
/src/ch10/Odd.java
|
247b82d5517d17479efd19c059cbbbc7095da35d
|
[] |
no_license
|
Eyan123/javasource
|
https://github.com/Eyan123/javasource
|
66046c853686fed25783a55ffaf23e496e21d5c0
|
a885749d17ce758a62e431d7bf897140bff8a39c
|
refs/heads/master
| 2023-04-10T21:54:53.772000 | 2021-04-14T04:00:16 | 2021-04-14T04:00:16 | 357,111,328 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package ch10;
public class Odd extends OddDetector {
public Odd(int n) {
super(n);
}
@Override
public boolean isOdd() {
if (super.n % 2 == 0) {
System.out.println(super.n);
System.out.println("홀수가 아닙니다");
return false;
} else {
System.out.println("홀수입니다");
return true;
}
}
}
|
UTF-8
|
Java
| 353 |
java
|
Odd.java
|
Java
|
[] | null |
[] |
package ch10;
public class Odd extends OddDetector {
public Odd(int n) {
super(n);
}
@Override
public boolean isOdd() {
if (super.n % 2 == 0) {
System.out.println(super.n);
System.out.println("홀수가 아닙니다");
return false;
} else {
System.out.println("홀수입니다");
return true;
}
}
}
| 353 | 0.574468 | 0.56231 | 21 | 13.666667 | 12.418624 | 38 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.666667 | false | false |
12
|
24c60656341472e5e9790a0c7448429275d66dae
| 24,404,004,185,891 |
cf1693c8339dd2c78877adb2234713f7bb114016
|
/src/main/java/logic/brick/GlassBrick.java
|
7721742e7bf0ebbf616e003816a87c536ad35578
|
[] |
no_license
|
Vasepulv/cc3002-breakout
|
https://github.com/Vasepulv/cc3002-breakout
|
7c3ed5bc1c2621103cb85f5bd8a6944b4ade9da4
|
57be1e401e23c137cddb7f3bc16d5ddf010ec327
|
refs/heads/master
| 2020-04-07T02:45:56.561000 | 2018-12-27T17:41:25 | 2018-12-27T17:41:25 | 157,988,923 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package logic.brick;
import logic.update.BrickDestroyedUpdate;
/**
*
* @author Juan-Pablo Silva
*/
public class GlassBrick extends AbstractBrick {
public GlassBrick() {
super(1, 50);
}
@Override
protected void sendUpdate() {
notifyObservers(new BrickDestroyedUpdate(this));
}
}
|
UTF-8
|
Java
| 320 |
java
|
GlassBrick.java
|
Java
|
[
{
"context": "ic.update.BrickDestroyedUpdate;\n\n/**\n *\n * @author Juan-Pablo Silva\n */\npublic class GlassBrick extends AbstractBrick",
"end": 99,
"score": 0.9998481869697571,
"start": 83,
"tag": "NAME",
"value": "Juan-Pablo Silva"
}
] | null |
[] |
package logic.brick;
import logic.update.BrickDestroyedUpdate;
/**
*
* @author <NAME>
*/
public class GlassBrick extends AbstractBrick {
public GlassBrick() {
super(1, 50);
}
@Override
protected void sendUpdate() {
notifyObservers(new BrickDestroyedUpdate(this));
}
}
| 310 | 0.6625 | 0.653125 | 18 | 16.777779 | 17.45647 | 56 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.277778 | false | false |
12
|
5e3e7855e3c5c79e5e8fc73867998b92a7dbde39
| 31,662,498,917,193 |
9c03b546ea16a35ce1cbbb49714ddb745f6d193a
|
/app/src/main/java/com/example/administrator/afinal/Fragment/wode.java
|
6e8972d2d1934b86ecb9b5434629c2f114895e53
|
[] |
no_license
|
isBoom/final
|
https://github.com/isBoom/final
|
890565fd4ae2475e59aa4f22c6b154a61e94b812
|
04d16ad4f8c72e75a1dd51de00afaaf9759b3bc6
|
refs/heads/master
| 2020-09-24T01:33:13.171000 | 2019-12-03T13:46:58 | 2019-12-03T13:46:58 | 225,630,159 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.example.administrator.afinal.Fragment;
import android.support.v4.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
/**
* Created by Administrator on 2019/12/3.
*/
public class wode extends Fragment {
public wode() {
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
return super.onCreateView(inflater, container, savedInstanceState);
}
}
|
UTF-8
|
Java
| 529 |
java
|
wode.java
|
Java
|
[] | null |
[] |
package com.example.administrator.afinal.Fragment;
import android.support.v4.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
/**
* Created by Administrator on 2019/12/3.
*/
public class wode extends Fragment {
public wode() {
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
return super.onCreateView(inflater, container, savedInstanceState);
}
}
| 529 | 0.754253 | 0.73913 | 21 | 24.190475 | 26.652292 | 103 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.52381 | false | false |
12
|
475c7eb2da26a783407762ec7512c4101841b372
| 33,036,888,454,438 |
93da011421790f519dbf15af19211dff5176822f
|
/src/br/com/haila/formulario/FTriagem.java
|
1eca383562bb1a1bf01a76d8cf3c7896c7592f01
|
[] |
no_license
|
hailamello200/ProjetoHospital
|
https://github.com/hailamello200/ProjetoHospital
|
50f47c15d5b2bdd60688220c2801154462b2372e
|
4ec11922d1dcbce690c1edb68216654b2c332daf
|
refs/heads/master
| 2020-03-21T06:24:27.870000 | 2018-06-21T20:18:17 | 2018-06-21T20:18:17 | 138,217,424 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package br.com.haila.formulario;
import Singleton.SEnfermeira;
import Singleton.SPaciente;
import Singleton.STriagem;
import br.com.haila.objeto.Enfermeira;
import br.com.haila.objeto.Paciente;
import br.com.haila.objeto.Triagem;
import javax.swing.JOptionPane;
/**
*
* @author SATC
*/
public class FTriagem extends javax.swing.JFrame {
/**
* Creates new form Triagem
*/
public FTriagem() {
initComponents();
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jLabel1 = new javax.swing.JLabel();
jPanel1 = new javax.swing.JPanel();
jTAlergias = new javax.swing.JTextField();
jTEnfermeira = new javax.swing.JTextField();
jTPeso = new javax.swing.JTextField();
jTPaciente = new javax.swing.JTextField();
jTAltura = new javax.swing.JTextField();
jTPressao = new javax.swing.JTextField();
JTImc = new javax.swing.JTextField();
jTTemperatura = new javax.swing.JTextField();
jTFebre = new javax.swing.JTextField();
jTSintomas = new javax.swing.JTextField();
jLAlergias = new javax.swing.JLabel();
jLEnfermeira = new javax.swing.JLabel();
jLPeso = new javax.swing.JLabel();
jLPaciente = new javax.swing.JLabel();
jLAltura = new javax.swing.JLabel();
jLPressao = new javax.swing.JLabel();
jLImc = new javax.swing.JLabel();
jLTemperatura = new javax.swing.JLabel();
jLFebre = new javax.swing.JLabel();
jLSintomas = new javax.swing.JLabel();
jBCadastrar = new javax.swing.JButton();
jBMostrar = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jLabel1.setFont(new java.awt.Font("Tahoma", 1, 24)); // NOI18N
jLabel1.setText("Triagem ");
jPanel1.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED, new java.awt.Color(240, 240, 240), null));
jTEnfermeira.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jTEnfermeiraActionPerformed(evt);
}
});
jLAlergias.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
jLAlergias.setText("Alergias:");
jLAlergias.setName("jLAlergias"); // NOI18N
jLEnfermeira.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
jLEnfermeira.setText("Enfermeira:");
jLEnfermeira.setName("jLEnfermeira"); // NOI18N
jLPeso.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
jLPeso.setText("Peso:");
jLPeso.setName("jLPeso"); // NOI18N
jLPaciente.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
jLPaciente.setText("Paciente:");
jLPaciente.setName("jLPaciente"); // NOI18N
jLAltura.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
jLAltura.setText("Altura:");
jLAltura.setName("jLAltura"); // NOI18N
jLPressao.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
jLPressao.setText("Pressão:");
jLPressao.setName("jLPressao"); // NOI18N
jLImc.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
jLImc.setText("IMC:");
jLImc.setName("jLImc"); // NOI18N
jLTemperatura.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
jLTemperatura.setText("Temperatura:");
jLTemperatura.setName("jLTemperatura"); // NOI18N
jLFebre.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
jLFebre.setText("Febre:");
jLFebre.setName("jLFebre"); // NOI18N
jLSintomas.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
jLSintomas.setText("Sintomas:");
jLSintomas.setName("jLSintomas"); // NOI18N
jBCadastrar.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
jBCadastrar.setText("Cadastrar");
jBCadastrar.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jBCadastrarActionPerformed(evt);
}
});
jBMostrar.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
jBMostrar.setText("Mostrar");
jBMostrar.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jBMostrarActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jLSintomas)
.addComponent(jLTemperatura)
.addComponent(jLPressao)
.addComponent(jLPaciente)
.addComponent(jTEnfermeira, javax.swing.GroupLayout.DEFAULT_SIZE, 120, Short.MAX_VALUE)
.addComponent(jTPaciente)
.addComponent(jTPressao)
.addComponent(jTTemperatura)
.addComponent(jTSintomas))
.addGap(64, 64, 64)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jLAlergias)
.addComponent(jLPeso)
.addComponent(jLAltura)
.addComponent(jLImc)
.addComponent(jLFebre)
.addComponent(jTAlergias, javax.swing.GroupLayout.DEFAULT_SIZE, 109, Short.MAX_VALUE)
.addComponent(jTPeso)
.addComponent(jTAltura)
.addComponent(JTImc)
.addComponent(jTFebre)))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(132, 132, 132)
.addComponent(jBCadastrar)
.addGap(18, 18, 18)
.addComponent(jBMostrar)))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLEnfermeira)
.addContainerGap(236, Short.MAX_VALUE)))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLAlergias)
.addGap(7, 7, 7)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jTEnfermeira, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jTAlergias, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLPaciente)
.addComponent(jLPeso))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jTPaciente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jTPeso, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLPressao)
.addComponent(jLAltura))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jTPressao, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jTAltura, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLTemperatura)
.addComponent(jLImc))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jTTemperatura, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(JTImc, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLSintomas)
.addComponent(jLFebre))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jTSintomas, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jTFebre, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jBCadastrar)
.addComponent(jBMostrar))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(14, 14, 14)
.addComponent(jLEnfermeira)
.addContainerGap(311, Short.MAX_VALUE)))
);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(layout.createSequentialGroup()
.addGap(13, 13, 13)
.addComponent(jLabel1)))
.addContainerGap(15, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(20, 20, 20)
.addComponent(jLabel1)
.addGap(18, 18, 18)
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addContainerGap())
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void jTEnfermeiraActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTEnfermeiraActionPerformed
}//GEN-LAST:event_jTEnfermeiraActionPerformed
private void jBCadastrarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBCadastrarActionPerformed
Triagem triagem = null;
int codigPaciente = Integer.parseInt(jTPaciente.getText());
Paciente paciente = SPaciente.getInstance().getPacientes().get(codigPaciente);
int codigEnfermeira = Integer.parseInt(jTEnfermeira.getText());
Enfermeira enfermeira = SEnfermeira.getInstance().getEnfermeira().get(codigEnfermeira);
String pressao = jTPressao.getText();
float temperatura= Float.parseFloat(jTPressao.getText());
String sintomas = jTSintomas.getText();
String alergias = jTAlergias.getText();
float peso = Float.parseFloat(jTPeso.getText());
float altura = Float.parseFloat(jTAltura.getText());
float imc = Float.parseFloat(JTImc.getText());
Boolean febre = Boolean.parseBoolean(jTFebre.getText());
STriagem.getInstance().getTriagem().add(triagem);
}//GEN-LAST:event_jBCadastrarActionPerformed
private void jBMostrarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBMostrarActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jBMostrarActionPerformed
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(FTriagem.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(FTriagem.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(FTriagem.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(FTriagem.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new FTriagem().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JTextField JTImc;
private javax.swing.JButton jBCadastrar;
private javax.swing.JButton jBMostrar;
private javax.swing.JLabel jLAlergias;
private javax.swing.JLabel jLAltura;
private javax.swing.JLabel jLEnfermeira;
private javax.swing.JLabel jLFebre;
private javax.swing.JLabel jLImc;
private javax.swing.JLabel jLPaciente;
private javax.swing.JLabel jLPeso;
private javax.swing.JLabel jLPressao;
private javax.swing.JLabel jLSintomas;
private javax.swing.JLabel jLTemperatura;
private javax.swing.JLabel jLabel1;
private javax.swing.JPanel jPanel1;
private javax.swing.JTextField jTAlergias;
private javax.swing.JTextField jTAltura;
private javax.swing.JTextField jTEnfermeira;
private javax.swing.JTextField jTFebre;
private javax.swing.JTextField jTPaciente;
private javax.swing.JTextField jTPeso;
private javax.swing.JTextField jTPressao;
private javax.swing.JTextField jTSintomas;
private javax.swing.JTextField jTTemperatura;
// End of variables declaration//GEN-END:variables
}
|
UTF-8
|
Java
| 18,127 |
java
|
FTriagem.java
|
Java
|
[
{
"context": "import javax.swing.JOptionPane;\n\n/**\n *\n * @author SATC\n */\npublic class FTriagem extends javax.swing.JFr",
"end": 471,
"score": 0.9996709823608398,
"start": 467,
"tag": "USERNAME",
"value": "SATC"
}
] | null |
[] |
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package br.com.haila.formulario;
import Singleton.SEnfermeira;
import Singleton.SPaciente;
import Singleton.STriagem;
import br.com.haila.objeto.Enfermeira;
import br.com.haila.objeto.Paciente;
import br.com.haila.objeto.Triagem;
import javax.swing.JOptionPane;
/**
*
* @author SATC
*/
public class FTriagem extends javax.swing.JFrame {
/**
* Creates new form Triagem
*/
public FTriagem() {
initComponents();
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jLabel1 = new javax.swing.JLabel();
jPanel1 = new javax.swing.JPanel();
jTAlergias = new javax.swing.JTextField();
jTEnfermeira = new javax.swing.JTextField();
jTPeso = new javax.swing.JTextField();
jTPaciente = new javax.swing.JTextField();
jTAltura = new javax.swing.JTextField();
jTPressao = new javax.swing.JTextField();
JTImc = new javax.swing.JTextField();
jTTemperatura = new javax.swing.JTextField();
jTFebre = new javax.swing.JTextField();
jTSintomas = new javax.swing.JTextField();
jLAlergias = new javax.swing.JLabel();
jLEnfermeira = new javax.swing.JLabel();
jLPeso = new javax.swing.JLabel();
jLPaciente = new javax.swing.JLabel();
jLAltura = new javax.swing.JLabel();
jLPressao = new javax.swing.JLabel();
jLImc = new javax.swing.JLabel();
jLTemperatura = new javax.swing.JLabel();
jLFebre = new javax.swing.JLabel();
jLSintomas = new javax.swing.JLabel();
jBCadastrar = new javax.swing.JButton();
jBMostrar = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jLabel1.setFont(new java.awt.Font("Tahoma", 1, 24)); // NOI18N
jLabel1.setText("Triagem ");
jPanel1.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED, new java.awt.Color(240, 240, 240), null));
jTEnfermeira.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jTEnfermeiraActionPerformed(evt);
}
});
jLAlergias.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
jLAlergias.setText("Alergias:");
jLAlergias.setName("jLAlergias"); // NOI18N
jLEnfermeira.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
jLEnfermeira.setText("Enfermeira:");
jLEnfermeira.setName("jLEnfermeira"); // NOI18N
jLPeso.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
jLPeso.setText("Peso:");
jLPeso.setName("jLPeso"); // NOI18N
jLPaciente.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
jLPaciente.setText("Paciente:");
jLPaciente.setName("jLPaciente"); // NOI18N
jLAltura.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
jLAltura.setText("Altura:");
jLAltura.setName("jLAltura"); // NOI18N
jLPressao.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
jLPressao.setText("Pressão:");
jLPressao.setName("jLPressao"); // NOI18N
jLImc.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
jLImc.setText("IMC:");
jLImc.setName("jLImc"); // NOI18N
jLTemperatura.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
jLTemperatura.setText("Temperatura:");
jLTemperatura.setName("jLTemperatura"); // NOI18N
jLFebre.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
jLFebre.setText("Febre:");
jLFebre.setName("jLFebre"); // NOI18N
jLSintomas.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
jLSintomas.setText("Sintomas:");
jLSintomas.setName("jLSintomas"); // NOI18N
jBCadastrar.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
jBCadastrar.setText("Cadastrar");
jBCadastrar.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jBCadastrarActionPerformed(evt);
}
});
jBMostrar.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
jBMostrar.setText("Mostrar");
jBMostrar.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jBMostrarActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jLSintomas)
.addComponent(jLTemperatura)
.addComponent(jLPressao)
.addComponent(jLPaciente)
.addComponent(jTEnfermeira, javax.swing.GroupLayout.DEFAULT_SIZE, 120, Short.MAX_VALUE)
.addComponent(jTPaciente)
.addComponent(jTPressao)
.addComponent(jTTemperatura)
.addComponent(jTSintomas))
.addGap(64, 64, 64)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jLAlergias)
.addComponent(jLPeso)
.addComponent(jLAltura)
.addComponent(jLImc)
.addComponent(jLFebre)
.addComponent(jTAlergias, javax.swing.GroupLayout.DEFAULT_SIZE, 109, Short.MAX_VALUE)
.addComponent(jTPeso)
.addComponent(jTAltura)
.addComponent(JTImc)
.addComponent(jTFebre)))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(132, 132, 132)
.addComponent(jBCadastrar)
.addGap(18, 18, 18)
.addComponent(jBMostrar)))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLEnfermeira)
.addContainerGap(236, Short.MAX_VALUE)))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLAlergias)
.addGap(7, 7, 7)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jTEnfermeira, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jTAlergias, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLPaciente)
.addComponent(jLPeso))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jTPaciente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jTPeso, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLPressao)
.addComponent(jLAltura))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jTPressao, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jTAltura, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLTemperatura)
.addComponent(jLImc))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jTTemperatura, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(JTImc, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLSintomas)
.addComponent(jLFebre))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jTSintomas, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jTFebre, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jBCadastrar)
.addComponent(jBMostrar))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(14, 14, 14)
.addComponent(jLEnfermeira)
.addContainerGap(311, Short.MAX_VALUE)))
);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(layout.createSequentialGroup()
.addGap(13, 13, 13)
.addComponent(jLabel1)))
.addContainerGap(15, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(20, 20, 20)
.addComponent(jLabel1)
.addGap(18, 18, 18)
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addContainerGap())
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void jTEnfermeiraActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTEnfermeiraActionPerformed
}//GEN-LAST:event_jTEnfermeiraActionPerformed
private void jBCadastrarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBCadastrarActionPerformed
Triagem triagem = null;
int codigPaciente = Integer.parseInt(jTPaciente.getText());
Paciente paciente = SPaciente.getInstance().getPacientes().get(codigPaciente);
int codigEnfermeira = Integer.parseInt(jTEnfermeira.getText());
Enfermeira enfermeira = SEnfermeira.getInstance().getEnfermeira().get(codigEnfermeira);
String pressao = jTPressao.getText();
float temperatura= Float.parseFloat(jTPressao.getText());
String sintomas = jTSintomas.getText();
String alergias = jTAlergias.getText();
float peso = Float.parseFloat(jTPeso.getText());
float altura = Float.parseFloat(jTAltura.getText());
float imc = Float.parseFloat(JTImc.getText());
Boolean febre = Boolean.parseBoolean(jTFebre.getText());
STriagem.getInstance().getTriagem().add(triagem);
}//GEN-LAST:event_jBCadastrarActionPerformed
private void jBMostrarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBMostrarActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jBMostrarActionPerformed
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(FTriagem.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(FTriagem.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(FTriagem.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(FTriagem.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new FTriagem().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JTextField JTImc;
private javax.swing.JButton jBCadastrar;
private javax.swing.JButton jBMostrar;
private javax.swing.JLabel jLAlergias;
private javax.swing.JLabel jLAltura;
private javax.swing.JLabel jLEnfermeira;
private javax.swing.JLabel jLFebre;
private javax.swing.JLabel jLImc;
private javax.swing.JLabel jLPaciente;
private javax.swing.JLabel jLPeso;
private javax.swing.JLabel jLPressao;
private javax.swing.JLabel jLSintomas;
private javax.swing.JLabel jLTemperatura;
private javax.swing.JLabel jLabel1;
private javax.swing.JPanel jPanel1;
private javax.swing.JTextField jTAlergias;
private javax.swing.JTextField jTAltura;
private javax.swing.JTextField jTEnfermeira;
private javax.swing.JTextField jTFebre;
private javax.swing.JTextField jTPaciente;
private javax.swing.JTextField jTPeso;
private javax.swing.JTextField jTPressao;
private javax.swing.JTextField jTSintomas;
private javax.swing.JTextField jTTemperatura;
// End of variables declaration//GEN-END:variables
}
| 18,127 | 0.638806 | 0.626614 | 355 | 50.059155 | 35.887924 | 166 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.698592 | false | false |
12
|
434811702b50b16996485796bd9fffb1b7dfd1eb
| 36,146,444,790,651 |
3467111873a28e3c2c5f83bbc70ff0de4fa0001c
|
/app/src/main/java/com/whpe/qrcode/jiangxi_jian/activity/custombus/ActivityCustomBusToPay.java
|
7c06fea424f7896be08c8e7989947e4b440db0d6
|
[] |
no_license
|
henggenzuigao/jiangongjiao
|
https://github.com/henggenzuigao/jiangongjiao
|
f1a504a10daa4d14e549d868d70834b94b9f5b21
|
b6f04222c317848100f1fc1044799de1be68623e
|
refs/heads/master
| 2023-04-05T15:02:20.300000 | 2021-04-09T11:23:19 | 2021-04-09T11:23:19 | 356,211,379 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.whpe.qrcode.jiangxi_jian.activity.custombus;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.os.Handler;
import android.os.Message;
import android.text.TextUtils;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.BaseAdapter;
import android.widget.Button;
import android.widget.GridView;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import com.whpe.qrcode.jiangxi_jian.GYDZApplication;
import com.whpe.qrcode.jiangxi_jian.R;
import com.whpe.qrcode.jiangxi_jian.bigtools.AliPayResult;
import com.whpe.qrcode.jiangxi_jian.bigtools.GlobalConfig;
import com.whpe.qrcode.jiangxi_jian.bigtools.MyDrawableUtils;
import com.whpe.qrcode.jiangxi_jian.bigtools.PayUtils;
import com.whpe.qrcode.jiangxi_jian.net.JsonComomUtils;
import com.whpe.qrcode.jiangxi_jian.net.action.PayUnifyAction;
import com.whpe.qrcode.jiangxi_jian.net.action.cusbtombus.RemoveTicketOrderInfoAction;
import com.whpe.qrcode.jiangxi_jian.net.getbean.LoadQrcodeParamBean;
import com.whpe.qrcode.jiangxi_jian.net.getbean.custombus.GetGenerateTicketOrderInfoBean;
import com.whpe.qrcode.jiangxi_jian.net.getbean.payunity.AlipayBean;
import com.whpe.qrcode.jiangxi_jian.net.getbean.payunity.UnionBean;
import com.whpe.qrcode.jiangxi_jian.net.getbean.payunity.WeichatBean;
import com.whpe.qrcode.jiangxi_jian.parent.NormalTitleActivity;
import com.whpe.qrcode.jiangxi_jian.toolbean.PaytypeCustombusBean;
import com.whpe.qrcode.jiangxi_jian.toolbean.PaytypePrepayBean;
import com.whpe.qrcode.jiangxi_jian.toolbean.custombus.BusSelectDateBean;
import com.whpe.qrcode.jiangxi_jian.view.AlertDialog;
import com.whpe.qrcode.jiangxi_jian.view.adapter.CustombusPaytypeLvAdapter;
import com.whpe.qrcode.jiangxi_jian.view.adapter.MoneyGridAdapter;
import com.whpe.qrcode.jiangxi_jian.view.adapter.PaypursePaytypeLvAdapter;
import org.json.JSONException;
import org.json.JSONObject;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
* Created by yang on 2019/1/13.
*/
public class ActivityCustomBusToPay extends NormalTitleActivity implements RemoveTicketOrderInfoAction.Inter_removeTicketOrderInfo, View.OnClickListener, PayUnifyAction.Inter_queryqruserinfo {
public LoadQrcodeParamBean loadQrcodeParamBean=new LoadQrcodeParamBean();
private ArrayList<PaytypeCustombusBean> paytypeCustombusBeans=new ArrayList<>();
private CustombusPaytypeLvAdapter custombusPaytypeLvAdapter;
private Button btn_submit;
private ListView lv_paytype;
private boolean payflag=false;
private CountDownTimer timer;
private TextView tv_remaintime;
private TextView tv_ticketprice;
private GridView gv_seat;
private AlertDialog thisalertdialog;
private GetGenerateTicketOrderInfoBean getGenerateTicketOrderInfoBean=new GetGenerateTicketOrderInfoBean();
private TextView tv_ticketseat;
private String paycode="";
@Override
protected void afterLayout() {
super.afterLayout();
}
@Override
protected void beforeLayout() {
super.beforeLayout();
loadQrcodeParamBean = (LoadQrcodeParamBean) JsonComomUtils.parseAllInfo(sharePreferenceParam.getParamInfos(),loadQrcodeParamBean);
initCustombusPaytype();
thisalertdialog=new AlertDialog(this).builder().setCancelable(false);
}
private void initOhterUI() {
String price=new BigDecimal(getGenerateTicketOrderInfoBean.getTotalTicketPrice()).divide(new BigDecimal(100))
.toString();
String showprice=String.format("%.2f",Double.parseDouble(price));
tv_ticketprice.setText(getString(R.string.app_rmb)+showprice);
initGridSeat();
/*tv_ticketseat.setText(getString(R.string.custombustopay_layer)+getGenerateTicketOrderInfoBean.getTicketList().get(0).getLayerNo()
+getString(R.string.custombustopay_seat)+getGenerateTicketOrderInfoBean.getTicketList().get(0).getSeatNo());*/
timer = new CountDownTimer(180000,1000) {
@Override
public void onTick(long l) {
long seconds=l/1000;
long minutes = seconds / 60;
long remainingSeconds = seconds % 60;
tv_remaintime.setText(getString(R.string.custombustopay_remaintime)+minutes+":"+remainingSeconds);
}
@Override
public void onFinish() {
showThisExceptionAlertDialog(getString(R.string.custombustopay_overtime));
}
}.start();
btn_submit.setOnClickListener(this);
}
private void initGridSeat() {
SeatGridAdapter seatGridAdapter = new SeatGridAdapter(this,getGenerateTicketOrderInfoBean);
gv_seat.setAdapter(seatGridAdapter);
}
//填充预付费的充值数据(从预加载数据中获取)
private void initCustombusPaytype() {
paytypeCustombusBeans.clear();
List<LoadQrcodeParamBean.CityQrParamConfigBean.PayWayBean> payWayBeans=loadQrcodeParamBean.getCityQrParamConfig().getPayWay();
for(int i=0;i<payWayBeans.size();i++){
if(payWayBeans.get(i).getPayWayType().equals(GlobalConfig.LOADPARAM_QROPAYTYPE_PREPAY)){
PaytypeCustombusBean paytypeCustombusBean=new PaytypeCustombusBean();
paytypeCustombusBean.setPayWayCode(payWayBeans.get(i).getPayWayCode());
paytypeCustombusBean.setPayWayName(payWayBeans.get(i).getPayWayName());
paytypeCustombusBeans.add(paytypeCustombusBean);
}
}
}
@Override
protected void setActivityLayout() {
super.setActivityLayout();
setContentView(R.layout.activity_custombus_topay);
}
@Override
protected void onCreateInitView() {
super.onCreateInitView();
setTitle(getString(R.string.custombustopay_title));
getMyInfoIntent();
initListViewPaytype();
initOhterUI();
}
private void getMyInfoIntent() {
Bundle bundle=getIntent().getExtras();
String getinfo = bundle.getString(GlobalConfig.INTENT_CUSTOMBUS_ORDERINFOTOPAY_KEY);
Log.e("YC","getinfo="+getinfo);
getGenerateTicketOrderInfoBean = new GetGenerateTicketOrderInfoBean();
getGenerateTicketOrderInfoBean = (GetGenerateTicketOrderInfoBean) JsonComomUtils.parseAllInfo(getinfo, getGenerateTicketOrderInfoBean);
}
@Override
protected void onCreatebindView() {
super.onCreatebindView();
btn_submit = (Button)findViewById(R.id.btn_submit);
lv_paytype = (ListView)findViewById(R.id.lv_paytype);
tv_remaintime = (TextView)findViewById(R.id.tv_remaintime);
tv_ticketprice = (TextView)findViewById(R.id.tv_ticketprice);
tv_ticketseat = (TextView)findViewById(R.id.tv_ticketseat);
gv_seat=(GridView)findViewById(R.id.gv_seat);
}
//填充支付方式选择目录
private void initListViewPaytype() {
custombusPaytypeLvAdapter = new CustombusPaytypeLvAdapter(this,paytypeCustombusBeans);
lv_paytype.setAdapter(custombusPaytypeLvAdapter);
lv_paytype.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
custombusPaytypeLvAdapter.setPaytypePosition(i);
custombusPaytypeLvAdapter.notifyDataSetChanged();
}
});
}
@Override
protected void onStart() {
super.onStart();
if(payflag/*&&paycode==GlobalConfig.LOADPARAM_QROPAYTYPE_PREPAYWEICHAT*/){
Log.e("YC","微信回调");
((GYDZApplication)getApplication()).clearAllCustomBusAty();
}
}
//支付宝回调
private Handler aliHandler = new Handler() {
@SuppressWarnings("unused")
public void handleMessage(Message msg) {
if(payflag){
Log.e("YC","支付宝回调");
((GYDZApplication)getApplication()).clearAllCustomBusAty();
}
};
};
private void startToPay(ArrayList<String> getinfo) {
payflag = true;
if(custombusPaytypeLvAdapter.getPaytypeCode().equals(GlobalConfig.LOADPARAM_QROPAYTYPE_PREPAYUNION)){
paycode=GlobalConfig.LOADPARAM_QROPAYTYPE_PREPAYUNION;
UnionBean unionBean=new UnionBean();
unionBean= (UnionBean) JsonComomUtils.parseAllInfo(getinfo.get(2),unionBean);
PayUtils.unionPay(this,unionBean.getPayParam().getTn());
return;
}
if(custombusPaytypeLvAdapter.getPaytypeCode().equals(GlobalConfig.LOADPARAM_QROPAYTYPE_PREPAYALIPAY)){
paycode=GlobalConfig.LOADPARAM_QROPAYTYPE_PREPAYALIPAY;
AlipayBean alipayBean=new AlipayBean();
alipayBean= (AlipayBean) JsonComomUtils.parseAllInfo(getinfo.get(2),alipayBean);
PayUtils.aliPay(this,alipayBean.getPayParam().getOrderStr(),aliHandler);
return;
}
if(custombusPaytypeLvAdapter.getPaytypeCode().equals(GlobalConfig.LOADPARAM_QROPAYTYPE_PREPAYWEICHAT)){
paycode=GlobalConfig.LOADPARAM_QROPAYTYPE_PREPAYWEICHAT;
WeichatBean weichatBean=new WeichatBean();
weichatBean= (WeichatBean) JsonComomUtils.parseAllInfo(getinfo.get(2),weichatBean);
PayUtils.weichatPay(this,weichatBean);
return;
}
showExceptionAlertDialog(getString(R.string.app_function_notopen));
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if(payflag/*&&paycode==GlobalConfig.LOADPARAM_QROPAYTYPE_PREPAYUNION*/){
Log.e("YC","银联回调");
((GYDZApplication)getApplication()).clearAllCustomBusAty();
}
}
@Override
protected void onDestroy() {
super.onDestroy();
timer.cancel();
timer=null;
}
@Override
public void onBackPressed() {
showTwoButtonAlertDialog(getString(R.string.custombustopay_back), new View.OnClickListener() {
@Override
public void onClick(View v) {
RemoveTicketOrderInfoAction removeTicketOrderInfoAction=new RemoveTicketOrderInfoAction(ActivityCustomBusToPay.this,ActivityCustomBusToPay.this);
removeTicketOrderInfoAction.sendAction(getGenerateTicketOrderInfoBean.getPreOrderId());
finish();
}
});
}
public boolean showThisExceptionAlertDialog(String msg){
if(thisalertdialog!=null&&!thisalertdialog.isShowing()){
thisalertdialog.setTitle(getString(R.string.app_alertdialog_title)).setMsg(msg)
.setPositiveButton("确定", new View.OnClickListener() {
@Override
public void onClick(View view) {
finish();
}
}).show();
return true;
}else {
return false;
}
}
public void titleback(View v){
showTwoButtonAlertDialog(getString(R.string.custombustopay_back), new View.OnClickListener() {
@Override
public void onClick(View v) {
RemoveTicketOrderInfoAction removeTicketOrderInfoAction=new RemoveTicketOrderInfoAction(ActivityCustomBusToPay.this,ActivityCustomBusToPay.this);
removeTicketOrderInfoAction.sendAction(getGenerateTicketOrderInfoBean.getPreOrderId());
finish();
}
});
}
@Override
public void onClick(View v) {
int id=v.getId();
if(id==R.id.btn_submit){
requestForPayUnify();
}
}
class SeatGridAdapter extends BaseAdapter {
private Context mycontext;
private GetGenerateTicketOrderInfoBean getGenerateTicketOrderInfoBean;
public SeatGridAdapter(Context context, GetGenerateTicketOrderInfoBean getGenerateTicketOrderInfoBean) {
mycontext=context;
this.getGenerateTicketOrderInfoBean=getGenerateTicketOrderInfoBean;
}
@Override
public int getCount() {
return getGenerateTicketOrderInfoBean.getTicketList().size();
}
@Override
public Object getItem(int i) {
return null;
}
@Override
public long getItemId(int i) {
return 0;
}
@Override
public View getView(int i, View view, ViewGroup viewGroup) {
if(view==null){
view= LayoutInflater.from(mycontext).inflate(R.layout.item_custombustopay_seatinfo,viewGroup,false);
}
TextView tv_seat=(TextView)view.findViewById(R.id.tv_seat);
tv_seat.setText(String.format(getString(R.string.custombustopay_layerandseat),getGenerateTicketOrderInfoBean.getTicketList().get(i).getLayerNo(),getGenerateTicketOrderInfoBean.getTicketList().get(i).getSeatNo()));
if(getGenerateTicketOrderInfoBean.getTicketList().get(i).getLayerNo().equals("1")){
tv_seat.setText(String.format(getString(R.string.custombustopay_layerandseat),"下",getGenerateTicketOrderInfoBean.getTicketList().get(i).getSeatNo()));
}
if(getGenerateTicketOrderInfoBean.getTicketList().get(i).getLayerNo().equals("2")){
tv_seat.setText(String.format(getString(R.string.custombustopay_layerandseat),"上",getGenerateTicketOrderInfoBean.getTicketList().get(i).getSeatNo()));
}
return view;
}
}
private void requestForPayUnify() {
showProgress();
PayUnifyAction payUnifyAction=new PayUnifyAction(this,this);
payUnifyAction.sendAction(getGenerateTicketOrderInfoBean.getTotalTicketPrice(),GlobalConfig.PAYUNITY_TYPE_CUSTOMBUS_TOPAY
,"",custombusPaytypeLvAdapter.getPaytypeCode(),sharePreferenceLogin.getLoginPhone(),"","","",getGenerateTicketOrderInfoBean.getPreOrderId());
}
@Override
public void onRemoveTicketOrderInfoSucces(ArrayList<String> getinfo) {
}
@Override
public void onRemoveTicketOrderInfoFaild(String resmsg) {
}
@Override
public void onPayUnifySucces(ArrayList<String> getinfo) {
dissmissProgress();
try {
String rescode=getinfo.get(0);
if(rescode.equals(GlobalConfig.RESCODE_SUCCESS)){
startToPay(getinfo);
}else {
checkAllUpadate(rescode,getinfo);
}
}catch (Exception e){
showExceptionAlertDialog();
}
}
@Override
public void onPayUnifyFaild(String resmsg) {
dissmissProgress();
showExceptionAlertDialog(resmsg);
}
}
|
UTF-8
|
Java
| 15,044 |
java
|
ActivityCustomBusToPay.java
|
Java
|
[
{
"context": "til.List;\nimport java.util.Map;\n\n/**\n * Created by yang on 2019/1/13.\n */\n\npublic class ActivityCustomBus",
"end": 2277,
"score": 0.716005802154541,
"start": 2273,
"tag": "USERNAME",
"value": "yang"
}
] | null |
[] |
package com.whpe.qrcode.jiangxi_jian.activity.custombus;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.os.Handler;
import android.os.Message;
import android.text.TextUtils;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.BaseAdapter;
import android.widget.Button;
import android.widget.GridView;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import com.whpe.qrcode.jiangxi_jian.GYDZApplication;
import com.whpe.qrcode.jiangxi_jian.R;
import com.whpe.qrcode.jiangxi_jian.bigtools.AliPayResult;
import com.whpe.qrcode.jiangxi_jian.bigtools.GlobalConfig;
import com.whpe.qrcode.jiangxi_jian.bigtools.MyDrawableUtils;
import com.whpe.qrcode.jiangxi_jian.bigtools.PayUtils;
import com.whpe.qrcode.jiangxi_jian.net.JsonComomUtils;
import com.whpe.qrcode.jiangxi_jian.net.action.PayUnifyAction;
import com.whpe.qrcode.jiangxi_jian.net.action.cusbtombus.RemoveTicketOrderInfoAction;
import com.whpe.qrcode.jiangxi_jian.net.getbean.LoadQrcodeParamBean;
import com.whpe.qrcode.jiangxi_jian.net.getbean.custombus.GetGenerateTicketOrderInfoBean;
import com.whpe.qrcode.jiangxi_jian.net.getbean.payunity.AlipayBean;
import com.whpe.qrcode.jiangxi_jian.net.getbean.payunity.UnionBean;
import com.whpe.qrcode.jiangxi_jian.net.getbean.payunity.WeichatBean;
import com.whpe.qrcode.jiangxi_jian.parent.NormalTitleActivity;
import com.whpe.qrcode.jiangxi_jian.toolbean.PaytypeCustombusBean;
import com.whpe.qrcode.jiangxi_jian.toolbean.PaytypePrepayBean;
import com.whpe.qrcode.jiangxi_jian.toolbean.custombus.BusSelectDateBean;
import com.whpe.qrcode.jiangxi_jian.view.AlertDialog;
import com.whpe.qrcode.jiangxi_jian.view.adapter.CustombusPaytypeLvAdapter;
import com.whpe.qrcode.jiangxi_jian.view.adapter.MoneyGridAdapter;
import com.whpe.qrcode.jiangxi_jian.view.adapter.PaypursePaytypeLvAdapter;
import org.json.JSONException;
import org.json.JSONObject;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
* Created by yang on 2019/1/13.
*/
public class ActivityCustomBusToPay extends NormalTitleActivity implements RemoveTicketOrderInfoAction.Inter_removeTicketOrderInfo, View.OnClickListener, PayUnifyAction.Inter_queryqruserinfo {
public LoadQrcodeParamBean loadQrcodeParamBean=new LoadQrcodeParamBean();
private ArrayList<PaytypeCustombusBean> paytypeCustombusBeans=new ArrayList<>();
private CustombusPaytypeLvAdapter custombusPaytypeLvAdapter;
private Button btn_submit;
private ListView lv_paytype;
private boolean payflag=false;
private CountDownTimer timer;
private TextView tv_remaintime;
private TextView tv_ticketprice;
private GridView gv_seat;
private AlertDialog thisalertdialog;
private GetGenerateTicketOrderInfoBean getGenerateTicketOrderInfoBean=new GetGenerateTicketOrderInfoBean();
private TextView tv_ticketseat;
private String paycode="";
@Override
protected void afterLayout() {
super.afterLayout();
}
@Override
protected void beforeLayout() {
super.beforeLayout();
loadQrcodeParamBean = (LoadQrcodeParamBean) JsonComomUtils.parseAllInfo(sharePreferenceParam.getParamInfos(),loadQrcodeParamBean);
initCustombusPaytype();
thisalertdialog=new AlertDialog(this).builder().setCancelable(false);
}
private void initOhterUI() {
String price=new BigDecimal(getGenerateTicketOrderInfoBean.getTotalTicketPrice()).divide(new BigDecimal(100))
.toString();
String showprice=String.format("%.2f",Double.parseDouble(price));
tv_ticketprice.setText(getString(R.string.app_rmb)+showprice);
initGridSeat();
/*tv_ticketseat.setText(getString(R.string.custombustopay_layer)+getGenerateTicketOrderInfoBean.getTicketList().get(0).getLayerNo()
+getString(R.string.custombustopay_seat)+getGenerateTicketOrderInfoBean.getTicketList().get(0).getSeatNo());*/
timer = new CountDownTimer(180000,1000) {
@Override
public void onTick(long l) {
long seconds=l/1000;
long minutes = seconds / 60;
long remainingSeconds = seconds % 60;
tv_remaintime.setText(getString(R.string.custombustopay_remaintime)+minutes+":"+remainingSeconds);
}
@Override
public void onFinish() {
showThisExceptionAlertDialog(getString(R.string.custombustopay_overtime));
}
}.start();
btn_submit.setOnClickListener(this);
}
private void initGridSeat() {
SeatGridAdapter seatGridAdapter = new SeatGridAdapter(this,getGenerateTicketOrderInfoBean);
gv_seat.setAdapter(seatGridAdapter);
}
//填充预付费的充值数据(从预加载数据中获取)
private void initCustombusPaytype() {
paytypeCustombusBeans.clear();
List<LoadQrcodeParamBean.CityQrParamConfigBean.PayWayBean> payWayBeans=loadQrcodeParamBean.getCityQrParamConfig().getPayWay();
for(int i=0;i<payWayBeans.size();i++){
if(payWayBeans.get(i).getPayWayType().equals(GlobalConfig.LOADPARAM_QROPAYTYPE_PREPAY)){
PaytypeCustombusBean paytypeCustombusBean=new PaytypeCustombusBean();
paytypeCustombusBean.setPayWayCode(payWayBeans.get(i).getPayWayCode());
paytypeCustombusBean.setPayWayName(payWayBeans.get(i).getPayWayName());
paytypeCustombusBeans.add(paytypeCustombusBean);
}
}
}
@Override
protected void setActivityLayout() {
super.setActivityLayout();
setContentView(R.layout.activity_custombus_topay);
}
@Override
protected void onCreateInitView() {
super.onCreateInitView();
setTitle(getString(R.string.custombustopay_title));
getMyInfoIntent();
initListViewPaytype();
initOhterUI();
}
private void getMyInfoIntent() {
Bundle bundle=getIntent().getExtras();
String getinfo = bundle.getString(GlobalConfig.INTENT_CUSTOMBUS_ORDERINFOTOPAY_KEY);
Log.e("YC","getinfo="+getinfo);
getGenerateTicketOrderInfoBean = new GetGenerateTicketOrderInfoBean();
getGenerateTicketOrderInfoBean = (GetGenerateTicketOrderInfoBean) JsonComomUtils.parseAllInfo(getinfo, getGenerateTicketOrderInfoBean);
}
@Override
protected void onCreatebindView() {
super.onCreatebindView();
btn_submit = (Button)findViewById(R.id.btn_submit);
lv_paytype = (ListView)findViewById(R.id.lv_paytype);
tv_remaintime = (TextView)findViewById(R.id.tv_remaintime);
tv_ticketprice = (TextView)findViewById(R.id.tv_ticketprice);
tv_ticketseat = (TextView)findViewById(R.id.tv_ticketseat);
gv_seat=(GridView)findViewById(R.id.gv_seat);
}
//填充支付方式选择目录
private void initListViewPaytype() {
custombusPaytypeLvAdapter = new CustombusPaytypeLvAdapter(this,paytypeCustombusBeans);
lv_paytype.setAdapter(custombusPaytypeLvAdapter);
lv_paytype.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
custombusPaytypeLvAdapter.setPaytypePosition(i);
custombusPaytypeLvAdapter.notifyDataSetChanged();
}
});
}
@Override
protected void onStart() {
super.onStart();
if(payflag/*&&paycode==GlobalConfig.LOADPARAM_QROPAYTYPE_PREPAYWEICHAT*/){
Log.e("YC","微信回调");
((GYDZApplication)getApplication()).clearAllCustomBusAty();
}
}
//支付宝回调
private Handler aliHandler = new Handler() {
@SuppressWarnings("unused")
public void handleMessage(Message msg) {
if(payflag){
Log.e("YC","支付宝回调");
((GYDZApplication)getApplication()).clearAllCustomBusAty();
}
};
};
private void startToPay(ArrayList<String> getinfo) {
payflag = true;
if(custombusPaytypeLvAdapter.getPaytypeCode().equals(GlobalConfig.LOADPARAM_QROPAYTYPE_PREPAYUNION)){
paycode=GlobalConfig.LOADPARAM_QROPAYTYPE_PREPAYUNION;
UnionBean unionBean=new UnionBean();
unionBean= (UnionBean) JsonComomUtils.parseAllInfo(getinfo.get(2),unionBean);
PayUtils.unionPay(this,unionBean.getPayParam().getTn());
return;
}
if(custombusPaytypeLvAdapter.getPaytypeCode().equals(GlobalConfig.LOADPARAM_QROPAYTYPE_PREPAYALIPAY)){
paycode=GlobalConfig.LOADPARAM_QROPAYTYPE_PREPAYALIPAY;
AlipayBean alipayBean=new AlipayBean();
alipayBean= (AlipayBean) JsonComomUtils.parseAllInfo(getinfo.get(2),alipayBean);
PayUtils.aliPay(this,alipayBean.getPayParam().getOrderStr(),aliHandler);
return;
}
if(custombusPaytypeLvAdapter.getPaytypeCode().equals(GlobalConfig.LOADPARAM_QROPAYTYPE_PREPAYWEICHAT)){
paycode=GlobalConfig.LOADPARAM_QROPAYTYPE_PREPAYWEICHAT;
WeichatBean weichatBean=new WeichatBean();
weichatBean= (WeichatBean) JsonComomUtils.parseAllInfo(getinfo.get(2),weichatBean);
PayUtils.weichatPay(this,weichatBean);
return;
}
showExceptionAlertDialog(getString(R.string.app_function_notopen));
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if(payflag/*&&paycode==GlobalConfig.LOADPARAM_QROPAYTYPE_PREPAYUNION*/){
Log.e("YC","银联回调");
((GYDZApplication)getApplication()).clearAllCustomBusAty();
}
}
@Override
protected void onDestroy() {
super.onDestroy();
timer.cancel();
timer=null;
}
@Override
public void onBackPressed() {
showTwoButtonAlertDialog(getString(R.string.custombustopay_back), new View.OnClickListener() {
@Override
public void onClick(View v) {
RemoveTicketOrderInfoAction removeTicketOrderInfoAction=new RemoveTicketOrderInfoAction(ActivityCustomBusToPay.this,ActivityCustomBusToPay.this);
removeTicketOrderInfoAction.sendAction(getGenerateTicketOrderInfoBean.getPreOrderId());
finish();
}
});
}
public boolean showThisExceptionAlertDialog(String msg){
if(thisalertdialog!=null&&!thisalertdialog.isShowing()){
thisalertdialog.setTitle(getString(R.string.app_alertdialog_title)).setMsg(msg)
.setPositiveButton("确定", new View.OnClickListener() {
@Override
public void onClick(View view) {
finish();
}
}).show();
return true;
}else {
return false;
}
}
public void titleback(View v){
showTwoButtonAlertDialog(getString(R.string.custombustopay_back), new View.OnClickListener() {
@Override
public void onClick(View v) {
RemoveTicketOrderInfoAction removeTicketOrderInfoAction=new RemoveTicketOrderInfoAction(ActivityCustomBusToPay.this,ActivityCustomBusToPay.this);
removeTicketOrderInfoAction.sendAction(getGenerateTicketOrderInfoBean.getPreOrderId());
finish();
}
});
}
@Override
public void onClick(View v) {
int id=v.getId();
if(id==R.id.btn_submit){
requestForPayUnify();
}
}
class SeatGridAdapter extends BaseAdapter {
private Context mycontext;
private GetGenerateTicketOrderInfoBean getGenerateTicketOrderInfoBean;
public SeatGridAdapter(Context context, GetGenerateTicketOrderInfoBean getGenerateTicketOrderInfoBean) {
mycontext=context;
this.getGenerateTicketOrderInfoBean=getGenerateTicketOrderInfoBean;
}
@Override
public int getCount() {
return getGenerateTicketOrderInfoBean.getTicketList().size();
}
@Override
public Object getItem(int i) {
return null;
}
@Override
public long getItemId(int i) {
return 0;
}
@Override
public View getView(int i, View view, ViewGroup viewGroup) {
if(view==null){
view= LayoutInflater.from(mycontext).inflate(R.layout.item_custombustopay_seatinfo,viewGroup,false);
}
TextView tv_seat=(TextView)view.findViewById(R.id.tv_seat);
tv_seat.setText(String.format(getString(R.string.custombustopay_layerandseat),getGenerateTicketOrderInfoBean.getTicketList().get(i).getLayerNo(),getGenerateTicketOrderInfoBean.getTicketList().get(i).getSeatNo()));
if(getGenerateTicketOrderInfoBean.getTicketList().get(i).getLayerNo().equals("1")){
tv_seat.setText(String.format(getString(R.string.custombustopay_layerandseat),"下",getGenerateTicketOrderInfoBean.getTicketList().get(i).getSeatNo()));
}
if(getGenerateTicketOrderInfoBean.getTicketList().get(i).getLayerNo().equals("2")){
tv_seat.setText(String.format(getString(R.string.custombustopay_layerandseat),"上",getGenerateTicketOrderInfoBean.getTicketList().get(i).getSeatNo()));
}
return view;
}
}
private void requestForPayUnify() {
showProgress();
PayUnifyAction payUnifyAction=new PayUnifyAction(this,this);
payUnifyAction.sendAction(getGenerateTicketOrderInfoBean.getTotalTicketPrice(),GlobalConfig.PAYUNITY_TYPE_CUSTOMBUS_TOPAY
,"",custombusPaytypeLvAdapter.getPaytypeCode(),sharePreferenceLogin.getLoginPhone(),"","","",getGenerateTicketOrderInfoBean.getPreOrderId());
}
@Override
public void onRemoveTicketOrderInfoSucces(ArrayList<String> getinfo) {
}
@Override
public void onRemoveTicketOrderInfoFaild(String resmsg) {
}
@Override
public void onPayUnifySucces(ArrayList<String> getinfo) {
dissmissProgress();
try {
String rescode=getinfo.get(0);
if(rescode.equals(GlobalConfig.RESCODE_SUCCESS)){
startToPay(getinfo);
}else {
checkAllUpadate(rescode,getinfo);
}
}catch (Exception e){
showExceptionAlertDialog();
}
}
@Override
public void onPayUnifyFaild(String resmsg) {
dissmissProgress();
showExceptionAlertDialog(resmsg);
}
}
| 15,044 | 0.687458 | 0.684848 | 366 | 39.825138 | 37.221195 | 225 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.625683 | false | false |
12
|
26e6731a51093929281765f66eb06f7c884d60eb
| 38,122,129,720,039 |
3dae280485206ae9f49919a6438b7c0067611e8a
|
/jwt-resource-server/src/main/java/com/example/demoresource/CustomAccessTokenConverter.java
|
641cedde401716106fecc904fcff2e173f7eaf71
|
[] |
no_license
|
ArtemMe/shaverma
|
https://github.com/ArtemMe/shaverma
|
12a124549128547a5e0796e0c9144fb96f5215bf
|
ab5b8ee1f01554753ddea06107138723eb6c927d
|
refs/heads/master
| 2023-01-07T12:58:13.489000 | 2019-05-27T20:32:56 | 2019-05-27T20:32:56 | 130,253,306 | 5 | 0 | null | false | 2023-01-04T02:41:58 | 2018-04-19T17:59:53 | 2022-12-02T02:10:40 | 2023-01-04T02:41:58 | 1,665 | 4 | 0 | 9 |
Java
| false | false |
//package com.example.demoresource;
//
//import org.springframework.security.oauth2.provider.OAuth2Authentication;
//import org.springframework.security.oauth2.provider.token.DefaultAccessTokenConverter;
//import org.springframework.stereotype.Component;
//
//import java.util.Map;
//
//@Component
//public class CustomAccessTokenConverter extends DefaultAccessTokenConverter {
//
// @Override
// public OAuth2Authentication extractAuthentication(Map<String, ?> claims) {
// OAuth2Authentication authentication = super.extractAuthentication(claims);
// authentication.setDetails(claims);
// return authentication;
// }
//
//}
|
UTF-8
|
Java
| 656 |
java
|
CustomAccessTokenConverter.java
|
Java
|
[] | null |
[] |
//package com.example.demoresource;
//
//import org.springframework.security.oauth2.provider.OAuth2Authentication;
//import org.springframework.security.oauth2.provider.token.DefaultAccessTokenConverter;
//import org.springframework.stereotype.Component;
//
//import java.util.Map;
//
//@Component
//public class CustomAccessTokenConverter extends DefaultAccessTokenConverter {
//
// @Override
// public OAuth2Authentication extractAuthentication(Map<String, ?> claims) {
// OAuth2Authentication authentication = super.extractAuthentication(claims);
// authentication.setDetails(claims);
// return authentication;
// }
//
//}
| 656 | 0.760671 | 0.753049 | 19 | 33.526318 | 31.929806 | 88 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.473684 | false | false |
12
|
61efdd56fab1a3745af9ade6052de9c72d3358ee
| 37,864,431,688,554 |
5d11f938a50e42316805fcb4c4a193955d9ac874
|
/xiaoniu-service/src/main/java/com/xiaoniu/service/news/CmpyNewsService.java
|
7d142b9b5b7eaf5305a167c261b2497d55cf303f
|
[] |
no_license
|
x-front/xiaoniu
|
https://github.com/x-front/xiaoniu
|
102faea14a82c3e79adb79936fe9d75599db78c9
|
6dc978edb6624eaa1841f20268237f05a129af06
|
refs/heads/master
| 2021-04-12T03:48:53.727000 | 2017-10-27T09:00:38 | 2017-10-27T09:00:38 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.xiaoniu.service.news;
import java.util.List;
import com.github.pagehelper.PageInfo;
import com.xiaoniu.db.domain.CmpyNews;
import com.xiaoniu.db.domain.NewsSearchVO;
import com.xiaoniu.service.base.BaseService;
public interface CmpyNewsService extends BaseService<CmpyNews>{
public List<NewsSearchVO> search(Integer page,Integer rows,Long totalCount,Integer type,Integer lang,Integer isTop,String keyword);
public long searchTotalCount(Integer type,Integer lang,Integer isTop,String keyword);
/**
* 分页查询。
* @param page
* @param rows
* @param orderBy
* @param entity title和summary采用like
* @return
* @throws Exception
*/
public PageInfo<CmpyNews> queryNewsList(Integer page, Integer rows, String orderBy, final CmpyNews entity) throws Exception;
}
|
UTF-8
|
Java
| 823 |
java
|
CmpyNewsService.java
|
Java
|
[] | null |
[] |
package com.xiaoniu.service.news;
import java.util.List;
import com.github.pagehelper.PageInfo;
import com.xiaoniu.db.domain.CmpyNews;
import com.xiaoniu.db.domain.NewsSearchVO;
import com.xiaoniu.service.base.BaseService;
public interface CmpyNewsService extends BaseService<CmpyNews>{
public List<NewsSearchVO> search(Integer page,Integer rows,Long totalCount,Integer type,Integer lang,Integer isTop,String keyword);
public long searchTotalCount(Integer type,Integer lang,Integer isTop,String keyword);
/**
* 分页查询。
* @param page
* @param rows
* @param orderBy
* @param entity title和summary采用like
* @return
* @throws Exception
*/
public PageInfo<CmpyNews> queryNewsList(Integer page, Integer rows, String orderBy, final CmpyNews entity) throws Exception;
}
| 823 | 0.760843 | 0.760843 | 24 | 31.625 | 36.317825 | 133 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.375 | false | false |
12
|
22c609930f839e5dcb838bde8f6d4e9a73067de9
| 35,201,551,992,324 |
dba87418d2286ce141d81deb947305a0eaf9824f
|
/sources/com/wowza/gocoder/sdk/support/wmstransport/wms/p042a/p047e/C4325a.java
|
767bd18a6b6d7f16cd912166470a712cea5a8ce2
|
[] |
no_license
|
Sluckson/copyOavct
|
https://github.com/Sluckson/copyOavct
|
1f73f47ce94bb08df44f2ba9f698f2e8589b5cf6
|
d20597e14411e8607d1d6e93b632d0cd2e8af8cb
|
refs/heads/main
| 2023-03-09T12:14:38.824000 | 2021-02-26T01:38:16 | 2021-02-26T01:38:16 | 341,292,450 | 0 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.wowza.gocoder.sdk.support.wmstransport.wms.p042a.p047e;
/* renamed from: com.wowza.gocoder.sdk.support.wmstransport.wms.a.e.a */
/* compiled from: GoCoderSDK */
public class C4325a {
/* renamed from: a */
public static final int f4606a = 2889;
/* renamed from: b */
public static final int f4607b = 32;
/* renamed from: c */
public static final int f4608c = 33;
/* renamed from: d */
public static final int f4609d = 34;
/* renamed from: e */
public static final String f4610e = "mp4a.40.32";
/* renamed from: f */
public static final String f4611f = "mp4a.40.33";
/* renamed from: g */
public static final String f4612g = "mp4a.40.34";
}
|
UTF-8
|
Java
| 715 |
java
|
C4325a.java
|
Java
|
[] | null |
[] |
package com.wowza.gocoder.sdk.support.wmstransport.wms.p042a.p047e;
/* renamed from: com.wowza.gocoder.sdk.support.wmstransport.wms.a.e.a */
/* compiled from: GoCoderSDK */
public class C4325a {
/* renamed from: a */
public static final int f4606a = 2889;
/* renamed from: b */
public static final int f4607b = 32;
/* renamed from: c */
public static final int f4608c = 33;
/* renamed from: d */
public static final int f4609d = 34;
/* renamed from: e */
public static final String f4610e = "mp4a.40.32";
/* renamed from: f */
public static final String f4611f = "mp4a.40.33";
/* renamed from: g */
public static final String f4612g = "mp4a.40.34";
}
| 715 | 0.641958 | 0.553846 | 27 | 25.481482 | 21.867226 | 72 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.296296 | false | false |
12
|
6fcd8999e272f8288cabc4088a3b4b14fa9d81a1
| 34,857,954,600,610 |
27d5409ae38463e6f31639bb54d2ccc71d773023
|
/p1010/src/com/shadow/extras/lucene/KeyWord.java
|
c86115fe692d29fda6403c0dccaebcf15ca47a40
|
[] |
no_license
|
wy243808263/Spring-Onther
|
https://github.com/wy243808263/Spring-Onther
|
cc7dedb3a836e462f63224a0d8bc6b83056de35e
|
78b69e415835bfa67ec7fb8f9f8fe0285dc2bf3e
|
refs/heads/master
| 2021-01-01T04:59:35.035000 | 2017-07-15T01:26:04 | 2017-07-15T01:26:04 | 97,286,954 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.shadow.extras.lucene;
public class KeyWord {
private Integer id;
private String word;
private Integer hit;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getWord() {
return word;
}
public void setWord(String word) {
this.word = word;
}
public Integer getHit() {
return hit;
}
public void setHit(Integer hit) {
this.hit = hit;
}
}
|
UTF-8
|
Java
| 433 |
java
|
KeyWord.java
|
Java
|
[] | null |
[] |
package com.shadow.extras.lucene;
public class KeyWord {
private Integer id;
private String word;
private Integer hit;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getWord() {
return word;
}
public void setWord(String word) {
this.word = word;
}
public Integer getHit() {
return hit;
}
public void setHit(Integer hit) {
this.hit = hit;
}
}
| 433 | 0.660508 | 0.660508 | 35 | 11.371428 | 12.095066 | 35 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.057143 | false | false |
12
|
11f412d29e5b748d0de6a3669e14f11f9452f468
| 37,632,503,449,135 |
c8e8a3cec2a2ee3c56daa7210445d7d92852e996
|
/LeetCode_Courses/src/com/leetcode/august/Challenges/ValidPalinDrome.java
|
20e93db89e7e15b2050aceae6dc77e874775057e
|
[] |
no_license
|
Ritwika94/Leetcode_challenges
|
https://github.com/Ritwika94/Leetcode_challenges
|
67ec931c6c7b45109fb0f1b045603653b6480579
|
981bc33a225c61505ea349f3f602e18bcbe4e4a2
|
refs/heads/master
| 2023-02-25T05:10:36.869000 | 2020-08-29T15:24:28 | 2020-08-29T15:24:28 | 286,774,575 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.leetcode.august.Challenges;
public class ValidPalinDrome {
public static void main(String[] args) {
String str="A man, a plan, a canal: Panama";
System.out.println(isPalindrome(str));
}
public static boolean isPalindrome(String s) {
if(s==null)
return true;
int len=s.length();
int i=0;
int j=0;
int k=0;
for(j=0;j<len;j++)
{
if(!(Character.isLetterOrDigit(s.charAt(j))))
continue;
else
break;
}
if(j==len)
{
return true;
}
for(k=len-1;k>=0;k--)
{
if(!(Character.isLetterOrDigit(s.charAt(k))))
continue;
else
break;
}
if(j==k)
return true;
String str=s.substring(j,len);
len=str.length();
if(len==1)
return true;
int p=k;
for(i=j;i<len/2;i++)
{
//System.out.println(Character.isLetterOrDigit(s.charAt(i)));
if((!(Character.isLetterOrDigit(s.charAt(i)))) && (Character.isLetterOrDigit(s.charAt(p))))
{
continue;
}
if((Character.isLetterOrDigit(s.charAt(i))) && (!(Character.isLetterOrDigit(s.charAt(p)))))
{
i--;
p--;
continue;
}
if((!(Character.isLetterOrDigit(s.charAt(i)))) && (!(Character.isLetterOrDigit(s.charAt(p)))))
{
p--;
continue;
}
char x=Character.toUpperCase(s.charAt(i));
char y=Character.toUpperCase(s.charAt(p));
//System.out.println(x+" "+y);
if(Character.compare(x,y)==0)
{
p--;
continue;
}
else
break;
}
if(i==len/2)
return true;
return false;
}
}
|
UTF-8
|
Java
| 2,250 |
java
|
ValidPalinDrome.java
|
Java
|
[] | null |
[] |
package com.leetcode.august.Challenges;
public class ValidPalinDrome {
public static void main(String[] args) {
String str="A man, a plan, a canal: Panama";
System.out.println(isPalindrome(str));
}
public static boolean isPalindrome(String s) {
if(s==null)
return true;
int len=s.length();
int i=0;
int j=0;
int k=0;
for(j=0;j<len;j++)
{
if(!(Character.isLetterOrDigit(s.charAt(j))))
continue;
else
break;
}
if(j==len)
{
return true;
}
for(k=len-1;k>=0;k--)
{
if(!(Character.isLetterOrDigit(s.charAt(k))))
continue;
else
break;
}
if(j==k)
return true;
String str=s.substring(j,len);
len=str.length();
if(len==1)
return true;
int p=k;
for(i=j;i<len/2;i++)
{
//System.out.println(Character.isLetterOrDigit(s.charAt(i)));
if((!(Character.isLetterOrDigit(s.charAt(i)))) && (Character.isLetterOrDigit(s.charAt(p))))
{
continue;
}
if((Character.isLetterOrDigit(s.charAt(i))) && (!(Character.isLetterOrDigit(s.charAt(p)))))
{
i--;
p--;
continue;
}
if((!(Character.isLetterOrDigit(s.charAt(i)))) && (!(Character.isLetterOrDigit(s.charAt(p)))))
{
p--;
continue;
}
char x=Character.toUpperCase(s.charAt(i));
char y=Character.toUpperCase(s.charAt(p));
//System.out.println(x+" "+y);
if(Character.compare(x,y)==0)
{
p--;
continue;
}
else
break;
}
if(i==len/2)
return true;
return false;
}
}
| 2,250 | 0.390222 | 0.385778 | 86 | 24.16279 | 20.514805 | 106 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.604651 | false | false |
12
|
a25e226133c9f52b17d2b380cf9632b8763e5638
| 34,505,767,298,652 |
5304fca5abc4351d4743deaa3e11090a9b9e1455
|
/src/Bluegrownd.java
|
6cd3657952dbff011e8e73c99c966d30c6398fde
|
[] |
no_license
|
YairHanimov/Arknoid-multilevel-game-intro-to-oop
|
https://github.com/YairHanimov/Arknoid-multilevel-game-intro-to-oop
|
49eed6e7f62c67d2db603f99b2299c23d24b785d
|
f8bf652006dbf57c5285fef5b8f80266cded480a
|
refs/heads/master
| 2020-09-14T18:26:34.203000 | 2019-11-21T16:16:06 | 2019-11-21T16:16:06 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
import biuoop.DrawSurface;
import java.awt.Color;
/**
* The type Bluegrownd.
*/
public class Bluegrownd implements Sprite {
private Sprite b;
/**
* Draw on.
*
* @param d the d
*/
@Override
public void drawOn(DrawSurface d) {
d.setColor(Color.blue);
d.fillRectangle(0, 0, 1000, 1000);
d.drawRectangle(0, 0, 1000, 1000);
d.setColor(Color.decode("#D0D0D0"));
d.fillCircle(150, 400, 35);
d.setColor(Color.decode("#D0D0D0"));
d.fillCircle(190, 390, 40);
d.setColor(Color.decode("#BEBEBF"));
d.fillCircle(220, 400, 40);
d.setColor(Color.decode("#B3B3B5"));
d.fillCircle(240, 420, 35);
d.setColor(Color.decode("#D0D0D0"));
d.fillCircle(620, 490, 35);
d.setColor(Color.decode("#D0D0D0"));
d.fillCircle(660, 470, 40);
d.setColor(Color.decode("#BEBEBF"));
d.fillCircle(680, 480, 40);
d.setColor(Color.decode("#B3B3B5"));
d.fillCircle(700, 500, 35);
}
/**
* Time passed.
*/
@Override
public void timePassed() {
}
/**
* Add to game.
*
* @param g the g
*/
@Override
public void addToGame(GameLevel g) {
g.addSprite(this);
}
}
|
UTF-8
|
Java
| 1,341 |
java
|
Bluegrownd.java
|
Java
|
[] | null |
[] |
import biuoop.DrawSurface;
import java.awt.Color;
/**
* The type Bluegrownd.
*/
public class Bluegrownd implements Sprite {
private Sprite b;
/**
* Draw on.
*
* @param d the d
*/
@Override
public void drawOn(DrawSurface d) {
d.setColor(Color.blue);
d.fillRectangle(0, 0, 1000, 1000);
d.drawRectangle(0, 0, 1000, 1000);
d.setColor(Color.decode("#D0D0D0"));
d.fillCircle(150, 400, 35);
d.setColor(Color.decode("#D0D0D0"));
d.fillCircle(190, 390, 40);
d.setColor(Color.decode("#BEBEBF"));
d.fillCircle(220, 400, 40);
d.setColor(Color.decode("#B3B3B5"));
d.fillCircle(240, 420, 35);
d.setColor(Color.decode("#D0D0D0"));
d.fillCircle(620, 490, 35);
d.setColor(Color.decode("#D0D0D0"));
d.fillCircle(660, 470, 40);
d.setColor(Color.decode("#BEBEBF"));
d.fillCircle(680, 480, 40);
d.setColor(Color.decode("#B3B3B5"));
d.fillCircle(700, 500, 35);
}
/**
* Time passed.
*/
@Override
public void timePassed() {
}
/**
* Add to game.
*
* @param g the g
*/
@Override
public void addToGame(GameLevel g) {
g.addSprite(this);
}
}
| 1,341 | 0.51827 | 0.442207 | 56 | 21.910715 | 16.015926 | 44 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.803571 | false | false |
12
|
d240e92a042df2edc2b458a84d7613394b522b1d
| 3,118,146,318,770 |
a566d06f71bb4823fbcaea201cca5dadbc7bba0f
|
/IASC.Roll/src/org/IASC/Roll/Entity/RML_TABLE.java
|
196a03e1e6fc055f351407878e012eddf8be15ef
|
[] |
no_license
|
SaeedMirshams/RollGuide
|
https://github.com/SaeedMirshams/RollGuide
|
e40ead0995613b933f4060e20daf4675e97ce2e2
|
95c5c1df97752a366e3b072177983aec4062880c
|
refs/heads/master
| 2017-12-05T15:03:50.121000 | 2017-03-23T18:47:18 | 2017-03-23T18:47:18 | 80,336,450 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package org.IASC.Roll.Entity;
import java.util.ArrayList;
public class RML_TABLE{
Object rowid;
/**Sets rowid
* @param value the rowid to set
*/public void setrowid(Object value)
{
this.rowid=value;
}
/**
* @return the rowid
*/public Object getrowid()
{
return this.rowid;
}
Integer REVISION;
/**Sets REVISION
* @param value the REVISION to set
*/public void setREVISION(Integer value)
{
this.REVISION=value;
}
/**
* @return the REVISION
*/public Integer getREVISION()
{
return this.REVISION;
}
String OPERATOR;
/**Sets OPERATOR
* @param value the OPERATOR to set
*/public void setOPERATOR(String value)
{
this.OPERATOR=value;
}
/**
* @return the OPERATOR
*/public String getOPERATOR()
{
return this.OPERATOR;
}
Integer PASSES;
/**Sets PASSES
* @param value the PASSES to set
*/public void setPASSES(Integer value)
{
this.PASSES=value;
}
/**
* @return the PASSES
*/public Integer getPASSES()
{
return this.PASSES;
}
Integer DIAMETER;
/**Sets DIAMETER
* @param value the DIAMETER to set
*/public void setDIAMETER(Integer value)
{
this.DIAMETER=value;
}
/**
* @return the DIAMETER
*/public Integer getDIAMETER()
{
return this.DIAMETER;
}
String LINE_ID;
/**Sets LINE_ID
* @param value the LINE_ID to set
*/public void setLINE_ID(String value)
{
this.LINE_ID=value;
}
/**
* @return the LINE_ID
*/public String getLINE_ID()
{
return this.LINE_ID;
}
String TABLE_OPTION;
/**Sets TABLE_OPTION
* @param value the TABLE_OPTION to set
*/public void setTABLE_OPTION(String value)
{
this.TABLE_OPTION=value;
}
/**
* @return the TABLE_OPTION
*/public String getTABLE_OPTION()
{
return this.TABLE_OPTION;
}
String OUT_PROFILE_ID;
/**Sets OUT_PROFILE_ID
* @param value the OUT_PROFILE_ID to set
*/public void setOUT_PROFILE_ID(String value)
{
this.OUT_PROFILE_ID=value;
}
/**
* @return the OUT_PROFILE_ID
*/public String getOUT_PROFILE_ID()
{
return this.OUT_PROFILE_ID;
}
String IN_PROFILE_ID;
/**Sets IN_PROFILE_ID
* @param value the IN_PROFILE_ID to set
*/public void setIN_PROFILE_ID(String value)
{
this.IN_PROFILE_ID=value;
}
/**
* @return the IN_PROFILE_ID
*/public String getIN_PROFILE_ID()
{
return this.IN_PROFILE_ID;
}
String TABLE_ID;
/**Sets TABLE_ID
* @param value the TABLE_ID to set
*/public void setTABLE_ID(String value)
{
this.TABLE_ID=value;
}
/**
* @return the TABLE_ID
*/public String getTABLE_ID()
{
return this.TABLE_ID;
}
String STATION_ID;
/**Sets STATION_ID
* @param value the STATION_ID to set
*/public void setSTATION_ID(String value)
{
this.STATION_ID=value;
}
/**
* @return the STATION_ID
*/public String getSTATION_ID()
{
return this.STATION_ID;
}
String PLANT_ID;
/**Sets PLANT_ID
* @param value the PLANT_ID to set
*/public void setPLANT_ID(String value)
{
this.PLANT_ID=value;
}
/**
* @return the PLANT_ID
*/public String getPLANT_ID()
{
return this.PLANT_ID;
}
public void retriveFromRequest(Object req) {
HttpServletRequest request=(HttpServletRequest) req;
try{setrowid(request.getParameter("rowid"));}
catch(Exception ex){setrowid(null);}
try{ setREVISION(request.getParameter("REVISION") != null ? Integer.parseInt(request.getParameter("REVISION")) : null);
}catch(Exception ex){setREVISION(null);}
try{setOPERATOR(request.getParameter("OPERATOR"));}
catch(Exception ex){setOPERATOR(null);}
try{ setPASSES(request.getParameter("PASSES") != null ? Integer.parseInt(request.getParameter("PASSES")) : null);
}catch(Exception ex){setPASSES(null);}
try{ setDIAMETER(request.getParameter("DIAMETER") != null ? Integer.parseInt(request.getParameter("DIAMETER")) : null);
}catch(Exception ex){setDIAMETER(null);}
try{setLINE_ID(request.getParameter("LINE_ID"));}
catch(Exception ex){setLINE_ID(null);}
try{setTABLE_OPTION(request.getParameter("TABLE_OPTION"));}
catch(Exception ex){setTABLE_OPTION(null);}
try{setOUT_PROFILE_ID(request.getParameter("OUT_PROFILE_ID"));}
catch(Exception ex){setOUT_PROFILE_ID(null);}
try{setIN_PROFILE_ID(request.getParameter("IN_PROFILE_ID"));}
catch(Exception ex){setIN_PROFILE_ID(null);}
try{setTABLE_ID(request.getParameter("TABLE_ID"));}
catch(Exception ex){setTABLE_ID(null);}
try{setSTATION_ID(request.getParameter("STATION_ID"));}
catch(Exception ex){setSTATION_ID(null);}
try{setPLANT_ID(request.getParameter("PLANT_ID"));}
catch(Exception ex){setPLANT_ID(null);}
}
public static class RML_TABLEs extends ArrayList<RML_TABLE> {
}
}
|
UTF-8
|
Java
| 4,803 |
java
|
RML_TABLE.java
|
Java
|
[] | null |
[] |
package org.IASC.Roll.Entity;
import java.util.ArrayList;
public class RML_TABLE{
Object rowid;
/**Sets rowid
* @param value the rowid to set
*/public void setrowid(Object value)
{
this.rowid=value;
}
/**
* @return the rowid
*/public Object getrowid()
{
return this.rowid;
}
Integer REVISION;
/**Sets REVISION
* @param value the REVISION to set
*/public void setREVISION(Integer value)
{
this.REVISION=value;
}
/**
* @return the REVISION
*/public Integer getREVISION()
{
return this.REVISION;
}
String OPERATOR;
/**Sets OPERATOR
* @param value the OPERATOR to set
*/public void setOPERATOR(String value)
{
this.OPERATOR=value;
}
/**
* @return the OPERATOR
*/public String getOPERATOR()
{
return this.OPERATOR;
}
Integer PASSES;
/**Sets PASSES
* @param value the PASSES to set
*/public void setPASSES(Integer value)
{
this.PASSES=value;
}
/**
* @return the PASSES
*/public Integer getPASSES()
{
return this.PASSES;
}
Integer DIAMETER;
/**Sets DIAMETER
* @param value the DIAMETER to set
*/public void setDIAMETER(Integer value)
{
this.DIAMETER=value;
}
/**
* @return the DIAMETER
*/public Integer getDIAMETER()
{
return this.DIAMETER;
}
String LINE_ID;
/**Sets LINE_ID
* @param value the LINE_ID to set
*/public void setLINE_ID(String value)
{
this.LINE_ID=value;
}
/**
* @return the LINE_ID
*/public String getLINE_ID()
{
return this.LINE_ID;
}
String TABLE_OPTION;
/**Sets TABLE_OPTION
* @param value the TABLE_OPTION to set
*/public void setTABLE_OPTION(String value)
{
this.TABLE_OPTION=value;
}
/**
* @return the TABLE_OPTION
*/public String getTABLE_OPTION()
{
return this.TABLE_OPTION;
}
String OUT_PROFILE_ID;
/**Sets OUT_PROFILE_ID
* @param value the OUT_PROFILE_ID to set
*/public void setOUT_PROFILE_ID(String value)
{
this.OUT_PROFILE_ID=value;
}
/**
* @return the OUT_PROFILE_ID
*/public String getOUT_PROFILE_ID()
{
return this.OUT_PROFILE_ID;
}
String IN_PROFILE_ID;
/**Sets IN_PROFILE_ID
* @param value the IN_PROFILE_ID to set
*/public void setIN_PROFILE_ID(String value)
{
this.IN_PROFILE_ID=value;
}
/**
* @return the IN_PROFILE_ID
*/public String getIN_PROFILE_ID()
{
return this.IN_PROFILE_ID;
}
String TABLE_ID;
/**Sets TABLE_ID
* @param value the TABLE_ID to set
*/public void setTABLE_ID(String value)
{
this.TABLE_ID=value;
}
/**
* @return the TABLE_ID
*/public String getTABLE_ID()
{
return this.TABLE_ID;
}
String STATION_ID;
/**Sets STATION_ID
* @param value the STATION_ID to set
*/public void setSTATION_ID(String value)
{
this.STATION_ID=value;
}
/**
* @return the STATION_ID
*/public String getSTATION_ID()
{
return this.STATION_ID;
}
String PLANT_ID;
/**Sets PLANT_ID
* @param value the PLANT_ID to set
*/public void setPLANT_ID(String value)
{
this.PLANT_ID=value;
}
/**
* @return the PLANT_ID
*/public String getPLANT_ID()
{
return this.PLANT_ID;
}
public void retriveFromRequest(Object req) {
HttpServletRequest request=(HttpServletRequest) req;
try{setrowid(request.getParameter("rowid"));}
catch(Exception ex){setrowid(null);}
try{ setREVISION(request.getParameter("REVISION") != null ? Integer.parseInt(request.getParameter("REVISION")) : null);
}catch(Exception ex){setREVISION(null);}
try{setOPERATOR(request.getParameter("OPERATOR"));}
catch(Exception ex){setOPERATOR(null);}
try{ setPASSES(request.getParameter("PASSES") != null ? Integer.parseInt(request.getParameter("PASSES")) : null);
}catch(Exception ex){setPASSES(null);}
try{ setDIAMETER(request.getParameter("DIAMETER") != null ? Integer.parseInt(request.getParameter("DIAMETER")) : null);
}catch(Exception ex){setDIAMETER(null);}
try{setLINE_ID(request.getParameter("LINE_ID"));}
catch(Exception ex){setLINE_ID(null);}
try{setTABLE_OPTION(request.getParameter("TABLE_OPTION"));}
catch(Exception ex){setTABLE_OPTION(null);}
try{setOUT_PROFILE_ID(request.getParameter("OUT_PROFILE_ID"));}
catch(Exception ex){setOUT_PROFILE_ID(null);}
try{setIN_PROFILE_ID(request.getParameter("IN_PROFILE_ID"));}
catch(Exception ex){setIN_PROFILE_ID(null);}
try{setTABLE_ID(request.getParameter("TABLE_ID"));}
catch(Exception ex){setTABLE_ID(null);}
try{setSTATION_ID(request.getParameter("STATION_ID"));}
catch(Exception ex){setSTATION_ID(null);}
try{setPLANT_ID(request.getParameter("PLANT_ID"));}
catch(Exception ex){setPLANT_ID(null);}
}
public static class RML_TABLEs extends ArrayList<RML_TABLE> {
}
}
| 4,803 | 0.65584 | 0.65584 | 214 | 21.443926 | 22.108994 | 121 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.294393 | false | false |
12
|
0505f4ed4daaf8eb313ceb590cf6cfb2c2dd0962
| 34,918,084,153,335 |
7e2a859d23ef381d558dd73f8e24315a44c7e43c
|
/Obres/src/Model/TipusVia.java
|
d635ddbb90d686c904b933ac63ce2490856742ca
|
[] |
no_license
|
OskyFJ/Prac3Programacio
|
https://github.com/OskyFJ/Prac3Programacio
|
25a15ad466cee7e1a9ccd09134eaefed8e958c72
|
31b54da29119e22fa123dd409123abe3bda63a22
|
refs/heads/master
| 2016-09-02T05:57:59.989000 | 2014-11-29T19:26:43 | 2014-11-29T19:26:43 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package Model;
public enum TipusVia {
AUTOPISTA, AUTOVIA, NACIONAL, COMARCAL, ALTRES
}
|
UTF-8
|
Java
| 94 |
java
|
TipusVia.java
|
Java
|
[] | null |
[] |
package Model;
public enum TipusVia {
AUTOPISTA, AUTOVIA, NACIONAL, COMARCAL, ALTRES
}
| 94 | 0.723404 | 0.723404 | 5 | 16.799999 | 17.197674 | 47 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.2 | false | false |
12
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.