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
862ed75ce0a8da627999494673c348eccca3040a
34,265,249,118,682
4179f663c3c4190f93b87cfe3f065250623d163d
/JobPortalMVCBoot/src/main/java/com/niit/recruiter/repository/EducationRepo.java
df626698d421b6d89fa1d69973435dce5ffd48fb
[]
no_license
deepanshu102/ForAngularProject
https://github.com/deepanshu102/ForAngularProject
2496af14e15a7f3e52102019a8a6fcceafde645d
93b1a35b772c44bf24a1cbc9557173e182eda2c3
refs/heads/master
2022-04-19T15:07:28.837000
2020-04-18T15:07:14
2020-04-18T15:07:14
256,782,302
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.niit.recruiter.repository; import java.util.List; import org.springframework.data.jpa.repository.JpaRepository; import com.niit.recruiter.model.Education; import com.niit.recruiter.model.JobSeeker; public interface EducationRepo extends JpaRepository<Education, Integer> { List<Education> findByJobSeeker(JobSeeker activeUser); List<Education> findByJobSeekerOrderByEducationCategoryAsc(JobSeeker activeUser); }
UTF-8
Java
433
java
EducationRepo.java
Java
[]
null
[]
package com.niit.recruiter.repository; import java.util.List; import org.springframework.data.jpa.repository.JpaRepository; import com.niit.recruiter.model.Education; import com.niit.recruiter.model.JobSeeker; public interface EducationRepo extends JpaRepository<Education, Integer> { List<Education> findByJobSeeker(JobSeeker activeUser); List<Education> findByJobSeekerOrderByEducationCategoryAsc(JobSeeker activeUser); }
433
0.836028
0.836028
16
26.0625
29.084938
82
false
false
0
0
0
0
0
0
0.625
false
false
13
0d17456edf9bd3734b979af44d4108e3b51e9c9b
36,197,984,386,938
f5b8b37f0745c6981a4cddd68bb4fd9e1754f6b1
/JAVA/SwapNodeInPair.java
8fb08db1bd1fa8f568478aef9ef76b9b831468d4
[ "MIT" ]
permissive
onedaygotosky/leetcode
https://github.com/onedaygotosky/leetcode
bc36497b2ad9ae23d0114cb1065dfc462db22ddf
c28c0a50300a28262ffcb7fe4f12d028d80d0f14
refs/heads/master
2018-12-31T21:54:25.202000
2015-09-03T12:10:53
2015-09-03T12:10:53
35,327,498
4
0
null
null
null
null
null
null
null
null
null
null
null
null
null
/** * Definition for singly-linked list. * public class ListNode { * int val; * ListNode next; * ListNode(int x) { val = x; } * } */ //从头开始交换链表相邻的结点 //必须就是交换结点,不能是交换结点的val //要画图才比较好理解 public class Solution { public ListNode swapPairs(ListNode head) { if(head == null) return null; if(head.next == null) return head; ListNode pre,middle,post,lastChunk; //先交换前面两个 pre = head; middle = pre.next; post = middle.next; //swap middle.next = pre; pre.next = post; //reset the head head = middle; //record lastchunk lastChunk = pre; //要特别注意连接前一次交换得到的新段和后面一次交换之后的段 while(post != null) { //shift pre = post; //如果链表结点个数为单数 if(pre.next == null) { break; } middle = pre.next; post = middle.next; //swap middle.next = pre; pre.next = post; //重新连接前后两个分别交换过后的段 lastChunk.next = middle; lastChunk = pre; } return head; } }
UTF-8
Java
1,407
java
SwapNodeInPair.java
Java
[]
null
[]
/** * Definition for singly-linked list. * public class ListNode { * int val; * ListNode next; * ListNode(int x) { val = x; } * } */ //从头开始交换链表相邻的结点 //必须就是交换结点,不能是交换结点的val //要画图才比较好理解 public class Solution { public ListNode swapPairs(ListNode head) { if(head == null) return null; if(head.next == null) return head; ListNode pre,middle,post,lastChunk; //先交换前面两个 pre = head; middle = pre.next; post = middle.next; //swap middle.next = pre; pre.next = post; //reset the head head = middle; //record lastchunk lastChunk = pre; //要特别注意连接前一次交换得到的新段和后面一次交换之后的段 while(post != null) { //shift pre = post; //如果链表结点个数为单数 if(pre.next == null) { break; } middle = pre.next; post = middle.next; //swap middle.next = pre; pre.next = post; //重新连接前后两个分别交换过后的段 lastChunk.next = middle; lastChunk = pre; } return head; } }
1,407
0.46722
0.46722
52
22.192308
10.19434
46
false
false
0
0
0
0
0
0
0.480769
false
false
13
e1a0673f0eb21f307747dcb412402ea2ab6e0340
9,904,194,621,068
fa9f3327c9ad529c3cd502855023650f90dc9ab0
/src/wsj/dp/singleton/SingletonSix.java
9bd0d5636037a863dfa5564fbbcda78f1e3f7576
[]
no_license
RichardFrankios/DesignPatternLearning
https://github.com/RichardFrankios/DesignPatternLearning
b12d8a296b8168654ffebdb99538336cb6019004
b608a5cd8a6dee4b124211cc041333050d15510e
refs/heads/master
2021-01-18T15:42:55.471000
2017-03-30T10:29:18
2017-03-30T10:29:18
86,676,219
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package wsj.dp.singleton; /** * @author wsj * 枚举方式实现单例.自动支持序列化机制. */ public enum SingletonSix { instance; // 其他方法. }
UTF-8
Java
165
java
SingletonSix.java
Java
[ { "context": "package wsj.dp.singleton;\n\n/**\n * @author wsj\n * 枚举方式实现单例.自动支持序列化机制.\n */\npublic enum SingletonS", "end": 45, "score": 0.9994840621948242, "start": 42, "tag": "USERNAME", "value": "wsj" } ]
null
[]
package wsj.dp.singleton; /** * @author wsj * 枚举方式实现单例.自动支持序列化机制. */ public enum SingletonSix { instance; // 其他方法. }
165
0.658537
0.658537
10
11.3
9.508417
26
false
false
0
0
0
0
0
0
0.4
false
false
13
923fc4e476ceb7f22581010754d34addb04b1f6b
23,261,542,920,107
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/33/33_95a36ec86318e98cb3ee9653cdbea0ec4c1e8c3b/RadarImageSyncAndGridCalculationTask/33_95a36ec86318e98cb3ee9653cdbea0ec4c1e8c3b_RadarImageSyncAndGridCalculationTask_t.java
3ec7d7cf4e1189b3272e198c031870548c586a55
[]
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
package it.giacomos.android.osmer.service; import android.os.AsyncTask; import android.util.Log; import it.giacomos.android.osmer.locationUtils.GeoCoordinates; import it.giacomos.android.osmer.rainAlert.RainDetectResult; import it.giacomos.android.osmer.rainAlert.SyncImages; import it.giacomos.android.osmer.rainAlert.genericAlgo.MeteoFvgImgParams; import it.giacomos.android.osmer.rainAlert.gridAlgo.ImgCompareGrids; import it.giacomos.android.osmer.rainAlert.gridAlgo.ImgOverlayGrid; public class RadarImageSyncAndGridCalculationTask extends AsyncTask<String, Integer, RainDetectResult> { private RadarImageSyncAndCalculationTaskListener mRadarImageSyncTaskListener; private double mMyLatitude, mMyLongitude; public RadarImageSyncAndGridCalculationTask(double mylatitude, double mylongitude, RadarImageSyncAndCalculationTaskListener radarImageSyncAndCalculationTaskListener) { mRadarImageSyncTaskListener = radarImageSyncAndCalculationTaskListener; mMyLatitude = mylatitude; mMyLongitude = mylongitude; // mMyLatitude = 46.06009; // mMyLongitude = 12.079811; } @Override protected RainDetectResult doInBackground(String... configurations) { RainDetectResult rainDetectRes = null; /* some configuration file names and the grid configuration are passed inside configurations arg */ String gridConf = configurations[0]; String radarImgLocalPath = configurations[1]; String radarImgRemotePath = configurations[2]; String lastImgFileName = ""; String prevImgFileName = ""; /* From GeoCoordinates.java: * public static final LatLngBounds radarImageBounds = new LatLngBounds(new LatLng(44.6052, 11.9294), * new LatLng(46.8080, 15.0857)); */ double topLeftLat = GeoCoordinates.radarImageBounds.northeast.latitude; double topLeftLon = GeoCoordinates.radarImageBounds.southwest.longitude; double botRightLat = GeoCoordinates.radarImageBounds.southwest.latitude; double botRightLon = GeoCoordinates.radarImageBounds.northeast.longitude; double widthKm = 240.337; double heightKm = 244.153; double defaultRadius = 20; /* 20km */ /* sync radar images for rain detection */ SyncImages syncer = new SyncImages(); String [] filenames = syncer.sync(radarImgRemotePath, radarImgLocalPath); if(filenames != null) { lastImgFileName = radarImgLocalPath + "/" + filenames[0]; prevImgFileName = radarImgLocalPath + "/" + filenames[1]; ImgOverlayGrid imgoverlaygrid_0 = new ImgOverlayGrid(lastImgFileName, 501, 501, topLeftLat, topLeftLon, botRightLat, botRightLon, widthKm, heightKm, defaultRadius, mMyLatitude, mMyLongitude); ImgOverlayGrid imgoverlaygrid_1 = new ImgOverlayGrid(prevImgFileName, 501, 501, topLeftLat, topLeftLon, botRightLat, botRightLon, widthKm, heightKm, defaultRadius, mMyLatitude, mMyLongitude); imgoverlaygrid_1.init(gridConf); imgoverlaygrid_0.init(gridConf); if(imgoverlaygrid_1.isValid() && imgoverlaygrid_0.isValid()) { MeteoFvgImgParams imgParams = new MeteoFvgImgParams(); imgoverlaygrid_1.processImage(imgParams); imgoverlaygrid_0.processImage(imgParams); ImgCompareGrids imgCmpGrids = new ImgCompareGrids(); rainDetectRes = imgCmpGrids.compare(imgoverlaygrid_0, imgoverlaygrid_1, imgParams); } else /* latitude and longitude of the user outside the valid radar area */ rainDetectRes = new RainDetectResult(false, 0.0f); } else Log.e("RadarImageSync... ", "filenames is null!"); if(rainDetectRes != null) Log.e("RadarImageSync... ", "last " + lastImgFileName + ", prev " + prevImgFileName + ", rain: " + rainDetectRes.willRain + " dbz: " + rainDetectRes.dbz + " tlLa " + topLeftLat + " tlLon " + topLeftLon + ", brla " + botRightLat + ", brlon " + botRightLon + " myLa " + mMyLatitude + ", myLon " + mMyLongitude); return rainDetectRes; } @Override public void onPostExecute(RainDetectResult result) { mRadarImageSyncTaskListener.onRainDetectionDone(result); } @Override public void onCancelled(RainDetectResult result) { Log.e("RadarImageSyncAndGridCalculationTask.onCancelled", "task cancelled"); mRadarImageSyncTaskListener.onRainDetectionDone(result); } }
UTF-8
Java
4,321
java
33_95a36ec86318e98cb3ee9653cdbea0ec4c1e8c3b_RadarImageSyncAndGridCalculationTask_t.java
Java
[]
null
[]
package it.giacomos.android.osmer.service; import android.os.AsyncTask; import android.util.Log; import it.giacomos.android.osmer.locationUtils.GeoCoordinates; import it.giacomos.android.osmer.rainAlert.RainDetectResult; import it.giacomos.android.osmer.rainAlert.SyncImages; import it.giacomos.android.osmer.rainAlert.genericAlgo.MeteoFvgImgParams; import it.giacomos.android.osmer.rainAlert.gridAlgo.ImgCompareGrids; import it.giacomos.android.osmer.rainAlert.gridAlgo.ImgOverlayGrid; public class RadarImageSyncAndGridCalculationTask extends AsyncTask<String, Integer, RainDetectResult> { private RadarImageSyncAndCalculationTaskListener mRadarImageSyncTaskListener; private double mMyLatitude, mMyLongitude; public RadarImageSyncAndGridCalculationTask(double mylatitude, double mylongitude, RadarImageSyncAndCalculationTaskListener radarImageSyncAndCalculationTaskListener) { mRadarImageSyncTaskListener = radarImageSyncAndCalculationTaskListener; mMyLatitude = mylatitude; mMyLongitude = mylongitude; // mMyLatitude = 46.06009; // mMyLongitude = 12.079811; } @Override protected RainDetectResult doInBackground(String... configurations) { RainDetectResult rainDetectRes = null; /* some configuration file names and the grid configuration are passed inside configurations arg */ String gridConf = configurations[0]; String radarImgLocalPath = configurations[1]; String radarImgRemotePath = configurations[2]; String lastImgFileName = ""; String prevImgFileName = ""; /* From GeoCoordinates.java: * public static final LatLngBounds radarImageBounds = new LatLngBounds(new LatLng(44.6052, 11.9294), * new LatLng(46.8080, 15.0857)); */ double topLeftLat = GeoCoordinates.radarImageBounds.northeast.latitude; double topLeftLon = GeoCoordinates.radarImageBounds.southwest.longitude; double botRightLat = GeoCoordinates.radarImageBounds.southwest.latitude; double botRightLon = GeoCoordinates.radarImageBounds.northeast.longitude; double widthKm = 240.337; double heightKm = 244.153; double defaultRadius = 20; /* 20km */ /* sync radar images for rain detection */ SyncImages syncer = new SyncImages(); String [] filenames = syncer.sync(radarImgRemotePath, radarImgLocalPath); if(filenames != null) { lastImgFileName = radarImgLocalPath + "/" + filenames[0]; prevImgFileName = radarImgLocalPath + "/" + filenames[1]; ImgOverlayGrid imgoverlaygrid_0 = new ImgOverlayGrid(lastImgFileName, 501, 501, topLeftLat, topLeftLon, botRightLat, botRightLon, widthKm, heightKm, defaultRadius, mMyLatitude, mMyLongitude); ImgOverlayGrid imgoverlaygrid_1 = new ImgOverlayGrid(prevImgFileName, 501, 501, topLeftLat, topLeftLon, botRightLat, botRightLon, widthKm, heightKm, defaultRadius, mMyLatitude, mMyLongitude); imgoverlaygrid_1.init(gridConf); imgoverlaygrid_0.init(gridConf); if(imgoverlaygrid_1.isValid() && imgoverlaygrid_0.isValid()) { MeteoFvgImgParams imgParams = new MeteoFvgImgParams(); imgoverlaygrid_1.processImage(imgParams); imgoverlaygrid_0.processImage(imgParams); ImgCompareGrids imgCmpGrids = new ImgCompareGrids(); rainDetectRes = imgCmpGrids.compare(imgoverlaygrid_0, imgoverlaygrid_1, imgParams); } else /* latitude and longitude of the user outside the valid radar area */ rainDetectRes = new RainDetectResult(false, 0.0f); } else Log.e("RadarImageSync... ", "filenames is null!"); if(rainDetectRes != null) Log.e("RadarImageSync... ", "last " + lastImgFileName + ", prev " + prevImgFileName + ", rain: " + rainDetectRes.willRain + " dbz: " + rainDetectRes.dbz + " tlLa " + topLeftLat + " tlLon " + topLeftLon + ", brla " + botRightLat + ", brlon " + botRightLon + " myLa " + mMyLatitude + ", myLon " + mMyLongitude); return rainDetectRes; } @Override public void onPostExecute(RainDetectResult result) { mRadarImageSyncTaskListener.onRainDetectionDone(result); } @Override public void onCancelled(RainDetectResult result) { Log.e("RadarImageSyncAndGridCalculationTask.onCancelled", "task cancelled"); mRadarImageSyncTaskListener.onRainDetectionDone(result); } }
4,321
0.741726
0.722287
111
37.918919
31.337494
135
false
false
0
0
0
0
0
0
2.711712
false
false
13
5587e5186f91669752528c48309d53d98eee09b3
4,269,197,535,593
f65a6e075738f5f47eb9bcea67252611bd12d61b
/src/main/java/com/sanvalero/greenrouteapp/domain/Road.java
2cddb72397e224ad23394625c35fe579ef465b71
[]
no_license
DamGreenTeam/GreenRouteApp
https://github.com/DamGreenTeam/GreenRouteApp
c960e8f4727ac360997d818a770d656158fec644
b801b1d45e960d186b0ad48c64f0e2e0b6af4d00
refs/heads/master
2023-03-31T16:20:24.466000
2021-04-10T07:21:30
2021-04-10T07:21:30
356,166,386
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.sanvalero.greenrouteapp.domain; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import java.time.LocalDate; /** * Creado por @ author: Pedro Orós * el 08/04/2021 */ @Data @Builder @AllArgsConstructor @NoArgsConstructor public class Road { private long id; private String name; private float length; private boolean toll; private String buildDate; private String image; }
UTF-8
Java
478
java
Road.java
Java
[ { "context": " java.time.LocalDate;\n\n/**\n * Creado por @ author: Pedro Orós\n * el 08/04/2021\n */\n\n@Data\n@Builder\n@AllArgsCons", "end": 223, "score": 0.9998905062675476, "start": 213, "tag": "NAME", "value": "Pedro Orós" } ]
null
[]
package com.sanvalero.greenrouteapp.domain; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import java.time.LocalDate; /** * Creado por @ author: <NAME> * el 08/04/2021 */ @Data @Builder @AllArgsConstructor @NoArgsConstructor public class Road { private long id; private String name; private float length; private boolean toll; private String buildDate; private String image; }
473
0.746331
0.72956
27
16.666666
12.610989
43
false
false
0
0
0
0
0
0
0.444444
false
false
13
db2668c8eaf4c3511d78025b5ad827ee7a69c5c0
37,151,467,123,095
7c3a5fe83f60af1061cd03b5ae70208905928865
/src/com/studytrade/studytrade2/model/StudyTradeDefinitions.java
2159fae9c80ebf56615ec54f1b565c25388ab0df
[]
no_license
Mikescher/StudyTrade2
https://github.com/Mikescher/StudyTrade2
7fcef4f212cd855fc8ff1cc0b990c6671a35fe1e
979b2f31099d8e488ecc12c47a57b1710f36bc89
refs/heads/master
2020-06-06T18:34:19.777000
2014-06-16T16:59:41
2014-06-16T16:59:41
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.studytrade.studytrade2.model; import com.vaadin.ui.NativeSelect; public class StudyTradeDefinitions { public static String[] PLACES = { "DH Karlsruhe", "DH Freiburg", "Uni Offenburg", "Other", }; public static String[] CONDITIONS = { "OVP", "New", "Like New", "Used", "Slightly damaged", "Heavily damaged", "Defect", "Totally broken", }; public static void addSelectItems_Places(NativeSelect sel) { for (String p : PLACES) { sel.setItemCaption(sel.addItem(p), p); } } public static void addSelectItems_Condition(NativeSelect sel) { for (String p : CONDITIONS) { sel.setItemCaption(sel.addItem(p), p); } } public static int getConditionIndex(String cond) { for (int i = 0; i < CONDITIONS.length; i++) { if (CONDITIONS[i].equalsIgnoreCase(cond)) { return i; } } return 0; } }
UTF-8
Java
865
java
StudyTradeDefinitions.java
Java
[]
null
[]
package com.studytrade.studytrade2.model; import com.vaadin.ui.NativeSelect; public class StudyTradeDefinitions { public static String[] PLACES = { "DH Karlsruhe", "DH Freiburg", "Uni Offenburg", "Other", }; public static String[] CONDITIONS = { "OVP", "New", "Like New", "Used", "Slightly damaged", "Heavily damaged", "Defect", "Totally broken", }; public static void addSelectItems_Places(NativeSelect sel) { for (String p : PLACES) { sel.setItemCaption(sel.addItem(p), p); } } public static void addSelectItems_Condition(NativeSelect sel) { for (String p : CONDITIONS) { sel.setItemCaption(sel.addItem(p), p); } } public static int getConditionIndex(String cond) { for (int i = 0; i < CONDITIONS.length; i++) { if (CONDITIONS[i].equalsIgnoreCase(cond)) { return i; } } return 0; } }
865
0.654335
0.650867
47
17.404255
17.980675
64
false
false
0
0
0
0
0
0
2
false
false
13
ded8fd1ce2099eadd4a27da3af6937cbeb742d26
35,493,609,762,520
fe150aac9cad2aafba345065045c3b5bcc109c52
/cedar-server-globals/src/main/java/org/metadatacenter/server/security/model/auth/CedarGroupUserRequest.java
13041bfdf193d6725f1ec5fe19966adb6fc4b550
[ "BSD-2-Clause" ]
permissive
metadatacenter/cedar-server-utils
https://github.com/metadatacenter/cedar-server-utils
33884c450b982e9159cc37114f39dc2e8eaa4cf8
861be596bff05923831800cd9af9f86741857bcd
refs/heads/master
2021-05-22T10:05:28.683000
2021-03-19T05:21:26
2021-03-19T05:23:59
50,546,981
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package org.metadatacenter.server.security.model.auth; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import org.metadatacenter.server.security.model.permission.resource.ResourcePermissionUser; @JsonIgnoreProperties(ignoreUnknown = true) public class CedarGroupUserRequest { private ResourcePermissionUser user; private boolean administrator; private boolean member; public CedarGroupUserRequest() { } public CedarGroupUserRequest(ResourcePermissionUser user, boolean administrator, boolean member) { this.user = user; this.administrator = administrator; this.member = member; } public ResourcePermissionUser getUser() { return user; } public void setUser(ResourcePermissionUser user) { this.user = user; } public boolean isAdministrator() { return administrator; } public void setAdministrator(boolean administrator) { this.administrator = administrator; } public boolean isMember() { return member; } public void setMember(boolean member) { this.member = member; } }
UTF-8
Java
1,069
java
CedarGroupUserRequest.java
Java
[]
null
[]
package org.metadatacenter.server.security.model.auth; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import org.metadatacenter.server.security.model.permission.resource.ResourcePermissionUser; @JsonIgnoreProperties(ignoreUnknown = true) public class CedarGroupUserRequest { private ResourcePermissionUser user; private boolean administrator; private boolean member; public CedarGroupUserRequest() { } public CedarGroupUserRequest(ResourcePermissionUser user, boolean administrator, boolean member) { this.user = user; this.administrator = administrator; this.member = member; } public ResourcePermissionUser getUser() { return user; } public void setUser(ResourcePermissionUser user) { this.user = user; } public boolean isAdministrator() { return administrator; } public void setAdministrator(boolean administrator) { this.administrator = administrator; } public boolean isMember() { return member; } public void setMember(boolean member) { this.member = member; } }
1,069
0.755847
0.755847
45
22.755556
24.430542
100
false
false
0
0
0
0
0
0
0.377778
false
false
13
eaed51ef75e4d08ac5be1613c678d8f7a4c1edb9
22,127,671,574,414
804825d9b8041948ed775d4f37d425e1f117ba4b
/zoyibean/src/org/zoyi/service/impl/AnnouncementServiceImpl.java
1979d0af0638b14bf94af89753ce758114e8d452
[]
no_license
BGCX261/zoyijavabean-svn-to-git
https://github.com/BGCX261/zoyijavabean-svn-to-git
c6459ea382d1b4a6d27568641801f59bc8a4ed31
1b4ae8e1de4ca8aeb14cc5da32a26edd5bdd8ab3
refs/heads/master
2021-01-01T19:33:51.782000
2015-08-25T15:52:38
2015-08-25T15:52:38
41,600,155
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package org.zoyi.service.impl; import java.util.List; import org.zoyi.service.AnnouncementService; import org.zoyi.vo.Announcement; import org.zoyi.adapter.AnnouncementAdapter; import org.zoyi.hibernate.ZoyiAnnouncementDAO; public class AnnouncementServiceImpl implements AnnouncementService { public AnnouncementServiceImpl() { } @Override public String add(Announcement t) throws Exception { try { new ZoyiAnnouncementDAO().add(AnnouncementAdapter.toPo(t)); return "success"; } catch (Exception e) { e.printStackTrace(); return "fail"; } } public String delete(List<Integer> id) throws Exception { try { for (Integer i : id) { this.deleteById(i); } return "success"; } catch (Exception e) { e.printStackTrace(); return "fail"; } } @Override public String deleteById(int id) throws Exception { try { new ZoyiAnnouncementDAO().delete(id); return "success"; } catch (Exception e) { e.printStackTrace(); return "fail"; } } @Override public String isExist(Announcement t) throws Exception { return this.isExist(t.getId()); } @Override public String isExist(int id) throws Exception { if(new ZoyiAnnouncementDAO().get(id)!=null){ return "success"; }else{ return "fail"; } } @Override public String modify(Announcement t) throws Exception { try { new ZoyiAnnouncementDAO().update(AnnouncementAdapter.toPo(t)); return "success"; } catch (Exception e) { e.printStackTrace(); return "fail"; } } @Override public Announcement queryById(int id) throws Exception { return AnnouncementAdapter.toVo(new ZoyiAnnouncementDAO().get(id)); } public List<Object> queryByPage(int startRow, int pageSize) { return new ZoyiAnnouncementDAO().queryByPage(startRow, pageSize); } @Override public int getCount() { return new ZoyiAnnouncementDAO().getCount(); } @Override public String plusClick(int i,int announcementId) throws Exception { try { new ZoyiAnnouncementDAO().plusClick(i, announcementId); return "success"; } catch (Exception e) { e.printStackTrace(); return "fail"; } } @Override public int getCountByCond(int startRow, int pageSize, String cond) throws Exception { return new ZoyiAnnouncementDAO().countByCond(cond); } @Override public List<Object> queryByCond(int startRow, int pageSize, String cond) throws Exception { return new ZoyiAnnouncementDAO().queryByCond(startRow, pageSize, cond); } }
UTF-8
Java
2,577
java
AnnouncementServiceImpl.java
Java
[]
null
[]
package org.zoyi.service.impl; import java.util.List; import org.zoyi.service.AnnouncementService; import org.zoyi.vo.Announcement; import org.zoyi.adapter.AnnouncementAdapter; import org.zoyi.hibernate.ZoyiAnnouncementDAO; public class AnnouncementServiceImpl implements AnnouncementService { public AnnouncementServiceImpl() { } @Override public String add(Announcement t) throws Exception { try { new ZoyiAnnouncementDAO().add(AnnouncementAdapter.toPo(t)); return "success"; } catch (Exception e) { e.printStackTrace(); return "fail"; } } public String delete(List<Integer> id) throws Exception { try { for (Integer i : id) { this.deleteById(i); } return "success"; } catch (Exception e) { e.printStackTrace(); return "fail"; } } @Override public String deleteById(int id) throws Exception { try { new ZoyiAnnouncementDAO().delete(id); return "success"; } catch (Exception e) { e.printStackTrace(); return "fail"; } } @Override public String isExist(Announcement t) throws Exception { return this.isExist(t.getId()); } @Override public String isExist(int id) throws Exception { if(new ZoyiAnnouncementDAO().get(id)!=null){ return "success"; }else{ return "fail"; } } @Override public String modify(Announcement t) throws Exception { try { new ZoyiAnnouncementDAO().update(AnnouncementAdapter.toPo(t)); return "success"; } catch (Exception e) { e.printStackTrace(); return "fail"; } } @Override public Announcement queryById(int id) throws Exception { return AnnouncementAdapter.toVo(new ZoyiAnnouncementDAO().get(id)); } public List<Object> queryByPage(int startRow, int pageSize) { return new ZoyiAnnouncementDAO().queryByPage(startRow, pageSize); } @Override public int getCount() { return new ZoyiAnnouncementDAO().getCount(); } @Override public String plusClick(int i,int announcementId) throws Exception { try { new ZoyiAnnouncementDAO().plusClick(i, announcementId); return "success"; } catch (Exception e) { e.printStackTrace(); return "fail"; } } @Override public int getCountByCond(int startRow, int pageSize, String cond) throws Exception { return new ZoyiAnnouncementDAO().countByCond(cond); } @Override public List<Object> queryByCond(int startRow, int pageSize, String cond) throws Exception { return new ZoyiAnnouncementDAO().queryByCond(startRow, pageSize, cond); } }
2,577
0.682965
0.682965
111
21.216217
21.94235
73
false
false
0
0
0
0
0
0
1.864865
false
false
13
4afc696e6d954ca77df3932d9379ba4a44a611be
38,001,870,642,580
4b46e0887ecc9a613f8d9bdddba7d34189d6d2d0
/module/01.web/src/com/gxx/file/CreateFilesAction.java
a2c72a2ed91329b7a482db20416ec80f5f1fa88c
[]
no_license
GuanXianghui/suncare-files
https://github.com/GuanXianghui/suncare-files
02606c3e7cabd77dff2d9fb9ee8e59215de37bda
e28fbcaa5dbfd9c56ad428d153a99202e4382df9
refs/heads/master
2016-09-06T07:40:11.493000
2014-04-23T01:42:22
2014-04-23T01:42:22
19,052,464
0
1
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.gxx.file; import com.gxx.file.dao.FilesDao; import com.gxx.file.entities.Files; import com.gxx.file.interfaces.OperateLogInterface; import com.gxx.file.utils.BaseUtil; import com.gxx.file.utils.TokenUtil; /** * 创建文档Action * * @author Gxx * @module oa * @datetime 14-4-18 15:22 */ public class CreateFilesAction extends BaseAction { /** * 文档名称 */ String name; String fileNum; String projectName; String doorSeries; String glassType; String wind; String air; String water; String temperature; String voice; String sun; String perspective; String dewPoint; /** * 入口 * @return */ public String execute() throws Exception { logger.info("name:" + name + ",fileNum=" + fileNum + ",projectName=" + projectName + ",doorSeries=" + doorSeries + ",glassType=" + glassType + ",wind=" + wind + ",air=" + air + ",water=" + water + ",temperature=" + temperature + ",voice=" + voice + ",sun=" + sun + ",perspective=" + perspective + ",dewPoint=" + dewPoint); String resp; if(FilesDao.isNameExist(name)){ resp = "{isSuccess:false,message:'该文档名字已存在!',hasNewToken:true,token:'" + TokenUtil.createToken(request) + "'}"; } else { Files files = new Files(name, fileNum, projectName, doorSeries, glassType, wind, air, water, temperature, voice, sun, perspective, dewPoint); FilesDao.insertFiles(files); resp = "{isSuccess:true,message:'新增文档成功!',hasNewToken:true,token:'" + TokenUtil.createToken(request) + "'}"; //创建操作日志 BaseUtil.createOperateLog(getUser().getName(), OperateLogInterface.TYPE_CREATE_FILES, "新建文档[" + name + "]", date, time, getIp()); } write(resp); return null; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getFileNum() { return fileNum; } public void setFileNum(String fileNum) { this.fileNum = fileNum; } public String getProjectName() { return projectName; } public void setProjectName(String projectName) { this.projectName = projectName; } public String getDoorSeries() { return doorSeries; } public void setDoorSeries(String doorSeries) { this.doorSeries = doorSeries; } public String getGlassType() { return glassType; } public void setGlassType(String glassType) { this.glassType = glassType; } public String getWind() { return wind; } public void setWind(String wind) { this.wind = wind; } public String getAir() { return air; } public void setAir(String air) { this.air = air; } public String getWater() { return water; } public void setWater(String water) { this.water = water; } public String getTemperature() { return temperature; } public void setTemperature(String temperature) { this.temperature = temperature; } public String getVoice() { return voice; } public void setVoice(String voice) { this.voice = voice; } public String getSun() { return sun; } public void setSun(String sun) { this.sun = sun; } public String getPerspective() { return perspective; } public void setPerspective(String perspective) { this.perspective = perspective; } public String getDewPoint() { return dewPoint; } public void setDewPoint(String dewPoint) { this.dewPoint = dewPoint; } }
GB18030
Java
3,925
java
CreateFilesAction.java
Java
[ { "context": ".utils.TokenUtil;\n\n/**\n * 创建文档Action\n *\n * @author Gxx\n * @module oa\n * @datetime 14-4-18 15:22\n */\npubl", "end": 254, "score": 0.9996799230575562, "start": 251, "tag": "USERNAME", "value": "Gxx" } ]
null
[]
package com.gxx.file; import com.gxx.file.dao.FilesDao; import com.gxx.file.entities.Files; import com.gxx.file.interfaces.OperateLogInterface; import com.gxx.file.utils.BaseUtil; import com.gxx.file.utils.TokenUtil; /** * 创建文档Action * * @author Gxx * @module oa * @datetime 14-4-18 15:22 */ public class CreateFilesAction extends BaseAction { /** * 文档名称 */ String name; String fileNum; String projectName; String doorSeries; String glassType; String wind; String air; String water; String temperature; String voice; String sun; String perspective; String dewPoint; /** * 入口 * @return */ public String execute() throws Exception { logger.info("name:" + name + ",fileNum=" + fileNum + ",projectName=" + projectName + ",doorSeries=" + doorSeries + ",glassType=" + glassType + ",wind=" + wind + ",air=" + air + ",water=" + water + ",temperature=" + temperature + ",voice=" + voice + ",sun=" + sun + ",perspective=" + perspective + ",dewPoint=" + dewPoint); String resp; if(FilesDao.isNameExist(name)){ resp = "{isSuccess:false,message:'该文档名字已存在!',hasNewToken:true,token:'" + TokenUtil.createToken(request) + "'}"; } else { Files files = new Files(name, fileNum, projectName, doorSeries, glassType, wind, air, water, temperature, voice, sun, perspective, dewPoint); FilesDao.insertFiles(files); resp = "{isSuccess:true,message:'新增文档成功!',hasNewToken:true,token:'" + TokenUtil.createToken(request) + "'}"; //创建操作日志 BaseUtil.createOperateLog(getUser().getName(), OperateLogInterface.TYPE_CREATE_FILES, "新建文档[" + name + "]", date, time, getIp()); } write(resp); return null; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getFileNum() { return fileNum; } public void setFileNum(String fileNum) { this.fileNum = fileNum; } public String getProjectName() { return projectName; } public void setProjectName(String projectName) { this.projectName = projectName; } public String getDoorSeries() { return doorSeries; } public void setDoorSeries(String doorSeries) { this.doorSeries = doorSeries; } public String getGlassType() { return glassType; } public void setGlassType(String glassType) { this.glassType = glassType; } public String getWind() { return wind; } public void setWind(String wind) { this.wind = wind; } public String getAir() { return air; } public void setAir(String air) { this.air = air; } public String getWater() { return water; } public void setWater(String water) { this.water = water; } public String getTemperature() { return temperature; } public void setTemperature(String temperature) { this.temperature = temperature; } public String getVoice() { return voice; } public void setVoice(String voice) { this.voice = voice; } public String getSun() { return sun; } public void setSun(String sun) { this.sun = sun; } public String getPerspective() { return perspective; } public void setPerspective(String perspective) { this.perspective = perspective; } public String getDewPoint() { return dewPoint; } public void setDewPoint(String dewPoint) { this.dewPoint = dewPoint; } }
3,925
0.580846
0.57851
164
22.493902
22.829563
104
false
false
0
0
0
0
0
0
0.542683
false
false
13
181f59f73a5197a93e359151434ec8c63526d044
20,693,152,456,284
a63d261c59ac4e66e20313a8837f22fac3cd0855
/src/cn/edu/xmu/servlet/Sec_UpdateUndergraStuPartiSocialPrac.java
59ca0deaf3a9207c9e3f55dddc2c49044af64ba9
[]
no_license
Guosmilesmile/iqa
https://github.com/Guosmilesmile/iqa
9a7d54a3192b0e4634b9a0f268c106b9cbf1f07d
db7935120911396818146eeadb1ac4da095e0ffb
refs/heads/master
2021-01-20T17:46:31.076000
2016-08-21T08:46:25
2016-08-21T08:46:25
65,795,465
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package cn.edu.xmu.servlet; import java.io.IOException; import java.io.PrintWriter; import java.net.URLDecoder; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import cn.edu.xmu.dao.UndergraStuPartiSocialPracDao; import cn.edu.xmu.daoimpl.UndergraStuPartiSocialPracDaoImpl; import cn.edu.xmu.entity.UndergraStuPartiSocialPrac; import cn.edu.xmu.table.UndergraStuPartiSocialPracTable; import cn.edu.xmu.table.UndergraStuPartiSocialPracTable; /** * * @author xiaoping 附表5-4-3 本科生参与暑期社会实践情况 date 2015-7-10 * */ @WebServlet("/Sec_UpdateUndergraStuPartiSocialPrac") public class Sec_UpdateUndergraStuPartiSocialPrac extends HttpServlet { private static final long serialVersionUID = 1L; public Sec_UpdateUndergraStuPartiSocialPrac() { super(); } @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { this.doPost(request, response); } @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { request.setCharacterEncoding("UTF-8"); response.setCharacterEncoding("UTF-8"); response.setContentType("text/html;Charset=UTF-8"); PrintWriter out = response.getWriter(); String data = request.getParameter("rowdata"); String patter = request.getParameter("patter"); // 解码 data = URLDecoder.decode(data, "UTF-8"); data = data.substring(1, data.length() - 1); try { UndergraStuPartiSocialPracDao uspspDao = new UndergraStuPartiSocialPracDaoImpl(); if (patter != null && "batch".equals(patter)) { System.out.println("批量更新"); // 审核部分更新,可以批量 data = "[" + data + "]"; JSONArray jsons = new JSONArray(data); for (int i = 0; i < jsons.length(); i++) { String uspsp_id = jsons.getJSONObject(i).getString(UndergraStuPartiSocialPracTable.USPSP_ID); String uspsp_comments = jsons.getJSONObject(i) .getString(UndergraStuPartiSocialPracTable.USPSP_COMMENTS); Map<String, String> params = new HashMap<String, String>(); params.put(UndergraStuPartiSocialPracTable.USPSP_ID, uspsp_id); params.put(UndergraStuPartiSocialPracTable.USPSP_COMMENTS, uspsp_comments); int result = uspspDao.alterUndergraStuPartiSocialPrac(params, uspsp_id); out.print(result); } } else { JSONObject json = new JSONObject(data); String uspsp_id = json.getString(UndergraStuPartiSocialPracTable.USPSP_ID); String uspsp_department = json.getString(UndergraStuPartiSocialPracTable.USPSP_DEPARTMENT); String uspsp_focuspracnum = json.getString(UndergraStuPartiSocialPracTable.USPSP_FOCUSPRACNUM); String uspsp_scatterpracnum = json.getString(UndergraStuPartiSocialPracTable.USPSP_SCATTERPRACNUM); int uspsp_subtotal = 0; String uspsp_comments = json.getString(UndergraStuPartiSocialPracTable.USPSP_COMMENTS); String uspsp_isnull = "0"; if ("".equals(uspsp_department) || "".equals(uspsp_focuspracnum) || "".equals(uspsp_scatterpracnum)) uspsp_isnull = "1"; if (!"".equals(uspsp_focuspracnum)) uspsp_subtotal += Integer.parseInt(uspsp_focuspracnum); else uspsp_focuspracnum="-9"; if (!"".equals(uspsp_scatterpracnum)) uspsp_subtotal += Integer.parseInt(uspsp_scatterpracnum); else uspsp_scatterpracnum="-9"; Map<String, String> params = new HashMap<String, String>(); params.put(UndergraStuPartiSocialPracTable.USPSP_ID, uspsp_id); params.put(UndergraStuPartiSocialPracTable.USPSP_DEPARTMENT, uspsp_department); params.put(UndergraStuPartiSocialPracTable.USPSP_FOCUSPRACNUM, uspsp_focuspracnum); params.put(UndergraStuPartiSocialPracTable.USPSP_SCATTERPRACNUM, uspsp_scatterpracnum); params.put(UndergraStuPartiSocialPracTable.USPSP_SUBTOTAL, uspsp_subtotal+""); params.put(UndergraStuPartiSocialPracTable.USPSP_COMMENTS, uspsp_comments); params.put(UndergraStuPartiSocialPracTable.USPSP_ISNULL, uspsp_isnull); int result = uspspDao.alterUndergraStuPartiSocialPrac(params, uspsp_id); if (result == 1) { // 解码 String college = request.getParameter(UndergraStuPartiSocialPracTable.USPSP_COLLEGE); college = URLDecoder.decode(college, "UTF-8"); Map queryParams = new HashMap(); Map notEqualParams = new HashMap(); // 获得合计记录 queryParams.put(UndergraStuPartiSocialPracTable.USPSP_COLLEGE, college); notEqualParams.put(UndergraStuPartiSocialPracTable.USPSP_DEPARTMENT, "合计"); // 获得所有记录 List<UndergraStuPartiSocialPrac> sums = uspspDao.getEqualUndergraStuPartiSocialPrac(queryParams, notEqualParams); queryParams.put(UndergraStuPartiSocialPracTable.USPSP_DEPARTMENT, "合计"); List<UndergraStuPartiSocialPrac> totals = uspspDao.getEqualUndergraStuPartiSocialPrac(queryParams, null); int focuspracnum = 0, scatterpracnum = 0, subtotal = 0; if (sums != null && sums.size() > 0) { for (UndergraStuPartiSocialPrac uspsp : sums) { focuspracnum += (uspsp.getUspsp_focuspracnum() < 0 ? 0 : uspsp.getUspsp_focuspracnum()); scatterpracnum += (uspsp.getUspsp_scatterpracnum() < 0 ? 0 : uspsp.getUspsp_scatterpracnum()); subtotal += uspsp.getUspsp_subtotal(); } } if (totals != null && totals.size() > 0) { UndergraStuPartiSocialPrac total = totals.get(0); queryParams.clear(); queryParams.put(UndergraStuPartiSocialPracTable.USPSP_FOCUSPRACNUM, focuspracnum + ""); queryParams.put(UndergraStuPartiSocialPracTable.USPSP_SCATTERPRACNUM, scatterpracnum + ""); queryParams.put(UndergraStuPartiSocialPracTable.USPSP_SUBTOTAL, subtotal + ""); queryParams.put(UndergraStuPartiSocialPracTable.USPSP_SERIALNUMBER, (uspspDao.getMaxSerialNum() + 1) + ""); queryParams.put(UndergraStuPartiSocialPracTable.USPSP_ISNULL, "0"); result = uspspDao.alterUndergraStuPartiSocialPrac(queryParams, total.getUspsp_id() + ""); } else { UndergraStuPartiSocialPrac undergraStuPartiSocialPrac = new UndergraStuPartiSocialPrac(0, "合计", focuspracnum, scatterpracnum, subtotal, 1, null, college, uspsp_comments, 0); result = uspspDao.addUndergraStuPartiSocialPrac(undergraStuPartiSocialPrac); } } out.print(result); } } catch (JSONException e) { e.printStackTrace(); } finally { out.close(); } } }
UTF-8
Java
6,784
java
Sec_UpdateUndergraStuPartiSocialPrac.java
Java
[ { "context": "dergraStuPartiSocialPracTable;\n\n/**\n * \n * @author xiaoping 附表5-4-3 本科生参与暑期社会实践情况 date 2015-7-10\n *\n */\n@WebS", "end": 797, "score": 0.9979982376098633, "start": 789, "tag": "USERNAME", "value": "xiaoping" } ]
null
[]
package cn.edu.xmu.servlet; import java.io.IOException; import java.io.PrintWriter; import java.net.URLDecoder; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import cn.edu.xmu.dao.UndergraStuPartiSocialPracDao; import cn.edu.xmu.daoimpl.UndergraStuPartiSocialPracDaoImpl; import cn.edu.xmu.entity.UndergraStuPartiSocialPrac; import cn.edu.xmu.table.UndergraStuPartiSocialPracTable; import cn.edu.xmu.table.UndergraStuPartiSocialPracTable; /** * * @author xiaoping 附表5-4-3 本科生参与暑期社会实践情况 date 2015-7-10 * */ @WebServlet("/Sec_UpdateUndergraStuPartiSocialPrac") public class Sec_UpdateUndergraStuPartiSocialPrac extends HttpServlet { private static final long serialVersionUID = 1L; public Sec_UpdateUndergraStuPartiSocialPrac() { super(); } @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { this.doPost(request, response); } @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { request.setCharacterEncoding("UTF-8"); response.setCharacterEncoding("UTF-8"); response.setContentType("text/html;Charset=UTF-8"); PrintWriter out = response.getWriter(); String data = request.getParameter("rowdata"); String patter = request.getParameter("patter"); // 解码 data = URLDecoder.decode(data, "UTF-8"); data = data.substring(1, data.length() - 1); try { UndergraStuPartiSocialPracDao uspspDao = new UndergraStuPartiSocialPracDaoImpl(); if (patter != null && "batch".equals(patter)) { System.out.println("批量更新"); // 审核部分更新,可以批量 data = "[" + data + "]"; JSONArray jsons = new JSONArray(data); for (int i = 0; i < jsons.length(); i++) { String uspsp_id = jsons.getJSONObject(i).getString(UndergraStuPartiSocialPracTable.USPSP_ID); String uspsp_comments = jsons.getJSONObject(i) .getString(UndergraStuPartiSocialPracTable.USPSP_COMMENTS); Map<String, String> params = new HashMap<String, String>(); params.put(UndergraStuPartiSocialPracTable.USPSP_ID, uspsp_id); params.put(UndergraStuPartiSocialPracTable.USPSP_COMMENTS, uspsp_comments); int result = uspspDao.alterUndergraStuPartiSocialPrac(params, uspsp_id); out.print(result); } } else { JSONObject json = new JSONObject(data); String uspsp_id = json.getString(UndergraStuPartiSocialPracTable.USPSP_ID); String uspsp_department = json.getString(UndergraStuPartiSocialPracTable.USPSP_DEPARTMENT); String uspsp_focuspracnum = json.getString(UndergraStuPartiSocialPracTable.USPSP_FOCUSPRACNUM); String uspsp_scatterpracnum = json.getString(UndergraStuPartiSocialPracTable.USPSP_SCATTERPRACNUM); int uspsp_subtotal = 0; String uspsp_comments = json.getString(UndergraStuPartiSocialPracTable.USPSP_COMMENTS); String uspsp_isnull = "0"; if ("".equals(uspsp_department) || "".equals(uspsp_focuspracnum) || "".equals(uspsp_scatterpracnum)) uspsp_isnull = "1"; if (!"".equals(uspsp_focuspracnum)) uspsp_subtotal += Integer.parseInt(uspsp_focuspracnum); else uspsp_focuspracnum="-9"; if (!"".equals(uspsp_scatterpracnum)) uspsp_subtotal += Integer.parseInt(uspsp_scatterpracnum); else uspsp_scatterpracnum="-9"; Map<String, String> params = new HashMap<String, String>(); params.put(UndergraStuPartiSocialPracTable.USPSP_ID, uspsp_id); params.put(UndergraStuPartiSocialPracTable.USPSP_DEPARTMENT, uspsp_department); params.put(UndergraStuPartiSocialPracTable.USPSP_FOCUSPRACNUM, uspsp_focuspracnum); params.put(UndergraStuPartiSocialPracTable.USPSP_SCATTERPRACNUM, uspsp_scatterpracnum); params.put(UndergraStuPartiSocialPracTable.USPSP_SUBTOTAL, uspsp_subtotal+""); params.put(UndergraStuPartiSocialPracTable.USPSP_COMMENTS, uspsp_comments); params.put(UndergraStuPartiSocialPracTable.USPSP_ISNULL, uspsp_isnull); int result = uspspDao.alterUndergraStuPartiSocialPrac(params, uspsp_id); if (result == 1) { // 解码 String college = request.getParameter(UndergraStuPartiSocialPracTable.USPSP_COLLEGE); college = URLDecoder.decode(college, "UTF-8"); Map queryParams = new HashMap(); Map notEqualParams = new HashMap(); // 获得合计记录 queryParams.put(UndergraStuPartiSocialPracTable.USPSP_COLLEGE, college); notEqualParams.put(UndergraStuPartiSocialPracTable.USPSP_DEPARTMENT, "合计"); // 获得所有记录 List<UndergraStuPartiSocialPrac> sums = uspspDao.getEqualUndergraStuPartiSocialPrac(queryParams, notEqualParams); queryParams.put(UndergraStuPartiSocialPracTable.USPSP_DEPARTMENT, "合计"); List<UndergraStuPartiSocialPrac> totals = uspspDao.getEqualUndergraStuPartiSocialPrac(queryParams, null); int focuspracnum = 0, scatterpracnum = 0, subtotal = 0; if (sums != null && sums.size() > 0) { for (UndergraStuPartiSocialPrac uspsp : sums) { focuspracnum += (uspsp.getUspsp_focuspracnum() < 0 ? 0 : uspsp.getUspsp_focuspracnum()); scatterpracnum += (uspsp.getUspsp_scatterpracnum() < 0 ? 0 : uspsp.getUspsp_scatterpracnum()); subtotal += uspsp.getUspsp_subtotal(); } } if (totals != null && totals.size() > 0) { UndergraStuPartiSocialPrac total = totals.get(0); queryParams.clear(); queryParams.put(UndergraStuPartiSocialPracTable.USPSP_FOCUSPRACNUM, focuspracnum + ""); queryParams.put(UndergraStuPartiSocialPracTable.USPSP_SCATTERPRACNUM, scatterpracnum + ""); queryParams.put(UndergraStuPartiSocialPracTable.USPSP_SUBTOTAL, subtotal + ""); queryParams.put(UndergraStuPartiSocialPracTable.USPSP_SERIALNUMBER, (uspspDao.getMaxSerialNum() + 1) + ""); queryParams.put(UndergraStuPartiSocialPracTable.USPSP_ISNULL, "0"); result = uspspDao.alterUndergraStuPartiSocialPrac(queryParams, total.getUspsp_id() + ""); } else { UndergraStuPartiSocialPrac undergraStuPartiSocialPrac = new UndergraStuPartiSocialPrac(0, "合计", focuspracnum, scatterpracnum, subtotal, 1, null, college, uspsp_comments, 0); result = uspspDao.addUndergraStuPartiSocialPrac(undergraStuPartiSocialPrac); } } out.print(result); } } catch (JSONException e) { e.printStackTrace(); } finally { out.close(); } } }
6,784
0.738772
0.732784
166
39.240963
32.833126
117
false
false
0
0
0
0
0
0
3.89759
false
false
13
e880ea87de8422ed96fd5bc4994e5817a455961a
7,524,782,730,528
d0db06c4bdd6a445448fc1daf6adb4656d984786
/160Div1/Quilting.java
c6d9495072fed231ae2606b5409fef216734a22b
[]
no_license
Linzertorte/SRM
https://github.com/Linzertorte/SRM
61dc53320d633b8e7a37384353de205bc018f47f
f3cd9cbc3f4a1e96c5b610477911acc3ed1b6360
refs/heads/master
2016-08-07T23:27:36.558000
2015-12-03T06:15:53
2015-12-03T06:15:53
17,495,485
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
import java.util.*; import java.util.regex.*; import java.text.*; import java.math.*; import java.awt.geom.*; public class Quilting { public String lastPatch(int length, int width, String[] colorList) { int[] dx = {0,-1,-1,-1,0,1,1,1}; int[] dy = {1,1,0,-1,-1,-1,0,1}; int[][] quilt = new int[length][width]; int[] cnt = new int[colorList.length]; int i=0,j=0; for(i=0;i<length;i++) for(j=0;j<width;j++) quilt[i][j]=-1; i = length/2; j = width/2; int dir = 0; int left = length*width; int last = -1; while(left-- != 0 ) { //place current patch according to rules int same_ngh_cnt = Integer.MAX_VALUE; for(int k=0;k<colorList.length;k++){ int ng_cnt = 0; for(int d=0;d<8;d++){ int nx = i+dx[d]; int ny = j+dy[d]; if(nx<0 ||nx>=length) continue; if(ny<0 || ny>=width) continue; if(quilt[nx][ny]==k) ng_cnt++; } if(ng_cnt<same_ngh_cnt){ same_ngh_cnt = ng_cnt; last = k; }else if(ng_cnt == same_ngh_cnt){ if(cnt[k]<cnt[last]) last = k; } } //last = ... //the index of picked color quilt[i][j] = last; cnt[last] ++; //greedily turn left, if cannot, then forward int l_dir = (dir+2)%8; if(left ==0) continue; if(quilt[i+dx[l_dir]][j+dy[l_dir]]==-1){ dir = l_dir; } i+=dx[dir]; j+=dy[dir]; } //System.out.println(quilt[i][j]+"$"+quilt[i-1][j]); return colorList[last]; } }
UTF-8
Java
1,870
java
Quilting.java
Java
[]
null
[]
import java.util.*; import java.util.regex.*; import java.text.*; import java.math.*; import java.awt.geom.*; public class Quilting { public String lastPatch(int length, int width, String[] colorList) { int[] dx = {0,-1,-1,-1,0,1,1,1}; int[] dy = {1,1,0,-1,-1,-1,0,1}; int[][] quilt = new int[length][width]; int[] cnt = new int[colorList.length]; int i=0,j=0; for(i=0;i<length;i++) for(j=0;j<width;j++) quilt[i][j]=-1; i = length/2; j = width/2; int dir = 0; int left = length*width; int last = -1; while(left-- != 0 ) { //place current patch according to rules int same_ngh_cnt = Integer.MAX_VALUE; for(int k=0;k<colorList.length;k++){ int ng_cnt = 0; for(int d=0;d<8;d++){ int nx = i+dx[d]; int ny = j+dy[d]; if(nx<0 ||nx>=length) continue; if(ny<0 || ny>=width) continue; if(quilt[nx][ny]==k) ng_cnt++; } if(ng_cnt<same_ngh_cnt){ same_ngh_cnt = ng_cnt; last = k; }else if(ng_cnt == same_ngh_cnt){ if(cnt[k]<cnt[last]) last = k; } } //last = ... //the index of picked color quilt[i][j] = last; cnt[last] ++; //greedily turn left, if cannot, then forward int l_dir = (dir+2)%8; if(left ==0) continue; if(quilt[i+dx[l_dir]][j+dy[l_dir]]==-1){ dir = l_dir; } i+=dx[dir]; j+=dy[dir]; } //System.out.println(quilt[i][j]+"$"+quilt[i-1][j]); return colorList[last]; } }
1,870
0.417112
0.397326
61
29.655737
16.968519
70
false
false
0
0
0
0
0
0
1.081967
false
false
13
8475c10587bd52847d9f5801bd93a2a147acffa2
1,468,878,845,863
3bd50aa3d8ebdb7e291de6d0f58df7d5f7d62095
/deftbus-core/src/main/java/com/deft/bus/DBus.java
8e83abde3d5813466dd2b52fd2333820f2fe9f1c
[]
no_license
wei2006004/DeftBus
https://github.com/wei2006004/DeftBus
00b30c3788a2e1c646aff893f9f531f11c697b83
67c2adb06dce87792ee88ade8e162416382338eb
refs/heads/master
2021-01-24T08:36:55.018000
2016-10-08T13:18:44
2016-10-08T13:18:44
69,554,195
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.deft.bus; import java.util.ArrayList; import java.util.List; /** * Created by Administrator on 2016/9/29. */ public class DBus { private DBus() { } public static <T> void register(T recieverObject, Class<T> recieverClass) { innerRegister(recieverObject, recieverClass, null); } public static <T> void register(T recieverObject, Class<T> recieverClass, Class[] senders, String[] actions) { if (senders == null || senders.length == 0) { innerRegister(recieverObject, recieverClass, actions); return; } List list = new ArrayList<String>(); for (Class clazz : senders) { list.add(clazz.getName()); } if (actions != null) { for (String action : actions) { list.add(action); } } innerRegister(recieverObject, recieverClass, list.isEmpty() ? null : (String[]) list.toArray(new String[]{})); } private static <T> void innerRegister(T recieverObject, Class<T> recieverClass, String[] actions) { assertRecieverClass(recieverClass); SignalHandler.getInstance().registerReciever(recieverObject, recieverClass, actions); } public static <T> void unregister(T recieverObject, Class<T> recieverClass) { assertRecieverClass(recieverClass); SignalHandler.getInstance().unregisterReciever(recieverObject, recieverClass); } private static void assertRecieverClass(Class recieverClass) { if (!recieverClass.isInterface()) { throw new IllegalArgumentException("RecieverClass must be interface. Error recieverClass:" + recieverClass); } } public static void unInst() { SignalHandler.unInst(); } }
UTF-8
Java
1,770
java
DBus.java
Java
[ { "context": "rayList;\nimport java.util.List;\n\n/**\n * Created by Administrator on 2016/9/29.\n */\npublic class DBus {\n\n privat", "end": 106, "score": 0.43486732244491577, "start": 93, "tag": "NAME", "value": "Administrator" } ]
null
[]
package com.deft.bus; import java.util.ArrayList; import java.util.List; /** * Created by Administrator on 2016/9/29. */ public class DBus { private DBus() { } public static <T> void register(T recieverObject, Class<T> recieverClass) { innerRegister(recieverObject, recieverClass, null); } public static <T> void register(T recieverObject, Class<T> recieverClass, Class[] senders, String[] actions) { if (senders == null || senders.length == 0) { innerRegister(recieverObject, recieverClass, actions); return; } List list = new ArrayList<String>(); for (Class clazz : senders) { list.add(clazz.getName()); } if (actions != null) { for (String action : actions) { list.add(action); } } innerRegister(recieverObject, recieverClass, list.isEmpty() ? null : (String[]) list.toArray(new String[]{})); } private static <T> void innerRegister(T recieverObject, Class<T> recieverClass, String[] actions) { assertRecieverClass(recieverClass); SignalHandler.getInstance().registerReciever(recieverObject, recieverClass, actions); } public static <T> void unregister(T recieverObject, Class<T> recieverClass) { assertRecieverClass(recieverClass); SignalHandler.getInstance().unregisterReciever(recieverObject, recieverClass); } private static void assertRecieverClass(Class recieverClass) { if (!recieverClass.isInterface()) { throw new IllegalArgumentException("RecieverClass must be interface. Error recieverClass:" + recieverClass); } } public static void unInst() { SignalHandler.unInst(); } }
1,770
0.640678
0.636158
54
31.777779
34.041187
120
false
false
0
0
0
0
0
0
0.62963
false
false
13
12d008ab56d8c48c316adda1e0c9fdafc2c005e3
9,749,575,781,040
3eca8335a7b8d51b93ae1f28569ca4c63b964839
/DataStruct/src/com/ex/graph/Edge.java
8cc5cf129b65a89b6dac2c355a260567271761d0
[]
no_license
Xuc1124/DataStruct
https://github.com/Xuc1124/DataStruct
44693af7f2f867439cb9350f55a885483b618cb9
358ec36b02eac01ff0be8f68ec95f5620d56414a
refs/heads/master
2021-01-12T07:10:40.515000
2016-12-26T11:11:33
2016-12-26T11:11:33
76,859,705
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.ex.graph; /* * 边集数组 */ public class Edge { int begin; int end; int weight; public Edge(int begin,int end,int weight){ this.begin=begin; this.end=end; this.weight=weight; } public Edge(){} }
UTF-8
Java
225
java
Edge.java
Java
[]
null
[]
package com.ex.graph; /* * 边集数组 */ public class Edge { int begin; int end; int weight; public Edge(int begin,int end,int weight){ this.begin=begin; this.end=end; this.weight=weight; } public Edge(){} }
225
0.654378
0.654378
16
12.5625
10.67104
43
false
false
0
0
0
0
0
0
1.3125
false
false
13
f8faa844af96ecc5f718e22b5292cae8b1f241eb
28,183,575,424,614
0cbc25595a6fa4af07701c53eb5950102a61b9e8
/CoreJava/src/com/joe/web/misc/ReadURL.java
a5c84d73e320ed68b314f3490712a801c70e5caf
[]
no_license
xiaojunshcn/13_JSE_CoreJava
https://github.com/xiaojunshcn/13_JSE_CoreJava
625b39dbcf0bed13a9b3fe7be1884c5b1fae93a5
f4b4cc140d0a54b1a0828b5168cb6ed38a12cbe6
refs/heads/master
2016-09-02T04:11:45.880000
2014-03-14T08:52:46
2014-03-14T08:52:46
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.joe.web.misc; import java.io.DataInputStream; import java.net.URL; public class ReadURL { public static void main(String[] args) { try { //when in an intranet, this 2 lines are required System.setProperty("http.proxyHost", "proxy.jpn.hp.com"); System.setProperty("http.proxyPort", "8080"); // 根据参数args[0])构造一个绝对的URL对象 URL url = new URL("http://www.baidu.com/"); // 通过URL对象打开一个数据输入流 DataInputStream dis = new DataInputStream(url.openStream()); String inputLine; while ((inputLine = dis.readLine()) != null) { System.out.println(inputLine); } dis.close(); } catch (Exception e) { e.printStackTrace(); } } }
UTF-8
Java
755
java
ReadURL.java
Java
[]
null
[]
package com.joe.web.misc; import java.io.DataInputStream; import java.net.URL; public class ReadURL { public static void main(String[] args) { try { //when in an intranet, this 2 lines are required System.setProperty("http.proxyHost", "proxy.jpn.hp.com"); System.setProperty("http.proxyPort", "8080"); // 根据参数args[0])构造一个绝对的URL对象 URL url = new URL("http://www.baidu.com/"); // 通过URL对象打开一个数据输入流 DataInputStream dis = new DataInputStream(url.openStream()); String inputLine; while ((inputLine = dis.readLine()) != null) { System.out.println(inputLine); } dis.close(); } catch (Exception e) { e.printStackTrace(); } } }
755
0.638691
0.630156
29
22.241379
19.655052
63
false
false
0
0
0
0
0
0
2.241379
false
false
13
b652666ab483605043891f691bfd38bf53a84ba6
5,763,846,138,219
37565116bf677f94fd7abe20584f303d46aed68e
/Topup_18-06-2015_1/src/main/java/com/masary/utils/BuildUUID.java
02d94a7ee88ecc02c1dcb441d4fbcca2afbbdadf
[]
no_license
Sobhy-M/test-jira
https://github.com/Sobhy-M/test-jira
70b6390b95182b7c70fbca510b032ca853d2c508
f38554d674e4eaf6c38e4493278a63d41504f155
refs/heads/master
2022-12-20T12:22:32.110000
2019-07-07T16:39:34
2019-07-07T16:39:34
195,658,623
0
0
null
false
2022-12-16T08:16:01
2019-07-07T14:07:16
2022-07-20T20:07:27
2022-12-16T08:15:58
11,854
0
0
8
Java
false
false
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package com.masary.utils; import java.sql.Timestamp; import java.util.UUID; /** * * @author Masary */ public class BuildUUID { public String extTrxId ; public String CreateUUID () { String uuid = UUID.randomUUID().toString(); Timestamp timestamp = new Timestamp(System.currentTimeMillis()); String CurrentTime =timestamp.toGMTString(); this.extTrxId= uuid + CurrentTime ; return extTrxId ; } }
UTF-8
Java
669
java
BuildUUID.java
Java
[ { "context": "estamp;\nimport java.util.UUID;\n\n\n/**\n *\n * @author Masary\n */\npublic class BuildUUID {\n public String ", "end": 288, "score": 0.9987392425537109, "start": 282, "tag": "NAME", "value": "Masary" } ]
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 com.masary.utils; import java.sql.Timestamp; import java.util.UUID; /** * * @author Masary */ public class BuildUUID { public String extTrxId ; public String CreateUUID () { String uuid = UUID.randomUUID().toString(); Timestamp timestamp = new Timestamp(System.currentTimeMillis()); String CurrentTime =timestamp.toGMTString(); this.extTrxId= uuid + CurrentTime ; return extTrxId ; } }
669
0.650224
0.650224
29
22.068966
22.529568
79
false
false
0
0
0
0
0
0
0.413793
false
false
13
b0501fd673027f5f89a51f9bae0ae3fde69fd722
20,358,145,019,185
8b15510039bc4a952e8a46a6d06f715721950b23
/src/com/winston/core/PythonJudge.java
636cb75c6d6f35544b7c9a5ae4480ca983c293e9
[ "Apache-2.0" ]
permissive
15218047860/CompileWeb
https://github.com/15218047860/CompileWeb
2014c87924daa4a3c357b12f7ad6717391e4ec34
bcaa12a6d40d30992bb89ca225fea7fbeacb911a
refs/heads/master
2021-09-23T13:48:52.984000
2018-09-23T09:25:43
2018-09-23T09:25:43
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.winston.core; import com.winston.util.CMDUtil; /** @Author 王钟鑫 @date 2018年9月13日 上午12:18:32 * */ public class PythonJudge extends AbstractJudge implements Judge{ /** 编译的方法,由子类实现 @Author Winston.Wang @date 2018年9月13日 上午12:04:31 @email 940945444@qq.com @return @param */ @Override public String compile(String path){ // 执行编译 String compile = CMDUtil.execProcessBuider("python","python.py", path); return compile; } }
UTF-8
Java
527
java
PythonJudge.java
Java
[ { "context": ";\n\nimport com.winston.util.CMDUtil;\n\n/**\n @Author 王钟鑫\n @date 2018年9月13日 上午12:18:32\n * \n */\npublic class", "end": 77, "score": 0.9998784065246582, "start": 74, "tag": "NAME", "value": "王钟鑫" }, { "context": " implements Judge{\n\n\t/**\n\t 编译的方法,由子类实现 \n\t @Auth...
null
[]
package com.winston.core; import com.winston.util.CMDUtil; /** @Author 王钟鑫 @date 2018年9月13日 上午12:18:32 * */ public class PythonJudge extends AbstractJudge implements Judge{ /** 编译的方法,由子类实现 @Author Winston.Wang @date 2018年9月13日 上午12:04:31 @email <EMAIL> @return @param */ @Override public String compile(String path){ // 执行编译 String compile = CMDUtil.execProcessBuider("python","python.py", path); return compile; } }
518
0.687898
0.613588
29
15.24138
18.12534
73
false
false
0
0
0
0
0
0
0.931035
false
false
13
1f865f068fbdd9bc5d768278d0eae6a4cb32592f
28,037,546,537,454
a8ee4d70c223a0bf6494c3a85ee2a43450887b66
/app/src/main/java/me/odinaris/gymmanager/application/ApplicationPageFragment.java
5b613ec9307f9044bca7199811fb4e6112309097
[]
no_license
Ubhadiyap/GymManager
https://github.com/Ubhadiyap/GymManager
689a155d4b5d53554911def12a01d5ccaddbc8f7
b050e446223786d0faf8ac9e3e68246c92fcba3e
refs/heads/master
2020-04-10T05:27:12.140000
2017-03-05T05:13:57
2017-03-05T05:13:57
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package me.odinaris.gymmanager.application; import android.content.Intent; import android.os.Bundle; import android.support.design.widget.Snackbar; import android.support.v4.app.Fragment; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Toast; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Calendar; import java.util.Collection; import java.util.Collections; import java.util.List; import butterknife.BindView; import butterknife.ButterKnife; import cn.bmob.v3.Bmob; import cn.bmob.v3.BmobBatch; import cn.bmob.v3.BmobObject; import cn.bmob.v3.BmobQuery; import cn.bmob.v3.datatype.BatchResult; import cn.bmob.v3.exception.BmobException; import cn.bmob.v3.listener.FindListener; import cn.bmob.v3.listener.QueryListListener; import cn.bmob.v3.listener.QueryListener; import me.odinaris.gymmanager.R; import me.odinaris.gymmanager.user.userBean; /** * Created by Odinaris on 2016/12/10. */ public class ApplicationPageFragment extends Fragment { private String type; //超期的预约列表,需要将其修改为已结束 private ArrayList<BmobObject> exceedTimeList = new ArrayList<BmobObject>(); private ArrayList<applicationInfo> applicationList = new ArrayList<applicationInfo>(); @BindView(R.id.application_rv_list) RecyclerView list; public void setType(String type) { this.type = type; } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.frg_application_detail,container,false); ButterKnife.bind(this,view); Bmob.initialize(getActivity(), "899b5bc7d14343a022b2d59b35da55f5"); initData(); initView(); return view; } private void initView() { } private void initData() { userBean user = userBean.getCurrentUser(userBean.class); String userId = user.getUserId(); BmobQuery<applicationInfo> query = new BmobQuery<>(); query.addWhereEqualTo("userId",userId); query.addWhereEqualTo("applicationState",type); query.findObjects(new FindListener<applicationInfo>() { @Override public void done(List<applicationInfo> alist, BmobException e) { if(e == null) { for (applicationInfo app : alist) { if(idExceed(app,type)){ app.setApplicationState("已结束"); exceedTimeList.add(app); }else { applicationList.add(app); } } if(exceedTimeList.size()!=0){ new BmobBatch().updateBatch(exceedTimeList).doBatch(new QueryListListener<BatchResult>() { @Override public void done(List<BatchResult> blist, BmobException e) { Collections.reverse(applicationList); ApplicationAdapter adapter = new ApplicationAdapter(applicationList,getContext(), type); LinearLayoutManager manager = new LinearLayoutManager(getActivity()); list.setAdapter(adapter); list.setLayoutManager(manager); } }); }else { Collections.reverse(applicationList); ApplicationAdapter adapter = new ApplicationAdapter(applicationList,getContext(), type); LinearLayoutManager manager = new LinearLayoutManager(getActivity()); list.setAdapter(adapter); list.setLayoutManager(manager); } }else { Snackbar.make(list,e.toString(), Snackbar.LENGTH_LONG); } } private boolean idExceed(applicationInfo app, String type) { if(!type.equals("已结束")){ Calendar calendar = Calendar.getInstance(); int currentMonth = calendar.get(Calendar.MONTH)+1; int currentDay = calendar.get(Calendar.DAY_OF_MONTH); int currentHour = calendar.get(Calendar.HOUR_OF_DAY); //获取当前申请表中预定的时间段截止时间 int appHour = Integer.parseInt(app.getUseTime().split("-")[1].split(":")[0]); int appMonth = Integer.parseInt(app.getUseDate().split("月")[0]); int appDay = Integer.parseInt(app.getUseDate().split("月")[1].split("日")[0]); if(currentMonth > appMonth){ return true; }else if(currentMonth == appMonth){ if(currentDay > appDay){ return true; }else if(currentDay == appDay){ if(currentHour >= appHour){ return true; } } }else { return false; } return false; }else { return false; } } }); } }
UTF-8
Java
4,443
java
ApplicationPageFragment.java
Java
[ { "context": "naris.gymmanager.user.userBean;\n\n/**\n * Created by Odinaris on 2016/12/10.\n */\n\npublic class ApplicationPageF", "end": 1076, "score": 0.9988970160484314, "start": 1068, "tag": "USERNAME", "value": "Odinaris" } ]
null
[]
package me.odinaris.gymmanager.application; import android.content.Intent; import android.os.Bundle; import android.support.design.widget.Snackbar; import android.support.v4.app.Fragment; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Toast; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Calendar; import java.util.Collection; import java.util.Collections; import java.util.List; import butterknife.BindView; import butterknife.ButterKnife; import cn.bmob.v3.Bmob; import cn.bmob.v3.BmobBatch; import cn.bmob.v3.BmobObject; import cn.bmob.v3.BmobQuery; import cn.bmob.v3.datatype.BatchResult; import cn.bmob.v3.exception.BmobException; import cn.bmob.v3.listener.FindListener; import cn.bmob.v3.listener.QueryListListener; import cn.bmob.v3.listener.QueryListener; import me.odinaris.gymmanager.R; import me.odinaris.gymmanager.user.userBean; /** * Created by Odinaris on 2016/12/10. */ public class ApplicationPageFragment extends Fragment { private String type; //超期的预约列表,需要将其修改为已结束 private ArrayList<BmobObject> exceedTimeList = new ArrayList<BmobObject>(); private ArrayList<applicationInfo> applicationList = new ArrayList<applicationInfo>(); @BindView(R.id.application_rv_list) RecyclerView list; public void setType(String type) { this.type = type; } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.frg_application_detail,container,false); ButterKnife.bind(this,view); Bmob.initialize(getActivity(), "899b5bc7d14343a022b2d59b35da55f5"); initData(); initView(); return view; } private void initView() { } private void initData() { userBean user = userBean.getCurrentUser(userBean.class); String userId = user.getUserId(); BmobQuery<applicationInfo> query = new BmobQuery<>(); query.addWhereEqualTo("userId",userId); query.addWhereEqualTo("applicationState",type); query.findObjects(new FindListener<applicationInfo>() { @Override public void done(List<applicationInfo> alist, BmobException e) { if(e == null) { for (applicationInfo app : alist) { if(idExceed(app,type)){ app.setApplicationState("已结束"); exceedTimeList.add(app); }else { applicationList.add(app); } } if(exceedTimeList.size()!=0){ new BmobBatch().updateBatch(exceedTimeList).doBatch(new QueryListListener<BatchResult>() { @Override public void done(List<BatchResult> blist, BmobException e) { Collections.reverse(applicationList); ApplicationAdapter adapter = new ApplicationAdapter(applicationList,getContext(), type); LinearLayoutManager manager = new LinearLayoutManager(getActivity()); list.setAdapter(adapter); list.setLayoutManager(manager); } }); }else { Collections.reverse(applicationList); ApplicationAdapter adapter = new ApplicationAdapter(applicationList,getContext(), type); LinearLayoutManager manager = new LinearLayoutManager(getActivity()); list.setAdapter(adapter); list.setLayoutManager(manager); } }else { Snackbar.make(list,e.toString(), Snackbar.LENGTH_LONG); } } private boolean idExceed(applicationInfo app, String type) { if(!type.equals("已结束")){ Calendar calendar = Calendar.getInstance(); int currentMonth = calendar.get(Calendar.MONTH)+1; int currentDay = calendar.get(Calendar.DAY_OF_MONTH); int currentHour = calendar.get(Calendar.HOUR_OF_DAY); //获取当前申请表中预定的时间段截止时间 int appHour = Integer.parseInt(app.getUseTime().split("-")[1].split(":")[0]); int appMonth = Integer.parseInt(app.getUseDate().split("月")[0]); int appDay = Integer.parseInt(app.getUseDate().split("月")[1].split("日")[0]); if(currentMonth > appMonth){ return true; }else if(currentMonth == appMonth){ if(currentDay > appDay){ return true; }else if(currentDay == appDay){ if(currentHour >= appHour){ return true; } } }else { return false; } return false; }else { return false; } } }); } }
4,443
0.715369
0.704342
137
30.773722
24.435522
100
false
false
0
0
0
0
0
0
3.467153
false
false
13
bfe7975a48fa1dd73ace9efa7bf0d5161ff6623c
22,771,916,644,739
aa38ee88b5b4debe8e27dc39b0fa8dcedd11b5b5
/src/main/java/de/sciss/gui/ParamField.java
6f88e158593ad116ab3f1de238ead9a587701ebb
[]
no_license
vijayvani/ScissLib
https://github.com/vijayvani/ScissLib
3539b319c769fc790b12e2842c2943152227d964
4e7e26fcd5578a8d41fa26494b600d15e2a720ce
refs/heads/master
2020-05-16T08:38:36.136000
2017-10-20T13:37:38
2017-10-20T13:37:38
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
/* * ParamField.java * (ScissLib) * * Copyright (c) 2004-2016 Hanns Holger Rutz. All rights reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * * For further information, please contact Hanns Holger Rutz at * contact@sciss.de */ package de.sciss.gui; import de.sciss.app.BasicEvent; import de.sciss.app.EventManager; import de.sciss.util.DefaultUnitTranslator; import de.sciss.util.Param; import de.sciss.util.ParamSpace; import javax.swing.*; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import java.util.ArrayList; import java.util.EventListener; import java.util.List; public class ParamField extends JPanel implements PropertyChangeListener, EventManager.Processor, ComboBoxEditor { private final Jog ggJog; protected final NumberField ggNumber; protected final UnitLabel lbUnit; private static final UnitViewFactory uvf = new DefaultUnitViewFactory(); private ParamSpace.Translator ut; protected final List collSpaces = new ArrayList(); protected ParamSpace currentSpace = null; private EventManager elm = null; // lazy creation private boolean comboGate = true; public ParamField() { this( new DefaultUnitTranslator() ); } public ParamField( final ParamSpace.Translator ut ) { super(); // uvf = new DefaultUnitViewFactory(); this.ut = ut; final GridBagLayout lay = new GridBagLayout(); final GridBagConstraints con = new GridBagConstraints(); setLayout( lay ); con.anchor = GridBagConstraints.WEST; con.fill = GridBagConstraints.HORIZONTAL; ggJog = new Jog(); ggNumber = new NumberField(); lbUnit = new UnitLabel(); ggJog.addListener( new NumberListener() { public void numberChanged( NumberEvent e ) { if( currentSpace != null ) { final double inc = e.getNumber().doubleValue() * currentSpace.inc; final Number num = ggNumber.getNumber(); final Number newNum; boolean changed; if( currentSpace.isInteger() ) { newNum = (long) currentSpace.fitValue(num.longValue() + inc); } else { newNum = currentSpace.fitValue(num.doubleValue() + inc); } changed = !newNum.equals( num ); if( changed ) { ggNumber.setNumber( newNum ); } if( changed || !e.isAdjusting() ) { fireValueChanged( e.isAdjusting() ); } } } }); ggNumber.addListener( new NumberListener() { public void numberChanged( NumberEvent e ) { fireValueChanged( e.isAdjusting() ); } }); lbUnit.addActionListener( new ActionListener() { public void actionPerformed( ActionEvent e ) { selectSpace( lbUnit.getSelectedIndex() ); fireSpaceChanged(); fireValueChanged( false ); } }); con.gridwidth = 1; con.gridheight = 1; con.gridx = 1; con.gridy = 1; con.weightx = 0.0; con.weighty = 0.0; lay.setConstraints(ggJog, con); ggJog.setBorder(BorderFactory.createEmptyBorder(0, 2, 0, 2)); add(ggJog); con.gridx++; con.weightx = 1.0; lay.setConstraints(ggNumber, con); add(ggNumber); con.gridx++; con.weightx = 0.0; con.gridwidth = GridBagConstraints.REMAINDER; lay.setConstraints(lbUnit, con); lbUnit.setBorder(BorderFactory.createEmptyBorder(0, 4, 0, 0)); add(lbUnit); this.addPropertyChangeListener("font", this); this.addPropertyChangeListener("enabled", this); } public boolean requestFocusInWindow() { return ggNumber.requestFocusInWindow(); } public void addSpace(ParamSpace spc) { collSpaces.add(spc); final Object view = uvf.createView(spc.unit); if (view instanceof Icon) { lbUnit.addUnit((Icon) view); } else { lbUnit.addUnit(view.toString()); } if (collSpaces.size() == 1) { currentSpace = spc; ggNumber.setSpace(spc); } } public Param getValue() { return new Param(ggNumber.getNumber().doubleValue(), currentSpace == null ? ParamSpace.NONE : currentSpace.unit); } public void setValue(Param newValue) { final Number oldNum = ggNumber.getNumber(); final Param newParam = ut.translate(newValue, currentSpace); final Number newNum; if (currentSpace.isInteger()) { newNum = (long) newParam.val; } else { newNum = newParam.val; } if (!newNum.equals(oldNum)) ggNumber.setNumber(newNum); } public void setValueAndSpace(Param newValue) { int spcIdx = 0; ParamSpace spc = currentSpace; boolean newSpc = false; for (; spcIdx < collSpaces.size(); spcIdx++) { spc = (ParamSpace) collSpaces.get(spcIdx); if ((spc != currentSpace) && (spc.unit == newValue.unit)) { newSpc = true; break; } } if (newSpc) { currentSpace = spc; ggNumber.setSpace(currentSpace); ggNumber.setFlags(currentSpace.unit & ParamSpace.SPECIAL_MASK); if (spcIdx != lbUnit.getSelectedIndex()) { lbUnit.setSelectedIndex(spcIdx); } } setValue(newValue); if (newSpc) { this.fireSpaceChanged(); } } public ParamSpace getSpace() { return currentSpace; } public void setSpace(ParamSpace newSpace) { for (int i = 0; i < collSpaces.size(); i++) { if (newSpace == collSpaces.get(i)) { // rely on references here selectSpace(i); return; } } throw new IllegalArgumentException("Illegal space switch " + newSpace); } public void setCycling(boolean b) { lbUnit.setCycling(b); } public boolean getCycling() { return lbUnit.getCycling(); } public ParamSpace.Translator getTranslator() { return ut; } public void setTranslator(ParamSpace.Translator ut) { this.ut = ut; } protected void selectSpace(int selectedIdx) { if (selectedIdx >= 0 && selectedIdx < collSpaces.size()) { final ParamSpace oldSpace = currentSpace; currentSpace = (ParamSpace) collSpaces.get(selectedIdx); final Number oldNum = ggNumber.getNumber(); final Param oldParam = new Param(oldNum == null ? (oldSpace == null ? 0.0 : oldSpace.reset) : oldNum.doubleValue(), oldSpace == null ? ParamSpace.NONE : oldSpace.unit); final Param newParam = ut.translate(oldParam, currentSpace); final Number newNum; if (currentSpace.isInteger()) { newNum = (long) newParam.val; } else { newNum = newParam.val; } ggNumber.setSpace(currentSpace); ggNumber.setFlags(currentSpace.unit & ParamSpace.SPECIAL_MASK); if (!newNum.equals(oldNum)) ggNumber.setNumber(newNum); if (selectedIdx != lbUnit.getSelectedIndex()) { lbUnit.setSelectedIndex(selectedIdx); } } else { currentSpace = null; } } // --- listener registration --- /** * Register a <code>NumberListener</code> * which will be informed about changes of * the gadgets content. * * @param listener the <code>NumberListener</code> to register * @see de.sciss.app.EventManager#addListener( Object ) */ public void addListener(ParamField.Listener listener) { synchronized (this) { if (elm == null) { elm = new EventManager(this); } elm.addListener(listener); } } /** * Unregister a <code>NumberListener</code> * from receiving number change events. * * @param listener the <code>NumberListener</code> to unregister * @see de.sciss.app.EventManager#removeListener( Object ) */ public void removeListener(ParamField.Listener listener) { if (elm != null) elm.removeListener(listener); } public void processEvent(BasicEvent e) { ParamField.Listener listener; for (int i = 0; i < elm.countListeners(); i++) { listener = (ParamField.Listener) elm.getListener(i); switch (e.getID()) { case ParamField.Event.VALUE: listener.paramValueChanged((ParamField.Event) e); break; case ParamField.Event.SPACE: listener.paramSpaceChanged((ParamField.Event) e); break; default: assert false : e.getID(); } } // for( i = 0; i < elm.countListeners(); i++ ) } protected void fireValueChanged(boolean adjusting) { if (elm != null) { elm.dispatchEvent(new ParamField.Event(this, ParamField.Event.VALUE, System.currentTimeMillis(), getValue(), getSpace(), getTranslator(), adjusting)); } } protected void fireSpaceChanged() { if (elm != null) { elm.dispatchEvent(new ParamField.Event(this, ParamField.Event.SPACE, System.currentTimeMillis(), getValue(), getSpace(), getTranslator(), false)); } } // ------------------- PropertyChangeListener interface ------------------- /** * Forwards <code>Font</code> property * changes to the child gadgets */ public void propertyChange(PropertyChangeEvent e) { if (e.getPropertyName().equals("font")) { final Font fnt = this.getFont(); ggNumber.setFont(fnt); lbUnit.setFont(fnt); } else if (e.getPropertyName().equals("enabled")) { final boolean enabled = this.isEnabled(); ggJog.setEnabled(enabled); ggNumber.setEnabled(enabled); lbUnit.setEnabled(enabled); } } // ------------------- ComboBoxEditor interface ------------------- public Component getEditorComponent() { return this; } public void setComboGate(boolean gate) { comboGate = gate; } protected boolean getComboGate() { return comboGate; } public void setItem(Object anObject) { if (!comboGate || (anObject == null)) return; if (anObject instanceof Param) { setValue((Param) anObject); } else if (anObject instanceof StringItem) { setValue(Param.valueOf(((StringItem) anObject).getKey())); } } public Object getItem() { final Action a = lbUnit.getSelectedUnit(); final String unit = a == null ? null : (String) a.getValue(Action.NAME); return new StringItem(getValue().toString(), unit == null ? ggNumber.getText() : ggNumber.getText() + " " + unit); } public void selectAll() { ggNumber.requestFocus(); ggNumber.selectAll(); } public void addActionListener(ActionListener l) { ggNumber.addActionListener(l); // XXX only until we have multiple units! } public void removeActionListener(ActionListener l) { ggNumber.removeActionListener(l); } // ------------------- internal classes / interfaces ------------------- public interface UnitViewFactory { public Object createView(int unit); } public static class Event extends BasicEvent { // --- ID values --- /** * returned by getID() : the param value changed */ public static final int VALUE = 0; /** * returned by getID() : the param space was switched */ public static final int SPACE = 1; private final Param value; private final ParamSpace space; private final ParamSpace.Translator ut; private final boolean adjusting; public Event(Object source, int ID, long when, Param value, ParamSpace space, ParamSpace.Translator ut, boolean adjusting) { super(source, ID, when); this.value = value; this.space = space; this.ut = ut; this.adjusting = adjusting; } public boolean isAdjusting() { return adjusting; } public Param getValue() { return value; } public Param getTranslatedValue( ParamSpace newSpace ) { return ut.translate( value, newSpace ); } public ParamSpace getSpace() { return space; } public boolean incorporate(BasicEvent oldEvent) { return oldEvent instanceof Event && this.getSource() == oldEvent.getSource() && this.getID() == oldEvent.getID(); } } public interface Listener extends EventListener { public void paramValueChanged(ParamField.Event e); public void paramSpaceChanged(ParamField.Event e); } }
UTF-8
Java
14,552
java
ParamField.java
Java
[ { "context": "java\n * (ScissLib)\n *\n * Copyright (c) 2004-2016 Hanns Holger Rutz. All rights reserved.\n *\n *\tThis library is free ", "end": 86, "score": 0.9998941421508789, "start": 69, "tag": "NAME", "value": "Hanns Holger Rutz" }, { "context": "A\n *\n *\n *\tFor further in...
null
[]
/* * ParamField.java * (ScissLib) * * Copyright (c) 2004-2016 <NAME>. All rights reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * * For further information, please contact <NAME> at * <EMAIL> */ package de.sciss.gui; import de.sciss.app.BasicEvent; import de.sciss.app.EventManager; import de.sciss.util.DefaultUnitTranslator; import de.sciss.util.Param; import de.sciss.util.ParamSpace; import javax.swing.*; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import java.util.ArrayList; import java.util.EventListener; import java.util.List; public class ParamField extends JPanel implements PropertyChangeListener, EventManager.Processor, ComboBoxEditor { private final Jog ggJog; protected final NumberField ggNumber; protected final UnitLabel lbUnit; private static final UnitViewFactory uvf = new DefaultUnitViewFactory(); private ParamSpace.Translator ut; protected final List collSpaces = new ArrayList(); protected ParamSpace currentSpace = null; private EventManager elm = null; // lazy creation private boolean comboGate = true; public ParamField() { this( new DefaultUnitTranslator() ); } public ParamField( final ParamSpace.Translator ut ) { super(); // uvf = new DefaultUnitViewFactory(); this.ut = ut; final GridBagLayout lay = new GridBagLayout(); final GridBagConstraints con = new GridBagConstraints(); setLayout( lay ); con.anchor = GridBagConstraints.WEST; con.fill = GridBagConstraints.HORIZONTAL; ggJog = new Jog(); ggNumber = new NumberField(); lbUnit = new UnitLabel(); ggJog.addListener( new NumberListener() { public void numberChanged( NumberEvent e ) { if( currentSpace != null ) { final double inc = e.getNumber().doubleValue() * currentSpace.inc; final Number num = ggNumber.getNumber(); final Number newNum; boolean changed; if( currentSpace.isInteger() ) { newNum = (long) currentSpace.fitValue(num.longValue() + inc); } else { newNum = currentSpace.fitValue(num.doubleValue() + inc); } changed = !newNum.equals( num ); if( changed ) { ggNumber.setNumber( newNum ); } if( changed || !e.isAdjusting() ) { fireValueChanged( e.isAdjusting() ); } } } }); ggNumber.addListener( new NumberListener() { public void numberChanged( NumberEvent e ) { fireValueChanged( e.isAdjusting() ); } }); lbUnit.addActionListener( new ActionListener() { public void actionPerformed( ActionEvent e ) { selectSpace( lbUnit.getSelectedIndex() ); fireSpaceChanged(); fireValueChanged( false ); } }); con.gridwidth = 1; con.gridheight = 1; con.gridx = 1; con.gridy = 1; con.weightx = 0.0; con.weighty = 0.0; lay.setConstraints(ggJog, con); ggJog.setBorder(BorderFactory.createEmptyBorder(0, 2, 0, 2)); add(ggJog); con.gridx++; con.weightx = 1.0; lay.setConstraints(ggNumber, con); add(ggNumber); con.gridx++; con.weightx = 0.0; con.gridwidth = GridBagConstraints.REMAINDER; lay.setConstraints(lbUnit, con); lbUnit.setBorder(BorderFactory.createEmptyBorder(0, 4, 0, 0)); add(lbUnit); this.addPropertyChangeListener("font", this); this.addPropertyChangeListener("enabled", this); } public boolean requestFocusInWindow() { return ggNumber.requestFocusInWindow(); } public void addSpace(ParamSpace spc) { collSpaces.add(spc); final Object view = uvf.createView(spc.unit); if (view instanceof Icon) { lbUnit.addUnit((Icon) view); } else { lbUnit.addUnit(view.toString()); } if (collSpaces.size() == 1) { currentSpace = spc; ggNumber.setSpace(spc); } } public Param getValue() { return new Param(ggNumber.getNumber().doubleValue(), currentSpace == null ? ParamSpace.NONE : currentSpace.unit); } public void setValue(Param newValue) { final Number oldNum = ggNumber.getNumber(); final Param newParam = ut.translate(newValue, currentSpace); final Number newNum; if (currentSpace.isInteger()) { newNum = (long) newParam.val; } else { newNum = newParam.val; } if (!newNum.equals(oldNum)) ggNumber.setNumber(newNum); } public void setValueAndSpace(Param newValue) { int spcIdx = 0; ParamSpace spc = currentSpace; boolean newSpc = false; for (; spcIdx < collSpaces.size(); spcIdx++) { spc = (ParamSpace) collSpaces.get(spcIdx); if ((spc != currentSpace) && (spc.unit == newValue.unit)) { newSpc = true; break; } } if (newSpc) { currentSpace = spc; ggNumber.setSpace(currentSpace); ggNumber.setFlags(currentSpace.unit & ParamSpace.SPECIAL_MASK); if (spcIdx != lbUnit.getSelectedIndex()) { lbUnit.setSelectedIndex(spcIdx); } } setValue(newValue); if (newSpc) { this.fireSpaceChanged(); } } public ParamSpace getSpace() { return currentSpace; } public void setSpace(ParamSpace newSpace) { for (int i = 0; i < collSpaces.size(); i++) { if (newSpace == collSpaces.get(i)) { // rely on references here selectSpace(i); return; } } throw new IllegalArgumentException("Illegal space switch " + newSpace); } public void setCycling(boolean b) { lbUnit.setCycling(b); } public boolean getCycling() { return lbUnit.getCycling(); } public ParamSpace.Translator getTranslator() { return ut; } public void setTranslator(ParamSpace.Translator ut) { this.ut = ut; } protected void selectSpace(int selectedIdx) { if (selectedIdx >= 0 && selectedIdx < collSpaces.size()) { final ParamSpace oldSpace = currentSpace; currentSpace = (ParamSpace) collSpaces.get(selectedIdx); final Number oldNum = ggNumber.getNumber(); final Param oldParam = new Param(oldNum == null ? (oldSpace == null ? 0.0 : oldSpace.reset) : oldNum.doubleValue(), oldSpace == null ? ParamSpace.NONE : oldSpace.unit); final Param newParam = ut.translate(oldParam, currentSpace); final Number newNum; if (currentSpace.isInteger()) { newNum = (long) newParam.val; } else { newNum = newParam.val; } ggNumber.setSpace(currentSpace); ggNumber.setFlags(currentSpace.unit & ParamSpace.SPECIAL_MASK); if (!newNum.equals(oldNum)) ggNumber.setNumber(newNum); if (selectedIdx != lbUnit.getSelectedIndex()) { lbUnit.setSelectedIndex(selectedIdx); } } else { currentSpace = null; } } // --- listener registration --- /** * Register a <code>NumberListener</code> * which will be informed about changes of * the gadgets content. * * @param listener the <code>NumberListener</code> to register * @see de.sciss.app.EventManager#addListener( Object ) */ public void addListener(ParamField.Listener listener) { synchronized (this) { if (elm == null) { elm = new EventManager(this); } elm.addListener(listener); } } /** * Unregister a <code>NumberListener</code> * from receiving number change events. * * @param listener the <code>NumberListener</code> to unregister * @see de.sciss.app.EventManager#removeListener( Object ) */ public void removeListener(ParamField.Listener listener) { if (elm != null) elm.removeListener(listener); } public void processEvent(BasicEvent e) { ParamField.Listener listener; for (int i = 0; i < elm.countListeners(); i++) { listener = (ParamField.Listener) elm.getListener(i); switch (e.getID()) { case ParamField.Event.VALUE: listener.paramValueChanged((ParamField.Event) e); break; case ParamField.Event.SPACE: listener.paramSpaceChanged((ParamField.Event) e); break; default: assert false : e.getID(); } } // for( i = 0; i < elm.countListeners(); i++ ) } protected void fireValueChanged(boolean adjusting) { if (elm != null) { elm.dispatchEvent(new ParamField.Event(this, ParamField.Event.VALUE, System.currentTimeMillis(), getValue(), getSpace(), getTranslator(), adjusting)); } } protected void fireSpaceChanged() { if (elm != null) { elm.dispatchEvent(new ParamField.Event(this, ParamField.Event.SPACE, System.currentTimeMillis(), getValue(), getSpace(), getTranslator(), false)); } } // ------------------- PropertyChangeListener interface ------------------- /** * Forwards <code>Font</code> property * changes to the child gadgets */ public void propertyChange(PropertyChangeEvent e) { if (e.getPropertyName().equals("font")) { final Font fnt = this.getFont(); ggNumber.setFont(fnt); lbUnit.setFont(fnt); } else if (e.getPropertyName().equals("enabled")) { final boolean enabled = this.isEnabled(); ggJog.setEnabled(enabled); ggNumber.setEnabled(enabled); lbUnit.setEnabled(enabled); } } // ------------------- ComboBoxEditor interface ------------------- public Component getEditorComponent() { return this; } public void setComboGate(boolean gate) { comboGate = gate; } protected boolean getComboGate() { return comboGate; } public void setItem(Object anObject) { if (!comboGate || (anObject == null)) return; if (anObject instanceof Param) { setValue((Param) anObject); } else if (anObject instanceof StringItem) { setValue(Param.valueOf(((StringItem) anObject).getKey())); } } public Object getItem() { final Action a = lbUnit.getSelectedUnit(); final String unit = a == null ? null : (String) a.getValue(Action.NAME); return new StringItem(getValue().toString(), unit == null ? ggNumber.getText() : ggNumber.getText() + " " + unit); } public void selectAll() { ggNumber.requestFocus(); ggNumber.selectAll(); } public void addActionListener(ActionListener l) { ggNumber.addActionListener(l); // XXX only until we have multiple units! } public void removeActionListener(ActionListener l) { ggNumber.removeActionListener(l); } // ------------------- internal classes / interfaces ------------------- public interface UnitViewFactory { public Object createView(int unit); } public static class Event extends BasicEvent { // --- ID values --- /** * returned by getID() : the param value changed */ public static final int VALUE = 0; /** * returned by getID() : the param space was switched */ public static final int SPACE = 1; private final Param value; private final ParamSpace space; private final ParamSpace.Translator ut; private final boolean adjusting; public Event(Object source, int ID, long when, Param value, ParamSpace space, ParamSpace.Translator ut, boolean adjusting) { super(source, ID, when); this.value = value; this.space = space; this.ut = ut; this.adjusting = adjusting; } public boolean isAdjusting() { return adjusting; } public Param getValue() { return value; } public Param getTranslatedValue( ParamSpace newSpace ) { return ut.translate( value, newSpace ); } public ParamSpace getSpace() { return space; } public boolean incorporate(BasicEvent oldEvent) { return oldEvent instanceof Event && this.getSource() == oldEvent.getSource() && this.getID() == oldEvent.getID(); } } public interface Listener extends EventListener { public void paramValueChanged(ParamField.Event e); public void paramSpaceChanged(ParamField.Event e); } }
14,521
0.569681
0.56597
467
30.162741
24.37289
108
false
false
0
0
0
0
0
0
0.798715
false
false
13
e732890e7e37e48bb90bb54bbd44f43f315711aa
4,913,442,624,127
2d05d93a4d8b30b7e1de4bf7b104b911c8107066
/app/src/main/java/com/example/app50001/DeliveryHistoryFragment.java
a85e335bf610c9fbd0eeb77fbf667c24c7fcaa7e
[]
no_license
jesterlyn/50001InfoSysApp
https://github.com/jesterlyn/50001InfoSysApp
d17531e8f10232e75addfca2895bf95f38a3addd
f7709506d65f30a16ea2d13f43d479dff1683af4
refs/heads/master
2020-09-10T08:27:06.392000
2019-12-10T16:42:48
2019-12-10T16:42:48
221,702,542
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.example.app50001; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import androidx.annotation.Nullable; import androidx.annotation.NonNull; import androidx.fragment.app.Fragment; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import com.google.firebase.auth.FirebaseAuth; import com.google.firebase.auth.FirebaseUser; import com.google.firebase.database.DataSnapshot; import com.google.firebase.database.DatabaseError; import com.google.firebase.database.DatabaseReference; import com.google.firebase.database.FirebaseDatabase; import com.google.firebase.database.ValueEventListener; import java.util.ArrayList; import java.util.HashMap; import java.util.List; public class DeliveryHistoryFragment extends Fragment { private DatabaseReference userreference; private FirebaseAuth dbauth; private List<String> deliverydates; private HashMap<String,List<String>> deliverydetails; private RecyclerView recyclerView; private RecyclerView.Adapter adapter; private TextView invisiblewoman; private String currentUID; @Override public void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); //get auth from firebase dbauth = FirebaseAuth.getInstance(); //get the current user and its unique ID FirebaseUser currentuser = dbauth.getCurrentUser(); currentUID = currentuser.getUid(); //get instance of the database userreference = FirebaseDatabase.getInstance().getReference().child("Profiles").child(currentUID); } public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_delivery_history, container, false); return view; } @Override public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); invisiblewoman = (TextView) view.findViewById(R.id.invisible_woman); recyclerView = (RecyclerView) view.findViewById(R.id.recycler_delivery_history); recyclerView.setLayoutManager(new LinearLayoutManager(getContext())); getdeliveries(); adapter = new backendHistoryCustomRecyclerView(getContext(), deliverydates,deliverydetails); recyclerView.setAdapter(adapter); } public void getdeliveries(){ deliverydates = new ArrayList<String>(); deliverydetails = new HashMap<String, List<String>>(); userreference.child("deliveryHistoryOfProfile").addValueEventListener(new ValueEventListener() { @Override public void onDataChange(@NonNull DataSnapshot dataSnapshot) { for(DataSnapshot datasnap : dataSnapshot.getChildren()){ String dates = datasnap.getKey().toString(); deliverydates.add(dates); for(DataSnapshot snap : dataSnapshot.child(dates).getChildren()){ String box = snap.getKey().toString(); String address = snap.getValue().toString(); List<String> detaillist = new ArrayList<>(); detaillist.add(box + "\n" + address); deliverydetails.put(dates, detaillist); } invisiblewoman.setText(dates); } } @Override public void onCancelled(@NonNull DatabaseError databaseError) { } }); } } //COMPLETED
UTF-8
Java
3,791
java
DeliveryHistoryFragment.java
Java
[]
null
[]
package com.example.app50001; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import androidx.annotation.Nullable; import androidx.annotation.NonNull; import androidx.fragment.app.Fragment; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import com.google.firebase.auth.FirebaseAuth; import com.google.firebase.auth.FirebaseUser; import com.google.firebase.database.DataSnapshot; import com.google.firebase.database.DatabaseError; import com.google.firebase.database.DatabaseReference; import com.google.firebase.database.FirebaseDatabase; import com.google.firebase.database.ValueEventListener; import java.util.ArrayList; import java.util.HashMap; import java.util.List; public class DeliveryHistoryFragment extends Fragment { private DatabaseReference userreference; private FirebaseAuth dbauth; private List<String> deliverydates; private HashMap<String,List<String>> deliverydetails; private RecyclerView recyclerView; private RecyclerView.Adapter adapter; private TextView invisiblewoman; private String currentUID; @Override public void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); //get auth from firebase dbauth = FirebaseAuth.getInstance(); //get the current user and its unique ID FirebaseUser currentuser = dbauth.getCurrentUser(); currentUID = currentuser.getUid(); //get instance of the database userreference = FirebaseDatabase.getInstance().getReference().child("Profiles").child(currentUID); } public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_delivery_history, container, false); return view; } @Override public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); invisiblewoman = (TextView) view.findViewById(R.id.invisible_woman); recyclerView = (RecyclerView) view.findViewById(R.id.recycler_delivery_history); recyclerView.setLayoutManager(new LinearLayoutManager(getContext())); getdeliveries(); adapter = new backendHistoryCustomRecyclerView(getContext(), deliverydates,deliverydetails); recyclerView.setAdapter(adapter); } public void getdeliveries(){ deliverydates = new ArrayList<String>(); deliverydetails = new HashMap<String, List<String>>(); userreference.child("deliveryHistoryOfProfile").addValueEventListener(new ValueEventListener() { @Override public void onDataChange(@NonNull DataSnapshot dataSnapshot) { for(DataSnapshot datasnap : dataSnapshot.getChildren()){ String dates = datasnap.getKey().toString(); deliverydates.add(dates); for(DataSnapshot snap : dataSnapshot.child(dates).getChildren()){ String box = snap.getKey().toString(); String address = snap.getValue().toString(); List<String> detaillist = new ArrayList<>(); detaillist.add(box + "\n" + address); deliverydetails.put(dates, detaillist); } invisiblewoman.setText(dates); } } @Override public void onCancelled(@NonNull DatabaseError databaseError) { } }); } } //COMPLETED
3,791
0.682142
0.680823
120
30.566668
29.110346
106
false
false
0
0
0
0
0
0
0.541667
false
false
13
cbd47632335cc34474979bedd6bc6cb348d26ea7
24,034,637,048,122
f41c1c987752f36065d5733cece0fb9dc8c47dea
/ErrorInfo.java
39e72d5c956a3793f4d9f8680a071016dbf0c46e
[]
no_license
moyaog/PrototypeLinuxJobWorkerService
https://github.com/moyaog/PrototypeLinuxJobWorkerService
7e097f4448e16c00853c3cab0975855fa74a0112
55370e838eff65ab8b1c388b0519dc2ec2cdf748
refs/heads/master
2020-05-23T18:42:41.690000
2019-06-19T05:57:02
2019-06-19T05:57:02
186,893,817
0
0
null
false
2019-06-17T07:51:08
2019-05-15T19:55:20
2019-06-17T07:14:05
2019-06-17T07:51:07
75
0
0
0
Java
false
false
import java.util.stream.*; import java.io.Serializable; import java.util.*; // ErrorInfo contains methods that update and return the values in it's data fields public class ErrorInfo implements Serializable { private static final long serialVersionUID = 1L; private Integer errorCode; private String ioMessage; private String errorMessage; private Long pid; // Constructor ErrorInfo() { this.errorCode = null; this.ioMessage = null; this.errorMessage = null; this.pid = null; } public void setErrorCode(int errorCode) { this.errorCode = errorCode; } public int getErrorCode() { return this.errorCode; } public void setIoMessage(String ioMessage) { this.ioMessage = ioMessage; } public String getIoMessage() { return this.ioMessage; } public void setErrorMessage(String errorMessage) { this.errorMessage = errorMessage; } public String getErrorMessage() { return this.errorMessage; } public void setPid(Long pid) { this.pid = pid; } public Long getPid() { return this.pid; } }
UTF-8
Java
1,084
java
ErrorInfo.java
Java
[]
null
[]
import java.util.stream.*; import java.io.Serializable; import java.util.*; // ErrorInfo contains methods that update and return the values in it's data fields public class ErrorInfo implements Serializable { private static final long serialVersionUID = 1L; private Integer errorCode; private String ioMessage; private String errorMessage; private Long pid; // Constructor ErrorInfo() { this.errorCode = null; this.ioMessage = null; this.errorMessage = null; this.pid = null; } public void setErrorCode(int errorCode) { this.errorCode = errorCode; } public int getErrorCode() { return this.errorCode; } public void setIoMessage(String ioMessage) { this.ioMessage = ioMessage; } public String getIoMessage() { return this.ioMessage; } public void setErrorMessage(String errorMessage) { this.errorMessage = errorMessage; } public String getErrorMessage() { return this.errorMessage; } public void setPid(Long pid) { this.pid = pid; } public Long getPid() { return this.pid; } }
1,084
0.697417
0.696494
54
19.074074
17.951427
83
false
false
0
0
0
0
0
0
0.37037
false
false
13
90e4f7aa2b15afa2bdf7537677fff81c176dfce8
12,481,175,001,370
156853a87ec67c2c39d247a6eb610fe46a77b646
/IADifficile.java
010eae76a087813d3aeae5643c2b02d5346d8d68
[]
no_license
boudykh/Java-Project
https://github.com/boudykh/Java-Project
7937d6083cb2fb7a6c6511569df49d1948ea44a8
8d6105c33846d874b7955d0b5c675c36b3bd3823
refs/heads/master
2020-08-12T18:09:09.486000
2019-10-13T12:34:24
2019-10-13T12:34:24
214,816,503
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
public class IADifficile extends Players { public IADifficile() { } @Override void nextMove() throws InterruptedException { int n = 0; this.capture = false; n = (int) (Math.random() * (6)); if (locaJoueur == 1) { if (0 <= n && n <= 2) { locaJoueur++; Thread.sleep(800); return; } if (0 <= 3 && n <= 5) { this.capture = true; Thread.sleep(800); return; } } else { while (true) { if (!ListeLevel.isEmpty()) { for (Levels level : niveauDispo) { if (level.numeroNiveau == locaJoueur) { this.capture = true; Thread.sleep(800); return; } } locaJoueur++; Thread.sleep(800); return; } for (Levels level : niveauDispo) { if (level.numeroNiveau == locaJoueur) { if (0 <= n && n <= 2) { locaJoueur--; Thread.sleep(800); return; } if (0 <= 3 && n <= 5) { this.capture = true; Thread.sleep(800); return; } } } locaJoueur--; Thread.sleep(800); return; } } } void Bloquage() throws InterruptedException { locaJoueur--; Thread.sleep(800); return; } }
UTF-8
Java
1,259
java
IADifficile.java
Java
[]
null
[]
public class IADifficile extends Players { public IADifficile() { } @Override void nextMove() throws InterruptedException { int n = 0; this.capture = false; n = (int) (Math.random() * (6)); if (locaJoueur == 1) { if (0 <= n && n <= 2) { locaJoueur++; Thread.sleep(800); return; } if (0 <= 3 && n <= 5) { this.capture = true; Thread.sleep(800); return; } } else { while (true) { if (!ListeLevel.isEmpty()) { for (Levels level : niveauDispo) { if (level.numeroNiveau == locaJoueur) { this.capture = true; Thread.sleep(800); return; } } locaJoueur++; Thread.sleep(800); return; } for (Levels level : niveauDispo) { if (level.numeroNiveau == locaJoueur) { if (0 <= n && n <= 2) { locaJoueur--; Thread.sleep(800); return; } if (0 <= 3 && n <= 5) { this.capture = true; Thread.sleep(800); return; } } } locaJoueur--; Thread.sleep(800); return; } } } void Bloquage() throws InterruptedException { locaJoueur--; Thread.sleep(800); return; } }
1,259
0.48054
0.451152
75
14.76
13.366466
46
false
false
0
0
0
0
0
0
3.44
false
false
13
b70df5b00f92e30abefb7e7f4c3b0f6a1f92a5b0
20,761,871,950,096
995f73d30450a6dce6bc7145d89344b4ad6e0622
/MATE-20_EMUI_11.0.0/src/main/java/ohos/media/camera/mode/tags/hisi/utils/HisiSensorHdrCapabilityUtil.java
42cc1dd42884feb23688d5b9da6e131b44f1d806
[]
no_license
morningblu/HWFramework
https://github.com/morningblu/HWFramework
0ceb02cbe42585d0169d9b6c4964a41b436039f5
672bb34094b8780806a10ba9b1d21036fd808b8e
refs/heads/master
2023-07-29T05:26:14.603000
2021-09-03T05:23:34
2021-09-03T05:23:34
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package ohos.media.camera.mode.tags.hisi.utils; import ohos.media.camera.device.impl.CameraAbilityImpl; import ohos.media.camera.params.adapter.InnerPropertyKey; import ohos.media.utils.log.Logger; import ohos.media.utils.log.LoggerFactory; public class HisiSensorHdrCapabilityUtil { private static final Logger LOGGER = LoggerFactory.getCameraLogger(HisiSensorHdrCapabilityUtil.class); private HisiSensorHdrCapabilityUtil() { } public static boolean isAvailable(CameraAbilityImpl cameraAbilityImpl) { if (cameraAbilityImpl == null) { LOGGER.warn("SensorHDR support return false, cameraAbility == null", new Object[0]); return false; } Byte b = (Byte) cameraAbilityImpl.getPropertyValue(InnerPropertyKey.SENSOR_HDR_SUPPORTED); if (b == null || b.byteValue() != 1) { return false; } return true; } }
UTF-8
Java
907
java
HisiSensorHdrCapabilityUtil.java
Java
[]
null
[]
package ohos.media.camera.mode.tags.hisi.utils; import ohos.media.camera.device.impl.CameraAbilityImpl; import ohos.media.camera.params.adapter.InnerPropertyKey; import ohos.media.utils.log.Logger; import ohos.media.utils.log.LoggerFactory; public class HisiSensorHdrCapabilityUtil { private static final Logger LOGGER = LoggerFactory.getCameraLogger(HisiSensorHdrCapabilityUtil.class); private HisiSensorHdrCapabilityUtil() { } public static boolean isAvailable(CameraAbilityImpl cameraAbilityImpl) { if (cameraAbilityImpl == null) { LOGGER.warn("SensorHDR support return false, cameraAbility == null", new Object[0]); return false; } Byte b = (Byte) cameraAbilityImpl.getPropertyValue(InnerPropertyKey.SENSOR_HDR_SUPPORTED); if (b == null || b.byteValue() != 1) { return false; } return true; } }
907
0.706725
0.70452
25
35.279999
31.861601
106
false
false
0
0
0
0
0
0
0.6
false
false
13
c1a789ce4e27bca50784b788862d04f9bb7158a5
16,758,962,455,186
40ca7cf005ec1df72641307b5c61d31c6cb72394
/trunk/micbi/hadoop/src/main/java/dw/dwMicbiEmailResultInfo/DwMicbiEmailResultInfoMap.java
d24ee77e66f6954747c41ca61284c7fa8c22aab6
[]
no_license
htsumail/micbi
https://github.com/htsumail/micbi
1e08d0125151418d601c2a2c05240b838686531e
ae985ada2c667606ebbc8996be48a0a21d49743b
refs/heads/master
2018-01-09T12:50:51.654000
2017-08-14T01:16:29
2017-08-14T01:16:29
100,215,087
0
1
null
null
null
null
null
null
null
null
null
null
null
null
null
package dw.dwMicbiEmailResultInfo; import java.io.IOException; import java.util.ArrayList; import java.util.List; import org.apache.hadoop.io.Text; import org.apache.hadoop.mapreduce.Mapper; import com.focustech.commons.util.StringUtils; public class DwMicbiEmailResultInfoMap extends Mapper<Object, Text, Text, Text> { private Text keyText = new Text(); private Text valueText = new Text(); private DwMicbiEmailResultInfoRecord record = new DwMicbiEmailResultInfoRecord(); @Override public void map(Object key, Text value, Context context) throws IOException, InterruptedException { String logStr = value.toString(); if (StringUtils.isEmpty(logStr)) { return; } List<String> resultList = new ArrayList<String>(); for (int index = 0; index < DwMicbiEmailResultInfoRecord.p_command.length; index++) { if (checkCommand(logStr, DwMicbiEmailResultInfoRecord.p_command[index])) { resultList = record.doRecord(logStr); if (resultList.size() > 0 && StringUtils.isNotEmpty(resultList.get(2))) { keyText.set(resultList.get(2) + DwMicbiEmailResultInfoRecord.SPLIT_CHAR_LINE + resultList.get(1)); valueText.set(record.generateRecord(resultList)); context.write(keyText, valueText); } } } } /** * 检查该行日志是否存在检查的命令 * * @param logStr * @param command * @return */ private boolean checkCommand(String logStr, String command) { boolean flag = true; String[] commandCheckArr = command.split(DwMicbiEmailResultInfoRecord.JUDGE_CHAR_END); for (String commandCheck : commandCheckArr) { flag = flag && logStr.contains(commandCheck); } return flag; } }
UTF-8
Java
1,881
java
DwMicbiEmailResultInfoMap.java
Java
[]
null
[]
package dw.dwMicbiEmailResultInfo; import java.io.IOException; import java.util.ArrayList; import java.util.List; import org.apache.hadoop.io.Text; import org.apache.hadoop.mapreduce.Mapper; import com.focustech.commons.util.StringUtils; public class DwMicbiEmailResultInfoMap extends Mapper<Object, Text, Text, Text> { private Text keyText = new Text(); private Text valueText = new Text(); private DwMicbiEmailResultInfoRecord record = new DwMicbiEmailResultInfoRecord(); @Override public void map(Object key, Text value, Context context) throws IOException, InterruptedException { String logStr = value.toString(); if (StringUtils.isEmpty(logStr)) { return; } List<String> resultList = new ArrayList<String>(); for (int index = 0; index < DwMicbiEmailResultInfoRecord.p_command.length; index++) { if (checkCommand(logStr, DwMicbiEmailResultInfoRecord.p_command[index])) { resultList = record.doRecord(logStr); if (resultList.size() > 0 && StringUtils.isNotEmpty(resultList.get(2))) { keyText.set(resultList.get(2) + DwMicbiEmailResultInfoRecord.SPLIT_CHAR_LINE + resultList.get(1)); valueText.set(record.generateRecord(resultList)); context.write(keyText, valueText); } } } } /** * 检查该行日志是否存在检查的命令 * * @param logStr * @param command * @return */ private boolean checkCommand(String logStr, String command) { boolean flag = true; String[] commandCheckArr = command.split(DwMicbiEmailResultInfoRecord.JUDGE_CHAR_END); for (String commandCheck : commandCheckArr) { flag = flag && logStr.contains(commandCheck); } return flag; } }
1,881
0.644516
0.641815
55
32.654545
31.707882
118
false
false
0
0
0
0
0
0
0.581818
false
false
13
b10642c4660952fea48e06efa5884fc1920bca3d
14,602,888,852,876
7d832497fe5bc4f1915171ef44c690d79bae2c0e
/src/main/java/com/ssoysal/letMeIn/entities/Login.java
1a93081d5a8866cc0c87b2233c90885332bbf16d
[]
no_license
ssscs/letmein-spring
https://github.com/ssscs/letmein-spring
5bc7b192cb909b4eade785a92099a98709c6d06d
3845a7817da8931082da272ce08f0e01da5b5a76
refs/heads/main
2023-04-28T11:46:49.858000
2021-05-20T13:14:17
2021-05-20T13:14:17
369,128,729
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.ssoysal.letMeIn.entities; import javax.persistence.*; import org.hibernate.annotations.ColumnTransformer; @Entity @Table(name="login") public class Login { @Id @Column(name="id") @GeneratedValue(strategy=GenerationType.IDENTITY) private int id; @Column(name="url") @ColumnTransformer( read = "cast(aes_decrypt(url, UNHEX('/* use strong keys */')) as char(255))", write = "aes_encrypt(?, UNHEX('/* use strong keys */'))") private String url; @Column(name="mail") @ColumnTransformer( read = "cast(aes_decrypt(mail, UNHEX('/* use strong keys */')) as char(255))", write = "aes_encrypt(?, UNHEX('/* use strong keys */'))") private String mail; @Column(name="pass") @ColumnTransformer( read = "cast(aes_decrypt(pass, UNHEX('/* use strong keys */')) as char(255))", write = "aes_encrypt(?, UNHEX('/* use strong keys */'))") private String pass; public Login() {} public Login(int id, String url, String mail, String pass) { super(); this.id = id; this.url = url; this.mail = mail; this.pass = pass; } public int getId() { return id; } public void setId(int id) { this.id = id; } public String getUrl() { return url; } public void setUrl(String url) { this.url = url; } public String getMail() { return mail; } public void setMail(String mail) { this.mail = mail; } public String getPass() { return pass; } public void setPass(String pass) { this.pass = pass; } }
UTF-8
Java
1,566
java
Login.java
Java
[]
null
[]
package com.ssoysal.letMeIn.entities; import javax.persistence.*; import org.hibernate.annotations.ColumnTransformer; @Entity @Table(name="login") public class Login { @Id @Column(name="id") @GeneratedValue(strategy=GenerationType.IDENTITY) private int id; @Column(name="url") @ColumnTransformer( read = "cast(aes_decrypt(url, UNHEX('/* use strong keys */')) as char(255))", write = "aes_encrypt(?, UNHEX('/* use strong keys */'))") private String url; @Column(name="mail") @ColumnTransformer( read = "cast(aes_decrypt(mail, UNHEX('/* use strong keys */')) as char(255))", write = "aes_encrypt(?, UNHEX('/* use strong keys */'))") private String mail; @Column(name="pass") @ColumnTransformer( read = "cast(aes_decrypt(pass, UNHEX('/* use strong keys */')) as char(255))", write = "aes_encrypt(?, UNHEX('/* use strong keys */'))") private String pass; public Login() {} public Login(int id, String url, String mail, String pass) { super(); this.id = id; this.url = url; this.mail = mail; this.pass = pass; } public int getId() { return id; } public void setId(int id) { this.id = id; } public String getUrl() { return url; } public void setUrl(String url) { this.url = url; } public String getMail() { return mail; } public void setMail(String mail) { this.mail = mail; } public String getPass() { return pass; } public void setPass(String pass) { this.pass = pass; } }
1,566
0.60281
0.597063
77
19.337662
21.765343
89
false
false
0
0
0
0
0
0
2.064935
false
false
13
b6eeaf104601c9d51195be12fcd8e44a06929158
8,426,725,891,798
947b482600cde52ce96ae408cb1256a3f31cdc1d
/src/other/AmzNameList.java
fd3736512f8a894f15f209f8ff6374d6b6580ff1
[]
no_license
fztest/LintCodeSolution
https://github.com/fztest/LintCodeSolution
850e790f4b68b8231ea43f7f924578b26c4d76be
79d4fc47fe2788ca4d5f6a68fce2dff5f99f2920
refs/heads/master
2020-03-25T06:34:06.982000
2016-06-06T03:27:12
2016-06-06T03:27:14
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package other; import java.util.*; public class AmzNameList { public static void main(String[] args) { List<String> names = Arrays.asList(new String[]{"aaa","sss","bbb","fff","eee","ddd","aaa","aaa","sss","sss","aaa"}); System.out.println(romanizeNames(names)); } private static List<String> romanizeNames(List<String> namesInOrder){ List<String> result = new ArrayList<String>(); Map<String,Integer> map = new HashMap<String,Integer>(); for(int i=0; i<namesInOrder.size(); i++){ if(map.containsKey(namesInOrder.get(i))){ if(map.get(namesInOrder.get(i)) <= 0){ int pos = -map.get(namesInOrder.get(i)); map.put(namesInOrder.get(i), 2); result.add(namesInOrder.get(i)+"2"); result.remove(pos); result.add(pos, namesInOrder.get(i)+"1"); }else{ map.put(namesInOrder.get(i), map.get(namesInOrder.get(i))+1); result.add(namesInOrder.get(i)+map.get(namesInOrder.get(i))); } }else{ map.put(namesInOrder.get(i), -i); result.add(namesInOrder.get(i)); } } return result; } }
UTF-8
Java
1,071
java
AmzNameList.java
Java
[]
null
[]
package other; import java.util.*; public class AmzNameList { public static void main(String[] args) { List<String> names = Arrays.asList(new String[]{"aaa","sss","bbb","fff","eee","ddd","aaa","aaa","sss","sss","aaa"}); System.out.println(romanizeNames(names)); } private static List<String> romanizeNames(List<String> namesInOrder){ List<String> result = new ArrayList<String>(); Map<String,Integer> map = new HashMap<String,Integer>(); for(int i=0; i<namesInOrder.size(); i++){ if(map.containsKey(namesInOrder.get(i))){ if(map.get(namesInOrder.get(i)) <= 0){ int pos = -map.get(namesInOrder.get(i)); map.put(namesInOrder.get(i), 2); result.add(namesInOrder.get(i)+"2"); result.remove(pos); result.add(pos, namesInOrder.get(i)+"1"); }else{ map.put(namesInOrder.get(i), map.get(namesInOrder.get(i))+1); result.add(namesInOrder.get(i)+map.get(namesInOrder.get(i))); } }else{ map.put(namesInOrder.get(i), -i); result.add(namesInOrder.get(i)); } } return result; } }
1,071
0.633987
0.628385
41
25.121952
26.41433
118
false
false
0
0
0
0
0
0
3.170732
false
false
13
ca2aeec7b1a249af8d39712295392e71e6f76236
26,216,480,422,670
ab065f4726a56780e7e7be195914bc83437b59b1
/src/main/java/domain_Direction/oTo/DoDire_oTo.java
bd51cc6e43adf4e4c1803253e9ee275a5d3ec7fb
[]
no_license
yetao93/HibernateDemo
https://github.com/yetao93/HibernateDemo
42434aa36a2367b0137086a1396a90c53aafebc2
665c510e776886244e40950afb80c08afdd3bbc8
refs/heads/master
2019-01-07T14:49:34.546000
2017-10-19T11:52:50
2017-10-19T11:52:50
74,882,701
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package domain_Direction.oTo; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.hibernate.boot.registry.StandardServiceRegistryBuilder; import org.hibernate.cfg.Configuration; import org.hibernate.service.ServiceRegistry; import java.util.*; public class DoDire_oTo { public static SessionFactory sessionFactory; public static void main(String[] args) { Session session = getSession(); try { session.beginTransaction(); // 由于Wife实体使用@OneToOne注解时指定了mappedBy属性,因此Wife实体不能用于控制关联关系,只能由Husband实体控制 // 先持久化主表再从表 Husband husband = new Husband("好丽友"); Wife wife = new Wife("派"); husband.setWife(wife); session.save(wife); session.save(husband); session.getTransaction().commit(); } catch (Exception e) { e.printStackTrace(); session.getTransaction().rollback(); } } public static Session getSession() { if (sessionFactory == null || sessionFactory.isClosed()) { Configuration cfg = new Configuration().configure(); ServiceRegistry serviceRegistry = new StandardServiceRegistryBuilder().applySettings(cfg.getProperties()) .build(); sessionFactory = cfg.buildSessionFactory(serviceRegistry); } return sessionFactory.getCurrentSession(); } public static List<Map<String, Object>> mapKeyToUpperCase(List<Map<String, Object>> list) { List<Map<String, Object>> newList = new ArrayList<Map<String, Object>>(); for (Map<String, Object> map : list) { Map<String, Object> newMap = new HashMap<String, Object>(); Iterator<String> it = map.keySet().iterator(); while (it.hasNext()) { String key = (String) it.next(); String upKey = key.toUpperCase(); newMap.put(upKey, map.get(key)); } newList.add(newMap); } return newList; } }
UTF-8
Java
2,193
java
DoDire_oTo.java
Java
[]
null
[]
package domain_Direction.oTo; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.hibernate.boot.registry.StandardServiceRegistryBuilder; import org.hibernate.cfg.Configuration; import org.hibernate.service.ServiceRegistry; import java.util.*; public class DoDire_oTo { public static SessionFactory sessionFactory; public static void main(String[] args) { Session session = getSession(); try { session.beginTransaction(); // 由于Wife实体使用@OneToOne注解时指定了mappedBy属性,因此Wife实体不能用于控制关联关系,只能由Husband实体控制 // 先持久化主表再从表 Husband husband = new Husband("好丽友"); Wife wife = new Wife("派"); husband.setWife(wife); session.save(wife); session.save(husband); session.getTransaction().commit(); } catch (Exception e) { e.printStackTrace(); session.getTransaction().rollback(); } } public static Session getSession() { if (sessionFactory == null || sessionFactory.isClosed()) { Configuration cfg = new Configuration().configure(); ServiceRegistry serviceRegistry = new StandardServiceRegistryBuilder().applySettings(cfg.getProperties()) .build(); sessionFactory = cfg.buildSessionFactory(serviceRegistry); } return sessionFactory.getCurrentSession(); } public static List<Map<String, Object>> mapKeyToUpperCase(List<Map<String, Object>> list) { List<Map<String, Object>> newList = new ArrayList<Map<String, Object>>(); for (Map<String, Object> map : list) { Map<String, Object> newMap = new HashMap<String, Object>(); Iterator<String> it = map.keySet().iterator(); while (it.hasNext()) { String key = (String) it.next(); String upKey = key.toUpperCase(); newMap.put(upKey, map.get(key)); } newList.add(newMap); } return newList; } }
2,193
0.602007
0.602007
59
33.474575
26.15168
117
false
false
0
0
0
0
0
0
0.677966
false
false
13
437b9308cc2e9bfd0084925f780e740577528111
10,548,439,693,782
1163394bf18e8671506fe1d45db8decb1d8938bd
/src/main/java/com/grudnik/controllers/LoginController.java
101e866551cf7ff492f6effe0b093fe5cdb76e1a
[]
no_license
MrKyrtap/JAVASpringForum
https://github.com/MrKyrtap/JAVASpringForum
f3e1b8c4c78b7caa565952aee7caa2b51c5504c8
272e2ec6a0b0f37cd2b50f9631f3b286a420a06e
refs/heads/master
2021-01-20T08:20:38.186000
2017-08-27T10:42:08
2017-08-27T10:42:08
90,132,853
1
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.grudnik.controllers; import com.grudnik.entities.Category; import com.grudnik.entities.MainCategory; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import java.util.HashMap; import java.util.List; /** * Created by PatrykGrudnik on 02/05/2017. */ @Controller public class LoginController { @RequestMapping(value = "/login") public String login(Model model) { return "login"; } }
UTF-8
Java
520
java
LoginController.java
Java
[ { "context": "HashMap;\nimport java.util.List;\n\n/**\n * Created by PatrykGrudnik on 02/05/2017.\n */\n@Controller\npublic class Login", "end": 346, "score": 0.9888842701911926, "start": 333, "tag": "NAME", "value": "PatrykGrudnik" } ]
null
[]
package com.grudnik.controllers; import com.grudnik.entities.Category; import com.grudnik.entities.MainCategory; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import java.util.HashMap; import java.util.List; /** * Created by PatrykGrudnik on 02/05/2017. */ @Controller public class LoginController { @RequestMapping(value = "/login") public String login(Model model) { return "login"; } }
520
0.759615
0.744231
23
21.608696
18.830454
62
false
false
0
0
0
0
0
0
0.391304
false
false
13
43966f44d284f1020b6cc59d473c2f7b56e038ce
10,548,439,693,789
ed9a60eee17b7b4e4ee34de7beb3a6480069e208
/src/main/java/com/sanjoksoft/dao/impl/BankDaoImpl.java
3419e920ca5e1787664cfe75bb4f55901ceca183
[]
no_license
sanjokpro/Spring-Boot-JDBC-Transaction-Management
https://github.com/sanjokpro/Spring-Boot-JDBC-Transaction-Management
437f670df790f82e039afb8bf732533bc1721c70
f1c181478eac78f7e622ed58399560c3e8ede388
refs/heads/master
2020-03-07T15:34:31.826000
2018-03-31T18:43:25
2018-03-31T18:43:25
127,558,625
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.sanjoksoft.dao.impl; import com.sanjoksoft.dao.BankDao; import com.sanjoksoft.dao.exception.InsufficientAccountBalanceException; import com.sanjoksoft.dao.mapper.AccountRowMapper; import com.sanjoksoft.model.Account; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.dao.EmptyResultDataAccessException; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.stereotype.Repository; @Repository @Slf4j public class BankDaoImpl implements BankDao { @Autowired private JdbcTemplate jdbcTemplate; public JdbcTemplate getJdbcTemplate() { return jdbcTemplate; } public void setJdbcTemplate(JdbcTemplate jdbcTemplate) { this.jdbcTemplate = jdbcTemplate; } @Override public void withdraw(Account fromAccount,Double amount) throws Exception { Account accountFromDb = getAccountFromDb(fromAccount.getAccountNumber()); Double accountBalance = accountFromDb.getAccountBalance() - amount; if (accountFromDb.getAccountBalance() >= amount) { String SQL = "UPDATE icici_bank SET account_balance=? WHERE account_no=?"; int update = getJdbcTemplate().update(SQL, accountBalance, fromAccount.getAccountNumber()); if (update > 0) { log.info("Amount Rs:" + amount + " is deducted from Account No:" + fromAccount.getAccountNumber()); } } else { throw new InsufficientAccountBalanceException("Insufficient account balance"); } } @Override public void deposit(Account toAccount, Double amount) throws Exception { Account accountFromDb = getAccountFromDb(toAccount.getAccountNumber()); Double accountBalance = accountFromDb.getAccountBalance() + amount; String SQL = "UPDATE icici_bank SET account_balance=? WHERE account_no=?"; int update = getJdbcTemplate().update(SQL, accountBalance, toAccount.getAccountNumber()); if (update > 0) { log.info("Amount Rs:" + amount + " is deposited in Account No:" + toAccount.getAccountNumber()); } } private Account getAccountFromDb(Long accountNumber) throws Exception { try { String SQL = "SELECT * FROM icici_bank WHERE account_no = ?"; Account account = getJdbcTemplate().queryForObject(SQL, new AccountRowMapper(), accountNumber); return account; } catch (EmptyResultDataAccessException e) { throw new Exception("sorry, यो खाता नम्बर छैन"); } } }
UTF-8
Java
2,701
java
BankDaoImpl.java
Java
[]
null
[]
package com.sanjoksoft.dao.impl; import com.sanjoksoft.dao.BankDao; import com.sanjoksoft.dao.exception.InsufficientAccountBalanceException; import com.sanjoksoft.dao.mapper.AccountRowMapper; import com.sanjoksoft.model.Account; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.dao.EmptyResultDataAccessException; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.stereotype.Repository; @Repository @Slf4j public class BankDaoImpl implements BankDao { @Autowired private JdbcTemplate jdbcTemplate; public JdbcTemplate getJdbcTemplate() { return jdbcTemplate; } public void setJdbcTemplate(JdbcTemplate jdbcTemplate) { this.jdbcTemplate = jdbcTemplate; } @Override public void withdraw(Account fromAccount,Double amount) throws Exception { Account accountFromDb = getAccountFromDb(fromAccount.getAccountNumber()); Double accountBalance = accountFromDb.getAccountBalance() - amount; if (accountFromDb.getAccountBalance() >= amount) { String SQL = "UPDATE icici_bank SET account_balance=? WHERE account_no=?"; int update = getJdbcTemplate().update(SQL, accountBalance, fromAccount.getAccountNumber()); if (update > 0) { log.info("Amount Rs:" + amount + " is deducted from Account No:" + fromAccount.getAccountNumber()); } } else { throw new InsufficientAccountBalanceException("Insufficient account balance"); } } @Override public void deposit(Account toAccount, Double amount) throws Exception { Account accountFromDb = getAccountFromDb(toAccount.getAccountNumber()); Double accountBalance = accountFromDb.getAccountBalance() + amount; String SQL = "UPDATE icici_bank SET account_balance=? WHERE account_no=?"; int update = getJdbcTemplate().update(SQL, accountBalance, toAccount.getAccountNumber()); if (update > 0) { log.info("Amount Rs:" + amount + " is deposited in Account No:" + toAccount.getAccountNumber()); } } private Account getAccountFromDb(Long accountNumber) throws Exception { try { String SQL = "SELECT * FROM icici_bank WHERE account_no = ?"; Account account = getJdbcTemplate().queryForObject(SQL, new AccountRowMapper(), accountNumber); return account; } catch (EmptyResultDataAccessException e) { throw new Exception("sorry, यो खाता नम्बर छैन"); } } }
2,701
0.677516
0.675645
69
37.739132
31.74338
108
false
false
0
0
0
0
0
0
0.536232
false
false
13
f23d02d4e14608fd9d321dcb4a4fca458f6374c9
15,247,133,922,144
ad3adf532338a3f7160b44e864885a7fbbcad0f0
/operation-system-web/src/main/java/operation/system/WebApplicationBootStrap.java
0e171e10dfaed0258afccc76777ead09dccf0a40
[]
no_license
qiufeng001/operation-system
https://github.com/qiufeng001/operation-system
0b90cb5e67fa8032c277269d3a05b7aec316afac
11cd93bc4a25a20fb73db2492406d6d4d77f125c
refs/heads/master
2020-04-12T18:22:52.175000
2018-12-22T09:57:03
2018-12-22T09:57:03
162,677,061
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package operation.system; import com.framework.core.configuration.ApplicationBootStrap; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.ImportResource; import org.springframework.transaction.annotation.EnableTransactionManagement; @SpringBootApplication @EnableTransactionManagement // 事物注解 @ImportResource(locations={"classpath:spring-redis.xml"}) @ComponentScan(basePackages = { "operation.system.controller", "operation.system.inspect", "operation.system.netty" }) public class WebApplicationBootStrap extends ApplicationBootStrap { public static void main(String[] args) { new WebApplicationBootStrap().run(args); } }
UTF-8
Java
798
java
WebApplicationBootStrap.java
Java
[]
null
[]
package operation.system; import com.framework.core.configuration.ApplicationBootStrap; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.ImportResource; import org.springframework.transaction.annotation.EnableTransactionManagement; @SpringBootApplication @EnableTransactionManagement // 事物注解 @ImportResource(locations={"classpath:spring-redis.xml"}) @ComponentScan(basePackages = { "operation.system.controller", "operation.system.inspect", "operation.system.netty" }) public class WebApplicationBootStrap extends ApplicationBootStrap { public static void main(String[] args) { new WebApplicationBootStrap().run(args); } }
798
0.802532
0.802532
22
34.954544
24.551388
78
false
false
0
0
0
0
0
0
2
false
false
13
c8f4881b029737509ded409a7474858d9fd6c740
11,647,951,310,414
7602f4bac5c41382deeb3bb70a1986a612e7d313
/srv/src/main/java/com/zenika/nc/angular/mybottles/AppServer.java
0f1d78d80d5d53eaf957f2a70d7ec7c3418819b3
[]
no_license
Zenika/nc-angularjs-decouverte
https://github.com/Zenika/nc-angularjs-decouverte
7f6acb67250ac53719905fabfb25ad5b5fcddf1f
67d06ebbb15221f7a93de8a63c6fa70eb671f59e
refs/heads/master
2021-01-01T19:42:43.634000
2014-02-07T06:51:11
2014-02-07T06:51:11
16,134,951
0
2
null
false
2014-02-07T06:51:11
2014-01-22T09:41:23
2014-02-07T06:51:11
2014-02-07T06:51:11
11,184
1
3
0
Java
null
null
package com.zenika.nc.angular.mybottles; import restx.server.WebServer; /** * This class can be used to run the app. * * Alternatively, you can deploy the app as a war in a regular container like tomcat or jetty. * * Reading the port from system env PORT makes it compatible with heroku. */ public class AppServer { public static final String WEB_INF_LOCATION = "src/main/webapp/WEB-INF/web.xml"; private static int port = 8080; private static String WEB_APP_LOCATION = "../ui/app"; public static void main(String[] args) throws Exception { if( ! extractArgs(args) ) { return; } WebServer server = new NonBlockingJettyWebServer(WEB_INF_LOCATION, WEB_APP_LOCATION, port, "0.0.0.0"); /* * load mode from system property if defined, or default to dev * be careful with that setting, if you use this class to launch your server in production, make sure to launch * it with -Drestx.mode=prod or change the default here */ System.setProperty("restx.mode", System.getProperty("restx.mode", "dev")); System.setProperty("restx.app.package", "com.zenika.nc.angular.mybottles"); System.out.println("Server starting on port "+port); server.startAndAwait(); } private static boolean extractArgs(String[] args) { //case HELP if( args.length > 0 && "help".equals(args[0]) ) { showHelp(); return false; } // parse port value if( args.length > 0 ) { try { port = Integer.valueOf(args[0]); } catch ( NumberFormatException e) { showHelp(); return false; } } if( args.length > 1 ) { WEB_APP_LOCATION = args[1]; } return true; } private static void showHelp() { System.out.println("sh start.sh <port> <ui directory>"); System.out.println(""); System.out.println("Example :"); System.out.println("sh start.sh 8080 ../ui/app"); } }
UTF-8
Java
2,095
java
AppServer.java
Java
[ { "context": "Server(WEB_INF_LOCATION, WEB_APP_LOCATION, port, \"0.0.0.0\");\n\n /*\n * load mode from system p", "end": 740, "score": 0.9995264410972595, "start": 733, "tag": "IP_ADDRESS", "value": "0.0.0.0" } ]
null
[]
package com.zenika.nc.angular.mybottles; import restx.server.WebServer; /** * This class can be used to run the app. * * Alternatively, you can deploy the app as a war in a regular container like tomcat or jetty. * * Reading the port from system env PORT makes it compatible with heroku. */ public class AppServer { public static final String WEB_INF_LOCATION = "src/main/webapp/WEB-INF/web.xml"; private static int port = 8080; private static String WEB_APP_LOCATION = "../ui/app"; public static void main(String[] args) throws Exception { if( ! extractArgs(args) ) { return; } WebServer server = new NonBlockingJettyWebServer(WEB_INF_LOCATION, WEB_APP_LOCATION, port, "0.0.0.0"); /* * load mode from system property if defined, or default to dev * be careful with that setting, if you use this class to launch your server in production, make sure to launch * it with -Drestx.mode=prod or change the default here */ System.setProperty("restx.mode", System.getProperty("restx.mode", "dev")); System.setProperty("restx.app.package", "com.zenika.nc.angular.mybottles"); System.out.println("Server starting on port "+port); server.startAndAwait(); } private static boolean extractArgs(String[] args) { //case HELP if( args.length > 0 && "help".equals(args[0]) ) { showHelp(); return false; } // parse port value if( args.length > 0 ) { try { port = Integer.valueOf(args[0]); } catch ( NumberFormatException e) { showHelp(); return false; } } if( args.length > 1 ) { WEB_APP_LOCATION = args[1]; } return true; } private static void showHelp() { System.out.println("sh start.sh <port> <ui directory>"); System.out.println(""); System.out.println("Example :"); System.out.println("sh start.sh 8080 ../ui/app"); } }
2,095
0.590453
0.581862
67
30.268656
29.418535
119
false
false
0
0
0
0
0
0
0.537313
false
false
13
19fae1413bd58e09415d4d6b5298a760b7a6ee2a
11,647,951,307,187
10354290ed5bc29a8349ab449fe904a8a149ee73
/src/main/java/mekanism/common/util/StackUtils.java
042fe516307ba44042e392cbd9f56f056ef78780
[ "MIT" ]
permissive
thecow275/Mekanism
https://github.com/thecow275/Mekanism
17ac675b59aa8af9ac73909f8182262881d422ca
6093851f05dfb5ff2da52ace87f06ea03a7571a4
refs/heads/master
2022-12-10T08:45:16.038000
2022-10-22T15:47:07
2022-10-22T15:47:07
31,206,431
0
0
null
true
2020-10-22T16:22:32
2015-02-23T12:04:36
2019-04-19T02:13:42
2020-10-22T16:22:31
34,443
0
0
0
Java
false
false
package mekanism.common.util; import java.util.ArrayList; import java.util.Collections; import java.util.List; import mekanism.api.Action; import mekanism.api.inventory.IInventorySlot; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.world.InteractionHand; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.context.BlockPlaceContext; import net.minecraft.world.item.context.UseOnContext; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.phys.BlockHitResult; import net.minecraft.world.phys.Vec3; import net.minecraftforge.items.ItemHandlerHelper; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; public final class StackUtils { private StackUtils() { } public static ItemStack size(ItemStack stack, int size) { if (size <= 0 || stack.isEmpty()) { return ItemStack.EMPTY; } return ItemHandlerHelper.copyStackWithSize(stack, size); } public static List<ItemStack> merge(@NotNull List<IInventorySlot> orig, @NotNull List<IInventorySlot> toAdd) { List<ItemStack> rejects = new ArrayList<>(); merge(orig, toAdd, rejects); return rejects; } public static void merge(@NotNull List<IInventorySlot> orig, @NotNull List<IInventorySlot> toAdd, List<ItemStack> rejects) { if (orig.size() != toAdd.size()) { throw new IllegalArgumentException("Mismatched slot count"); } for (int i = 0; i < toAdd.size(); i++) { IInventorySlot toAddSlot = toAdd.get(i); if (!toAddSlot.isEmpty()) { IInventorySlot origSlot = orig.get(i); ItemStack toAddStack = toAddSlot.getStack(); if (origSlot.isEmpty()) { int max = origSlot.getLimit(toAddStack); if (toAddStack.getCount() <= max) { origSlot.setStack(toAddStack); } else { origSlot.setStack(size(toAddStack, max)); //Add any remainder to the rejects (if this is zero this will no-op addStack(rejects, size(toAddStack, toAddStack.getCount() - max)); } } else if (ItemHandlerHelper.canItemStacksStack(origSlot.getStack(), toAddStack)) { int added = origSlot.growStack(toAddStack.getCount(), Action.EXECUTE); //Add any remainder to the rejects (if this is zero this will no-op addStack(rejects, size(toAddStack, toAddStack.getCount() - added)); } else { addStack(rejects, toAddStack.copy()); } } } } /** * @implNote Assumes the passed in stack and stacks in the list can be safely modified. */ private static void addStack(List<ItemStack> stacks, ItemStack stack) { if (!stack.isEmpty()) { for (ItemStack existingStack : stacks) { int needed = existingStack.getMaxStackSize() - existingStack.getCount(); if (needed > 0 && ItemHandlerHelper.canItemStacksStack(existingStack, stack)) { //This stack needs some items and can stack with the one we are adding int toAdd = Math.min(needed, stack.getCount()); //Add the amount we can existingStack.grow(toAdd); stack.shrink(toAdd); //And break out of checking as even if we have any remaining it won't be able to stack with later things // as they will have a different type or this existing stack would have already been full break; } } if (!stack.isEmpty()) { //If we have any we weren't able to add to existing stacks, we need to go ahead and add it as new stacks // making sure to split it if it is an oversized stack int count = stack.getCount(); int max = stack.getMaxStackSize(); if (count > max) { //If we have more than a stack of the item stack counts, int excess = count % max; int stacksToAdd = count / max; if (excess > 0) { // start by adding any excess that won't go into full stack sizes (so that we have a lower index // and have less to iterate when adding more of the same type) stacks.add(size(stack, excess)); } // and then add as many max size stacks as needed ItemStack maxSize = size(stack, max); stacks.add(maxSize); for (int i = 1; i < stacksToAdd; i++) { stacks.add(maxSize.copy()); } } else { //Valid stack, just add it directly stacks.add(stack); } } } } //Assumes that the stacks are already private static List<ItemStack> flatten(List<ItemStack> stacks) { if (stacks.isEmpty()) { return Collections.emptyList(); } List<ItemStack> compacted = new ArrayList<>(); for (ItemStack stack : stacks) { if (!stack.isEmpty()) { int count = stack.getCount(); int max = stack.getMaxStackSize(); //TODO: Fix comments if (count > max) { //If we have more than a stack of the item (such as we are a bin) or some other thing that allows for compressing // stack counts, drop as many stacks as we need at their max size while (count > max) { compacted.add(size(stack, max)); count -= max; } if (count > 0) { //If we have anything left to drop afterward, do so compacted.add(size(stack, count)); } } else { //If we have a valid stack, we can just directly drop that instead without requiring any copies // as while IInventorySlot#getStack says to not mutate the stack, our slot is a dummy slot compacted.add(stack); } } } for (int i = 0; i < stacks.size(); i++) { ItemStack s = stacks.get(i); if (!s.isEmpty()) { for (int j = i + 1; j < stacks.size(); j++) { ItemStack s1 = stacks.get(j); if (ItemHandlerHelper.canItemStacksStack(s, s1)) { s.grow(s1.getCount()); stacks.set(j, ItemStack.EMPTY); } } } } return compacted; } /** * Get state for placement for a generic item, with our fake player * * @param stack the item to place * @param pos where * @param player our fake player, usually * * @return the result of {@link Block#getStateForPlacement(BlockPlaceContext)}, or null if it cannot be placed in that location */ @Nullable public static BlockState getStateForPlacement(ItemStack stack, BlockPos pos, Player player) { return Block.byItem(stack.getItem()).getStateForPlacement(new BlockPlaceContext(new UseOnContext(player, InteractionHand.MAIN_HAND, new BlockHitResult(Vec3.ZERO, Direction.UP, pos, false)))); } }
UTF-8
Java
7,850
java
StackUtils.java
Java
[]
null
[]
package mekanism.common.util; import java.util.ArrayList; import java.util.Collections; import java.util.List; import mekanism.api.Action; import mekanism.api.inventory.IInventorySlot; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.world.InteractionHand; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.context.BlockPlaceContext; import net.minecraft.world.item.context.UseOnContext; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.phys.BlockHitResult; import net.minecraft.world.phys.Vec3; import net.minecraftforge.items.ItemHandlerHelper; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; public final class StackUtils { private StackUtils() { } public static ItemStack size(ItemStack stack, int size) { if (size <= 0 || stack.isEmpty()) { return ItemStack.EMPTY; } return ItemHandlerHelper.copyStackWithSize(stack, size); } public static List<ItemStack> merge(@NotNull List<IInventorySlot> orig, @NotNull List<IInventorySlot> toAdd) { List<ItemStack> rejects = new ArrayList<>(); merge(orig, toAdd, rejects); return rejects; } public static void merge(@NotNull List<IInventorySlot> orig, @NotNull List<IInventorySlot> toAdd, List<ItemStack> rejects) { if (orig.size() != toAdd.size()) { throw new IllegalArgumentException("Mismatched slot count"); } for (int i = 0; i < toAdd.size(); i++) { IInventorySlot toAddSlot = toAdd.get(i); if (!toAddSlot.isEmpty()) { IInventorySlot origSlot = orig.get(i); ItemStack toAddStack = toAddSlot.getStack(); if (origSlot.isEmpty()) { int max = origSlot.getLimit(toAddStack); if (toAddStack.getCount() <= max) { origSlot.setStack(toAddStack); } else { origSlot.setStack(size(toAddStack, max)); //Add any remainder to the rejects (if this is zero this will no-op addStack(rejects, size(toAddStack, toAddStack.getCount() - max)); } } else if (ItemHandlerHelper.canItemStacksStack(origSlot.getStack(), toAddStack)) { int added = origSlot.growStack(toAddStack.getCount(), Action.EXECUTE); //Add any remainder to the rejects (if this is zero this will no-op addStack(rejects, size(toAddStack, toAddStack.getCount() - added)); } else { addStack(rejects, toAddStack.copy()); } } } } /** * @implNote Assumes the passed in stack and stacks in the list can be safely modified. */ private static void addStack(List<ItemStack> stacks, ItemStack stack) { if (!stack.isEmpty()) { for (ItemStack existingStack : stacks) { int needed = existingStack.getMaxStackSize() - existingStack.getCount(); if (needed > 0 && ItemHandlerHelper.canItemStacksStack(existingStack, stack)) { //This stack needs some items and can stack with the one we are adding int toAdd = Math.min(needed, stack.getCount()); //Add the amount we can existingStack.grow(toAdd); stack.shrink(toAdd); //And break out of checking as even if we have any remaining it won't be able to stack with later things // as they will have a different type or this existing stack would have already been full break; } } if (!stack.isEmpty()) { //If we have any we weren't able to add to existing stacks, we need to go ahead and add it as new stacks // making sure to split it if it is an oversized stack int count = stack.getCount(); int max = stack.getMaxStackSize(); if (count > max) { //If we have more than a stack of the item stack counts, int excess = count % max; int stacksToAdd = count / max; if (excess > 0) { // start by adding any excess that won't go into full stack sizes (so that we have a lower index // and have less to iterate when adding more of the same type) stacks.add(size(stack, excess)); } // and then add as many max size stacks as needed ItemStack maxSize = size(stack, max); stacks.add(maxSize); for (int i = 1; i < stacksToAdd; i++) { stacks.add(maxSize.copy()); } } else { //Valid stack, just add it directly stacks.add(stack); } } } } //Assumes that the stacks are already private static List<ItemStack> flatten(List<ItemStack> stacks) { if (stacks.isEmpty()) { return Collections.emptyList(); } List<ItemStack> compacted = new ArrayList<>(); for (ItemStack stack : stacks) { if (!stack.isEmpty()) { int count = stack.getCount(); int max = stack.getMaxStackSize(); //TODO: Fix comments if (count > max) { //If we have more than a stack of the item (such as we are a bin) or some other thing that allows for compressing // stack counts, drop as many stacks as we need at their max size while (count > max) { compacted.add(size(stack, max)); count -= max; } if (count > 0) { //If we have anything left to drop afterward, do so compacted.add(size(stack, count)); } } else { //If we have a valid stack, we can just directly drop that instead without requiring any copies // as while IInventorySlot#getStack says to not mutate the stack, our slot is a dummy slot compacted.add(stack); } } } for (int i = 0; i < stacks.size(); i++) { ItemStack s = stacks.get(i); if (!s.isEmpty()) { for (int j = i + 1; j < stacks.size(); j++) { ItemStack s1 = stacks.get(j); if (ItemHandlerHelper.canItemStacksStack(s, s1)) { s.grow(s1.getCount()); stacks.set(j, ItemStack.EMPTY); } } } } return compacted; } /** * Get state for placement for a generic item, with our fake player * * @param stack the item to place * @param pos where * @param player our fake player, usually * * @return the result of {@link Block#getStateForPlacement(BlockPlaceContext)}, or null if it cannot be placed in that location */ @Nullable public static BlockState getStateForPlacement(ItemStack stack, BlockPos pos, Player player) { return Block.byItem(stack.getItem()).getStateForPlacement(new BlockPlaceContext(new UseOnContext(player, InteractionHand.MAIN_HAND, new BlockHitResult(Vec3.ZERO, Direction.UP, pos, false)))); } }
7,850
0.554904
0.553248
176
43.607956
31.893284
139
false
false
0
0
0
0
0
0
0.653409
false
false
13
5da5c1475cc8b645b573688f61053fdd6d62fc04
11,647,951,308,401
238a043a69d97d797e6939b88d64502f60deb102
/recorder/app/src/main/java/com/example/shikharjai/recorder/recorder1.java
87e46a24b952c4537a515f7129dcf7e19c21df68
[]
no_license
uc-sja/LearnCodeOnline
https://github.com/uc-sja/LearnCodeOnline
882b2311fd64b4663eaa012e67de28b10e105d48
8cde6e8dd51817dd9d61d5b1bd73a0fe90062eef
refs/heads/master
2020-03-28T12:08:16.793000
2019-02-28T03:31:38
2019-02-28T03:31:38
148,272,143
0
1
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.example.shikharjai.recorder; import android.Manifest; import android.content.Context; import android.content.pm.PackageManager; import android.media.MediaPlayer; import android.media.MediaRecorder; import android.os.Build; import android.os.Bundle; import android.os.Environment; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.v4.app.ActivityCompat; import android.support.v4.app.Fragment; import android.support.v4.content.ContextCompat; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Button; import android.widget.Toast; import java.io.File; import java.io.IOException; import java.util.UUID; public class recorder1 extends Fragment { Button rec, play, pause, stop; String path=""; boolean isPaused=false; MediaRecorder mediaRecorder; MediaPlayer mp; int length; public static recorder1 getInstance(){ recorder1 fragment = new recorder1(); return fragment; } @Override public void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); } @Nullable @Override public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { View v = inflater.inflate(R.layout.recorder1, container, false); rec = v.findViewById(R.id.rec); pause = v.findViewById(R.id.pause); play = v.findViewById(R.id.play); stop = v.findViewById(R.id.stop); return v; } @Override public void onActivityCreated(@Nullable final Bundle savedInstanceState) { final File dir = new File(Environment.getExternalStorageDirectory(), "/njaudio/"); if((!dir.exists())) { dir.mkdir(); } mp = new MediaPlayer(); rec.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Toast.makeText(getContext(), "Now Recording",Toast.LENGTH_SHORT).show(); path = dir.getAbsolutePath()+"/"+ UUID.randomUUID()+".mp3"; RecorderSetup(path); try { mediaRecorder.prepare(); play.setEnabled(false); v.setEnabled(false); stop.setEnabled(true); } catch (IOException e) { e.printStackTrace(); } mediaRecorder.start(); } }); play.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { rec.setEnabled(false); File[] filelist = dir.listFiles(); String last_file_path = filelist[filelist.length - 1].getAbsolutePath(); Log.d("ddd"+mp, ""+(mp.getCurrentPosition())); if(!isPaused){ try { mp.stop(); mp.reset(); mp.setDataSource(last_file_path); mp.prepare(); mp.start(); pause.setEnabled(true); Toast.makeText(getContext(),"Playing", Toast.LENGTH_SHORT).show(); } catch (IOException e){ e.printStackTrace(); }} else { mp.seekTo(length); mp.start(); pause.setEnabled(true); isPaused = false; Toast.makeText(getContext(),"Resuming"+length, Toast.LENGTH_SHORT).show(); } mp.setOnCompletionListener(new MediaPlayer.OnCompletionListener() { @Override public void onCompletion(MediaPlayer mp) { rec.setEnabled(true); } }); } }); pause.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if(mp.isPlaying()){ if(mp != null){ mp.pause(); isPaused = true; v.setEnabled(false); rec.setEnabled(true); length = mp.getCurrentPosition(); Toast.makeText(getContext(), "Pausedaaaa"+length, Toast.LENGTH_SHORT).show(); } } else { Toast.makeText(getContext(), "Currently Not Playing", Toast.LENGTH_SHORT).show(); } } }); stop.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if(mediaRecorder != null){ mediaRecorder.stop(); mediaRecorder.release(); v.setEnabled(false); play.setEnabled(true); rec.setEnabled(true); isPaused = false; Toast.makeText(getContext(), "Recording Stopped", Toast.LENGTH_SHORT).show(); } } }); super.onActivityCreated(savedInstanceState); } public void RecorderSetup(String p){ mediaRecorder = new MediaRecorder(); mediaRecorder.setAudioSource(MediaRecorder.AudioSource.MIC); mediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP); mediaRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB); mediaRecorder.setOutputFile(p); } }
UTF-8
Java
5,751
java
recorder1.java
Java
[]
null
[]
package com.example.shikharjai.recorder; import android.Manifest; import android.content.Context; import android.content.pm.PackageManager; import android.media.MediaPlayer; import android.media.MediaRecorder; import android.os.Build; import android.os.Bundle; import android.os.Environment; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.v4.app.ActivityCompat; import android.support.v4.app.Fragment; import android.support.v4.content.ContextCompat; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Button; import android.widget.Toast; import java.io.File; import java.io.IOException; import java.util.UUID; public class recorder1 extends Fragment { Button rec, play, pause, stop; String path=""; boolean isPaused=false; MediaRecorder mediaRecorder; MediaPlayer mp; int length; public static recorder1 getInstance(){ recorder1 fragment = new recorder1(); return fragment; } @Override public void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); } @Nullable @Override public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { View v = inflater.inflate(R.layout.recorder1, container, false); rec = v.findViewById(R.id.rec); pause = v.findViewById(R.id.pause); play = v.findViewById(R.id.play); stop = v.findViewById(R.id.stop); return v; } @Override public void onActivityCreated(@Nullable final Bundle savedInstanceState) { final File dir = new File(Environment.getExternalStorageDirectory(), "/njaudio/"); if((!dir.exists())) { dir.mkdir(); } mp = new MediaPlayer(); rec.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Toast.makeText(getContext(), "Now Recording",Toast.LENGTH_SHORT).show(); path = dir.getAbsolutePath()+"/"+ UUID.randomUUID()+".mp3"; RecorderSetup(path); try { mediaRecorder.prepare(); play.setEnabled(false); v.setEnabled(false); stop.setEnabled(true); } catch (IOException e) { e.printStackTrace(); } mediaRecorder.start(); } }); play.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { rec.setEnabled(false); File[] filelist = dir.listFiles(); String last_file_path = filelist[filelist.length - 1].getAbsolutePath(); Log.d("ddd"+mp, ""+(mp.getCurrentPosition())); if(!isPaused){ try { mp.stop(); mp.reset(); mp.setDataSource(last_file_path); mp.prepare(); mp.start(); pause.setEnabled(true); Toast.makeText(getContext(),"Playing", Toast.LENGTH_SHORT).show(); } catch (IOException e){ e.printStackTrace(); }} else { mp.seekTo(length); mp.start(); pause.setEnabled(true); isPaused = false; Toast.makeText(getContext(),"Resuming"+length, Toast.LENGTH_SHORT).show(); } mp.setOnCompletionListener(new MediaPlayer.OnCompletionListener() { @Override public void onCompletion(MediaPlayer mp) { rec.setEnabled(true); } }); } }); pause.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if(mp.isPlaying()){ if(mp != null){ mp.pause(); isPaused = true; v.setEnabled(false); rec.setEnabled(true); length = mp.getCurrentPosition(); Toast.makeText(getContext(), "Pausedaaaa"+length, Toast.LENGTH_SHORT).show(); } } else { Toast.makeText(getContext(), "Currently Not Playing", Toast.LENGTH_SHORT).show(); } } }); stop.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if(mediaRecorder != null){ mediaRecorder.stop(); mediaRecorder.release(); v.setEnabled(false); play.setEnabled(true); rec.setEnabled(true); isPaused = false; Toast.makeText(getContext(), "Recording Stopped", Toast.LENGTH_SHORT).show(); } } }); super.onActivityCreated(savedInstanceState); } public void RecorderSetup(String p){ mediaRecorder = new MediaRecorder(); mediaRecorder.setAudioSource(MediaRecorder.AudioSource.MIC); mediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP); mediaRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB); mediaRecorder.setOutputFile(p); } }
5,751
0.548426
0.546688
165
33.854546
24.383615
132
false
false
0
0
0
0
0
0
0.690909
false
false
13
efcdf57ca06f4d35851236f13c782912aa7b2d95
4,681,514,360,146
7ffc711a5717c39c0579a4c3362ebed0f5d6815f
/src/Task.java
4088cb7839bec981700191a13dc6b511d235fc0a
[]
no_license
JayDosunmu/GreedyTask
https://github.com/JayDosunmu/GreedyTask
7f67156f837240fb7e518c2967099001a33fbe3d
eb299b8d0e5cde52dff7512494af7d928e192441
refs/heads/master
2017-05-23T08:47:34.582000
2015-10-20T03:03:35
2015-10-20T03:03:35
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
public class Task { private String keyword; private String description; private int minsToComplete; private int priority; public Task(){ keyword = ""; description = ""; minsToComplete = 0; priority = 0; } public Task(String keyword, String description, int minsToComplete, int priority){ this.keyword = keyword; this.description = description; this.minsToComplete = minsToComplete; this.priority = priority; } public Task(Task o){ this.keyword = o.getKeyword(); this.description = o.getDescription(); this.minsToComplete = o.getMinsToComplete(); this.priority = o.getPriority(); } public int compareTo(Task o) { int priority = getPriority()-o.getPriority(); if(priority==0){ return getMinsToComplete()-o.getMinsToComplete(); } return priority; } public boolean equals(Task o){ return getKeyword().equals(o.getKeyword()) && getDescription().equals(o.getDescription()) && getMinsToComplete() == o.getMinsToComplete() && getPriority() == o.getPriority(); } public String getKeyword() { return keyword; } public String getDescription() { return description; } public int getMinsToComplete() { return minsToComplete; } public int getPriority() { return priority; } public void setKeyword(String keyword) { this.keyword = keyword; } public void setDescription(String description) { this.description = description; } public void setMinsToComplete(int minsToComplete) { this.minsToComplete = minsToComplete; } public void setPriority(int priority) { this.priority = priority; } }
UTF-8
Java
1,581
java
Task.java
Java
[]
null
[]
public class Task { private String keyword; private String description; private int minsToComplete; private int priority; public Task(){ keyword = ""; description = ""; minsToComplete = 0; priority = 0; } public Task(String keyword, String description, int minsToComplete, int priority){ this.keyword = keyword; this.description = description; this.minsToComplete = minsToComplete; this.priority = priority; } public Task(Task o){ this.keyword = o.getKeyword(); this.description = o.getDescription(); this.minsToComplete = o.getMinsToComplete(); this.priority = o.getPriority(); } public int compareTo(Task o) { int priority = getPriority()-o.getPriority(); if(priority==0){ return getMinsToComplete()-o.getMinsToComplete(); } return priority; } public boolean equals(Task o){ return getKeyword().equals(o.getKeyword()) && getDescription().equals(o.getDescription()) && getMinsToComplete() == o.getMinsToComplete() && getPriority() == o.getPriority(); } public String getKeyword() { return keyword; } public String getDescription() { return description; } public int getMinsToComplete() { return minsToComplete; } public int getPriority() { return priority; } public void setKeyword(String keyword) { this.keyword = keyword; } public void setDescription(String description) { this.description = description; } public void setMinsToComplete(int minsToComplete) { this.minsToComplete = minsToComplete; } public void setPriority(int priority) { this.priority = priority; } }
1,581
0.709045
0.707147
74
20.351351
20.90741
94
false
false
0
0
0
0
0
0
1.675676
false
false
13
f2ab16d16ca8f2b9ba9bfa7a01f860cf9dd88aa6
4,810,363,414,307
86c759b0294b1f4952a2b235e670e6e614102727
/MusicPlayer v3/src/application/FXMLController.java
cb853743bc2989c6b2d309d3e33db91b55686ae8
[]
no_license
ducthinhle92/MusicPlayer-Java-Samsung-2014
https://github.com/ducthinhle92/MusicPlayer-Java-Samsung-2014
c8562af527bdf691846434cd22224676bcf144c6
35ed6bfe0ff6d3f0674ff553eda8da08a34d0d72
refs/heads/master
2020-05-18T15:18:03.658000
2014-12-16T08:10:19
2014-12-16T08:10:19
24,712,490
1
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package application; import java.io.IOException; import java.net.URISyntaxException; import java.sql.SQLException; import java.util.ArrayList; import java.util.List; import javafx.collections.FXCollections; import javafx.collections.ObservableList; import javafx.event.ActionEvent; import javafx.event.EventHandler; import javafx.fxml.FXML; import javafx.fxml.FXMLLoader; import javafx.scene.Parent; import javafx.scene.control.Button; import javafx.scene.control.Label; import javafx.scene.control.ListView; import javafx.scene.control.Slider; import javafx.scene.control.TextField; import javafx.scene.layout.Pane; import javafx.scene.layout.StackPane; import javafx.scene.layout.VBox; import javafx.stage.Stage; import javafx.stage.WindowEvent; import model.MediaFile; import model.MediaInfo; import model.PlayList; import application.config.Config; import application.controller.LibraryScreen; import application.controller.PlayScreen; import application.resource.R; import application.view.listener.MediaListener; public class FXMLController { public static final int PLAY_SCREEN = 0; public static final int LIBRARY_SCREEN = 1; private static FXMLController instance = null; private StackPane bodyPane; private Parent libraryPane; private Parent playPane; private PlayScreen playScreen; private LibraryScreen libraryScreen; private Stage stage; private int currentScreen = LIBRARY_SCREEN; ObservableList<PlayList> items2 = FXCollections.observableArrayList(); ObservableList<MediaInfo> mediaFiles = FXCollections.observableArrayList(); // FXML components @FXML public ListView<String> listFile; @FXML public Label fileDetail; @FXML public Button play, prev, next, btn_saveList, btn_clearList, btnChangeScene,mute,stop; @FXML public TextField txtPlaylistName; @FXML public Slider volumeSlider, timeSlider; @FXML public Label playTime, lbInfo; @FXML public StackPane nowPlayingPane; @FXML public VBox mainBackground; @FXML public Pane controlPane; final ObservableList<Integer> ratingSample = FXCollections .observableArrayList(1, 2, 3, 4, 5); private ArrayList<MediaListener> mediaListeners; /** * Initializes the controller class. This method is automatically called * after the fxml file has been loaded. * * @throws SQLException * @throws ClassNotFoundException */ @FXML private void initialize() throws ClassNotFoundException, SQLException { instance = this; mediaListeners = new ArrayList<MediaListener>(); } @FXML protected void openFile(ActionEvent event) throws ClassNotFoundException, SQLException { try { libraryScreen.processOpenFile(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } @FXML protected void onChangeScene(ActionEvent event) { if(currentScreen == LIBRARY_SCREEN) { setScreen(PLAY_SCREEN); } else { setScreen(LIBRARY_SCREEN); } } @FXML protected void btnPlay(ActionEvent event) { libraryScreen.onClickPlay(); } @FXML protected void btnNext(ActionEvent event) { libraryScreen.onClickNext(); } @FXML protected void btnPrev(ActionEvent event) { libraryScreen.onClickPrev(); } @FXML protected void btnStop(ActionEvent event) { libraryScreen.onClickStop(); } @FXML protected void btnMute(ActionEvent event) { libraryScreen.onClickMute(); } @FXML protected void onSaveList(ActionEvent event) throws ClassNotFoundException, SQLException { try { libraryScreen.onSaveList(); } catch (URISyntaxException e) { // TODO Auto-generated catch block e.printStackTrace(); } } @FXML protected void onClearList(ActionEvent event) { libraryScreen.onClearList(); } @FXML protected void onExit() { Config.getInstance().dispose(); } public void processOpenList(List<MediaInfo> playlist) { libraryScreen.processOpenPlayList(playlist); } public void setStage(Stage primaryStage) { stage = primaryStage; stage.setOnCloseRequest(new EventHandler<WindowEvent>() { @Override public void handle(WindowEvent event) { onExit(); } }); } public void manageLayout() { try { bodyPane = (StackPane) stage.getScene().lookup("#bodyPane"); libraryPane = (Parent) stage.getScene().lookup("#libraryPane"); FXMLLoader loader = new FXMLLoader(R.getLayoutFXML("PlayPane")); playPane = (Parent) loader.load(); playScreen = new PlayScreen(stage); libraryScreen = new LibraryScreen(stage); // default screen is library setScreen(LIBRARY_SCREEN); } catch (IOException e) { e.printStackTrace(); } } public void setScreen(int screenId) { if(screenId == PLAY_SCREEN) { bodyPane.getChildren().clear(); bodyPane.getChildren().add(playPane); currentScreen = PLAY_SCREEN; playScreen.start(); } else if(screenId == LIBRARY_SCREEN) { bodyPane.getChildren().clear(); bodyPane.getChildren().add(libraryPane); currentScreen = LIBRARY_SCREEN; libraryScreen.start(); } } public int getCurrentScreen() { return currentScreen; } public static FXMLController getInstance() { return instance; } public LibraryScreen getLibraryScreen(){ return libraryScreen; } public MediaFile getCurrentMedia() { return libraryScreen.getCurrentMedia(); } public void onMediaChanged() { for(MediaListener ml : mediaListeners) { ml.onMediaChanged(); } } public void addMediaListener(MediaListener listener) { mediaListeners.add(listener); } }
UTF-8
Java
5,456
java
FXMLController.java
Java
[]
null
[]
package application; import java.io.IOException; import java.net.URISyntaxException; import java.sql.SQLException; import java.util.ArrayList; import java.util.List; import javafx.collections.FXCollections; import javafx.collections.ObservableList; import javafx.event.ActionEvent; import javafx.event.EventHandler; import javafx.fxml.FXML; import javafx.fxml.FXMLLoader; import javafx.scene.Parent; import javafx.scene.control.Button; import javafx.scene.control.Label; import javafx.scene.control.ListView; import javafx.scene.control.Slider; import javafx.scene.control.TextField; import javafx.scene.layout.Pane; import javafx.scene.layout.StackPane; import javafx.scene.layout.VBox; import javafx.stage.Stage; import javafx.stage.WindowEvent; import model.MediaFile; import model.MediaInfo; import model.PlayList; import application.config.Config; import application.controller.LibraryScreen; import application.controller.PlayScreen; import application.resource.R; import application.view.listener.MediaListener; public class FXMLController { public static final int PLAY_SCREEN = 0; public static final int LIBRARY_SCREEN = 1; private static FXMLController instance = null; private StackPane bodyPane; private Parent libraryPane; private Parent playPane; private PlayScreen playScreen; private LibraryScreen libraryScreen; private Stage stage; private int currentScreen = LIBRARY_SCREEN; ObservableList<PlayList> items2 = FXCollections.observableArrayList(); ObservableList<MediaInfo> mediaFiles = FXCollections.observableArrayList(); // FXML components @FXML public ListView<String> listFile; @FXML public Label fileDetail; @FXML public Button play, prev, next, btn_saveList, btn_clearList, btnChangeScene,mute,stop; @FXML public TextField txtPlaylistName; @FXML public Slider volumeSlider, timeSlider; @FXML public Label playTime, lbInfo; @FXML public StackPane nowPlayingPane; @FXML public VBox mainBackground; @FXML public Pane controlPane; final ObservableList<Integer> ratingSample = FXCollections .observableArrayList(1, 2, 3, 4, 5); private ArrayList<MediaListener> mediaListeners; /** * Initializes the controller class. This method is automatically called * after the fxml file has been loaded. * * @throws SQLException * @throws ClassNotFoundException */ @FXML private void initialize() throws ClassNotFoundException, SQLException { instance = this; mediaListeners = new ArrayList<MediaListener>(); } @FXML protected void openFile(ActionEvent event) throws ClassNotFoundException, SQLException { try { libraryScreen.processOpenFile(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } @FXML protected void onChangeScene(ActionEvent event) { if(currentScreen == LIBRARY_SCREEN) { setScreen(PLAY_SCREEN); } else { setScreen(LIBRARY_SCREEN); } } @FXML protected void btnPlay(ActionEvent event) { libraryScreen.onClickPlay(); } @FXML protected void btnNext(ActionEvent event) { libraryScreen.onClickNext(); } @FXML protected void btnPrev(ActionEvent event) { libraryScreen.onClickPrev(); } @FXML protected void btnStop(ActionEvent event) { libraryScreen.onClickStop(); } @FXML protected void btnMute(ActionEvent event) { libraryScreen.onClickMute(); } @FXML protected void onSaveList(ActionEvent event) throws ClassNotFoundException, SQLException { try { libraryScreen.onSaveList(); } catch (URISyntaxException e) { // TODO Auto-generated catch block e.printStackTrace(); } } @FXML protected void onClearList(ActionEvent event) { libraryScreen.onClearList(); } @FXML protected void onExit() { Config.getInstance().dispose(); } public void processOpenList(List<MediaInfo> playlist) { libraryScreen.processOpenPlayList(playlist); } public void setStage(Stage primaryStage) { stage = primaryStage; stage.setOnCloseRequest(new EventHandler<WindowEvent>() { @Override public void handle(WindowEvent event) { onExit(); } }); } public void manageLayout() { try { bodyPane = (StackPane) stage.getScene().lookup("#bodyPane"); libraryPane = (Parent) stage.getScene().lookup("#libraryPane"); FXMLLoader loader = new FXMLLoader(R.getLayoutFXML("PlayPane")); playPane = (Parent) loader.load(); playScreen = new PlayScreen(stage); libraryScreen = new LibraryScreen(stage); // default screen is library setScreen(LIBRARY_SCREEN); } catch (IOException e) { e.printStackTrace(); } } public void setScreen(int screenId) { if(screenId == PLAY_SCREEN) { bodyPane.getChildren().clear(); bodyPane.getChildren().add(playPane); currentScreen = PLAY_SCREEN; playScreen.start(); } else if(screenId == LIBRARY_SCREEN) { bodyPane.getChildren().clear(); bodyPane.getChildren().add(libraryPane); currentScreen = LIBRARY_SCREEN; libraryScreen.start(); } } public int getCurrentScreen() { return currentScreen; } public static FXMLController getInstance() { return instance; } public LibraryScreen getLibraryScreen(){ return libraryScreen; } public MediaFile getCurrentMedia() { return libraryScreen.getCurrentMedia(); } public void onMediaChanged() { for(MediaListener ml : mediaListeners) { ml.onMediaChanged(); } } public void addMediaListener(MediaListener listener) { mediaListeners.add(listener); } }
5,456
0.748717
0.747251
229
22.825327
19.670763
87
false
false
0
0
0
0
0
0
1.764192
false
false
13
0d5432df475123a799ee25824a3ccc2793a8e623
24,704,651,897,203
69595e0a89f66fd0fb869b08907da6631eb5d623
/src/dungeonGamePackage/Projectile.java
eaa9148b935954e73418d5aa4e0a857072f7a5da
[]
no_license
asger1537/DD-Projekt-Uge
https://github.com/asger1537/DD-Projekt-Uge
1bc687e3ba047a0dfe6bd871f0e2c24e0b13f2ff
07033b445b018375f18cd0aacfef9f20c9a5d718
refs/heads/master
2020-07-26T20:11:54.622000
2019-10-10T11:21:55
2019-10-10T11:21:55
208,754,169
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package dungeonGamePackage; import static dungeonGamePackage.DungeonGame.DG; import processing.core.PVector; class Projectile { PVector position; PVector velocity; int dmg; String[] canHit; float radius; int color; boolean hit; Projectile(PVector position, PVector velocity, int dmg, String[] canHit, float radius, int color) { this.position = position; this.velocity = velocity; this.dmg = dmg; this.canHit = canHit; this.radius = radius; this.color = color; } void update() { move(); checkEdgeCollision(); checkUnitCollision(); display(); } void move() { position.add(velocity); } void checkUnitCollision() { if (Utility.contains(canHit, "Enemy")) { for (int i = 0; i < DG.zone.enemies.size(); i++) { Enemy e = DG.zone.enemies.get(i); if (PVector.dist(position, e.position) < radius + e.radius) { onEnemyCollision(e); break; } } } if (Utility.contains(canHit, "Player")) { if (PVector.dist(position, DG.p.position) < radius + DG.p.radius) { onPlayerCollision(); } } } void onEnemyCollision(Enemy e) { e.takeDamage(dmg); hit = true; e.hit = true; } void onPlayerCollision() { DG.p.takeDamage(dmg); hit = true; } void checkEdgeCollision() { if (position.x + radius >= DG.zone.width || position.x - radius <= 0 || position.y + radius >= DG.zone.height || position.y - radius <= 0) { onEdgeCollision(); } } void onEdgeCollision() { hit = true; } void display() { // draws and colors the projectile DG.fill(color); Utility.circle(position, radius); } }
UTF-8
Java
1,936
java
Projectile.java
Java
[]
null
[]
package dungeonGamePackage; import static dungeonGamePackage.DungeonGame.DG; import processing.core.PVector; class Projectile { PVector position; PVector velocity; int dmg; String[] canHit; float radius; int color; boolean hit; Projectile(PVector position, PVector velocity, int dmg, String[] canHit, float radius, int color) { this.position = position; this.velocity = velocity; this.dmg = dmg; this.canHit = canHit; this.radius = radius; this.color = color; } void update() { move(); checkEdgeCollision(); checkUnitCollision(); display(); } void move() { position.add(velocity); } void checkUnitCollision() { if (Utility.contains(canHit, "Enemy")) { for (int i = 0; i < DG.zone.enemies.size(); i++) { Enemy e = DG.zone.enemies.get(i); if (PVector.dist(position, e.position) < radius + e.radius) { onEnemyCollision(e); break; } } } if (Utility.contains(canHit, "Player")) { if (PVector.dist(position, DG.p.position) < radius + DG.p.radius) { onPlayerCollision(); } } } void onEnemyCollision(Enemy e) { e.takeDamage(dmg); hit = true; e.hit = true; } void onPlayerCollision() { DG.p.takeDamage(dmg); hit = true; } void checkEdgeCollision() { if (position.x + radius >= DG.zone.width || position.x - radius <= 0 || position.y + radius >= DG.zone.height || position.y - radius <= 0) { onEdgeCollision(); } } void onEdgeCollision() { hit = true; } void display() { // draws and colors the projectile DG.fill(color); Utility.circle(position, radius); } }
1,936
0.530475
0.528926
81
22.901234
23.955002
148
false
false
0
0
0
0
0
0
0.641975
false
false
13
c88df19158b044a04685691d2660b30258449358
3,917,010,183,653
4f9b99eb2f60acf5031e32816ffe127bb80cd348
/HMAgent/src/com/cdv/service/ClipService.java
1a34d87c08e970e9f24bad0e3cabf4ef01a54818
[]
no_license
liangguang/HM
https://github.com/liangguang/HM
4fee43919feebf7450c6ef5af0686d14008b04ed
0f3f34d0a6cc42e01328b4318f93f588fab894d6
refs/heads/master
2016-08-09T23:29:19.677000
2015-11-13T09:17:50
2015-11-13T09:17:50
45,896,337
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.cdv.service; import java.util.HashMap; import java.util.Map; import org.dom4j.Document; import org.dom4j.DocumentException; import org.dom4j.Element; 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.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.StringUtils; import com.cdv.db.mapper.ClipMapper; import com.cdv.model.Clip; import com.cdv.model.ClipUserInfo; import com.cdv.model.ProduceTask; import com.cdv.model.Title; import com.cdv.utils.XmlUtil; @Service public class ClipService { private final Logger logger = LoggerFactory.getLogger(getClass()); @Autowired private ClipMapper clipmapper; @Value("${web.cms.exportClipurl}") private String cmsweburl; @Transactional("transactionManager") public Clip getClipBymmid(long mmobjectid) { return clipmapper.getClipByMMid(mmobjectid); } @Transactional("transactionManager") public int insertClipUserInfo(ClipUserInfo clipinfo) { return clipmapper.insertClipUserInfo(clipinfo); } @Transactional("transactionManager") public int updateMMObjectidByClipid(long mmobjectid, long clipid) { Map<String,Long> map = new HashMap<String,Long>(); map.put("mmobjectid", mmobjectid); map.put("clipid", clipid); return clipmapper.updateMMObjectidByClipid(map); } @Transactional("transactionManager") public Clip getClipByclipID(long clipid) { return clipmapper.getClipByclipID(clipid); } /** * 用backid 记录是value审核通过后素材归档媒资的,还是在媒体中心点击归档媒资的,以此来判断是否需要在归档后再次将媒资的id传给ivalue * @param clipid * @return */ @Transactional("transactionManager") public int updateBakcIDByclipID(long clipid){ return clipmapper.updateBakcIDByclipID(clipid); } @Transactional("transactionManager") public Title getTitleByClipID(long clipid) { return clipmapper.getTitleByClipID(clipid); } /** * ivalue下发制作任务的任务id保存在titles表的stringner中,在归档到媒资后, * 需要在给ivalue提交一次媒资内部的mmobjectid,用来他们绑定他们的素材可以预览用 * * @param clipid * @return */ @Transactional("transactionManager") public ProduceTask getProidByClipid(long clipid) { return clipmapper.getProidByClipid(clipid); } public String getClipPath(String extendinfo) { try { if (StringUtils.isEmpty(extendinfo)) { return ""; } Document infoDoc = XmlUtil.loadXMLFile(extendinfo); Element cfileEle = (Element) infoDoc .selectSingleNode("//Auto.NET/ClipMeta/Files[@caption='编辑码流文件列表']"); if (cfileEle != null) { Element fileEle = cfileEle.element("File"); return fileEle == null ? "" : XmlUtil .getAutonetClipName(fileEle.attributeValue("filename")); } else { return ""; } } catch (Throwable e) { logger.debug("解析制作网中clip表中的meta文件出错:" + e.getMessage()); logger.error("解析制作网中clip表中的meta文件出错:", e); return ""; } } public static void main(String[] args) throws DocumentException { Document doc = XmlUtil.loadXMLFile("D:\\stat\\导视-1_01.mta"); Element ele = (Element) doc .selectSingleNode("Auto.NET/ClipMeta/Files/File[@caption='编辑码流视频']"); System.out.println(ele.attributeValue("filename")); // Element rootEle = doc.getRootElement(); // Element ClipMetaEle = rootEle.element("ClipMeta"); // List<Element> FIlesEle = ClipMetaEle.elements(); // for(Element ele : FIlesEle){ // String cation = ele.attributeValue("caption"); // if(cation.equals("编辑码流文件列表")){ // List<Element> emelists = ele.elements(); // for(Element ii : emelists){ // System.out.println(ii.attributeValue("filename")); // } // } // } } }
UTF-8
Java
4,103
java
ClipService.java
Java
[]
null
[]
package com.cdv.service; import java.util.HashMap; import java.util.Map; import org.dom4j.Document; import org.dom4j.DocumentException; import org.dom4j.Element; 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.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.StringUtils; import com.cdv.db.mapper.ClipMapper; import com.cdv.model.Clip; import com.cdv.model.ClipUserInfo; import com.cdv.model.ProduceTask; import com.cdv.model.Title; import com.cdv.utils.XmlUtil; @Service public class ClipService { private final Logger logger = LoggerFactory.getLogger(getClass()); @Autowired private ClipMapper clipmapper; @Value("${web.cms.exportClipurl}") private String cmsweburl; @Transactional("transactionManager") public Clip getClipBymmid(long mmobjectid) { return clipmapper.getClipByMMid(mmobjectid); } @Transactional("transactionManager") public int insertClipUserInfo(ClipUserInfo clipinfo) { return clipmapper.insertClipUserInfo(clipinfo); } @Transactional("transactionManager") public int updateMMObjectidByClipid(long mmobjectid, long clipid) { Map<String,Long> map = new HashMap<String,Long>(); map.put("mmobjectid", mmobjectid); map.put("clipid", clipid); return clipmapper.updateMMObjectidByClipid(map); } @Transactional("transactionManager") public Clip getClipByclipID(long clipid) { return clipmapper.getClipByclipID(clipid); } /** * 用backid 记录是value审核通过后素材归档媒资的,还是在媒体中心点击归档媒资的,以此来判断是否需要在归档后再次将媒资的id传给ivalue * @param clipid * @return */ @Transactional("transactionManager") public int updateBakcIDByclipID(long clipid){ return clipmapper.updateBakcIDByclipID(clipid); } @Transactional("transactionManager") public Title getTitleByClipID(long clipid) { return clipmapper.getTitleByClipID(clipid); } /** * ivalue下发制作任务的任务id保存在titles表的stringner中,在归档到媒资后, * 需要在给ivalue提交一次媒资内部的mmobjectid,用来他们绑定他们的素材可以预览用 * * @param clipid * @return */ @Transactional("transactionManager") public ProduceTask getProidByClipid(long clipid) { return clipmapper.getProidByClipid(clipid); } public String getClipPath(String extendinfo) { try { if (StringUtils.isEmpty(extendinfo)) { return ""; } Document infoDoc = XmlUtil.loadXMLFile(extendinfo); Element cfileEle = (Element) infoDoc .selectSingleNode("//Auto.NET/ClipMeta/Files[@caption='编辑码流文件列表']"); if (cfileEle != null) { Element fileEle = cfileEle.element("File"); return fileEle == null ? "" : XmlUtil .getAutonetClipName(fileEle.attributeValue("filename")); } else { return ""; } } catch (Throwable e) { logger.debug("解析制作网中clip表中的meta文件出错:" + e.getMessage()); logger.error("解析制作网中clip表中的meta文件出错:", e); return ""; } } public static void main(String[] args) throws DocumentException { Document doc = XmlUtil.loadXMLFile("D:\\stat\\导视-1_01.mta"); Element ele = (Element) doc .selectSingleNode("Auto.NET/ClipMeta/Files/File[@caption='编辑码流视频']"); System.out.println(ele.attributeValue("filename")); // Element rootEle = doc.getRootElement(); // Element ClipMetaEle = rootEle.element("ClipMeta"); // List<Element> FIlesEle = ClipMetaEle.elements(); // for(Element ele : FIlesEle){ // String cation = ele.attributeValue("caption"); // if(cation.equals("编辑码流文件列表")){ // List<Element> emelists = ele.elements(); // for(Element ii : emelists){ // System.out.println(ii.attributeValue("filename")); // } // } // } } }
4,103
0.717489
0.715379
127
27.850393
22.03722
77
false
false
0
0
0
0
0
0
1.716535
false
false
13
5c52601a900a6c92ee9309bddc869713816ab7aa
26,963,804,727,750
958d30e5eea44fbb9744d0b18d77036d8c40e630
/app/src/main/java/com/pakos/lcw/SliderAdapter.java
d269b698540146135dbab3532aa19b4900e3647a
[]
no_license
Svestis/LCW
https://github.com/Svestis/LCW
6df5a1f692bfa535028231957e50f93f5d2b924c
a055e894c89f9ba41ddc772c1c9b6510a0ee6591
refs/heads/master
2022-03-18T00:41:10.103000
2022-02-26T21:33:02
2022-02-26T21:33:02
175,052,054
1
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.pakos.lcw; import android.content.Context; import android.support.annotation.NonNull; import android.support.v4.view.PagerAdapter; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.RelativeLayout; import android.widget.TextView; public class SliderAdapter extends PagerAdapter { private Context context; SliderAdapter(Context context){ this.context = context; } private int[] imgs = { R.drawable.shopping, R.drawable.optionset, R.drawable.start }; private String[] heading_txt = { "Welcome!", "Now what?", "How?" }; private String[] txt = { "\nThank you for purchasing Pectus\u2122,\nthe new generation wearable.\n\nLets get started!", "\nYou will just need to pair your device and you are all set!\n\nThe app will guide you through.", "Simply click next and explore the \u221e options!"}; @Override public int getCount() { return heading_txt.length; } @Override public boolean isViewFromObject(@NonNull View view, @NonNull Object o){ return view == o; } @NonNull @Override public Object instantiateItem(@NonNull ViewGroup container, int position){ LayoutInflater layoutInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); View view = layoutInflater.inflate(R.layout.activity_select_device_onboard_slide, container, false); ImageView imageView = view.findViewById(R.id.imageView); TextView heading = view.findViewById(R.id.header); TextView body = view.findViewById(R.id.main); imageView.setImageResource(imgs[position]); heading.setText(heading_txt[position]); body.setText(txt[position]); container.addView(view); return view; } @Override public void destroyItem(@NonNull ViewGroup container, int position, @NonNull Object object){ container.removeView((RelativeLayout)object); } }
UTF-8
Java
2,148
java
SliderAdapter.java
Java
[]
null
[]
package com.pakos.lcw; import android.content.Context; import android.support.annotation.NonNull; import android.support.v4.view.PagerAdapter; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.RelativeLayout; import android.widget.TextView; public class SliderAdapter extends PagerAdapter { private Context context; SliderAdapter(Context context){ this.context = context; } private int[] imgs = { R.drawable.shopping, R.drawable.optionset, R.drawable.start }; private String[] heading_txt = { "Welcome!", "Now what?", "How?" }; private String[] txt = { "\nThank you for purchasing Pectus\u2122,\nthe new generation wearable.\n\nLets get started!", "\nYou will just need to pair your device and you are all set!\n\nThe app will guide you through.", "Simply click next and explore the \u221e options!"}; @Override public int getCount() { return heading_txt.length; } @Override public boolean isViewFromObject(@NonNull View view, @NonNull Object o){ return view == o; } @NonNull @Override public Object instantiateItem(@NonNull ViewGroup container, int position){ LayoutInflater layoutInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); View view = layoutInflater.inflate(R.layout.activity_select_device_onboard_slide, container, false); ImageView imageView = view.findViewById(R.id.imageView); TextView heading = view.findViewById(R.id.header); TextView body = view.findViewById(R.id.main); imageView.setImageResource(imgs[position]); heading.setText(heading_txt[position]); body.setText(txt[position]); container.addView(view); return view; } @Override public void destroyItem(@NonNull ViewGroup container, int position, @NonNull Object object){ container.removeView((RelativeLayout)object); } }
2,148
0.672253
0.668529
72
28.833334
29.244183
115
false
false
0
0
0
0
0
0
0.569444
false
false
13
5797d50ed7d7a773928454184f0577e954d00b5e
22,488,448,779,077
978f6eb52601a2b5245146049437a0cb519685eb
/src/GUI/CrearEmpleado.java
8de02dda5d3444c21873c9badd36c4b7c0696931
[]
no_license
fabelio/SeguritaSA
https://github.com/fabelio/SeguritaSA
f3cf5e115a87a6d00458147457111f2aa40d418a
d4a8890e98488c05968e335a5e4fe3834105ca9a
refs/heads/master
2020-12-30T10:23:30.608000
2015-05-15T16:06:49
2015-05-15T16:06:49
35,683,371
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package GUI; import BaseHibernate.DaoHibernate; import BaseHibernate.DataAccessLayerException; import BaseHibernate.Parametro; import Entidades.Departamento; import Entidades.Pais; import Entidades.Tipopago; import java.util.ArrayList; import java.util.List; import javax.swing.JOptionPane; /** * * @author user */ public class CrearEmpleado extends javax.swing.JDialog { /** * Creates new form CrearEmpleado */ DaoHibernate conexion; public CrearEmpleado(java.awt.Frame parent, boolean modal, DaoHibernate conexion) { super(parent, modal); initComponents(); this.conexion = conexion; cargarDepartamento(); } /** * 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() { jPanel1 = new javax.swing.JPanel(); txtCodigo = new javax.swing.JTextField(); txtNombre = new javax.swing.JTextField(); jLabel2 = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); jLabel1 = new javax.swing.JLabel(); cbDepartamento = new javax.swing.JComboBox(); btncrearEmpleado = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Datos Empleado")); jLabel2.setText("Codigo:"); jLabel3.setText("Departamento"); jLabel1.setText("Nombre:"); cbDepartamento.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" })); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(txtNombre) .addComponent(txtCodigo) .addGroup(jPanel1Layout.createSequentialGroup() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel1) .addComponent(jLabel2) .addComponent(jLabel3)) .addGap(0, 0, Short.MAX_VALUE)) .addComponent(cbDepartamento, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap() .addComponent(jLabel1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(txtNombre, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(8, 8, 8) .addComponent(jLabel2) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(txtCodigo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel3) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(cbDepartamento, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(31, Short.MAX_VALUE)) ); btncrearEmpleado.setText("Guardar"); btncrearEmpleado.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btncrearEmpleadoActionPerformed(evt); } }); 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() .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addContainerGap()) .addGroup(layout.createSequentialGroup() .addGap(146, 146, 146) .addComponent(btncrearEmpleado) .addContainerGap(183, Short.MAX_VALUE)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(20, 20, 20) .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(btncrearEmpleado) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); pack(); }// </editor-fold>//GEN-END:initComponents private void btncrearEmpleadoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btncrearEmpleadoActionPerformed // TODO add your handling code here: guardar(); }//GEN-LAST:event_btncrearEmpleadoActionPerformed /** * ============================================================================= * =============================inicio * codigo==================================== * ============================================================================= * */ private void cargarDepartamento() { cbDepartamento.removeAllItems(); for (Object pais : conexion.findAll(Departamento.class)) { cbDepartamento.addItem(((Departamento) pais).getCodigo() + "-" + ((Departamento) pais).getNombre()); } } private void guardar() { try { if (beforeSave()) { //conexion.save(new Usuario(0, txtNombre.getText(), txtNombre.getText())); List<Parametro> lista = new ArrayList<Parametro>(); lista.add(new Parametro("nombre", txtNombre.getText())); lista.add(new Parametro("codigo", txtCodigo.getText())); lista.add(new Parametro("departamento", Integer.parseInt(((String) cbDepartamento.getSelectedItem()).split("-")[0]))); conexion.runSP("empleado_insert(:nombre,:departamento,:codigo)", Tipopago.class, lista); afterSave(); } } catch (DataAccessLayerException e) { JOptionPane.showMessageDialog(this, e.getCause().toString(), "Error al guardar usuario nuevo", JOptionPane.ERROR_MESSAGE); } } private void afterSave() { limpiar(); JOptionPane.showMessageDialog(this, "Empleado guardado", "Cliente guardado", JOptionPane.INFORMATION_MESSAGE); this.dispose(); } private boolean beforeSave() { if (txtNombre.getText().isEmpty() || txtCodigo.getText().isEmpty()) { JOptionPane.showMessageDialog(this, "Debe llenar todos los campos del formulario", "Llenar formulario", JOptionPane.INFORMATION_MESSAGE); return false; } return true; } private void limpiar() { this.txtNombre.setText(""); this.txtCodigo.setText(""); } /** * ============================================================================= * =============================final * codigo==================================== * ============================================================================= * */ // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton btncrearEmpleado; private javax.swing.JComboBox cbDepartamento; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; private javax.swing.JPanel jPanel1; private javax.swing.JTextField txtCodigo; private javax.swing.JTextField txtNombre; // End of variables declaration//GEN-END:variables }
UTF-8
Java
8,685
java
CrearEmpleado.java
Java
[ { "context": "import javax.swing.JOptionPane;\n\n/**\n *\n * @author user\n */\npublic class CrearEmpleado extends javax.swin", "end": 415, "score": 0.9992542862892151, "start": 411, "tag": "USERNAME", "value": "user" } ]
null
[]
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package GUI; import BaseHibernate.DaoHibernate; import BaseHibernate.DataAccessLayerException; import BaseHibernate.Parametro; import Entidades.Departamento; import Entidades.Pais; import Entidades.Tipopago; import java.util.ArrayList; import java.util.List; import javax.swing.JOptionPane; /** * * @author user */ public class CrearEmpleado extends javax.swing.JDialog { /** * Creates new form CrearEmpleado */ DaoHibernate conexion; public CrearEmpleado(java.awt.Frame parent, boolean modal, DaoHibernate conexion) { super(parent, modal); initComponents(); this.conexion = conexion; cargarDepartamento(); } /** * 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() { jPanel1 = new javax.swing.JPanel(); txtCodigo = new javax.swing.JTextField(); txtNombre = new javax.swing.JTextField(); jLabel2 = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); jLabel1 = new javax.swing.JLabel(); cbDepartamento = new javax.swing.JComboBox(); btncrearEmpleado = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Datos Empleado")); jLabel2.setText("Codigo:"); jLabel3.setText("Departamento"); jLabel1.setText("Nombre:"); cbDepartamento.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" })); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(txtNombre) .addComponent(txtCodigo) .addGroup(jPanel1Layout.createSequentialGroup() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel1) .addComponent(jLabel2) .addComponent(jLabel3)) .addGap(0, 0, Short.MAX_VALUE)) .addComponent(cbDepartamento, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap() .addComponent(jLabel1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(txtNombre, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(8, 8, 8) .addComponent(jLabel2) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(txtCodigo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel3) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(cbDepartamento, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(31, Short.MAX_VALUE)) ); btncrearEmpleado.setText("Guardar"); btncrearEmpleado.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btncrearEmpleadoActionPerformed(evt); } }); 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() .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addContainerGap()) .addGroup(layout.createSequentialGroup() .addGap(146, 146, 146) .addComponent(btncrearEmpleado) .addContainerGap(183, Short.MAX_VALUE)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(20, 20, 20) .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(btncrearEmpleado) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); pack(); }// </editor-fold>//GEN-END:initComponents private void btncrearEmpleadoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btncrearEmpleadoActionPerformed // TODO add your handling code here: guardar(); }//GEN-LAST:event_btncrearEmpleadoActionPerformed /** * ============================================================================= * =============================inicio * codigo==================================== * ============================================================================= * */ private void cargarDepartamento() { cbDepartamento.removeAllItems(); for (Object pais : conexion.findAll(Departamento.class)) { cbDepartamento.addItem(((Departamento) pais).getCodigo() + "-" + ((Departamento) pais).getNombre()); } } private void guardar() { try { if (beforeSave()) { //conexion.save(new Usuario(0, txtNombre.getText(), txtNombre.getText())); List<Parametro> lista = new ArrayList<Parametro>(); lista.add(new Parametro("nombre", txtNombre.getText())); lista.add(new Parametro("codigo", txtCodigo.getText())); lista.add(new Parametro("departamento", Integer.parseInt(((String) cbDepartamento.getSelectedItem()).split("-")[0]))); conexion.runSP("empleado_insert(:nombre,:departamento,:codigo)", Tipopago.class, lista); afterSave(); } } catch (DataAccessLayerException e) { JOptionPane.showMessageDialog(this, e.getCause().toString(), "Error al guardar usuario nuevo", JOptionPane.ERROR_MESSAGE); } } private void afterSave() { limpiar(); JOptionPane.showMessageDialog(this, "Empleado guardado", "Cliente guardado", JOptionPane.INFORMATION_MESSAGE); this.dispose(); } private boolean beforeSave() { if (txtNombre.getText().isEmpty() || txtCodigo.getText().isEmpty()) { JOptionPane.showMessageDialog(this, "Debe llenar todos los campos del formulario", "Llenar formulario", JOptionPane.INFORMATION_MESSAGE); return false; } return true; } private void limpiar() { this.txtNombre.setText(""); this.txtCodigo.setText(""); } /** * ============================================================================= * =============================final * codigo==================================== * ============================================================================= * */ // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton btncrearEmpleado; private javax.swing.JComboBox cbDepartamento; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; private javax.swing.JPanel jPanel1; private javax.swing.JTextField txtCodigo; private javax.swing.JTextField txtNombre; // End of variables declaration//GEN-END:variables }
8,685
0.618768
0.610823
201
42.208954
36.575638
163
false
false
0
0
0
0
78
0.035924
0.631841
false
false
13
fde4b29aa6bfca58c245dba77c304984102e2fdd
9,363,028,723,494
15b6656bf1c9c35ca5f503c4432bf56ac3f1f473
/mercado-livre/src/main/java/com/api/mercadolivre/controller/TransacaoController.java
192ecc4ac05a0f47030abdc4683432c74f8ca992
[ "Apache-2.0" ]
permissive
KelwinPF/orange-talents-03-template-ecommerce
https://github.com/KelwinPF/orange-talents-03-template-ecommerce
c70130ab4c249ff2f787a6b510fd72eb773e5893
67e27661a4981e53fad6f70d5c29fa2705264e88
refs/heads/main
2023-04-07T10:32:06.058000
2021-04-13T20:06:37
2021-04-13T20:06:37
350,825,208
0
0
Apache-2.0
true
2021-03-23T18:59:39
2021-03-23T18:59:39
2021-03-19T17:30:01
2021-03-15T20:26:56
4
0
0
0
null
false
false
package com.api.mercadolivre.controller; import java.util.Optional; import javax.validation.Valid; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.util.UriComponentsBuilder; import com.api.mercadolivre.dto.TransacaoDTO; import com.api.mercadolivre.entity.Compra; import com.api.mercadolivre.entity.Pergunta; import com.api.mercadolivre.entity.Transacao; import com.api.mercadolivre.repository.CompraRepository; import com.api.mercadolivre.repository.TransacaoRepository; import com.api.mercadolivre.util.EmailSender; import com.api.mercadolivre.util.Processa; import com.api.mercadolivre.util.TransacaoStatusEnum; @RestController @RequestMapping("/transacoes") public class TransacaoController { private CompraRepository compraRepository; private TransacaoRepository transacaoRepository; private EmailSender sender; private Processa processa; public TransacaoController(CompraRepository compraRepository,TransacaoRepository transacaoRepository, EmailSender sender,Processa processa) { this.transacaoRepository = transacaoRepository; this.compraRepository = compraRepository; this.sender = sender; this.processa = processa; } @PostMapping(value={"/retorno-pagseguro/{id}","/retorno-paypal/{id}"}) public ResponseEntity<?> cadastrar(@PathVariable(name="id",required =true) Long id ,@Valid @RequestBody TransacaoDTO dto, UriComponentsBuilder uri){ Optional<Compra> compra = compraRepository.findById(id); if(compra.isEmpty()) { return ResponseEntity.badRequest().build(); } Transacao transaction = transacaoRepository.save(dto.convert(compra.get())); processar(uri,transaction,compra.get()); return ResponseEntity.ok().build(); } public void processar(UriComponentsBuilder uri,Transacao transacao,Compra compra) { if(transacao.getStatus().equals(TransacaoStatusEnum.SUCESSO)) { transacao.getCompra().finalizacompra(compraRepository); processa.GerarNota(compra); processa.Ranking(compra); }; sendMail(transacao,transacao.getStatus(),uri); } private Boolean sendMail(Transacao transacao, TransacaoStatusEnum transacaoStatusEnum, UriComponentsBuilder uri) { if(transacao.getStatus().equals(TransacaoStatusEnum.SUCESSO)) { return sender.send("Caro Sr."+transacao.getCompra().getUsuario().getLogin()+", "+ "a sua transacao foi finalizada com sucesso: "+transacao.getCompra().getQuantidade().toString()+"" + " unidades do produto "+transacao.getCompra().getProduto().getNome()+ " pelo valor unitário de "+ transacao.getCompra().getValor_unitario().toString()); }else { return sender.send("Caro Sr."+transacao.getCompra().getUsuario().getLogin()+", "+ "a sua transacao Não foi concluida com sucesso, acesse o link para tentar novamente" +transacao.getCompra().getGateway().retorno(transacao.getCompra(),uri)); } } }
UTF-8
Java
3,170
java
TransacaoController.java
Java
[ { "context": "acaoStatusEnum.SUCESSO)) {\n\t\t\treturn sender.send(\"Caro Sr.\"+transacao.getCompra().getUsuario().getLogin(", "end": 2566, "score": 0.7596089839935303, "start": 2562, "tag": "NAME", "value": "Caro" } ]
null
[]
package com.api.mercadolivre.controller; import java.util.Optional; import javax.validation.Valid; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.util.UriComponentsBuilder; import com.api.mercadolivre.dto.TransacaoDTO; import com.api.mercadolivre.entity.Compra; import com.api.mercadolivre.entity.Pergunta; import com.api.mercadolivre.entity.Transacao; import com.api.mercadolivre.repository.CompraRepository; import com.api.mercadolivre.repository.TransacaoRepository; import com.api.mercadolivre.util.EmailSender; import com.api.mercadolivre.util.Processa; import com.api.mercadolivre.util.TransacaoStatusEnum; @RestController @RequestMapping("/transacoes") public class TransacaoController { private CompraRepository compraRepository; private TransacaoRepository transacaoRepository; private EmailSender sender; private Processa processa; public TransacaoController(CompraRepository compraRepository,TransacaoRepository transacaoRepository, EmailSender sender,Processa processa) { this.transacaoRepository = transacaoRepository; this.compraRepository = compraRepository; this.sender = sender; this.processa = processa; } @PostMapping(value={"/retorno-pagseguro/{id}","/retorno-paypal/{id}"}) public ResponseEntity<?> cadastrar(@PathVariable(name="id",required =true) Long id ,@Valid @RequestBody TransacaoDTO dto, UriComponentsBuilder uri){ Optional<Compra> compra = compraRepository.findById(id); if(compra.isEmpty()) { return ResponseEntity.badRequest().build(); } Transacao transaction = transacaoRepository.save(dto.convert(compra.get())); processar(uri,transaction,compra.get()); return ResponseEntity.ok().build(); } public void processar(UriComponentsBuilder uri,Transacao transacao,Compra compra) { if(transacao.getStatus().equals(TransacaoStatusEnum.SUCESSO)) { transacao.getCompra().finalizacompra(compraRepository); processa.GerarNota(compra); processa.Ranking(compra); }; sendMail(transacao,transacao.getStatus(),uri); } private Boolean sendMail(Transacao transacao, TransacaoStatusEnum transacaoStatusEnum, UriComponentsBuilder uri) { if(transacao.getStatus().equals(TransacaoStatusEnum.SUCESSO)) { return sender.send("Caro Sr."+transacao.getCompra().getUsuario().getLogin()+", "+ "a sua transacao foi finalizada com sucesso: "+transacao.getCompra().getQuantidade().toString()+"" + " unidades do produto "+transacao.getCompra().getProduto().getNome()+ " pelo valor unitário de "+ transacao.getCompra().getValor_unitario().toString()); }else { return sender.send("Caro Sr."+transacao.getCompra().getUsuario().getLogin()+", "+ "a sua transacao Não foi concluida com sucesso, acesse o link para tentar novamente" +transacao.getCompra().getGateway().retorno(transacao.getCompra(),uri)); } } }
3,170
0.784407
0.784407
79
39.101265
29.485287
103
false
false
0
0
0
0
0
0
2.113924
false
false
13
ed2325f8a4aa21a6e6ab40d8180a4b19913d3ac0
11,201,274,722,088
ee41b8d5392f5a4b307c0509ecbb958b22aa1251
/src/main/java/messy/render/croosr.java
d5119ed0307d49fb1d1578044c1005a2c33078ff
[]
no_license
akakishi04/messy-mod
https://github.com/akakishi04/messy-mod
cf021855864cc8acc57d29824610e0d13f20afd5
06e3e09dcdad7e5af3a3fe92bd104d703051d07e
refs/heads/master
2016-08-12T07:02:17.139000
2016-02-07T14:31:29
2016-02-07T14:31:29
43,634,137
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package messy.render; import org.lwjgl.opengl.GL11; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.Minecraft; import net.minecraft.client.model.ModelVillager; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.entity.Entity; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ResourceLocation; @SideOnly(Side.CLIENT) public class croosr extends TileEntitySpecialRenderer { private static final ResourceLocation resource = new ResourceLocation("textures/entity/villager/villager.png"); //private crm modelcross =new crm(); private ModelVillager modelcross =new ModelVillager(1F); @Override public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float partialTickTime) { this.doRender(tileEntity, x, y, z, partialTickTime); } private void doRender(TileEntity tileEntity, double x, double y, double z, float partialTickTime) { Minecraft.getMinecraft().renderEngine.bindTexture(resource); float rot = 0; GL11.glPushMatrix(); /* * 位置の調整と色の設定. */ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glTranslatef((float) x + 0.5F, (float) y + 0.36F, (float) z + 0.5F); GL11.glRotatef(-180F, 1F, 0.0F, 0.0F); GL11.glTranslatef(0.0F, -1F, 0.0F); GL11.glRotatef(-180, 0.0F, 1.5F, 0.0F); modelcross.render((Entity)null, 0f, 0f, 0f, 0f, 0f, 0.0550f); //new ModelBiped().render((Entity)null, 0F, 0F, 0F,-0.0F, 0.0F, 0.0625F); GL11.glPopMatrix(); } }
UTF-8
Java
1,628
java
croosr.java
Java
[]
null
[]
package messy.render; import org.lwjgl.opengl.GL11; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.Minecraft; import net.minecraft.client.model.ModelVillager; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.entity.Entity; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ResourceLocation; @SideOnly(Side.CLIENT) public class croosr extends TileEntitySpecialRenderer { private static final ResourceLocation resource = new ResourceLocation("textures/entity/villager/villager.png"); //private crm modelcross =new crm(); private ModelVillager modelcross =new ModelVillager(1F); @Override public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float partialTickTime) { this.doRender(tileEntity, x, y, z, partialTickTime); } private void doRender(TileEntity tileEntity, double x, double y, double z, float partialTickTime) { Minecraft.getMinecraft().renderEngine.bindTexture(resource); float rot = 0; GL11.glPushMatrix(); /* * 位置の調整と色の設定. */ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glTranslatef((float) x + 0.5F, (float) y + 0.36F, (float) z + 0.5F); GL11.glRotatef(-180F, 1F, 0.0F, 0.0F); GL11.glTranslatef(0.0F, -1F, 0.0F); GL11.glRotatef(-180, 0.0F, 1.5F, 0.0F); modelcross.render((Entity)null, 0f, 0f, 0f, 0f, 0f, 0.0550f); //new ModelBiped().render((Entity)null, 0F, 0F, 0F,-0.0F, 0.0F, 0.0625F); GL11.glPopMatrix(); } }
1,628
0.708955
0.660448
57
26.210526
29.091349
116
false
false
0
0
0
0
0
0
1.824561
false
false
13
8a423b2e792a5197a483268ce909b61e54269bdc
10,058,813,466,452
a0881dedec2a8e098f983faef2acb15e89efe64b
/src/main/java/com/yukil/petcareuserserver/entity/Pet.java
6241dd6347a99e356bc120211643d227cad9d1b0
[]
no_license
dbrdlf/petcareuserserver
https://github.com/dbrdlf/petcareuserserver
b11866b9af0f691b5dfc7b427becf615682a871b
eda72e642e13a4f469aa31a3309f467e611930d3
refs/heads/master
2023-03-29T18:47:47.830000
2021-03-23T14:57:46
2021-03-23T14:57:46
332,916,909
0
0
null
false
2021-03-23T14:55:09
2021-01-25T23:48:05
2021-03-23T14:37:37
2021-03-23T14:55:09
116
0
0
1
Java
false
false
package com.yukil.petcareuserserver.entity; import lombok.*; import org.springframework.jmx.export.annotation.ManagedAttribute; import javax.persistence.*; import java.time.LocalDate; @Entity @Getter @Setter @Builder @NoArgsConstructor @AllArgsConstructor @EqualsAndHashCode(of = "id") public class Pet { @Id @GeneratedValue private Long id; @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "customer_id") private Customer customer; private String name; @Enumerated(EnumType.STRING) private PetType petType; private LocalDate birthday; public void saveCustomer(Customer customer){ this.customer = customer; customer.getPetList().add(this); } }
UTF-8
Java
717
java
Pet.java
Java
[]
null
[]
package com.yukil.petcareuserserver.entity; import lombok.*; import org.springframework.jmx.export.annotation.ManagedAttribute; import javax.persistence.*; import java.time.LocalDate; @Entity @Getter @Setter @Builder @NoArgsConstructor @AllArgsConstructor @EqualsAndHashCode(of = "id") public class Pet { @Id @GeneratedValue private Long id; @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "customer_id") private Customer customer; private String name; @Enumerated(EnumType.STRING) private PetType petType; private LocalDate birthday; public void saveCustomer(Customer customer){ this.customer = customer; customer.getPetList().add(this); } }
717
0.726639
0.726639
32
21.40625
16.01144
66
false
false
0
0
0
0
0
0
0.375
false
false
13
8758573308f569f69bc13c702abfd148f913e3a5
21,904,333,222,102
663316411d093c25270a6aad4a0082bc731e6803
/src/main/java/ru/ase/ims/enomanager/service/xml/XMLReader.java
ea4444581d35fdc326f2f4216db35996eed98957
[]
no_license
Battal99/modeller
https://github.com/Battal99/modeller
d1816b2172c6e380b875c30de50822f250f7fc84
778471c02d2a5c669a64b4209046105f27c72e22
refs/heads/master
2022-12-02T17:43:14.842000
2020-07-14T10:59:56
2020-07-14T10:59:56
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package ru.ase.ims.enomanager.service.xml; import ru.ase.ims.enomanager.model.enovia.DataModel; import ru.ase.ims.enomanager.model.enovia.xml.Ematrix; public interface XMLReader { DataModel getObjectFromFile(String branchName, String fileName); DataModel getObjectFromString(String type, String content); String getHtml(Ematrix xmlContent); String getXml(Ematrix content); }
UTF-8
Java
393
java
XMLReader.java
Java
[]
null
[]
package ru.ase.ims.enomanager.service.xml; import ru.ase.ims.enomanager.model.enovia.DataModel; import ru.ase.ims.enomanager.model.enovia.xml.Ematrix; public interface XMLReader { DataModel getObjectFromFile(String branchName, String fileName); DataModel getObjectFromString(String type, String content); String getHtml(Ematrix xmlContent); String getXml(Ematrix content); }
393
0.791349
0.791349
11
34.727272
23.821651
68
false
false
0
0
0
0
0
0
0.818182
false
false
13
98867a9234189e955b1d7aaf68afbc0598feea57
18,691,697,689,526
c3af3463070efc583bfce5dc404d6d73fe23c3cb
/src/main/java/com/discretion/solver/inference/UnionDisjunction.java
7f218f3ce0a94743f342a89ddcd7deba2bda1c54
[]
no_license
jbauschatz/Discretion
https://github.com/jbauschatz/Discretion
e77c6661933d19e8e1e2116a81adb26da81042cc
f7d31a5c4b6158aee6975dcd6f8f4302040829db
refs/heads/master
2020-05-17T13:19:38.904000
2016-02-16T21:02:35
2016-02-16T21:02:35
24,506,767
0
1
null
false
2016-02-14T17:40:23
2014-09-26T16:28:07
2016-01-13T04:34:33
2016-02-14T17:38:45
1,048
2
1
4
Java
null
null
package com.discretion.solver.inference; import com.discretion.AbstractMathObjectVisitor; import com.discretion.MathObject; import com.discretion.expression.SetUnion; import com.discretion.proof.ProofStatement; import com.discretion.solver.Replacer; import com.discretion.solver.environment.TruthEnvironment; import com.discretion.statement.Disjunction; import com.discretion.statement.ElementOf; import com.discretion.statement.Statement; import java.util.LinkedList; import java.util.List; public class UnionDisjunction extends AbstractMathObjectVisitor implements InferenceRule { @Override public List<ProofStatement> getInferences(TruthEnvironment environment) { inferences = new LinkedList<>(); // Each truth-statement in the environment can potentially be substituted using this rule for (Statement object : environment.getTruths()) { originalStatement = object; traverse(object); } return inferences; } public UnionDisjunction() { replacer = new Replacer(); } @Override protected void handle(Disjunction disjunction) { if (!(disjunction.getLeft() instanceof ElementOf)) return; if (!(disjunction.getRight() instanceof ElementOf)) return; ElementOf left = (ElementOf)disjunction.getLeft(); ElementOf right = (ElementOf)disjunction.getRight(); if (!left.getElement().equals(right.getElement())) return; ElementOf substitution = new ElementOf(left.getElement(), new SetUnion(left.getSet(), right.getSet())); inferences.add(new ProofStatement( (Statement) replacer.substitute(originalStatement, disjunction, substitution), "by the definition of union" )); } @Override protected void handle(ElementOf elementOf) { if (elementOf.getSet() instanceof SetUnion) { MathObject object = elementOf.getElement(); SetUnion oldUnion = (SetUnion)elementOf.getSet(); Disjunction newDisjunction = new Disjunction( new ElementOf(object, oldUnion.getLeft()), new ElementOf(object, oldUnion.getRight()) ); inferences.add(new ProofStatement( (Statement) replacer.substitute(originalStatement, elementOf, newDisjunction), "by the definition of union" )); } } private Statement originalStatement; private LinkedList<ProofStatement> inferences; private Replacer replacer; }
UTF-8
Java
2,654
java
UnionDisjunction.java
Java
[]
null
[]
package com.discretion.solver.inference; import com.discretion.AbstractMathObjectVisitor; import com.discretion.MathObject; import com.discretion.expression.SetUnion; import com.discretion.proof.ProofStatement; import com.discretion.solver.Replacer; import com.discretion.solver.environment.TruthEnvironment; import com.discretion.statement.Disjunction; import com.discretion.statement.ElementOf; import com.discretion.statement.Statement; import java.util.LinkedList; import java.util.List; public class UnionDisjunction extends AbstractMathObjectVisitor implements InferenceRule { @Override public List<ProofStatement> getInferences(TruthEnvironment environment) { inferences = new LinkedList<>(); // Each truth-statement in the environment can potentially be substituted using this rule for (Statement object : environment.getTruths()) { originalStatement = object; traverse(object); } return inferences; } public UnionDisjunction() { replacer = new Replacer(); } @Override protected void handle(Disjunction disjunction) { if (!(disjunction.getLeft() instanceof ElementOf)) return; if (!(disjunction.getRight() instanceof ElementOf)) return; ElementOf left = (ElementOf)disjunction.getLeft(); ElementOf right = (ElementOf)disjunction.getRight(); if (!left.getElement().equals(right.getElement())) return; ElementOf substitution = new ElementOf(left.getElement(), new SetUnion(left.getSet(), right.getSet())); inferences.add(new ProofStatement( (Statement) replacer.substitute(originalStatement, disjunction, substitution), "by the definition of union" )); } @Override protected void handle(ElementOf elementOf) { if (elementOf.getSet() instanceof SetUnion) { MathObject object = elementOf.getElement(); SetUnion oldUnion = (SetUnion)elementOf.getSet(); Disjunction newDisjunction = new Disjunction( new ElementOf(object, oldUnion.getLeft()), new ElementOf(object, oldUnion.getRight()) ); inferences.add(new ProofStatement( (Statement) replacer.substitute(originalStatement, elementOf, newDisjunction), "by the definition of union" )); } } private Statement originalStatement; private LinkedList<ProofStatement> inferences; private Replacer replacer; }
2,654
0.657498
0.657498
75
34.386665
25.387606
97
false
false
0
0
0
0
0
0
0.56
false
false
13
142eba2c4317b0f9c868a69ac41a91e8d29b5a10
31,610,959,317,882
1bcac378ac7778af3a337919acfdfd1d9ab7ebca
/jd1-module5-basic_of_oop/src/by/htp/homework/basic_of_oop/task3/View.java
f12550d1b6015b67809d8c7c4d42b8afc7ddcbb8
[]
no_license
Ilia911/jd1-homework
https://github.com/Ilia911/jd1-homework
b3e9b33beeaf75d72e7eafb301a47dfb8ec08770
09e089a777ec44d33800dde4681e4beb5c4392ea
refs/heads/master
2021-01-07T13:52:07.285000
2020-10-11T10:19:40
2020-10-11T10:19:40
241,714,255
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package by.htp.homework.basic_of_oop.task3; public class View { public void printAllHolyday(Calendar calendar) { System.out.println("Holidays:"); for (Calendar.Month month : calendar.getMonthList()) { System.out.println(month.getTitle() + ":"); for (Calendar.Day day : month.getDayList()) { if (day.isHoliday()) { System.out.println(day); } } } System.out.println(""); } public void printResult(boolean result) { System.out.println("Is the day Holiday? - " + result); } }
UTF-8
Java
539
java
View.java
Java
[]
null
[]
package by.htp.homework.basic_of_oop.task3; public class View { public void printAllHolyday(Calendar calendar) { System.out.println("Holidays:"); for (Calendar.Month month : calendar.getMonthList()) { System.out.println(month.getTitle() + ":"); for (Calendar.Day day : month.getDayList()) { if (day.isHoliday()) { System.out.println(day); } } } System.out.println(""); } public void printResult(boolean result) { System.out.println("Is the day Holiday? - " + result); } }
539
0.625232
0.623377
23
21.434782
20.652037
56
false
false
0
0
0
0
0
0
1.956522
false
false
13
77bc0a0d47eac96ffded1ee5facd89203f1e318b
21,174,188,832,753
f8ef7313b04aa25344c5277051dd5516366dc13d
/src/com/ufo/flamepernixfarmer/main/Core.java
f7d011dc4d483b5323cfc1c6b4684483f19253a2
[]
no_license
UFOSrReal/Parabot
https://github.com/UFOSrReal/Parabot
9ddaaf18559316cb3bc73914ecb73c26b552bd11
58a47f70cfced9b54a4bd2c6c17ef426a74c8d09
refs/heads/master
2021-01-11T20:08:00.116000
2017-02-23T23:14:34
2017-02-23T23:14:34
82,975,808
0
3
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.ufo.flamepernixfarmer.main; import com.ufo.flamepernixfarmer.strategies.Attack; import com.ufo.flamepernixfarmer.strategies.HandleTile; import com.ufo.flamepernixfarmer.strategies.Loot; import com.ufo.flamepernixfarmer.strategies.Teleport; import com.ufo.flamepernixfarmer.utils.Variables; import org.parabot.environment.api.interfaces.Paintable; import org.parabot.environment.api.utils.Timer; import org.parabot.environment.scripts.Category; import org.parabot.environment.scripts.Script; import org.parabot.environment.scripts.ScriptManifest; import org.parabot.environment.scripts.framework.Strategy; import org.rev317.min.api.events.MessageEvent; import org.rev317.min.api.events.listeners.MessageListener; import org.rev317.min.api.methods.Skill; import java.awt.*; import java.text.NumberFormat; import java.util.ArrayList; import java.util.Locale; /** * Created by UFO credits to Fryslan */ @ScriptManifest( author = "UFO", name = "UFOS Flame Pernix Farmer", category = Category.COMBAT, version = 1.2, description = "Kills flame pernix in safespot, loots Flame Pernix armour.", servers = {"DreamScape"}) public class Core extends Script implements Paintable, MessageListener { private ArrayList<Strategy> strategies = new ArrayList<Strategy>(); Timer time = new Timer();//credits to Cyanic for helping private Variables vars = new Variables(); private int startDefExp, startRangeExp, startHpExp; @Override public boolean onExecute() { startDefExp = Skill.DEFENSE.getExperience(); startRangeExp = Skill.RANGE.getExperience(); startHpExp = Skill.HITPOINTS.getExperience(); /* * Displays GUI and title */ Ui window = new Ui(); window.setTitle("Flame Pernix Farmer"); window.setVisible(true); while (window.isVisible()) { sleep(20); } strategies.add(new Attack()); strategies.add(new HandleTile()); strategies.add(new Loot()); strategies.add(new Teleport()); provide(strategies); return true; } @Override public void onFinish() { System.out.println("Script Stopped"); } @Override public void paint(Graphics g1) { int getDefExp = Skill.DEFENSE.getExperience(); int getRangeExp = Skill.RANGE.getExperience(); int getHpExp = Skill.HITPOINTS.getExperience(); int defExpGained = getDefExp - startDefExp; int rangeExpGained = getRangeExp - startRangeExp; int hPExpGained = getHpExp - startHpExp; int allExpGained = defExpGained + rangeExpGained + hPExpGained; Graphics2D g = (Graphics2D) g1; g.setColor(Color.BLUE); Font currentFont = g.getFont(); Font newFont = currentFont.deriveFont(currentFont.getSize() * 1.1F); NumberFormat nf = NumberFormat.getInstance(Locale.ENGLISH); g.setFont(newFont); g.drawRect(7, 7, 190, 106); g.drawString("Run time: " + time, 10, 20); g.drawString("State: " + vars.getState(), 10, 35); g.drawString("Kills/hr: " + nf.format(vars.getCount()) + "/" + vars.getPerHour(vars.getCount()), 10, 50); g.drawString("Chest drops/hour: " + nf.format(vars.getChestDrops()) + "/" + vars.getPerHour(vars.getChestDrops()), 10, 65); g.drawString("Keys drops/hour: " + nf.format(vars.getKeyDrops()) + "/" + vars.getPerHour(vars.getKeyDrops()), 10, 80); g.drawString("Immortal(key) drops/hour: " + nf.format(vars.getImmortalDrops()) + "/" + vars.getPerHour(vars.getImmortalDrops()), 10, 95); g.drawString("Exp gained/hour: " + nf.format(allExpGained) + "/" + vars.getPerHour(allExpGained), 10, 110); } public void messageReceived(MessageEvent messageEvent) { if (messageEvent.getMessage().contains("Your Flame pernix kill count is")) { vars.setCount(vars.getCount() + 1); } if (messageEvent.getMessage().contains("The chest has been added directly to your bank")) { vars.setChestDrops(vars.getChestDrops() + 1); } if (messageEvent.getMessage().contains("The key fragment has been added directly to your bank")) { vars.setKeyDrops(vars.getKeyDrops() + 1); } if (messageEvent.getMessage().contains("The Immortal stone fragment has been added directly to your bank")) { vars.setImmortalDrops(vars.getImmortalDrops() + 1); } } }
UTF-8
Java
4,508
java
Core.java
Java
[ { "context": "to Fryslan\n */\n@ScriptManifest(\n author = \"UFO\",\n name = \"UFOS Flame Pernix Farmer\",\n ", "end": 954, "score": 0.6786782741546631, "start": 951, "tag": "USERNAME", "value": "UFO" }, { "context": " Ui window = new Ui();\n window.setTitle(\...
null
[]
package com.ufo.flamepernixfarmer.main; import com.ufo.flamepernixfarmer.strategies.Attack; import com.ufo.flamepernixfarmer.strategies.HandleTile; import com.ufo.flamepernixfarmer.strategies.Loot; import com.ufo.flamepernixfarmer.strategies.Teleport; import com.ufo.flamepernixfarmer.utils.Variables; import org.parabot.environment.api.interfaces.Paintable; import org.parabot.environment.api.utils.Timer; import org.parabot.environment.scripts.Category; import org.parabot.environment.scripts.Script; import org.parabot.environment.scripts.ScriptManifest; import org.parabot.environment.scripts.framework.Strategy; import org.rev317.min.api.events.MessageEvent; import org.rev317.min.api.events.listeners.MessageListener; import org.rev317.min.api.methods.Skill; import java.awt.*; import java.text.NumberFormat; import java.util.ArrayList; import java.util.Locale; /** * Created by UFO credits to Fryslan */ @ScriptManifest( author = "UFO", name = "UFOS Flame Pernix Farmer", category = Category.COMBAT, version = 1.2, description = "Kills flame pernix in safespot, loots Flame Pernix armour.", servers = {"DreamScape"}) public class Core extends Script implements Paintable, MessageListener { private ArrayList<Strategy> strategies = new ArrayList<Strategy>(); Timer time = new Timer();//credits to Cyanic for helping private Variables vars = new Variables(); private int startDefExp, startRangeExp, startHpExp; @Override public boolean onExecute() { startDefExp = Skill.DEFENSE.getExperience(); startRangeExp = Skill.RANGE.getExperience(); startHpExp = Skill.HITPOINTS.getExperience(); /* * Displays GUI and title */ Ui window = new Ui(); window.setTitle("Fl<NAME>"); window.setVisible(true); while (window.isVisible()) { sleep(20); } strategies.add(new Attack()); strategies.add(new HandleTile()); strategies.add(new Loot()); strategies.add(new Teleport()); provide(strategies); return true; } @Override public void onFinish() { System.out.println("Script Stopped"); } @Override public void paint(Graphics g1) { int getDefExp = Skill.DEFENSE.getExperience(); int getRangeExp = Skill.RANGE.getExperience(); int getHpExp = Skill.HITPOINTS.getExperience(); int defExpGained = getDefExp - startDefExp; int rangeExpGained = getRangeExp - startRangeExp; int hPExpGained = getHpExp - startHpExp; int allExpGained = defExpGained + rangeExpGained + hPExpGained; Graphics2D g = (Graphics2D) g1; g.setColor(Color.BLUE); Font currentFont = g.getFont(); Font newFont = currentFont.deriveFont(currentFont.getSize() * 1.1F); NumberFormat nf = NumberFormat.getInstance(Locale.ENGLISH); g.setFont(newFont); g.drawRect(7, 7, 190, 106); g.drawString("Run time: " + time, 10, 20); g.drawString("State: " + vars.getState(), 10, 35); g.drawString("Kills/hr: " + nf.format(vars.getCount()) + "/" + vars.getPerHour(vars.getCount()), 10, 50); g.drawString("Chest drops/hour: " + nf.format(vars.getChestDrops()) + "/" + vars.getPerHour(vars.getChestDrops()), 10, 65); g.drawString("Keys drops/hour: " + nf.format(vars.getKeyDrops()) + "/" + vars.getPerHour(vars.getKeyDrops()), 10, 80); g.drawString("Immortal(key) drops/hour: " + nf.format(vars.getImmortalDrops()) + "/" + vars.getPerHour(vars.getImmortalDrops()), 10, 95); g.drawString("Exp gained/hour: " + nf.format(allExpGained) + "/" + vars.getPerHour(allExpGained), 10, 110); } public void messageReceived(MessageEvent messageEvent) { if (messageEvent.getMessage().contains("Your Flame pernix kill count is")) { vars.setCount(vars.getCount() + 1); } if (messageEvent.getMessage().contains("The chest has been added directly to your bank")) { vars.setChestDrops(vars.getChestDrops() + 1); } if (messageEvent.getMessage().contains("The key fragment has been added directly to your bank")) { vars.setKeyDrops(vars.getKeyDrops() + 1); } if (messageEvent.getMessage().contains("The Immortal stone fragment has been added directly to your bank")) { vars.setImmortalDrops(vars.getImmortalDrops() + 1); } } }
4,497
0.668589
0.65528
112
39.25893
31.419041
145
false
false
0
0
0
0
0
0
0.785714
false
false
13
9cc54d82d4d767c0b8cc546610ba4e30c7c3d6cb
29,111,288,363,836
6fcc8805e841584aeb58d446dc544e3a251e2f78
/seleniumMavenProject/src/main/java/MMPprojectAssignment/Data.java
ccf0f2f93d5f82e384c1021ec041e9ad9a634ff2
[]
no_license
revathirao/MMP-Project
https://github.com/revathirao/MMP-Project
8f84c517ad56f639e970dda0f83d2ef10b41dbcd
a2baae56cace489724c2a70fe92453dda76d403c
refs/heads/master
2021-03-05T22:17:56.322000
2020-04-08T23:34:53
2020-04-08T23:34:53
246,157,405
0
0
null
false
2020-04-08T23:31:43
2020-03-09T22:44:21
2020-04-08T23:22:58
2020-04-08T23:29:08
17
0
0
1
Java
false
false
package MMPprojectAssignment; import java.util.ArrayList; import java.util.HashMap; import org.openqa.selenium.Alert; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; //Code by Revathi public class Data { static WebDriver driver; static HashMap<String, String> PersonalDetailsMap; HashMap<String, String> PersonalDetailsMap1; HashMap<String, WebElement> PersonalDetailsMap2; public Data(WebDriver driver) { this.driver = driver; } public void profileEdit() throws Exception { // click the profile menu WebElement profile = driver.findElement(By.xpath("//span[contains(text(),'Profile')]")); profile.click(); Thread.sleep(3000); // Creating an ArrayList of values ArrayList<WebElement> listOfValues = new ArrayList<WebElement>(profileMap().values()); System.out.println("contents of the list holding values of the map ::" + listOfValues); for (int i = 0; i < listOfValues.size(); i++) { if (!listOfValues.isEmpty()) { if (i == 0) { WebElement edit = driver.findElement(By.id("Ebtn")); edit.click(); Thread.sleep(3000); } else { WebElement save = driver.findElement(By.id("Sbtn")); save.click(); Thread.sleep(3000); } listOfValues.get(i).clear(); } } profileMap(); alertPopUp(); } public static HashMap<String, String> dataMap() { // Creating a HashMap object PersonalDetailsMap = new HashMap<String, String>(); // Adding elements to HashMap PersonalDetailsMap.put("Address", "5234,Main Street"); PersonalDetailsMap.put("state", "Indiana"); PersonalDetailsMap.put("City", "IndianaPolis"); PersonalDetailsMap.put("ZipCode", "45112"); return PersonalDetailsMap; } public HashMap<String, WebElement> profileMap() throws Exception { // Creating a HashMap object PersonalDetailsMap2 = new HashMap<String, WebElement>(); // Adding Webelements to HashMap // Address String strAddress = Data.dataMap().get("Address"); WebElement address = driver.findElement(By.id("addr")); address.sendKeys(strAddress); PersonalDetailsMap2.put("Address", address); // zipcode String strZip = Data.dataMap().get("ZipCode"); WebElement zipcode = driver.findElement(By.id("zip")); zipcode.sendKeys(strZip); PersonalDetailsMap2.put("ZipCode", zipcode); // State String strState = Data.dataMap().get("state"); WebElement state = driver.findElement(By.id("state")); state.sendKeys(strState); PersonalDetailsMap2.put("State", state); // City String strCity = Data.dataMap().get("City"); WebElement city = driver.findElement(By.id("city")); city.sendKeys(strCity); PersonalDetailsMap2.put("City", city); // save WebElement save = driver.findElement(By.id("Sbtn")); save.click(); Thread.sleep(3000); return PersonalDetailsMap2; } public HashMap<String, String> alertPopUp() { HashMap<String, String> alert = new HashMap<String, String>(); Alert alt = driver.switchTo().alert(); String successMsg = alt.getText(); alt.accept(); alert.put("message", successMsg); return alert; } }
UTF-8
Java
3,106
java
Data.java
Java
[ { "context": "\nimport org.openqa.selenium.WebElement;\n\n//Code by Revathi\npublic class Data {\n\n\tstatic WebDriver driver;\n\ts", "end": 245, "score": 0.9886174201965332, "start": 238, "tag": "NAME", "value": "Revathi" } ]
null
[]
package MMPprojectAssignment; import java.util.ArrayList; import java.util.HashMap; import org.openqa.selenium.Alert; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; //Code by Revathi public class Data { static WebDriver driver; static HashMap<String, String> PersonalDetailsMap; HashMap<String, String> PersonalDetailsMap1; HashMap<String, WebElement> PersonalDetailsMap2; public Data(WebDriver driver) { this.driver = driver; } public void profileEdit() throws Exception { // click the profile menu WebElement profile = driver.findElement(By.xpath("//span[contains(text(),'Profile')]")); profile.click(); Thread.sleep(3000); // Creating an ArrayList of values ArrayList<WebElement> listOfValues = new ArrayList<WebElement>(profileMap().values()); System.out.println("contents of the list holding values of the map ::" + listOfValues); for (int i = 0; i < listOfValues.size(); i++) { if (!listOfValues.isEmpty()) { if (i == 0) { WebElement edit = driver.findElement(By.id("Ebtn")); edit.click(); Thread.sleep(3000); } else { WebElement save = driver.findElement(By.id("Sbtn")); save.click(); Thread.sleep(3000); } listOfValues.get(i).clear(); } } profileMap(); alertPopUp(); } public static HashMap<String, String> dataMap() { // Creating a HashMap object PersonalDetailsMap = new HashMap<String, String>(); // Adding elements to HashMap PersonalDetailsMap.put("Address", "5234,Main Street"); PersonalDetailsMap.put("state", "Indiana"); PersonalDetailsMap.put("City", "IndianaPolis"); PersonalDetailsMap.put("ZipCode", "45112"); return PersonalDetailsMap; } public HashMap<String, WebElement> profileMap() throws Exception { // Creating a HashMap object PersonalDetailsMap2 = new HashMap<String, WebElement>(); // Adding Webelements to HashMap // Address String strAddress = Data.dataMap().get("Address"); WebElement address = driver.findElement(By.id("addr")); address.sendKeys(strAddress); PersonalDetailsMap2.put("Address", address); // zipcode String strZip = Data.dataMap().get("ZipCode"); WebElement zipcode = driver.findElement(By.id("zip")); zipcode.sendKeys(strZip); PersonalDetailsMap2.put("ZipCode", zipcode); // State String strState = Data.dataMap().get("state"); WebElement state = driver.findElement(By.id("state")); state.sendKeys(strState); PersonalDetailsMap2.put("State", state); // City String strCity = Data.dataMap().get("City"); WebElement city = driver.findElement(By.id("city")); city.sendKeys(strCity); PersonalDetailsMap2.put("City", city); // save WebElement save = driver.findElement(By.id("Sbtn")); save.click(); Thread.sleep(3000); return PersonalDetailsMap2; } public HashMap<String, String> alertPopUp() { HashMap<String, String> alert = new HashMap<String, String>(); Alert alt = driver.switchTo().alert(); String successMsg = alt.getText(); alt.accept(); alert.put("message", successMsg); return alert; } }
3,106
0.702511
0.691243
119
25.10084
22.441856
90
false
false
0
0
0
0
0
0
2.151261
false
false
13
3c558dcb4363310e7bf69b2c908df815c4ba3869
22,299,470,234,184
20ce73e6f7fcc54f4846ac9f426a8be6f6a18867
/FinalFlameMaker/bin/ch/epfl/flamemaker/color/Color.java
1093a8c6b5d1a574a65c3d6981915dd068a0c1b6
[]
no_license
baraschi/FlameMaker
https://github.com/baraschi/FlameMaker
a116787e9c2f509902c05492c9b60e5b19b6cb52
1bf485922e531125c8a596dd66ddd5799a4e89fe
refs/heads/master
2016-09-06T21:41:58.490000
2014-03-10T10:53:00
2014-03-10T10:53:00
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package ch.epfl.flamemaker.color; import ch.epfl.flamemaker.color.Color; /** * <b> La classe couleur nous permet de modeliser des fractales en couleur.</b> * Ici, une couleur est caracterisee par un triplet de nombres. * * @author Lou Richard <lou.richard@epfl.ch> Sciper: 228149 * @author Zoe Baraschi <zoe.baraschi@epfl.ch> Sciper: 219665 * * @version 1.0 */ public class Color { public static final Color BLACK = new Color(0, 0, 0); public static final Color WHITE = new Color(1, 1, 1); public static final Color RED = new Color(1, 0, 0); public static final Color GREEN = new Color(0, 1, 0); public static final Color BLUE = new Color(0, 0, 1); private double r; private double g; private double b; /** * <b>Constructeur de la classe Color.</b> * * @param r * Composante rouge. * @param g * Composante verte. * @param b * Composante bleue. * @throws IllegalArgumentException * Si l'une des composantes est invalide. */ public Color(double r, double g, double b) throws IllegalArgumentException { if ((r < 0) || (r > 1) || (g < 0) || (g > 1) || (b < 0) || (b > 1)) { throw new IllegalArgumentException("r : " + r + " g : " + g + " b + " + b); } this.r = r; this.b = b; this.g = g; } /** * Getter de la quantite de rouge. * * @return La quandtite de rouge. */ public double red() { return r; } /** * Getter de la quantite de vert. * * @return la quantite de vert. */ public double green() { return g; } /** * Getter de la quantite de bleu. * * @return La quantite de bleu. */ public double blue() { return b; } /** * * @return La couleur sous forme d'un entier compose de 24 bits. */ public int asPackedRGB() { int rs = sRGBEncode(r, 255) <<16; int rg = sRGBEncode(g, 255) << 8; int rb = sRGBEncode(b, 255); return rs | rg | rb; } /** * Melange de deux couleurs. * * @param that * Couleur a melanger avec l'actuelle. * @param proportion * Proportion de la couleur representee par le recepteur, contenue * dans un intervalle [0,1]. * @return Un melange de deux couleurs. * @throws IllegalArgumentException * Si la proportion n'appartient pas a l'intervalle [0,1]. */ public Color mixWith(Color that, double proportion) throws IllegalArgumentException { if ((proportion > 1) || (proportion < 0)) { throw new IllegalArgumentException("Proportion : " + proportion); } return new Color((proportion * r) + ((1 - proportion) * that.red()), (proportion * g) + ((1 - proportion) * that.green()), (proportion * b) + ((1 - proportion) * that.blue())); } /** * @param v Composante rŽelle d'une couleur a encoder en un entier. * @param max Maximum (represente 1). * @return La valeur v gamma-encodee. */ public static int sRGBEncode(double v, int max) { double vs; if (v <= 0.0031308) { vs = 12.92 * v; } else { vs = (1.055 * Math.pow(v, (1 / 2.4))) - 0.055; } return (int) (vs * max); } }
WINDOWS-1250
Java
3,086
java
Color.java
Java
[ { "context": "cterisee par un triplet de nombres.\n * \n * @author Lou Richard <lou.richard@epfl.ch> Sciper: 228149\n * @author Z", "end": 249, "score": 0.9998579025268555, "start": 238, "tag": "NAME", "value": "Lou Richard" }, { "context": "n triplet de nombres.\n * \n * @author Lou...
null
[]
package ch.epfl.flamemaker.color; import ch.epfl.flamemaker.color.Color; /** * <b> La classe couleur nous permet de modeliser des fractales en couleur.</b> * Ici, une couleur est caracterisee par un triplet de nombres. * * @author <NAME> <<EMAIL>> Sciper: 228149 * @author <NAME> <<EMAIL>> Sciper: 219665 * * @version 1.0 */ public class Color { public static final Color BLACK = new Color(0, 0, 0); public static final Color WHITE = new Color(1, 1, 1); public static final Color RED = new Color(1, 0, 0); public static final Color GREEN = new Color(0, 1, 0); public static final Color BLUE = new Color(0, 0, 1); private double r; private double g; private double b; /** * <b>Constructeur de la classe Color.</b> * * @param r * Composante rouge. * @param g * Composante verte. * @param b * Composante bleue. * @throws IllegalArgumentException * Si l'une des composantes est invalide. */ public Color(double r, double g, double b) throws IllegalArgumentException { if ((r < 0) || (r > 1) || (g < 0) || (g > 1) || (b < 0) || (b > 1)) { throw new IllegalArgumentException("r : " + r + " g : " + g + " b + " + b); } this.r = r; this.b = b; this.g = g; } /** * Getter de la quantite de rouge. * * @return La quandtite de rouge. */ public double red() { return r; } /** * Getter de la quantite de vert. * * @return la quantite de vert. */ public double green() { return g; } /** * Getter de la quantite de bleu. * * @return La quantite de bleu. */ public double blue() { return b; } /** * * @return La couleur sous forme d'un entier compose de 24 bits. */ public int asPackedRGB() { int rs = sRGBEncode(r, 255) <<16; int rg = sRGBEncode(g, 255) << 8; int rb = sRGBEncode(b, 255); return rs | rg | rb; } /** * Melange de deux couleurs. * * @param that * Couleur a melanger avec l'actuelle. * @param proportion * Proportion de la couleur representee par le recepteur, contenue * dans un intervalle [0,1]. * @return Un melange de deux couleurs. * @throws IllegalArgumentException * Si la proportion n'appartient pas a l'intervalle [0,1]. */ public Color mixWith(Color that, double proportion) throws IllegalArgumentException { if ((proportion > 1) || (proportion < 0)) { throw new IllegalArgumentException("Proportion : " + proportion); } return new Color((proportion * r) + ((1 - proportion) * that.red()), (proportion * g) + ((1 - proportion) * that.green()), (proportion * b) + ((1 - proportion) * that.blue())); } /** * @param v Composante rŽelle d'une couleur a encoder en un entier. * @param max Maximum (represente 1). * @return La valeur v gamma-encodee. */ public static int sRGBEncode(double v, int max) { double vs; if (v <= 0.0031308) { vs = 12.92 * v; } else { vs = (1.055 * Math.pow(v, (1 / 2.4))) - 0.055; } return (int) (vs * max); } }
3,050
0.600972
0.574392
129
22.914728
23.007593
79
false
false
0
0
0
0
0
0
1.589147
false
false
13
f2e05ab28fdd9da4f6562bdc300b1764b7e48437
10,299,331,599,034
0903e2f780eb83db57c64f7950409b9369d12b23
/src/us/hqgaming/core/commands/commands/MemberCommand.java
265402ce395cf6b2cc17e011cf9587ca5b602a8e
[]
no_license
xenojava/HQGamingCore
https://github.com/xenojava/HQGamingCore
44ff1afdb5795e22f21e75e82e03d01e1617fd7d
54a93b158bc86892f364ed04c4f82cce179c57a3
refs/heads/master
2018-09-08T02:09:44.785000
2014-10-16T19:50:03
2014-10-16T19:50:03
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package us.hqgaming.core.commands.commands; import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.Sound; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import us.hqgaming.api.Chat; import us.hqgaming.core.commands.CommandException; import us.hqgaming.core.security.Security; public class MemberCommand extends ServerCommand { public MemberCommand() { super("member"); } public void execute(CommandSender sender, String[] args) throws CommandException { if (args.length == 0 || args.length < 2) { sender.sendMessage(ChatColor.RED + "/answer [name] [message]"); return; } Player other = Bukkit.getPlayer(args[0]); if (other == null) { sender.sendMessage(ChatColor.RED + args[0] + " is not online"); return; } StringBuilder message = new StringBuilder(args[1]); for (int arg = 2; arg < args.length; arg++) { message.append(" ").append(args[arg]); } Chat.message(other, "&c" + ((sender instanceof Player) ? ((Player) sender).getDisplayName() : sender.getName()) + " &aANSWERED: &c" + message); Chat.message(other, "&cType &e/msg " + sender.getName().toLowerCase() + " [message] &cto reply back."); other.getWorld() .playSound(other.getLocation(), Sound.ORB_PICKUP, 1, 1); for (String name : Security.getOnlineTeamMembers()) { Player member = Bukkit.getPlayer(name); if (member == null) { continue; } Chat.message(member, "&c" + ((sender instanceof Player) ? ((Player) sender).getDisplayName() : sender.getName()) + " &aANSWERED: &c" + message); other.getWorld() .playSound(member.getLocation(), Sound.ORB_PICKUP, 1, 1); } } public String[] getAliases() { return new String[]{"assist"}; } }
UTF-8
Java
2,053
java
MemberCommand.java
Java
[]
null
[]
package us.hqgaming.core.commands.commands; import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.Sound; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import us.hqgaming.api.Chat; import us.hqgaming.core.commands.CommandException; import us.hqgaming.core.security.Security; public class MemberCommand extends ServerCommand { public MemberCommand() { super("member"); } public void execute(CommandSender sender, String[] args) throws CommandException { if (args.length == 0 || args.length < 2) { sender.sendMessage(ChatColor.RED + "/answer [name] [message]"); return; } Player other = Bukkit.getPlayer(args[0]); if (other == null) { sender.sendMessage(ChatColor.RED + args[0] + " is not online"); return; } StringBuilder message = new StringBuilder(args[1]); for (int arg = 2; arg < args.length; arg++) { message.append(" ").append(args[arg]); } Chat.message(other, "&c" + ((sender instanceof Player) ? ((Player) sender).getDisplayName() : sender.getName()) + " &aANSWERED: &c" + message); Chat.message(other, "&cType &e/msg " + sender.getName().toLowerCase() + " [message] &cto reply back."); other.getWorld() .playSound(other.getLocation(), Sound.ORB_PICKUP, 1, 1); for (String name : Security.getOnlineTeamMembers()) { Player member = Bukkit.getPlayer(name); if (member == null) { continue; } Chat.message(member, "&c" + ((sender instanceof Player) ? ((Player) sender).getDisplayName() : sender.getName()) + " &aANSWERED: &c" + message); other.getWorld() .playSound(member.getLocation(), Sound.ORB_PICKUP, 1, 1); } } public String[] getAliases() { return new String[]{"assist"}; } }
2,053
0.571846
0.566975
66
30.10606
29.78261
124
false
false
0
0
0
0
0
0
0.590909
false
false
13
d53def7ec0fd13e219aadc459e70c01151698c2e
17,970,143,190,189
0d664528c6543dbc5b0475cfabb1cac7a2a96419
/untitled/src/OOneCheckPowerOfTwo.java
d0f15dbec33b6cfd0630c9824befd64622eca384
[]
no_license
liaozihan/Lintcode
https://github.com/liaozihan/Lintcode
384f6adfba249cbdc64a6cf92114447012ebaaf2
75854b4176cca89d2afd03283df6cbc762694711
refs/heads/master
2018-01-10T03:03:49.630000
2016-01-26T08:03:14
2016-01-26T08:03:14
50,083,598
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
/** * Created by zliao on 1/6/16. */ public class OOneCheckPowerOfTwo { public static void main(String[] args){ OOneCheckPowerOfTwo oocpot = new OOneCheckPowerOfTwo(); System.out.println(oocpot.checkPowerOf2(11)); } public boolean checkPowerOf2(int n) { // write your code here return n <= 0 ? false : (n & (n-1)) == 0; } }
UTF-8
Java
377
java
OOneCheckPowerOfTwo.java
Java
[ { "context": "/**\n * Created by zliao on 1/6/16.\n */\npublic class OOneCheckPowerOfTwo {", "end": 23, "score": 0.9991498589515686, "start": 18, "tag": "USERNAME", "value": "zliao" } ]
null
[]
/** * Created by zliao on 1/6/16. */ public class OOneCheckPowerOfTwo { public static void main(String[] args){ OOneCheckPowerOfTwo oocpot = new OOneCheckPowerOfTwo(); System.out.println(oocpot.checkPowerOf2(11)); } public boolean checkPowerOf2(int n) { // write your code here return n <= 0 ? false : (n & (n-1)) == 0; } }
377
0.604775
0.575597
16
22.5625
21.86598
63
false
false
0
0
0
0
0
0
0.1875
false
false
13
f05d23daf7ae49d6026d0ec329b3b74f5d048960
27,831,388,105,881
1dc575048d61c2060cc397186ed1f18491b53631
/spring-mvc4-mybatis/src/main/java/com/iii/emp/batch/service/impl/MessegePrintServiceImpl.java
987e8377cf7a52d2207fbfc1890fde557f0cd73b
[]
no_license
dick6619/spring-mvc4-2018
https://github.com/dick6619/spring-mvc4-2018
8363c5666e930ddbbff713b9983a11f2607c817c
3a4435b1e2ed97d8ef06f3290694a7e072728554
refs/heads/master
2022-10-08T09:23:07.485000
2022-01-17T14:19:53
2022-01-17T14:19:53
132,912,839
1
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.iii.emp.batch.service.impl; import java.util.Date; import org.springframework.stereotype.Service; import com.iii.emp.batch.service.MessegePrintService; @Service("messegePrintService") public class MessegePrintServiceImpl implements MessegePrintService { @Override public String printMessege() { // TODO Auto-generated method stub return "jobEmp2 run application.getBean(MessegePrintService)...and use service" + "(" + new Date() + ")"; } }
UTF-8
Java
465
java
MessegePrintServiceImpl.java
Java
[]
null
[]
package com.iii.emp.batch.service.impl; import java.util.Date; import org.springframework.stereotype.Service; import com.iii.emp.batch.service.MessegePrintService; @Service("messegePrintService") public class MessegePrintServiceImpl implements MessegePrintService { @Override public String printMessege() { // TODO Auto-generated method stub return "jobEmp2 run application.getBean(MessegePrintService)...and use service" + "(" + new Date() + ")"; } }
465
0.769892
0.767742
18
24.833334
29.214247
107
false
false
0
0
0
0
0
0
0.666667
false
false
13
e8a7ddf53c79a134ec3ef680848fd925c280a66c
1,056,561,965,751
f74ff1867c7a11d5e1b9e918e94b88686324e224
/RoleBasedAccessControlSecurity/rbaclibrary/src/main/java/demo/rbac/library/WebPage.java
da14d52f6cfb78aee26da8248af1e78d842e89ce
[]
no_license
ctmobiledev/RBAC_Demo
https://github.com/ctmobiledev/RBAC_Demo
4f84f5e4d241c0e26c48a1acf05ede0ac60497f5
e65964afefc60591f99070c89c2349d6e4ab98f8
refs/heads/master
2022-12-21T04:23:27.261000
2020-09-15T22:31:19
2020-09-15T22:31:19
295,840,761
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package demo.rbac.library; import java.util.ArrayList; import java.util.List; public class WebPage { private Integer _id; // this appears in other tables public Integer getId() { return _id; } public void setId(Integer value) { this._id = value; } private String _url; public String getUrl() { return _url; } public void setUrl(String value) { this._url = value; } public WebPage(Integer pId, String pUrl) { setId(pId); setUrl(pUrl); } public static List<WebPage> listWebPages = new ArrayList<>(); }
UTF-8
Java
618
java
WebPage.java
Java
[]
null
[]
package demo.rbac.library; import java.util.ArrayList; import java.util.List; public class WebPage { private Integer _id; // this appears in other tables public Integer getId() { return _id; } public void setId(Integer value) { this._id = value; } private String _url; public String getUrl() { return _url; } public void setUrl(String value) { this._url = value; } public WebPage(Integer pId, String pUrl) { setId(pId); setUrl(pUrl); } public static List<WebPage> listWebPages = new ArrayList<>(); }
618
0.590615
0.590615
31
18.935484
18.058928
67
false
false
0
0
0
0
0
0
0.419355
false
false
13
1b41414366b55ddcd0e53d1d8188949050e51289
1,056,561,961,975
10f5e1653986026bd20b881be5d98be6c7bb12bd
/src/game/GameEngine.java
f1088f7d9023e226fcfba1ef20151ca0753e1ce1
[]
no_license
MatanDavidian/Aoop_hw3
https://github.com/MatanDavidian/Aoop_hw3
5c7cf81a12a4a9dbb6fbdb06c328ff60ccc5b7a9
dc64dd4495b9e1572fd0fc6102d7dafb1df05dfd
refs/heads/master
2020-05-09T22:34:20.595000
2019-05-02T16:57:01
2019-05-02T16:57:01
181,475,457
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package game; import game.arena.WinterArena; import game.competition.Competition; import game.competition.Competitor; import utilities.ValidationUtils; import static java.lang.Thread.sleep; /** * Created by Matan & Tom on 15-Apr-19. */ public class GameEngine{ private static GameEngine instance; private Competition competition; /** * @return singleton instance of the game engine */ public static GameEngine getInstance() { if (instance == null) { instance = new GameEngine(); } return instance; } /** * private empty Ctor for game engine */ private GameEngine() { } /** * Start a race at a competition * This method will call to startCompetition method of competition obj to run all the threads of the competitors if they valid * @param competition The competition to be run */ public void startRace(Competition competition) { ValidationUtils.assertNotNull(competition); competition.startCompetition(); } //region Getters & setters /** * @return competition */ public Competition getCompetition() { return competition; } public void setCompetition(Competition competition) { this.competition = competition; } //end region }
UTF-8
Java
1,384
java
GameEngine.java
Java
[ { "context": "atic java.lang.Thread.sleep;\r\n\r\n/**\r\n * Created by Matan & Tom on 15-Apr-19.\r\n */\r\npublic class GameEngine", "end": 226, "score": 0.9993647336959839, "start": 221, "tag": "NAME", "value": "Matan" }, { "context": "a.lang.Thread.sleep;\r\n\r\n/**\r\n * Created b...
null
[]
package game; import game.arena.WinterArena; import game.competition.Competition; import game.competition.Competitor; import utilities.ValidationUtils; import static java.lang.Thread.sleep; /** * Created by Matan & Tom on 15-Apr-19. */ public class GameEngine{ private static GameEngine instance; private Competition competition; /** * @return singleton instance of the game engine */ public static GameEngine getInstance() { if (instance == null) { instance = new GameEngine(); } return instance; } /** * private empty Ctor for game engine */ private GameEngine() { } /** * Start a race at a competition * This method will call to startCompetition method of competition obj to run all the threads of the competitors if they valid * @param competition The competition to be run */ public void startRace(Competition competition) { ValidationUtils.assertNotNull(competition); competition.startCompetition(); } //region Getters & setters /** * @return competition */ public Competition getCompetition() { return competition; } public void setCompetition(Competition competition) { this.competition = competition; } //end region }
1,384
0.629335
0.626445
56
22.714285
22.934467
130
false
false
0
0
0
0
0
0
0.25
false
false
13
9bff9dfabcfd5de1b5015dfe3012b2f8f4922924
7,404,523,667,165
19b9cf46262561f19d5e54de3dcc6af1dbd008e6
/src/ReverseLL.java
24eae8819570cc5a64c546593a22dd81c9f61263
[]
no_license
arnab-ray/assignments
https://github.com/arnab-ray/assignments
559d14006ca848f8b20cf3ee6a518955d3e6164a
e56b38bcf506bab90d5d197a42070ec5371c9cca
refs/heads/master
2022-04-03T10:04:41.384000
2020-02-10T07:00:03
2020-02-10T07:00:03
116,450,895
1
0
null
null
null
null
null
null
null
null
null
null
null
null
null
public class ReverseLL { private static class Node { int val; Node next; Node(int val) { this.val = val; this.next = null; } } private static Node revList(Node head) { if(head == null || head.next == null) return head; Node rest = revList(head.next); head.next.next = head; head.next = null; return rest; } private static Node revListIter(Node head) { if(head == null || head.next == null) return head; Node prev = null, next = null; Node curr = head; while (curr != null) { next = curr.next; curr.next = prev; prev = curr; curr = next; } head = prev; return head; } private static void printList(Node head) { Node temp = head; while(temp != null) { System.out.print(temp.val + " "); temp = temp.next; } System.out.println(); } public static void main(String[] args) { Node head = new Node(1); head.next = new Node(2); head.next.next = new Node(3); head.next.next.next = new Node(4); head.next.next.next.next = new Node(5); printList(head); head = revList(head); printList(head); head = revListIter(head); printList(head); } }
UTF-8
Java
1,444
java
ReverseLL.java
Java
[]
null
[]
public class ReverseLL { private static class Node { int val; Node next; Node(int val) { this.val = val; this.next = null; } } private static Node revList(Node head) { if(head == null || head.next == null) return head; Node rest = revList(head.next); head.next.next = head; head.next = null; return rest; } private static Node revListIter(Node head) { if(head == null || head.next == null) return head; Node prev = null, next = null; Node curr = head; while (curr != null) { next = curr.next; curr.next = prev; prev = curr; curr = next; } head = prev; return head; } private static void printList(Node head) { Node temp = head; while(temp != null) { System.out.print(temp.val + " "); temp = temp.next; } System.out.println(); } public static void main(String[] args) { Node head = new Node(1); head.next = new Node(2); head.next.next = new Node(3); head.next.next.next = new Node(4); head.next.next.next.next = new Node(5); printList(head); head = revList(head); printList(head); head = revListIter(head); printList(head); } }
1,444
0.484072
0.480609
69
19.927536
15.672665
48
false
false
0
0
0
0
0
0
0.536232
false
false
13
47e25e35ab529843ec6b1077fc7d7ab5182dcabe
7,782,480,803,091
a7dbb8bb5ca174ed945e5ac727b5ce4cdc9c2acf
/src/main/java/guides/hazelcast/tomcatsessionmanager/CommandController.java
f5ff27776e2737b758659f297638a5c8cca175b3
[]
no_license
rgidda-west/springboot-tomcat-session-replication
https://github.com/rgidda-west/springboot-tomcat-session-replication
74b0a2a2a9e7ad720f0a46796c68b98b64a6fca6
d00b1effc6335ef162cca46b39db6df2d6ef55b1
refs/heads/master
2023-08-07T00:09:08.827000
2021-10-04T07:59:44
2021-10-04T07:59:44
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package guides.hazelcast.tomcatsessionmanager; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import javax.servlet.http.HttpSession; @RestController public class CommandController { @RequestMapping("/put") public CommandResponse put(HttpSession session, @RequestParam(value = "key") String key, @RequestParam(value = "value") String value) { session.setAttribute(key, value); return new CommandResponse(value); } @RequestMapping("/get") public CommandResponse get(HttpSession session, @RequestParam(value = "key") String key) { String value = (String) session.getAttribute(key); return new CommandResponse(value); } }
UTF-8
Java
820
java
CommandController.java
Java
[]
null
[]
package guides.hazelcast.tomcatsessionmanager; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import javax.servlet.http.HttpSession; @RestController public class CommandController { @RequestMapping("/put") public CommandResponse put(HttpSession session, @RequestParam(value = "key") String key, @RequestParam(value = "value") String value) { session.setAttribute(key, value); return new CommandResponse(value); } @RequestMapping("/get") public CommandResponse get(HttpSession session, @RequestParam(value = "key") String key) { String value = (String) session.getAttribute(key); return new CommandResponse(value); } }
820
0.747561
0.747561
24
33.166668
34.117039
139
false
false
0
0
0
0
0
0
0.541667
false
false
13
056eba67010ba9fda77ae2190bd31f5f44512e8c
9,990,093,996,647
b3d994029fed3d7f7575bd4beaa4024158875782
/app_android/src/android/kankan/TestActivity.java
604afafa49717a1f050d867ad22060b6e0aac686
[]
no_license
RyanTech/kankan
https://github.com/RyanTech/kankan
bd68868825a8dd9456729d953039cd41b0703dff
188b0f6a5c73521aa0b6a6ff1e87921655511595
refs/heads/master
2016-09-07T04:38:04.868000
2013-07-28T13:27:09
2013-07-28T13:27:09
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package android.kankan; import android.app.Activity; import android.os.Bundle; import android.view.Menu; import android.view.MotionEvent; import android.view.View; import android.view.View.OnTouchListener; import android.widget.LinearLayout; public class TestActivity extends Activity implements OnTouchListener { private LinearLayout layout; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.sliding_menu_new); layout = (LinearLayout) findViewById(R.id.profile_layout); layout.setOnTouchListener(this); } @Override public boolean onTouch(View v, MotionEvent event) { // TODO Auto-generated method stub int action = event.getAction(); switch(action) { case MotionEvent.ACTION_DOWN: if (v.getId() == R.id.profile_layout) layout.setBackgroundResource(R.drawable.sliding_menu_selected_background); break; case MotionEvent.ACTION_UP: if (v.getId() == R.id.profile_layout) layout.setBackgroundResource(R.drawable.sliding_menu_background); break; default: if (v.getId() == R.id.profile_layout) layout.setBackgroundResource(R.drawable.sliding_menu_selected_background); break; } return true; } }
UTF-8
Java
1,244
java
TestActivity.java
Java
[]
null
[]
package android.kankan; import android.app.Activity; import android.os.Bundle; import android.view.Menu; import android.view.MotionEvent; import android.view.View; import android.view.View.OnTouchListener; import android.widget.LinearLayout; public class TestActivity extends Activity implements OnTouchListener { private LinearLayout layout; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.sliding_menu_new); layout = (LinearLayout) findViewById(R.id.profile_layout); layout.setOnTouchListener(this); } @Override public boolean onTouch(View v, MotionEvent event) { // TODO Auto-generated method stub int action = event.getAction(); switch(action) { case MotionEvent.ACTION_DOWN: if (v.getId() == R.id.profile_layout) layout.setBackgroundResource(R.drawable.sliding_menu_selected_background); break; case MotionEvent.ACTION_UP: if (v.getId() == R.id.profile_layout) layout.setBackgroundResource(R.drawable.sliding_menu_background); break; default: if (v.getId() == R.id.profile_layout) layout.setBackgroundResource(R.drawable.sliding_menu_selected_background); break; } return true; } }
1,244
0.75
0.75
48
24.916666
22.294275
78
false
false
0
0
0
0
0
0
1.9375
false
false
13
d6410c6bd6cb2d536c2d53f47f5997cad781be18
8,486,855,389,765
54407cc10297e90db781abee9a98c2fabc98beb6
/src/main/java/com/gmail/jannyboy11/customrecipes/impl/crafting/custom/ingredient/CountIngredient.java
cbc63fb9e8649fb0feac205b19818bb91049f713
[ "BSD-2-Clause" ]
permissive
NurPech/CustomRecipes
https://github.com/NurPech/CustomRecipes
40877934d84cc846c338b4b4b340aef14bc5d630
a78d6d15d2885cc7137c6dc59a1cccd6d8c17922
refs/heads/master
2020-06-04T17:34:21.683000
2019-06-15T22:06:27
2019-06-15T22:06:27
192,126,452
0
0
BSD-2-Clause
true
2019-06-15T21:46:12
2019-06-15T21:46:12
2019-05-16T16:51:06
2017-10-24T20:07:36
543
0
0
0
null
false
false
package com.gmail.jannyboy11.customrecipes.impl.crafting.custom.ingredient; import com.gmail.jannyboy11.customrecipes.util.ReflectionUtil; import net.minecraft.server.v1_12_R1.RecipeItemStack; public class CountIngredient extends CombinedIngredient { private final RecipeItemStack basePredicate; private final int count; public CountIngredient(RecipeItemStack basePredicate, int count) { super(basePredicate, itemStack -> itemStack.getCount() == count, Boolean::logicalAnd); this.basePredicate = basePredicate; this.count = count; } @Override public RecipeItemStack asNMSIngredient() { RecipeItemStack recipeItemStack = super.asNMSIngredient(); ReflectionUtil.setFinalFieldValue(recipeItemStack, "choices", basePredicate.choices); return recipeItemStack; } public int getCount() { return count; } }
UTF-8
Java
833
java
CountIngredient.java
Java
[ { "context": "package com.gmail.jannyboy11.customrecipes.impl.crafting.custom.ingredient;\n\ni", "end": 28, "score": 0.8789676427841187, "start": 18, "tag": "USERNAME", "value": "jannyboy11" }, { "context": "mpl.crafting.custom.ingredient;\n\nimport com.gmail.jannyboy11.customrecipes...
null
[]
package com.gmail.jannyboy11.customrecipes.impl.crafting.custom.ingredient; import com.gmail.jannyboy11.customrecipes.util.ReflectionUtil; import net.minecraft.server.v1_12_R1.RecipeItemStack; public class CountIngredient extends CombinedIngredient { private final RecipeItemStack basePredicate; private final int count; public CountIngredient(RecipeItemStack basePredicate, int count) { super(basePredicate, itemStack -> itemStack.getCount() == count, Boolean::logicalAnd); this.basePredicate = basePredicate; this.count = count; } @Override public RecipeItemStack asNMSIngredient() { RecipeItemStack recipeItemStack = super.asNMSIngredient(); ReflectionUtil.setFinalFieldValue(recipeItemStack, "choices", basePredicate.choices); return recipeItemStack; } public int getCount() { return count; } }
833
0.793517
0.783914
29
27.724138
29.059862
88
false
false
0
0
0
0
0
0
1.482759
false
false
13
4645e1274aa98a0da3145c4f7769f516cb9ea38e
25,400,436,655,896
572f7811de3919f21663a52706da3b547dc459b6
/BBQ_GUI_v1/src/java/de/gsi/sd/BBQ_Proto1/data/FESAAdcSettings.java
fdb4579eb2d8910e6db218e45624512825aca6d0
[]
no_license
rahulgsin/GUI
https://github.com/rahulgsin/GUI
274ff3404fe931389081f72d01d9b8c5ab40a28d
dc972e0f6c3832625ac59fdfd1402fa7f073fca6
refs/heads/master
2016-09-05T13:48:53.361000
2014-06-10T22:09:27
2014-06-10T22:09:27
20,052,543
0
0
null
false
2014-06-11T14:09:43
2014-05-22T07:52:22
2014-06-11T14:09:43
2014-06-11T14:06:02
20,588
0
0
1
Java
null
null
/***************************************************************************** * * * PrimerExample1 - Settings of FESA class * * * * modified: 2010-08-04 Harald Braeuning * * * ****************************************************************************/ package de.gsi.sd.BBQ_Proto1.data; /**import de.gsi.sd.BBQ_Proto1.BBQ_GUIApplication;*/ /** * This class contains the ADC settings (mode and trigger, acquisition) settings of the FESA device. */ public class FESAAdcSettings { /** ADC mode and settings */ private byte adcmode; private short [] adcsettings; /** * Get the ADC mode * @return the ADC mode */ public FESAAdcSettings() { adcsettings = new short[10]; } public byte getMode() { return adcmode; } /** * Set the ADC mode * @param Set the ADC mode */ public void setMode(Byte adcmode) { this.adcmode = adcmode; } public double getAdcSettings(int index) { return adcsettings[index]; } public short [] getAdcSettings() { return adcsettings; } public void setAdcSettings(short [] adcsettings) { this.adcsettings = adcsettings; } public void setAdcSettings(short adcsettings,int index) { this.adcsettings[index] = adcsettings; } }
UTF-8
Java
1,507
java
FESAAdcSettings.java
Java
[ { "context": " *\n * modified: 2010-08-04 Harald Braeuning *\n * ", "end": 356, "score": 0.9999017119407654, "start": 340, "tag": "NAME", "value": "Harald Braeuning" } ]
null
[]
/***************************************************************************** * * * PrimerExample1 - Settings of FESA class * * * * modified: 2010-08-04 <NAME> * * * ****************************************************************************/ package de.gsi.sd.BBQ_Proto1.data; /**import de.gsi.sd.BBQ_Proto1.BBQ_GUIApplication;*/ /** * This class contains the ADC settings (mode and trigger, acquisition) settings of the FESA device. */ public class FESAAdcSettings { /** ADC mode and settings */ private byte adcmode; private short [] adcsettings; /** * Get the ADC mode * @return the ADC mode */ public FESAAdcSettings() { adcsettings = new short[10]; } public byte getMode() { return adcmode; } /** * Set the ADC mode * @param Set the ADC mode */ public void setMode(Byte adcmode) { this.adcmode = adcmode; } public double getAdcSettings(int index) { return adcsettings[index]; } public short [] getAdcSettings() { return adcsettings; } public void setAdcSettings(short [] adcsettings) { this.adcsettings = adcsettings; } public void setAdcSettings(short adcsettings,int index) { this.adcsettings[index] = adcsettings; } }
1,497
0.474453
0.465826
65
22.184616
26.781103
101
false
false
0
0
0
0
0
0
0.369231
false
false
13
280156f0cd47f44dc5b2a1674130e54a6f851874
29,326,036,763,576
63ec9e17dbc7f816799bb97839528f1fcce68d4d
/src/test/java/de/kernebeck/escaperoom/escaperoomgame/core/service/entity/impl/WorkflowPartServiceBeanUnitTest.java
8d78340737ec81e6e1e997789e1259472c692cf1
[]
no_license
Kerni92/EscaperoomWorkflowEngine
https://github.com/Kerni92/EscaperoomWorkflowEngine
e3a228dd68c31bc1fb80748aab945aa78ae4a083
c2d037ab251d15a7ebf92994f9941ae9863190a0
refs/heads/main
2023-08-31T13:02:39.677000
2021-10-21T21:34:09
2021-10-21T21:34:09
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package de.kernebeck.escaperoom.escaperoomgame.core.service.entity.impl; import de.kernebeck.escaperoom.escaperoomgame.AbstractUnitTest; import de.kernebeck.escaperoom.escaperoomgame.core.datamodel.entity.definition.WorkflowPart; import de.kernebeck.escaperoom.escaperoomgame.core.datamodel.repository.definition.WorkflowPartRepository; import org.junit.jupiter.api.Test; import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.Mockito; import java.util.Optional; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; class WorkflowPartServiceBeanUnitTest extends AbstractUnitTest { @Mock private WorkflowPartRepository workflowPartRepository; @InjectMocks private WorkflowPartServiceBean workflowPartServiceBean; @Test public void testFindWorkflowPartById() { final WorkflowPart workflowPart = mock(WorkflowPart.class); when(workflowPartRepository.findById(2L)).thenReturn(Optional.of(workflowPart)); assertThat(workflowPartServiceBean.findWorkflowPartById(2L)).isEqualTo(workflowPart); } @Test public void testFindWorkflowPartById_Id_Null() { assertThat(workflowPartServiceBean.findWorkflowPartById(null)).isNull(); Mockito.verifyNoInteractions(workflowPartRepository); } }
UTF-8
Java
1,368
java
WorkflowPartServiceBeanUnitTest.java
Java
[]
null
[]
package de.kernebeck.escaperoom.escaperoomgame.core.service.entity.impl; import de.kernebeck.escaperoom.escaperoomgame.AbstractUnitTest; import de.kernebeck.escaperoom.escaperoomgame.core.datamodel.entity.definition.WorkflowPart; import de.kernebeck.escaperoom.escaperoomgame.core.datamodel.repository.definition.WorkflowPartRepository; import org.junit.jupiter.api.Test; import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.Mockito; import java.util.Optional; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; class WorkflowPartServiceBeanUnitTest extends AbstractUnitTest { @Mock private WorkflowPartRepository workflowPartRepository; @InjectMocks private WorkflowPartServiceBean workflowPartServiceBean; @Test public void testFindWorkflowPartById() { final WorkflowPart workflowPart = mock(WorkflowPart.class); when(workflowPartRepository.findById(2L)).thenReturn(Optional.of(workflowPart)); assertThat(workflowPartServiceBean.findWorkflowPartById(2L)).isEqualTo(workflowPart); } @Test public void testFindWorkflowPartById_Id_Null() { assertThat(workflowPartServiceBean.findWorkflowPartById(null)).isNull(); Mockito.verifyNoInteractions(workflowPartRepository); } }
1,368
0.803363
0.801901
38
35.026318
32.393539
106
false
false
0
0
0
0
0
0
0.5
false
false
13
c981e34d8d9cb5ef0e235d315bb602f50f656bcd
11,536,282,161,420
f50de836b97f9246366ab0a72859f88ccffb8656
/app/src/main/java/com/zy/xxl/dynamicaddview/util/PreCons.java
53bbbe4792d6192ce524a92c49e24875a078d534
[]
no_license
ainiyiwan/DynamicAddView
https://github.com/ainiyiwan/DynamicAddView
ac1b7f6c2c658026b61a7c3d62a9cfa1de57a49d
158425cb6352bdccca508376599919839b568f1a
refs/heads/master
2021-08-17T09:58:03.016000
2017-11-21T02:53:19
2017-11-21T02:53:19
111,490,659
1
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.zy.xxl.dynamicaddview.util; /** * Author : zhangyang * Date : 2017/11/20 * Email : 18610942105@163.com * Description : */ public class PreCons { public static final String FIRST_OPEN_SHARE_ACT = "first_open_shareAct"; }
UTF-8
Java
252
java
PreCons.java
Java
[ { "context": "e com.zy.xxl.dynamicaddview.util;\n\n/**\n * Author : zhangyang\n * Date : 2017/11/20\n * Email : 18610942105@1", "end": 66, "score": 0.9328687787055969, "start": 57, "tag": "USERNAME", "value": "zhangyang" }, { "context": "r : zhangyang\n * Date : 2017/11/20\n * ...
null
[]
package com.zy.xxl.dynamicaddview.util; /** * Author : zhangyang * Date : 2017/11/20 * Email : <EMAIL> * Description : */ public class PreCons { public static final String FIRST_OPEN_SHARE_ACT = "first_open_shareAct"; }
240
0.677419
0.58871
12
19.666666
21.206656
76
false
false
0
0
0
0
0
0
0.166667
false
false
13
1828db1855eb73023e73e02e896956f5b8ec0ca2
16,947,940,961,562
e7b67e2d2f488aa8760c20df0dc7dbf68a43e84e
/src/com/tzmb2c/web/action/HomePackageAction.java
8b40b470e9a6191d8c623a4fabf0b43cdec9267c
[]
no_license
1658544535/java
https://github.com/1658544535/java
573f10b1a4f759444bd9382f5584a26ddc7f6833
e026335e89e3f2ae6c4143e48a0ea0f89870daa0
refs/heads/master
2021-01-11T06:37:55.119000
2017-02-08T03:13:12
2017-02-08T03:13:12
81,417,586
0
1
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.tzmb2c.web.action; import java.io.File; import java.sql.SQLException; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.HashMap; import java.util.List; import java.util.Map; import maowu.framework.utils.web.SuperAction; import net.sf.json.JSONArray; import org.apache.struts2.ServletActionContext; import org.springframework.beans.factory.annotation.Autowired; import com.tzmb2c.common.Pager; import com.tzmb2c.utils.FileUtil; import com.tzmb2c.utils.StringUtil; import com.tzmb2c.web.pojo.ScenePojo; import com.tzmb2c.web.pojo.SceneProductPojo; import com.tzmb2c.web.service.SceneProductService; import com.tzmb2c.web.service.SceneService; public class HomePackageAction extends SuperAction { @Autowired private SceneService sceneService; private ScenePojo scenePojo; private List<ScenePojo> scenePojos; private Integer t;// 操作类型 private File upfile;// 上传图片 private String[] tids; private String result; // private double tempPrice = 0; // private double tempSellPrice = 0; private double tempPrice; private double tempSellPrice; @Autowired private SceneProductService sceneProductService; private SceneProductPojo sceneProductPojo; private List<SceneProductPojo> sceneProductPojos; public String[] getTids() { return tids; } public void setTids(String[] tids) { this.tids = tids; } /** * 设置首页套餐 * * @return * @throws SQLException * @throws ParseException */ public String homePackageManage() throws SQLException, ParseException { if (page == null) { page = new Pager(); } Map<String, Object> map = new HashMap<String, Object>(); map.put("isdelete", "0"); if (scenePojo != null) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); map.put("name", scenePojo.getName().trim()); map.put("status", scenePojo.getStatus()); if (scenePojo.getBeginTimeStr().length() >= 10) { map.put("beginTimeStr", sdf.parse(scenePojo.getBeginTimeStr())); } if (scenePojo.getEndTimeStr().length() >= 10) { map.put("endTimeStr", sdf.parse(scenePojo.getEndTimeStr())); } } map.put("type", 2); int i = sceneService.findSceneCount(map); page.setRowCount(i); return SUCCESS; } /** * 首页套餐列表 * * @return * @throws SQLException */ public String homePackageAllList() throws SQLException { if (page == null) { page = new Pager(); } Map<String, Object> map = new HashMap<String, Object>(); map.put("pageSize", 10); map.put("pageNo", (page.getPageNo() - 1) * page.getPageSize()); map.put("isdelete", "0"); if (scenePojo != null) { map.put("name", scenePojo.getName().trim()); map.put("status", scenePojo.getStatus()); if (scenePojo.getBeginTimeStr().length() >= 10) { map.put("beginTimeStr", scenePojo.getBeginTimeStr()); } if (scenePojo.getEndTimeStr().length() >= 10) { map.put("endTimeStr", scenePojo.getEndTimeStr()); } } map.put("type", 2); scenePojos = sceneService.findSceneList(map); JSONArray json = JSONArray.fromObject(scenePojos); page.setRowCount(scenePojos.size()); page.setResult(json.toString()); return SUCCESS; } /** * 添加/修改首页套餐 * * @return * @throws SQLException */ public String homePackageAdd() throws SQLException { if (t == 2) { if (scenePojo != null) { scenePojo = sceneService.findSceneById(scenePojo.getId()); if (scenePojo != null) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); if (scenePojo.getBeginTime() != null) { scenePojo.setBeginTimeStr(sdf.format(scenePojo.getBeginTime())); } if (scenePojo.getEndTime() != null) { scenePojo.setEndTimeStr(sdf.format(scenePojo.getEndTime())); } HashMap<String, Object> map = new HashMap<String, Object>(); map.put("sceneId", scenePojo.getId()); sceneProductPojos = sceneProductService.findSceneProductList(map); if (sceneProductPojos.size() != 0) { for (SceneProductPojo s : sceneProductPojos) { tempSellPrice += s.getSellingPrice(); tempPrice += s.getDistributionPrice(); } } } } } return SUCCESS; } /** * 添加/修改首页套餐提交 * * @return */ public String homePackageAddOk() { if (t == 1) { try { if (scenePojo != null) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); if (scenePojo.getBeginTimeStr().length() >= 19) { scenePojo.setBeginTime(sdf.parse(scenePojo.getBeginTimeStr())); } if (scenePojo.getEndTimeStr().length() >= 19) { scenePojo.setEndTime(sdf.parse(scenePojo.getEndTimeStr())); } if (upfile != null) { String file_name = StringUtil.getCurrentDateStr() + ".jpg"; String uploadPath = ServletActionContext.getServletContext().getRealPath("/upfiles/homePackage") + File.separator; FileUtil.uploadFile(file_name, uploadPath, "upfiles/homePackage/", upfile); scenePojo.setImage(file_name); } scenePojo.setType(2); scenePojo.setPreview(0); sceneService.insertScene(scenePojo); FileUtil.alertMessageBySkip("添加成功!", "homePackageManage.do"); } } catch (Exception e) { e.printStackTrace(); FileUtil.alertMessageBySkip("添加失败!", "homePackageManage.do"); } } else { try { if (scenePojo != null) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); if (scenePojo.getBeginTimeStr().length() >= 19) { scenePojo.setBeginTime(sdf.parse(scenePojo.getBeginTimeStr())); } if (scenePojo.getEndTimeStr().length() >= 19) { scenePojo.setEndTime(sdf.parse(scenePojo.getEndTimeStr())); } if (upfile != null) { String file_name = StringUtil.getCurrentDateStr() + ".jpg"; String uploadPath = ServletActionContext.getServletContext().getRealPath("/upfiles/homePackage") + File.separator; FileUtil.uploadFile(file_name, uploadPath, "upfiles/homePackage/", upfile); scenePojo.setImage(file_name); } // scenePojo.setType(2); sceneService.updateSceneById(scenePojo); FileUtil.alertMessageBySkip("编辑成功!", "homePackageManage.do"); } } catch (Exception e) { e.printStackTrace(); FileUtil.alertMessageBySkip("编辑失败!", "homePackageManage.do"); } } return null; } /** * 批量删除场首页套餐 * * @return */ public String deletePackageAll() { try { for (String id : tids) { HashMap<String, Object> map = new HashMap<String, Object>(); map.put("sceneId", id); sceneProductPojos = sceneProductService.findSceneProductList(map); if (sceneProductPojos.size() != 0) { for (SceneProductPojo s : sceneProductPojos) { sceneProductService.delSceneProductById(s.getId()); } } sceneService.delSceneById(Long.valueOf(id)); } FileUtil.alertMessageBySkip("删除成功!", "homePackageManage.do"); } catch (Exception e) { e.printStackTrace(); FileUtil.alertMessageBySkip("删除失败!", "homePackageManage.do"); } return null; } /** * 删除首页套餐 * * @return */ public String deletePackage() { try { if (scenePojo != null) { HashMap<String, Object> map = new HashMap<String, Object>(); map.put("sceneId", scenePojo.getId()); sceneProductPojos = sceneProductService.findSceneProductList(map); if (sceneProductPojos.size() != 0) { for (SceneProductPojo s : sceneProductPojos) { sceneProductService.delSceneProductById(s.getId()); } } sceneService.delSceneById(scenePojo.getId()); } setResult("1"); } catch (Exception e) { e.printStackTrace(); setResult("0"); } return SUCCESS; } /** * 批量审核场首页套餐 * * @return */ public String checkPackageAll() { try { for (String id : tids) { sceneService.checkSceneById(Long.valueOf(id)); } FileUtil.alertMessageBySkip("审核成功!", "homePackageManage.do"); } catch (Exception e) { e.printStackTrace(); FileUtil.alertMessageBySkip("审核失败!", "homePackageManage.do"); } return null; } /** * 取消审核首页套餐 * * @return */ public String checkPackage() { try { if (scenePojo != null) { sceneService.checkSceneById(scenePojo.getId()); } setResult("1"); } catch (Exception e) { e.printStackTrace(); setResult("0"); } return SUCCESS; } /** * 审核首页套餐 * * @return */ public String uncheckPackage() { try { if (scenePojo != null) { sceneService.uncheckSceneById(scenePojo.getId()); } setResult("1"); } catch (Exception e) { e.printStackTrace(); setResult("0"); } return SUCCESS; } public File getUpfile() { return upfile; } public void setUpfile(File upfile) { this.upfile = upfile; } public ScenePojo getScenePojo() { return scenePojo; } public void setScenePojo(ScenePojo scenePojo) { this.scenePojo = scenePojo; } public Integer getT() { return t; } public void setT(Integer t) { this.t = t; } public String getResult() { return result; } public void setResult(String result) { this.result = result; } public double getTempPrice() { return tempPrice; } public void setTempPrice(double tempPrice) { this.tempPrice = tempPrice; } public double getTempSellPrice() { return tempSellPrice; } public void setTempSellPrice(double tempSellPrice) { this.tempSellPrice = tempSellPrice; } public SceneProductPojo getSceneProductPojo() { return sceneProductPojo; } public void setSceneProductPojo(SceneProductPojo sceneProductPojo) { this.sceneProductPojo = sceneProductPojo; } }
UTF-8
Java
10,924
java
HomePackageAction.java
Java
[]
null
[]
package com.tzmb2c.web.action; import java.io.File; import java.sql.SQLException; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.HashMap; import java.util.List; import java.util.Map; import maowu.framework.utils.web.SuperAction; import net.sf.json.JSONArray; import org.apache.struts2.ServletActionContext; import org.springframework.beans.factory.annotation.Autowired; import com.tzmb2c.common.Pager; import com.tzmb2c.utils.FileUtil; import com.tzmb2c.utils.StringUtil; import com.tzmb2c.web.pojo.ScenePojo; import com.tzmb2c.web.pojo.SceneProductPojo; import com.tzmb2c.web.service.SceneProductService; import com.tzmb2c.web.service.SceneService; public class HomePackageAction extends SuperAction { @Autowired private SceneService sceneService; private ScenePojo scenePojo; private List<ScenePojo> scenePojos; private Integer t;// 操作类型 private File upfile;// 上传图片 private String[] tids; private String result; // private double tempPrice = 0; // private double tempSellPrice = 0; private double tempPrice; private double tempSellPrice; @Autowired private SceneProductService sceneProductService; private SceneProductPojo sceneProductPojo; private List<SceneProductPojo> sceneProductPojos; public String[] getTids() { return tids; } public void setTids(String[] tids) { this.tids = tids; } /** * 设置首页套餐 * * @return * @throws SQLException * @throws ParseException */ public String homePackageManage() throws SQLException, ParseException { if (page == null) { page = new Pager(); } Map<String, Object> map = new HashMap<String, Object>(); map.put("isdelete", "0"); if (scenePojo != null) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); map.put("name", scenePojo.getName().trim()); map.put("status", scenePojo.getStatus()); if (scenePojo.getBeginTimeStr().length() >= 10) { map.put("beginTimeStr", sdf.parse(scenePojo.getBeginTimeStr())); } if (scenePojo.getEndTimeStr().length() >= 10) { map.put("endTimeStr", sdf.parse(scenePojo.getEndTimeStr())); } } map.put("type", 2); int i = sceneService.findSceneCount(map); page.setRowCount(i); return SUCCESS; } /** * 首页套餐列表 * * @return * @throws SQLException */ public String homePackageAllList() throws SQLException { if (page == null) { page = new Pager(); } Map<String, Object> map = new HashMap<String, Object>(); map.put("pageSize", 10); map.put("pageNo", (page.getPageNo() - 1) * page.getPageSize()); map.put("isdelete", "0"); if (scenePojo != null) { map.put("name", scenePojo.getName().trim()); map.put("status", scenePojo.getStatus()); if (scenePojo.getBeginTimeStr().length() >= 10) { map.put("beginTimeStr", scenePojo.getBeginTimeStr()); } if (scenePojo.getEndTimeStr().length() >= 10) { map.put("endTimeStr", scenePojo.getEndTimeStr()); } } map.put("type", 2); scenePojos = sceneService.findSceneList(map); JSONArray json = JSONArray.fromObject(scenePojos); page.setRowCount(scenePojos.size()); page.setResult(json.toString()); return SUCCESS; } /** * 添加/修改首页套餐 * * @return * @throws SQLException */ public String homePackageAdd() throws SQLException { if (t == 2) { if (scenePojo != null) { scenePojo = sceneService.findSceneById(scenePojo.getId()); if (scenePojo != null) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); if (scenePojo.getBeginTime() != null) { scenePojo.setBeginTimeStr(sdf.format(scenePojo.getBeginTime())); } if (scenePojo.getEndTime() != null) { scenePojo.setEndTimeStr(sdf.format(scenePojo.getEndTime())); } HashMap<String, Object> map = new HashMap<String, Object>(); map.put("sceneId", scenePojo.getId()); sceneProductPojos = sceneProductService.findSceneProductList(map); if (sceneProductPojos.size() != 0) { for (SceneProductPojo s : sceneProductPojos) { tempSellPrice += s.getSellingPrice(); tempPrice += s.getDistributionPrice(); } } } } } return SUCCESS; } /** * 添加/修改首页套餐提交 * * @return */ public String homePackageAddOk() { if (t == 1) { try { if (scenePojo != null) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); if (scenePojo.getBeginTimeStr().length() >= 19) { scenePojo.setBeginTime(sdf.parse(scenePojo.getBeginTimeStr())); } if (scenePojo.getEndTimeStr().length() >= 19) { scenePojo.setEndTime(sdf.parse(scenePojo.getEndTimeStr())); } if (upfile != null) { String file_name = StringUtil.getCurrentDateStr() + ".jpg"; String uploadPath = ServletActionContext.getServletContext().getRealPath("/upfiles/homePackage") + File.separator; FileUtil.uploadFile(file_name, uploadPath, "upfiles/homePackage/", upfile); scenePojo.setImage(file_name); } scenePojo.setType(2); scenePojo.setPreview(0); sceneService.insertScene(scenePojo); FileUtil.alertMessageBySkip("添加成功!", "homePackageManage.do"); } } catch (Exception e) { e.printStackTrace(); FileUtil.alertMessageBySkip("添加失败!", "homePackageManage.do"); } } else { try { if (scenePojo != null) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); if (scenePojo.getBeginTimeStr().length() >= 19) { scenePojo.setBeginTime(sdf.parse(scenePojo.getBeginTimeStr())); } if (scenePojo.getEndTimeStr().length() >= 19) { scenePojo.setEndTime(sdf.parse(scenePojo.getEndTimeStr())); } if (upfile != null) { String file_name = StringUtil.getCurrentDateStr() + ".jpg"; String uploadPath = ServletActionContext.getServletContext().getRealPath("/upfiles/homePackage") + File.separator; FileUtil.uploadFile(file_name, uploadPath, "upfiles/homePackage/", upfile); scenePojo.setImage(file_name); } // scenePojo.setType(2); sceneService.updateSceneById(scenePojo); FileUtil.alertMessageBySkip("编辑成功!", "homePackageManage.do"); } } catch (Exception e) { e.printStackTrace(); FileUtil.alertMessageBySkip("编辑失败!", "homePackageManage.do"); } } return null; } /** * 批量删除场首页套餐 * * @return */ public String deletePackageAll() { try { for (String id : tids) { HashMap<String, Object> map = new HashMap<String, Object>(); map.put("sceneId", id); sceneProductPojos = sceneProductService.findSceneProductList(map); if (sceneProductPojos.size() != 0) { for (SceneProductPojo s : sceneProductPojos) { sceneProductService.delSceneProductById(s.getId()); } } sceneService.delSceneById(Long.valueOf(id)); } FileUtil.alertMessageBySkip("删除成功!", "homePackageManage.do"); } catch (Exception e) { e.printStackTrace(); FileUtil.alertMessageBySkip("删除失败!", "homePackageManage.do"); } return null; } /** * 删除首页套餐 * * @return */ public String deletePackage() { try { if (scenePojo != null) { HashMap<String, Object> map = new HashMap<String, Object>(); map.put("sceneId", scenePojo.getId()); sceneProductPojos = sceneProductService.findSceneProductList(map); if (sceneProductPojos.size() != 0) { for (SceneProductPojo s : sceneProductPojos) { sceneProductService.delSceneProductById(s.getId()); } } sceneService.delSceneById(scenePojo.getId()); } setResult("1"); } catch (Exception e) { e.printStackTrace(); setResult("0"); } return SUCCESS; } /** * 批量审核场首页套餐 * * @return */ public String checkPackageAll() { try { for (String id : tids) { sceneService.checkSceneById(Long.valueOf(id)); } FileUtil.alertMessageBySkip("审核成功!", "homePackageManage.do"); } catch (Exception e) { e.printStackTrace(); FileUtil.alertMessageBySkip("审核失败!", "homePackageManage.do"); } return null; } /** * 取消审核首页套餐 * * @return */ public String checkPackage() { try { if (scenePojo != null) { sceneService.checkSceneById(scenePojo.getId()); } setResult("1"); } catch (Exception e) { e.printStackTrace(); setResult("0"); } return SUCCESS; } /** * 审核首页套餐 * * @return */ public String uncheckPackage() { try { if (scenePojo != null) { sceneService.uncheckSceneById(scenePojo.getId()); } setResult("1"); } catch (Exception e) { e.printStackTrace(); setResult("0"); } return SUCCESS; } public File getUpfile() { return upfile; } public void setUpfile(File upfile) { this.upfile = upfile; } public ScenePojo getScenePojo() { return scenePojo; } public void setScenePojo(ScenePojo scenePojo) { this.scenePojo = scenePojo; } public Integer getT() { return t; } public void setT(Integer t) { this.t = t; } public String getResult() { return result; } public void setResult(String result) { this.result = result; } public double getTempPrice() { return tempPrice; } public void setTempPrice(double tempPrice) { this.tempPrice = tempPrice; } public double getTempSellPrice() { return tempSellPrice; } public void setTempSellPrice(double tempSellPrice) { this.tempSellPrice = tempSellPrice; } public SceneProductPojo getSceneProductPojo() { return sceneProductPojo; } public void setSceneProductPojo(SceneProductPojo sceneProductPojo) { this.sceneProductPojo = sceneProductPojo; } }
10,924
0.594089
0.5896
372
26.741936
22.787424
92
false
false
0
0
0
0
0
0
0.502688
false
false
13
434f1ca3c1358fc51b317e5bbcff3dac2512585e
10,118,942,963,740
90e07ca48504b8450a2f675ee8991af4a94c6400
/river-ms-project/src/main/java/com/river/ms/project/entity/ResRefRoleOrg.java
1e6c457b2413c5b96b4840747c6e5b175b768de0
[]
no_license
moutainhigh/touzi
https://github.com/moutainhigh/touzi
78e1881cc2a104c56c22157e39c7aa55686bebc8
e34fe04148c82a87bef6263f145917118d5c89de
refs/heads/master
2021-09-19T02:33:50.190000
2018-07-22T10:49:23
2018-07-22T10:49:23
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.river.ms.project.entity; import com.baomidou.mybatisplus.enums.IdType; import com.baomidou.mybatisplus.annotations.TableId; import com.baomidou.mybatisplus.annotations.TableName; import java.io.Serializable; /** * <p> * * </p> * * @author zyb * @since 2018-04-19 */ @TableName("res_ref_role_org") public class ResRefRoleOrg implements Serializable { private static final long serialVersionUID = 1L; /** * 实体ID */ @TableId(value="entityId", type= IdType.AUTO) private Long entityId; /** * 资源ID */ private Long resourceId; /** * 资源itcode */ private String itcode; /** * 角色ID */ private Long roleId; /** * 公司编码 */ private String groupCode; /** * 是否包含下级 0-不包含,1-包含 */ private Integer isIncludeSubordinate; /** * 是否是本人所在组织机构 0-不是,1-是 */ private Integer isOneselfOrg; /** * 是否可查看全部 0-不是,1-是 */ private Integer isAll; public Long getEntityId() { return entityId; } public void setEntityId(Long entityId) { this.entityId = entityId; } public Long getResourceId() { return resourceId; } public void setResourceId(Long resourceId) { this.resourceId = resourceId; } public String getItcode() { return itcode; } public void setItcode(String itcode) { this.itcode = itcode; } public Long getRoleId() { return roleId; } public void setRoleId(Long roleId) { this.roleId = roleId; } public String getGroupCode() { return groupCode; } public void setGroupCode(String groupCode) { this.groupCode = groupCode; } public Integer getIsIncludeSubordinate() { return isIncludeSubordinate; } public void setIsIncludeSubordinate(Integer isIncludeSubordinate) { this.isIncludeSubordinate = isIncludeSubordinate; } public Integer getIsOneselfOrg() { return isOneselfOrg; } public void setIsOneselfOrg(Integer isOneselfOrg) { this.isOneselfOrg = isOneselfOrg; } public Integer getIsAll() { return isAll; } public void setIsAll(Integer isAll) { this.isAll = isAll; } @Override public String toString() { return "ResRefRoleOrg{" + ", entityId=" + entityId + ", resourceId=" + resourceId + ", itcode=" + itcode + ", roleId=" + roleId + ", groupCode=" + groupCode + ", isIncludeSubordinate=" + isIncludeSubordinate + ", isOneselfOrg=" + isOneselfOrg + ", isAll=" + isAll + "}"; } }
UTF-8
Java
2,512
java
ResRefRoleOrg.java
Java
[ { "context": "erializable;\n\n/**\n * <p>\n * \n * </p>\n *\n * @author zyb\n * @since 2018-04-19\n */\n@TableName(\"res_ref_role", "end": 262, "score": 0.9996299743652344, "start": 259, "tag": "USERNAME", "value": "zyb" } ]
null
[]
package com.river.ms.project.entity; import com.baomidou.mybatisplus.enums.IdType; import com.baomidou.mybatisplus.annotations.TableId; import com.baomidou.mybatisplus.annotations.TableName; import java.io.Serializable; /** * <p> * * </p> * * @author zyb * @since 2018-04-19 */ @TableName("res_ref_role_org") public class ResRefRoleOrg implements Serializable { private static final long serialVersionUID = 1L; /** * 实体ID */ @TableId(value="entityId", type= IdType.AUTO) private Long entityId; /** * 资源ID */ private Long resourceId; /** * 资源itcode */ private String itcode; /** * 角色ID */ private Long roleId; /** * 公司编码 */ private String groupCode; /** * 是否包含下级 0-不包含,1-包含 */ private Integer isIncludeSubordinate; /** * 是否是本人所在组织机构 0-不是,1-是 */ private Integer isOneselfOrg; /** * 是否可查看全部 0-不是,1-是 */ private Integer isAll; public Long getEntityId() { return entityId; } public void setEntityId(Long entityId) { this.entityId = entityId; } public Long getResourceId() { return resourceId; } public void setResourceId(Long resourceId) { this.resourceId = resourceId; } public String getItcode() { return itcode; } public void setItcode(String itcode) { this.itcode = itcode; } public Long getRoleId() { return roleId; } public void setRoleId(Long roleId) { this.roleId = roleId; } public String getGroupCode() { return groupCode; } public void setGroupCode(String groupCode) { this.groupCode = groupCode; } public Integer getIsIncludeSubordinate() { return isIncludeSubordinate; } public void setIsIncludeSubordinate(Integer isIncludeSubordinate) { this.isIncludeSubordinate = isIncludeSubordinate; } public Integer getIsOneselfOrg() { return isOneselfOrg; } public void setIsOneselfOrg(Integer isOneselfOrg) { this.isOneselfOrg = isOneselfOrg; } public Integer getIsAll() { return isAll; } public void setIsAll(Integer isAll) { this.isAll = isAll; } @Override public String toString() { return "ResRefRoleOrg{" + ", entityId=" + entityId + ", resourceId=" + resourceId + ", itcode=" + itcode + ", roleId=" + roleId + ", groupCode=" + groupCode + ", isIncludeSubordinate=" + isIncludeSubordinate + ", isOneselfOrg=" + isOneselfOrg + ", isAll=" + isAll + "}"; } }
2,512
0.661692
0.655473
133
17.135338
16.395388
68
false
false
0
0
0
0
0
0
1.090226
false
false
13
6e314b28850434ad3c0e5d791bbb855d86452c35
24,318,104,857,304
3b091bb35f0f0352b341c3e3f385adf5d3f0a490
/like-shiro/src/main/java/com/janita/like/service/base/RoleService.java
308d7a5caa5d3f18911cb5d2a2043e16930ddc7e
[]
no_license
janforp/shiro-parent
https://github.com/janforp/shiro-parent
abdf15014a2f15b172719a227f18345b3a65ee04
fff157938e5b1c400f183cdd6a924e76cbce037f
refs/heads/master
2020-04-05T13:05:08.352000
2017-07-04T08:10:31
2017-07-04T08:10:31
94,745,581
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.janita.like.service.base; import com.janita.like.dao.RoleDAO; import com.janita.like.entity.Role; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; /** * Created by Janita on 2017/6/21 0021-下午 12:45 * 该类是: */ @Service public class RoleService { private final RoleDAO roleDAO; @Autowired(required = false) public RoleService(RoleDAO roleDAO) { this.roleDAO = roleDAO; } /** * 根据 roleId 列表 查询 对应的 role 列表 * @param roleIds * @return */ public List<Role> getRoleListByRoleIdList(List<String> roleIds) { if (!roleIds.isEmpty()) { return roleDAO.getRoleListByRoleIdList(roleIds); } return null; } }
UTF-8
Java
823
java
RoleService.java
Java
[ { "context": "ervice;\n\nimport java.util.List;\n\n/**\n * Created by Janita on 2017/6/21 0021-下午 12:45\n * 该类是:\n */\n@Service\np", "end": 270, "score": 0.9969726204872131, "start": 264, "tag": "USERNAME", "value": "Janita" } ]
null
[]
package com.janita.like.service.base; import com.janita.like.dao.RoleDAO; import com.janita.like.entity.Role; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; /** * Created by Janita on 2017/6/21 0021-下午 12:45 * 该类是: */ @Service public class RoleService { private final RoleDAO roleDAO; @Autowired(required = false) public RoleService(RoleDAO roleDAO) { this.roleDAO = roleDAO; } /** * 根据 roleId 列表 查询 对应的 role 列表 * @param roleIds * @return */ public List<Role> getRoleListByRoleIdList(List<String> roleIds) { if (!roleIds.isEmpty()) { return roleDAO.getRoleListByRoleIdList(roleIds); } return null; } }
823
0.669201
0.65019
35
21.542856
19.806698
69
false
false
0
0
0
0
0
0
0.285714
false
false
13
17e5a22773ce585df8ab94ea59c464e85beaa474
31,739,808,342,861
bf4122f5ae3a9f9b9c2cc94ef87cdb9dcadc9dc9
/Transfer/TYSS_PROJECTS/Module1Project/phonesimulator/src/com/tyss/phonesimulator/controller/Validation.java
5a40a8a59a410a991e362955048847e413b9a243
[]
no_license
haren7474/TY_ELF_JFS_HarendraKumar
https://github.com/haren7474/TY_ELF_JFS_HarendraKumar
7ef8b9a0bb6d6bdddb94b88ab2db4e0aef0fbc1d
f99ef30b40d0877167c8159e8b7f322af7cc87b9
refs/heads/master
2023-01-11T01:01:10.458000
2020-01-23T18:20:20
2020-01-23T18:20:20
225,845,989
0
0
null
false
2023-01-07T22:01:21
2019-12-04T11:00:37
2020-01-23T18:20:44
2023-01-07T22:01:20
156,906
0
0
172
HTML
false
false
package com.tyss.phonesimulator.controller; public class Validation { public static boolean checkName(String cname) { return cname.matches("[A-Z][a-z]*") && cname.length()>3 && cname.length()<10; } }
UTF-8
Java
205
java
Validation.java
Java
[]
null
[]
package com.tyss.phonesimulator.controller; public class Validation { public static boolean checkName(String cname) { return cname.matches("[A-Z][a-z]*") && cname.length()>3 && cname.length()<10; } }
205
0.707317
0.692683
7
28.285715
27.834789
79
false
false
0
0
0
0
0
0
0.857143
false
false
13
6e3d05ba65fb200ffbf5d4085dde97b9501b69c4
28,724,741,325,022
e18f2e986dbb40c38dd84e37940be350d60241c1
/app/src/main/java/ecuaciones/gt/com/ecuaciones/Ecuacion2IncognitasRelleno.java
cedf615e61808bc0abe325c5cfe87315c52476d5
[]
no_license
EduardoColon/Ecuaciones-master
https://github.com/EduardoColon/Ecuaciones-master
b82dfaffebd2943ad796184fa51394f17895c5cd
59144ed132e7a433881d0b51d40625739a9bc7f4
refs/heads/master
2019-05-13T15:37:30.491000
2016-08-05T22:51:15
2016-08-05T22:51:15
64,962,730
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package ecuaciones.gt.com.ecuaciones; import android.content.DialogInterface; import android.graphics.Color; import android.support.v7.app.AlertDialog; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.support.v7.widget.Toolbar; import android.view.View; import android.widget.CompoundButton; import android.widget.EditText; import android.widget.Switch; import android.widget.TextView; import com.andexert.library.RippleView; public class Ecuacion2IncognitasRelleno extends AppCompatActivity implements CompoundButton.OnCheckedChangeListener, View.OnClickListener{ private Toolbar toolbar; private EditText x1, x2, y1, y2, igual1, igual2; private RippleView calcular; private TextView respuestaX, respuestaY, sX1, sX2, sY1, sY2, sI1, sI2;; private Switch switchx1, switchx2, switchy1, switchy2, switchI1, switchI2; private Integer intX1, intX2, intY1, intY2, intI1, intI2, rojoColor = Color.YELLOW, blancoColor = Color.WHITE; ; private String stringX1, stringX2, stringY1, stringY2, stringI1, stringI2; private Boolean bX1, bX2, bY1, bY2, bI1, bI2; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.principal); iniciaVars(); } private void iniciaVars() { bX1 = bX2 = bY1 = bY2 = bI1 = bI2 = true; intX1 = intX2 = intY1 = intY2 = intI1 = intI2 = 0; toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); setTitle(getString(R.string.ecuaciones)); x1 = (EditText) findViewById(R.id.x1); x2 = (EditText) findViewById(R.id.x2); y1 = (EditText) findViewById(R.id.y1); y2 = (EditText) findViewById(R.id.y2); igual1 = (EditText) findViewById(R.id.igual1); igual2 = (EditText) findViewById(R.id.igual2); switchI1 = (Switch) findViewById(R.id.switchigual1); switchx1 = (Switch) findViewById(R.id.switchx1); switchy1 = (Switch) findViewById(R.id.switchy1); switchI2 = (Switch) findViewById(R.id.switchigual2); switchx2 = (Switch) findViewById(R.id.switchx2); switchy2 = (Switch) findViewById(R.id.switchy2); switchx1.setOnCheckedChangeListener(this); switchx2.setOnCheckedChangeListener(this); switchy1.setOnCheckedChangeListener(this); switchy2.setOnCheckedChangeListener(this); switchI1.setOnCheckedChangeListener(this); switchI2.setOnCheckedChangeListener(this); respuestaX = (TextView) findViewById(R.id.respuestaX); respuestaY = (TextView) findViewById(R.id.respuestaY); sX1 = (TextView) findViewById(R.id.tvSignoX1); sX2 = (TextView) findViewById(R.id.tvSignoX2); sY1 = (TextView) findViewById(R.id.tvSignoY1); sY2 = (TextView) findViewById(R.id.tvSignoY2); sI1 = (TextView) findViewById(R.id.tvSignoI1); sI2 = (TextView) findViewById(R.id.tvSignoI2); calcular = (RippleView) findViewById(R.id.rvCalcular); igual1.setOnClickListener(this); igual2.setOnClickListener(this); calcular.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { stringX1 = x1.getText().toString(); stringX2 = x2.getText().toString(); stringY1 = y1.getText().toString(); stringY2 = y2.getText().toString(); stringI1 = igual1.getText().toString(); stringI2 = igual2.getText().toString(); } }); calcular.setOnRippleCompleteListener(new RippleView.OnRippleCompleteListener() { @Override public void onComplete(RippleView rippleView) { if(stringX1.matches("")){ stringX1 = "1"; } if(stringX2.matches("")){ stringX2 = "1"; } if(stringY1.matches("")){ stringY1 = "1"; } if(stringY2.matches("")){ stringY2 = "1"; } if(stringI1.matches("") ||stringI2.matches("")){ if(stringI1.matches("")) igual1.setBackgroundColor(rojoColor); if(stringI2.matches("")) igual2.setBackgroundColor(rojoColor); new AlertDialog.Builder(Ecuacion2IncognitasRelleno.this).setTitle("Error"). setMessage("Debe rellenar los campos indicados"). setPositiveButton("Ok", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { } }).setIcon(R.drawable.matematica).show(); }else{ intI1 = Integer.parseInt(stringI1); intI2 = Integer.parseInt(stringI2); } intX1 = Integer.parseInt(stringX1); intX2 = Integer.parseInt(stringX2); intY1 = Integer.parseInt(stringY1); intY2 = Integer.parseInt(stringY2); new Ecuacion2Incognitas(respuestaX, respuestaY, intX1, intX2 , intY1, intY2, intI1, intI2, bX1, bX2, bY1, bY2 , bI1, bI2).execute(); } }); } @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { switch(buttonView.getId()){ case R.id.switchx1: if(!switchx1.isChecked()) { bX1 = true; sX1.setText(""); }else{ bX1 = false; sX1.setText("-"); } break; case R.id.switchx2: if(!switchx2.isChecked()) { bX2 = true; sX2.setText(""); }else{ bX2 = false; sX2.setText("-"); } break; case R.id.switchy1: if(!switchy1.isChecked()) { bY1 = true; sY1.setText("+"); }else{ bY1 = false; sY1.setText("-"); } break; case R.id.switchy2: if(!switchy2.isChecked()) { bY2 = true; sY2.setText("+"); }else{ bY2 = false; sY2.setText("-"); } break; case R.id.switchigual1: if(!switchI1.isChecked()) { bI1 = true; sI1.setText(""); }else{ bI1 = false; sI1.setText("-"); } break; case R.id.switchigual2: if(!switchI2.isChecked()) { bI2 = true; sI2.setText(""); }else{ bI2 = false; sI2.setText("-"); } break; } } @Override public void onClick(View v) { switch (v.getId()){ case R.id.igual1: igual1.setBackgroundColor(blancoColor); break; case R.id.igual2: igual2.setBackgroundColor(blancoColor); break; } } }
UTF-8
Java
7,780
java
Ecuacion2IncognitasRelleno.java
Java
[]
null
[]
package ecuaciones.gt.com.ecuaciones; import android.content.DialogInterface; import android.graphics.Color; import android.support.v7.app.AlertDialog; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.support.v7.widget.Toolbar; import android.view.View; import android.widget.CompoundButton; import android.widget.EditText; import android.widget.Switch; import android.widget.TextView; import com.andexert.library.RippleView; public class Ecuacion2IncognitasRelleno extends AppCompatActivity implements CompoundButton.OnCheckedChangeListener, View.OnClickListener{ private Toolbar toolbar; private EditText x1, x2, y1, y2, igual1, igual2; private RippleView calcular; private TextView respuestaX, respuestaY, sX1, sX2, sY1, sY2, sI1, sI2;; private Switch switchx1, switchx2, switchy1, switchy2, switchI1, switchI2; private Integer intX1, intX2, intY1, intY2, intI1, intI2, rojoColor = Color.YELLOW, blancoColor = Color.WHITE; ; private String stringX1, stringX2, stringY1, stringY2, stringI1, stringI2; private Boolean bX1, bX2, bY1, bY2, bI1, bI2; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.principal); iniciaVars(); } private void iniciaVars() { bX1 = bX2 = bY1 = bY2 = bI1 = bI2 = true; intX1 = intX2 = intY1 = intY2 = intI1 = intI2 = 0; toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); setTitle(getString(R.string.ecuaciones)); x1 = (EditText) findViewById(R.id.x1); x2 = (EditText) findViewById(R.id.x2); y1 = (EditText) findViewById(R.id.y1); y2 = (EditText) findViewById(R.id.y2); igual1 = (EditText) findViewById(R.id.igual1); igual2 = (EditText) findViewById(R.id.igual2); switchI1 = (Switch) findViewById(R.id.switchigual1); switchx1 = (Switch) findViewById(R.id.switchx1); switchy1 = (Switch) findViewById(R.id.switchy1); switchI2 = (Switch) findViewById(R.id.switchigual2); switchx2 = (Switch) findViewById(R.id.switchx2); switchy2 = (Switch) findViewById(R.id.switchy2); switchx1.setOnCheckedChangeListener(this); switchx2.setOnCheckedChangeListener(this); switchy1.setOnCheckedChangeListener(this); switchy2.setOnCheckedChangeListener(this); switchI1.setOnCheckedChangeListener(this); switchI2.setOnCheckedChangeListener(this); respuestaX = (TextView) findViewById(R.id.respuestaX); respuestaY = (TextView) findViewById(R.id.respuestaY); sX1 = (TextView) findViewById(R.id.tvSignoX1); sX2 = (TextView) findViewById(R.id.tvSignoX2); sY1 = (TextView) findViewById(R.id.tvSignoY1); sY2 = (TextView) findViewById(R.id.tvSignoY2); sI1 = (TextView) findViewById(R.id.tvSignoI1); sI2 = (TextView) findViewById(R.id.tvSignoI2); calcular = (RippleView) findViewById(R.id.rvCalcular); igual1.setOnClickListener(this); igual2.setOnClickListener(this); calcular.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { stringX1 = x1.getText().toString(); stringX2 = x2.getText().toString(); stringY1 = y1.getText().toString(); stringY2 = y2.getText().toString(); stringI1 = igual1.getText().toString(); stringI2 = igual2.getText().toString(); } }); calcular.setOnRippleCompleteListener(new RippleView.OnRippleCompleteListener() { @Override public void onComplete(RippleView rippleView) { if(stringX1.matches("")){ stringX1 = "1"; } if(stringX2.matches("")){ stringX2 = "1"; } if(stringY1.matches("")){ stringY1 = "1"; } if(stringY2.matches("")){ stringY2 = "1"; } if(stringI1.matches("") ||stringI2.matches("")){ if(stringI1.matches("")) igual1.setBackgroundColor(rojoColor); if(stringI2.matches("")) igual2.setBackgroundColor(rojoColor); new AlertDialog.Builder(Ecuacion2IncognitasRelleno.this).setTitle("Error"). setMessage("Debe rellenar los campos indicados"). setPositiveButton("Ok", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { } }).setIcon(R.drawable.matematica).show(); }else{ intI1 = Integer.parseInt(stringI1); intI2 = Integer.parseInt(stringI2); } intX1 = Integer.parseInt(stringX1); intX2 = Integer.parseInt(stringX2); intY1 = Integer.parseInt(stringY1); intY2 = Integer.parseInt(stringY2); new Ecuacion2Incognitas(respuestaX, respuestaY, intX1, intX2 , intY1, intY2, intI1, intI2, bX1, bX2, bY1, bY2 , bI1, bI2).execute(); } }); } @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { switch(buttonView.getId()){ case R.id.switchx1: if(!switchx1.isChecked()) { bX1 = true; sX1.setText(""); }else{ bX1 = false; sX1.setText("-"); } break; case R.id.switchx2: if(!switchx2.isChecked()) { bX2 = true; sX2.setText(""); }else{ bX2 = false; sX2.setText("-"); } break; case R.id.switchy1: if(!switchy1.isChecked()) { bY1 = true; sY1.setText("+"); }else{ bY1 = false; sY1.setText("-"); } break; case R.id.switchy2: if(!switchy2.isChecked()) { bY2 = true; sY2.setText("+"); }else{ bY2 = false; sY2.setText("-"); } break; case R.id.switchigual1: if(!switchI1.isChecked()) { bI1 = true; sI1.setText(""); }else{ bI1 = false; sI1.setText("-"); } break; case R.id.switchigual2: if(!switchI2.isChecked()) { bI2 = true; sI2.setText(""); }else{ bI2 = false; sI2.setText("-"); } break; } } @Override public void onClick(View v) { switch (v.getId()){ case R.id.igual1: igual1.setBackgroundColor(blancoColor); break; case R.id.igual2: igual2.setBackgroundColor(blancoColor); break; } } }
7,780
0.519152
0.494344
241
31.282158
24.576481
138
false
false
0
0
0
0
0
0
0.701245
false
false
13
416bf477715962964231b397f2cf726904c664dc
28,621,662,099,229
107e011afb4055fd39e9777108d4bca40c125976
/Gateway/src/main/java/imt/atlantique/sss/upas/cricket/entities/Position.java
32619b12a6248b6563350119b4e596ebac030756
[]
no_license
ahenteti/CricketProject
https://github.com/ahenteti/CricketProject
a804df043321d8eb725aa4a5aa73a828d1bce8cb
523b8ea80c9d31f1aafebf98af351f2fa67f2610
refs/heads/master
2017-12-02T12:45:30.965000
2017-03-18T00:22:16
2017-03-18T00:22:16
85,363,046
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package imt.atlantique.sss.upas.cricket.entities; /** * X, Y, Z coordinate. * * * @author Allen Miu */ public class Position { private double x; private double y; private double z; public Position(double x, double y, double z) { this.x = x; this.y = y; this.z = z; } public String toString() { if (invalid()) return "invalid"; else return x + "|" + y + "|" + z; } public boolean equals(Object o) { if (!(o instanceof Position)) return false; Position p = (Position) o; return (p.x == x) && (p.y == y) && (p.z == z); } public static double sqr(double v) { return v * v; } public double dist(Position o) { return dist(o.x, o.y, o.z); } public double dist(double ox, double oy, double oz) { return Math.sqrt(sqr(x - ox) + sqr(y - oy) + sqr(z - oz)); } public boolean invalid() { return (Double.isNaN(x) || Double.isNaN(y) || Double.isNaN(z)); } public static Position weightSum(double w1, Position p1, double w2, Position p2) { if (p1 == null) if (p2 == null) return null; else return new Position(p2.x, p2.y, p2.z); if (p2 == null) return new Position(p1.x, p1.y, p1.z); double x = w1 * p1.x + w2 * p2.x; double y = w1 * p1.y + w2 * p2.y; double z = w1 * p1.z + w2 * p2.z; return new Position(x, y, z); } public double getX() { return x; } public void setX(double x) { this.x = x; } public double getY() { return y; } public void setY(double y) { this.y = y; } public double getZ() { return z; } public void setZ(double z) { this.z = z; } }
UTF-8
Java
1,574
java
Position.java
Java
[ { "context": "ties;\n\n/**\n * X, Y, Z coordinate.\n *\n *\n * @author Allen Miu\n */\npublic class Position {\n\t\n\tprivate double x;\n", "end": 104, "score": 0.9998029470443726, "start": 95, "tag": "NAME", "value": "Allen Miu" } ]
null
[]
package imt.atlantique.sss.upas.cricket.entities; /** * X, Y, Z coordinate. * * * @author <NAME> */ public class Position { private double x; private double y; private double z; public Position(double x, double y, double z) { this.x = x; this.y = y; this.z = z; } public String toString() { if (invalid()) return "invalid"; else return x + "|" + y + "|" + z; } public boolean equals(Object o) { if (!(o instanceof Position)) return false; Position p = (Position) o; return (p.x == x) && (p.y == y) && (p.z == z); } public static double sqr(double v) { return v * v; } public double dist(Position o) { return dist(o.x, o.y, o.z); } public double dist(double ox, double oy, double oz) { return Math.sqrt(sqr(x - ox) + sqr(y - oy) + sqr(z - oz)); } public boolean invalid() { return (Double.isNaN(x) || Double.isNaN(y) || Double.isNaN(z)); } public static Position weightSum(double w1, Position p1, double w2, Position p2) { if (p1 == null) if (p2 == null) return null; else return new Position(p2.x, p2.y, p2.z); if (p2 == null) return new Position(p1.x, p1.y, p1.z); double x = w1 * p1.x + w2 * p2.x; double y = w1 * p1.y + w2 * p2.y; double z = w1 * p1.z + w2 * p2.z; return new Position(x, y, z); } public double getX() { return x; } public void setX(double x) { this.x = x; } public double getY() { return y; } public void setY(double y) { this.y = y; } public double getZ() { return z; } public void setZ(double z) { this.z = z; } }
1,571
0.581957
0.566074
93
15.924731
17.399937
83
false
false
0
0
0
0
0
0
1.731183
false
false
13
44feaca8ee4b070b4dcf7b95cafd87a8a33fad84
29,515,015,297,047
a03ab25431c9142d6ddc5efafc609d7875af38d2
/PS2/Geometry.java
adbcb27aa774393cfdb7bb3d19457c1467a27bbd
[]
no_license
sidHathi/CS10
https://github.com/sidHathi/CS10
047d89c8848439251afe3e7c3a9ea21129d13ce0
5a9f5c33e6d2fc951bdda3fc8bc45c74e5e0dfed
refs/heads/master
2023-06-26T22:06:56.685000
2021-04-24T22:29:25
2021-04-24T22:29:25
361,274,885
0
1
null
null
null
null
null
null
null
null
null
null
null
null
null
/** * Geometry helper methods * * @author Chris Bailey-Kellogg, Dartmouth CS 10, Spring 2015 * @author CBK, Fall 2016, separated from quadtree, instrumented to count calls * */ public class Geometry { private static int numInCircleTests = 0; // keeps track of how many times pointInCircle has been called private static int numCircleRectangleTests = 0; // keeps track of how many times circleIntersectsRectangle has been called public static int getNumInCircleTests() { return numInCircleTests; } public static void resetNumInCircleTests() { numInCircleTests = 0; } public static int getNumCircleRectangleTests() { return numCircleRectangleTests; } public static void resetNumCircleRectangleTests() { numCircleRectangleTests = 0; } /** * Returns whether or not the point is within the circle * @param px point x coord * @param py point y coord * @param cx circle center x * @param cy circle center y * @param cr circle radius */ public static boolean pointInCircle(double px, double py, double cx, double cy, double cr) { numInCircleTests++; return (px-cx)*(px-cx) + (py-cy)*(py-cy) <= cr*cr; } /** * Returns whether or not the circle intersects the rectangle * Based on discussion at http://stackoverflow.com/questions/401847/circle-rectangle-collision-detection-intersection * @param cx circle center x * @param cy circle center y * @param cr circle radius * @param x1 rectangle min x * @param y1 rectangle min y * @param x2 rectangle max x * @param y2 rectangle max y */ public static boolean circleIntersectsRectangle(double cx, double cy, double cr, double x1, double y1, double x2, double y2) { numCircleRectangleTests++; double closestX = Math.min(Math.max(cx, x1), x2); double closestY = Math.min(Math.max(cy, y1), y2); return (cx-closestX)*(cx-closestX) + (cy-closestY)*(cy-closestY) <= cr*cr; } }
UTF-8
Java
1,908
java
Geometry.java
Java
[ { "context": "/**\n * Geometry helper methods\n * \n * @author Chris Bailey-Kellogg, Dartmouth CS 10, Spring 2015\n * @author C", "end": 58, "score": 0.9994016289710999, "start": 46, "tag": "NAME", "value": "Chris Bailey" }, { "context": "ometry helper methods\n * \n * @author Chris ...
null
[]
/** * Geometry helper methods * * @author <NAME>-Kellogg, Dartmouth CS 10, Spring 2015 * @author CBK, Fall 2016, separated from quadtree, instrumented to count calls * */ public class Geometry { private static int numInCircleTests = 0; // keeps track of how many times pointInCircle has been called private static int numCircleRectangleTests = 0; // keeps track of how many times circleIntersectsRectangle has been called public static int getNumInCircleTests() { return numInCircleTests; } public static void resetNumInCircleTests() { numInCircleTests = 0; } public static int getNumCircleRectangleTests() { return numCircleRectangleTests; } public static void resetNumCircleRectangleTests() { numCircleRectangleTests = 0; } /** * Returns whether or not the point is within the circle * @param px point x coord * @param py point y coord * @param cx circle center x * @param cy circle center y * @param cr circle radius */ public static boolean pointInCircle(double px, double py, double cx, double cy, double cr) { numInCircleTests++; return (px-cx)*(px-cx) + (py-cy)*(py-cy) <= cr*cr; } /** * Returns whether or not the circle intersects the rectangle * Based on discussion at http://stackoverflow.com/questions/401847/circle-rectangle-collision-detection-intersection * @param cx circle center x * @param cy circle center y * @param cr circle radius * @param x1 rectangle min x * @param y1 rectangle min y * @param x2 rectangle max x * @param y2 rectangle max y */ public static boolean circleIntersectsRectangle(double cx, double cy, double cr, double x1, double y1, double x2, double y2) { numCircleRectangleTests++; double closestX = Math.min(Math.max(cx, x1), x2); double closestY = Math.min(Math.max(cy, y1), y2); return (cx-closestX)*(cx-closestX) + (cy-closestY)*(cy-closestY) <= cr*cr; } }
1,902
0.714885
0.698113
58
31.896551
32.704365
127
false
false
0
0
0
0
0
0
1.862069
false
false
13
9858e86c44efb99208c6be9eaa29dc0ce0bbdc4b
12,635,793,839,327
28354c7cd494a88d6284067c2079548b748e3327
/src/main/java/leetcode/dfs_and_memo/MinimumDifficultyofaJobSchedule1335.java
0ef9e18407f2ccd3c9792841c4a7bf7c369c3d84
[]
no_license
VicnentX/LeetCode
https://github.com/VicnentX/LeetCode
639c9e8ba1bad383966158b5d088ac1c7f117c2e
d3eb82a9403ea919cacf242e4904d570256bacfd
refs/heads/master
2021-06-09T21:37:10.482000
2021-05-01T01:03:40
2021-05-01T01:03:40
158,880,943
2
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package leetcode.dfs_and_memo; /* You want to schedule a list of jobs in d days. Jobs are dependent (i.e To work on the i-th job, you have to finish all the jobs j where 0 <= j < i). You have to finish at least one task every day. The difficulty of a job schedule is the sum of difficulties of each day of the d days. The difficulty of a day is the maximum difficulty of a job done in that day. Given an array of integers jobDifficulty and an integer d. The difficulty of the i-th job is jobDifficulty[i]. Return the minimum difficulty of a job schedule. If you cannot find a schedule for the jobs return -1. Example 1: Input: jobDifficulty = [6,5,4,3,2,1], d = 2 Output: 7 Explanation: First day you can finish the first 5 jobs, total difficulty = 6. Second day you can finish the last job, total difficulty = 1. The difficulty of the schedule = 6 + 1 = 7 Example 2: Input: jobDifficulty = [9,9,9], d = 4 Output: -1 Explanation: If you finish a job per day you will still have a free day. you cannot find a schedule for the given jobs. Example 3: Input: jobDifficulty = [1,1,1], d = 3 Output: 3 Explanation: The schedule is one job per day. total difficulty will be 3. Example 4: Input: jobDifficulty = [7,1,7,1,7,1], d = 3 Output: 15 Example 5: Input: jobDifficulty = [11,111,22,222,33,333,44,444], d = 6 Output: 843 Constraints: 1 <= jobDifficulty.length <= 300 0 <= jobDifficulty[i] <= 1000 1 <= d <= 10 */ /** * Explanation * dfs help find the the minimum difficulty * if start work at ith job with d days left. * * If d = 1, only one day left, we have to do all jobs, * return the maximum difficulty of jobs. * * * Complexity * Time O(nnd) * Space O(nd) */ import java.util.Arrays; public class MinimumDifficultyofaJobSchedule1335 { public int minDifficultyDFSMEM(int[] jobDifficulty, int d) { int n = jobDifficulty.length; if (n < d) return -1; int[][] dp = new int[n][d + 1]; for (int[] rows: dp) { Arrays.fill(rows, -1); } return dfs(0, d, jobDifficulty, jobDifficulty.length, dp); } //dfs返回的是从第i个任务开始,并且只剩余d天的时候,最小的diffculty是多少 private int dfs(int i, int d, int[] jobDifficulty, int n, int[][] dp) { if (dp[i][d] != -1) return dp[i][d]; if (d == 1) { return dp[i][d] = Arrays.stream(jobDifficulty, i, n).max().getAsInt(); } int ret = Integer.MAX_VALUE; int maxd = 0; //这里的maxd就相当于把i 到 index 当作一天,然后和后面的dfs加起来 for (int index = i; index < n - d + 1; ++index) { maxd = Math.max(maxd, jobDifficulty[index]); ret = Math.min(ret, maxd + dfs(index + 1, d - 1, jobDifficulty, n, dp)); } return dp[i][d] = ret; } public int minDifficultyDP(int[] jobDifficulty, int d) { int n=jobDifficulty.length; int sum=0; if(d>n) return -1; if(d==n) { for(int i=0;i<n;i++) sum+=jobDifficulty[i]; return sum; } int dp[][]=new int[d][n]; dp[0][0]=jobDifficulty[0]; for(int j=1;j<n;j++) { dp[0][j]=Math.max(jobDifficulty[j],dp[0][j-1]); } for(int i=1;i<d;i++) { for(int j=i;j<n;j++) { int localMx=jobDifficulty[j]; dp[i][j]=Integer.MAX_VALUE; for(int r=j;r>=i;r--) { localMx=Math.max(localMx,jobDifficulty[r]); dp[i][j]=Math.min(dp[i][j],dp[i-1][r-1]+localMx); } } } return dp[d-1][n-1]; } }
UTF-8
Java
3,764
java
MinimumDifficultyofaJobSchedule1335.java
Java
[]
null
[]
package leetcode.dfs_and_memo; /* You want to schedule a list of jobs in d days. Jobs are dependent (i.e To work on the i-th job, you have to finish all the jobs j where 0 <= j < i). You have to finish at least one task every day. The difficulty of a job schedule is the sum of difficulties of each day of the d days. The difficulty of a day is the maximum difficulty of a job done in that day. Given an array of integers jobDifficulty and an integer d. The difficulty of the i-th job is jobDifficulty[i]. Return the minimum difficulty of a job schedule. If you cannot find a schedule for the jobs return -1. Example 1: Input: jobDifficulty = [6,5,4,3,2,1], d = 2 Output: 7 Explanation: First day you can finish the first 5 jobs, total difficulty = 6. Second day you can finish the last job, total difficulty = 1. The difficulty of the schedule = 6 + 1 = 7 Example 2: Input: jobDifficulty = [9,9,9], d = 4 Output: -1 Explanation: If you finish a job per day you will still have a free day. you cannot find a schedule for the given jobs. Example 3: Input: jobDifficulty = [1,1,1], d = 3 Output: 3 Explanation: The schedule is one job per day. total difficulty will be 3. Example 4: Input: jobDifficulty = [7,1,7,1,7,1], d = 3 Output: 15 Example 5: Input: jobDifficulty = [11,111,22,222,33,333,44,444], d = 6 Output: 843 Constraints: 1 <= jobDifficulty.length <= 300 0 <= jobDifficulty[i] <= 1000 1 <= d <= 10 */ /** * Explanation * dfs help find the the minimum difficulty * if start work at ith job with d days left. * * If d = 1, only one day left, we have to do all jobs, * return the maximum difficulty of jobs. * * * Complexity * Time O(nnd) * Space O(nd) */ import java.util.Arrays; public class MinimumDifficultyofaJobSchedule1335 { public int minDifficultyDFSMEM(int[] jobDifficulty, int d) { int n = jobDifficulty.length; if (n < d) return -1; int[][] dp = new int[n][d + 1]; for (int[] rows: dp) { Arrays.fill(rows, -1); } return dfs(0, d, jobDifficulty, jobDifficulty.length, dp); } //dfs返回的是从第i个任务开始,并且只剩余d天的时候,最小的diffculty是多少 private int dfs(int i, int d, int[] jobDifficulty, int n, int[][] dp) { if (dp[i][d] != -1) return dp[i][d]; if (d == 1) { return dp[i][d] = Arrays.stream(jobDifficulty, i, n).max().getAsInt(); } int ret = Integer.MAX_VALUE; int maxd = 0; //这里的maxd就相当于把i 到 index 当作一天,然后和后面的dfs加起来 for (int index = i; index < n - d + 1; ++index) { maxd = Math.max(maxd, jobDifficulty[index]); ret = Math.min(ret, maxd + dfs(index + 1, d - 1, jobDifficulty, n, dp)); } return dp[i][d] = ret; } public int minDifficultyDP(int[] jobDifficulty, int d) { int n=jobDifficulty.length; int sum=0; if(d>n) return -1; if(d==n) { for(int i=0;i<n;i++) sum+=jobDifficulty[i]; return sum; } int dp[][]=new int[d][n]; dp[0][0]=jobDifficulty[0]; for(int j=1;j<n;j++) { dp[0][j]=Math.max(jobDifficulty[j],dp[0][j-1]); } for(int i=1;i<d;i++) { for(int j=i;j<n;j++) { int localMx=jobDifficulty[j]; dp[i][j]=Integer.MAX_VALUE; for(int r=j;r>=i;r--) { localMx=Math.max(localMx,jobDifficulty[r]); dp[i][j]=Math.min(dp[i][j],dp[i-1][r-1]+localMx); } } } return dp[d-1][n-1]; } }
3,764
0.576188
0.546969
139
25.345324
31.804871
211
false
false
0
0
0
0
0
0
0.669065
false
false
13
1659731c84afa1abd8e66157094188277faac693
27,462,020,938,283
ec1f17c2a2dface46d9a6822bf7f9e70483af5d1
/main/java/frc/robot/subsystems/Vision.java
bcb89e92abf02657dbb5415403c226630a4fee6c
[]
no_license
Team2883/Competition_Code_2020
https://github.com/Team2883/Competition_Code_2020
231b0c721f11e311e7af98e4df9f197e7266119d
8d9f7db075ba9548be5075f481a51fe96428f606
refs/heads/master
2021-01-01T08:05:43.437000
2020-03-12T00:40:01
2020-03-12T00:40:01
239,188,133
1
0
null
null
null
null
null
null
null
null
null
null
null
null
null
/*----------------------------------------------------------------------------*/ /* Copyright (c) 2019 FIRST. All Rights Reserved. */ /* Open Source Software - may be modified and shared by FRC teams. The code */ /* must be accompanied by the FIRST BSD license file in the root directory of */ /* the project. */ /*----------------------------------------------------------------------------*/ package frc.robot.subsystems; import com.revrobotics.ColorMatch; import com.revrobotics.ColorMatchResult; import com.revrobotics.ColorSensorV3; import edu.wpi.first.networktables.NetworkTableEntry; import edu.wpi.first.networktables.NetworkTableInstance; import edu.wpi.first.networktables.NetworkTable; import edu.wpi.first.wpilibj.I2C; import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; import edu.wpi.first.wpilibj.util.Color; import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.SubsystemBase; public class Vision extends SubsystemBase { private static final Command VisionDrive = null; private final I2C.Port i2cPort = I2C.Port.kOnboard; private final ColorMatch m_colorMatcher = new ColorMatch(); private final ColorSensorV3 m_colorSensor = new ColorSensorV3(i2cPort); boolean Spinning = false; boolean done = false; Color detectedColor = m_colorSensor.getColor(); ColorMatchResult match = m_colorMatcher.matchClosestColor(detectedColor); @Override public void periodic() { NetworkTable table = NetworkTableInstance.getDefault().getTable("limelight"); NetworkTableEntry tx = table.getEntry("tx"); NetworkTableEntry ty = table.getEntry("ty"); NetworkTableEntry ta = table.getEntry("ta"); //read values periodically double x = tx.getDouble(0.0); double y = ty.getDouble(0.0); double area = ta.getDouble(0.0); //post to smart dashboard periodically SmartDashboard.putNumber("LimelightX", x); SmartDashboard.putNumber("LimelightY", y); SmartDashboard.putNumber("LimelightArea", area); } public void setDefaultCommand() { setDefaultCommand(VisionDrive); } }
UTF-8
Java
2,248
java
Vision.java
Java
[]
null
[]
/*----------------------------------------------------------------------------*/ /* Copyright (c) 2019 FIRST. All Rights Reserved. */ /* Open Source Software - may be modified and shared by FRC teams. The code */ /* must be accompanied by the FIRST BSD license file in the root directory of */ /* the project. */ /*----------------------------------------------------------------------------*/ package frc.robot.subsystems; import com.revrobotics.ColorMatch; import com.revrobotics.ColorMatchResult; import com.revrobotics.ColorSensorV3; import edu.wpi.first.networktables.NetworkTableEntry; import edu.wpi.first.networktables.NetworkTableInstance; import edu.wpi.first.networktables.NetworkTable; import edu.wpi.first.wpilibj.I2C; import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; import edu.wpi.first.wpilibj.util.Color; import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.SubsystemBase; public class Vision extends SubsystemBase { private static final Command VisionDrive = null; private final I2C.Port i2cPort = I2C.Port.kOnboard; private final ColorMatch m_colorMatcher = new ColorMatch(); private final ColorSensorV3 m_colorSensor = new ColorSensorV3(i2cPort); boolean Spinning = false; boolean done = false; Color detectedColor = m_colorSensor.getColor(); ColorMatchResult match = m_colorMatcher.matchClosestColor(detectedColor); @Override public void periodic() { NetworkTable table = NetworkTableInstance.getDefault().getTable("limelight"); NetworkTableEntry tx = table.getEntry("tx"); NetworkTableEntry ty = table.getEntry("ty"); NetworkTableEntry ta = table.getEntry("ta"); //read values periodically double x = tx.getDouble(0.0); double y = ty.getDouble(0.0); double area = ta.getDouble(0.0); //post to smart dashboard periodically SmartDashboard.putNumber("LimelightX", x); SmartDashboard.putNumber("LimelightY", y); SmartDashboard.putNumber("LimelightArea", area); } public void setDefaultCommand() { setDefaultCommand(VisionDrive); } }
2,248
0.649021
0.640125
57
37.438595
25.755951
81
false
false
0
0
0
0
0
0
0.596491
false
false
13
44fc27a11eeab0444ce7180ca9474b000ae7ae92
20,804,821,630,352
7d9844126a07a182d6492fd8eead0a7b48942514
/src/ativaula_21_09/AtivAula_21_09.java
f3a19912b8cba7e5ecfb8eef6f4c1f2e424c3330
[]
no_license
ufjf-dcc171/ufjf-dcc171-2017-3-exrx1-gabrielnascimento95
https://github.com/ufjf-dcc171/ufjf-dcc171-2017-3-exrx1-gabrielnascimento95
5603520706b6dcbc3fc87920f58dc20d6c34df13
b9e6b83967ccfe0e7e37c4185e6a943a8600c15d
refs/heads/master
2021-07-04T03:08:11.689000
2017-09-26T18:37:01
2017-09-26T18:37:01
104,422,715
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 ativaula_21_09; import javax.swing.JFrame; import java.util.ArrayList; import java.util.List; /** * * @author Gabriel_Nascimento */ public class AtivAula_21_09 { /** * @param args the command line arguments */ public static void main(String[] args) { Controller janela = new Controller(getSampleData()); janela.setLocationRelativeTo(null); janela.setVisible(true); janela.setSize(500,250); janela.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); } private static List<Dados> getSampleData(){ Dados d1 = new Dados(); Dados d2 = new Dados(); Dados d3 = new Dados(); List<Dados> dados = new ArrayList<>(); return dados; } }
UTF-8
Java
1,007
java
AtivAula_21_09.java
Java
[ { "context": "st;\r\nimport java.util.List;\r\n\r\n/**\r\n *\r\n * @author Gabriel_Nascimento\r\n */\r\npublic class AtivAula_21_09 {\r\n\r\n /**\r\n ", "end": 338, "score": 0.9997512102127075, "start": 320, "tag": "NAME", "value": "Gabriel_Nascimento" } ]
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 ativaula_21_09; import javax.swing.JFrame; import java.util.ArrayList; import java.util.List; /** * * @author Gabriel_Nascimento */ public class AtivAula_21_09 { /** * @param args the command line arguments */ public static void main(String[] args) { Controller janela = new Controller(getSampleData()); janela.setLocationRelativeTo(null); janela.setVisible(true); janela.setSize(500,250); janela.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); } private static List<Dados> getSampleData(){ Dados d1 = new Dados(); Dados d2 = new Dados(); Dados d3 = new Dados(); List<Dados> dados = new ArrayList<>(); return dados; } }
1,007
0.598808
0.581927
41
22.560976
20.610262
79
false
false
0
0
0
0
0
0
0.439024
false
false
13
a806ca6fdb51eef0ae19f48965545e19d53e339c
16,595,753,652,572
e92661dd79a4d7519aed1fec8db6154b735cada1
/src/test/java/cz/certicon/routing/utils/EffectiveUtilsTest.java
a440e4e839a783e26cb967a915911d763440052d
[]
no_license
blahami2/routing-sra
https://github.com/blahami2/routing-sra
f3857ba0e27e9a603c0482e666c47fa5ece08b84
16a7cd58f8eeff7d0ad1f93051cd2e23bd081886
refs/heads/master
2020-05-22T02:47:23.433000
2016-12-07T08:21:16
2016-12-07T08:21:16
65,298,579
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package cz.certicon.routing.utils; import org.junit.Test; import static cz.certicon.routing.utils.EffectiveUtils.*; import static org.junit.Assert.*; import static org.hamcrest.CoreMatchers.*; /** * @author Michael Blaha {@literal <blahami2@gmail.com>} */ public class EffectiveUtilsTest { @Test public void fillArray_int_for_1_returns_array_of_1() throws Exception { int value = 1; int[] result = new int[5]; int[] expected = new int[]{ value, value, value, value, value }; fillArray( result, value ); assertThat( result, equalTo( expected ) ); } @Test public void fillArray_double_for_half_returns_array_of_halfs() throws Exception { double value = 0.5; double[] result = new double[5]; double[] expected = new double[]{ value, value, value, value, value }; fillArray( result, value ); assertThat( result, equalTo( expected ) ); } @Test public void fillArray_float_for_half_returns_array_of_halfs() throws Exception { float value = 0.5f; float[] result = new float[5]; float[] expected = new float[]{ value, value, value, value, value }; fillArray( result, value ); assertThat( result, equalTo( expected ) ); } @Test public void fillArray_double_for_true_returns_array_of_trues() throws Exception { boolean value = true; boolean[] result = new boolean[5]; boolean[] expected = new boolean[]{ value, value, value, value, value }; fillArray( result, value ); assertThat( result, equalTo( expected ) ); } @Test public void fillArray_double_for_String_returns_array_of_Strings() throws Exception { String value = "nothing"; String[] result = new String[5]; String[] expected = new String[]{ value, value, value, value, value }; fillArray( result, value ); assertThat( result, equalTo( expected ) ); } @Test public void copyArray_int_copies_source_into_target() throws Exception { int value = 1; int[] result = new int[5]; int[] expected = new int[]{ value, value, value, value, value }; copyArray( expected, result ); assertThat( result, equalTo( expected ) ); } @Test public void copyArray_long_copies_source_into_target() throws Exception { long value = 1; long[] result = new long[5]; long[] expected = new long[]{ value, value, value, value, value }; copyArray( expected, result ); assertThat( result, equalTo( expected ) ); } @Test public void copyArray_double_copies_source_into_target() throws Exception { double value = 0.5; double[] result = new double[5]; double[] expected = new double[]{ value, value, value, value, value }; copyArray( expected, result ); assertThat( result, equalTo( expected ) ); } @Test public void copyArray_boolean_copies_source_into_target() throws Exception { boolean value = true; boolean[] result = new boolean[5]; boolean[] expected = new boolean[]{ value, value, value, value, value }; copyArray( expected, result ); assertThat( result, equalTo( expected ) ); } @Test public void copyArray_float_copies_source_into_target() throws Exception { float value = 0.5f; float[] result = new float[5]; float[] expected = new float[]{ value, value, value, value, value }; copyArray( expected, result ); assertThat( result, equalTo( expected ) ); } @Test public void enlarge_long_enlarges_to_twice_size() throws Exception { long value = 1; long def = 0; long[] input = new long[]{ value, value, value, value, value }; long[] expected = new long[]{ value, value, value, value, value, def, def, def, def, def }; long[] result = enlarge( input, input.length ); assertThat( result, equalTo( expected ) ); } @Test public void enlarge_int_enlarges_to_twice_size() throws Exception { int value = 1; int def = 0; int[] input = new int[]{ value, value, value, value, value }; int[] expected = new int[]{ value, value, value, value, value, def, def, def, def, def }; int[] result = enlarge( input, input.length ); assertThat( result, equalTo( expected ) ); } @Test public void enlarge_boolean_enlarges_to_twice_size() throws Exception { boolean value = true; boolean def = false; boolean[] input = new boolean[]{ value, value, value, value, value }; boolean[] expected = new boolean[]{ value, value, value, value, value, def, def, def, def, def }; boolean[] result = enlarge( input, input.length ); assertThat( result, equalTo( expected ) ); } @Test public void enlarge_float_enlarges_to_twice_size() throws Exception { float value = 0.5f; float def = 0; float[] input = new float[]{ value, value, value, value, value }; float[] expected = new float[]{ value, value, value, value, value, def, def, def, def, def }; float[] result = enlarge( input, input.length ); assertThat( result, equalTo( expected ) ); } @Test public void enlarge_double_enlarges_to_twice_size() throws Exception { double value = 0.5; double def = 0; double[] input = new double[]{ value, value, value, value, value }; double[] expected = new double[]{ value, value, value, value, value, def, def, def, def, def }; double[] result = enlarge( input, input.length ); assertThat( result, equalTo( expected ) ); } @Test public void enlarge_int_2d_enlarges_to_twice_size() throws Exception { int value = 1; int[] def = null; int[][] input = new int[][]{ { value, value }, { value, value, value }, { value, value }, { value, value, value }, { value, value } }; int[][] expected = new int[][]{ { value, value }, { value, value, value }, { value, value }, { value, value, value }, { value, value }, def, def, def, def, def }; int[][] result = enlarge( input, input.length ); assertThat( result, equalTo( expected ) ); } @Test public void enlarge_float_3d_enlarges_to_twice_size() throws Exception { float value = 1.0f; float[][] def = null; float[][][] input = new float[][][]{ { { value, value }, { value, value, value }, { value, value }, { value, value, value }, { value, value } }, { { value } } }; float[][][] expected = new float[][][]{ { { value, value }, { value, value, value }, { value, value }, { value, value, value }, { value, value } }, { { value } }, def, def }; float[][][] result = enlarge( input, input.length ); assertThat( result, equalTo( expected ) ); } }
UTF-8
Java
6,921
java
EffectiveUtilsTest.java
Java
[ { "context": "tatic org.hamcrest.CoreMatchers.*;\n\n/**\n * @author Michael Blaha {@literal <blahami2@gmail.com>}\n */\npublic class ", "end": 224, "score": 0.9998214244842529, "start": 211, "tag": "NAME", "value": "Michael Blaha" }, { "context": "t.CoreMatchers.*;\n\n/**\n * @author...
null
[]
package cz.certicon.routing.utils; import org.junit.Test; import static cz.certicon.routing.utils.EffectiveUtils.*; import static org.junit.Assert.*; import static org.hamcrest.CoreMatchers.*; /** * @author <NAME> {@literal <<EMAIL>>} */ public class EffectiveUtilsTest { @Test public void fillArray_int_for_1_returns_array_of_1() throws Exception { int value = 1; int[] result = new int[5]; int[] expected = new int[]{ value, value, value, value, value }; fillArray( result, value ); assertThat( result, equalTo( expected ) ); } @Test public void fillArray_double_for_half_returns_array_of_halfs() throws Exception { double value = 0.5; double[] result = new double[5]; double[] expected = new double[]{ value, value, value, value, value }; fillArray( result, value ); assertThat( result, equalTo( expected ) ); } @Test public void fillArray_float_for_half_returns_array_of_halfs() throws Exception { float value = 0.5f; float[] result = new float[5]; float[] expected = new float[]{ value, value, value, value, value }; fillArray( result, value ); assertThat( result, equalTo( expected ) ); } @Test public void fillArray_double_for_true_returns_array_of_trues() throws Exception { boolean value = true; boolean[] result = new boolean[5]; boolean[] expected = new boolean[]{ value, value, value, value, value }; fillArray( result, value ); assertThat( result, equalTo( expected ) ); } @Test public void fillArray_double_for_String_returns_array_of_Strings() throws Exception { String value = "nothing"; String[] result = new String[5]; String[] expected = new String[]{ value, value, value, value, value }; fillArray( result, value ); assertThat( result, equalTo( expected ) ); } @Test public void copyArray_int_copies_source_into_target() throws Exception { int value = 1; int[] result = new int[5]; int[] expected = new int[]{ value, value, value, value, value }; copyArray( expected, result ); assertThat( result, equalTo( expected ) ); } @Test public void copyArray_long_copies_source_into_target() throws Exception { long value = 1; long[] result = new long[5]; long[] expected = new long[]{ value, value, value, value, value }; copyArray( expected, result ); assertThat( result, equalTo( expected ) ); } @Test public void copyArray_double_copies_source_into_target() throws Exception { double value = 0.5; double[] result = new double[5]; double[] expected = new double[]{ value, value, value, value, value }; copyArray( expected, result ); assertThat( result, equalTo( expected ) ); } @Test public void copyArray_boolean_copies_source_into_target() throws Exception { boolean value = true; boolean[] result = new boolean[5]; boolean[] expected = new boolean[]{ value, value, value, value, value }; copyArray( expected, result ); assertThat( result, equalTo( expected ) ); } @Test public void copyArray_float_copies_source_into_target() throws Exception { float value = 0.5f; float[] result = new float[5]; float[] expected = new float[]{ value, value, value, value, value }; copyArray( expected, result ); assertThat( result, equalTo( expected ) ); } @Test public void enlarge_long_enlarges_to_twice_size() throws Exception { long value = 1; long def = 0; long[] input = new long[]{ value, value, value, value, value }; long[] expected = new long[]{ value, value, value, value, value, def, def, def, def, def }; long[] result = enlarge( input, input.length ); assertThat( result, equalTo( expected ) ); } @Test public void enlarge_int_enlarges_to_twice_size() throws Exception { int value = 1; int def = 0; int[] input = new int[]{ value, value, value, value, value }; int[] expected = new int[]{ value, value, value, value, value, def, def, def, def, def }; int[] result = enlarge( input, input.length ); assertThat( result, equalTo( expected ) ); } @Test public void enlarge_boolean_enlarges_to_twice_size() throws Exception { boolean value = true; boolean def = false; boolean[] input = new boolean[]{ value, value, value, value, value }; boolean[] expected = new boolean[]{ value, value, value, value, value, def, def, def, def, def }; boolean[] result = enlarge( input, input.length ); assertThat( result, equalTo( expected ) ); } @Test public void enlarge_float_enlarges_to_twice_size() throws Exception { float value = 0.5f; float def = 0; float[] input = new float[]{ value, value, value, value, value }; float[] expected = new float[]{ value, value, value, value, value, def, def, def, def, def }; float[] result = enlarge( input, input.length ); assertThat( result, equalTo( expected ) ); } @Test public void enlarge_double_enlarges_to_twice_size() throws Exception { double value = 0.5; double def = 0; double[] input = new double[]{ value, value, value, value, value }; double[] expected = new double[]{ value, value, value, value, value, def, def, def, def, def }; double[] result = enlarge( input, input.length ); assertThat( result, equalTo( expected ) ); } @Test public void enlarge_int_2d_enlarges_to_twice_size() throws Exception { int value = 1; int[] def = null; int[][] input = new int[][]{ { value, value }, { value, value, value }, { value, value }, { value, value, value }, { value, value } }; int[][] expected = new int[][]{ { value, value }, { value, value, value }, { value, value }, { value, value, value }, { value, value }, def, def, def, def, def }; int[][] result = enlarge( input, input.length ); assertThat( result, equalTo( expected ) ); } @Test public void enlarge_float_3d_enlarges_to_twice_size() throws Exception { float value = 1.0f; float[][] def = null; float[][][] input = new float[][][]{ { { value, value }, { value, value, value }, { value, value }, { value, value, value }, { value, value } }, { { value } } }; float[][][] expected = new float[][][]{ { { value, value }, { value, value, value }, { value, value }, { value, value, value }, { value, value } }, { { value } }, def, def }; float[][][] result = enlarge( input, input.length ); assertThat( result, equalTo( expected ) ); } }
6,903
0.593411
0.587776
174
38.781609
34.848911
182
false
false
0
0
0
0
0
0
1.66092
false
false
13
0546f4c43073bfe61fb4aa8bfba83ba339f7cf49
25,134,148,682,497
a8a5b98457dce960ad09d90147ae43d324839f49
/api/src/main/java/com/adfonic/webservices/service/impl/SegmentCopyService.java
9de31053dc4b9a2d9f638cb77ea87b2449a8474f
[]
no_license
graemeparker/cinofda
https://github.com/graemeparker/cinofda
fbb88791f964fefd37134b5845d9f69ca6875bd4
5f669d9dfdded5d511eeea585ea25d7b244d3635
refs/heads/master
2021-03-22T03:01:36.367000
2016-10-14T14:17:54
2016-10-14T14:17:54
70,915,669
1
2
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.adfonic.webservices.service.impl; import java.util.HashSet; import java.util.List; import java.util.Set; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.adfonic.domain.Campaign; import com.adfonic.domain.Category; import com.adfonic.domain.Channel; import com.adfonic.domain.Country; import com.adfonic.domain.Geotarget; import com.adfonic.domain.Geotarget_; import com.adfonic.domain.Model; import com.adfonic.domain.Operator; import com.adfonic.domain.Platform; import com.adfonic.domain.Publisher; import com.adfonic.domain.Segment; import com.adfonic.domain.Vendor; import com.adfonic.webservices.ErrorCode; import com.adfonic.webservices.dto.GeoTargetDTO; import com.adfonic.webservices.dto.GeoTargetDTO.Type; import com.adfonic.webservices.dto.SegmentDTO; import com.adfonic.webservices.dto.mapping.CategoryConverter; import com.adfonic.webservices.dto.mapping.ChannelConverter; import com.adfonic.webservices.dto.mapping.CountryConverter; import com.adfonic.webservices.dto.mapping.InventoryTargetedCategoryConverter; import com.adfonic.webservices.dto.mapping.ModelConverter; import com.adfonic.webservices.dto.mapping.OperatorConverter; import com.adfonic.webservices.dto.mapping.PlatformConverter; import com.adfonic.webservices.dto.mapping.ReferenceSetCopier; import com.adfonic.webservices.dto.mapping.TargetPublisherConverter; import com.adfonic.webservices.dto.mapping.VendorConverter; import com.adfonic.webservices.exception.ServiceException; import com.adfonic.webservices.exception.ValidationException; import com.adfonic.webservices.service.IRestrictingCopyService; import com.adfonic.webservices.service.ISegmentCopyService; import com.adfonic.webservices.service.IUtilService; import com.adfonic.webservices.util.DspAccess; import com.byyd.middleware.account.service.CompanyManager; import com.byyd.middleware.campaign.filter.GeotargetFilter; import com.byyd.middleware.campaign.service.TargetingManager; import com.byyd.middleware.iface.dao.FetchStrategy; import com.byyd.middleware.iface.dao.Pagination; import com.byyd.middleware.iface.dao.SortOrder; import com.byyd.middleware.iface.dao.Sorting; import com.byyd.middleware.iface.dao.jpa.FetchStrategyBuilder; /* * stopgap kind of class; formatting intended */ @Service public class SegmentCopyService implements ISegmentCopyService{ private static final FetchStrategy GEOTARGET_FETCH_STRATEGY = new FetchStrategyBuilder() .addInner(Geotarget_.country) .build(); @Autowired private IRestrictingCopyService<SegmentDTO, Segment> copyService; @Autowired private TargetingManager targetingManager; @Autowired private IUtilService utilService; ReferenceSetCopier<Country> countryCopier = new ReferenceSetCopier<Country>(new CountryConverter()); ReferenceSetCopier<Operator> operatorCopier = new ReferenceSetCopier<Operator>(new OperatorConverter()); ReferenceSetCopier<Vendor> vendorCopier = new ReferenceSetCopier<Vendor>(new VendorConverter()); ReferenceSetCopier<Model> modelCopier = new ReferenceSetCopier<Model>(new ModelConverter()); ReferenceSetCopier<Platform> platformCopier = new ReferenceSetCopier<Platform>(new PlatformConverter()); ReferenceSetCopier<Category> categoryCopier = new ReferenceSetCopier<Category>(new CategoryConverter()); ReferenceSetCopier<Channel> channelCopier = new ReferenceSetCopier<Channel>(new ChannelConverter()); ReferenceSetCopier<Category> includedCategoryCopier = new ReferenceSetCopier<>(new InventoryTargetedCategoryConverter()); public void copyToSegment(SegmentDTO segmentDTO, Segment segment, Campaign.Status campaignStatus) { copyOperatorsOrIpAddressesToSegment(segmentDTO, segment); copyPlatformsOrModelsNvendorsToSegment(segmentDTO, segment); copyCountriesOrGeotargetsToSegment(segmentDTO, segment); // inventory Targeting Part of Segments copyTargetPublishersOrIncludedCategories(segmentDTO, segment); modelCopier.copy(segmentDTO.getExcludedModels(), segment.getExcludedModels()); //channelCopier.copy(segmentDTO.getChannels(), segment.getChannels()); segmentDTO.nullizeCollectionProperties(); copyService.restrictOnCampaignStatus(campaignStatus).copyToDomain(segmentDTO, segment); Integer daysOfWeek, hoursOfDay, hoursOfDayWeekend; daysOfWeek = segmentDTO.getDaysOfWeek(); hoursOfDay = segmentDTO.getHoursOfDay(); hoursOfDayWeekend = segmentDTO.getHoursOfDayWeekend(); if (daysOfWeek != null) { segment.setDaysOfWeekAsArray(getBooleanArrayFromBitmask(daysOfWeek, 7)); } if (hoursOfDay != null) { segment.setHoursOfDayAsArray(getBooleanArrayFromBitmask(hoursOfDay, 24)); } if (hoursOfDayWeekend != null) { segment.setHoursOfDayWeekendAsArray(getBooleanArrayFromBitmask(hoursOfDayWeekend, 24)); } } private boolean[] getBooleanArrayFromBitmask(int bitMask, int noOfBits) { boolean[] target = new boolean[noOfBits]; for (int i = 0; i < noOfBits; i++) { target[i] = 1 == (1 & bitMask); bitMask >>= 1; } return (target); } private void copyPlatformsOrModelsNvendorsToSegment(SegmentDTO segmentDTO, Segment segment) { Set<String> modelStrs = segmentDTO.getModels(), platformStrs = segmentDTO.getPlatforms(), vendorStrs=segmentDTO.getVendors(); if (modelStrs != null || vendorStrs != null) { if (platformStrs != null) { throw new ValidationException("Will not simultaneously target Platforms along with Models or Vendors!"); } if (modelStrs != null) { modelCopier.copy(modelStrs, segment.getModels()); } if (vendorStrs != null) { vendorCopier.copy(segmentDTO.getVendors(), segment.getVendors()); Set<Model> models = segment.getModels(); for (Vendor vendor : segment.getVendors()) {// normalize just like UI so as to avoid problems for latter ..and consistency in serving models.removeAll(vendor.getModels()); } } clear(segment.getPlatforms()); } else if (platformStrs != null) { platformCopier.copy(platformStrs, segment.getPlatforms()); clear(segment.getModels()); clear(segment.getVendors()); } } private void copyCountriesOrGeotargetsToSegment(SegmentDTO segmentDTO, Segment segment) { Set<String> countryStrs = segmentDTO.getCountries(); Set<GeoTargetDTO> geotargetDTOs = segmentDTO.getGeotargets(); if (countryStrs != null) { if (geotargetDTOs != null) { throw new ValidationException("Cannot target based on country and geotarget simultaneously!"); } countryCopier.copy(countryStrs, segment.getCountries()); clear(segment.getGeotargets()); segment.setGeotargetType(null); } else if (geotargetDTOs != null) { Set<Geotarget> segmentGeotargets = segment.getGeotargets(); clear(segmentGeotargets); for (GeoTargetDTO geo : geotargetDTOs) { Set<Geotarget> geotargets = lookupGeotargets(geo.getCountry(), geo.getType(), geo.getName()); if (geotargets == null || geotargets.size() != 1) { throw new ServiceException(ErrorCode.GENERAL, "Geotarget invalid!"); } segmentGeotargets.add(geotargets.toArray(new Geotarget[1])[0]); } if(!segmentGeotargets.isEmpty()){ segment.setGeotargetType(segmentGeotargets.iterator().next().getGeotargetType()); } clear(segment.getCountries()); } } private Set<Geotarget> lookupGeotargets(String isoCode, Type type, String... names) { GeotargetFilter filter = new GeotargetFilter(); filter.setCountryIsoCode(isoCode); String gtType=type.name(); //TODO GT filter.setType(type); if (names != null) { Set<String> nameSet = new HashSet<String>(); for (String name : names) { nameSet.add(name); } filter.setNames(nameSet, false); // case-insensitive } List<Geotarget> geotargetList = targetingManager.getAllGeotargets(filter, new Pagination(0, 50, new Sorting(SortOrder.asc("name"))), GEOTARGET_FETCH_STRATEGY); Set<Geotarget> geotargets=new HashSet<>(); for(Geotarget geotarget: geotargetList){ if(!geotargets.contains(geotarget) && geotarget.getGeotargetType().getType().equals(gtType)){ geotargets.add(geotarget); } } return geotargets; } private void copyOperatorsOrIpAddressesToSegment(SegmentDTO segmentDTO, Segment segment) { Set<String> ipAddrStrs = segmentDTO.getIpAddresses(), ipAddrs, operatorStrs = segmentDTO.getOperators(); if (operatorStrs != null) { if (ipAddrStrs != null) { throw new ValidationException("Cannot target operators and ip addresses simultaneously!"); } operatorCopier.copy(operatorStrs, segment.getOperators()); clear(segment.getIpAddresses()); } else if (ipAddrStrs != null) { segment.setIpAddressesListWhitelist(segmentDTO.isIpAddressesWhitelist()); ipAddrs = segment.getIpAddresses(); clear(ipAddrs); ipAddrs.addAll(ipAddrStrs); clear(segment.getOperators()); } } @Autowired private CompanyManager companyManager; private void copyTargetPublishersOrIncludedCategories(SegmentDTO segmentDTO, Segment segment) { Set<String> targetPublisherStrs = segmentDTO.getTargetedPublishers(), includedCategoryStrs = segmentDTO.getIncludedCategories(); if (targetPublisherStrs != null) { DspAccess dspAccess = utilService.getEffectiveDspAccess(segment.getAdvertiser().getCompany()); // will never be null under changed circumstances - remove in next round if (dspAccess == null) { throw new ServiceException(ErrorCode.AUTH_NO_AUTHORIZATION, "cannot authorize non DSP!"); } if (includedCategoryStrs != null) { throw new ValidationException("Inventory targeting: cannot target categories and publishers simultaneously!"); } ReferenceSetCopier<Publisher> targetPublisherCopier = new ReferenceSetCopier<>(new TargetPublisherConverter(true)); targetPublisherCopier.copy(targetPublisherStrs, segment.getTargettedPublishers()); clear(segment.getIncludedCategories()); } else if (includedCategoryStrs != null) { includedCategoryCopier.copy(includedCategoryStrs, segment.getIncludedCategories()); clear(segment.getTargettedPublishers()); } } // Needed because JDO proxy Set's clear() implementation seems to have a bug // TODO: do we still need this? private void clear(Set<?> targets) { targets.removeAll(targets); } }
UTF-8
Java
11,340
java
SegmentCopyService.java
Java
[]
null
[]
package com.adfonic.webservices.service.impl; import java.util.HashSet; import java.util.List; import java.util.Set; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.adfonic.domain.Campaign; import com.adfonic.domain.Category; import com.adfonic.domain.Channel; import com.adfonic.domain.Country; import com.adfonic.domain.Geotarget; import com.adfonic.domain.Geotarget_; import com.adfonic.domain.Model; import com.adfonic.domain.Operator; import com.adfonic.domain.Platform; import com.adfonic.domain.Publisher; import com.adfonic.domain.Segment; import com.adfonic.domain.Vendor; import com.adfonic.webservices.ErrorCode; import com.adfonic.webservices.dto.GeoTargetDTO; import com.adfonic.webservices.dto.GeoTargetDTO.Type; import com.adfonic.webservices.dto.SegmentDTO; import com.adfonic.webservices.dto.mapping.CategoryConverter; import com.adfonic.webservices.dto.mapping.ChannelConverter; import com.adfonic.webservices.dto.mapping.CountryConverter; import com.adfonic.webservices.dto.mapping.InventoryTargetedCategoryConverter; import com.adfonic.webservices.dto.mapping.ModelConverter; import com.adfonic.webservices.dto.mapping.OperatorConverter; import com.adfonic.webservices.dto.mapping.PlatformConverter; import com.adfonic.webservices.dto.mapping.ReferenceSetCopier; import com.adfonic.webservices.dto.mapping.TargetPublisherConverter; import com.adfonic.webservices.dto.mapping.VendorConverter; import com.adfonic.webservices.exception.ServiceException; import com.adfonic.webservices.exception.ValidationException; import com.adfonic.webservices.service.IRestrictingCopyService; import com.adfonic.webservices.service.ISegmentCopyService; import com.adfonic.webservices.service.IUtilService; import com.adfonic.webservices.util.DspAccess; import com.byyd.middleware.account.service.CompanyManager; import com.byyd.middleware.campaign.filter.GeotargetFilter; import com.byyd.middleware.campaign.service.TargetingManager; import com.byyd.middleware.iface.dao.FetchStrategy; import com.byyd.middleware.iface.dao.Pagination; import com.byyd.middleware.iface.dao.SortOrder; import com.byyd.middleware.iface.dao.Sorting; import com.byyd.middleware.iface.dao.jpa.FetchStrategyBuilder; /* * stopgap kind of class; formatting intended */ @Service public class SegmentCopyService implements ISegmentCopyService{ private static final FetchStrategy GEOTARGET_FETCH_STRATEGY = new FetchStrategyBuilder() .addInner(Geotarget_.country) .build(); @Autowired private IRestrictingCopyService<SegmentDTO, Segment> copyService; @Autowired private TargetingManager targetingManager; @Autowired private IUtilService utilService; ReferenceSetCopier<Country> countryCopier = new ReferenceSetCopier<Country>(new CountryConverter()); ReferenceSetCopier<Operator> operatorCopier = new ReferenceSetCopier<Operator>(new OperatorConverter()); ReferenceSetCopier<Vendor> vendorCopier = new ReferenceSetCopier<Vendor>(new VendorConverter()); ReferenceSetCopier<Model> modelCopier = new ReferenceSetCopier<Model>(new ModelConverter()); ReferenceSetCopier<Platform> platformCopier = new ReferenceSetCopier<Platform>(new PlatformConverter()); ReferenceSetCopier<Category> categoryCopier = new ReferenceSetCopier<Category>(new CategoryConverter()); ReferenceSetCopier<Channel> channelCopier = new ReferenceSetCopier<Channel>(new ChannelConverter()); ReferenceSetCopier<Category> includedCategoryCopier = new ReferenceSetCopier<>(new InventoryTargetedCategoryConverter()); public void copyToSegment(SegmentDTO segmentDTO, Segment segment, Campaign.Status campaignStatus) { copyOperatorsOrIpAddressesToSegment(segmentDTO, segment); copyPlatformsOrModelsNvendorsToSegment(segmentDTO, segment); copyCountriesOrGeotargetsToSegment(segmentDTO, segment); // inventory Targeting Part of Segments copyTargetPublishersOrIncludedCategories(segmentDTO, segment); modelCopier.copy(segmentDTO.getExcludedModels(), segment.getExcludedModels()); //channelCopier.copy(segmentDTO.getChannels(), segment.getChannels()); segmentDTO.nullizeCollectionProperties(); copyService.restrictOnCampaignStatus(campaignStatus).copyToDomain(segmentDTO, segment); Integer daysOfWeek, hoursOfDay, hoursOfDayWeekend; daysOfWeek = segmentDTO.getDaysOfWeek(); hoursOfDay = segmentDTO.getHoursOfDay(); hoursOfDayWeekend = segmentDTO.getHoursOfDayWeekend(); if (daysOfWeek != null) { segment.setDaysOfWeekAsArray(getBooleanArrayFromBitmask(daysOfWeek, 7)); } if (hoursOfDay != null) { segment.setHoursOfDayAsArray(getBooleanArrayFromBitmask(hoursOfDay, 24)); } if (hoursOfDayWeekend != null) { segment.setHoursOfDayWeekendAsArray(getBooleanArrayFromBitmask(hoursOfDayWeekend, 24)); } } private boolean[] getBooleanArrayFromBitmask(int bitMask, int noOfBits) { boolean[] target = new boolean[noOfBits]; for (int i = 0; i < noOfBits; i++) { target[i] = 1 == (1 & bitMask); bitMask >>= 1; } return (target); } private void copyPlatformsOrModelsNvendorsToSegment(SegmentDTO segmentDTO, Segment segment) { Set<String> modelStrs = segmentDTO.getModels(), platformStrs = segmentDTO.getPlatforms(), vendorStrs=segmentDTO.getVendors(); if (modelStrs != null || vendorStrs != null) { if (platformStrs != null) { throw new ValidationException("Will not simultaneously target Platforms along with Models or Vendors!"); } if (modelStrs != null) { modelCopier.copy(modelStrs, segment.getModels()); } if (vendorStrs != null) { vendorCopier.copy(segmentDTO.getVendors(), segment.getVendors()); Set<Model> models = segment.getModels(); for (Vendor vendor : segment.getVendors()) {// normalize just like UI so as to avoid problems for latter ..and consistency in serving models.removeAll(vendor.getModels()); } } clear(segment.getPlatforms()); } else if (platformStrs != null) { platformCopier.copy(platformStrs, segment.getPlatforms()); clear(segment.getModels()); clear(segment.getVendors()); } } private void copyCountriesOrGeotargetsToSegment(SegmentDTO segmentDTO, Segment segment) { Set<String> countryStrs = segmentDTO.getCountries(); Set<GeoTargetDTO> geotargetDTOs = segmentDTO.getGeotargets(); if (countryStrs != null) { if (geotargetDTOs != null) { throw new ValidationException("Cannot target based on country and geotarget simultaneously!"); } countryCopier.copy(countryStrs, segment.getCountries()); clear(segment.getGeotargets()); segment.setGeotargetType(null); } else if (geotargetDTOs != null) { Set<Geotarget> segmentGeotargets = segment.getGeotargets(); clear(segmentGeotargets); for (GeoTargetDTO geo : geotargetDTOs) { Set<Geotarget> geotargets = lookupGeotargets(geo.getCountry(), geo.getType(), geo.getName()); if (geotargets == null || geotargets.size() != 1) { throw new ServiceException(ErrorCode.GENERAL, "Geotarget invalid!"); } segmentGeotargets.add(geotargets.toArray(new Geotarget[1])[0]); } if(!segmentGeotargets.isEmpty()){ segment.setGeotargetType(segmentGeotargets.iterator().next().getGeotargetType()); } clear(segment.getCountries()); } } private Set<Geotarget> lookupGeotargets(String isoCode, Type type, String... names) { GeotargetFilter filter = new GeotargetFilter(); filter.setCountryIsoCode(isoCode); String gtType=type.name(); //TODO GT filter.setType(type); if (names != null) { Set<String> nameSet = new HashSet<String>(); for (String name : names) { nameSet.add(name); } filter.setNames(nameSet, false); // case-insensitive } List<Geotarget> geotargetList = targetingManager.getAllGeotargets(filter, new Pagination(0, 50, new Sorting(SortOrder.asc("name"))), GEOTARGET_FETCH_STRATEGY); Set<Geotarget> geotargets=new HashSet<>(); for(Geotarget geotarget: geotargetList){ if(!geotargets.contains(geotarget) && geotarget.getGeotargetType().getType().equals(gtType)){ geotargets.add(geotarget); } } return geotargets; } private void copyOperatorsOrIpAddressesToSegment(SegmentDTO segmentDTO, Segment segment) { Set<String> ipAddrStrs = segmentDTO.getIpAddresses(), ipAddrs, operatorStrs = segmentDTO.getOperators(); if (operatorStrs != null) { if (ipAddrStrs != null) { throw new ValidationException("Cannot target operators and ip addresses simultaneously!"); } operatorCopier.copy(operatorStrs, segment.getOperators()); clear(segment.getIpAddresses()); } else if (ipAddrStrs != null) { segment.setIpAddressesListWhitelist(segmentDTO.isIpAddressesWhitelist()); ipAddrs = segment.getIpAddresses(); clear(ipAddrs); ipAddrs.addAll(ipAddrStrs); clear(segment.getOperators()); } } @Autowired private CompanyManager companyManager; private void copyTargetPublishersOrIncludedCategories(SegmentDTO segmentDTO, Segment segment) { Set<String> targetPublisherStrs = segmentDTO.getTargetedPublishers(), includedCategoryStrs = segmentDTO.getIncludedCategories(); if (targetPublisherStrs != null) { DspAccess dspAccess = utilService.getEffectiveDspAccess(segment.getAdvertiser().getCompany()); // will never be null under changed circumstances - remove in next round if (dspAccess == null) { throw new ServiceException(ErrorCode.AUTH_NO_AUTHORIZATION, "cannot authorize non DSP!"); } if (includedCategoryStrs != null) { throw new ValidationException("Inventory targeting: cannot target categories and publishers simultaneously!"); } ReferenceSetCopier<Publisher> targetPublisherCopier = new ReferenceSetCopier<>(new TargetPublisherConverter(true)); targetPublisherCopier.copy(targetPublisherStrs, segment.getTargettedPublishers()); clear(segment.getIncludedCategories()); } else if (includedCategoryStrs != null) { includedCategoryCopier.copy(includedCategoryStrs, segment.getIncludedCategories()); clear(segment.getTargettedPublishers()); } } // Needed because JDO proxy Set's clear() implementation seems to have a bug // TODO: do we still need this? private void clear(Set<?> targets) { targets.removeAll(targets); } }
11,340
0.698854
0.697531
266
41.63158
35.734818
167
false
false
0
0
0
0
0
0
0.680451
false
false
13
c6c9f985e265bbe5ac02cd0354badb473d5bde80
4,681,514,401,833
6e4657c71287193c1c8b5b9f23789ef7dea1f08c
/src/Juego/Disparo.java
ca809e0f8e15f23994339186fe3743008ed6e040
[]
no_license
aacm13/ProyectoPoo
https://github.com/aacm13/ProyectoPoo
a7968bc2deeb7d2a8202c62f1b11ac8a7747c995
2a6a830ff7a80e0359871620550ba9b7e773e30e
refs/heads/master
2020-03-22T15:49:41.763000
2018-07-09T12:21:31
2018-07-09T12:21:31
140,281,765
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 Juego; import java.awt.Color; import java.awt.Graphics; import java.awt.Rectangle; import javax.swing.ImageIcon; /** * * @author aacm12 */ public class Disparo extends MovingGameObject { // My player ship shoots bullets! int diametro; int yVelocidad; // Constructor for bullet public Disparo(int xPosicion, int yPosicion, int diametro, Color color) { super(xPosicion, yPosicion, 0, 0, color); this.diametro = diametro; } // Gets the diameter of the bullet public int getDiametro() { return diametro; } // Used to draw the bullet @Override public void dibujar(Graphics g) { g.setColor(color); g.fillRect(this.getXPosicion(), this.getYPosicion(), 7, 15); } @Override public Rectangle getBounds() { Rectangle bulletHitbox = new Rectangle(xPos, yPos, 7, 15); return bulletHitbox; } }
UTF-8
Java
1,102
java
Disparo.java
Java
[ { "context": "e;\nimport javax.swing.ImageIcon;\n/**\n *\n * @author aacm12\n */\npublic class Disparo extends MovingGameObject", "end": 331, "score": 0.9995707869529724, "start": 325, "tag": "USERNAME", "value": "aacm12" } ]
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 Juego; import java.awt.Color; import java.awt.Graphics; import java.awt.Rectangle; import javax.swing.ImageIcon; /** * * @author aacm12 */ public class Disparo extends MovingGameObject { // My player ship shoots bullets! int diametro; int yVelocidad; // Constructor for bullet public Disparo(int xPosicion, int yPosicion, int diametro, Color color) { super(xPosicion, yPosicion, 0, 0, color); this.diametro = diametro; } // Gets the diameter of the bullet public int getDiametro() { return diametro; } // Used to draw the bullet @Override public void dibujar(Graphics g) { g.setColor(color); g.fillRect(this.getXPosicion(), this.getYPosicion(), 7, 15); } @Override public Rectangle getBounds() { Rectangle bulletHitbox = new Rectangle(xPos, yPos, 7, 15); return bulletHitbox; } }
1,102
0.662432
0.653358
46
22.97826
21.65991
79
false
false
0
0
0
0
0
0
0.652174
false
false
13
f401ebec92f15478c6191a4a0f223bbd8686464b
14,078,902,838,020
7da722dca4cdd6b9da27205268641e7aef4e804c
/src/main/java/com/hejinyo/core/web/SysMenuController.java
7c4bfb83d383a3bf85f698751ac079eb3c0082f2
[]
no_license
HejinYo/base
https://github.com/HejinYo/base
efec1cec7e8ebcf2ce6c36a8925db4d34451e6dd
577c4ab75eac93aa929bf73f5d5c9dd3c0e35fb0
refs/heads/master
2021-01-12T02:18:01.214000
2017-06-06T16:04:54
2017-06-06T16:04:54
78,495,836
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.hejinyo.core.web; import com.hejinyo.core.common.utils.JsonRetrun; import com.hejinyo.core.domain.dto.ActiveUser; import com.hejinyo.core.domain.dto.SysMenu; import com.hejinyo.core.service.SysResourceService; import net.sf.json.JSONArray; import net.sf.json.JSONObject; import org.apache.shiro.SecurityUtils; import org.apache.shiro.subject.Subject; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; import javax.annotation.Resource; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; @Controller @RequestMapping("/sysMenu") public class SysMenuController { @Resource private SysResourceService sysResourceService; /** * 编辑菜单 * * @return */ @RequestMapping(value = "editMenu", method = RequestMethod.GET) public String editMenu() { return "core/sys_menu"; } /** * 获取菜单树 * * @return */ @RequestMapping(value = "menuTree", method = RequestMethod.GET, produces = "application/json") @ResponseBody public Object menuTree() { JSONArray jsonArray = new JSONArray(); Subject subject = SecurityUtils.getSubject(); ActiveUser activeUser = (ActiveUser) subject.getPrincipal(); //所有菜单 List<SysMenu> SysMenus = sysResourceService.getMenuList(activeUser.getLoginName()); for (int i = 0; i < SysMenus.size(); i++) { JSONObject jsonObject = new JSONObject(); jsonObject.put("id", String.valueOf(SysMenus.get(i).getMid())); if (0 == (SysMenus.get(i).getPid())) { jsonObject.put("parent", "#"); } else { jsonObject.put("parent", String.valueOf(SysMenus.get(i).getPid())); } jsonObject.put("text", SysMenus.get(i).getMname()); int menuLevel = SysMenus.get(i).getMlevel(); JSONObject state = new JSONObject(); if (menuLevel == 1) { state.put("opened", true); jsonObject.put("state", state); } else if (menuLevel == 2) { jsonObject.put("state", state); jsonObject.put("icon", "fa fa-folder text-primary"); } else if (menuLevel == 3) { jsonObject.put("icon", "fa fa-file text-primary"); } jsonArray.add(jsonObject); } /* String json = "[{\"id\":\"1\",\"parent\":\"#\",\"text\":\"Parent Node\"}," + "{\"id\":\"2\",\"parent\":\"1\",\"text\":\"Initially selected\",\"state\": {\"selected\": true}}," + "{\"id\":\"3\",\"parent\":\"1\",\"text\":\"Custom Icon\",\"icon\": \"fa fa-warning text-primary\"}," + "{\"id\":\"4\",\"parent\":\"1\",\"text\":\"Initially open\",\"icon\": \"fa fa-folder text-primary\", \"state\": {\"opened\": true}}," + "{\"id\":\"5\",\"parent\":\"4\",\"text\":\"Another node\",\"icon\": \"fa fa-file text-primary\"}]";*/ System.out.println(jsonArray.toString()); return jsonArray; } }
UTF-8
Java
3,267
java
SysMenuController.java
Java
[]
null
[]
package com.hejinyo.core.web; import com.hejinyo.core.common.utils.JsonRetrun; import com.hejinyo.core.domain.dto.ActiveUser; import com.hejinyo.core.domain.dto.SysMenu; import com.hejinyo.core.service.SysResourceService; import net.sf.json.JSONArray; import net.sf.json.JSONObject; import org.apache.shiro.SecurityUtils; import org.apache.shiro.subject.Subject; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; import javax.annotation.Resource; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; @Controller @RequestMapping("/sysMenu") public class SysMenuController { @Resource private SysResourceService sysResourceService; /** * 编辑菜单 * * @return */ @RequestMapping(value = "editMenu", method = RequestMethod.GET) public String editMenu() { return "core/sys_menu"; } /** * 获取菜单树 * * @return */ @RequestMapping(value = "menuTree", method = RequestMethod.GET, produces = "application/json") @ResponseBody public Object menuTree() { JSONArray jsonArray = new JSONArray(); Subject subject = SecurityUtils.getSubject(); ActiveUser activeUser = (ActiveUser) subject.getPrincipal(); //所有菜单 List<SysMenu> SysMenus = sysResourceService.getMenuList(activeUser.getLoginName()); for (int i = 0; i < SysMenus.size(); i++) { JSONObject jsonObject = new JSONObject(); jsonObject.put("id", String.valueOf(SysMenus.get(i).getMid())); if (0 == (SysMenus.get(i).getPid())) { jsonObject.put("parent", "#"); } else { jsonObject.put("parent", String.valueOf(SysMenus.get(i).getPid())); } jsonObject.put("text", SysMenus.get(i).getMname()); int menuLevel = SysMenus.get(i).getMlevel(); JSONObject state = new JSONObject(); if (menuLevel == 1) { state.put("opened", true); jsonObject.put("state", state); } else if (menuLevel == 2) { jsonObject.put("state", state); jsonObject.put("icon", "fa fa-folder text-primary"); } else if (menuLevel == 3) { jsonObject.put("icon", "fa fa-file text-primary"); } jsonArray.add(jsonObject); } /* String json = "[{\"id\":\"1\",\"parent\":\"#\",\"text\":\"Parent Node\"}," + "{\"id\":\"2\",\"parent\":\"1\",\"text\":\"Initially selected\",\"state\": {\"selected\": true}}," + "{\"id\":\"3\",\"parent\":\"1\",\"text\":\"Custom Icon\",\"icon\": \"fa fa-warning text-primary\"}," + "{\"id\":\"4\",\"parent\":\"1\",\"text\":\"Initially open\",\"icon\": \"fa fa-folder text-primary\", \"state\": {\"opened\": true}}," + "{\"id\":\"5\",\"parent\":\"4\",\"text\":\"Another node\",\"icon\": \"fa fa-file text-primary\"}]";*/ System.out.println(jsonArray.toString()); return jsonArray; } }
3,267
0.591484
0.587164
84
37.583332
31.133816
151
false
false
0
0
0
0
0
0
0.869048
false
false
13
5653eb21b31f1f9f04e981db5d49af03f25e7e4c
9,225,589,785,660
4ecb5b1e69be67fd5dcd5df00d37947d634372de
/TaxEngagement/src/test/java/steps/XBRLvalidate.java
d737066a23dba229d3fc9f154acf1aa25f439b4f
[]
no_license
MvdWeetering/Tax
https://github.com/MvdWeetering/Tax
5471d7981dd29e9926a921d262f2151549f97719
de05a35d6d77473000973f38f13afdfab3153dd8
refs/heads/master
2021-01-09T20:57:08.181000
2017-12-13T13:59:59
2017-12-13T13:59:59
81,466,960
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package steps; import cucumber.api.java.en.Given; import cucumber.api.java.en.Then; import cucumber.api.java.en.When; import gherkin.formatter.model.Result; import pageObjects.BalansActivaObjecten; import codebase.BalansActivaXLS; import codebase.BalansPassivaXLS; import codebase.FiscaleVermogensvergelijkingXLS; import codebase.LeesXLS; import codebase.ReadXML; import codebase.ToelichtingOverigeVoorzXLS; import codebase.VerliesVerrekeningXLS; import codebase.WinstVerliesXLS; import codebase.XLSbyColumn; import codebase.XMLandXLScompare; import codebase.convertDate; import codebase.vergelijk; import static org.junit.Assert.assertTrue; import java.util.ArrayList; import org.eclipse.jetty.io.NetworkTrafficListener.Empty; import org.hamcrest.core.IsNull; public class XBRLvalidate { ArrayList<String> Result = new ArrayList<String>(); @Given("^the reading of the XBRL is correct$") public void the_reading_of_the_XBRL_is_correct() throws Throwable { ArrayList<String> CheckEmpty = new ArrayList<String>(); CheckEmpty = ReadXML.GetXMLvalue("xbrli:xbrl"); // assertTrue(!CheckEmpty.isEmpty()); } @Given("^the reading of the XLS is correct$") public void the_reading_of_the_XLS_is_correct() throws Throwable { ArrayList<String> CheckEmpty = new ArrayList<String>(); CheckEmpty = XLSbyColumn.extractExcelContentByColumnIndex("Algemene_gegevens", 1); assertTrue(!CheckEmpty.isEmpty()); } @When("^the elements of the XBRL and the XLS for Specificatie aandeelhouders are compared$") public void the_elements_of_the_XBRL_and_the_XLS_for_Specificatie_aandeelhouders_are_compared() throws Throwable { // Naam aandeelhouder Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_aandeelh", "bd-bedr:ShareholderName", 1)); // Straatnaam adres aandeelhouder Result.addAll( XMLandXLScompare.XMLandXLScheckerArrays("Spec_aandeelh", "bd-bedr:ShareholderAddressStreetName", 4)); // Huisnummer adres aandeelhouder Result.addAll( XMLandXLScompare.XMLandXLScheckerArrays("Spec_aandeelh", "bd-bedr:ShareholderAddressHouseNumber", 5)); // Huisnummer buitenlands adres Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_aandeelh", "bd-bedr:ShareholderAddressHouseNumberAbroad", 6)); // Huisnummertoevoeging adres aandeelhouder Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_aandeelh", "bd-bedr:ShareholderAddressHouseNumberAddition", 8)); // Woonplaats aandeelhouder Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_aandeelh", "bd-bedr:ShareholderAddressPlaceOfResidence", 9)); // Woon- vestigingsland aandeelhouder Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_aandeelh", "bd-bedr:ShareholderResidenceEstablishmentCountryCode", 10)); // Nominale waarde gewone aandelen Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_aandeelh", "bd-bedr:ShareholderOrdinarySharesNominalValue", 11)); // Nominale waarde preferente aandelen einde boekjaar Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_aandeelh", "bd-bedr:ShareholderPrefenceSharesNominalValue", 12)); // Nominale waarde prioriteitsaandelen einde boekjaar Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_aandeelh", "bd-bedr:ShareholderPrioritySharesNominalValue", 13)); // Percentage nominaal geplaatst kapitaal Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_aandeelh", "bd-bedr:ShareholderIssuedCapitalPercentage", 14)); // Vordering belastingplichtige op aandeelhouder Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_aandeelh", "bd-bedr:ShareholderClaimTaxpayerOnShareholder", 15)); // In het boekjaar ontvangen rente van de aandeelhouder Result.addAll( XMLandXLScompare.XMLandXLScheckerArrays("Spec_aandeelh", "bd-bedr:ShareholderInterestReceived", 17)); // Schuld belastingplichtige aan aandeelhouder Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_aandeelh", "bd-bedr:ShareholderTaxpayerDebtToShareholder", 16)); // In dit boekjaar betaalde rente aan de aandeelhouder Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_aandeelh", "bd-bedr:ShareholderInterestPaid", 18)); // Informele kapitaalstorting door of via deze aandeelhouder Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_aandeelh", "bd-bedr:ShareholderInformalCapitalThroughOrByThisShareholder", 19)); // Omvang informele kapitaalstorting door of via deze aandeelhouder Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_aandeelh", "bd-bedr:ShareholderInformalCapitalSizeThroughOrByThisShareholder", 20)); // Omschrijving mening informeel kapitaal Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_aandeelh", "bd-bedr:ShareholderInformalCapitalOpinionDescription", 21)); // Naam uiteindelijke moedermaatschappij informeel kapitaal Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_aandeelh", "bd-bedr:ShareholderInformalCapitalFinalParentCompanyName", 22)); // Straatnaam vestigingsadres uiteindelijke moedermaatschappij informeel // kapitaal Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_aandeelh", "bd-bedr:ShareholderInformalCapitalFinalParentCompanyAddressOfEstablishmentStreetname", 23)); // Huisnummer vestigingsadres uiteindelijke moedermaatschappij informeel // kapitaal Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_aandeelh", "bd-bedr:ShareholderInformalCapitalFinalParentCompanyAddressOfEstablishmentHousenumber", 24)); // Toevoeging huisnummer vestigingsadres uiteindelijke // moedermaatschappij informeel kapitaal Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_aandeelh", "bd-bedr:ShareholderInformalCapitalFinalParentCompanyAddressOfEstablishmentHouseNumberAddition", 25)); // Vestigingsplaats uiteindelijke moedermaatschappij informeel kapitaal Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_aandeelh", "bd-bedr:ShareholderInformalCapitalFinalParentCompanyPlaceOfEstablishment", 26)); // Vestigingsland uiteindelijk moedermaatschappij informeel kapitaal Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_aandeelh", "bd-bedr:ShareholderInformalCapitalFinalParentCompanyEstablishmentCountryCode", 27)); // Bevoordeling afkomstig van directe aandeelhouder Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_aandeelh", "bd-bedr:ShareholderDirectShareholderBenefiting", 28)); // Naam rechtspersoon bevoordeling gedaan Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_aandeelh", "bd-bedr:ShareholderBenefitingLegalPersonsCompanyName", 29)); // Straatnaam vestigingsadres rechtspersoon bevoordeling gedaan Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_aandeelh", "bd-bedr:ShareholderBenefitingLegalPersonsCompanyAddressOfEstablishmentStreetName", 30)); // Huisnummer vestigingsadres rechtspersoon bevoordeling gedaan Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_aandeelh", "bd-bedr:ShareholderBenefitingLegalPersonsCompanyAddressOfEstablishmentHouseNumber", 31)); // Toevoeging huisnummer vestigingsadres rechtspersoon bevoordeling // gedaan Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_aandeelh", "bd-bedr:ShareholderBenefitingLegalPersonsCompanyAddressOfEstablishmentHouseNumberAddition", 32)); // Vestigingsplaats rechtspersoon bevoordeling gedaan Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_aandeelh", "bd-bedr:ShareholderBenefitingLegalPersonsCompanyPlaceOfEstablishment", 33)); // Vestigingsland rechtspersoon bevoordeling gedaan Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_aandeelh", "bd-bedr:ShareholderBenefitingLegalPersonsCompanyEstablishmentCountryCode", 34)); } @When("^the elements of the XBRL and the XLS for Algemene Gegevens are compared$") public void the_elements_of_the_XBRL_and_the_XLS_for_Algemene_Gegevens_are_compared() throws Throwable { // Write code here that turns the phrase above into concrete actions // LegalPersonName Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Algemene_gegevens", "bd-bedr:LegalPersonName", 1)); // FunctionalCurrencySchemeExists Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Algemene_gegevens", "bd-bedr:FunctionalCurrencySchemeExists", 8)); // TaxReturnConcernsTaxEntity Result.addAll( XMLandXLScompare.XMLandXLScheckerArrays("Algemene_gegevens", "bd-bedr:TaxReturnConcernsTaxEntity", 7)); // TaxConsultantNumber Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Algemene_gegevens", "bd-alg:TaxConsultantNumber", 9)); // TaxConsultantInitials Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Algemene_gegevens", "bd-alg:TaxConsultantInitials", 12)); // TaxConsultantPrefix Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Algemene_gegevens", "bd-alg:TaxConsultantInitials", 12)); // TaxConsultantSurname Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Algemene_gegevens", "bd-alg:TaxConsultantSurname", 14)); // TaxConsultantTelephoneNumber Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Algemene_gegevens", "bd-alg:TaxConsultantTelephoneNumber", 15)); // IncomeTaxReturnSignatureInitials Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Algemene_gegevens", "bd-bedr:IncomeTaxReturnSignatureInitials", 18)); // IncomeTaxReturnSignaturePrefix Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Algemene_gegevens", "bd-bedr:IncomeTaxReturnSignaturePrefix", 19)); // IncomeTaxReturnSignatureSurname Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Algemene_gegevens", "bd-bedr:IncomeTaxReturnSignatureSurname", 20)); // IncomeTaxReturnSignatureFunctionSignatory Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Algemene_gegevens", "bd-bedr:IncomeTaxReturnSignatureFunctionSignatory", 21)); // IncomeTaxReturnSignatureTelephoneNumber Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Algemene_gegevens", "bd-bedr:IncomeTaxReturnSignatureTelephoneNumber", 22)); // RequestExplicitDecisionTaxAdministrationExists Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Algemene_gegevens", "bd-alg:RequestExplicitDecisionTaxAdministrationExists", 6)); // RequestExplicitDecisionTaxAdministrationDescription Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Algemene_gegevens", "bd-bedr:RequestExplicitDecisionTaxAdministrationDescription", 6)); } @When("^the elements of the XBRL and the XLS for Specificatie Deelneming are compared$") public void the_elements_of_the_XBRL_and_the_XLS_for_Specificatie_Deelneming_are_compared() throws Throwable { // ParticipatingInterestName // Naam deelneming Result.addAll( XMLandXLScompare.XMLandXLScheckerArrays("Spec_deelneming", "bd-bedr:ParticipatingInterestName", 1)); // ParticipatingInterestIdentificationNumber // Identificatienummer deelneming Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_deelneming", "bd-bedr:ParticipatingInterestIdentificationNumber", 2)); // PlaceOfEstablishmentParticipatingInterest // Vestigingsplaats deelneming Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_deelneming", "bd-bedr:PlaceOfEstablishmentParticipatingInterest", 3)); // EstablishmentParticipatingInterestCountry // Vestigingsland deelneming Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_deelneming", "bd-bedr:EstablishmentParticipatingInterestCountry", 4)); // ParticipatingInterestPercentageInterest // Percentage aandelenbezit deelneming Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_deelneming", "bd-bedr:ParticipatingInterestPercentageInterest", 5)); // InterestParticipatingInterestNominalValue // Nominale waarde aandelenbezit deelneming Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_deelneming", "bd-bedr:InterestParticipatingInterestNominalValue", 9)); // ParticipatingInterestSacrificedAmount // Opgeofferd bedrag aandelenbezit deelneming Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_deelneming", "bd-bedr:ParticipatingInterestSacrificedAmount", 10)); // SheetValuationParticipatingInterestBalance // Balanswaardering deelneming fiscaal Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_deelneming", "bd-bedr:SheetValuationParticipatingInterestBalance", 11)); // ParticipatingInterestBenefits // Voordelen deelneming boekjaar Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_deelneming", "bd-bedr:ParticipatingInterestBenefits", 12)); // ParticipatingInterestReceivableAmount // Bedrag vordering op deelneming Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_deelneming", "bd-bedr:ParticipatingInterestReceivableAmount", 13)); // InterestReceivedFromParticipatingInterest // In het boekjaar ontvangen rente van de deelneming Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_deelneming", "bd-bedr:InterestReceivedFromParticipatingInterest", 15)); // ParticipatingInterestPayableAmount // Bedrag schuld aan deelneming Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_deelneming", "bd-bedr:ParticipatingInterestPayableAmount", 14)); // InterestPaidToParticipatingInterest // In het boekjaar betaalde rente aan de deelneming Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_deelneming", "bd-bedr:InterestPaidToParticipatingInterest", 16)); // ParticipatingInterestJoiningOrRemovalTaxEntityExists // Voeging of ontvoeging van deelneming fiscale eenheid van // belastingplichtige Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_deelneming", "bd-bedr:ParticipatingInterestJoiningOrRemovalTaxEntityExists", 17)); // ParticipatingInterestObtainmentEnlargementExists // Verwerving of uitbreiding deelneming van toepassing Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_deelneming", "bd-bedr:ParticipatingInterestObtainmentEnlargementExists", 20)); // ParticipatingInterestAlienationDiminutionExists // Vervreemding of verkleining deelneming van toepassing Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_deelneming", "bd-bedr:ParticipatingInterestAlienationDiminutionExists", 27)); // ParticipatingInterestLiquidationExists // Deelneming liquidatie Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_deelneming", "bd-bedr:ParticipatingInterestLiquidationExists", 33)); // ParticipatingInterestApplicationValuationInstructionArticle13aApplied // Waarderingsvoorschrift artikel 13a op deelneming toegepast Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_deelneming", "bd-bedr:ParticipatingInterestApplicationValuationInstructionArticle13aApplied", 36)); // ParticipatingInterestQualificationAsNotQualified // Kwalificatie als niet kwalificerende beleggingsdeelneming Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_deelneming", "bd-bedr:ParticipatingInterestQualificationAsNotQualified", 37)); // TaxEntityJoiningDate // Voegingsdatum deelneming Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_deelneming", "bd-bedr:TaxEntityJoiningDate", 18)); // TaxEntityRemovalDate // Ontvoegingsdatum deelneming Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_deelneming", "bd-bedr:TaxEntityRemovalDate", 19)); // ParticipatingInterestObtainmentEnlargementPercentage // Percentage verwerving of uitbreiding aandelenbezit deelneming Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_deelneming", "bd-bedr:ParticipatingInterestObtainmentEnlargementPercentage", 21)); // ParticipatingInterestObtainmentEnlargementNominalValue // Nominale waarde verwerving of uitbreiding aandelenbezit deelneming Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_deelneming", "bd-bedr:ParticipatingInterestObtainmentEnlargementNominalValue", 22)); // ParticipatingInterestObtainmentEnlargementSacrificedAmount // Opgeofferd bedrag verwerving of uitbreiding aandelenbezit deelneming Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_deelneming", "bd-bedr:ParticipatingInterestObtainmentEnlargementSacrificedAmount", 23)); // ParticipatingInterestObtainedAffiliatedPerson // Deelneming is verworven van verbonden natuurlijk- of rechtspersoon Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_deelneming", "bd-bedr:ParticipatingInterestObtainedAffiliatedPerson", 26)); // ParticipatingInterestAlienationDiminutionPercentage // Percentage vervreemding of verkleining aandelenbezit deelneming Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_deelneming", "bd-bedr:ParticipatingInterestAlienationDiminutionPercentage", 28)); // ParticipatingInterestAlienationDiminutionNominalValue // Nominale waarde vervreemding of verkleining aandelenbezit deelneming Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_deelneming", "bd-bedr:ParticipatingInterestAlienationDiminutionNominalValue", 29)); // ParticipatingInterestAlienationDiminutionRevenue // Opbrengst vervreemding of verkleining aandelenbezit deelneming Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_deelneming", "bd-bedr:ParticipatingInterestAlienationDiminutionRevenue", 30)); // ParticipatingInterestAlienationAffiliatedPerson // Deelneming is vervreemd aan verbonden natuurlijk- of rechtspersoon // Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_deelneming","bd-bedr:ParticipatingInterestAlienationAffiliatedPerson", // 27)); // InterestsWithParticipatingInterestSettlementDate // Vereffeningsdatum deelneming Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_deelneming", "bd-bedr:InterestsWithParticipatingInterestSettlementDate", 34)); // ParticipatingInterestLiquidationLoss // Liquidatieverlies van deelneming Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_deelneming", "bd-bedr:ParticipatingInterestLiquidationLoss", 35)); // ParticipatingInterestEconomicValue // Waarde in het economisch verkeer van deelneming Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_deelneming", "bd-bedr:ParticipatingInterestEconomicValue", 38)); // ParticipatingInterestPercentageFallenBelowTwentyFivePercent // Percentage in deelneming gedaald onder 25 procent // Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_deelneming","bd-bedr:ParticipatingInterestPercentageFallenBelowTwentyFivePercent", // 36)); // ParticipatingInterestValueAtTimeOfShareChangeToBelowTwentyFivePercent // Waarde van 25 procent-of-meer-belang op tijdstip mutatie Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_deelneming", "bd-bedr:ParticipatingInterestValueAtTimeOfShareChangeToBelowTwentyFivePercent", 38)); // ParticipatingInterestEngrossmentBenefit // Brutering van voordeel bij deelneming Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_deelneming", "bd-bedr:ParticipatingInterestEngrossmentBenefit", 39)); // ParticipatingInterestEuropeanUnitProfitPaymentPartBenefit // EU-deelneming en winstuitkering als onderdeel van voordeel Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_deelneming", "bd-bedr:ParticipatingInterestEuropeanUnitProfitPaymentPartBenefit", 41)); // ParticipatingInterestEngrossmentAndSetoffWithEffectiveTaxExists // Brutering en verrekening met effectieve belasting deelneming // Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_deelneming","bd-ParticipatingInterestEngrossmentAndSetoffWithEffectiveTaxExists", // x)); // ParticipatingInterestDifferentSetoffWithAlreadyTaxedBenefitExists // Afwijkende verrekening bij reeds belaste winstuitkering deelneming Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_deelneming", "bd-bedr:ParticipatingInterestDifferentSetoffWithAlreadyTaxedBenefitExists", 43)); } @When("^the elements of the XBRL and the XLS for Toelichting Balans are compared$") public void the_elements_of_the_XBRL_and_the_XLS_for_Toelichting_Balans_are_compared() throws Throwable { // EnvironmentalBusinessAssetsPurchaseCostsFiscal // Aanschafkosten milieu-bedrijfsmiddelen fiscaal Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Toelichting_balans", "bd-ParticipatingInterestDifferentSetoffWithAlreadyTaxedBenefitExists", 1)); // EnvironmentalBusinessAssetsFiscal // Milieu-bedrijfsmiddelen fiscaal Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Toelichting_balans", "bd-EnvironmentalBusinessAssetsFiscal", 1)); // EnvironmentalBusinessAssetsResidualValueFiscal // Restwaarde milieu-bedrijfsmiddelen fiscaal Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Toelichting_balans", "bd-EnvironmentalBusinessAssetsResidualValueFiscal", 1)); // BuildingsOwnUsePurchaseCostsFiscal // Aanschafkosten gebouwen in eigen gebruik fiscaal Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Toelichting_balans", "bd-BuildingsOwnUsePurchaseCostsFiscal", 1)); // BuildingsOwnUseFiscal // Gebouwen in eigen gebruik fiscaal Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Toelichting_balans", "bd-BuildingsOwnUseFiscal", 1)); // BuildingsOwnUseResidualValueFiscal // Restwaarde gebouwen in eigen gebruik fiscaal Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Toelichting_balans", "bd-BuildingsOwnUseResidualValueFiscal", 1)); // BuildingsOwnUseSoilValueFiscal // Bodemwaarde gebouwen in eigen gebruik fiscaal Result.addAll( XMLandXLScompare.XMLandXLScheckerArrays("Toelichting_balans", "bd-BuildingsOwnUseSoilValueFiscal", 1)); // BuildingsForInvestmentPurposesPurchaseCostsFiscal // Aanschafkosten gebouwen ter belegging fiscaal Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Toelichting_balans", "bd-BuildingsForInvestmentPurposesPurchaseCostsFiscal", 1)); // BuildingsForInvestmentPurposesFiscal // Gebouwen ter belegging fiscaal Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Toelichting_balans", "bd-BuildingsForInvestmentPurposesFiscal", 1)); // BuildingsForInvestmentPurposesResidualValueFiscal // Restwaarde gebouwen ter belegging fiscaal Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Toelichting_balans", "bd-BuildingsForInvestmentPurposesResidualValueFiscal", 1)); // BuildingsForInvestmentPurposesSoilValueFiscal // Bodemwaarde gebouwen ter belegging fiscaal Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Toelichting_balans", "bd-BuildingsForInvestmentPurposesSoilValueFiscal", 1)); // BuildingsPurchaseCostsWithoutDepreciationFiscal // Aanschafkosten gebouwen zonder afschrijving fiscaal Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Toelichting_balans", "bd-BuildingsPurchaseCostsWithoutDepreciationFiscal", 1)); // BuildingsWithoutDepreciationFiscal // Gebouwen zonder afschrijving fiscaal Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Toelichting_balans", "bd-BuildingsWithoutDepreciationFiscal", 1)); // CompanySitesFiscal // Bedrijfsterreinen fiscaal Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Toelichting_balans", "bd-CompanySitesFiscal", 1)); // CompanySitesPurchaseCostsFiscal // Kosten aanschaf bedrijfsterreinen fiscaal Result.addAll( XMLandXLScompare.XMLandXLScheckerArrays("Toelichting_balans", "bd-CompanySitesPurchaseCostsFiscal", 1)); // CompanySitesResidualValueFiscal // Restwaarde bedrijfsterreinen fiscaal Result.addAll( XMLandXLScompare.XMLandXLScheckerArrays("Toelichting_balans", "bd-CompanySitesResidualValueFiscal", 1)); // MachineryPurchaseCostsFiscal // Kosten aanschaf machines fiscaal Result.addAll( XMLandXLScompare.XMLandXLScheckerArrays("Toelichting_balans", "bd-MachineryPurchaseCostsFiscal", 1)); // MachineryResidualValueFiscal // Restwaarde machines fiscaal Result.addAll( XMLandXLScompare.XMLandXLScheckerArrays("Toelichting_balans", "bd-MachineryResidualValueFiscal", 1)); // FixedAssetsOtherPurchaseCostsFiscal // Andere vaste bedrijfsmiddelen aanschafwaarde fiscaal Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Toelichting_balans", "bd-FixedAssetsOtherPurchaseCostsFiscal", 1)); // FixedAssetsOtherResidualValueFiscal // Andere vaste bedrijfsmiddelen restwaarde fiscaal Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Toelichting_balans", "bd-FixedAssetsOtherResidualValueFiscal", 1)); // ReinvestmentReserveDisposedBusinessAssetDescription // Omschrijving vervreemd bedrijfsmiddel Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Toelichting_balans", "bd-ReinvestmentReserveDisposedBusinessAssetDescription", 1)); // ReinvestmentReserveDisposedBusinessAssetYear // Jaar vervreemding bedrijfsmiddel Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Toelichting_balans", "bd-ReinvestmentReserveDisposedBusinessAssetYear", 1)); // ReinvestmentReserveDisposedBusinessAssetBookProfit // Boekwinst vervreemde bedrijfsmiddel Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Toelichting_balans", "bd-ReinvestmentReserveDisposedBusinessAssetBookProfit", 1)); // ReinvestmentReserveDisposedBusinessAssetDepreciationPercentage // Afschrijvingspercentage vervreemd bedrijfsmiddel Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Toelichting_balans", "bd-ReinvestmentReserveDisposedBusinessAssetDepreciationPercentage", 1)); // ReinvestmentReserveDisposedBusinessAssetBookValueAtTransferTime // Boekwaarde bedrijfsmiddel op vervreemdingsmoment Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Toelichting_balans", "bd-ReinvestmentReserveDisposedBusinessAssetBookValueAtTransferTime", 1)); // // Omschrijving soort garantievoorziening Result.addAll( XMLandXLScompare.XMLandXLScheckerArrays("Toelichting_balans", "bd-WarrantyProvisionDescription", 1)); // WarrantyProvisionAllocationAmount // Dotatie garantievoorziening Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Toelichting_balans", "bd-WarrantyProvisionAllocationAmount", 1)); // WarrantyProvisionWithdrawal // Onttrekking garantievoorziening Result.addAll( XMLandXLScompare.XMLandXLScheckerArrays("Toelichting_balans", "bd-WarrantyProvisionWithdrawal", 1)); // WarrantyProvisionFiscalAmount // Garantievoorziening fiscaal einde boekjaar Result.addAll( XMLandXLScompare.XMLandXLScheckerArrays("Toelichting_balans", "bd-WarrantyProvisionFiscalAmount", 1)); // ProvisionsOtherDescription // Omschrijving overige voorziening Result.addAll( XMLandXLScompare.XMLandXLScheckerArrays("Toelichting_balans", "bd-ProvisionsOtherDescription", 1)); // ProvisionsOtherAllocation // Dotatie overige voorziening Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Toelichting_balans", "bd-ProvisionsOtherAllocation", 1)); // ProvisionsOtherWithdrawal // Onttrekking overige voorziening Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Toelichting_balans", "bd-ProvisionsOtherWithdrawal", 1)); // ProvisionsOtherAmount // Overige voorziening einde boekjaar Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Toelichting_balans", "bd-ProvisionsOtherAmount", 1)); // ValueAddedTaxPayableOrReceivablePartThisFinancialyear // Schuld/vordering over dit boekjaar Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Toelichting_balans", "bd-ValueAddedTaxPayableOrReceivablePartThisFinancialyear", 1)); // ValueAddedTaxPayableOrReceivablePartPreviousFinancialyear // Schuld/vordering over het vorig boekjaar Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Toelichting_balans", "bd-ValueAddedTaxPayableOrReceivablePartPreviousFinancialyear", 1)); // ValueAddedTaxPayableOrReceivablePartPrecedingPreviousFinancialyear // Schuld/vordering over oudere boekjaren Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Toelichting_balans", "bd-ValueAddedTaxPayableOrReceivablePartPrecedingPreviousFinancialyear", 1)); } @When("^the elements of the XBRL and the XLS for Zeescheepvaart are compared$") public void the_elements_of_the_XBRL_and_the_XLS_for_Zeescheepvaart_are_compared() throws Throwable { Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Zeescheepvaart", "bd-bedr:ShipName", 1)); Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Zeescheepvaart", "bd-bedr:NetTonnageShip", 2)); Result.addAll( XMLandXLScompare.XMLandXLScheckerArrays("Zeescheepvaart", "bd-bedr:ShipExploitationDaysCount", 3)); Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Zeescheepvaart", "bd-bedr:ShipParticipatingInterestPercentage", 4)); } @When("^the elements of the XBRL and the XLS for Balans Activa are compared$") public void the_elements_of_the_XBRL_and_the_XLS_for_Balans_Activa_are_compared() throws Throwable { // Write code here that turns the phrase above into concrete actions String Tab = "TC04"; // Naam van de onderneming // BusinessName // Omschrijving activiteiten van de onderneming // BusinessActivitiesDescription // Dochtermaatschappij fiscale eenheid // SubsidiaryTaxEntityExists // Agrarische activiteiten // AgriculturalActivitiesExist // Goodwill fiscaal // GoodwillFiscal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:GoodwillFiscal").toString(), Double.parseDouble(BalansActivaXLS.HaalData("G", 16, Tab)), "G16")); // Overige immateriële vaste activa fiscaal // IntangibleFixedAssetsOtherFiscal Result.addAll( vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:IntangibleFixedAssetsOtherFiscal").toString(), Double.parseDouble(BalansActivaXLS.HaalData("G", 17, Tab)), "G17")); // Totaal immateriële vaste activa fiscaal // IntangibleFixedAssetsTotalFiscal Result.addAll( vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:IntangibleFixedAssetsTotalFiscal").toString(), Double.parseDouble(BalansActivaXLS.HaalData("G", 18, Tab)), "G18")); // Gebouwen en terreinen fiscaal // BuildingsAndLandFiscal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:BuildingsAndLandFiscal").toString(), Double.parseDouble(BalansActivaXLS.HaalData("G", 26, Tab)), "G26")); // Machines en installaties fiscaal // MachinesAndInstallationsFiscal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:MachinesAndInstallationsFiscal").toString(), Double.parseDouble(BalansActivaXLS.HaalData("G", 27, Tab)), "G27")); // Andere vaste bedrijfsmiddelen fiscaal // FixedAssetsOtherFiscal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:FixedAssetsOtherFiscal").toString(), Double.parseDouble(BalansActivaXLS.HaalData("G", 28, Tab)), "G28")); // Totaal materiële vaste activa fiscaal // TangibleFixedAssetsFiscalTotal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:TangibleFixedAssetsFiscalTotal").toString(), Double.parseDouble(BalansActivaXLS.HaalData("G", 29, Tab)), "G29")); // Deelnemingen fiscaal // ParticipatingInterests Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:ParticipatingInterests").toString(), Double.parseDouble(BalansActivaXLS.HaalData("G", 37, Tab)), "G37")); // Langlopende vorderingen op groepsmaatschappijen fiscaal // LongTermReceivablesGroupCompaniesFiscal Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:LongTermReceivablesGroupCompaniesFiscal").toString(), Double.parseDouble(BalansActivaXLS.HaalData("G", 38, Tab)), "G38")); // Langlopende vorderingen participanten/maatschappij waarin wordt // deelgenomen, fiscaal // LongTermReceivablesParticipatingInterestCompaniesFiscal Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:LongTermReceivablesParticipatingInterestCompaniesFiscal").toString(), Double.parseDouble(BalansActivaXLS.HaalData("G", 39, Tab)), "G39")); // Overige financiële vaste activa fiscaal // FinancialFixedAssetsOtherFiscal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:FinancialFixedAssetsOtherFiscal").toString(), Double.parseDouble(BalansActivaXLS.HaalData("G", 40, Tab)), "G40")); // Totaal financiële vaste activa fiscaal // FinancialFixedAssetsTotalFiscal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:FinancialFixedAssetsTotalFiscal").toString(), Double.parseDouble(BalansActivaXLS.HaalData("G", 41, Tab)), "G41")); // Langlopende vorderingen op groepsmaatschappijen nominaal // LongTermReceivablesGroupCompaniesNominal Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:LongTermReceivablesGroupCompaniesNominal").toString(), Double.parseDouble(BalansActivaXLS.HaalData("B", 38, Tab)), "B38")); // Langlopende vorderingen participanten/maatschappij waarin wordt // deelgenomen, nominaal // LongTermReceivablesParticipatingInterestCompaniesNominal Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:LongTermReceivablesParticipatingInterestCompaniesNominal").toString(), Double.parseDouble(BalansActivaXLS.HaalData("B", 39, Tab)), "B39")); // Overige financiële vaste activa fiscaal nominaal // FinancialFixedAssetsOtherTaxNominalFiscal Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:FinancialFixedAssetsOtherTaxNominalFiscal").toString(), Double.parseDouble(BalansActivaXLS.HaalData("B", 40, Tab)), "B40")); // Voorraden, exclusief onderhanden werk // StockExcludingWorkInProgress Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:StockExcludingWorkInProgress").toString(), Double.parseDouble(BalansActivaXLS.HaalData("G", 48, Tab)), "G48")); // Onderhanden werk fiscaal // WorkInProgressFiscal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:WorkInProgressFiscal").toString(), Double.parseDouble(BalansActivaXLS.HaalData("G", 49, Tab)), "G49")); // Totaal voorraden fiscaal // StockTotalFiscal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:StockTotalFiscal").toString(), Double.parseDouble(BalansActivaXLS.HaalData("G", 50, Tab)), "G50")); // Vorderingen op handelsdebiteuren fiscaal // TradeAccountsReceivableFiscal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:TradeAccountsReceivableFiscal").toString(), Double.parseDouble(BalansActivaXLS.HaalData("G", 57, Tab)), "G57")); // Vorderingen omzetbelasting fiscaal // ValueAddedTaxReceivablesFiscal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:ValueAddedTaxReceivablesFiscal").toString(), Double.parseDouble(BalansActivaXLS.HaalData("G", 58, Tab)), "G58")); // Kortlopende vorderingen op groepsmaatschappijen fiscaal // ShortTermReceivablesGroupCompaniesFiscal Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:ShortTermReceivablesGroupCompaniesFiscal").toString(), Double.parseDouble(BalansActivaXLS.HaalData("G", 59, Tab)), "G59")); // Kortlopende vorderingen participanten/maatschappij waarin wordt // deelgenomen, fiscaal // ShortTermReceivablesParticipatingInterestCompaniesFiscal Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:ShortTermReceivablesParticipatingInterestCompaniesFiscal").toString(), Double.parseDouble(BalansActivaXLS.HaalData("G", 60, Tab)), "G60")); // Overige vorderingen fiscaal // ReceivablesOtherFiscal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:ReceivablesOtherFiscal").toString(), Double.parseDouble(BalansActivaXLS.HaalData("G", 61, Tab)), "G61")); // Totaal vorderingen fiscaal // ReceivablesTotalFiscal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:ReceivablesTotalFiscal").toString(), Double.parseDouble(BalansActivaXLS.HaalData("G", 62, Tab)), "G62")); // Nominaal handelsdebiteuren fiscaal // TradeReceivablesNominal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:TradeReceivablesNominal").toString(), Double.parseDouble(BalansActivaXLS.HaalData("B", 57, Tab)), "B57")); // Kortlopende vorderingen op groepsmaatschappijen nominaal // ShortTermReceivablesGroupCompaniesNominal Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:ShortTermReceivablesGroupCompaniesNominal").toString(), Double.parseDouble(BalansActivaXLS.HaalData("B", 59, Tab)), "B59")); // Kortlopende vorderingen participanten/maatschappij waarin wordt // deelgenomen, nominaal // ShortTermReceivablesParticipatingInterestCompaniesNominal Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:ShortTermReceivablesParticipatingInterestCompaniesNominal").toString(), Double.parseDouble(BalansActivaXLS.HaalData("B", 60, Tab)), "B60")); // Effecten fiscaal // SecuritiesFiscal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:SecuritiesFiscal").toString(), Double.parseDouble(BalansActivaXLS.HaalData("G", 67, Tab)), "G67")); // Liquide middelen fiscaal // LiquidAssetsTotalFiscal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:LiquidAssetsTotalFiscal").toString(), Double.parseDouble(BalansActivaXLS.HaalData("G", 72, Tab)), "G72")); // Totaal activa fiscaal // AssetsTotalAmountFiscal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:AssetsTotalAmountFiscal").toString(), Double.parseDouble(BalansActivaXLS.HaalData("G", 77, Tab)), "G77")); // Kosten aanschaf goodwill fiscaal // GoodwillPurchaseCostsFiscal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:GoodwillPurchaseCostsFiscal").toString(), Double.parseDouble(BalansActivaXLS.HaalData("B", 16, Tab)), "B16")); // Aanschaf/voortbrengingskosten overige immateriële vaste activa // fiscaal // IntangibleFixedAssetsOtherPurchaseOrProductionCostsFiscal Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:IntangibleFixedAssetsOtherPurchaseOrProductionCostsFiscal").toString(), Double.parseDouble(BalansActivaXLS.HaalData("B", 17, Tab)), "B17")); // Toelichting op balans activa // BalanceSheetAssetsDescription } @When("^the elements of the XBRL and the XLS for Balans Passiva are compared$") public void the_elements_of_the_XBRL_and_the_XLS_for_Balans_Passiva_are_compared() throws Throwable { String Tab = "TC04"; // PaidCalledUpCapitalFiscal // Gestort en opgevraagd kapitaal fiscaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:PaidCalledUpCapitalFiscal").toString(), Double.parseDouble(BalansPassivaXLS.HaalData("F", 9, Tab)), "F9")); // InformalCapitalFiscal // Informeel kapitaal fiscaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:InformalCapitalFiscal").toString(), Double.parseDouble(BalansPassivaXLS.HaalData("F", 10, Tab)), "F10")); // SharePremiumFiscal // Agio fiscaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:SharePremiumFiscal").toString(), Double.parseDouble(BalansPassivaXLS.HaalData("F", 11, Tab)), "F11")); // RetainedProfitsFiscal // Winstreserve fiscaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:RetainedProfitsFiscal").toString(), Double.parseDouble(BalansPassivaXLS.HaalData("F", 12, Tab)), "F12")); // EqualizationReserveCostsFiscal // Kosten egalisatiereserve fiscaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:EqualizationReserveCostsFiscal").toString(), Double.parseDouble(BalansPassivaXLS.HaalData("F", 13, Tab)), "F13")); // ReinvestmentReserveFiscal // Herinvesteringsreserve fiscaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:ReinvestmentReserveFiscal").toString(), Double.parseDouble(BalansPassivaXLS.HaalData("F", 14, Tab)), "F14")); // CompartmentReserveTaxed // Belaste compartimenteringsreserve Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:CompartmentReserveTaxed").toString(), Double.parseDouble(BalansPassivaXLS.HaalData("F", 15, Tab)), "F15")); // TaxReservesOtherFiscal // Overige fiscale reserves Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:TaxReservesOtherFiscal").toString(), Double.parseDouble(BalansPassivaXLS.HaalData("F", 16, Tab)), "F16")); // EquityCapitalBusinessAssetsTotalFiscal // Eigen vermogen/fiscaal ondernemingsvermogen // WarrantyProvisionFiscal // Garantievoorziening fiscaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:WarrantyProvisionFiscal").toString(), Double.parseDouble(BalansPassivaXLS.HaalData("F", 25, Tab)), "F25")); // ProvisionAnnuityPensionAndRightOfStanding // Voorzieningen voor lijfrente, pensioen en stamrecht Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:ProvisionAnnuityPensionAndRightOfStanding").toString(), Double.parseDouble(BalansPassivaXLS.HaalData("F", 26, Tab)), "F26")); // ProvisionsOtherFiscal // Overige voorzieningen fiscaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:ProvisionsOtherFiscal").toString(), Double.parseDouble(BalansPassivaXLS.HaalData("F", 27, Tab)), "F27")); // ProvisionsTotalFiscal // Totaal voorzieningen fiscaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:ProvisionsTotalFiscal").toString(), Double.parseDouble(BalansPassivaXLS.HaalData("F", 28, Tab)), "F28")); // ConvertibleLoansFiscal // Converteerbare leningen fiscaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:ConvertibleLoansFiscal").toString(), Double.parseDouble(BalansPassivaXLS.HaalData("F", 36, Tab)), "F36")); // BondsFiscal // Obligaties fiscaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:BondsFiscal").toString(), Double.parseDouble(BalansPassivaXLS.HaalData("F", 38, Tab)), "F38")); // LongTermDebtsGroupCompanies // Langlopende schulden groepsmaatschappijen Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:LongTermDebtsGroupCompanies").toString(), Double.parseDouble(BalansPassivaXLS.HaalData("F", 39, Tab)), "F39")); // LongTermDebtsParticipatingInterestCompanies // Langlopende schulden participanten/maatschappij waarin wordt // deelgenomen Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:LongTermDebtsParticipatingInterestCompanies").toString(), Double.parseDouble(BalansPassivaXLS.HaalData("F", 40, Tab)), "F40")); // PayablesCreditInstitutionFiscal // Schulden aan kredietinstellingen fiscaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:PayablesCreditInstitutionFiscal").toString(), Double.parseDouble(BalansPassivaXLS.HaalData("F", 37, Tab)), "F37")); // LongTermDebtsOther // Overige langlopende schulden Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:LongTermDebtsOther").toString(), Double.parseDouble(BalansPassivaXLS.HaalData("F", 41, Tab)), "F41")); // LongTermDebtsTotal // Totaal langlopende schulden Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:LongTermDebtsTotal").toString(), Double.parseDouble(BalansPassivaXLS.HaalData("F", 42, Tab)), "F42")); // AccountsPayableSuppliersTradeCreditors // Schulden aan leveranciers en handelskredieten Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:AccountsPayableSuppliersTradeCreditors").toString(), Double.parseDouble(BalansPassivaXLS.HaalData("F", 49, Tab)), "F49")); // ValueAddedTaxPayablesFiscal // Schulden omzetbelasting fiscaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:ValueAddedTaxPayablesFiscal").toString(), Double.parseDouble(BalansPassivaXLS.HaalData("F", 50, Tab)), "F50")); // ShortTermDebtsGroupCompanies // Kortlopende schulden groepsmaatschappijen Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:ShortTermDebtsGroupCompanies").toString(), Double.parseDouble(BalansPassivaXLS.HaalData("F", 52, Tab)), "F52")); // WageTaxDebt // Loonheffingen Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:WageTaxDebt").toString(), Double.parseDouble(BalansPassivaXLS.HaalData("F", 51, Tab)), "F51")); // ShortTermDebtsParticipatingInterestCompanies // Kortlopende schulden participanten/maatschappij waarin wordt // deelgenomen Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:ShortTermDebtsParticipatingInterestCompanies").toString(), Double.parseDouble(BalansPassivaXLS.HaalData("F", 53, Tab)), "F53")); // ShortTermDebtsOther // Overige kortlopende schulden Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:ShortTermDebtsOther").toString(), Double.parseDouble(BalansPassivaXLS.HaalData("F", 54, Tab)), "F54")); // ShortTermDebtsTotal // Totaal kortlopende schulden Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:ShortTermDebtsTotal").toString(), Double.parseDouble(BalansPassivaXLS.HaalData("F", 55, Tab)), "F55")); // LiabilitiesTotalFiscal // Totaal passiva fiscaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:LiabilitiesTotalFiscal").toString(), Double.parseDouble(BalansPassivaXLS.HaalData("F", 59, Tab)), "F59")); // BalanceSheetLiabilitiesDescription // Toelichting op balans passiva } @When("^the elements of the XBRL and the XLS for Fiscale vermogensvergelijking are compared$") public void the_elements_of_the_XBRL_and_the_XLS_for_Fiscale_vermogensvergelijking_are_compared() throws Throwable { // Write code here that turns the phrase above into concrete actions String Tab = "TC01"; // ProfitDistributionSubjectToDividendDate // De datum waarop het dividend ter beschikking is gesteld Result.addAll(vergelijk.VergelijkTupple( ReadXML.GetXMLvalue("bd-bedr:ProfitDistributionSubjectToDividendDate").toString(), convertDate.changedateformat(FiscaleVermogensvergelijkingXLS.HaalText("B", 24, Tab)), convertDate.changedateformat(FiscaleVermogensvergelijkingXLS.HaalText("B", 25, Tab)))); // DividendTaxReturnDate // Datum aangifte dividendbelasting Result.addAll(vergelijk.VergelijkTupple(ReadXML.GetXMLvalue("bd-bedr:DividendTaxReturnDate").toString(), convertDate.changedateformat(FiscaleVermogensvergelijkingXLS.HaalText("C", 24, Tab)), convertDate.changedateformat(FiscaleVermogensvergelijkingXLS.HaalText("C", 25, Tab)))); // DividendTaxWithheldAmount // Bedrag ingehouden dividendbelasting Result.addAll(vergelijk.VergelijkTupple(ReadXML.GetXMLvalue("bd-bedr:DividendTaxWithheldAmount").toString(), FiscaleVermogensvergelijkingXLS.HaalData("D", 24, Tab), FiscaleVermogensvergelijkingXLS.HaalData("D", 25, Tab))); // ProfitDistributionAmount // Bedrag winstuitdeling Result.addAll(vergelijk.VergelijkTupple(ReadXML.GetXMLvalue("bd-bedr:ProfitDistributionAmount").toString(), FiscaleVermogensvergelijkingXLS.HaalData("E", 24, Tab), FiscaleVermogensvergelijkingXLS.HaalData("E", 25, Tab))); // ProfitDistributionsSubjectToDividendTaxTotalAmount // Totaal aan dividendbelasting onderworpen winstuitdelingen Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:ProfitDistributionsSubjectToDividendTaxTotalAmount").toString(), Double.parseDouble(FiscaleVermogensvergelijkingXLS.HaalData("F", 21, Tab)), "F21")); // CorporationTaxWithdrawnFromEquityCapital // Vennootschapsbelasting aan fiscaal vermogen onttrokken Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:CorporationTaxWithdrawnFromEquityCapital").toString(), Double.parseDouble(FiscaleVermogensvergelijkingXLS.HaalData("F", 27, Tab)), "F27")); // ForeignTaxAmountThisFinancialYearAppliedDoubleTaxAvoidance // Buitenlandse belasting over dit boekjaar voorzover hierop een // regeling ter voorkoming van dubbele belasting van toepassing is Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:ForeignTaxAmountThisFinancialYearAppliedDoubleTaxAvoidance").toString(), Double.parseDouble(FiscaleVermogensvergelijkingXLS.HaalData("F", 28, Tab)), "F28")); // ProfitDistributionsByCooperationsNonDeductibelPart // Niet aftrekbaar deel winstuitdelingen door coöperaties Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:ProfitDistributionsByCooperationsNonDeductibelPart").toString(), Double.parseDouble(FiscaleVermogensvergelijkingXLS.HaalData("F", 30, Tab)), "F30")); // ProfitDistributionOtherNonDeductibleAmount // Andere openlijke of vermomde uitdelingen van winst Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:ProfitDistributionOtherNonDeductibleAmount").toString(), Double.parseDouble(FiscaleVermogensvergelijkingXLS.HaalData("F", 35, Tab)), "F35")); // SupervisoryDirectorsFeesBalanceNonDeductiblePart // Niet aftrekbaar deel beloningen commissarissen Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:SupervisoryDirectorsFeesBalanceNonDeductiblePart").toString(), Double.parseDouble(FiscaleVermogensvergelijkingXLS.HaalData("F", 36, Tab)), "F36")); // ProfitSharingBonusesNonDeductiblePart // Niet aftrekbaar deel tantièmes Result.addAll( vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:ProfitSharingBonusesNonDeductiblePart").toString(), Double.parseDouble(FiscaleVermogensvergelijkingXLS.HaalData("F", 41, Tab)), "F41")); // CapitalProvisionPaymentsNonDeductiblePart // Niet aftrekbaar deel vergoedingen voor kapitaalsverstrekking Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:CapitalProvisionPaymentsNonDeductiblePart").toString(), Double.parseDouble(FiscaleVermogensvergelijkingXLS.HaalData("F", 47, Tab)), "F47")); // PaymentsEnsuingFromArticlesOfAssociationEtcRegulationsTotal // Totaal uitkeringen ingevolge statutaire en andere voorschriften Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:PaymentsEnsuingFromArticlesOfAssociationEtcRegulationsTotal").toString(), Double.parseDouble(FiscaleVermogensvergelijkingXLS.HaalData("F", 52, Tab)), "F52")); // ResultTemporarilyPurchasedSharesEmployeeOptionsTotal // Totaal resultaat tijdelijk ingekochte aandelen werknemersopties Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:ResultTemporarilyPurchasedSharesEmployeeOptionsTotal").toString(), Double.parseDouble(FiscaleVermogensvergelijkingXLS.HaalData("F", 53, Tab)), "F53")); // CostsUponTaxEntityPurchaseRemainingSharesSubsidiaryInTaxEntityTotal // Totaal kosten bij aankoop resterende aandelen dochtermaatschappijen // in fiscale eenheid Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:CostsUponTaxEntityPurchaseRemainingSharesSubsidiaryInTaxEntityTotal") .toString(), Double.parseDouble(FiscaleVermogensvergelijkingXLS.HaalData("F", 54, Tab)), "F54")); // BusinessCapitalTotalEndFinancialYearForComparisonMethod // Ondernemingsvermogen bij het einde van het boekjaar Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:BusinessCapitalTotalEndFinancialYearForComparisonMethod").toString(), Double.parseDouble(FiscaleVermogensvergelijkingXLS.HaalData("E", 5, Tab)), "E5")); // CapitalChangesAndWithdrawalsTotal // Mutaties/onttrekkingen kapitaal in het boekjaar Result.addAll( vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:CapitalChangesAndWithdrawalsTotal").toString(), Double.parseDouble(FiscaleVermogensvergelijkingXLS.HaalData("E", 6, Tab)), "E6")); // FinalAssetsAndCapitalWithdrawalsTotal // Totaal eindvermogen en terugbetalingen Result.addAll( vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:FinalAssetsAndCapitalWithdrawalsTotal").toString(), Double.parseDouble(FiscaleVermogensvergelijkingXLS.HaalData("F", 8, Tab)), "F8")); // BusinessCapitalTotalStartFinancialYearForComparisonMethod // Ondernemingsvermogen bij het begin van het boekjaar Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:BusinessCapitalTotalEndFinancialYearForComparisonMethod").toString(), Double.parseDouble(FiscaleVermogensvergelijkingXLS.HaalData("E", 5, Tab)), "E5")); // CapitalContributionsTotal // Stortingen van kapitaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:CapitalContributionsTotal").toString(), Double.parseDouble(FiscaleVermogensvergelijkingXLS.HaalData("E", 11, Tab)), "E11")); // InitialCapitalAndCapitalContributionsTotal // Totaal beginvermogen en kapitaalstortingen Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:InitialCapitalAndCapitalContributionsTotal").toString(), Double.parseDouble(FiscaleVermogensvergelijkingXLS.HaalData("F", 13, Tab)), "F13")); // CapitalComparisonDifferenceOfCapitalTotal // Vermogensverschil Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:CapitalComparisonDifferenceOfCapitalTotal").toString(), Double.parseDouble(FiscaleVermogensvergelijkingXLS.HaalData("F", 14, Tab)), "F14")); // CorporationTaxNonDeductibleAmountsTotal // Niet aftrekbare bedragen Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:CorporationTaxNonDeductibleAmountsTotal").toString(), Double.parseDouble(FiscaleVermogensvergelijkingXLS.HaalData("F", 15, Tab)), "F15")); // BalanceProfitComparisonMethod // Saldo fiscale winstberekening (volgens vermogensvergelijking) Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:BalanceProfitComparisonMethod").toString(), Double.parseDouble(FiscaleVermogensvergelijkingXLS.HaalData("F", 16, Tab)), "F16")); } @When("^the elements of the XBRL and the XLS for Winst en verliesrekening are compared$") public void the_elements_of_the_XBRL_and_the_XLS_for_Winst_en_verliesrekening_are_compared() throws Throwable { String Tab = "TC01"; // StockAndWorkInProgressChangeFiscal // Wijziging voorraad en onderhanden werk fiscaal Result.addAll( vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:StockAndWorkInProgressChangeFiscal").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 8, Tab)), "D8")); // CapitalizedProductionOwnBusinessFiscal // Geactiveerde productie eigen bedrijf fiscaal Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:CapitalizedProductionOwnBusinessFiscal").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 9, Tab)), "D9")); // RevenuesOtherFiscal // Overige opbrengsten fiscaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:RevenuesOtherFiscal").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 10, Tab)), "D10")); // BusinessRevenuesFiscalTotal // Totaal bedrijfsopbrengsten fiscaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:BusinessRevenuesFiscalTotal").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("G", 13, Tab)), "G13")); // RawAncillaryMaterialsPurchasePriceSalesFiscal // Kosten grond- en hulpstoffen, inkoopprijs van de verkopen fiscaal Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:RawAncillaryMaterialsPurchasePriceSalesFiscal").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 20, Tab)), "D20")); // OutsourcedWorkCostsAndOtherExternalCostsFiscal // Kosten uitbesteed werk en andere externe kosten fiscaal Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:RawAncillaryMaterialsPurchasePriceSalesFiscal").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 21, Tab)), "D21")); // WagesSalariesFiscal // Lonen en salarissen fiscaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:WagesSalariesFiscal").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 27, Tab)), "D27")); // SocialSecurityCostsFiscal // Sociale lasten fiscaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:SocialSecurityCostsFiscal").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 28, Tab)), "D28")); // PensionCostsFiscal // Pensioenlasten fiscaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:PensionCostsFiscal").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 29, Tab)), "D29")); // PersonnelCostsOtherFiscal // Overige personeelskosten fiscaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:PersonnelCostsOtherFiscal").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 30, Tab)), "D30")); // BenefitsAndWageSubsidiesReceivedFiscal // Ontvangen uitkeringen en loonsubsidies fiscaal Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:BenefitsAndWageSubsidiesReceivedFiscal").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 31, Tab)), "D31")); // GoodwillDepreciationFiscal // Goodwill afschrijvingen fiscaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:GoodwillDepreciationFiscal").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 37, Tab)), "D37")); // IntangibleFixedAssetsOtherDepreciation // Overige immateriële vaste activa afschrijvingen Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:IntangibleFixedAssetsOtherDepreciation").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 38, Tab)), "D38")); // CompanyBuildingsDepreciationFiscal // Afschrijving bedrijfsgebouwen fiscaal Result.addAll( vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:CompanyBuildingsDepreciationFiscal").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 39, Tab)), "D39")); // MachineryDepreciationFiscal // Afschrijving machines en installaties fiscaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:MachineryDepreciationFiscal").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 40, Tab)), "D40")); // TangibleFixedAssetsOtherDepreciation // Andere vaste bedrijfsmiddelen afschrijving Result.addAll( vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:TangibleFixedAssetsOtherDepreciation").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 41, Tab)), "D41")); // TangibleAndIntangibleFixedAssetsOtherValuationChangeAmount // Overige waardeveranderingen van immateriële en materiële vaste // activa Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:TangibleAndIntangibleFixedAssetsOtherValuationChangeAmount").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 47, Tab)), "D47")); // CurrentAssetsSpecialValuationDecreaseAmount // Bijzondere waardevermindering van vlottende activa Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:CurrentAssetsSpecialValuationDecreaseAmount").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 51, Tab)), "D51")); // CarAndTransportCostsFiscal // Auto- en transportkosten fiscaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:CarAndTransportCostsFiscal").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 56, Tab)), "D56")); // AccommodationCostsFiscal // Huisvestingskosten fiscaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:AccommodationCostsFiscal").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 57, Tab)), "D57")); // MaintenanceOtherTangibleFixedAssetsFiscal // Onderhoud overige materiële vaste activa fiscaal Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:MaintenanceOtherTangibleFixedAssetsFiscal").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 58, Tab)), "D58")); // SalesCostsFiscal // Verkoopkosten fiscaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:SalesCostsFiscal").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 59, Tab)), "D59")); // CostOtherFiscal // Andere kosten fiscaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:CostOtherFiscal").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 60, Tab)), "D60")); // BusinessExpenditureFiscalTotal // Totaal bedrijfslasten fiscaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:BusinessExpenditureFiscalTotal").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("G", 63, Tab)), "G63")); // RevenuesOnReceivablesGroupCompanies // Opbrengsten vorderingen groepsmaatschappijen Result.addAll( vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:RevenuesOnReceivablesGroupCompanies").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 71, Tab)), "D71")); // ProfitDueToDebtRemission // Kwijtscheldingswinst Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:ProfitDueToDebtRemission").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 72, Tab)), "D72")); // RevenuesOnReceivablesParticipatingInterestCompanies // Opbrengsten vorderingen participant/maatschappijen waarin wordt // deelgenomen Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:RevenuesOnReceivablesParticipatingInterestCompanies").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 73, Tab)), "D73")); // RevenuesOtherReceivablesFiscal // Opbrengsten overige vorderingen fiscaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:RevenuesOtherReceivablesFiscal").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 74, Tab)), "D74")); // RevenuesBankCreditsFiscal // Opbrengsten banktegoeden fiscaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:RevenuesOtherReceivablesFiscal").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 75, Tab)), "D75")); // ReceivablesValuationChangeAmount // Waardeverandering van vorderingen Result.addAll( vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:ReceivablesValuationChangeAmount").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 76, Tab)), "D76")); // StockValuationChangeAmount // Waardeverandering van effecten Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:StockValuationChangeAmount").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 77, Tab)), "D77")); // DividendExceptParticipatingInterestDividendFiscal // Ontvangen dividend (met uitzondering van deelnemingsdividend) fiscaal Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:DividendExceptParticipatingInterestDividendFiscal").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 78, Tab)), "D78")); // CostsOnReceivablesParticipatingInterestCompanies // Kosten schulden participant/maatschappijen waarin wordt deelgenomen Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:CostsOnReceivablesParticipatingInterestCompanies").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 84, Tab)), "D84")); // InterestExpenditureEtcCostsDebtsFiscal // Kosten schulden, rentelasten etc. fiscaal Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:InterestExpenditureEtcCostsDebtsFiscal").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 85, Tab)), "D85")); // CostsOnReceivablesGroupCompanies // Kosten van schulden aan groepsmaatschappijen Result.addAll( vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:CostsOnReceivablesGroupCompanies").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 86, Tab)), "D86")); // BusinessFinanciaResultFiscalTotal // Totaal financiële baten en lasten fiscaal Result.addAll( vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:BusinessFinanciaResultFiscalTotal").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("G", 90, Tab)), "D90")); // NormalBusinessActivitiesBusinessResultTotalFiscal // Resultaat gewone bedrijfsuitoefening fiscaal Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:NormalBusinessActivitiesBusinessResultTotalFiscal").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("G", 91, Tab)), "D91")); // BenefitsOrLossesRemovalSubsidiaryTerminationTaxEntityFiscal // Voordelen ontvoeging dochtermaatschappij/beeindiging fiscale eenheid // fiscaal Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:BenefitsOrLossesRemovalSubsidiaryTerminationTaxEntityFiscal").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 100, Tab)), "D100")); // ExtraordinaryIncomeBusinessOtherFiscal // Overige buitengewone baten fiscaal Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:ExtraordinaryIncomeBusinessOtherFiscal").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 101, Tab)), "D101")); // AssetsBookProfitsFiscal // Boekwinst op activa fiscaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:AssetsBookProfitsFiscal").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 102, Tab)), "D102")); // ReinvestmentReservesWriteDownFiscal // Afboeking herinvesteringsreserve fiscaal Result.addAll( vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:ReinvestmentReservesWriteDownFiscal").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 107, Tab)), "D107")); // PaymentsCharitiesFiscal // Uitkeringen aan algemeen nut beogende instellingen fiscaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:PaymentsCharitiesFiscal").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 108, Tab)), "D108")); // ExtraordinaryExpenditureBusinessOtherFiscal // Overige buitengewone lasten fiscaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:PaymentsCharitiesFiscal").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 109, Tab)), "D109")); // ExtraordinaryBusinessResultsFiscal // Buitengewone resultaten fiscaal Result.addAll( vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:ExtraordinaryBusinessResultsFiscal").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 110, Tab)), "D110")); // BalanceProfitCalculationForTaxPurposesFiscal // Saldo fiscale winstberekening Result.addAll( vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:ExtraordinaryBusinessResultsFiscal").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("G", 118, Tab)), "G118")); } @When("^the elements of the XBRL and the XLS for Investeringsaftrek are compared$") public void the_elements_of_the_XBRL_and_the_XLS_for_Investeringsaftrek_are_compared() throws Throwable { // BusinessAssetEnvironmentalEnergyInvestmentDescription // Bedrijfsmiddel investering energie/milieu Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("investeringsaftrek", "bd-bedr:BusinessAssetEnvironmentalEnergyInvestmentDescription", 1)); // BusinessAssetEnvironmentalEnergyInvestmentFinancialYearAmount // Investeringsbedrag boekjaar Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("investeringsaftrek", "bd-bedr:BusinessAssetEnvironmentalEnergyInvestmentFinancialYearAmount", 4)); // BusinessAssetEnvironmentalEnergyInvestmentInitialStartingDate // Datum ingebruikname bedrijfsmiddel Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("investeringsaftrek", "bd-bedr:BusinessAssetEnvironmentalEnergyInvestmentInitialStartingDate", 3)); // BusinessAssetEnvironmentalEnergyInvestmentPaidThisFinancialYear // Bedrag in boekjaar betaald Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("investeringsaftrek", "bd-bedr:BusinessAssetEnvironmentalEnergyInvestmentPaidThisFinancialYear", 5)); // BusinessAssetEnvironmentalEnergyInvestmentNotificationNumber // Meldingsnummer energie/milieu-investeringsaftrek Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("investeringsaftrek", "bd-bedr:BusinessAssetEnvironmentalEnergyInvestmentNotificationNumber", 9)); // BusinessAssetEnvironmentalEnergyInvestmentPercentage // Percentage energie/milieu-investeringsaftrek Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("investeringsaftrek", "bd-bedr:BusinessAssetEnvironmentalEnergyInvestmentPercentage", 14)); // BusinessAssetEnvironmentalEnergyInvestmentAllowancePerInvestmentAmount // Berekende investeringsaftrek per investering Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("investeringsaftrek", "bd-bedr:BusinessAssetEnvironmentalEnergyInvestmentAllowancePerInvestmentAmount", 13)); // BusinessAssetEnvironmentalEnergyInvestmentAllowanceThisFinancialYear // Investeringsaftrek energie/milieu dit boekjaar Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("investeringsaftrek", "bd-bedr:BusinessAssetEnvironmentalEnergyInvestmentAllowanceThisFinancialYear", 15)); } @When("^the elements of the XBRL and the XLS for verliesverrekening_xbrl are compared$") public void the_elements_of_the_XBRL_and_the_XLS_for_verliesverrekening_xbrl_are_compared() throws Throwable { String Tab = "Tc01"; // LossesToBeSettledTaxEntityThisFinancialYearCompanyIdentificationNumber // RSIN maatschappij herkomst verlies vergelijk.VergelijkTupple( ReadXML.GetXMLvalue("bd-bedr:LossesToBeSettledTaxEntityThisFinancialYearCompanyIdentificationNumber") .toString(), VerliesVerrekeningXLS.HaalData("A", 28, Tab), VerliesVerrekeningXLS.HaalData("A", 28, Tab)); // LossesToBeSettledTaxEntityThisFinancialYearStart // Boekjaar maatschappij herkomst verlies, begin Result.addAll(vergelijk.VergelijkTupple( ReadXML.GetXMLvalue("bd-bedr:LossesToBeSettledTaxEntityThisFinancialYearStart").toString(), convertDate.changedateformat(VerliesVerrekeningXLS.HaalDatum("B", 28, Tab)), convertDate.changedateformat(VerliesVerrekeningXLS.HaalDatum("B", 29, Tab)))); // LossesToBeSettledTaxEntityThisFinancialYearEnd@ // Boekjaar maatschappij herkomst verlies, eind Result.addAll(vergelijk.VergelijkTupple( ReadXML.GetXMLvalue("bd-bedr:LossesToBeSettledTaxEntityThisFinancialYearEnd").toString(), convertDate.changedateformat(VerliesVerrekeningXLS.HaalDatum("C", 28, Tab)), convertDate.changedateformat(VerliesVerrekeningXLS.HaalDatum("C", 29, Tab)))); // LossesToBeSettledTaxEntityThisFinancialYearCompany // Verrekening verlies maatschappij dit boekjaar vergelijk.VergelijkTupple( ReadXML.GetXMLvalue("bd-bedr:LossesToBeSettledTaxEntityThisFinancialYearCompany").toString(), VerliesVerrekeningXLS.HaalData("E", 28, Tab), VerliesVerrekeningXLS.HaalData("E", 29, Tab)); // BackwardLossesToBeSettledTaxEntityCompanyIdentificationNumber // RSIN maatschappij toerekening verlies vergelijk.VergelijkTupple( ReadXML.GetXMLvalue("bd-bedr:BackwardLossesToBeSettledTaxEntityCompanyIdentificationNumber").toString(), VerliesVerrekeningXLS.HaalData("A", 13, Tab), VerliesVerrekeningXLS.HaalData("A", 14, Tab)); // BackwardLossesToBeSettledTaxEntityLossToBeSettledPreviousFinancialYear // Verrekening verlies naar voorgaand boekjaar vergelijk.VergelijkTupple( ReadXML.GetXMLvalue("bd-bedr:BackwardLossesToBeSettledTaxEntityLossToBeSettledPreviousFinancialYear") .toString(), VerliesVerrekeningXLS.HaalData("C", 13, Tab), VerliesVerrekeningXLS.HaalData("D", 14, Tab)); } @When("^the elements of the XBRL and the XLS for Toelichting_overige_voorziening_xbrl are compared$") public void the_elements_of_the_XBRL_and_the_XLS_for_Toelichting_overige_voorziening_xbrl_are_compared() throws Throwable { // Write code here that turns the phrase above into concrete actions String Tab = "ToelichtingOverigeVoorziening"; // WarrantyProvisionDescription // Omschrijving soort garantievoorziening Result.addAll(vergelijk.VergelijkTupple(ReadXML.GetXMLvalue("bd-bedr:WarrantyProvisionDescription").toString(), ToelichtingOverigeVoorzXLS.HaalText("B", 2, Tab), ToelichtingOverigeVoorzXLS.HaalText("B", 3, Tab))); // WarrantyProvisionAllocationAmount // Dotatie garantievoorziening Result.addAll(vergelijk.VergelijkTupple( ReadXML.GetXMLvalue("bd-bedr:WarrantyProvisionAllocationAmount").toString(), ToelichtingOverigeVoorzXLS.HaalData("C", 2, Tab), ToelichtingOverigeVoorzXLS.HaalData("C", 3, Tab))); // WarrantyProvisionWithdrawal // Onttrekking garantievoorziening Result.addAll(vergelijk.VergelijkTupple(ReadXML.GetXMLvalue("bd-bedr:WarrantyProvisionWithdrawal").toString(), ToelichtingOverigeVoorzXLS.HaalData("D", 2, Tab), ToelichtingOverigeVoorzXLS.HaalData("D", 3, Tab))); // WarrantyProvisionFiscalAmount // Garantievoorziening fiscaal einde boekjaar Result.addAll(vergelijk.VergelijkTupple(ReadXML.GetXMLvalue("bd-bedr:WarrantyProvisionFiscalAmount").toString(), ToelichtingOverigeVoorzXLS.HaalData("E", 2, Tab), ToelichtingOverigeVoorzXLS.HaalData("E", 3, Tab))); } @When("^the elements of the XBRL and the XLS for Toelichting materiele vaste activa are compared$") public void the_elements_of_the_XBRL_and_the_XLS_for_Toelichting_materiele_vaste_activa_are_compared() throws Throwable { String Locatie = "C:\\testdata\\Toelichting materiele vaste activa.xlsx"; String Tab = "TC01"; // EnvironmentalBusinessAssetsPurchaseCostsFiscal // Aanschafkosten milieu-bedrijfsmiddelen fiscaal // EnvironmentalBusinessAssetsFiscal // Milieu-bedrijfsmiddelen fiscaal // EnvironmentalBusinessAssetsResidualValueFiscal // Restwaarde milieu-bedrijfsmiddelen fiscaal // BuildingsOwnUsePurchaseCostsFiscal // Aanschafkosten gebouwen in eigen gebruik fiscaal Result.addAll( vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:BuildingsOwnUsePurchaseCostsFiscal").toString(), Double.parseDouble(LeesXLS.HaalData("B", 9, Tab, Locatie)), "B9")); // BuildingsOwnUseFiscal // Gebouwen in eigen gebruik fiscaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:BuildingsOwnUseFiscal").toString(), Double.parseDouble(LeesXLS.HaalData("C", 9, Tab, Locatie)), "C9")); // BuildingsOwnUseResidualValueFiscal // Restwaarde gebouwen in eigen gebruik fiscaal Result.addAll( vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:BuildingsOwnUseResidualValueFiscal").toString(), Double.parseDouble(LeesXLS.HaalData("D", 9, Tab, Locatie)), "D9")); // BuildingsOwnUseSoilValueFiscal // Bodemwaarde gebouwen in eigen gebruik fiscaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:BuildingsOwnUseSoilValueFiscal").toString(), Double.parseDouble(LeesXLS.HaalData("E", 9, Tab, Locatie)), "E9")); // BuildingsForInvestmentPurposesPurchaseCostsFiscal // Aanschafkosten gebouwen ter belegging fiscaal Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:BuildingsForInvestmentPurposesPurchaseCostsFiscal").toString(), Double.parseDouble(LeesXLS.HaalData("B", 10, Tab, Locatie)), "B10")); // BuildingsForInvestmentPurposesFiscal // Gebouwen ter belegging fiscaal Result.addAll( vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:BuildingsForInvestmentPurposesFiscal").toString(), Double.parseDouble(LeesXLS.HaalData("C", 10, Tab, Locatie)), "C10")); // BuildingsForInvestmentPurposesResidualValueFiscal // Restwaarde gebouwen ter belegging fiscaal Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:BuildingsForInvestmentPurposesResidualValueFiscal").toString(), Double.parseDouble(LeesXLS.HaalData("D", 10, Tab, Locatie)), "D10")); // BuildingsForInvestmentPurposesSoilValueFiscal // Bodemwaarde gebouwen ter belegging fiscaal Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:BuildingsForInvestmentPurposesSoilValueFiscal").toString(), Double.parseDouble(LeesXLS.HaalData("E", 10, Tab, Locatie)), "E10")); // BuildingsPurchaseCostsWithoutDepreciationFiscal // Aanschafkosten gebouwen zonder afschrijving fiscaal Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:BuildingsPurchaseCostsWithoutDepreciationFiscal").toString(), Double.parseDouble(LeesXLS.HaalData("B", 11, Tab, Locatie)), "B11")); // BuildingsWithoutDepreciationFiscal // Gebouwen zonder afschrijving fiscaal Result.addAll( vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:BuildingsWithoutDepreciationFiscal").toString(), Double.parseDouble(LeesXLS.HaalData("C", 11, Tab, Locatie)), "C11")); // CompanySitesFiscal // Bedrijfsterreinen fiscaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:CompanySitesFiscal").toString(), Double.parseDouble(LeesXLS.HaalData("C", 12, Tab, Locatie)), "C12")); // CompanySitesPurchaseCostsFiscal // Kosten aanschaf bedrijfsterreinen fiscaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:CompanySitesPurchaseCostsFiscal").toString(), Double.parseDouble(LeesXLS.HaalData("B", 12, Tab, Locatie)), "B12")); // CompanySitesResidualValueFiscal // Restwaarde bedrijfsterreinen fiscaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:CompanySitesResidualValueFiscal").toString(), Double.parseDouble(LeesXLS.HaalData("D", 12, Tab, Locatie)), "D12")); // MachineryPurchaseCostsFiscal // Kosten aanschaf machines fiscaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:MachineryPurchaseCostsFiscal").toString(), Double.parseDouble(LeesXLS.HaalData("B", 17, Tab, Locatie)), "B17")); // MachineryResidualValueFiscal // Restwaarde machines fiscaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:MachineryResidualValueFiscal").toString(), Double.parseDouble(LeesXLS.HaalData("D", 17, Tab, Locatie)), "D17")); } @When("^the elements of the XBRL and the XLS for Toelichting garantievoorziening are compared$") public void the_elements_of_the_XBRL_and_the_XLS_for_Toelichting_garantievoorziening_are_compared() throws Throwable { // Write code here that turns the phrase above into concrete actions String Locatie = "C:\\testdata\\Toelichting garantievoorziening.xlsx"; String Tab = "TC01"; // WarrantyProvisionDescription // Omschrijving soort garantievoorziening Result.addAll(vergelijk.VergelijkTupple(ReadXML.GetXMLvalue("bd-bedr:WarrantyProvisionDescription").toString(), LeesXLS.HaalText("A", 4, Tab, Locatie), LeesXLS.HaalText("A", 5, Tab, Locatie))); // WarrantyProvisionAllocationAmount // Dotatie garantievoorziening Result.addAll( vergelijk.VergelijkTupple(ReadXML.GetXMLvalue("bd-bedr:WarrantyProvisionAllocationAmount").toString(), LeesXLS.HaalData("B", 4, Tab, Locatie), LeesXLS.HaalData("B", 5, Tab, Locatie))); // WarrantyProvisionWithdrawal // Onttrekking garantievoorziening Result.addAll(vergelijk.VergelijkTupple(ReadXML.GetXMLvalue("bd-bedr:WarrantyProvisionWithdrawal").toString(), LeesXLS.HaalData("C", 4, Tab, Locatie), LeesXLS.HaalData("C", 5, Tab, Locatie))); // WarrantyProvisionFiscalAmount // Garantievoorziening fiscaal einde boekjaar Result.addAll(vergelijk.VergelijkTupple(ReadXML.GetXMLvalue("bd-bedr:WarrantyProvisionFiscalAmount").toString(), LeesXLS.HaalData("D", 4, Tab, Locatie), LeesXLS.HaalData("D", 5, Tab, Locatie))); } @When("^the elements of the XBRL and the XLS for Innovatiebox are compared$") public void the_elements_of_the_XBRL_and_the_XLS_for_Innovatiebox_are_compared() throws Throwable { // Write code here that turns the phrase above into concrete actions String Tab = "Innovatiebox"; String Locatie = "C:\\testdata\\TestdataTax.xlsx"; // InnovationBoxBusinessAssetsDescription // Activum in innovatiebox omschrijving Result.addAll(vergelijk.VergelijkTupple(ReadXML.GetXMLvalue("bd-bedr:InnovationBoxBusinessAssetsDescription").toString(), LeesXLS.HaalText("B", 2, Tab, Locatie), LeesXLS.HaalText("B", 2, Tab, Locatie))); // InnovationBoxBusinessAssetsProductionCosts // Activum in innovatiebox voortbrengingskosten Result.addAll(vergelijk.VergelijkTupple(ReadXML.GetXMLvalue("bd-bedr:InnovationBoxBusinessAssetsDescription").toString(), LeesXLS.HaalData("C", 2, Tab, Locatie), LeesXLS.HaalData("C",2, Tab, Locatie))); // InnovationBoxFlatRateArrangementExists // Innovatiebox forfaitaire regeling Result.addAll(vergelijk.VergelijkTupple(ReadXML.GetXMLvalue("bd-bedr:InnovationBoxFlatRateArrangementExists").toString(), LeesXLS.HaalText("D", 2, Tab, Locatie), LeesXLS.HaalText("D", 2, Tab, Locatie))); // InnovationBoxBalanceThresholdPreviousFinancialYear // Saldo drempel innovatiebox vorig boekjaar Result.addAll(vergelijk.VergelijkTupple(ReadXML.GetXMLvalue("bd-bedr:InnovationBoxBalanceThresholdPreviousFinancialYear").toString(), LeesXLS.HaalData("E", 2, Tab, Locatie), LeesXLS.HaalData("E", 2, Tab, Locatie))); // InnovationBoxProductionCostsTotal // Innovatiebox voortbrengingskosten totaal Result.addAll(vergelijk.VergelijkTupple(ReadXML.GetXMLvalue("bd-bedr:InnovationBoxProductionCostsTotal").toString(), LeesXLS.HaalData("F", 2, Tab, Locatie), LeesXLS.HaalData("F", 2, Tab, Locatie))); // InnovationBoxExploitationLoss // Innovatiebox exploitatieverliezen in dit boekjaar Result.addAll(vergelijk.VergelijkTupple(ReadXML.GetXMLvalue("bd-bedr:InnovationBoxExploitationLoss").toString(), LeesXLS.HaalData("G", 2, Tab, Locatie), LeesXLS.HaalData("G",2, Tab, Locatie))); // BenefitsForegoingYearGrantPatent // Voordelen genoten voorafgaand aan jaar octrooi verlening Result.addAll(vergelijk.VergelijkTupple(ReadXML.GetXMLvalue("bd-bedr:BenefitsForegoingYearGrantPatent").toString(), LeesXLS.HaalData("H", 2, Tab, Locatie), LeesXLS.HaalData("H", 2, Tab, Locatie))); // InnovationBoxThresholdTakenOverOccasionJoiningOrRemovalSubsidiary // Overgenomen drempel innovatiebox bij voeging en ontvoeging Result.addAll(vergelijk.VergelijkTupple(ReadXML.GetXMLvalue("bd-bedr:InnovationBoxThresholdTakenOverOccasionJoiningOrRemovalSubsidiary").toString(), LeesXLS.HaalData("I", 2, Tab, Locatie), LeesXLS.HaalData("I", 2, Tab, Locatie))); // InnovationBoxProductionCostsToOvertake // In te lopen voortbrengingskosten innovatiebox in dit boekjaar Result.addAll(vergelijk.VergelijkTupple(ReadXML.GetXMLvalue("bd-bedr:InnovationBoxProductionCostsToOvertake").toString(), LeesXLS.HaalData("J", 2, Tab, Locatie), LeesXLS.HaalData("J", 2, Tab, Locatie))); // InnovationBoxBenefitsLessThanThreshold // Genoten voordeel onder drempel innovatiebox Result.addAll(vergelijk.VergelijkTupple(ReadXML.GetXMLvalue("bd-bedr:InnovationBoxBenefitsLessThanThreshold").toString(), LeesXLS.HaalData("K", 2, Tab, Locatie), LeesXLS.HaalData("K", 2, Tab, Locatie))); // InnovationBoxBenefitsExceedingThreshold // Genoten voordeel boven drempel innovatiebox Result.addAll(vergelijk.VergelijkTupple(ReadXML.GetXMLvalue("bd-bedr:InnovationBoxBenefitsExceedingThreshold").toString(), LeesXLS.HaalData("L", 2, Tab, Locatie), LeesXLS.HaalData("L", 2, Tab, Locatie))); // InnovationBoxBalanceThresholdEndFinancialYear // Saldo in te lopen voortbrengingskosten einde boekjaar Result.addAll(vergelijk.VergelijkTupple(ReadXML.GetXMLvalue("bd-bedr:InnovationBoxBalanceThresholdEndFinancialYear").toString(), LeesXLS.HaalData("M", 2, Tab, Locatie), LeesXLS.HaalData("M", 2, Tab, Locatie))); } @When("^the elements of the XBRL and the XLS for objectvrijstelling are compared$") public void the_elements_of_the_XBRL_and_the_XLS_for_objectvrijstelling_are_compared() throws Throwable { // Write code here that turns the phrase above into concrete actions String Tab = "Objectvrijstelling"; String Locatie = "C:\\testdata\\TestdataTax.xlsx"; // CountryForeignCompany // Vestigingsland buitenlandse onderneming Result.addAll(vergelijk.VergelijkTupple(ReadXML.GetXMLvalue("bd-bedr:CountryForeignCompany").toString(), LeesXLS.HaalText("C", 2, Tab, Locatie), LeesXLS.HaalText("C", 3, Tab, Locatie))); // ForeignBusinessProfitEuroFunctionalCurrency // Buitenlandse ondernemingswinst in euro of functionele valuta Result.addAll(vergelijk.VergelijkTupple(ReadXML.GetXMLvalue("bd-bedr:ForeignBusinessProfitEuroFunctionalCurrency").toString(), LeesXLS.HaalData("D", 2, Tab, Locatie), LeesXLS.HaalData("D", 3, Tab, Locatie))); // LossBefore1January2012ToOvertake // In te halen verliezen uit jaren voor 1 januari 2012 Result.addAll(vergelijk.VergelijkTupple(ReadXML.GetXMLvalue("bd-bedr:LossBefore1January2012ToOvertake").toString(), LeesXLS.HaalData("E", 2, Tab, Locatie), LeesXLS.HaalData("E", 3, Tab, Locatie))); // LossCessationForeignCompany // Stakingsverlies buitenlandse onderneming Result.addAll(vergelijk.VergelijkTupple(ReadXML.GetXMLvalue("bd-bedr:LossCessationForeignCompany").toString(), LeesXLS.HaalData("F", 2, Tab, Locatie), LeesXLS.HaalData("F", 3, Tab, Locatie))); // ObjectExemptionForeignBusinessProfitPerCountry // Objectvrijstelling buitenl ondernemingswinst per land Result.addAll(vergelijk.VergelijkTupple(ReadXML.GetXMLvalue("bd-bedr:ObjectExemptionForeignBusinessProfitPerCountry").toString(), LeesXLS.HaalData("G", 2, Tab, Locatie), LeesXLS.HaalData("G", 3, Tab, Locatie))); // ForeignBusinessProfitBalanceCumulative // Cumulatief saldo buitenlandse ondernemingswinst Result.addAll(vergelijk.VergelijkTupple(ReadXML.GetXMLvalue("bd-bedr:ForeignBusinessProfitBalanceCumulative").toString(), LeesXLS.HaalData("D", 6, Tab, Locatie), LeesXLS.HaalData("D", 6, Tab, Locatie))); } @Then("^they contain the same values$") public void they_contain_the_same_values() throws Throwable { System.out.println(Result); assertTrue(Result.isEmpty()); } }
UTF-8
Java
88,064
java
XBRLvalidate.java
Java
[ { "context": "hrowable {\r\n\r\n\t\t// ParticipatingInterestName\r\n\t\t// Naam deelneming\r\n\t\tResult.addAll(\r\n\t\t\t\tXMLandXLScompar", "end": 11035, "score": 0.5381654500961304, "start": 11031, "tag": "NAME", "value": "Naam" } ]
null
[]
package steps; import cucumber.api.java.en.Given; import cucumber.api.java.en.Then; import cucumber.api.java.en.When; import gherkin.formatter.model.Result; import pageObjects.BalansActivaObjecten; import codebase.BalansActivaXLS; import codebase.BalansPassivaXLS; import codebase.FiscaleVermogensvergelijkingXLS; import codebase.LeesXLS; import codebase.ReadXML; import codebase.ToelichtingOverigeVoorzXLS; import codebase.VerliesVerrekeningXLS; import codebase.WinstVerliesXLS; import codebase.XLSbyColumn; import codebase.XMLandXLScompare; import codebase.convertDate; import codebase.vergelijk; import static org.junit.Assert.assertTrue; import java.util.ArrayList; import org.eclipse.jetty.io.NetworkTrafficListener.Empty; import org.hamcrest.core.IsNull; public class XBRLvalidate { ArrayList<String> Result = new ArrayList<String>(); @Given("^the reading of the XBRL is correct$") public void the_reading_of_the_XBRL_is_correct() throws Throwable { ArrayList<String> CheckEmpty = new ArrayList<String>(); CheckEmpty = ReadXML.GetXMLvalue("xbrli:xbrl"); // assertTrue(!CheckEmpty.isEmpty()); } @Given("^the reading of the XLS is correct$") public void the_reading_of_the_XLS_is_correct() throws Throwable { ArrayList<String> CheckEmpty = new ArrayList<String>(); CheckEmpty = XLSbyColumn.extractExcelContentByColumnIndex("Algemene_gegevens", 1); assertTrue(!CheckEmpty.isEmpty()); } @When("^the elements of the XBRL and the XLS for Specificatie aandeelhouders are compared$") public void the_elements_of_the_XBRL_and_the_XLS_for_Specificatie_aandeelhouders_are_compared() throws Throwable { // Naam aandeelhouder Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_aandeelh", "bd-bedr:ShareholderName", 1)); // Straatnaam adres aandeelhouder Result.addAll( XMLandXLScompare.XMLandXLScheckerArrays("Spec_aandeelh", "bd-bedr:ShareholderAddressStreetName", 4)); // Huisnummer adres aandeelhouder Result.addAll( XMLandXLScompare.XMLandXLScheckerArrays("Spec_aandeelh", "bd-bedr:ShareholderAddressHouseNumber", 5)); // Huisnummer buitenlands adres Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_aandeelh", "bd-bedr:ShareholderAddressHouseNumberAbroad", 6)); // Huisnummertoevoeging adres aandeelhouder Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_aandeelh", "bd-bedr:ShareholderAddressHouseNumberAddition", 8)); // Woonplaats aandeelhouder Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_aandeelh", "bd-bedr:ShareholderAddressPlaceOfResidence", 9)); // Woon- vestigingsland aandeelhouder Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_aandeelh", "bd-bedr:ShareholderResidenceEstablishmentCountryCode", 10)); // Nominale waarde gewone aandelen Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_aandeelh", "bd-bedr:ShareholderOrdinarySharesNominalValue", 11)); // Nominale waarde preferente aandelen einde boekjaar Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_aandeelh", "bd-bedr:ShareholderPrefenceSharesNominalValue", 12)); // Nominale waarde prioriteitsaandelen einde boekjaar Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_aandeelh", "bd-bedr:ShareholderPrioritySharesNominalValue", 13)); // Percentage nominaal geplaatst kapitaal Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_aandeelh", "bd-bedr:ShareholderIssuedCapitalPercentage", 14)); // Vordering belastingplichtige op aandeelhouder Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_aandeelh", "bd-bedr:ShareholderClaimTaxpayerOnShareholder", 15)); // In het boekjaar ontvangen rente van de aandeelhouder Result.addAll( XMLandXLScompare.XMLandXLScheckerArrays("Spec_aandeelh", "bd-bedr:ShareholderInterestReceived", 17)); // Schuld belastingplichtige aan aandeelhouder Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_aandeelh", "bd-bedr:ShareholderTaxpayerDebtToShareholder", 16)); // In dit boekjaar betaalde rente aan de aandeelhouder Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_aandeelh", "bd-bedr:ShareholderInterestPaid", 18)); // Informele kapitaalstorting door of via deze aandeelhouder Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_aandeelh", "bd-bedr:ShareholderInformalCapitalThroughOrByThisShareholder", 19)); // Omvang informele kapitaalstorting door of via deze aandeelhouder Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_aandeelh", "bd-bedr:ShareholderInformalCapitalSizeThroughOrByThisShareholder", 20)); // Omschrijving mening informeel kapitaal Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_aandeelh", "bd-bedr:ShareholderInformalCapitalOpinionDescription", 21)); // Naam uiteindelijke moedermaatschappij informeel kapitaal Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_aandeelh", "bd-bedr:ShareholderInformalCapitalFinalParentCompanyName", 22)); // Straatnaam vestigingsadres uiteindelijke moedermaatschappij informeel // kapitaal Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_aandeelh", "bd-bedr:ShareholderInformalCapitalFinalParentCompanyAddressOfEstablishmentStreetname", 23)); // Huisnummer vestigingsadres uiteindelijke moedermaatschappij informeel // kapitaal Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_aandeelh", "bd-bedr:ShareholderInformalCapitalFinalParentCompanyAddressOfEstablishmentHousenumber", 24)); // Toevoeging huisnummer vestigingsadres uiteindelijke // moedermaatschappij informeel kapitaal Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_aandeelh", "bd-bedr:ShareholderInformalCapitalFinalParentCompanyAddressOfEstablishmentHouseNumberAddition", 25)); // Vestigingsplaats uiteindelijke moedermaatschappij informeel kapitaal Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_aandeelh", "bd-bedr:ShareholderInformalCapitalFinalParentCompanyPlaceOfEstablishment", 26)); // Vestigingsland uiteindelijk moedermaatschappij informeel kapitaal Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_aandeelh", "bd-bedr:ShareholderInformalCapitalFinalParentCompanyEstablishmentCountryCode", 27)); // Bevoordeling afkomstig van directe aandeelhouder Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_aandeelh", "bd-bedr:ShareholderDirectShareholderBenefiting", 28)); // Naam rechtspersoon bevoordeling gedaan Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_aandeelh", "bd-bedr:ShareholderBenefitingLegalPersonsCompanyName", 29)); // Straatnaam vestigingsadres rechtspersoon bevoordeling gedaan Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_aandeelh", "bd-bedr:ShareholderBenefitingLegalPersonsCompanyAddressOfEstablishmentStreetName", 30)); // Huisnummer vestigingsadres rechtspersoon bevoordeling gedaan Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_aandeelh", "bd-bedr:ShareholderBenefitingLegalPersonsCompanyAddressOfEstablishmentHouseNumber", 31)); // Toevoeging huisnummer vestigingsadres rechtspersoon bevoordeling // gedaan Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_aandeelh", "bd-bedr:ShareholderBenefitingLegalPersonsCompanyAddressOfEstablishmentHouseNumberAddition", 32)); // Vestigingsplaats rechtspersoon bevoordeling gedaan Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_aandeelh", "bd-bedr:ShareholderBenefitingLegalPersonsCompanyPlaceOfEstablishment", 33)); // Vestigingsland rechtspersoon bevoordeling gedaan Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_aandeelh", "bd-bedr:ShareholderBenefitingLegalPersonsCompanyEstablishmentCountryCode", 34)); } @When("^the elements of the XBRL and the XLS for Algemene Gegevens are compared$") public void the_elements_of_the_XBRL_and_the_XLS_for_Algemene_Gegevens_are_compared() throws Throwable { // Write code here that turns the phrase above into concrete actions // LegalPersonName Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Algemene_gegevens", "bd-bedr:LegalPersonName", 1)); // FunctionalCurrencySchemeExists Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Algemene_gegevens", "bd-bedr:FunctionalCurrencySchemeExists", 8)); // TaxReturnConcernsTaxEntity Result.addAll( XMLandXLScompare.XMLandXLScheckerArrays("Algemene_gegevens", "bd-bedr:TaxReturnConcernsTaxEntity", 7)); // TaxConsultantNumber Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Algemene_gegevens", "bd-alg:TaxConsultantNumber", 9)); // TaxConsultantInitials Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Algemene_gegevens", "bd-alg:TaxConsultantInitials", 12)); // TaxConsultantPrefix Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Algemene_gegevens", "bd-alg:TaxConsultantInitials", 12)); // TaxConsultantSurname Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Algemene_gegevens", "bd-alg:TaxConsultantSurname", 14)); // TaxConsultantTelephoneNumber Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Algemene_gegevens", "bd-alg:TaxConsultantTelephoneNumber", 15)); // IncomeTaxReturnSignatureInitials Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Algemene_gegevens", "bd-bedr:IncomeTaxReturnSignatureInitials", 18)); // IncomeTaxReturnSignaturePrefix Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Algemene_gegevens", "bd-bedr:IncomeTaxReturnSignaturePrefix", 19)); // IncomeTaxReturnSignatureSurname Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Algemene_gegevens", "bd-bedr:IncomeTaxReturnSignatureSurname", 20)); // IncomeTaxReturnSignatureFunctionSignatory Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Algemene_gegevens", "bd-bedr:IncomeTaxReturnSignatureFunctionSignatory", 21)); // IncomeTaxReturnSignatureTelephoneNumber Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Algemene_gegevens", "bd-bedr:IncomeTaxReturnSignatureTelephoneNumber", 22)); // RequestExplicitDecisionTaxAdministrationExists Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Algemene_gegevens", "bd-alg:RequestExplicitDecisionTaxAdministrationExists", 6)); // RequestExplicitDecisionTaxAdministrationDescription Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Algemene_gegevens", "bd-bedr:RequestExplicitDecisionTaxAdministrationDescription", 6)); } @When("^the elements of the XBRL and the XLS for Specificatie Deelneming are compared$") public void the_elements_of_the_XBRL_and_the_XLS_for_Specificatie_Deelneming_are_compared() throws Throwable { // ParticipatingInterestName // Naam deelneming Result.addAll( XMLandXLScompare.XMLandXLScheckerArrays("Spec_deelneming", "bd-bedr:ParticipatingInterestName", 1)); // ParticipatingInterestIdentificationNumber // Identificatienummer deelneming Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_deelneming", "bd-bedr:ParticipatingInterestIdentificationNumber", 2)); // PlaceOfEstablishmentParticipatingInterest // Vestigingsplaats deelneming Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_deelneming", "bd-bedr:PlaceOfEstablishmentParticipatingInterest", 3)); // EstablishmentParticipatingInterestCountry // Vestigingsland deelneming Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_deelneming", "bd-bedr:EstablishmentParticipatingInterestCountry", 4)); // ParticipatingInterestPercentageInterest // Percentage aandelenbezit deelneming Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_deelneming", "bd-bedr:ParticipatingInterestPercentageInterest", 5)); // InterestParticipatingInterestNominalValue // Nominale waarde aandelenbezit deelneming Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_deelneming", "bd-bedr:InterestParticipatingInterestNominalValue", 9)); // ParticipatingInterestSacrificedAmount // Opgeofferd bedrag aandelenbezit deelneming Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_deelneming", "bd-bedr:ParticipatingInterestSacrificedAmount", 10)); // SheetValuationParticipatingInterestBalance // Balanswaardering deelneming fiscaal Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_deelneming", "bd-bedr:SheetValuationParticipatingInterestBalance", 11)); // ParticipatingInterestBenefits // Voordelen deelneming boekjaar Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_deelneming", "bd-bedr:ParticipatingInterestBenefits", 12)); // ParticipatingInterestReceivableAmount // Bedrag vordering op deelneming Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_deelneming", "bd-bedr:ParticipatingInterestReceivableAmount", 13)); // InterestReceivedFromParticipatingInterest // In het boekjaar ontvangen rente van de deelneming Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_deelneming", "bd-bedr:InterestReceivedFromParticipatingInterest", 15)); // ParticipatingInterestPayableAmount // Bedrag schuld aan deelneming Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_deelneming", "bd-bedr:ParticipatingInterestPayableAmount", 14)); // InterestPaidToParticipatingInterest // In het boekjaar betaalde rente aan de deelneming Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_deelneming", "bd-bedr:InterestPaidToParticipatingInterest", 16)); // ParticipatingInterestJoiningOrRemovalTaxEntityExists // Voeging of ontvoeging van deelneming fiscale eenheid van // belastingplichtige Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_deelneming", "bd-bedr:ParticipatingInterestJoiningOrRemovalTaxEntityExists", 17)); // ParticipatingInterestObtainmentEnlargementExists // Verwerving of uitbreiding deelneming van toepassing Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_deelneming", "bd-bedr:ParticipatingInterestObtainmentEnlargementExists", 20)); // ParticipatingInterestAlienationDiminutionExists // Vervreemding of verkleining deelneming van toepassing Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_deelneming", "bd-bedr:ParticipatingInterestAlienationDiminutionExists", 27)); // ParticipatingInterestLiquidationExists // Deelneming liquidatie Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_deelneming", "bd-bedr:ParticipatingInterestLiquidationExists", 33)); // ParticipatingInterestApplicationValuationInstructionArticle13aApplied // Waarderingsvoorschrift artikel 13a op deelneming toegepast Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_deelneming", "bd-bedr:ParticipatingInterestApplicationValuationInstructionArticle13aApplied", 36)); // ParticipatingInterestQualificationAsNotQualified // Kwalificatie als niet kwalificerende beleggingsdeelneming Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_deelneming", "bd-bedr:ParticipatingInterestQualificationAsNotQualified", 37)); // TaxEntityJoiningDate // Voegingsdatum deelneming Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_deelneming", "bd-bedr:TaxEntityJoiningDate", 18)); // TaxEntityRemovalDate // Ontvoegingsdatum deelneming Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_deelneming", "bd-bedr:TaxEntityRemovalDate", 19)); // ParticipatingInterestObtainmentEnlargementPercentage // Percentage verwerving of uitbreiding aandelenbezit deelneming Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_deelneming", "bd-bedr:ParticipatingInterestObtainmentEnlargementPercentage", 21)); // ParticipatingInterestObtainmentEnlargementNominalValue // Nominale waarde verwerving of uitbreiding aandelenbezit deelneming Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_deelneming", "bd-bedr:ParticipatingInterestObtainmentEnlargementNominalValue", 22)); // ParticipatingInterestObtainmentEnlargementSacrificedAmount // Opgeofferd bedrag verwerving of uitbreiding aandelenbezit deelneming Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_deelneming", "bd-bedr:ParticipatingInterestObtainmentEnlargementSacrificedAmount", 23)); // ParticipatingInterestObtainedAffiliatedPerson // Deelneming is verworven van verbonden natuurlijk- of rechtspersoon Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_deelneming", "bd-bedr:ParticipatingInterestObtainedAffiliatedPerson", 26)); // ParticipatingInterestAlienationDiminutionPercentage // Percentage vervreemding of verkleining aandelenbezit deelneming Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_deelneming", "bd-bedr:ParticipatingInterestAlienationDiminutionPercentage", 28)); // ParticipatingInterestAlienationDiminutionNominalValue // Nominale waarde vervreemding of verkleining aandelenbezit deelneming Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_deelneming", "bd-bedr:ParticipatingInterestAlienationDiminutionNominalValue", 29)); // ParticipatingInterestAlienationDiminutionRevenue // Opbrengst vervreemding of verkleining aandelenbezit deelneming Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_deelneming", "bd-bedr:ParticipatingInterestAlienationDiminutionRevenue", 30)); // ParticipatingInterestAlienationAffiliatedPerson // Deelneming is vervreemd aan verbonden natuurlijk- of rechtspersoon // Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_deelneming","bd-bedr:ParticipatingInterestAlienationAffiliatedPerson", // 27)); // InterestsWithParticipatingInterestSettlementDate // Vereffeningsdatum deelneming Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_deelneming", "bd-bedr:InterestsWithParticipatingInterestSettlementDate", 34)); // ParticipatingInterestLiquidationLoss // Liquidatieverlies van deelneming Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_deelneming", "bd-bedr:ParticipatingInterestLiquidationLoss", 35)); // ParticipatingInterestEconomicValue // Waarde in het economisch verkeer van deelneming Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_deelneming", "bd-bedr:ParticipatingInterestEconomicValue", 38)); // ParticipatingInterestPercentageFallenBelowTwentyFivePercent // Percentage in deelneming gedaald onder 25 procent // Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_deelneming","bd-bedr:ParticipatingInterestPercentageFallenBelowTwentyFivePercent", // 36)); // ParticipatingInterestValueAtTimeOfShareChangeToBelowTwentyFivePercent // Waarde van 25 procent-of-meer-belang op tijdstip mutatie Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_deelneming", "bd-bedr:ParticipatingInterestValueAtTimeOfShareChangeToBelowTwentyFivePercent", 38)); // ParticipatingInterestEngrossmentBenefit // Brutering van voordeel bij deelneming Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_deelneming", "bd-bedr:ParticipatingInterestEngrossmentBenefit", 39)); // ParticipatingInterestEuropeanUnitProfitPaymentPartBenefit // EU-deelneming en winstuitkering als onderdeel van voordeel Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_deelneming", "bd-bedr:ParticipatingInterestEuropeanUnitProfitPaymentPartBenefit", 41)); // ParticipatingInterestEngrossmentAndSetoffWithEffectiveTaxExists // Brutering en verrekening met effectieve belasting deelneming // Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_deelneming","bd-ParticipatingInterestEngrossmentAndSetoffWithEffectiveTaxExists", // x)); // ParticipatingInterestDifferentSetoffWithAlreadyTaxedBenefitExists // Afwijkende verrekening bij reeds belaste winstuitkering deelneming Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Spec_deelneming", "bd-bedr:ParticipatingInterestDifferentSetoffWithAlreadyTaxedBenefitExists", 43)); } @When("^the elements of the XBRL and the XLS for Toelichting Balans are compared$") public void the_elements_of_the_XBRL_and_the_XLS_for_Toelichting_Balans_are_compared() throws Throwable { // EnvironmentalBusinessAssetsPurchaseCostsFiscal // Aanschafkosten milieu-bedrijfsmiddelen fiscaal Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Toelichting_balans", "bd-ParticipatingInterestDifferentSetoffWithAlreadyTaxedBenefitExists", 1)); // EnvironmentalBusinessAssetsFiscal // Milieu-bedrijfsmiddelen fiscaal Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Toelichting_balans", "bd-EnvironmentalBusinessAssetsFiscal", 1)); // EnvironmentalBusinessAssetsResidualValueFiscal // Restwaarde milieu-bedrijfsmiddelen fiscaal Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Toelichting_balans", "bd-EnvironmentalBusinessAssetsResidualValueFiscal", 1)); // BuildingsOwnUsePurchaseCostsFiscal // Aanschafkosten gebouwen in eigen gebruik fiscaal Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Toelichting_balans", "bd-BuildingsOwnUsePurchaseCostsFiscal", 1)); // BuildingsOwnUseFiscal // Gebouwen in eigen gebruik fiscaal Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Toelichting_balans", "bd-BuildingsOwnUseFiscal", 1)); // BuildingsOwnUseResidualValueFiscal // Restwaarde gebouwen in eigen gebruik fiscaal Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Toelichting_balans", "bd-BuildingsOwnUseResidualValueFiscal", 1)); // BuildingsOwnUseSoilValueFiscal // Bodemwaarde gebouwen in eigen gebruik fiscaal Result.addAll( XMLandXLScompare.XMLandXLScheckerArrays("Toelichting_balans", "bd-BuildingsOwnUseSoilValueFiscal", 1)); // BuildingsForInvestmentPurposesPurchaseCostsFiscal // Aanschafkosten gebouwen ter belegging fiscaal Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Toelichting_balans", "bd-BuildingsForInvestmentPurposesPurchaseCostsFiscal", 1)); // BuildingsForInvestmentPurposesFiscal // Gebouwen ter belegging fiscaal Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Toelichting_balans", "bd-BuildingsForInvestmentPurposesFiscal", 1)); // BuildingsForInvestmentPurposesResidualValueFiscal // Restwaarde gebouwen ter belegging fiscaal Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Toelichting_balans", "bd-BuildingsForInvestmentPurposesResidualValueFiscal", 1)); // BuildingsForInvestmentPurposesSoilValueFiscal // Bodemwaarde gebouwen ter belegging fiscaal Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Toelichting_balans", "bd-BuildingsForInvestmentPurposesSoilValueFiscal", 1)); // BuildingsPurchaseCostsWithoutDepreciationFiscal // Aanschafkosten gebouwen zonder afschrijving fiscaal Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Toelichting_balans", "bd-BuildingsPurchaseCostsWithoutDepreciationFiscal", 1)); // BuildingsWithoutDepreciationFiscal // Gebouwen zonder afschrijving fiscaal Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Toelichting_balans", "bd-BuildingsWithoutDepreciationFiscal", 1)); // CompanySitesFiscal // Bedrijfsterreinen fiscaal Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Toelichting_balans", "bd-CompanySitesFiscal", 1)); // CompanySitesPurchaseCostsFiscal // Kosten aanschaf bedrijfsterreinen fiscaal Result.addAll( XMLandXLScompare.XMLandXLScheckerArrays("Toelichting_balans", "bd-CompanySitesPurchaseCostsFiscal", 1)); // CompanySitesResidualValueFiscal // Restwaarde bedrijfsterreinen fiscaal Result.addAll( XMLandXLScompare.XMLandXLScheckerArrays("Toelichting_balans", "bd-CompanySitesResidualValueFiscal", 1)); // MachineryPurchaseCostsFiscal // Kosten aanschaf machines fiscaal Result.addAll( XMLandXLScompare.XMLandXLScheckerArrays("Toelichting_balans", "bd-MachineryPurchaseCostsFiscal", 1)); // MachineryResidualValueFiscal // Restwaarde machines fiscaal Result.addAll( XMLandXLScompare.XMLandXLScheckerArrays("Toelichting_balans", "bd-MachineryResidualValueFiscal", 1)); // FixedAssetsOtherPurchaseCostsFiscal // Andere vaste bedrijfsmiddelen aanschafwaarde fiscaal Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Toelichting_balans", "bd-FixedAssetsOtherPurchaseCostsFiscal", 1)); // FixedAssetsOtherResidualValueFiscal // Andere vaste bedrijfsmiddelen restwaarde fiscaal Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Toelichting_balans", "bd-FixedAssetsOtherResidualValueFiscal", 1)); // ReinvestmentReserveDisposedBusinessAssetDescription // Omschrijving vervreemd bedrijfsmiddel Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Toelichting_balans", "bd-ReinvestmentReserveDisposedBusinessAssetDescription", 1)); // ReinvestmentReserveDisposedBusinessAssetYear // Jaar vervreemding bedrijfsmiddel Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Toelichting_balans", "bd-ReinvestmentReserveDisposedBusinessAssetYear", 1)); // ReinvestmentReserveDisposedBusinessAssetBookProfit // Boekwinst vervreemde bedrijfsmiddel Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Toelichting_balans", "bd-ReinvestmentReserveDisposedBusinessAssetBookProfit", 1)); // ReinvestmentReserveDisposedBusinessAssetDepreciationPercentage // Afschrijvingspercentage vervreemd bedrijfsmiddel Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Toelichting_balans", "bd-ReinvestmentReserveDisposedBusinessAssetDepreciationPercentage", 1)); // ReinvestmentReserveDisposedBusinessAssetBookValueAtTransferTime // Boekwaarde bedrijfsmiddel op vervreemdingsmoment Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Toelichting_balans", "bd-ReinvestmentReserveDisposedBusinessAssetBookValueAtTransferTime", 1)); // // Omschrijving soort garantievoorziening Result.addAll( XMLandXLScompare.XMLandXLScheckerArrays("Toelichting_balans", "bd-WarrantyProvisionDescription", 1)); // WarrantyProvisionAllocationAmount // Dotatie garantievoorziening Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Toelichting_balans", "bd-WarrantyProvisionAllocationAmount", 1)); // WarrantyProvisionWithdrawal // Onttrekking garantievoorziening Result.addAll( XMLandXLScompare.XMLandXLScheckerArrays("Toelichting_balans", "bd-WarrantyProvisionWithdrawal", 1)); // WarrantyProvisionFiscalAmount // Garantievoorziening fiscaal einde boekjaar Result.addAll( XMLandXLScompare.XMLandXLScheckerArrays("Toelichting_balans", "bd-WarrantyProvisionFiscalAmount", 1)); // ProvisionsOtherDescription // Omschrijving overige voorziening Result.addAll( XMLandXLScompare.XMLandXLScheckerArrays("Toelichting_balans", "bd-ProvisionsOtherDescription", 1)); // ProvisionsOtherAllocation // Dotatie overige voorziening Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Toelichting_balans", "bd-ProvisionsOtherAllocation", 1)); // ProvisionsOtherWithdrawal // Onttrekking overige voorziening Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Toelichting_balans", "bd-ProvisionsOtherWithdrawal", 1)); // ProvisionsOtherAmount // Overige voorziening einde boekjaar Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Toelichting_balans", "bd-ProvisionsOtherAmount", 1)); // ValueAddedTaxPayableOrReceivablePartThisFinancialyear // Schuld/vordering over dit boekjaar Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Toelichting_balans", "bd-ValueAddedTaxPayableOrReceivablePartThisFinancialyear", 1)); // ValueAddedTaxPayableOrReceivablePartPreviousFinancialyear // Schuld/vordering over het vorig boekjaar Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Toelichting_balans", "bd-ValueAddedTaxPayableOrReceivablePartPreviousFinancialyear", 1)); // ValueAddedTaxPayableOrReceivablePartPrecedingPreviousFinancialyear // Schuld/vordering over oudere boekjaren Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Toelichting_balans", "bd-ValueAddedTaxPayableOrReceivablePartPrecedingPreviousFinancialyear", 1)); } @When("^the elements of the XBRL and the XLS for Zeescheepvaart are compared$") public void the_elements_of_the_XBRL_and_the_XLS_for_Zeescheepvaart_are_compared() throws Throwable { Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Zeescheepvaart", "bd-bedr:ShipName", 1)); Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Zeescheepvaart", "bd-bedr:NetTonnageShip", 2)); Result.addAll( XMLandXLScompare.XMLandXLScheckerArrays("Zeescheepvaart", "bd-bedr:ShipExploitationDaysCount", 3)); Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("Zeescheepvaart", "bd-bedr:ShipParticipatingInterestPercentage", 4)); } @When("^the elements of the XBRL and the XLS for Balans Activa are compared$") public void the_elements_of_the_XBRL_and_the_XLS_for_Balans_Activa_are_compared() throws Throwable { // Write code here that turns the phrase above into concrete actions String Tab = "TC04"; // Naam van de onderneming // BusinessName // Omschrijving activiteiten van de onderneming // BusinessActivitiesDescription // Dochtermaatschappij fiscale eenheid // SubsidiaryTaxEntityExists // Agrarische activiteiten // AgriculturalActivitiesExist // Goodwill fiscaal // GoodwillFiscal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:GoodwillFiscal").toString(), Double.parseDouble(BalansActivaXLS.HaalData("G", 16, Tab)), "G16")); // Overige immateriële vaste activa fiscaal // IntangibleFixedAssetsOtherFiscal Result.addAll( vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:IntangibleFixedAssetsOtherFiscal").toString(), Double.parseDouble(BalansActivaXLS.HaalData("G", 17, Tab)), "G17")); // Totaal immateriële vaste activa fiscaal // IntangibleFixedAssetsTotalFiscal Result.addAll( vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:IntangibleFixedAssetsTotalFiscal").toString(), Double.parseDouble(BalansActivaXLS.HaalData("G", 18, Tab)), "G18")); // Gebouwen en terreinen fiscaal // BuildingsAndLandFiscal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:BuildingsAndLandFiscal").toString(), Double.parseDouble(BalansActivaXLS.HaalData("G", 26, Tab)), "G26")); // Machines en installaties fiscaal // MachinesAndInstallationsFiscal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:MachinesAndInstallationsFiscal").toString(), Double.parseDouble(BalansActivaXLS.HaalData("G", 27, Tab)), "G27")); // Andere vaste bedrijfsmiddelen fiscaal // FixedAssetsOtherFiscal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:FixedAssetsOtherFiscal").toString(), Double.parseDouble(BalansActivaXLS.HaalData("G", 28, Tab)), "G28")); // Totaal materiële vaste activa fiscaal // TangibleFixedAssetsFiscalTotal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:TangibleFixedAssetsFiscalTotal").toString(), Double.parseDouble(BalansActivaXLS.HaalData("G", 29, Tab)), "G29")); // Deelnemingen fiscaal // ParticipatingInterests Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:ParticipatingInterests").toString(), Double.parseDouble(BalansActivaXLS.HaalData("G", 37, Tab)), "G37")); // Langlopende vorderingen op groepsmaatschappijen fiscaal // LongTermReceivablesGroupCompaniesFiscal Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:LongTermReceivablesGroupCompaniesFiscal").toString(), Double.parseDouble(BalansActivaXLS.HaalData("G", 38, Tab)), "G38")); // Langlopende vorderingen participanten/maatschappij waarin wordt // deelgenomen, fiscaal // LongTermReceivablesParticipatingInterestCompaniesFiscal Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:LongTermReceivablesParticipatingInterestCompaniesFiscal").toString(), Double.parseDouble(BalansActivaXLS.HaalData("G", 39, Tab)), "G39")); // Overige financiële vaste activa fiscaal // FinancialFixedAssetsOtherFiscal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:FinancialFixedAssetsOtherFiscal").toString(), Double.parseDouble(BalansActivaXLS.HaalData("G", 40, Tab)), "G40")); // Totaal financiële vaste activa fiscaal // FinancialFixedAssetsTotalFiscal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:FinancialFixedAssetsTotalFiscal").toString(), Double.parseDouble(BalansActivaXLS.HaalData("G", 41, Tab)), "G41")); // Langlopende vorderingen op groepsmaatschappijen nominaal // LongTermReceivablesGroupCompaniesNominal Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:LongTermReceivablesGroupCompaniesNominal").toString(), Double.parseDouble(BalansActivaXLS.HaalData("B", 38, Tab)), "B38")); // Langlopende vorderingen participanten/maatschappij waarin wordt // deelgenomen, nominaal // LongTermReceivablesParticipatingInterestCompaniesNominal Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:LongTermReceivablesParticipatingInterestCompaniesNominal").toString(), Double.parseDouble(BalansActivaXLS.HaalData("B", 39, Tab)), "B39")); // Overige financiële vaste activa fiscaal nominaal // FinancialFixedAssetsOtherTaxNominalFiscal Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:FinancialFixedAssetsOtherTaxNominalFiscal").toString(), Double.parseDouble(BalansActivaXLS.HaalData("B", 40, Tab)), "B40")); // Voorraden, exclusief onderhanden werk // StockExcludingWorkInProgress Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:StockExcludingWorkInProgress").toString(), Double.parseDouble(BalansActivaXLS.HaalData("G", 48, Tab)), "G48")); // Onderhanden werk fiscaal // WorkInProgressFiscal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:WorkInProgressFiscal").toString(), Double.parseDouble(BalansActivaXLS.HaalData("G", 49, Tab)), "G49")); // Totaal voorraden fiscaal // StockTotalFiscal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:StockTotalFiscal").toString(), Double.parseDouble(BalansActivaXLS.HaalData("G", 50, Tab)), "G50")); // Vorderingen op handelsdebiteuren fiscaal // TradeAccountsReceivableFiscal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:TradeAccountsReceivableFiscal").toString(), Double.parseDouble(BalansActivaXLS.HaalData("G", 57, Tab)), "G57")); // Vorderingen omzetbelasting fiscaal // ValueAddedTaxReceivablesFiscal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:ValueAddedTaxReceivablesFiscal").toString(), Double.parseDouble(BalansActivaXLS.HaalData("G", 58, Tab)), "G58")); // Kortlopende vorderingen op groepsmaatschappijen fiscaal // ShortTermReceivablesGroupCompaniesFiscal Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:ShortTermReceivablesGroupCompaniesFiscal").toString(), Double.parseDouble(BalansActivaXLS.HaalData("G", 59, Tab)), "G59")); // Kortlopende vorderingen participanten/maatschappij waarin wordt // deelgenomen, fiscaal // ShortTermReceivablesParticipatingInterestCompaniesFiscal Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:ShortTermReceivablesParticipatingInterestCompaniesFiscal").toString(), Double.parseDouble(BalansActivaXLS.HaalData("G", 60, Tab)), "G60")); // Overige vorderingen fiscaal // ReceivablesOtherFiscal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:ReceivablesOtherFiscal").toString(), Double.parseDouble(BalansActivaXLS.HaalData("G", 61, Tab)), "G61")); // Totaal vorderingen fiscaal // ReceivablesTotalFiscal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:ReceivablesTotalFiscal").toString(), Double.parseDouble(BalansActivaXLS.HaalData("G", 62, Tab)), "G62")); // Nominaal handelsdebiteuren fiscaal // TradeReceivablesNominal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:TradeReceivablesNominal").toString(), Double.parseDouble(BalansActivaXLS.HaalData("B", 57, Tab)), "B57")); // Kortlopende vorderingen op groepsmaatschappijen nominaal // ShortTermReceivablesGroupCompaniesNominal Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:ShortTermReceivablesGroupCompaniesNominal").toString(), Double.parseDouble(BalansActivaXLS.HaalData("B", 59, Tab)), "B59")); // Kortlopende vorderingen participanten/maatschappij waarin wordt // deelgenomen, nominaal // ShortTermReceivablesParticipatingInterestCompaniesNominal Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:ShortTermReceivablesParticipatingInterestCompaniesNominal").toString(), Double.parseDouble(BalansActivaXLS.HaalData("B", 60, Tab)), "B60")); // Effecten fiscaal // SecuritiesFiscal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:SecuritiesFiscal").toString(), Double.parseDouble(BalansActivaXLS.HaalData("G", 67, Tab)), "G67")); // Liquide middelen fiscaal // LiquidAssetsTotalFiscal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:LiquidAssetsTotalFiscal").toString(), Double.parseDouble(BalansActivaXLS.HaalData("G", 72, Tab)), "G72")); // Totaal activa fiscaal // AssetsTotalAmountFiscal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:AssetsTotalAmountFiscal").toString(), Double.parseDouble(BalansActivaXLS.HaalData("G", 77, Tab)), "G77")); // Kosten aanschaf goodwill fiscaal // GoodwillPurchaseCostsFiscal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:GoodwillPurchaseCostsFiscal").toString(), Double.parseDouble(BalansActivaXLS.HaalData("B", 16, Tab)), "B16")); // Aanschaf/voortbrengingskosten overige immateriële vaste activa // fiscaal // IntangibleFixedAssetsOtherPurchaseOrProductionCostsFiscal Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:IntangibleFixedAssetsOtherPurchaseOrProductionCostsFiscal").toString(), Double.parseDouble(BalansActivaXLS.HaalData("B", 17, Tab)), "B17")); // Toelichting op balans activa // BalanceSheetAssetsDescription } @When("^the elements of the XBRL and the XLS for Balans Passiva are compared$") public void the_elements_of_the_XBRL_and_the_XLS_for_Balans_Passiva_are_compared() throws Throwable { String Tab = "TC04"; // PaidCalledUpCapitalFiscal // Gestort en opgevraagd kapitaal fiscaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:PaidCalledUpCapitalFiscal").toString(), Double.parseDouble(BalansPassivaXLS.HaalData("F", 9, Tab)), "F9")); // InformalCapitalFiscal // Informeel kapitaal fiscaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:InformalCapitalFiscal").toString(), Double.parseDouble(BalansPassivaXLS.HaalData("F", 10, Tab)), "F10")); // SharePremiumFiscal // Agio fiscaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:SharePremiumFiscal").toString(), Double.parseDouble(BalansPassivaXLS.HaalData("F", 11, Tab)), "F11")); // RetainedProfitsFiscal // Winstreserve fiscaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:RetainedProfitsFiscal").toString(), Double.parseDouble(BalansPassivaXLS.HaalData("F", 12, Tab)), "F12")); // EqualizationReserveCostsFiscal // Kosten egalisatiereserve fiscaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:EqualizationReserveCostsFiscal").toString(), Double.parseDouble(BalansPassivaXLS.HaalData("F", 13, Tab)), "F13")); // ReinvestmentReserveFiscal // Herinvesteringsreserve fiscaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:ReinvestmentReserveFiscal").toString(), Double.parseDouble(BalansPassivaXLS.HaalData("F", 14, Tab)), "F14")); // CompartmentReserveTaxed // Belaste compartimenteringsreserve Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:CompartmentReserveTaxed").toString(), Double.parseDouble(BalansPassivaXLS.HaalData("F", 15, Tab)), "F15")); // TaxReservesOtherFiscal // Overige fiscale reserves Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:TaxReservesOtherFiscal").toString(), Double.parseDouble(BalansPassivaXLS.HaalData("F", 16, Tab)), "F16")); // EquityCapitalBusinessAssetsTotalFiscal // Eigen vermogen/fiscaal ondernemingsvermogen // WarrantyProvisionFiscal // Garantievoorziening fiscaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:WarrantyProvisionFiscal").toString(), Double.parseDouble(BalansPassivaXLS.HaalData("F", 25, Tab)), "F25")); // ProvisionAnnuityPensionAndRightOfStanding // Voorzieningen voor lijfrente, pensioen en stamrecht Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:ProvisionAnnuityPensionAndRightOfStanding").toString(), Double.parseDouble(BalansPassivaXLS.HaalData("F", 26, Tab)), "F26")); // ProvisionsOtherFiscal // Overige voorzieningen fiscaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:ProvisionsOtherFiscal").toString(), Double.parseDouble(BalansPassivaXLS.HaalData("F", 27, Tab)), "F27")); // ProvisionsTotalFiscal // Totaal voorzieningen fiscaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:ProvisionsTotalFiscal").toString(), Double.parseDouble(BalansPassivaXLS.HaalData("F", 28, Tab)), "F28")); // ConvertibleLoansFiscal // Converteerbare leningen fiscaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:ConvertibleLoansFiscal").toString(), Double.parseDouble(BalansPassivaXLS.HaalData("F", 36, Tab)), "F36")); // BondsFiscal // Obligaties fiscaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:BondsFiscal").toString(), Double.parseDouble(BalansPassivaXLS.HaalData("F", 38, Tab)), "F38")); // LongTermDebtsGroupCompanies // Langlopende schulden groepsmaatschappijen Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:LongTermDebtsGroupCompanies").toString(), Double.parseDouble(BalansPassivaXLS.HaalData("F", 39, Tab)), "F39")); // LongTermDebtsParticipatingInterestCompanies // Langlopende schulden participanten/maatschappij waarin wordt // deelgenomen Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:LongTermDebtsParticipatingInterestCompanies").toString(), Double.parseDouble(BalansPassivaXLS.HaalData("F", 40, Tab)), "F40")); // PayablesCreditInstitutionFiscal // Schulden aan kredietinstellingen fiscaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:PayablesCreditInstitutionFiscal").toString(), Double.parseDouble(BalansPassivaXLS.HaalData("F", 37, Tab)), "F37")); // LongTermDebtsOther // Overige langlopende schulden Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:LongTermDebtsOther").toString(), Double.parseDouble(BalansPassivaXLS.HaalData("F", 41, Tab)), "F41")); // LongTermDebtsTotal // Totaal langlopende schulden Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:LongTermDebtsTotal").toString(), Double.parseDouble(BalansPassivaXLS.HaalData("F", 42, Tab)), "F42")); // AccountsPayableSuppliersTradeCreditors // Schulden aan leveranciers en handelskredieten Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:AccountsPayableSuppliersTradeCreditors").toString(), Double.parseDouble(BalansPassivaXLS.HaalData("F", 49, Tab)), "F49")); // ValueAddedTaxPayablesFiscal // Schulden omzetbelasting fiscaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:ValueAddedTaxPayablesFiscal").toString(), Double.parseDouble(BalansPassivaXLS.HaalData("F", 50, Tab)), "F50")); // ShortTermDebtsGroupCompanies // Kortlopende schulden groepsmaatschappijen Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:ShortTermDebtsGroupCompanies").toString(), Double.parseDouble(BalansPassivaXLS.HaalData("F", 52, Tab)), "F52")); // WageTaxDebt // Loonheffingen Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:WageTaxDebt").toString(), Double.parseDouble(BalansPassivaXLS.HaalData("F", 51, Tab)), "F51")); // ShortTermDebtsParticipatingInterestCompanies // Kortlopende schulden participanten/maatschappij waarin wordt // deelgenomen Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:ShortTermDebtsParticipatingInterestCompanies").toString(), Double.parseDouble(BalansPassivaXLS.HaalData("F", 53, Tab)), "F53")); // ShortTermDebtsOther // Overige kortlopende schulden Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:ShortTermDebtsOther").toString(), Double.parseDouble(BalansPassivaXLS.HaalData("F", 54, Tab)), "F54")); // ShortTermDebtsTotal // Totaal kortlopende schulden Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:ShortTermDebtsTotal").toString(), Double.parseDouble(BalansPassivaXLS.HaalData("F", 55, Tab)), "F55")); // LiabilitiesTotalFiscal // Totaal passiva fiscaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:LiabilitiesTotalFiscal").toString(), Double.parseDouble(BalansPassivaXLS.HaalData("F", 59, Tab)), "F59")); // BalanceSheetLiabilitiesDescription // Toelichting op balans passiva } @When("^the elements of the XBRL and the XLS for Fiscale vermogensvergelijking are compared$") public void the_elements_of_the_XBRL_and_the_XLS_for_Fiscale_vermogensvergelijking_are_compared() throws Throwable { // Write code here that turns the phrase above into concrete actions String Tab = "TC01"; // ProfitDistributionSubjectToDividendDate // De datum waarop het dividend ter beschikking is gesteld Result.addAll(vergelijk.VergelijkTupple( ReadXML.GetXMLvalue("bd-bedr:ProfitDistributionSubjectToDividendDate").toString(), convertDate.changedateformat(FiscaleVermogensvergelijkingXLS.HaalText("B", 24, Tab)), convertDate.changedateformat(FiscaleVermogensvergelijkingXLS.HaalText("B", 25, Tab)))); // DividendTaxReturnDate // Datum aangifte dividendbelasting Result.addAll(vergelijk.VergelijkTupple(ReadXML.GetXMLvalue("bd-bedr:DividendTaxReturnDate").toString(), convertDate.changedateformat(FiscaleVermogensvergelijkingXLS.HaalText("C", 24, Tab)), convertDate.changedateformat(FiscaleVermogensvergelijkingXLS.HaalText("C", 25, Tab)))); // DividendTaxWithheldAmount // Bedrag ingehouden dividendbelasting Result.addAll(vergelijk.VergelijkTupple(ReadXML.GetXMLvalue("bd-bedr:DividendTaxWithheldAmount").toString(), FiscaleVermogensvergelijkingXLS.HaalData("D", 24, Tab), FiscaleVermogensvergelijkingXLS.HaalData("D", 25, Tab))); // ProfitDistributionAmount // Bedrag winstuitdeling Result.addAll(vergelijk.VergelijkTupple(ReadXML.GetXMLvalue("bd-bedr:ProfitDistributionAmount").toString(), FiscaleVermogensvergelijkingXLS.HaalData("E", 24, Tab), FiscaleVermogensvergelijkingXLS.HaalData("E", 25, Tab))); // ProfitDistributionsSubjectToDividendTaxTotalAmount // Totaal aan dividendbelasting onderworpen winstuitdelingen Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:ProfitDistributionsSubjectToDividendTaxTotalAmount").toString(), Double.parseDouble(FiscaleVermogensvergelijkingXLS.HaalData("F", 21, Tab)), "F21")); // CorporationTaxWithdrawnFromEquityCapital // Vennootschapsbelasting aan fiscaal vermogen onttrokken Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:CorporationTaxWithdrawnFromEquityCapital").toString(), Double.parseDouble(FiscaleVermogensvergelijkingXLS.HaalData("F", 27, Tab)), "F27")); // ForeignTaxAmountThisFinancialYearAppliedDoubleTaxAvoidance // Buitenlandse belasting over dit boekjaar voorzover hierop een // regeling ter voorkoming van dubbele belasting van toepassing is Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:ForeignTaxAmountThisFinancialYearAppliedDoubleTaxAvoidance").toString(), Double.parseDouble(FiscaleVermogensvergelijkingXLS.HaalData("F", 28, Tab)), "F28")); // ProfitDistributionsByCooperationsNonDeductibelPart // Niet aftrekbaar deel winstuitdelingen door coöperaties Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:ProfitDistributionsByCooperationsNonDeductibelPart").toString(), Double.parseDouble(FiscaleVermogensvergelijkingXLS.HaalData("F", 30, Tab)), "F30")); // ProfitDistributionOtherNonDeductibleAmount // Andere openlijke of vermomde uitdelingen van winst Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:ProfitDistributionOtherNonDeductibleAmount").toString(), Double.parseDouble(FiscaleVermogensvergelijkingXLS.HaalData("F", 35, Tab)), "F35")); // SupervisoryDirectorsFeesBalanceNonDeductiblePart // Niet aftrekbaar deel beloningen commissarissen Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:SupervisoryDirectorsFeesBalanceNonDeductiblePart").toString(), Double.parseDouble(FiscaleVermogensvergelijkingXLS.HaalData("F", 36, Tab)), "F36")); // ProfitSharingBonusesNonDeductiblePart // Niet aftrekbaar deel tantièmes Result.addAll( vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:ProfitSharingBonusesNonDeductiblePart").toString(), Double.parseDouble(FiscaleVermogensvergelijkingXLS.HaalData("F", 41, Tab)), "F41")); // CapitalProvisionPaymentsNonDeductiblePart // Niet aftrekbaar deel vergoedingen voor kapitaalsverstrekking Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:CapitalProvisionPaymentsNonDeductiblePart").toString(), Double.parseDouble(FiscaleVermogensvergelijkingXLS.HaalData("F", 47, Tab)), "F47")); // PaymentsEnsuingFromArticlesOfAssociationEtcRegulationsTotal // Totaal uitkeringen ingevolge statutaire en andere voorschriften Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:PaymentsEnsuingFromArticlesOfAssociationEtcRegulationsTotal").toString(), Double.parseDouble(FiscaleVermogensvergelijkingXLS.HaalData("F", 52, Tab)), "F52")); // ResultTemporarilyPurchasedSharesEmployeeOptionsTotal // Totaal resultaat tijdelijk ingekochte aandelen werknemersopties Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:ResultTemporarilyPurchasedSharesEmployeeOptionsTotal").toString(), Double.parseDouble(FiscaleVermogensvergelijkingXLS.HaalData("F", 53, Tab)), "F53")); // CostsUponTaxEntityPurchaseRemainingSharesSubsidiaryInTaxEntityTotal // Totaal kosten bij aankoop resterende aandelen dochtermaatschappijen // in fiscale eenheid Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:CostsUponTaxEntityPurchaseRemainingSharesSubsidiaryInTaxEntityTotal") .toString(), Double.parseDouble(FiscaleVermogensvergelijkingXLS.HaalData("F", 54, Tab)), "F54")); // BusinessCapitalTotalEndFinancialYearForComparisonMethod // Ondernemingsvermogen bij het einde van het boekjaar Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:BusinessCapitalTotalEndFinancialYearForComparisonMethod").toString(), Double.parseDouble(FiscaleVermogensvergelijkingXLS.HaalData("E", 5, Tab)), "E5")); // CapitalChangesAndWithdrawalsTotal // Mutaties/onttrekkingen kapitaal in het boekjaar Result.addAll( vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:CapitalChangesAndWithdrawalsTotal").toString(), Double.parseDouble(FiscaleVermogensvergelijkingXLS.HaalData("E", 6, Tab)), "E6")); // FinalAssetsAndCapitalWithdrawalsTotal // Totaal eindvermogen en terugbetalingen Result.addAll( vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:FinalAssetsAndCapitalWithdrawalsTotal").toString(), Double.parseDouble(FiscaleVermogensvergelijkingXLS.HaalData("F", 8, Tab)), "F8")); // BusinessCapitalTotalStartFinancialYearForComparisonMethod // Ondernemingsvermogen bij het begin van het boekjaar Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:BusinessCapitalTotalEndFinancialYearForComparisonMethod").toString(), Double.parseDouble(FiscaleVermogensvergelijkingXLS.HaalData("E", 5, Tab)), "E5")); // CapitalContributionsTotal // Stortingen van kapitaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:CapitalContributionsTotal").toString(), Double.parseDouble(FiscaleVermogensvergelijkingXLS.HaalData("E", 11, Tab)), "E11")); // InitialCapitalAndCapitalContributionsTotal // Totaal beginvermogen en kapitaalstortingen Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:InitialCapitalAndCapitalContributionsTotal").toString(), Double.parseDouble(FiscaleVermogensvergelijkingXLS.HaalData("F", 13, Tab)), "F13")); // CapitalComparisonDifferenceOfCapitalTotal // Vermogensverschil Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:CapitalComparisonDifferenceOfCapitalTotal").toString(), Double.parseDouble(FiscaleVermogensvergelijkingXLS.HaalData("F", 14, Tab)), "F14")); // CorporationTaxNonDeductibleAmountsTotal // Niet aftrekbare bedragen Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:CorporationTaxNonDeductibleAmountsTotal").toString(), Double.parseDouble(FiscaleVermogensvergelijkingXLS.HaalData("F", 15, Tab)), "F15")); // BalanceProfitComparisonMethod // Saldo fiscale winstberekening (volgens vermogensvergelijking) Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:BalanceProfitComparisonMethod").toString(), Double.parseDouble(FiscaleVermogensvergelijkingXLS.HaalData("F", 16, Tab)), "F16")); } @When("^the elements of the XBRL and the XLS for Winst en verliesrekening are compared$") public void the_elements_of_the_XBRL_and_the_XLS_for_Winst_en_verliesrekening_are_compared() throws Throwable { String Tab = "TC01"; // StockAndWorkInProgressChangeFiscal // Wijziging voorraad en onderhanden werk fiscaal Result.addAll( vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:StockAndWorkInProgressChangeFiscal").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 8, Tab)), "D8")); // CapitalizedProductionOwnBusinessFiscal // Geactiveerde productie eigen bedrijf fiscaal Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:CapitalizedProductionOwnBusinessFiscal").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 9, Tab)), "D9")); // RevenuesOtherFiscal // Overige opbrengsten fiscaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:RevenuesOtherFiscal").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 10, Tab)), "D10")); // BusinessRevenuesFiscalTotal // Totaal bedrijfsopbrengsten fiscaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:BusinessRevenuesFiscalTotal").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("G", 13, Tab)), "G13")); // RawAncillaryMaterialsPurchasePriceSalesFiscal // Kosten grond- en hulpstoffen, inkoopprijs van de verkopen fiscaal Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:RawAncillaryMaterialsPurchasePriceSalesFiscal").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 20, Tab)), "D20")); // OutsourcedWorkCostsAndOtherExternalCostsFiscal // Kosten uitbesteed werk en andere externe kosten fiscaal Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:RawAncillaryMaterialsPurchasePriceSalesFiscal").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 21, Tab)), "D21")); // WagesSalariesFiscal // Lonen en salarissen fiscaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:WagesSalariesFiscal").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 27, Tab)), "D27")); // SocialSecurityCostsFiscal // Sociale lasten fiscaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:SocialSecurityCostsFiscal").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 28, Tab)), "D28")); // PensionCostsFiscal // Pensioenlasten fiscaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:PensionCostsFiscal").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 29, Tab)), "D29")); // PersonnelCostsOtherFiscal // Overige personeelskosten fiscaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:PersonnelCostsOtherFiscal").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 30, Tab)), "D30")); // BenefitsAndWageSubsidiesReceivedFiscal // Ontvangen uitkeringen en loonsubsidies fiscaal Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:BenefitsAndWageSubsidiesReceivedFiscal").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 31, Tab)), "D31")); // GoodwillDepreciationFiscal // Goodwill afschrijvingen fiscaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:GoodwillDepreciationFiscal").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 37, Tab)), "D37")); // IntangibleFixedAssetsOtherDepreciation // Overige immateriële vaste activa afschrijvingen Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:IntangibleFixedAssetsOtherDepreciation").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 38, Tab)), "D38")); // CompanyBuildingsDepreciationFiscal // Afschrijving bedrijfsgebouwen fiscaal Result.addAll( vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:CompanyBuildingsDepreciationFiscal").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 39, Tab)), "D39")); // MachineryDepreciationFiscal // Afschrijving machines en installaties fiscaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:MachineryDepreciationFiscal").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 40, Tab)), "D40")); // TangibleFixedAssetsOtherDepreciation // Andere vaste bedrijfsmiddelen afschrijving Result.addAll( vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:TangibleFixedAssetsOtherDepreciation").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 41, Tab)), "D41")); // TangibleAndIntangibleFixedAssetsOtherValuationChangeAmount // Overige waardeveranderingen van immateriële en materiële vaste // activa Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:TangibleAndIntangibleFixedAssetsOtherValuationChangeAmount").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 47, Tab)), "D47")); // CurrentAssetsSpecialValuationDecreaseAmount // Bijzondere waardevermindering van vlottende activa Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:CurrentAssetsSpecialValuationDecreaseAmount").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 51, Tab)), "D51")); // CarAndTransportCostsFiscal // Auto- en transportkosten fiscaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:CarAndTransportCostsFiscal").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 56, Tab)), "D56")); // AccommodationCostsFiscal // Huisvestingskosten fiscaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:AccommodationCostsFiscal").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 57, Tab)), "D57")); // MaintenanceOtherTangibleFixedAssetsFiscal // Onderhoud overige materiële vaste activa fiscaal Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:MaintenanceOtherTangibleFixedAssetsFiscal").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 58, Tab)), "D58")); // SalesCostsFiscal // Verkoopkosten fiscaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:SalesCostsFiscal").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 59, Tab)), "D59")); // CostOtherFiscal // Andere kosten fiscaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:CostOtherFiscal").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 60, Tab)), "D60")); // BusinessExpenditureFiscalTotal // Totaal bedrijfslasten fiscaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:BusinessExpenditureFiscalTotal").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("G", 63, Tab)), "G63")); // RevenuesOnReceivablesGroupCompanies // Opbrengsten vorderingen groepsmaatschappijen Result.addAll( vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:RevenuesOnReceivablesGroupCompanies").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 71, Tab)), "D71")); // ProfitDueToDebtRemission // Kwijtscheldingswinst Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:ProfitDueToDebtRemission").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 72, Tab)), "D72")); // RevenuesOnReceivablesParticipatingInterestCompanies // Opbrengsten vorderingen participant/maatschappijen waarin wordt // deelgenomen Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:RevenuesOnReceivablesParticipatingInterestCompanies").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 73, Tab)), "D73")); // RevenuesOtherReceivablesFiscal // Opbrengsten overige vorderingen fiscaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:RevenuesOtherReceivablesFiscal").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 74, Tab)), "D74")); // RevenuesBankCreditsFiscal // Opbrengsten banktegoeden fiscaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:RevenuesOtherReceivablesFiscal").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 75, Tab)), "D75")); // ReceivablesValuationChangeAmount // Waardeverandering van vorderingen Result.addAll( vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:ReceivablesValuationChangeAmount").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 76, Tab)), "D76")); // StockValuationChangeAmount // Waardeverandering van effecten Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:StockValuationChangeAmount").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 77, Tab)), "D77")); // DividendExceptParticipatingInterestDividendFiscal // Ontvangen dividend (met uitzondering van deelnemingsdividend) fiscaal Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:DividendExceptParticipatingInterestDividendFiscal").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 78, Tab)), "D78")); // CostsOnReceivablesParticipatingInterestCompanies // Kosten schulden participant/maatschappijen waarin wordt deelgenomen Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:CostsOnReceivablesParticipatingInterestCompanies").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 84, Tab)), "D84")); // InterestExpenditureEtcCostsDebtsFiscal // Kosten schulden, rentelasten etc. fiscaal Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:InterestExpenditureEtcCostsDebtsFiscal").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 85, Tab)), "D85")); // CostsOnReceivablesGroupCompanies // Kosten van schulden aan groepsmaatschappijen Result.addAll( vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:CostsOnReceivablesGroupCompanies").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 86, Tab)), "D86")); // BusinessFinanciaResultFiscalTotal // Totaal financiële baten en lasten fiscaal Result.addAll( vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:BusinessFinanciaResultFiscalTotal").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("G", 90, Tab)), "D90")); // NormalBusinessActivitiesBusinessResultTotalFiscal // Resultaat gewone bedrijfsuitoefening fiscaal Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:NormalBusinessActivitiesBusinessResultTotalFiscal").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("G", 91, Tab)), "D91")); // BenefitsOrLossesRemovalSubsidiaryTerminationTaxEntityFiscal // Voordelen ontvoeging dochtermaatschappij/beeindiging fiscale eenheid // fiscaal Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:BenefitsOrLossesRemovalSubsidiaryTerminationTaxEntityFiscal").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 100, Tab)), "D100")); // ExtraordinaryIncomeBusinessOtherFiscal // Overige buitengewone baten fiscaal Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:ExtraordinaryIncomeBusinessOtherFiscal").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 101, Tab)), "D101")); // AssetsBookProfitsFiscal // Boekwinst op activa fiscaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:AssetsBookProfitsFiscal").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 102, Tab)), "D102")); // ReinvestmentReservesWriteDownFiscal // Afboeking herinvesteringsreserve fiscaal Result.addAll( vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:ReinvestmentReservesWriteDownFiscal").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 107, Tab)), "D107")); // PaymentsCharitiesFiscal // Uitkeringen aan algemeen nut beogende instellingen fiscaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:PaymentsCharitiesFiscal").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 108, Tab)), "D108")); // ExtraordinaryExpenditureBusinessOtherFiscal // Overige buitengewone lasten fiscaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:PaymentsCharitiesFiscal").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 109, Tab)), "D109")); // ExtraordinaryBusinessResultsFiscal // Buitengewone resultaten fiscaal Result.addAll( vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:ExtraordinaryBusinessResultsFiscal").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("D", 110, Tab)), "D110")); // BalanceProfitCalculationForTaxPurposesFiscal // Saldo fiscale winstberekening Result.addAll( vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:ExtraordinaryBusinessResultsFiscal").toString(), Double.parseDouble(WinstVerliesXLS.HaalData("G", 118, Tab)), "G118")); } @When("^the elements of the XBRL and the XLS for Investeringsaftrek are compared$") public void the_elements_of_the_XBRL_and_the_XLS_for_Investeringsaftrek_are_compared() throws Throwable { // BusinessAssetEnvironmentalEnergyInvestmentDescription // Bedrijfsmiddel investering energie/milieu Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("investeringsaftrek", "bd-bedr:BusinessAssetEnvironmentalEnergyInvestmentDescription", 1)); // BusinessAssetEnvironmentalEnergyInvestmentFinancialYearAmount // Investeringsbedrag boekjaar Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("investeringsaftrek", "bd-bedr:BusinessAssetEnvironmentalEnergyInvestmentFinancialYearAmount", 4)); // BusinessAssetEnvironmentalEnergyInvestmentInitialStartingDate // Datum ingebruikname bedrijfsmiddel Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("investeringsaftrek", "bd-bedr:BusinessAssetEnvironmentalEnergyInvestmentInitialStartingDate", 3)); // BusinessAssetEnvironmentalEnergyInvestmentPaidThisFinancialYear // Bedrag in boekjaar betaald Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("investeringsaftrek", "bd-bedr:BusinessAssetEnvironmentalEnergyInvestmentPaidThisFinancialYear", 5)); // BusinessAssetEnvironmentalEnergyInvestmentNotificationNumber // Meldingsnummer energie/milieu-investeringsaftrek Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("investeringsaftrek", "bd-bedr:BusinessAssetEnvironmentalEnergyInvestmentNotificationNumber", 9)); // BusinessAssetEnvironmentalEnergyInvestmentPercentage // Percentage energie/milieu-investeringsaftrek Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("investeringsaftrek", "bd-bedr:BusinessAssetEnvironmentalEnergyInvestmentPercentage", 14)); // BusinessAssetEnvironmentalEnergyInvestmentAllowancePerInvestmentAmount // Berekende investeringsaftrek per investering Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("investeringsaftrek", "bd-bedr:BusinessAssetEnvironmentalEnergyInvestmentAllowancePerInvestmentAmount", 13)); // BusinessAssetEnvironmentalEnergyInvestmentAllowanceThisFinancialYear // Investeringsaftrek energie/milieu dit boekjaar Result.addAll(XMLandXLScompare.XMLandXLScheckerArrays("investeringsaftrek", "bd-bedr:BusinessAssetEnvironmentalEnergyInvestmentAllowanceThisFinancialYear", 15)); } @When("^the elements of the XBRL and the XLS for verliesverrekening_xbrl are compared$") public void the_elements_of_the_XBRL_and_the_XLS_for_verliesverrekening_xbrl_are_compared() throws Throwable { String Tab = "Tc01"; // LossesToBeSettledTaxEntityThisFinancialYearCompanyIdentificationNumber // RSIN maatschappij herkomst verlies vergelijk.VergelijkTupple( ReadXML.GetXMLvalue("bd-bedr:LossesToBeSettledTaxEntityThisFinancialYearCompanyIdentificationNumber") .toString(), VerliesVerrekeningXLS.HaalData("A", 28, Tab), VerliesVerrekeningXLS.HaalData("A", 28, Tab)); // LossesToBeSettledTaxEntityThisFinancialYearStart // Boekjaar maatschappij herkomst verlies, begin Result.addAll(vergelijk.VergelijkTupple( ReadXML.GetXMLvalue("bd-bedr:LossesToBeSettledTaxEntityThisFinancialYearStart").toString(), convertDate.changedateformat(VerliesVerrekeningXLS.HaalDatum("B", 28, Tab)), convertDate.changedateformat(VerliesVerrekeningXLS.HaalDatum("B", 29, Tab)))); // LossesToBeSettledTaxEntityThisFinancialYearEnd@ // Boekjaar maatschappij herkomst verlies, eind Result.addAll(vergelijk.VergelijkTupple( ReadXML.GetXMLvalue("bd-bedr:LossesToBeSettledTaxEntityThisFinancialYearEnd").toString(), convertDate.changedateformat(VerliesVerrekeningXLS.HaalDatum("C", 28, Tab)), convertDate.changedateformat(VerliesVerrekeningXLS.HaalDatum("C", 29, Tab)))); // LossesToBeSettledTaxEntityThisFinancialYearCompany // Verrekening verlies maatschappij dit boekjaar vergelijk.VergelijkTupple( ReadXML.GetXMLvalue("bd-bedr:LossesToBeSettledTaxEntityThisFinancialYearCompany").toString(), VerliesVerrekeningXLS.HaalData("E", 28, Tab), VerliesVerrekeningXLS.HaalData("E", 29, Tab)); // BackwardLossesToBeSettledTaxEntityCompanyIdentificationNumber // RSIN maatschappij toerekening verlies vergelijk.VergelijkTupple( ReadXML.GetXMLvalue("bd-bedr:BackwardLossesToBeSettledTaxEntityCompanyIdentificationNumber").toString(), VerliesVerrekeningXLS.HaalData("A", 13, Tab), VerliesVerrekeningXLS.HaalData("A", 14, Tab)); // BackwardLossesToBeSettledTaxEntityLossToBeSettledPreviousFinancialYear // Verrekening verlies naar voorgaand boekjaar vergelijk.VergelijkTupple( ReadXML.GetXMLvalue("bd-bedr:BackwardLossesToBeSettledTaxEntityLossToBeSettledPreviousFinancialYear") .toString(), VerliesVerrekeningXLS.HaalData("C", 13, Tab), VerliesVerrekeningXLS.HaalData("D", 14, Tab)); } @When("^the elements of the XBRL and the XLS for Toelichting_overige_voorziening_xbrl are compared$") public void the_elements_of_the_XBRL_and_the_XLS_for_Toelichting_overige_voorziening_xbrl_are_compared() throws Throwable { // Write code here that turns the phrase above into concrete actions String Tab = "ToelichtingOverigeVoorziening"; // WarrantyProvisionDescription // Omschrijving soort garantievoorziening Result.addAll(vergelijk.VergelijkTupple(ReadXML.GetXMLvalue("bd-bedr:WarrantyProvisionDescription").toString(), ToelichtingOverigeVoorzXLS.HaalText("B", 2, Tab), ToelichtingOverigeVoorzXLS.HaalText("B", 3, Tab))); // WarrantyProvisionAllocationAmount // Dotatie garantievoorziening Result.addAll(vergelijk.VergelijkTupple( ReadXML.GetXMLvalue("bd-bedr:WarrantyProvisionAllocationAmount").toString(), ToelichtingOverigeVoorzXLS.HaalData("C", 2, Tab), ToelichtingOverigeVoorzXLS.HaalData("C", 3, Tab))); // WarrantyProvisionWithdrawal // Onttrekking garantievoorziening Result.addAll(vergelijk.VergelijkTupple(ReadXML.GetXMLvalue("bd-bedr:WarrantyProvisionWithdrawal").toString(), ToelichtingOverigeVoorzXLS.HaalData("D", 2, Tab), ToelichtingOverigeVoorzXLS.HaalData("D", 3, Tab))); // WarrantyProvisionFiscalAmount // Garantievoorziening fiscaal einde boekjaar Result.addAll(vergelijk.VergelijkTupple(ReadXML.GetXMLvalue("bd-bedr:WarrantyProvisionFiscalAmount").toString(), ToelichtingOverigeVoorzXLS.HaalData("E", 2, Tab), ToelichtingOverigeVoorzXLS.HaalData("E", 3, Tab))); } @When("^the elements of the XBRL and the XLS for Toelichting materiele vaste activa are compared$") public void the_elements_of_the_XBRL_and_the_XLS_for_Toelichting_materiele_vaste_activa_are_compared() throws Throwable { String Locatie = "C:\\testdata\\Toelichting materiele vaste activa.xlsx"; String Tab = "TC01"; // EnvironmentalBusinessAssetsPurchaseCostsFiscal // Aanschafkosten milieu-bedrijfsmiddelen fiscaal // EnvironmentalBusinessAssetsFiscal // Milieu-bedrijfsmiddelen fiscaal // EnvironmentalBusinessAssetsResidualValueFiscal // Restwaarde milieu-bedrijfsmiddelen fiscaal // BuildingsOwnUsePurchaseCostsFiscal // Aanschafkosten gebouwen in eigen gebruik fiscaal Result.addAll( vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:BuildingsOwnUsePurchaseCostsFiscal").toString(), Double.parseDouble(LeesXLS.HaalData("B", 9, Tab, Locatie)), "B9")); // BuildingsOwnUseFiscal // Gebouwen in eigen gebruik fiscaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:BuildingsOwnUseFiscal").toString(), Double.parseDouble(LeesXLS.HaalData("C", 9, Tab, Locatie)), "C9")); // BuildingsOwnUseResidualValueFiscal // Restwaarde gebouwen in eigen gebruik fiscaal Result.addAll( vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:BuildingsOwnUseResidualValueFiscal").toString(), Double.parseDouble(LeesXLS.HaalData("D", 9, Tab, Locatie)), "D9")); // BuildingsOwnUseSoilValueFiscal // Bodemwaarde gebouwen in eigen gebruik fiscaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:BuildingsOwnUseSoilValueFiscal").toString(), Double.parseDouble(LeesXLS.HaalData("E", 9, Tab, Locatie)), "E9")); // BuildingsForInvestmentPurposesPurchaseCostsFiscal // Aanschafkosten gebouwen ter belegging fiscaal Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:BuildingsForInvestmentPurposesPurchaseCostsFiscal").toString(), Double.parseDouble(LeesXLS.HaalData("B", 10, Tab, Locatie)), "B10")); // BuildingsForInvestmentPurposesFiscal // Gebouwen ter belegging fiscaal Result.addAll( vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:BuildingsForInvestmentPurposesFiscal").toString(), Double.parseDouble(LeesXLS.HaalData("C", 10, Tab, Locatie)), "C10")); // BuildingsForInvestmentPurposesResidualValueFiscal // Restwaarde gebouwen ter belegging fiscaal Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:BuildingsForInvestmentPurposesResidualValueFiscal").toString(), Double.parseDouble(LeesXLS.HaalData("D", 10, Tab, Locatie)), "D10")); // BuildingsForInvestmentPurposesSoilValueFiscal // Bodemwaarde gebouwen ter belegging fiscaal Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:BuildingsForInvestmentPurposesSoilValueFiscal").toString(), Double.parseDouble(LeesXLS.HaalData("E", 10, Tab, Locatie)), "E10")); // BuildingsPurchaseCostsWithoutDepreciationFiscal // Aanschafkosten gebouwen zonder afschrijving fiscaal Result.addAll(vergelijk.VergelijkXBRL( ReadXML.GetXMLvalue("bd-bedr:BuildingsPurchaseCostsWithoutDepreciationFiscal").toString(), Double.parseDouble(LeesXLS.HaalData("B", 11, Tab, Locatie)), "B11")); // BuildingsWithoutDepreciationFiscal // Gebouwen zonder afschrijving fiscaal Result.addAll( vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:BuildingsWithoutDepreciationFiscal").toString(), Double.parseDouble(LeesXLS.HaalData("C", 11, Tab, Locatie)), "C11")); // CompanySitesFiscal // Bedrijfsterreinen fiscaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:CompanySitesFiscal").toString(), Double.parseDouble(LeesXLS.HaalData("C", 12, Tab, Locatie)), "C12")); // CompanySitesPurchaseCostsFiscal // Kosten aanschaf bedrijfsterreinen fiscaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:CompanySitesPurchaseCostsFiscal").toString(), Double.parseDouble(LeesXLS.HaalData("B", 12, Tab, Locatie)), "B12")); // CompanySitesResidualValueFiscal // Restwaarde bedrijfsterreinen fiscaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:CompanySitesResidualValueFiscal").toString(), Double.parseDouble(LeesXLS.HaalData("D", 12, Tab, Locatie)), "D12")); // MachineryPurchaseCostsFiscal // Kosten aanschaf machines fiscaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:MachineryPurchaseCostsFiscal").toString(), Double.parseDouble(LeesXLS.HaalData("B", 17, Tab, Locatie)), "B17")); // MachineryResidualValueFiscal // Restwaarde machines fiscaal Result.addAll(vergelijk.VergelijkXBRL(ReadXML.GetXMLvalue("bd-bedr:MachineryResidualValueFiscal").toString(), Double.parseDouble(LeesXLS.HaalData("D", 17, Tab, Locatie)), "D17")); } @When("^the elements of the XBRL and the XLS for Toelichting garantievoorziening are compared$") public void the_elements_of_the_XBRL_and_the_XLS_for_Toelichting_garantievoorziening_are_compared() throws Throwable { // Write code here that turns the phrase above into concrete actions String Locatie = "C:\\testdata\\Toelichting garantievoorziening.xlsx"; String Tab = "TC01"; // WarrantyProvisionDescription // Omschrijving soort garantievoorziening Result.addAll(vergelijk.VergelijkTupple(ReadXML.GetXMLvalue("bd-bedr:WarrantyProvisionDescription").toString(), LeesXLS.HaalText("A", 4, Tab, Locatie), LeesXLS.HaalText("A", 5, Tab, Locatie))); // WarrantyProvisionAllocationAmount // Dotatie garantievoorziening Result.addAll( vergelijk.VergelijkTupple(ReadXML.GetXMLvalue("bd-bedr:WarrantyProvisionAllocationAmount").toString(), LeesXLS.HaalData("B", 4, Tab, Locatie), LeesXLS.HaalData("B", 5, Tab, Locatie))); // WarrantyProvisionWithdrawal // Onttrekking garantievoorziening Result.addAll(vergelijk.VergelijkTupple(ReadXML.GetXMLvalue("bd-bedr:WarrantyProvisionWithdrawal").toString(), LeesXLS.HaalData("C", 4, Tab, Locatie), LeesXLS.HaalData("C", 5, Tab, Locatie))); // WarrantyProvisionFiscalAmount // Garantievoorziening fiscaal einde boekjaar Result.addAll(vergelijk.VergelijkTupple(ReadXML.GetXMLvalue("bd-bedr:WarrantyProvisionFiscalAmount").toString(), LeesXLS.HaalData("D", 4, Tab, Locatie), LeesXLS.HaalData("D", 5, Tab, Locatie))); } @When("^the elements of the XBRL and the XLS for Innovatiebox are compared$") public void the_elements_of_the_XBRL_and_the_XLS_for_Innovatiebox_are_compared() throws Throwable { // Write code here that turns the phrase above into concrete actions String Tab = "Innovatiebox"; String Locatie = "C:\\testdata\\TestdataTax.xlsx"; // InnovationBoxBusinessAssetsDescription // Activum in innovatiebox omschrijving Result.addAll(vergelijk.VergelijkTupple(ReadXML.GetXMLvalue("bd-bedr:InnovationBoxBusinessAssetsDescription").toString(), LeesXLS.HaalText("B", 2, Tab, Locatie), LeesXLS.HaalText("B", 2, Tab, Locatie))); // InnovationBoxBusinessAssetsProductionCosts // Activum in innovatiebox voortbrengingskosten Result.addAll(vergelijk.VergelijkTupple(ReadXML.GetXMLvalue("bd-bedr:InnovationBoxBusinessAssetsDescription").toString(), LeesXLS.HaalData("C", 2, Tab, Locatie), LeesXLS.HaalData("C",2, Tab, Locatie))); // InnovationBoxFlatRateArrangementExists // Innovatiebox forfaitaire regeling Result.addAll(vergelijk.VergelijkTupple(ReadXML.GetXMLvalue("bd-bedr:InnovationBoxFlatRateArrangementExists").toString(), LeesXLS.HaalText("D", 2, Tab, Locatie), LeesXLS.HaalText("D", 2, Tab, Locatie))); // InnovationBoxBalanceThresholdPreviousFinancialYear // Saldo drempel innovatiebox vorig boekjaar Result.addAll(vergelijk.VergelijkTupple(ReadXML.GetXMLvalue("bd-bedr:InnovationBoxBalanceThresholdPreviousFinancialYear").toString(), LeesXLS.HaalData("E", 2, Tab, Locatie), LeesXLS.HaalData("E", 2, Tab, Locatie))); // InnovationBoxProductionCostsTotal // Innovatiebox voortbrengingskosten totaal Result.addAll(vergelijk.VergelijkTupple(ReadXML.GetXMLvalue("bd-bedr:InnovationBoxProductionCostsTotal").toString(), LeesXLS.HaalData("F", 2, Tab, Locatie), LeesXLS.HaalData("F", 2, Tab, Locatie))); // InnovationBoxExploitationLoss // Innovatiebox exploitatieverliezen in dit boekjaar Result.addAll(vergelijk.VergelijkTupple(ReadXML.GetXMLvalue("bd-bedr:InnovationBoxExploitationLoss").toString(), LeesXLS.HaalData("G", 2, Tab, Locatie), LeesXLS.HaalData("G",2, Tab, Locatie))); // BenefitsForegoingYearGrantPatent // Voordelen genoten voorafgaand aan jaar octrooi verlening Result.addAll(vergelijk.VergelijkTupple(ReadXML.GetXMLvalue("bd-bedr:BenefitsForegoingYearGrantPatent").toString(), LeesXLS.HaalData("H", 2, Tab, Locatie), LeesXLS.HaalData("H", 2, Tab, Locatie))); // InnovationBoxThresholdTakenOverOccasionJoiningOrRemovalSubsidiary // Overgenomen drempel innovatiebox bij voeging en ontvoeging Result.addAll(vergelijk.VergelijkTupple(ReadXML.GetXMLvalue("bd-bedr:InnovationBoxThresholdTakenOverOccasionJoiningOrRemovalSubsidiary").toString(), LeesXLS.HaalData("I", 2, Tab, Locatie), LeesXLS.HaalData("I", 2, Tab, Locatie))); // InnovationBoxProductionCostsToOvertake // In te lopen voortbrengingskosten innovatiebox in dit boekjaar Result.addAll(vergelijk.VergelijkTupple(ReadXML.GetXMLvalue("bd-bedr:InnovationBoxProductionCostsToOvertake").toString(), LeesXLS.HaalData("J", 2, Tab, Locatie), LeesXLS.HaalData("J", 2, Tab, Locatie))); // InnovationBoxBenefitsLessThanThreshold // Genoten voordeel onder drempel innovatiebox Result.addAll(vergelijk.VergelijkTupple(ReadXML.GetXMLvalue("bd-bedr:InnovationBoxBenefitsLessThanThreshold").toString(), LeesXLS.HaalData("K", 2, Tab, Locatie), LeesXLS.HaalData("K", 2, Tab, Locatie))); // InnovationBoxBenefitsExceedingThreshold // Genoten voordeel boven drempel innovatiebox Result.addAll(vergelijk.VergelijkTupple(ReadXML.GetXMLvalue("bd-bedr:InnovationBoxBenefitsExceedingThreshold").toString(), LeesXLS.HaalData("L", 2, Tab, Locatie), LeesXLS.HaalData("L", 2, Tab, Locatie))); // InnovationBoxBalanceThresholdEndFinancialYear // Saldo in te lopen voortbrengingskosten einde boekjaar Result.addAll(vergelijk.VergelijkTupple(ReadXML.GetXMLvalue("bd-bedr:InnovationBoxBalanceThresholdEndFinancialYear").toString(), LeesXLS.HaalData("M", 2, Tab, Locatie), LeesXLS.HaalData("M", 2, Tab, Locatie))); } @When("^the elements of the XBRL and the XLS for objectvrijstelling are compared$") public void the_elements_of_the_XBRL_and_the_XLS_for_objectvrijstelling_are_compared() throws Throwable { // Write code here that turns the phrase above into concrete actions String Tab = "Objectvrijstelling"; String Locatie = "C:\\testdata\\TestdataTax.xlsx"; // CountryForeignCompany // Vestigingsland buitenlandse onderneming Result.addAll(vergelijk.VergelijkTupple(ReadXML.GetXMLvalue("bd-bedr:CountryForeignCompany").toString(), LeesXLS.HaalText("C", 2, Tab, Locatie), LeesXLS.HaalText("C", 3, Tab, Locatie))); // ForeignBusinessProfitEuroFunctionalCurrency // Buitenlandse ondernemingswinst in euro of functionele valuta Result.addAll(vergelijk.VergelijkTupple(ReadXML.GetXMLvalue("bd-bedr:ForeignBusinessProfitEuroFunctionalCurrency").toString(), LeesXLS.HaalData("D", 2, Tab, Locatie), LeesXLS.HaalData("D", 3, Tab, Locatie))); // LossBefore1January2012ToOvertake // In te halen verliezen uit jaren voor 1 januari 2012 Result.addAll(vergelijk.VergelijkTupple(ReadXML.GetXMLvalue("bd-bedr:LossBefore1January2012ToOvertake").toString(), LeesXLS.HaalData("E", 2, Tab, Locatie), LeesXLS.HaalData("E", 3, Tab, Locatie))); // LossCessationForeignCompany // Stakingsverlies buitenlandse onderneming Result.addAll(vergelijk.VergelijkTupple(ReadXML.GetXMLvalue("bd-bedr:LossCessationForeignCompany").toString(), LeesXLS.HaalData("F", 2, Tab, Locatie), LeesXLS.HaalData("F", 3, Tab, Locatie))); // ObjectExemptionForeignBusinessProfitPerCountry // Objectvrijstelling buitenl ondernemingswinst per land Result.addAll(vergelijk.VergelijkTupple(ReadXML.GetXMLvalue("bd-bedr:ObjectExemptionForeignBusinessProfitPerCountry").toString(), LeesXLS.HaalData("G", 2, Tab, Locatie), LeesXLS.HaalData("G", 3, Tab, Locatie))); // ForeignBusinessProfitBalanceCumulative // Cumulatief saldo buitenlandse ondernemingswinst Result.addAll(vergelijk.VergelijkTupple(ReadXML.GetXMLvalue("bd-bedr:ForeignBusinessProfitBalanceCumulative").toString(), LeesXLS.HaalData("D", 6, Tab, Locatie), LeesXLS.HaalData("D", 6, Tab, Locatie))); } @Then("^they contain the same values$") public void they_contain_the_same_values() throws Throwable { System.out.println(Result); assertTrue(Result.isEmpty()); } }
88,064
0.777467
0.767462
1,838
45.905331
35.703999
150
false
false
0
0
0
0
85
0.023657
2.72198
false
false
13
deba0b6f44519e9f4aad1cb7c9f2d62523b034a8
7,567,732,438,281
0c9317530cb8c3d9e9b1c9f34757a3b2841d8b9b
/java/com/ucsmy/mc/module/idx/service/IdxService.java
158e57ef0992cd91e8a49c3a6933cc634e073f96
[]
no_license
olgeer/mc
https://github.com/olgeer/mc
8ea337b7b7079ec8fff34c2fc5cad79be71c571d
b16ca8a8373e71e538992c4aa5756b7ad407d0b5
refs/heads/master
2020-12-11T08:48:10.603000
2020-01-14T10:06:41
2020-01-14T10:06:41
233,805,366
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
/* * Copyright (c) 2016 * 广东网金控股股份有限公司(http://www.ucsmy.com) * All rights reserved. */ package com.ucsmy.mc.module.idx.service; import java.util.List; import java.util.Map; import com.ucsmy.mc.common.entity.Department; import com.ucsmy.mc.common.entity.Mctype; /** * @ClassName: AdminDepartmentService * @Description: TODO 部门管理Service * @author: ucs_chenchengteng * @date: 2016年11月28日 下午2:53:00 * @version: V1.0 */ public interface IdxService { List<Map<String, Object>> getIdxList(Map<String, Object> map); List<Mctype> getMctypeList(Map<String, Object> map); void addIdx(Mctype mctype); Mctype getIdxById(String id); void updateIdx(Mctype mctype); int batchDeleteIdx(List<String> depaIds); // // /** // * @Description: 除了最低级的所有部门. // * @return // */ // List<Map<String, Object>> getDepartmentMenu(); // // /** // * @Description: 插入部门 // * @param department // * @return 影响行数 // */ // int addDepartment(Department department); // // /** // * @Description:更新部门. // * @param department // * @return 影响行数. // */ // int updateDepartment(Department department); // // /** // * @param depaId // * @return 获取部门实体. // */ // Department getDepartmentByDepaId(String depaId); // // /** // * 批量删除部门. // * @param depaIds // * @return 删除成功影响行数. // */ // int batchDeleteDepartment(List<String> depaIds); // // /** // * @return 顶级部门. // */ // Department getTopDepartment(); // // /** // * 递归查询获取根节点 // * @param depaId // * @return // */ // public Department getDepartmentRoot(String depaId); }
UTF-8
Java
1,708
java
IdxService.java
Java
[ { "context": "ice \n * @Description: TODO 部门管理Service\n * @author: ucs_chenchengteng\n * @date: 2016年11月28日 下午2:53:00\n * @version: V1.0", "end": 376, "score": 0.9996259808540344, "start": 359, "tag": "USERNAME", "value": "ucs_chenchengteng" } ]
null
[]
/* * Copyright (c) 2016 * 广东网金控股股份有限公司(http://www.ucsmy.com) * All rights reserved. */ package com.ucsmy.mc.module.idx.service; import java.util.List; import java.util.Map; import com.ucsmy.mc.common.entity.Department; import com.ucsmy.mc.common.entity.Mctype; /** * @ClassName: AdminDepartmentService * @Description: TODO 部门管理Service * @author: ucs_chenchengteng * @date: 2016年11月28日 下午2:53:00 * @version: V1.0 */ public interface IdxService { List<Map<String, Object>> getIdxList(Map<String, Object> map); List<Mctype> getMctypeList(Map<String, Object> map); void addIdx(Mctype mctype); Mctype getIdxById(String id); void updateIdx(Mctype mctype); int batchDeleteIdx(List<String> depaIds); // // /** // * @Description: 除了最低级的所有部门. // * @return // */ // List<Map<String, Object>> getDepartmentMenu(); // // /** // * @Description: 插入部门 // * @param department // * @return 影响行数 // */ // int addDepartment(Department department); // // /** // * @Description:更新部门. // * @param department // * @return 影响行数. // */ // int updateDepartment(Department department); // // /** // * @param depaId // * @return 获取部门实体. // */ // Department getDepartmentByDepaId(String depaId); // // /** // * 批量删除部门. // * @param depaIds // * @return 删除成功影响行数. // */ // int batchDeleteDepartment(List<String> depaIds); // // /** // * @return 顶级部门. // */ // Department getTopDepartment(); // // /** // * 递归查询获取根节点 // * @param depaId // * @return // */ // public Department getDepartmentRoot(String depaId); }
1,708
0.640181
0.627907
82
17.878048
16.699198
63
false
false
0
0
0
0
0
0
0.829268
false
false
13
e8d2808c393fca12063cd5d8b120daa6bc62a9b6
4,432,406,297,466
abeb5695a9bc51ffeae87e96a91b7ef5f5976a50
/Hms/src/main/java/com/example/demo/model/Rooms.java
29e48541fa93cefd78d81d970d85dd4e92824f33
[]
no_license
Bhupander-chauhan/Hms-project
https://github.com/Bhupander-chauhan/Hms-project
40442437ebce23dba4648d91ca9c0cffd849ff7d
287aa73bb56bc9e1f8ad3afcd9e5a0dc2c8689cb
refs/heads/main
2023-04-05T11:51:58.864000
2021-04-26T13:54:07
2021-04-26T13:54:07
361,768,503
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.example.demo.model; import org.springframework.data.annotation.Id; import org.springframework.data.mongodb.core.mapping.Document; import lombok.Getter; import lombok.Setter; import lombok.ToString; @Getter @Setter @ToString @Document(collection="Rooms") public class Rooms { @Id public int getId() { return id; } public void setId(int id) { this.id = id; } public int getRoomNumber() { return RoomNumber; } public void setRoomNumber(int roomNumber) { RoomNumber = roomNumber; } public String getType() { return type; } public void setType(String type) { this.type = type; } public String getBedtype() { return bedtype; } public void setBedtype(String bedtype) { this.bedtype = bedtype; } public String getStatus() { return Status; } public void setStatus(String status) { Status = status; } private int id; private int RoomNumber; private String type; private String bedtype; private String Status; }
UTF-8
Java
1,031
java
Rooms.java
Java
[]
null
[]
package com.example.demo.model; import org.springframework.data.annotation.Id; import org.springframework.data.mongodb.core.mapping.Document; import lombok.Getter; import lombok.Setter; import lombok.ToString; @Getter @Setter @ToString @Document(collection="Rooms") public class Rooms { @Id public int getId() { return id; } public void setId(int id) { this.id = id; } public int getRoomNumber() { return RoomNumber; } public void setRoomNumber(int roomNumber) { RoomNumber = roomNumber; } public String getType() { return type; } public void setType(String type) { this.type = type; } public String getBedtype() { return bedtype; } public void setBedtype(String bedtype) { this.bedtype = bedtype; } public String getStatus() { return Status; } public void setStatus(String status) { Status = status; } private int id; private int RoomNumber; private String type; private String bedtype; private String Status; }
1,031
0.677983
0.677983
58
15.775862
14.373158
62
false
false
0
0
0
0
0
0
1.224138
false
false
13
ef8f35366dd20403ee5ed54f9182532872e6a59a
575,525,682,978
52ac05a8afba55254481b671743ed899ecc2cb42
/app/src/main/java/com/newitventure/hoteltv/mainactivity/MainActivity.java
6a7595c9bc3f0587f9f5e3cd4cf51ca7e90d7d2e
[]
no_license
DEV-NEP/HotelTV
https://github.com/DEV-NEP/HotelTV
a589b27c385a700e51ed336c69ee1841bbc9e512
e13ebba90a786cb6b0b7398fe30d5e08b10415e8
refs/heads/master
2021-05-05T23:09:55.146000
2018-01-12T12:25:48
2018-01-12T12:25:48
116,629,457
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.newitventure.hoteltv.mainactivity; import android.annotation.SuppressLint; import android.app.Activity; import android.content.Context; import android.content.Intent; import android.net.Uri; import android.os.AsyncTask; import android.os.Bundle; import android.provider.Settings; import android.support.design.widget.TabLayout; import android.support.v7.view.ContextThemeWrapper; import android.support.v7.view.menu.MenuBuilder; import android.support.v7.view.menu.MenuPopupHelper; import android.support.v7.widget.PopupMenu; import android.text.format.DateUtils; import android.util.Log; import android.view.Gravity; import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.view.WindowManager; import android.widget.Button; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.ListView; import android.widget.ProgressBar; import android.widget.RelativeLayout; import android.widget.TextView; import android.widget.Toast; import com.facebook.AccessToken; import com.facebook.AccessTokenTracker; import com.facebook.CallbackManager; import com.facebook.FacebookCallback; import com.facebook.FacebookException; import com.facebook.Profile; import com.facebook.ProfileTracker; import com.facebook.login.LoginManager; import com.facebook.login.LoginResult; import com.facebook.login.widget.LoginButton; import com.newitventure.hoteltv.R; import com.newitventure.hoteltv.facebook.FbParser; import com.newitventure.hoteltv.utils.GetData; import com.newitventure.hoteltv.utils.HttpHandler; import org.json.JSONObject; import java.lang.reflect.Field; import butterknife.BindView; import butterknife.ButterKnife; public class MainActivity extends Activity implements MainApiInterface.MainDataView { final static String TAG = MainActivity.class.getSimpleName(); String access_token, profileName; @BindView(R.id.refreshBtn) ImageView refreshBtn; TextView text, fbUserName, text2, text3, language; ImageView flag, alarm, mail, setting; ListView listView; ProgressBar progressBar, refreshProgress; Toast toast; RelativeLayout wholeLayout; Button logoutButton; int count = 0; MainDataPresImpl mainDataPres; private CallbackManager callbackManager; private AccessTokenTracker tokenTracker; private ProfileTracker profileTracker; LoginButton loginButton; boolean isLoggedIn, isNewLogin; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); setContentView(R.layout.activity_main); ButterKnife.bind(this); loginButton = findViewById(R.id.login_button); logoutButton = findViewById(R.id.logoutBtn); if (!isLoggedIn){ logoutButton.setVisibility(View.GONE); } loginButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Log.d(TAG, "onClick: login"); login(); } }); callbackManager = CallbackManager.Factory.create(); logoutButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { LoginManager.getInstance().logOut(); // AccessToken.setCurrentAccessToken(null); isLoggedIn = false; logoutButton.setVisibility(View.GONE); listView.setVisibility(View.GONE); loginButton.setVisibility(View.VISIBLE); fbUserName.setText("Welcome,"); // Intent logout = new Intent(MainActivity.this, MainActivity.class); // startActivity(logout); } }); final View view0 = getLayoutInflater().inflate(R.layout.toast_activity, null); toast = new Toast(getApplicationContext()); toast.setDuration(Toast.LENGTH_SHORT); toast.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.BOTTOM, 0, 50); toast.setView(view0); text = (TextView) view0.findViewById(R.id.toast_txt); alarm = (ImageView) findViewById(R.id.alarm); alarm.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { text.setText("Alarm Clicked!"); toast.show(); } }); mail = (ImageView) findViewById(R.id.mail); mail.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { text.setText("Mail Clicked!"); toast.show(); } }); setting = findViewById(R.id.setting); setting.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Intent intent = new Intent(Settings.ACTION_SETTINGS); startActivity(intent); } }); listView = findViewById(R.id.list); progressBar = findViewById(R.id.progress_bar1); refreshProgress = findViewById(R.id.refreshProgress); fbUserName = findViewById(R.id.profileName); language = findViewById(R.id.language); flag = findViewById(R.id.flag); text2 = findViewById(R.id.text2); text2.setText(DateUtils.formatDateTime(getApplicationContext(), System.currentTimeMillis(), DateUtils.FORMAT_ABBREV_ALL)); text3 = findViewById(R.id.text3); text3.setText((DateUtils.formatDateTime(getApplicationContext(), System.currentTimeMillis(), DateUtils.FORMAT_SHOW_WEEKDAY)) + ", "); wholeLayout = findViewById(R.id.whole_layout); final int[] background_images = {R.drawable.bg_0, R.drawable.bg, R.drawable.bg_2}; // Runnable r = new Runnable(){ // int i = 0; // public void run(){ // wholeLayout.setBackgroundResource(background_images[i]); // i++; // if(i > background_images.length -1){ // i = 0; // } // wholeLayout.postDelayed(this, 3000); //set to go off again in 3 seconds. // } // }; // wholeLayout.postDelayed(r,3000); new ChangeBackGround(background_images).start(); //to add more items to tablayout add here: int[] arr_drawable = {R.drawable.hotel_tv, R.drawable.room_service, R.drawable.travel_guide, R.drawable.call_taxi, R.drawable.my_bill, R.drawable.youtube, R.drawable.netflix, R.drawable.abema_tv, R.drawable.hulu, R.drawable.about_hotel, R.drawable.translate}; String[] tabName = {"HOTEL TV", "ROOM SERVICE", "TRAVEL GUIDE", "CALL TAXI", "MY BILL", "YOUTUBE", "NETFLIX", "ABEMA TV", "HULU", "ABOUT HOTEL", "TRANSLATE"}; TabLayout tabLayout = findViewById(R.id.tabs); int hei = getResources().getDisplayMetrics().heightPixels / 5; RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) tabLayout.getLayoutParams(); params.height = hei; tabLayout.setLayoutParams(params); for (int i = 0; i < tabName.length; i++) { View view = getLayoutInflater().inflate(R.layout.custom_tab, null); ImageView imageView = view.findViewById(R.id.pics); imageView.getLayoutParams().width = (int) (getResources().getDisplayMetrics().widthPixels / 6); imageView.setImageResource(arr_drawable[i]); TextView tabTitle = view.findViewById(R.id.txt); tabTitle.setText(tabName[i]); // tabLayout.getTabAt(i).setText(tabName[i]); // tabLayout.getTabAt(i).setIcon(arr_drawable[i]); tabLayout.addTab(tabLayout.newTab().setCustomView(view)); } RelativeLayout layoutFeed = findViewById(R.id.list_view); params = (RelativeLayout.LayoutParams) layoutFeed.getLayoutParams(); params.height = (int) (getResources().getDisplayMetrics().heightPixels / 2.2); layoutFeed.setLayoutParams(params); refreshBtn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { // mainDataPres = new MainDataPresImpl(this); // mainDataPres.getFBData(); refreshBtn.setVisibility(View.GONE); new GetPageID().execute(); } }); final LinearLayout linearLayout = findViewById(R.id.linearLayout); linearLayout.setClickable(true); linearLayout.setOnClickListener(new View.OnClickListener() { @SuppressLint("RestrictedApi") @Override public void onClick(View view) { switch (view.getId()) { case R.id.language: case R.id.flag: case R.id.linearLayout: @SuppressLint("RestrictedApi") Context context = new ContextThemeWrapper(MainActivity.this, R.style.CustomPopupTheme); PopupMenu popupMenu = new PopupMenu(context, linearLayout); popupMenu.getMenuInflater().inflate(R.menu.popup_menu, popupMenu.getMenu()); try { Field mFieldPopup=popupMenu.getClass().getDeclaredField("mPopup"); mFieldPopup.setAccessible(true); MenuPopupHelper mPopup = (MenuPopupHelper) mFieldPopup.get(popupMenu); mPopup.setForceShowIcon(true); } catch (Exception e) { e.printStackTrace(); } popupMenu.show(); popupMenu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() { @Override public boolean onMenuItemClick(MenuItem item) { switch (item.getItemId()) { case R.id.chinese: language.setText("CH"); flag.setImageResource(R.drawable.flag_china); flag.setScaleY((float) 1.4); return true; case R.id.english: language.setText("EN"); flag.setImageResource(R.drawable.flag_uk); flag.setScaleY(1); return true; case R.id.german: language.setText("GR"); flag.setImageResource(R.drawable.flag_germany); flag.setScaleY((float) 1.4); return true; case R.id.japanese: language.setText("JP"); flag.setImageResource(R.drawable.flag_japan); flag.setScaleY((float) 1.4); return true; case R.id.korean: language.setText("KR"); flag.setImageResource(R.drawable.flag_korea); flag.setScaleY((float) 1.4); return true; default: return false; } } }); } } }); tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() { @Override public void onTabSelected(TabLayout.Tab tab) { Log.d(TAG, "onTabSelected: " + tab.getPosition()); View view = tab.getCustomView(); TextView tabTitle = view.findViewById(R.id.txt); tabTitle.setTextColor(getResources().getColor(R.color.white)); switch (tab.getPosition()) { case 0: startAppActivity("com.worldtvgo"); break; case 1: break; case 2: break; case 3: break; case 4: break; case 5: startAppActivity("com.google.android.youtube"); break; case 6: startAppActivity("com.netflix.mediaclient"); break; case 7: startAppActivity("tv.abema"); break; case 8: startAppActivity("com.hulu.plus"); break; case 9: Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://www.apahotel.com/ja_en/about/")); startActivity(browserIntent); break; case 10: startAppActivity("com.google.android.apps.translate"); break; default: } } @Override public void onTabUnselected(TabLayout.Tab tab) { Log.d(TAG, "onTabUnselected: "); View view = tab.getCustomView(); TextView tabTitle = view.findViewById(R.id.txt); tabTitle.setTextColor(getResources().getColor(R.color.textColor)); } @Override public void onTabReselected(TabLayout.Tab tab) { Log.d(TAG, "onTabReselected: "); switch (tab.getPosition()) { case 0: startAppActivity("com.worldtvgo"); break; case 1: break; case 2: break; case 3: break; case 4: break; case 5: startAppActivity("com.google.android.youtube"); break; case 6: startAppActivity("com.netflix.mediaclient"); break; case 7: startAppActivity("tv.abema"); break; case 8: startAppActivity("com.hulu.plus"); break; case 9: Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://www.apahotel.com/ja_en/about/")); startActivity(browserIntent); break; case 10: startAppActivity("com.google.android.apps.translate"); break; default: } } }); // if(listAdapter.getCount()>2){ // View item = listAdapter.getView(0,null,listView); // item.measure(0,0); // RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, (3 * item.getMeasuredHeight())); // listView.setLayoutParams(params); // } } private void login() { Log.d(TAG, "login: "); tokenTracker = new AccessTokenTracker() { @Override protected void onCurrentAccessTokenChanged(AccessToken oldToken, AccessToken newToken) { if (newToken != null && Profile.getCurrentProfile() != null) { profileName = Profile.getCurrentProfile().getFirstName(); access_token = newToken.getToken(); } } }; tokenTracker.startTracking(); profileTracker = new ProfileTracker() { @Override protected void onCurrentProfileChanged(Profile oldProfile, Profile newProfile) { Log.d(TAG, "onCurrentProfileChanged: NewProfile: " + newProfile); Log.d(TAG, "onCurrentProfileChanged: OldProfile: " + oldProfile); this.stopTracking(); Profile.setCurrentProfile(newProfile); profileName = newProfile.getFirstName(); Log.d(TAG, "onCurrentProfileChanged: ===> "+profileName); access_token = AccessToken.getCurrentAccessToken().getToken(); fbUserName.setText("Welcome " + newProfile.getFirstName().toUpperCase() + ","); } }; profileTracker.startTracking(); loginButton.setReadPermissions("email"); loginButton.registerCallback(callbackManager, new FacebookCallback<LoginResult>() { @Override public void onSuccess(LoginResult loginResult) { Log.d(TAG, "onSuccess: "); isLoggedIn = true; loginButton.setVisibility(View.GONE); logoutButton.setVisibility(View.VISIBLE); final AccessToken accessToken = loginResult.getAccessToken(); Log.d(TAG, "onSuccess: accessToken: " + accessToken.getToken()); final Profile profile = Profile.getCurrentProfile(); Log.d(TAG, "onSuccess: Profile: " + profile); /*At first login, profile returns "null" and app crashes. So this is handled by following if-else statement*/ if (profile == null) { Log.d(TAG, "onSuccess: profilr null"); profileTracker = new ProfileTracker() { @Override protected void onCurrentProfileChanged(Profile oldProfile, Profile newProfile) { this.stopTracking(); Profile.setCurrentProfile(newProfile); profileName = newProfile.getFirstName(); access_token = accessToken.getToken(); fbUserName.setText("Welcome " + profileName.toUpperCase() + ","); } }; profileTracker.startTracking(); } else { profileName = profile.getFirstName(); access_token = accessToken.getToken(); } Log.d(TAG, "onSuccess: ======>"+profileName); fbUserName.setText("Welcome " + profileName.toUpperCase() + ","); // mainDataPres = new MainDataPresImpl(this); // mainDataPres.getFBData(); new GetPageID().execute(); progressBar.setVisibility(View.VISIBLE); listView.setVisibility(View.VISIBLE); } @Override public void onCancel() { Log.d(TAG, "onCancel: "); } @Override public void onError(FacebookException exception) { exception.printStackTrace(); Log.e(TAG, "onError: Cannot Login to Facebook"); } }); } @Override public void onGettingFBData(GetData getData) { Log.d(TAG, "onGettingFBData: "); String id = getData.getId(); FbParser fbParser = new FbParser(getApplicationContext(), listView, id, progressBar, access_token, toast, text); fbParser.jsonParser(); } @Override public void onNotGettingFBData(String errMsg) { } public class GetPageID extends AsyncTask<Void, Void, Void> { String url = "http://worldondemand.net/app/json_v5/binay.php"; String id; @Override protected void onPreExecute() { super.onPreExecute(); progressBar.setVisibility(View.VISIBLE); if (refreshBtn.getVisibility() == View.GONE) { refreshProgress.setVisibility(View.VISIBLE); } } @Override protected Void doInBackground(Void... voids) { HttpHandler httpHandler = new HttpHandler(); String jsonStr = httpHandler.makeServiceCall(url); Log.d(TAG, "preparePage: Response from url: " + jsonStr); try { JSONObject jsonObject = new JSONObject(jsonStr); // String pageName = jsonObject.getString("page"); id = jsonObject.getString("id"); } catch (Exception e) { e.printStackTrace(); } return null; } @Override protected void onPostExecute(Void aVoid) { super.onPostExecute(aVoid); refreshProgress.setVisibility(View.GONE); refreshBtn.setVisibility(View.VISIBLE); FbParser fbParser = new FbParser(getApplicationContext(), listView, id, progressBar, access_token, toast, text); fbParser.jsonParser(); } } public void startAppActivity(String packageName) { Intent intent = getPackageManager().getLaunchIntentForPackage(packageName); if (intent == null) { // Redirect user to the play store or let them choose an app? intent = new Intent(Intent.ACTION_VIEW); intent.setData(Uri.parse("market://details?id=" + packageName)); } intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(intent); } @Override public void onBackPressed() { if (count == 1) { toast.cancel(); count = 0; finishAffinity(); } else { text.setText("Press Back again to Exit"); toast.show(); count++; } return; } class ChangeBackGround extends Thread { int[] imgList; int i = 0; ChangeBackGround(int[] imgList) { this.imgList = imgList; } @Override public void run() { super.run(); while (true) { Log.d(TAG, "run: " + (imgList.length - 1) + "/t" + i); runOnUiThread(new Runnable() { @Override public void run() { wholeLayout.setBackgroundDrawable(getResources().getDrawable(imgList[i])); } } ); i++; if (i >= imgList.length - 1) i = 0; try { sleep(8000); } catch (InterruptedException e) { e.printStackTrace(); } } } } @Override protected void onActivityResult(int requestCode, int resultCode, Intent intent) { super.onActivityResult(requestCode, resultCode, intent); callbackManager.onActivityResult(requestCode, resultCode, intent); } @Override protected void onResume() { super.onResume(); Log.d(TAG, "onResume: isLogin" +isLoggedIn); //Facebook login Profile profile = Profile.getCurrentProfile(); Log.d(TAG, "onResume: profile=== "+profile); AccessToken accessToken = AccessToken.getCurrentAccessToken(); Log.d(TAG, "onResume: token=== "+accessToken); if (profile != null || accessToken != null) { if (profile != null){ Log.d(TAG, "onResume: already logged in "+profile.getFirstName()); profileName = profile.getFirstName(); fbUserName.setText("Welcome " + profileName.toUpperCase() + ","); } if (!isLoggedIn) { new GetPageID().execute(); } loginButton.setVisibility(View.GONE); listView.setVisibility(View.VISIBLE); logoutButton.setVisibility(View.VISIBLE); isLoggedIn = true; access_token = accessToken.getToken(); } } @Override protected void onPause() { Log.d(TAG, "onPause:"); super.onPause(); } protected void onStop() { super.onStop(); Log.d(TAG, "onStop: "); //Facebook login // tokenTracker.stopTracking(); // profileTracker.stopTracking(); } }
UTF-8
Java
25,059
java
MainActivity.java
Java
[ { "context": "iew.VISIBLE);\n fbUserName.setText(\"Welcome,\");\n\n// Intent logout = new Intent", "end": 3806, "score": 0.9835752248764038, "start": 3799, "tag": "NAME", "value": "Welcome" } ]
null
[]
package com.newitventure.hoteltv.mainactivity; import android.annotation.SuppressLint; import android.app.Activity; import android.content.Context; import android.content.Intent; import android.net.Uri; import android.os.AsyncTask; import android.os.Bundle; import android.provider.Settings; import android.support.design.widget.TabLayout; import android.support.v7.view.ContextThemeWrapper; import android.support.v7.view.menu.MenuBuilder; import android.support.v7.view.menu.MenuPopupHelper; import android.support.v7.widget.PopupMenu; import android.text.format.DateUtils; import android.util.Log; import android.view.Gravity; import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.view.WindowManager; import android.widget.Button; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.ListView; import android.widget.ProgressBar; import android.widget.RelativeLayout; import android.widget.TextView; import android.widget.Toast; import com.facebook.AccessToken; import com.facebook.AccessTokenTracker; import com.facebook.CallbackManager; import com.facebook.FacebookCallback; import com.facebook.FacebookException; import com.facebook.Profile; import com.facebook.ProfileTracker; import com.facebook.login.LoginManager; import com.facebook.login.LoginResult; import com.facebook.login.widget.LoginButton; import com.newitventure.hoteltv.R; import com.newitventure.hoteltv.facebook.FbParser; import com.newitventure.hoteltv.utils.GetData; import com.newitventure.hoteltv.utils.HttpHandler; import org.json.JSONObject; import java.lang.reflect.Field; import butterknife.BindView; import butterknife.ButterKnife; public class MainActivity extends Activity implements MainApiInterface.MainDataView { final static String TAG = MainActivity.class.getSimpleName(); String access_token, profileName; @BindView(R.id.refreshBtn) ImageView refreshBtn; TextView text, fbUserName, text2, text3, language; ImageView flag, alarm, mail, setting; ListView listView; ProgressBar progressBar, refreshProgress; Toast toast; RelativeLayout wholeLayout; Button logoutButton; int count = 0; MainDataPresImpl mainDataPres; private CallbackManager callbackManager; private AccessTokenTracker tokenTracker; private ProfileTracker profileTracker; LoginButton loginButton; boolean isLoggedIn, isNewLogin; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); setContentView(R.layout.activity_main); ButterKnife.bind(this); loginButton = findViewById(R.id.login_button); logoutButton = findViewById(R.id.logoutBtn); if (!isLoggedIn){ logoutButton.setVisibility(View.GONE); } loginButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Log.d(TAG, "onClick: login"); login(); } }); callbackManager = CallbackManager.Factory.create(); logoutButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { LoginManager.getInstance().logOut(); // AccessToken.setCurrentAccessToken(null); isLoggedIn = false; logoutButton.setVisibility(View.GONE); listView.setVisibility(View.GONE); loginButton.setVisibility(View.VISIBLE); fbUserName.setText("Welcome,"); // Intent logout = new Intent(MainActivity.this, MainActivity.class); // startActivity(logout); } }); final View view0 = getLayoutInflater().inflate(R.layout.toast_activity, null); toast = new Toast(getApplicationContext()); toast.setDuration(Toast.LENGTH_SHORT); toast.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.BOTTOM, 0, 50); toast.setView(view0); text = (TextView) view0.findViewById(R.id.toast_txt); alarm = (ImageView) findViewById(R.id.alarm); alarm.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { text.setText("Alarm Clicked!"); toast.show(); } }); mail = (ImageView) findViewById(R.id.mail); mail.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { text.setText("Mail Clicked!"); toast.show(); } }); setting = findViewById(R.id.setting); setting.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Intent intent = new Intent(Settings.ACTION_SETTINGS); startActivity(intent); } }); listView = findViewById(R.id.list); progressBar = findViewById(R.id.progress_bar1); refreshProgress = findViewById(R.id.refreshProgress); fbUserName = findViewById(R.id.profileName); language = findViewById(R.id.language); flag = findViewById(R.id.flag); text2 = findViewById(R.id.text2); text2.setText(DateUtils.formatDateTime(getApplicationContext(), System.currentTimeMillis(), DateUtils.FORMAT_ABBREV_ALL)); text3 = findViewById(R.id.text3); text3.setText((DateUtils.formatDateTime(getApplicationContext(), System.currentTimeMillis(), DateUtils.FORMAT_SHOW_WEEKDAY)) + ", "); wholeLayout = findViewById(R.id.whole_layout); final int[] background_images = {R.drawable.bg_0, R.drawable.bg, R.drawable.bg_2}; // Runnable r = new Runnable(){ // int i = 0; // public void run(){ // wholeLayout.setBackgroundResource(background_images[i]); // i++; // if(i > background_images.length -1){ // i = 0; // } // wholeLayout.postDelayed(this, 3000); //set to go off again in 3 seconds. // } // }; // wholeLayout.postDelayed(r,3000); new ChangeBackGround(background_images).start(); //to add more items to tablayout add here: int[] arr_drawable = {R.drawable.hotel_tv, R.drawable.room_service, R.drawable.travel_guide, R.drawable.call_taxi, R.drawable.my_bill, R.drawable.youtube, R.drawable.netflix, R.drawable.abema_tv, R.drawable.hulu, R.drawable.about_hotel, R.drawable.translate}; String[] tabName = {"HOTEL TV", "ROOM SERVICE", "TRAVEL GUIDE", "CALL TAXI", "MY BILL", "YOUTUBE", "NETFLIX", "ABEMA TV", "HULU", "ABOUT HOTEL", "TRANSLATE"}; TabLayout tabLayout = findViewById(R.id.tabs); int hei = getResources().getDisplayMetrics().heightPixels / 5; RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) tabLayout.getLayoutParams(); params.height = hei; tabLayout.setLayoutParams(params); for (int i = 0; i < tabName.length; i++) { View view = getLayoutInflater().inflate(R.layout.custom_tab, null); ImageView imageView = view.findViewById(R.id.pics); imageView.getLayoutParams().width = (int) (getResources().getDisplayMetrics().widthPixels / 6); imageView.setImageResource(arr_drawable[i]); TextView tabTitle = view.findViewById(R.id.txt); tabTitle.setText(tabName[i]); // tabLayout.getTabAt(i).setText(tabName[i]); // tabLayout.getTabAt(i).setIcon(arr_drawable[i]); tabLayout.addTab(tabLayout.newTab().setCustomView(view)); } RelativeLayout layoutFeed = findViewById(R.id.list_view); params = (RelativeLayout.LayoutParams) layoutFeed.getLayoutParams(); params.height = (int) (getResources().getDisplayMetrics().heightPixels / 2.2); layoutFeed.setLayoutParams(params); refreshBtn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { // mainDataPres = new MainDataPresImpl(this); // mainDataPres.getFBData(); refreshBtn.setVisibility(View.GONE); new GetPageID().execute(); } }); final LinearLayout linearLayout = findViewById(R.id.linearLayout); linearLayout.setClickable(true); linearLayout.setOnClickListener(new View.OnClickListener() { @SuppressLint("RestrictedApi") @Override public void onClick(View view) { switch (view.getId()) { case R.id.language: case R.id.flag: case R.id.linearLayout: @SuppressLint("RestrictedApi") Context context = new ContextThemeWrapper(MainActivity.this, R.style.CustomPopupTheme); PopupMenu popupMenu = new PopupMenu(context, linearLayout); popupMenu.getMenuInflater().inflate(R.menu.popup_menu, popupMenu.getMenu()); try { Field mFieldPopup=popupMenu.getClass().getDeclaredField("mPopup"); mFieldPopup.setAccessible(true); MenuPopupHelper mPopup = (MenuPopupHelper) mFieldPopup.get(popupMenu); mPopup.setForceShowIcon(true); } catch (Exception e) { e.printStackTrace(); } popupMenu.show(); popupMenu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() { @Override public boolean onMenuItemClick(MenuItem item) { switch (item.getItemId()) { case R.id.chinese: language.setText("CH"); flag.setImageResource(R.drawable.flag_china); flag.setScaleY((float) 1.4); return true; case R.id.english: language.setText("EN"); flag.setImageResource(R.drawable.flag_uk); flag.setScaleY(1); return true; case R.id.german: language.setText("GR"); flag.setImageResource(R.drawable.flag_germany); flag.setScaleY((float) 1.4); return true; case R.id.japanese: language.setText("JP"); flag.setImageResource(R.drawable.flag_japan); flag.setScaleY((float) 1.4); return true; case R.id.korean: language.setText("KR"); flag.setImageResource(R.drawable.flag_korea); flag.setScaleY((float) 1.4); return true; default: return false; } } }); } } }); tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() { @Override public void onTabSelected(TabLayout.Tab tab) { Log.d(TAG, "onTabSelected: " + tab.getPosition()); View view = tab.getCustomView(); TextView tabTitle = view.findViewById(R.id.txt); tabTitle.setTextColor(getResources().getColor(R.color.white)); switch (tab.getPosition()) { case 0: startAppActivity("com.worldtvgo"); break; case 1: break; case 2: break; case 3: break; case 4: break; case 5: startAppActivity("com.google.android.youtube"); break; case 6: startAppActivity("com.netflix.mediaclient"); break; case 7: startAppActivity("tv.abema"); break; case 8: startAppActivity("com.hulu.plus"); break; case 9: Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://www.apahotel.com/ja_en/about/")); startActivity(browserIntent); break; case 10: startAppActivity("com.google.android.apps.translate"); break; default: } } @Override public void onTabUnselected(TabLayout.Tab tab) { Log.d(TAG, "onTabUnselected: "); View view = tab.getCustomView(); TextView tabTitle = view.findViewById(R.id.txt); tabTitle.setTextColor(getResources().getColor(R.color.textColor)); } @Override public void onTabReselected(TabLayout.Tab tab) { Log.d(TAG, "onTabReselected: "); switch (tab.getPosition()) { case 0: startAppActivity("com.worldtvgo"); break; case 1: break; case 2: break; case 3: break; case 4: break; case 5: startAppActivity("com.google.android.youtube"); break; case 6: startAppActivity("com.netflix.mediaclient"); break; case 7: startAppActivity("tv.abema"); break; case 8: startAppActivity("com.hulu.plus"); break; case 9: Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://www.apahotel.com/ja_en/about/")); startActivity(browserIntent); break; case 10: startAppActivity("com.google.android.apps.translate"); break; default: } } }); // if(listAdapter.getCount()>2){ // View item = listAdapter.getView(0,null,listView); // item.measure(0,0); // RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, (3 * item.getMeasuredHeight())); // listView.setLayoutParams(params); // } } private void login() { Log.d(TAG, "login: "); tokenTracker = new AccessTokenTracker() { @Override protected void onCurrentAccessTokenChanged(AccessToken oldToken, AccessToken newToken) { if (newToken != null && Profile.getCurrentProfile() != null) { profileName = Profile.getCurrentProfile().getFirstName(); access_token = newToken.getToken(); } } }; tokenTracker.startTracking(); profileTracker = new ProfileTracker() { @Override protected void onCurrentProfileChanged(Profile oldProfile, Profile newProfile) { Log.d(TAG, "onCurrentProfileChanged: NewProfile: " + newProfile); Log.d(TAG, "onCurrentProfileChanged: OldProfile: " + oldProfile); this.stopTracking(); Profile.setCurrentProfile(newProfile); profileName = newProfile.getFirstName(); Log.d(TAG, "onCurrentProfileChanged: ===> "+profileName); access_token = AccessToken.getCurrentAccessToken().getToken(); fbUserName.setText("Welcome " + newProfile.getFirstName().toUpperCase() + ","); } }; profileTracker.startTracking(); loginButton.setReadPermissions("email"); loginButton.registerCallback(callbackManager, new FacebookCallback<LoginResult>() { @Override public void onSuccess(LoginResult loginResult) { Log.d(TAG, "onSuccess: "); isLoggedIn = true; loginButton.setVisibility(View.GONE); logoutButton.setVisibility(View.VISIBLE); final AccessToken accessToken = loginResult.getAccessToken(); Log.d(TAG, "onSuccess: accessToken: " + accessToken.getToken()); final Profile profile = Profile.getCurrentProfile(); Log.d(TAG, "onSuccess: Profile: " + profile); /*At first login, profile returns "null" and app crashes. So this is handled by following if-else statement*/ if (profile == null) { Log.d(TAG, "onSuccess: profilr null"); profileTracker = new ProfileTracker() { @Override protected void onCurrentProfileChanged(Profile oldProfile, Profile newProfile) { this.stopTracking(); Profile.setCurrentProfile(newProfile); profileName = newProfile.getFirstName(); access_token = accessToken.getToken(); fbUserName.setText("Welcome " + profileName.toUpperCase() + ","); } }; profileTracker.startTracking(); } else { profileName = profile.getFirstName(); access_token = accessToken.getToken(); } Log.d(TAG, "onSuccess: ======>"+profileName); fbUserName.setText("Welcome " + profileName.toUpperCase() + ","); // mainDataPres = new MainDataPresImpl(this); // mainDataPres.getFBData(); new GetPageID().execute(); progressBar.setVisibility(View.VISIBLE); listView.setVisibility(View.VISIBLE); } @Override public void onCancel() { Log.d(TAG, "onCancel: "); } @Override public void onError(FacebookException exception) { exception.printStackTrace(); Log.e(TAG, "onError: Cannot Login to Facebook"); } }); } @Override public void onGettingFBData(GetData getData) { Log.d(TAG, "onGettingFBData: "); String id = getData.getId(); FbParser fbParser = new FbParser(getApplicationContext(), listView, id, progressBar, access_token, toast, text); fbParser.jsonParser(); } @Override public void onNotGettingFBData(String errMsg) { } public class GetPageID extends AsyncTask<Void, Void, Void> { String url = "http://worldondemand.net/app/json_v5/binay.php"; String id; @Override protected void onPreExecute() { super.onPreExecute(); progressBar.setVisibility(View.VISIBLE); if (refreshBtn.getVisibility() == View.GONE) { refreshProgress.setVisibility(View.VISIBLE); } } @Override protected Void doInBackground(Void... voids) { HttpHandler httpHandler = new HttpHandler(); String jsonStr = httpHandler.makeServiceCall(url); Log.d(TAG, "preparePage: Response from url: " + jsonStr); try { JSONObject jsonObject = new JSONObject(jsonStr); // String pageName = jsonObject.getString("page"); id = jsonObject.getString("id"); } catch (Exception e) { e.printStackTrace(); } return null; } @Override protected void onPostExecute(Void aVoid) { super.onPostExecute(aVoid); refreshProgress.setVisibility(View.GONE); refreshBtn.setVisibility(View.VISIBLE); FbParser fbParser = new FbParser(getApplicationContext(), listView, id, progressBar, access_token, toast, text); fbParser.jsonParser(); } } public void startAppActivity(String packageName) { Intent intent = getPackageManager().getLaunchIntentForPackage(packageName); if (intent == null) { // Redirect user to the play store or let them choose an app? intent = new Intent(Intent.ACTION_VIEW); intent.setData(Uri.parse("market://details?id=" + packageName)); } intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(intent); } @Override public void onBackPressed() { if (count == 1) { toast.cancel(); count = 0; finishAffinity(); } else { text.setText("Press Back again to Exit"); toast.show(); count++; } return; } class ChangeBackGround extends Thread { int[] imgList; int i = 0; ChangeBackGround(int[] imgList) { this.imgList = imgList; } @Override public void run() { super.run(); while (true) { Log.d(TAG, "run: " + (imgList.length - 1) + "/t" + i); runOnUiThread(new Runnable() { @Override public void run() { wholeLayout.setBackgroundDrawable(getResources().getDrawable(imgList[i])); } } ); i++; if (i >= imgList.length - 1) i = 0; try { sleep(8000); } catch (InterruptedException e) { e.printStackTrace(); } } } } @Override protected void onActivityResult(int requestCode, int resultCode, Intent intent) { super.onActivityResult(requestCode, resultCode, intent); callbackManager.onActivityResult(requestCode, resultCode, intent); } @Override protected void onResume() { super.onResume(); Log.d(TAG, "onResume: isLogin" +isLoggedIn); //Facebook login Profile profile = Profile.getCurrentProfile(); Log.d(TAG, "onResume: profile=== "+profile); AccessToken accessToken = AccessToken.getCurrentAccessToken(); Log.d(TAG, "onResume: token=== "+accessToken); if (profile != null || accessToken != null) { if (profile != null){ Log.d(TAG, "onResume: already logged in "+profile.getFirstName()); profileName = profile.getFirstName(); fbUserName.setText("Welcome " + profileName.toUpperCase() + ","); } if (!isLoggedIn) { new GetPageID().execute(); } loginButton.setVisibility(View.GONE); listView.setVisibility(View.VISIBLE); logoutButton.setVisibility(View.VISIBLE); isLoggedIn = true; access_token = accessToken.getToken(); } } @Override protected void onPause() { Log.d(TAG, "onPause:"); super.onPause(); } protected void onStop() { super.onStop(); Log.d(TAG, "onStop: "); //Facebook login // tokenTracker.stopTracking(); // profileTracker.stopTracking(); } }
25,059
0.535616
0.532104
675
36.124443
29.575054
267
false
false
0
0
0
0
0
0
0.682963
false
false
13
85ce87743a5054661895fb399b3431c81ba11bb1
19,928,648,322,509
c4f1238a532c0e1719123da06984dec8dab77f91
/Compare.java
43b4302afa4b08cc819c268ba67ee8735ca6a8ec
[]
no_license
shashankmucheli/TravellingSalesManProblem
https://github.com/shashankmucheli/TravellingSalesManProblem
688c64db3104fd8e214ccb7cce654e1e3f04ee88
34465bbda07473529e9e29b0e5dcad98dbdfc977
refs/heads/master
2016-09-08T00:33:36.161000
2014-11-03T02:40:12
2014-11-03T02:40:12
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
import java.util.Comparator; class Compare implements Comparator<NodeInfo>{ @Override public int compare(NodeInfo n1, NodeInfo n2){ return 0; } }
UTF-8
Java
159
java
Compare.java
Java
[]
null
[]
import java.util.Comparator; class Compare implements Comparator<NodeInfo>{ @Override public int compare(NodeInfo n1, NodeInfo n2){ return 0; } }
159
0.72327
0.704403
9
16.777779
18.304691
49
false
false
0
0
0
0
0
0
0.777778
false
false
13
5062384ee0582fe2a072357e3d8eef81b47fd9ba
20,134,806,750,981
6e274c6a9e1cbea2154113764fe11806d6bc68eb
/app/src/main/java/com/trc/app/utils/ConstantKey.java
c8560562cc071ebca2a47ed7b37bd683dda8b6e9
[]
no_license
kamalstis1009/TRC_App
https://github.com/kamalstis1009/TRC_App
a4ed7f1225c8553e0f9b6c8645e87136c96a48d8
bd787d3e798c736ce089dda0ca400a3d0f1ac54e
refs/heads/master
2023-02-04T07:38:57.898000
2020-12-28T05:17:29
2020-12-28T05:17:29
314,746,648
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.trc.app.utils; import com.trc.app.R; import com.trc.app.models.Category; import com.trc.app.models.Consultant; import com.trc.app.models.Guideline; import java.util.ArrayList; public class ConstantKey { public static final String FIREBASE_SERVER_KEY = "AAAAASaR7OU:APA91bEpZlL6R_27zbW0DjbkmBI6Q43_S66MHVgHpl5XWgRDcpew-SrJHrtxJ6Bx5evnsE8zUahZC8in1IhjGofC0dxMaE7L78kGyoG3S43V2EIerwTCXQL81v1ulOoxX_jqVE1bA7R0"; public static final String FIREBASE_BASE_URL = "https://fcm.googleapis.com/"; public static final String SERVER_URL = "http://192.168.0.18:8080/"; //https://localhost:44379/ OR IPv4 192.168.0.105 OR https://docs.microsoft.com/en-us/xamarin/cross-platform/deploy-test/connect-to-local-web-services public static final String IMAGE_SERVER_URL = SERVER_URL + "api/file/Download?filePath="; public static ArrayList<Category> getCategories() { ArrayList<Category> mArrayList = new ArrayList<>(); mArrayList.add(new Category(1, "About", R.drawable.ic_baseline_error_outline_24)); mArrayList.add(new Category(2, "Vat/Tax Guidelines", R.drawable.ic_baseline_bookmark_border_24)); mArrayList.add(new Category(3, "Consultants", R.drawable.ic_baseline_people_24)); mArrayList.add(new Category(4, "Application Form", R.drawable.ic_baseline_post_add_24)); mArrayList.add(new Category(5, "Vat Calculation", R.drawable.ic_baseline_exposure_24)); mArrayList.add(new Category(6, "Tax Calculation", R.drawable.ic_baseline_exposure_24)); mArrayList.add(new Category(7, "Offers", R.drawable.ic_baseline_local_offer_24)); mArrayList.add(new Category(8, "Extra", R.drawable.ic_baseline_add_24)); return mArrayList; } public static ArrayList<Guideline> getGuidelines() { String guide = "TRC offering Accounting, Tax planning, VAT planning and advisory services; working closely with NBR for providing best services to our valuable clients for helping them to minimizing risks and be compliant for maximizing their benefit applying our prudent knowledge."; ArrayList<Guideline> mArrayList = new ArrayList<>(); mArrayList.add(new Guideline("About", guide)); mArrayList.add(new Guideline("Vat/Tax Guidelines", guide)); mArrayList.add(new Guideline("Consultants", guide)); mArrayList.add(new Guideline("Application Form", guide)); mArrayList.add(new Guideline("Vat Calculation", guide)); mArrayList.add(new Guideline("Tax Calculation", guide)); mArrayList.add(new Guideline("Offers", guide)); mArrayList.add(new Guideline("Extra", guide)); return mArrayList; } public static ArrayList<Consultant> getConsultants() { ArrayList<Consultant> mArrayList = new ArrayList<>(); mArrayList.add(new Consultant("MD. ALIMUZZAMAN", "March 15, 1993- September 14, 1996", "CHIEF CONSUSTANT", "01799707090", "alim121971@gmail.com", "He has 23 years work experience in Taxation, VAT and Customs at Bashundhara Group, Khaled Group and Crown Cement Group.", "C.A Course Completed ICAB, Bangladesh")); mArrayList.add(new Consultant("MD. ALIMUZZAMAN", "March 15, 1993- September 14, 1996", "CHIEF CONSUSTANT", "01799707090", "alim121971@gmail.com", "He has 23 years work experience in Taxation, VAT and Customs at Bashundhara Group, Khaled Group and Crown Cement Group.", "C.A Course Completed ICAB, Bangladesh")); mArrayList.add(new Consultant("MD. ALIMUZZAMAN", "March 15, 1993- September 14, 1996", "CHIEF CONSUSTANT", "01799707090", "alim121971@gmail.com", "He has 23 years work experience in Taxation, VAT and Customs at Bashundhara Group, Khaled Group and Crown Cement Group.", "C.A Course Completed ICAB, Bangladesh")); mArrayList.add(new Consultant("MD. ALIMUZZAMAN", "March 15, 1993- September 14, 1996", "CHIEF CONSUSTANT", "01799707090", "alim121971@gmail.com", "He has 23 years work experience in Taxation, VAT and Customs at Bashundhara Group, Khaled Group and Crown Cement Group.", "C.A Course Completed ICAB, Bangladesh")); mArrayList.add(new Consultant("MD. ALIMUZZAMAN", "March 15, 1993- September 14, 1996", "CHIEF CONSUSTANT", "01799707090", "alim121971@gmail.com", "He has 23 years work experience in Taxation, VAT and Customs at Bashundhara Group, Khaled Group and Crown Cement Group.", "C.A Course Completed ICAB, Bangladesh")); return mArrayList; } }
UTF-8
Java
4,417
java
ConstantKey.java
Java
[ { "context": "public static final String FIREBASE_SERVER_KEY = \"AAAAASaR7OU:APA91bEpZlL6R_27zbW0DjbkmBI6Q43_S66MHVgHpl5XWgRDcpew-SrJHrtxJ6Bx5evnsE8zUahZC8in1IhjGofC0dxMaE7L78kGyoG3S43V2EIerwTCXQL81v1ulOoxX_jqVE1bA7R0\";\n public static final String FIREBASE_BASE_UR", "end": 425, "score": 0.999758541...
null
[]
package com.trc.app.utils; import com.trc.app.R; import com.trc.app.models.Category; import com.trc.app.models.Consultant; import com.trc.app.models.Guideline; import java.util.ArrayList; public class ConstantKey { public static final String FIREBASE_SERVER_KEY = "<KEY>"; public static final String FIREBASE_BASE_URL = "https://fcm.googleapis.com/"; public static final String SERVER_URL = "http://192.168.0.18:8080/"; //https://localhost:44379/ OR IPv4 192.168.0.105 OR https://docs.microsoft.com/en-us/xamarin/cross-platform/deploy-test/connect-to-local-web-services public static final String IMAGE_SERVER_URL = SERVER_URL + "api/file/Download?filePath="; public static ArrayList<Category> getCategories() { ArrayList<Category> mArrayList = new ArrayList<>(); mArrayList.add(new Category(1, "About", R.drawable.ic_baseline_error_outline_24)); mArrayList.add(new Category(2, "Vat/Tax Guidelines", R.drawable.ic_baseline_bookmark_border_24)); mArrayList.add(new Category(3, "Consultants", R.drawable.ic_baseline_people_24)); mArrayList.add(new Category(4, "Application Form", R.drawable.ic_baseline_post_add_24)); mArrayList.add(new Category(5, "Vat Calculation", R.drawable.ic_baseline_exposure_24)); mArrayList.add(new Category(6, "Tax Calculation", R.drawable.ic_baseline_exposure_24)); mArrayList.add(new Category(7, "Offers", R.drawable.ic_baseline_local_offer_24)); mArrayList.add(new Category(8, "Extra", R.drawable.ic_baseline_add_24)); return mArrayList; } public static ArrayList<Guideline> getGuidelines() { String guide = "TRC offering Accounting, Tax planning, VAT planning and advisory services; working closely with NBR for providing best services to our valuable clients for helping them to minimizing risks and be compliant for maximizing their benefit applying our prudent knowledge."; ArrayList<Guideline> mArrayList = new ArrayList<>(); mArrayList.add(new Guideline("About", guide)); mArrayList.add(new Guideline("Vat/Tax Guidelines", guide)); mArrayList.add(new Guideline("Consultants", guide)); mArrayList.add(new Guideline("Application Form", guide)); mArrayList.add(new Guideline("Vat Calculation", guide)); mArrayList.add(new Guideline("Tax Calculation", guide)); mArrayList.add(new Guideline("Offers", guide)); mArrayList.add(new Guideline("Extra", guide)); return mArrayList; } public static ArrayList<Consultant> getConsultants() { ArrayList<Consultant> mArrayList = new ArrayList<>(); mArrayList.add(new Consultant("<NAME>", "March 15, 1993- September 14, 1996", "CH<NAME>STANT", "01799707090", "<EMAIL>", "He has 23 years work experience in Taxation, VAT and Customs at Bashundhara Group, Khaled Group and Crown Cement Group.", "C.A Course Completed ICAB, Bangladesh")); mArrayList.add(new Consultant("<NAME>", "March 15, 1993- September 14, 1996", "CHIEF CONSUSTANT", "01799707090", "<EMAIL>", "He has 23 years work experience in Taxation, VAT and Customs at Bashundhara Group, Khaled Group and Crown Cement Group.", "C.A Course Completed ICAB, Bangladesh")); mArrayList.add(new Consultant("<NAME>", "March 15, 1993- September 14, 1996", "CHIEF CONSUSTANT", "01799707090", "<EMAIL>", "He has 23 years work experience in Taxation, VAT and Customs at Bashundhara Group, Khaled Group and Crown Cement Group.", "C.A Course Completed ICAB, Bangladesh")); mArrayList.add(new Consultant("<NAME>", "March 15, 1993- September 14, 1996", "CHIEF CONSUSTANT", "01799707090", "<EMAIL>", "He has 23 years work experience in Taxation, VAT and Customs at Bashundhara Group, Khaled Group and Crown Cement Group.", "C.A Course Completed ICAB, Bangladesh")); mArrayList.add(new Consultant("<NAME>", "March 15, 1993- September 14, 1996", "CHIEF CONSUSTANT", "01799707090", "<EMAIL>", "He has 23 years work experience in Taxation, VAT and Customs at Bashundhara Group, Khaled Group and Crown Cement Group.", "C.A Course Completed ICAB, Bangladesh")); return mArrayList; } }
4,157
0.728775
0.67444
53
82.339622
94.103104
319
false
false
0
0
0
0
76
0.017206
2.264151
false
false
13
9d2c1e85481f2eaca369b856d7d8924735932feb
34,935,264,040,952
d8b179775d2829840451bb5ae968099ed1775950
/GoDiegoGo/app/src/main/java/com/example/godiegogo/utils/SpotifyMusicUtils.java
ff12a245037c0afa849e2959e08c78048a4ac8c2
[]
no_license
gracerobbins/465
https://github.com/gracerobbins/465
4c3268ea5b8d94639fac7e3af1b87fed876b4d2a
744d055e94a9d8e9af20bfc41b87e14165b3625e
refs/heads/main
2023-01-20T05:58:05.864000
2020-11-26T04:31:20
2020-11-26T04:31:20
312,662,569
0
1
null
false
2020-11-25T23:01:16
2020-11-13T19:12:24
2020-11-24T21:04:29
2020-11-25T23:01:15
10,585
0
1
0
Java
false
false
package com.example.godiegogo.utils; import android.content.Context; import android.util.Log; import com.android.volley.AuthFailureError; import com.android.volley.Request; import com.android.volley.RequestQueue; import com.android.volley.Response; import com.android.volley.VolleyError; import com.android.volley.toolbox.JsonObjectRequest; import com.android.volley.toolbox.StringRequest; import com.android.volley.toolbox.Volley; import com.example.godiegogo.R; import com.example.godiegogo.preferences.ApplePreferences; import com.example.godiegogo.preferences.SpotifyPreferences; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import java.util.HashMap; import java.util.Map; public class SpotifyMusicUtils { public static void getSpotifyMusicPlaylists(Context context, final VolleyResponseListener listener) throws JSONException, IllegalStateException { RequestQueue queue = Volley.newRequestQueue(context); String userId = SpotifyPreferences.with(context).getUserID(); String mAccessToken = SpotifyPreferences.with(context).getUserToken(); String url = "https://api.spotify.com/v1/users/" + userId + "/playlists"; StringRequest stringRequest = new StringRequest(Request.Method.GET, url, new Response.Listener<String>() { @Override public void onResponse(String response) { listener.onResponse(response); } }, new Response.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { listener.onError("VolleyError: " + error.toString()); } }) { @Override public Map<String, String> getHeaders() throws AuthFailureError { Map<String, String> params = new HashMap<>(); params.put("Authorization", "Bearer " + mAccessToken); return params; } }; queue.add(stringRequest); } public static void getPlaylistFromId(Context context, String playlistID, final VolleyResponseListener listener) { RequestQueue queue = Volley.newRequestQueue(context); String userId = SpotifyPreferences.with(context).getUserID(); String mAccesstoken = SpotifyPreferences.with(context).getUserToken(); String url = "https://api.spotify.com/v1/playlists/" + playlistID + "/tracks?market=US"; JsonObjectRequest jsonObjectRequest = new JsonObjectRequest(Request.Method.GET, url, null, new Response.Listener<JSONObject>() { @Override public void onResponse(JSONObject response) { listener.onResponse(response); } }, new Response.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { listener.onError("VolleyError: " + error.toString()); } }) { @Override public Map<String, String> getHeaders() throws AuthFailureError { Map<String, String> params = new HashMap<>(); params.put("Authorization", "Bearer " + mAccesstoken); return params; } }; queue.add(jsonObjectRequest); } // Make an API request to Spotify API public static void makeApiRequest(Context context, int requestMethod, JSONObject jsonObjectForRequest, String url, final VolleyResponseListener listener) { Log.d("Api Request", "Method: " + requestMethod + " - Url: " + url); RequestQueue queue = Volley.newRequestQueue(context); JsonObjectRequest jsonObjectRequest = new JsonObjectRequest(requestMethod, url, jsonObjectForRequest, new Response.Listener<JSONObject>() { @Override public void onResponse(JSONObject response) { listener.onResponse(response); } }, new Response.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { listener.onError("VolleyError: " + error.toString()); } }) { @Override public Map<String, String> getHeaders() throws AuthFailureError { Map<String, String> params = new HashMap<>(); params.put("Authorization", "Bearer " + SpotifyPreferences.with(context).getUserToken()); return params; } }; queue.add(jsonObjectRequest); } public static JSONObject makeEmptyJSONPlaylist(String name, String description) throws IllegalArgumentException, JSONException { if (name == null || name.isEmpty()) { throw new IllegalArgumentException("Name is null or empty"); } JSONObject playlist = new JSONObject(); playlist.put("name", name); if (description != null && !description.isEmpty()) { playlist.put("description", description); } return playlist; } }
UTF-8
Java
5,002
java
SpotifyMusicUtils.java
Java
[]
null
[]
package com.example.godiegogo.utils; import android.content.Context; import android.util.Log; import com.android.volley.AuthFailureError; import com.android.volley.Request; import com.android.volley.RequestQueue; import com.android.volley.Response; import com.android.volley.VolleyError; import com.android.volley.toolbox.JsonObjectRequest; import com.android.volley.toolbox.StringRequest; import com.android.volley.toolbox.Volley; import com.example.godiegogo.R; import com.example.godiegogo.preferences.ApplePreferences; import com.example.godiegogo.preferences.SpotifyPreferences; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import java.util.HashMap; import java.util.Map; public class SpotifyMusicUtils { public static void getSpotifyMusicPlaylists(Context context, final VolleyResponseListener listener) throws JSONException, IllegalStateException { RequestQueue queue = Volley.newRequestQueue(context); String userId = SpotifyPreferences.with(context).getUserID(); String mAccessToken = SpotifyPreferences.with(context).getUserToken(); String url = "https://api.spotify.com/v1/users/" + userId + "/playlists"; StringRequest stringRequest = new StringRequest(Request.Method.GET, url, new Response.Listener<String>() { @Override public void onResponse(String response) { listener.onResponse(response); } }, new Response.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { listener.onError("VolleyError: " + error.toString()); } }) { @Override public Map<String, String> getHeaders() throws AuthFailureError { Map<String, String> params = new HashMap<>(); params.put("Authorization", "Bearer " + mAccessToken); return params; } }; queue.add(stringRequest); } public static void getPlaylistFromId(Context context, String playlistID, final VolleyResponseListener listener) { RequestQueue queue = Volley.newRequestQueue(context); String userId = SpotifyPreferences.with(context).getUserID(); String mAccesstoken = SpotifyPreferences.with(context).getUserToken(); String url = "https://api.spotify.com/v1/playlists/" + playlistID + "/tracks?market=US"; JsonObjectRequest jsonObjectRequest = new JsonObjectRequest(Request.Method.GET, url, null, new Response.Listener<JSONObject>() { @Override public void onResponse(JSONObject response) { listener.onResponse(response); } }, new Response.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { listener.onError("VolleyError: " + error.toString()); } }) { @Override public Map<String, String> getHeaders() throws AuthFailureError { Map<String, String> params = new HashMap<>(); params.put("Authorization", "Bearer " + mAccesstoken); return params; } }; queue.add(jsonObjectRequest); } // Make an API request to Spotify API public static void makeApiRequest(Context context, int requestMethod, JSONObject jsonObjectForRequest, String url, final VolleyResponseListener listener) { Log.d("Api Request", "Method: " + requestMethod + " - Url: " + url); RequestQueue queue = Volley.newRequestQueue(context); JsonObjectRequest jsonObjectRequest = new JsonObjectRequest(requestMethod, url, jsonObjectForRequest, new Response.Listener<JSONObject>() { @Override public void onResponse(JSONObject response) { listener.onResponse(response); } }, new Response.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { listener.onError("VolleyError: " + error.toString()); } }) { @Override public Map<String, String> getHeaders() throws AuthFailureError { Map<String, String> params = new HashMap<>(); params.put("Authorization", "Bearer " + SpotifyPreferences.with(context).getUserToken()); return params; } }; queue.add(jsonObjectRequest); } public static JSONObject makeEmptyJSONPlaylist(String name, String description) throws IllegalArgumentException, JSONException { if (name == null || name.isEmpty()) { throw new IllegalArgumentException("Name is null or empty"); } JSONObject playlist = new JSONObject(); playlist.put("name", name); if (description != null && !description.isEmpty()) { playlist.put("description", description); } return playlist; } }
5,002
0.646142
0.645742
128
38.078125
35.069489
159
false
false
0
0
0
0
0
0
0.703125
false
false
13
945d1df351ff5aeac0f40bc9e089dceaec22a1a3
39,548,058,890,707
d5f09c7b0e954cd20dd613af600afd91b039c48a
/sources/com/huawei/hms/common/a/a.java
ff6cddbcea54d1feb73aa459dda06be09509afb1
[]
no_license
t0HiiBwn/CoolapkRelease
https://github.com/t0HiiBwn/CoolapkRelease
af5e00c701bf82c4e90b1033f5c5f9dc8526f4b3
a6a2b03e32cde0e5163016e0078391271a8d33ab
refs/heads/main
2022-07-29T23:28:35.867000
2021-03-26T11:41:18
2021-03-26T11:41:18
345,290,891
5
2
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.huawei.hms.common.a; import android.database.AbstractWindowedCursor; import android.database.CrossProcessCursor; import android.database.Cursor; import android.database.CursorWindow; import android.database.CursorWrapper; /* compiled from: HMSCursorWrapper */ public class a extends CursorWrapper implements CrossProcessCursor { private AbstractWindowedCursor a; public a(Cursor cursor) { super(cursor); if (cursor == null) { throw new IllegalArgumentException("cursor cannot be null"); } else if (cursor instanceof CursorWrapper) { Cursor wrappedCursor = ((CursorWrapper) cursor).getWrappedCursor(); if (wrappedCursor == null) { throw new IllegalArgumentException("getWrappedCursor cannot be null"); } else if (wrappedCursor instanceof AbstractWindowedCursor) { this.a = (AbstractWindowedCursor) wrappedCursor; } else { throw new IllegalArgumentException("getWrappedCursor:" + wrappedCursor + " is not a subclass for CursorWrapper"); } } else { throw new IllegalArgumentException("cursor:" + cursor + " is not a subclass for CursorWrapper"); } } @Override // android.database.CrossProcessCursor public CursorWindow getWindow() { return this.a.getWindow(); } public void a(CursorWindow cursorWindow) { this.a.setWindow(cursorWindow); } @Override // android.database.CrossProcessCursor public void fillWindow(int i, CursorWindow cursorWindow) { this.a.fillWindow(i, cursorWindow); } @Override // android.database.CrossProcessCursor public boolean onMove(int i, int i2) { return this.a.onMove(i, i2); } @Override // android.database.CursorWrapper public Cursor getWrappedCursor() { return this.a; } }
UTF-8
Java
1,899
java
a.java
Java
[]
null
[]
package com.huawei.hms.common.a; import android.database.AbstractWindowedCursor; import android.database.CrossProcessCursor; import android.database.Cursor; import android.database.CursorWindow; import android.database.CursorWrapper; /* compiled from: HMSCursorWrapper */ public class a extends CursorWrapper implements CrossProcessCursor { private AbstractWindowedCursor a; public a(Cursor cursor) { super(cursor); if (cursor == null) { throw new IllegalArgumentException("cursor cannot be null"); } else if (cursor instanceof CursorWrapper) { Cursor wrappedCursor = ((CursorWrapper) cursor).getWrappedCursor(); if (wrappedCursor == null) { throw new IllegalArgumentException("getWrappedCursor cannot be null"); } else if (wrappedCursor instanceof AbstractWindowedCursor) { this.a = (AbstractWindowedCursor) wrappedCursor; } else { throw new IllegalArgumentException("getWrappedCursor:" + wrappedCursor + " is not a subclass for CursorWrapper"); } } else { throw new IllegalArgumentException("cursor:" + cursor + " is not a subclass for CursorWrapper"); } } @Override // android.database.CrossProcessCursor public CursorWindow getWindow() { return this.a.getWindow(); } public void a(CursorWindow cursorWindow) { this.a.setWindow(cursorWindow); } @Override // android.database.CrossProcessCursor public void fillWindow(int i, CursorWindow cursorWindow) { this.a.fillWindow(i, cursorWindow); } @Override // android.database.CrossProcessCursor public boolean onMove(int i, int i2) { return this.a.onMove(i, i2); } @Override // android.database.CursorWrapper public Cursor getWrappedCursor() { return this.a; } }
1,899
0.670879
0.669826
54
34.166668
28.715559
129
false
false
0
0
0
0
0
0
0.425926
false
false
13
e54098fc76b1ed5a6624cdd41e7a5ff59b9d44f7
39,298,950,773,805
8683c05a16c5f0a09832bfeb8f7dcdc2f1f0ac7c
/data-structures/src/test/java/com/design/analysis/core/ds/advance/others/IOthersTest.java
a9141de323f598f04fae20306589efe4c0f560d0
[]
no_license
ifoets/teaching
https://github.com/ifoets/teaching
11cf69dbce6895dedec5478bf4bb287e69f79aa3
55270562761ad227d821edcda1513699f51041f8
refs/heads/master
2023-08-17T14:00:17.183000
2023-08-03T09:30:45
2023-08-03T09:30:45
173,404,139
1
0
null
false
2020-08-13T10:34:12
2019-03-02T04:43:48
2020-02-10T17:25:32
2020-08-13T10:34:12
14,769
0
0
0
Java
false
false
package com.design.analysis.core.ds.advance.others; import com.design.analysis.core.ds.advance.others.node.TernaryNode; import org.junit.Assert; import org.junit.Before; import org.junit.Test; public class IOthersTest { public IOthers<Character, Integer> iots = null; TernaryNode<Character> root = null; @Before public void init() { iots = new OthersImpl(); } /** 1. Palindromic Tree | Introduction & Implementation **/ /** 2. Ternary Search Tree **/ @Test public void insertTest() { String[] strArr = { "cat", "cats", "up", "bug" }; for (String str : strArr) { char charArr[] = str.toCharArray(); Character cAr[] = new Character[charArr.length]; for (int i = 0; i < cAr.length; i++) cAr[i] = charArr[i]; root = iots.insert(root, cAr, 0); } } @Test public void traverseTest() { String[] strArr = { "cat", "cats", "up", "bug" }; for (String str : strArr) { char charArr[] = str.toCharArray(); Character cAr[] = new Character[charArr.length]; for (int i = 0; i < cAr.length; i++) cAr[i] = charArr[i]; root = iots.insert(root, cAr, 0); } iots.traverse(root, new String()); } @Test public void searchTest() { String[] strArr = { "cat", "cats", "up", "bug" }; for (String str : strArr) { char charArr[] = str.toCharArray(); Character cAr[] = new Character[charArr.length]; for (int i = 0; i < cAr.length; i++) cAr[i] = charArr[i]; root = iots.insert(root, cAr, 0); } String str1 = "but"; String str2 = "up"; Character cha1[] = new Character[str1.length()]; Character cha2[] = new Character[str2.length()]; for (int i = 0; i < str1.length(); i++) cha1[i] = str1.charAt(i); for (int i = 0; i < str2.length(); i++) cha2[i] = str2.charAt(i); Assert.assertTrue(iots.search(root, cha1, 0) == false); Assert.assertTrue(iots.search(root, cha2, 0) == true); } @Test public void deleteTest() { String[] strArr = { "cat", "cats", "up", "bug" }; for (String str : strArr) { char charArr[] = str.toCharArray(); Character cAr[] = new Character[charArr.length]; for (int i = 0; i < cAr.length; i++) cAr[i] = charArr[i]; root = iots.insert(root, cAr, 0); } String str1 = "cats"; Character cha1[] = new Character[str1.length()]; for (int i = 0; i < str1.length(); i++) cha1[i] = str1.charAt(i); iots.delete(root, cha1, 0); iots.traverse(root, new String()); } }
UTF-8
Java
2,398
java
IOthersTest.java
Java
[]
null
[]
package com.design.analysis.core.ds.advance.others; import com.design.analysis.core.ds.advance.others.node.TernaryNode; import org.junit.Assert; import org.junit.Before; import org.junit.Test; public class IOthersTest { public IOthers<Character, Integer> iots = null; TernaryNode<Character> root = null; @Before public void init() { iots = new OthersImpl(); } /** 1. Palindromic Tree | Introduction & Implementation **/ /** 2. Ternary Search Tree **/ @Test public void insertTest() { String[] strArr = { "cat", "cats", "up", "bug" }; for (String str : strArr) { char charArr[] = str.toCharArray(); Character cAr[] = new Character[charArr.length]; for (int i = 0; i < cAr.length; i++) cAr[i] = charArr[i]; root = iots.insert(root, cAr, 0); } } @Test public void traverseTest() { String[] strArr = { "cat", "cats", "up", "bug" }; for (String str : strArr) { char charArr[] = str.toCharArray(); Character cAr[] = new Character[charArr.length]; for (int i = 0; i < cAr.length; i++) cAr[i] = charArr[i]; root = iots.insert(root, cAr, 0); } iots.traverse(root, new String()); } @Test public void searchTest() { String[] strArr = { "cat", "cats", "up", "bug" }; for (String str : strArr) { char charArr[] = str.toCharArray(); Character cAr[] = new Character[charArr.length]; for (int i = 0; i < cAr.length; i++) cAr[i] = charArr[i]; root = iots.insert(root, cAr, 0); } String str1 = "but"; String str2 = "up"; Character cha1[] = new Character[str1.length()]; Character cha2[] = new Character[str2.length()]; for (int i = 0; i < str1.length(); i++) cha1[i] = str1.charAt(i); for (int i = 0; i < str2.length(); i++) cha2[i] = str2.charAt(i); Assert.assertTrue(iots.search(root, cha1, 0) == false); Assert.assertTrue(iots.search(root, cha2, 0) == true); } @Test public void deleteTest() { String[] strArr = { "cat", "cats", "up", "bug" }; for (String str : strArr) { char charArr[] = str.toCharArray(); Character cAr[] = new Character[charArr.length]; for (int i = 0; i < cAr.length; i++) cAr[i] = charArr[i]; root = iots.insert(root, cAr, 0); } String str1 = "cats"; Character cha1[] = new Character[str1.length()]; for (int i = 0; i < str1.length(); i++) cha1[i] = str1.charAt(i); iots.delete(root, cha1, 0); iots.traverse(root, new String()); } }
2,398
0.612177
0.596747
88
26.25
18.77574
67
false
false
0
0
0
0
0
0
2.636364
false
false
13
873094acbdc2e58dbdda75be9bf593727aa7af06
8,890,582,334,676
bb7d521605d1d2c7229f36e301ec8311837b39f7
/ms.test/src/main/java/com/ms/commons/test/datawriter/DataWriterType.java
d601ecfbc8e9148aa5eb3fad38a000d3502dda36
[]
no_license
justinscript/summer
https://github.com/justinscript/summer
635eb3c8739065a2ee4736b0b9f42adf188d76dc
d6b982c41dc6a3d637d5de1bc84363db1797ef1b
refs/heads/master
2021-10-10T14:33:28.153000
2019-01-12T06:01:52
2019-01-12T06:01:52
18,910,111
2
0
null
null
null
null
null
null
null
null
null
null
null
null
null
/* * Copyright 2017-2025 msun.com All right reserved. This software is the confidential and proprietary information of * msun.com ("Confidential Information"). You shall not disclose such Confidential Information and shall use it only in * accordance with the terms of the license agreement you entered into with msun.com. */ package com.ms.commons.test.datawriter; /** * @author zxc Apr 13, 2013 11:32:57 PM */ public enum DataWriterType { Excel("xls"), Xml("xml"), Json("json"), Wiki("wiki"); private String ext; DataWriterType(String ext) { this.ext = ext; } public String getExt() { return this.ext; } public String toString() { return this.name() + "(" + this.ext + ")"; } }
UTF-8
Java
797
java
DataWriterType.java
Java
[ { "context": "com.ms.commons.test.datawriter;\r\n\r\n/**\r\n * @author zxc Apr 13, 2013 11:32:57 PM\r\n */\r\npublic enum DataWr", "end": 397, "score": 0.9995461702346802, "start": 394, "tag": "USERNAME", "value": "zxc" } ]
null
[]
/* * Copyright 2017-2025 msun.com All right reserved. This software is the confidential and proprietary information of * msun.com ("Confidential Information"). You shall not disclose such Confidential Information and shall use it only in * accordance with the terms of the license agreement you entered into with msun.com. */ package com.ms.commons.test.datawriter; /** * @author zxc Apr 13, 2013 11:32:57 PM */ public enum DataWriterType { Excel("xls"), Xml("xml"), Json("json"), Wiki("wiki"); private String ext; DataWriterType(String ext) { this.ext = ext; } public String getExt() { return this.ext; } public String toString() { return this.name() + "(" + this.ext + ")"; } }
797
0.61857
0.593476
34
21.441177
30.233591
119
false
false
0
0
0
0
0
0
0.294118
false
false
13
e82e891f0afccc0bda5166caba0061b3d5fe8d2b
5,600,637,365,228
18fb09a5dad10319b0687e242c92e57a7668fa6d
/HelloWorld/src/hello/test.java
9d00af163961f625c2522362ea2fc36e48de5a6f
[]
no_license
my1716412/hello
https://github.com/my1716412/hello
7b3e6c6efa76c6818952422ead6895a3a03d6e57
6da958934115dc886c60f364165b7528b0701915
refs/heads/master
2020-07-23T08:59:18.065000
2020-01-22T05:00:35
2020-01-22T05:00:35
207,506,638
1
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package hello; public class test { public static void main(String[] args) { // int sum = 0; // int a = 1, b = 10; // for (int i = a; i <= b; i++) { // if(i % 2 == 0) { // sum += i; // } // } // System.out.println(a + "~" + b + "합은" + sum); char chr = 'A'; int num = chr; for(int i=0; i<26; i++) System.out.println(chr++ +","+ num++); } }
UTF-8
Java
416
java
test.java
Java
[]
null
[]
package hello; public class test { public static void main(String[] args) { // int sum = 0; // int a = 1, b = 10; // for (int i = a; i <= b; i++) { // if(i % 2 == 0) { // sum += i; // } // } // System.out.println(a + "~" + b + "합은" + sum); char chr = 'A'; int num = chr; for(int i=0; i<26; i++) System.out.println(chr++ +","+ num++); } }
416
0.402913
0.381068
23
15.913043
13.968639
49
false
false
0
0
0
0
0
0
2.391304
false
false
13
aacb9b5663d964d14c05006b92d8b4e60dadf6ee
5,600,637,364,150
3dda064329c2aaaa21fb581d928a938560f6c31d
/src/com/greenday/dookie/Dookie.java
85fbb30f9f1dabfcd337eb6fcad430c5012854f4
[]
no_license
vishal0071/Green_Day_Lyrics
https://github.com/vishal0071/Green_Day_Lyrics
35ff9e63ca0315ae8c2df324252406af20ed4b10
5f4f7a8e2e447acffddef6a5686247208ce633ae
refs/heads/master
2021-05-01T02:36:16.780000
2018-01-15T11:25:22
2018-01-15T11:25:22
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.greenday.dookie; import com.fourmob.poppyview.PoppyViewHelper; import com.fourmob.poppyview.PoppyViewHelper.PoppyViewPosition; import com.google.android.gms.analytics.GoogleAnalytics; import com.google.android.gms.analytics.HitBuilders; import com.google.android.gms.analytics.Tracker; import com.greenday.lyrics.Allsongs; import com.greenday.lyrics.Favorites; import com.greenday.lyrics.Frontend; import com.greenday.lyrics.ReportSong; import com.greenday.lyrics.Settings; import com.greenday.lyrics.R; import com.greenday.lyrics.Frontend.TrackerName; import com.greenday.database.DBHandler; import com.greenday.database.Track; import com.greenday.dookie.Info; import de.keyboardsurfer.android.widget.crouton.Crouton; import de.keyboardsurfer.android.widget.crouton.Style; import android.app.ActionBar; import android.app.Activity; import android.content.Intent; import android.graphics.Color; import android.graphics.drawable.ColorDrawable; import android.os.Bundle; import android.preference.PreferenceManager; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.view.View.OnClickListener; import android.view.View.OnLongClickListener; import android.widget.ImageButton; import android.widget.TextView; public class Dookie extends Activity { private PoppyViewHelper mPoppyViewHelper; private Tracker t; private View poppyview; private TextView tv1; private ActionBar ab; @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.dookie); ab =getActionBar(); ab.setDisplayHomeAsUpEnabled(true); tv1 = (TextView)findViewById(R.id.textView1); //Poppyview mPoppyViewHelper=new PoppyViewHelper(this, PoppyViewPosition.BOTTOM); poppyview = mPoppyViewHelper.createPoppyViewOnScrollView(R.id.scrollView, R.layout.poppyview); //Loading Preferences getPref(); //Google Analytics ((Frontend) getApplication()).getTracker(Frontend.TrackerName.APP_TRACKER); t = ((Frontend) this.getApplication()).getTracker( TrackerName.APP_TRACKER); //PoppyView ImageButton search = (ImageButton) poppyview.findViewById(R.id.imageButton1); search.setOnClickListener(new OnClickListener() { @Override public void onClick(View arg0) { // TODO Auto-generated method stub // Search action | Add as new task Intent intent = new Intent(Dookie.this, Allsongs.class); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.putExtra("Search", true); startActivity(intent); } }); ImageButton report = (ImageButton) poppyview.findViewById(R.id.imageButton2); report.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub int track = getIntent().getExtras().getInt("track"); Intent intent = new Intent(Dookie.this, ReportSong.class); if(track == 1){ intent.putExtra("report_sub", "All By Myself"); startActivity(intent); } if(track == 2){ intent.putExtra("report_sub", "Burnout"); startActivity(intent); } if(track == 3){ intent.putExtra("report_sub", "Having A Blast"); startActivity(intent); } if(track == 4){ intent.putExtra("report_sub", "Chump"); startActivity(intent); } if(track == 5){ intent.putExtra("report_sub", "Longview"); startActivity(intent); } if(track == 6){ intent.putExtra("report_sub", "Welcome To Paradise"); startActivity(intent); } if(track == 7){ intent.putExtra("report_sub", "Pulling Teeth"); startActivity(intent); } if(track == 8){ intent.putExtra("report_sub", "Basket Case"); startActivity(intent); } if(track == 9){ intent.putExtra("report_sub", "She"); startActivity(intent); } if(track == 10){ intent.putExtra("report_sub", "Sassafras Roots"); startActivity(intent); } if(track == 11){ intent.putExtra("report_sub", "When I Come Around"); startActivity(intent); } if(track == 12){ intent.putExtra("report_sub", "Coming Clean"); startActivity(intent); } if(track == 13){ intent.putExtra("report_sub", "Emenius Sleepus"); startActivity(intent); } if(track == 14){ intent.putExtra("report_sub", "In The End"); startActivity(intent); } if(track == 15){ intent.putExtra("report_sub", "F.O.D."); startActivity(intent); } } }); ImageButton favourite = (ImageButton) poppyview.findViewById(R.id.imageButton3); favourite.setOnClickListener(new OnClickListener() { int track = getIntent().getExtras().getInt("track"); @Override public void onClick(View arg0) { // TODO Auto-generated method stub if(track == 1){ lookupTrack("All By Myself", track); } if(track == 2){ lookupTrack("Burnout", track); } if(track == 3){ lookupTrack("Having A Blast", track); } if(track == 4){ lookupTrack("Chump", track); } if(track == 5){ lookupTrack("Longview", track); } if(track == 6){ lookupTrack("Welcome To Paradise", track); } if(track == 7){ lookupTrack("Pulling Teeth", track); } if(track == 8){ lookupTrack("Basket Case", track); } if(track == 9){ lookupTrack("She", track); } if(track == 10){ lookupTrack("Sassafras Roots", track); } if(track == 11){ lookupTrack("When I Come Around", track); } if(track == 12){ lookupTrack("Coming Clean", track); } if(track == 13){ lookupTrack("Emenius Sleepus", track); } if(track == 14){ lookupTrack("In The End", track); } if(track == 15){ lookupTrack("F.O.D.", track); } } }); favourite.setOnLongClickListener(new OnLongClickListener() { Intent intent = new Intent(Dookie.this, Favorites.class); @Override public boolean onLongClick(View arg0) { // TODO Auto-generated method stub intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(intent); return false; } }); ImageButton label=(ImageButton) poppyview.findViewById(R.id.imageButton4); label.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub int track = getIntent().getExtras().getInt("track"); if(track == 1){ Info.info1(Dookie.this); } if(track == 2){ Info.info2(Dookie.this); } if(track == 3){ Info.info3(Dookie.this); } if(track == 4){ Info.info4(Dookie.this); } if(track == 5){ Info.info5(Dookie.this); } if(track == 6){ Info.info6(Dookie.this); } if(track == 7){ Info.info7(Dookie.this); } if(track == 8){ Info.info8(Dookie.this); } if(track == 9){ Info.info9(Dookie.this); } if(track == 10){ Info.info10(Dookie.this); } if(track == 11){ Info.info11(Dookie.this); } if(track == 12){ Info.info12(Dookie.this); } if(track == 13){ Info.info13(Dookie.this); } if(track == 14){ Info.info14(Dookie.this); } if(track == 15){ Info.info15(Dookie.this); } } }); ImageButton settings=(ImageButton) poppyview.findViewById(R.id.imageButton5); settings.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub startActivity(new Intent(getApplicationContext(), Settings.class)); } }); //Poppyview //Lyrics int track = getIntent().getExtras().getInt("track"); if(track == 1){ String current = "All By Myself"; ab.setTitle(current); tv1.setText(R.string.allbymyself); analytics(current); } if(track == 2){ String current = "Burnout"; ab.setTitle(current); tv1.setText(R.string.burnout); analytics(current); } if(track == 3){ String current = "Having A Blast"; ab.setTitle(current); tv1.setText(R.string.havingblast); analytics(current); } if(track == 4){ String current = "Chump"; ab.setTitle(current); tv1.setText(R.string.chump); analytics(current); } if(track == 5){ String current = "Longview"; ab.setTitle(current); tv1.setText(R.string.longview); analytics(current); } if(track == 6){ String current = "Welcome To Paradise"; ab.setTitle(current); tv1.setText(R.string.welcometoparadise); analytics(current); } if(track == 7){ String current = "Pulling Teeth"; ab.setTitle(current); tv1.setText(R.string.pullingteeth); analytics(current); } if(track == 8){ String current = "Basket Case"; ab.setTitle(current); tv1.setText(R.string.basketcase); analytics(current); } if(track == 9){ String current = "She"; ab.setTitle(current); tv1.setText(R.string.she); analytics(current); } if(track == 10){ String current = "Sassafras Roots"; ab.setTitle(current); tv1.setText(R.string.sassafrasroots); analytics(current); } if(track == 11){ String current = "When I Come Around"; ab.setTitle(current); tv1.setText(R.string.whencomearound); analytics(current); } if(track == 12){ String current = "Coming Clean"; ab.setTitle(current); tv1.setText(R.string.comingclean); analytics(current); } if(track == 13){ String current = "Emenius Sleepus"; ab.setTitle(current); tv1.setText(R.string.emeniussleepus); analytics(current); } if(track == 14){ String current = "In The End"; ab.setTitle(current); tv1.setText(R.string.intheend); analytics(current); } if(track == 15){ String current = "F.O.D."; ab.setTitle(current); tv1.setText(R.string.fod); analytics(current); } } @Override public boolean onCreateOptionsMenu(Menu menu) { return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case android.R.id.home: onBackPressed(); break; default: }; return super.onOptionsItemSelected(item); } //Checking and adding to database public void lookupTrack(String name, int i) { DBHandler db = new DBHandler(this, null, null, 1); Track findtrack = db.findTrack(name); if(findtrack != null) { Crouton.makeText(this, "Already in favorites", Style.ALERT).show(); } else { db.addTrack(new Track(name, i)); Crouton.makeText(this, "Added to favorites", Style.INFO).show(); } } //Analytics public void analytics(String s) { //Google Analytics // Set screen name. t.setScreenName(s); // Send a screen view. t.send(new HitBuilders.AppViewBuilder().build()); } @Override protected void onStart() { // TODO Auto-generated method stub //Get an Analytics tracker to report app starts & uncaught exceptions etc. GoogleAnalytics.getInstance(this).reportActivityStart(this); super.onStart(); } @Override protected void onStop() { // TODO Auto-generated method stub //Stop the analytics tracking GoogleAnalytics.getInstance(this).reportActivityStop(this); super.onStop(); } @Override protected void onDestroy() { // TODO Auto-generated method stub //Protect crouton Crouton.clearCroutonsForActivity(this); super.onDestroy(); } @Override protected void onResume() { // TODO Auto-generated method stub getPref(); super.onResume(); } private void getPref() { //Action bar color int ab_def_color= Color.parseColor("#222222"); int ab_color=PreferenceManager.getDefaultSharedPreferences(this).getInt("ab_theme", ab_def_color); ab.setBackgroundDrawable(new ColorDrawable(ab_color)); //Text Size int text_size = PreferenceManager.getDefaultSharedPreferences(this).getInt("text", 18); tv1.setTextSize(text_size); //Text Color int text_def_color= Color.parseColor("#000000"); int text_color=PreferenceManager.getDefaultSharedPreferences(this).getInt("text_theme", text_def_color); tv1.setTextColor(text_color); //Background transparency int def_alpha = 70; int alpha = PreferenceManager.getDefaultSharedPreferences(this).getInt("alpha", def_alpha); findViewById(R.id.dookie_layout).getBackground().setAlpha(alpha); //PoppyView int poppy_def_color=Color.parseColor("#40222222"); int poppy_color=PreferenceManager.getDefaultSharedPreferences(this).getInt("poppy_theme", poppy_def_color); poppyview.setBackgroundColor(poppy_color); //Display boolean display = PreferenceManager.getDefaultSharedPreferences(this).getBoolean("display", false); if(display) { tv1.setKeepScreenOn(true); } } }
UTF-8
Java
13,076
java
Dookie.java
Java
[ { "context": "ent);\n\t\t}\n\t\tif(track == 13){\n\t\t\tString current = \"Emenius Sleepus\";\n\t\t\tab.setTitle(current);\n\t\t\ttv1.setText(R.strin", "end": 9642, "score": 0.9998544454574585, "start": 9627, "tag": "NAME", "value": "Emenius Sleepus" } ]
null
[]
package com.greenday.dookie; import com.fourmob.poppyview.PoppyViewHelper; import com.fourmob.poppyview.PoppyViewHelper.PoppyViewPosition; import com.google.android.gms.analytics.GoogleAnalytics; import com.google.android.gms.analytics.HitBuilders; import com.google.android.gms.analytics.Tracker; import com.greenday.lyrics.Allsongs; import com.greenday.lyrics.Favorites; import com.greenday.lyrics.Frontend; import com.greenday.lyrics.ReportSong; import com.greenday.lyrics.Settings; import com.greenday.lyrics.R; import com.greenday.lyrics.Frontend.TrackerName; import com.greenday.database.DBHandler; import com.greenday.database.Track; import com.greenday.dookie.Info; import de.keyboardsurfer.android.widget.crouton.Crouton; import de.keyboardsurfer.android.widget.crouton.Style; import android.app.ActionBar; import android.app.Activity; import android.content.Intent; import android.graphics.Color; import android.graphics.drawable.ColorDrawable; import android.os.Bundle; import android.preference.PreferenceManager; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.view.View.OnClickListener; import android.view.View.OnLongClickListener; import android.widget.ImageButton; import android.widget.TextView; public class Dookie extends Activity { private PoppyViewHelper mPoppyViewHelper; private Tracker t; private View poppyview; private TextView tv1; private ActionBar ab; @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.dookie); ab =getActionBar(); ab.setDisplayHomeAsUpEnabled(true); tv1 = (TextView)findViewById(R.id.textView1); //Poppyview mPoppyViewHelper=new PoppyViewHelper(this, PoppyViewPosition.BOTTOM); poppyview = mPoppyViewHelper.createPoppyViewOnScrollView(R.id.scrollView, R.layout.poppyview); //Loading Preferences getPref(); //Google Analytics ((Frontend) getApplication()).getTracker(Frontend.TrackerName.APP_TRACKER); t = ((Frontend) this.getApplication()).getTracker( TrackerName.APP_TRACKER); //PoppyView ImageButton search = (ImageButton) poppyview.findViewById(R.id.imageButton1); search.setOnClickListener(new OnClickListener() { @Override public void onClick(View arg0) { // TODO Auto-generated method stub // Search action | Add as new task Intent intent = new Intent(Dookie.this, Allsongs.class); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.putExtra("Search", true); startActivity(intent); } }); ImageButton report = (ImageButton) poppyview.findViewById(R.id.imageButton2); report.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub int track = getIntent().getExtras().getInt("track"); Intent intent = new Intent(Dookie.this, ReportSong.class); if(track == 1){ intent.putExtra("report_sub", "All By Myself"); startActivity(intent); } if(track == 2){ intent.putExtra("report_sub", "Burnout"); startActivity(intent); } if(track == 3){ intent.putExtra("report_sub", "Having A Blast"); startActivity(intent); } if(track == 4){ intent.putExtra("report_sub", "Chump"); startActivity(intent); } if(track == 5){ intent.putExtra("report_sub", "Longview"); startActivity(intent); } if(track == 6){ intent.putExtra("report_sub", "Welcome To Paradise"); startActivity(intent); } if(track == 7){ intent.putExtra("report_sub", "Pulling Teeth"); startActivity(intent); } if(track == 8){ intent.putExtra("report_sub", "Basket Case"); startActivity(intent); } if(track == 9){ intent.putExtra("report_sub", "She"); startActivity(intent); } if(track == 10){ intent.putExtra("report_sub", "Sassafras Roots"); startActivity(intent); } if(track == 11){ intent.putExtra("report_sub", "When I Come Around"); startActivity(intent); } if(track == 12){ intent.putExtra("report_sub", "Coming Clean"); startActivity(intent); } if(track == 13){ intent.putExtra("report_sub", "Emenius Sleepus"); startActivity(intent); } if(track == 14){ intent.putExtra("report_sub", "In The End"); startActivity(intent); } if(track == 15){ intent.putExtra("report_sub", "F.O.D."); startActivity(intent); } } }); ImageButton favourite = (ImageButton) poppyview.findViewById(R.id.imageButton3); favourite.setOnClickListener(new OnClickListener() { int track = getIntent().getExtras().getInt("track"); @Override public void onClick(View arg0) { // TODO Auto-generated method stub if(track == 1){ lookupTrack("All By Myself", track); } if(track == 2){ lookupTrack("Burnout", track); } if(track == 3){ lookupTrack("Having A Blast", track); } if(track == 4){ lookupTrack("Chump", track); } if(track == 5){ lookupTrack("Longview", track); } if(track == 6){ lookupTrack("Welcome To Paradise", track); } if(track == 7){ lookupTrack("Pulling Teeth", track); } if(track == 8){ lookupTrack("Basket Case", track); } if(track == 9){ lookupTrack("She", track); } if(track == 10){ lookupTrack("Sassafras Roots", track); } if(track == 11){ lookupTrack("When I Come Around", track); } if(track == 12){ lookupTrack("Coming Clean", track); } if(track == 13){ lookupTrack("Emenius Sleepus", track); } if(track == 14){ lookupTrack("In The End", track); } if(track == 15){ lookupTrack("F.O.D.", track); } } }); favourite.setOnLongClickListener(new OnLongClickListener() { Intent intent = new Intent(Dookie.this, Favorites.class); @Override public boolean onLongClick(View arg0) { // TODO Auto-generated method stub intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(intent); return false; } }); ImageButton label=(ImageButton) poppyview.findViewById(R.id.imageButton4); label.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub int track = getIntent().getExtras().getInt("track"); if(track == 1){ Info.info1(Dookie.this); } if(track == 2){ Info.info2(Dookie.this); } if(track == 3){ Info.info3(Dookie.this); } if(track == 4){ Info.info4(Dookie.this); } if(track == 5){ Info.info5(Dookie.this); } if(track == 6){ Info.info6(Dookie.this); } if(track == 7){ Info.info7(Dookie.this); } if(track == 8){ Info.info8(Dookie.this); } if(track == 9){ Info.info9(Dookie.this); } if(track == 10){ Info.info10(Dookie.this); } if(track == 11){ Info.info11(Dookie.this); } if(track == 12){ Info.info12(Dookie.this); } if(track == 13){ Info.info13(Dookie.this); } if(track == 14){ Info.info14(Dookie.this); } if(track == 15){ Info.info15(Dookie.this); } } }); ImageButton settings=(ImageButton) poppyview.findViewById(R.id.imageButton5); settings.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub startActivity(new Intent(getApplicationContext(), Settings.class)); } }); //Poppyview //Lyrics int track = getIntent().getExtras().getInt("track"); if(track == 1){ String current = "All By Myself"; ab.setTitle(current); tv1.setText(R.string.allbymyself); analytics(current); } if(track == 2){ String current = "Burnout"; ab.setTitle(current); tv1.setText(R.string.burnout); analytics(current); } if(track == 3){ String current = "Having A Blast"; ab.setTitle(current); tv1.setText(R.string.havingblast); analytics(current); } if(track == 4){ String current = "Chump"; ab.setTitle(current); tv1.setText(R.string.chump); analytics(current); } if(track == 5){ String current = "Longview"; ab.setTitle(current); tv1.setText(R.string.longview); analytics(current); } if(track == 6){ String current = "Welcome To Paradise"; ab.setTitle(current); tv1.setText(R.string.welcometoparadise); analytics(current); } if(track == 7){ String current = "Pulling Teeth"; ab.setTitle(current); tv1.setText(R.string.pullingteeth); analytics(current); } if(track == 8){ String current = "Basket Case"; ab.setTitle(current); tv1.setText(R.string.basketcase); analytics(current); } if(track == 9){ String current = "She"; ab.setTitle(current); tv1.setText(R.string.she); analytics(current); } if(track == 10){ String current = "Sassafras Roots"; ab.setTitle(current); tv1.setText(R.string.sassafrasroots); analytics(current); } if(track == 11){ String current = "When I Come Around"; ab.setTitle(current); tv1.setText(R.string.whencomearound); analytics(current); } if(track == 12){ String current = "Coming Clean"; ab.setTitle(current); tv1.setText(R.string.comingclean); analytics(current); } if(track == 13){ String current = "<NAME>"; ab.setTitle(current); tv1.setText(R.string.emeniussleepus); analytics(current); } if(track == 14){ String current = "In The End"; ab.setTitle(current); tv1.setText(R.string.intheend); analytics(current); } if(track == 15){ String current = "F.O.D."; ab.setTitle(current); tv1.setText(R.string.fod); analytics(current); } } @Override public boolean onCreateOptionsMenu(Menu menu) { return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case android.R.id.home: onBackPressed(); break; default: }; return super.onOptionsItemSelected(item); } //Checking and adding to database public void lookupTrack(String name, int i) { DBHandler db = new DBHandler(this, null, null, 1); Track findtrack = db.findTrack(name); if(findtrack != null) { Crouton.makeText(this, "Already in favorites", Style.ALERT).show(); } else { db.addTrack(new Track(name, i)); Crouton.makeText(this, "Added to favorites", Style.INFO).show(); } } //Analytics public void analytics(String s) { //Google Analytics // Set screen name. t.setScreenName(s); // Send a screen view. t.send(new HitBuilders.AppViewBuilder().build()); } @Override protected void onStart() { // TODO Auto-generated method stub //Get an Analytics tracker to report app starts & uncaught exceptions etc. GoogleAnalytics.getInstance(this).reportActivityStart(this); super.onStart(); } @Override protected void onStop() { // TODO Auto-generated method stub //Stop the analytics tracking GoogleAnalytics.getInstance(this).reportActivityStop(this); super.onStop(); } @Override protected void onDestroy() { // TODO Auto-generated method stub //Protect crouton Crouton.clearCroutonsForActivity(this); super.onDestroy(); } @Override protected void onResume() { // TODO Auto-generated method stub getPref(); super.onResume(); } private void getPref() { //Action bar color int ab_def_color= Color.parseColor("#222222"); int ab_color=PreferenceManager.getDefaultSharedPreferences(this).getInt("ab_theme", ab_def_color); ab.setBackgroundDrawable(new ColorDrawable(ab_color)); //Text Size int text_size = PreferenceManager.getDefaultSharedPreferences(this).getInt("text", 18); tv1.setTextSize(text_size); //Text Color int text_def_color= Color.parseColor("#000000"); int text_color=PreferenceManager.getDefaultSharedPreferences(this).getInt("text_theme", text_def_color); tv1.setTextColor(text_color); //Background transparency int def_alpha = 70; int alpha = PreferenceManager.getDefaultSharedPreferences(this).getInt("alpha", def_alpha); findViewById(R.id.dookie_layout).getBackground().setAlpha(alpha); //PoppyView int poppy_def_color=Color.parseColor("#40222222"); int poppy_color=PreferenceManager.getDefaultSharedPreferences(this).getInt("poppy_theme", poppy_def_color); poppyview.setBackgroundColor(poppy_color); //Display boolean display = PreferenceManager.getDefaultSharedPreferences(this).getBoolean("display", false); if(display) { tv1.setKeepScreenOn(true); } } }
13,067
0.65387
0.64171
485
25.962887
20.222338
113
false
false
0
0
0
0
0
0
3.490722
false
false
13
fc6e49caddb706f731808e09b46ccda3456c69f0
20,761,871,974,839
05b67bc78e1653dc27714c2e5d51c5450e8e0e9a
/app/src/main/java/com/yuri/cnbeta/http/CallServer.java
51b1a8639fdb7b499c10eb05227156ac54b67828
[]
no_license
xiayouli0122/Android-CnBeta-Client
https://github.com/xiayouli0122/Android-CnBeta-Client
631cbaa891921afcb1a79d64ca552bbdf6e968fe
66794f18de4862021c2c40af81f956e82882ffac
refs/heads/master
2020-12-20T13:20:39.853000
2016-08-01T08:28:34
2016-08-01T08:28:34
55,683,342
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.yuri.cnbeta.http; import android.content.Context; import com.yolanda.nohttp.NoHttp; import com.yolanda.nohttp.rest.Request; import com.yolanda.nohttp.rest.RequestQueue; /** * Created by Yuri on 2016/4/8. */ public class CallServer { private static CallServer mInstance; /** * 请求队列 */ private RequestQueue mRequestQueue; private CallServer() { //使用默认配置创建一个请求队列,默认队列支持3个请求 this.mRequestQueue = NoHttp.newRequestQueue(); } public static CallServer getInstance() { if (mInstance == null) { synchronized (CallServer.class) { if (mInstance == null) { mInstance = new CallServer(); } } } return mInstance; } /** * 添加一个请求到请求队列. * * @param what 用来标志请求, 当多个请求使用同一个{@link HttpListener}时, 在回调方法中会返回这个what. * @param request 请求对象. * @param callback 结果回调对象. */ public <T> void add(int what, Request<T> request, HttpListener<T> callback) { mRequestQueue.add(what, request, new HttpResponseListener<>(callback)); } /** * 取消这个sign标记的所有请求. */ public void cancelBySign(Object sign) { mRequestQueue.cancelBySign(sign); } /** * 取消队列中所有请求. */ public void cancelAll() { mRequestQueue.cancelAll(); } /** * 退出app时停止所有请求. */ public void stopAll() { mRequestQueue.stop(); } }
UTF-8
Java
1,688
java
CallServer.java
Java
[ { "context": "landa.nohttp.rest.RequestQueue;\n\n/**\n * Created by Yuri on 2016/4/8.\n */\npublic class CallServer {\n\n p", "end": 206, "score": 0.9290169477462769, "start": 202, "tag": "NAME", "value": "Yuri" } ]
null
[]
package com.yuri.cnbeta.http; import android.content.Context; import com.yolanda.nohttp.NoHttp; import com.yolanda.nohttp.rest.Request; import com.yolanda.nohttp.rest.RequestQueue; /** * Created by Yuri on 2016/4/8. */ public class CallServer { private static CallServer mInstance; /** * 请求队列 */ private RequestQueue mRequestQueue; private CallServer() { //使用默认配置创建一个请求队列,默认队列支持3个请求 this.mRequestQueue = NoHttp.newRequestQueue(); } public static CallServer getInstance() { if (mInstance == null) { synchronized (CallServer.class) { if (mInstance == null) { mInstance = new CallServer(); } } } return mInstance; } /** * 添加一个请求到请求队列. * * @param what 用来标志请求, 当多个请求使用同一个{@link HttpListener}时, 在回调方法中会返回这个what. * @param request 请求对象. * @param callback 结果回调对象. */ public <T> void add(int what, Request<T> request, HttpListener<T> callback) { mRequestQueue.add(what, request, new HttpResponseListener<>(callback)); } /** * 取消这个sign标记的所有请求. */ public void cancelBySign(Object sign) { mRequestQueue.cancelBySign(sign); } /** * 取消队列中所有请求. */ public void cancelAll() { mRequestQueue.cancelAll(); } /** * 退出app时停止所有请求. */ public void stopAll() { mRequestQueue.stop(); } }
1,688
0.579946
0.575203
69
20.391304
20.140245
81
false
false
0
0
0
0
0
0
0.289855
false
false
13
e8ac2c2383d6f891299b19054d84b24042822e68
20,761,871,974,487
7378b0f5f088fe3846e8f79c71cf2d77426fb120
/service_version/MainActivity.java
0e30c44d6999a033ab56b860e9f8e54eea2de8ac
[]
no_license
vb123er951/TryAccelerometer
https://github.com/vb123er951/TryAccelerometer
26d3110116c8c4a119245aceb95769e31217f351
1a67f1a69d1de35508caa31d02da166ddde468ae
refs/heads/master
2021-10-24T00:57:47.994000
2019-03-21T02:11:58
2019-03-21T02:11:58
100,248,204
0
0
null
false
2017-08-14T09:07:25
2017-08-14T09:00:36
2017-08-14T09:00:36
2017-08-14T09:07:25
0
0
0
0
null
null
null
package com.example.nol.tryaccelerometer; import android.content.ComponentName; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.content.ServiceConnection; import android.hardware.Sensor; import android.hardware.SensorEvent; import android.hardware.SensorEventListener; import android.hardware.SensorManager; import android.os.CountDownTimer; import android.os.Environment; import android.os.Handler; import android.os.IBinder; import android.support.v7.app.AlertDialog; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.support.v7.widget.LinearLayoutCompat; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.EditText; import android.widget.ListView; import android.widget.TextView; import android.widget.Toast; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.util.List; public class MainActivity extends AppCompatActivity implements ServiceConnection { private MyService s; TextView textX, textY, textZ, textStatus, textTime; String label = ""; public Long startTime; boolean timeFlag = false; FileOutputStream fileOutputStream; File file; private Handler handler = new Handler(); @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); startService(new Intent(this, MyService.class)); textX = (TextView) findViewById(R.id.textx); textY = (TextView) findViewById(R.id.texty); textZ = (TextView) findViewById(R.id.textz); textStatus = (TextView) findViewById(R.id.status); textTime = (TextView) findViewById(R.id.timer); } @Override protected void onResume(){ super.onResume(); Intent intent = new Intent(this, MyService.class); bindService(intent, this, Context.BIND_AUTO_CREATE); } @Override protected void onPause(){ super.onPause(); unbindService(this); } @Override public void onServiceConnected(ComponentName name, IBinder binder){ MyService.MyBinder b = (MyService.MyBinder) binder; s = b.getService(); Toast.makeText(MainActivity.this, "Connected", Toast.LENGTH_SHORT).show(); textX.setText("X: " + s.getX()); textY.setText("Y: " + s.getY()); textZ.setText("Z: " + s.getZ()); textStatus.setText(R.string.stop_record); textTime.setText("start recording for 0 minutes 0 seconds."); } @Override public void onServiceDisconnected(ComponentName name){ s = null; } @Override public void onWindowFocusChanged(boolean hasFocus){ super.onWindowFocusChanged(hasFocus); if (hasFocus){ getWindow().getDecorView().setSystemUiVisibility( View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY ); } } // click WRITE button to start recording public void clickWrite(View view){ //writeBtn = true; s.setWriteBtn(true); Toast.makeText(this, "Start recording", Toast.LENGTH_SHORT).show(); textStatus.setText(R.string.start_record); startTime = System.currentTimeMillis(); timeFlag = true; handler.removeCallbacks(updateTimer); handler.postDelayed(updateTimer, 1000); } // count the time of recording period private Runnable updateTimer = new Runnable(){ public void run(){ Long minutes = 0L, seconds = 0L; if (timeFlag) { Long currentTime = System.currentTimeMillis(); Long spentTime = currentTime - startTime; seconds = (spentTime / 1000) % 60; minutes = (spentTime / 1000) / 60; } textTime.setText("start recording for " + minutes + " minutes " + seconds + " seconds."); handler.postDelayed(this, 1000); } }; // click STOP button to stop recording // and ask user to give a label public void clickStop(View view){ s.setWriteBtn(false); textStatus.setText(R.string.stop_record); labelDialog(); timeFlag = false; } private void labelDialog(){ final String[] list = {"walk", "stand", "sit", "upstairs", "downstairs", "run"}; ArrayAdapter<String> listAdapter; final View item = LayoutInflater.from(MainActivity.this).inflate(R.layout.dialog_layout, null); final ListView listView = (ListView) item.findViewById(R.id.label); listAdapter = new ArrayAdapter(this, android.R.layout.simple_list_item_1, list); listView.setAdapter(listAdapter); AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this); builder.setTitle(R.string.label_title); builder.setView(item); final AlertDialog alert = builder.show(); listView.setOnItemClickListener(new AdapterView.OnItemClickListener(){ @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id){ label = list[position]; try { File sdcard = Environment.getExternalStorageDirectory(); File folder = new File(sdcard + File.separator + "test"); //folder.mkdirs(); file = new File(folder, "output.txt"); fileOutputStream = new FileOutputStream(file, true); fileOutputStream.write((label + "\n").getBytes()); fileOutputStream.flush(); fileOutputStream.close(); s.setWriteHead(false); Toast.makeText(MainActivity.this, label, Toast.LENGTH_SHORT).show(); } catch (IOException e){ e.printStackTrace(); } alert.dismiss(); } }); } }
UTF-8
Java
6,463
java
MainActivity.java
Java
[]
null
[]
package com.example.nol.tryaccelerometer; import android.content.ComponentName; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.content.ServiceConnection; import android.hardware.Sensor; import android.hardware.SensorEvent; import android.hardware.SensorEventListener; import android.hardware.SensorManager; import android.os.CountDownTimer; import android.os.Environment; import android.os.Handler; import android.os.IBinder; import android.support.v7.app.AlertDialog; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.support.v7.widget.LinearLayoutCompat; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.EditText; import android.widget.ListView; import android.widget.TextView; import android.widget.Toast; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.util.List; public class MainActivity extends AppCompatActivity implements ServiceConnection { private MyService s; TextView textX, textY, textZ, textStatus, textTime; String label = ""; public Long startTime; boolean timeFlag = false; FileOutputStream fileOutputStream; File file; private Handler handler = new Handler(); @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); startService(new Intent(this, MyService.class)); textX = (TextView) findViewById(R.id.textx); textY = (TextView) findViewById(R.id.texty); textZ = (TextView) findViewById(R.id.textz); textStatus = (TextView) findViewById(R.id.status); textTime = (TextView) findViewById(R.id.timer); } @Override protected void onResume(){ super.onResume(); Intent intent = new Intent(this, MyService.class); bindService(intent, this, Context.BIND_AUTO_CREATE); } @Override protected void onPause(){ super.onPause(); unbindService(this); } @Override public void onServiceConnected(ComponentName name, IBinder binder){ MyService.MyBinder b = (MyService.MyBinder) binder; s = b.getService(); Toast.makeText(MainActivity.this, "Connected", Toast.LENGTH_SHORT).show(); textX.setText("X: " + s.getX()); textY.setText("Y: " + s.getY()); textZ.setText("Z: " + s.getZ()); textStatus.setText(R.string.stop_record); textTime.setText("start recording for 0 minutes 0 seconds."); } @Override public void onServiceDisconnected(ComponentName name){ s = null; } @Override public void onWindowFocusChanged(boolean hasFocus){ super.onWindowFocusChanged(hasFocus); if (hasFocus){ getWindow().getDecorView().setSystemUiVisibility( View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY ); } } // click WRITE button to start recording public void clickWrite(View view){ //writeBtn = true; s.setWriteBtn(true); Toast.makeText(this, "Start recording", Toast.LENGTH_SHORT).show(); textStatus.setText(R.string.start_record); startTime = System.currentTimeMillis(); timeFlag = true; handler.removeCallbacks(updateTimer); handler.postDelayed(updateTimer, 1000); } // count the time of recording period private Runnable updateTimer = new Runnable(){ public void run(){ Long minutes = 0L, seconds = 0L; if (timeFlag) { Long currentTime = System.currentTimeMillis(); Long spentTime = currentTime - startTime; seconds = (spentTime / 1000) % 60; minutes = (spentTime / 1000) / 60; } textTime.setText("start recording for " + minutes + " minutes " + seconds + " seconds."); handler.postDelayed(this, 1000); } }; // click STOP button to stop recording // and ask user to give a label public void clickStop(View view){ s.setWriteBtn(false); textStatus.setText(R.string.stop_record); labelDialog(); timeFlag = false; } private void labelDialog(){ final String[] list = {"walk", "stand", "sit", "upstairs", "downstairs", "run"}; ArrayAdapter<String> listAdapter; final View item = LayoutInflater.from(MainActivity.this).inflate(R.layout.dialog_layout, null); final ListView listView = (ListView) item.findViewById(R.id.label); listAdapter = new ArrayAdapter(this, android.R.layout.simple_list_item_1, list); listView.setAdapter(listAdapter); AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this); builder.setTitle(R.string.label_title); builder.setView(item); final AlertDialog alert = builder.show(); listView.setOnItemClickListener(new AdapterView.OnItemClickListener(){ @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id){ label = list[position]; try { File sdcard = Environment.getExternalStorageDirectory(); File folder = new File(sdcard + File.separator + "test"); //folder.mkdirs(); file = new File(folder, "output.txt"); fileOutputStream = new FileOutputStream(file, true); fileOutputStream.write((label + "\n").getBytes()); fileOutputStream.flush(); fileOutputStream.close(); s.setWriteHead(false); Toast.makeText(MainActivity.this, label, Toast.LENGTH_SHORT).show(); } catch (IOException e){ e.printStackTrace(); } alert.dismiss(); } }); } }
6,463
0.635773
0.631441
183
34.31694
24.169666
105
false
false
0
0
0
0
0
0
0.786885
false
false
13
35b60c86c3806d695552d581cb6690b1332940a6
17,282,948,426,352
3ef62ced3537e88e1c2b9d290fd49ccaaf9223de
/spring-mongodb-recipe-project/src/main/java/com/spring5/projects/springmongodbrecipeproject/repositories/RecipeRepository.java
dc31f8a5b1555bfb30d59bc53bbd26d13d45b8bf
[ "MIT" ]
permissive
mhnvelu/spring-5-bootcamp
https://github.com/mhnvelu/spring-5-bootcamp
1756250fdd66b142668d3f2a6a54e50da3fd99b9
ff9d58a845f48119dafcd39c1a8c7d413eaf0afb
refs/heads/master
2023-02-12T18:50:20.415000
2021-01-13T00:06:57
2021-01-13T00:06:57
296,159,462
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.spring5.projects.springmongodbrecipeproject.repositories; import com.spring5.projects.springmongodbrecipeproject.domain.Recipe; import org.springframework.data.repository.CrudRepository; import org.springframework.stereotype.Repository; @Repository public interface RecipeRepository extends CrudRepository<Recipe, String> { }
UTF-8
Java
340
java
RecipeRepository.java
Java
[]
null
[]
package com.spring5.projects.springmongodbrecipeproject.repositories; import com.spring5.projects.springmongodbrecipeproject.domain.Recipe; import org.springframework.data.repository.CrudRepository; import org.springframework.stereotype.Repository; @Repository public interface RecipeRepository extends CrudRepository<Recipe, String> { }
340
0.867647
0.861765
9
36.777779
31.111904
74
false
false
0
0
0
0
0
0
0.555556
false
false
13
b34c08a825492333bb17edcc01e519dd2cbedcea
14,766,097,624,393
7630aa9aaa7cd08ffc809ad0ca001e577e72d28e
/app/src/main/java/com/mk/mkfighterresultdb/di/ShowResultActivityModule.java
8a47bd9c22b60d3dd1f05afb8fb08859c23511ab
[]
no_license
TT64/ResultDB
https://github.com/TT64/ResultDB
e0f8b6ccaffbaf2466afd48cf1429c3bcaa1a365
ce5bb542856beaa935c9483d6e5778d24864eb73
refs/heads/master
2020-04-10T18:52:24.851000
2019-07-17T19:24:08
2019-07-17T19:24:08
161,213,086
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.mk.mkfighterresultdb.di; import com.mk.mkfighterresultdb.mvp.OperateResultModel; import com.mk.mkfighterresultdb.mvp.ShowResultActivityContract; import dagger.Module; import dagger.Provides; @Module class ShowResultActivityModule { ShowResultActivityModule() { } @Provides @PresenterScope ShowResultActivityContract.Model provideModel() { return new OperateResultModel(); } }
UTF-8
Java
425
java
ShowResultActivityModule.java
Java
[]
null
[]
package com.mk.mkfighterresultdb.di; import com.mk.mkfighterresultdb.mvp.OperateResultModel; import com.mk.mkfighterresultdb.mvp.ShowResultActivityContract; import dagger.Module; import dagger.Provides; @Module class ShowResultActivityModule { ShowResultActivityModule() { } @Provides @PresenterScope ShowResultActivityContract.Model provideModel() { return new OperateResultModel(); } }
425
0.767059
0.767059
20
20.25
20.181366
63
false
false
0
0
0
0
0
0
0.3
false
false
13
8bcdc4d1eb92e80d087d4cad4e31d7fb1dfdaef7
8,916,352,174,762
05fe6882eac07e59d402b70f168e7d2f23e00781
/src/zenefi/grapTree.java
cf02e941d55fed99e17242d34484dabf83a3b4c9
[]
no_license
aayushuppal/Algorithms
https://github.com/aayushuppal/Algorithms
c50b8dc334d01d486683c5945d609cd929d17d87
8193a14df632b1a7e7de8fabe1818604085690a3
refs/heads/master
2020-05-04T14:06:54.890000
2015-11-05T04:13:58
2015-11-05T04:13:58
30,593,614
2
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package zenefi; import java.lang.reflect.Array; import java.util.*; /** * Created by hellsapphire on 10/4/2015. */ public class grapTree { public static void main(String[] args) { //int[][] adjMat = {{0, 1, 1, 0}, {1, 0, 1, 1}, {1, 1, 0, 0}, {0, 1, 0, 0}}; int[][] adjMat = {{0, 1, 0, 0, 0}, {1, 0, 1, 1, 0}, {0, 1, 0, 1, 1}, {0, 1, 1, 0, 1}, {0, 0, 1, 1, 0}}; System.out.println(findTriangles(adjMat)); } public static int findTriangles(int[][] M) { Map<Integer, ArrayList<Integer>> nodeToadjMap = new HashMap<Integer, ArrayList<Integer>>(); HashSet<String> triangleSet = new HashSet<String>(); for (int i = 0; i < M.length; i++) { List<String> temp = getTriangles(M[i], M); for (String tri : temp) { String x = i + "-" + tri; String[] arr = x.split("-"); Arrays.sort(arr); x = Arrays.toString(arr); triangleSet.add(x); } } return triangleSet.size(); } public static List<String> getTriangles(int[] A, int[][] M) { List<String> res = new ArrayList<String>(); int i = 0; int j = A.length - 1; while (i < j) { while (i < A.length && A[i] != 1) { i++; } if (i == A.length - 1) { break; } int a = i; int b = j; while (b > a) { if (A[b] == 1 && M[a][b] == 1) { String temp = a + "-" + b; res.add(temp); } b--; } i++; } return res; } // could be done, not very optimal again similar to previous public static void findTrianglesDFS(int root, int maxDepth, int[][] M) { int level = 0; List<Integer> adj = getAdj(root,M); } public static List<Integer> getAdj(int root, int[][] M) { List<Integer> res = new ArrayList<>(); for (int i = 0; i < M[root].length; i++) { if (M[root][i] == 1) { res.add(i); } } return res; } }
UTF-8
Java
2,224
java
grapTree.java
Java
[ { "context": "lect.Array;\nimport java.util.*;\n\n/**\n * Created by hellsapphire on 10/4/2015.\n */\npublic class grapTree {\n\n pu", "end": 100, "score": 0.9967539310455322, "start": 88, "tag": "USERNAME", "value": "hellsapphire" } ]
null
[]
package zenefi; import java.lang.reflect.Array; import java.util.*; /** * Created by hellsapphire on 10/4/2015. */ public class grapTree { public static void main(String[] args) { //int[][] adjMat = {{0, 1, 1, 0}, {1, 0, 1, 1}, {1, 1, 0, 0}, {0, 1, 0, 0}}; int[][] adjMat = {{0, 1, 0, 0, 0}, {1, 0, 1, 1, 0}, {0, 1, 0, 1, 1}, {0, 1, 1, 0, 1}, {0, 0, 1, 1, 0}}; System.out.println(findTriangles(adjMat)); } public static int findTriangles(int[][] M) { Map<Integer, ArrayList<Integer>> nodeToadjMap = new HashMap<Integer, ArrayList<Integer>>(); HashSet<String> triangleSet = new HashSet<String>(); for (int i = 0; i < M.length; i++) { List<String> temp = getTriangles(M[i], M); for (String tri : temp) { String x = i + "-" + tri; String[] arr = x.split("-"); Arrays.sort(arr); x = Arrays.toString(arr); triangleSet.add(x); } } return triangleSet.size(); } public static List<String> getTriangles(int[] A, int[][] M) { List<String> res = new ArrayList<String>(); int i = 0; int j = A.length - 1; while (i < j) { while (i < A.length && A[i] != 1) { i++; } if (i == A.length - 1) { break; } int a = i; int b = j; while (b > a) { if (A[b] == 1 && M[a][b] == 1) { String temp = a + "-" + b; res.add(temp); } b--; } i++; } return res; } // could be done, not very optimal again similar to previous public static void findTrianglesDFS(int root, int maxDepth, int[][] M) { int level = 0; List<Integer> adj = getAdj(root,M); } public static List<Integer> getAdj(int root, int[][] M) { List<Integer> res = new ArrayList<>(); for (int i = 0; i < M[root].length; i++) { if (M[root][i] == 1) { res.add(i); } } return res; } }
2,224
0.431655
0.405576
89
23.988764
24.281816
111
false
false
0
0
0
0
0
0
0.94382
false
false
13
4bf79dab5f22b4d9000aa0d9e9819f9c09f202a8
15,788,299,780,628
869380b19a3d35f6559f9a44cccfdbfd19352d55
/wear-settings/src/main/java/day/cloudy/apps/wear/settings/item/PendingIntentSettingsItem.java
6d6cf462a1c6436b4221bef30533862127a8e4a4
[ "Apache-2.0" ]
permissive
Gaelan-Bolger/WearSettings
https://github.com/Gaelan-Bolger/WearSettings
580b5922331f083a2a52671c9a7ecef0230e9b62
8656793ffbe0f43f1c57cd2ae1af7155de4ff0f2
refs/heads/master
2020-12-24T20:43:11.538000
2017-08-05T18:31:51
2017-08-05T18:31:51
57,212,047
16
2
null
null
null
null
null
null
null
null
null
null
null
null
null
package day.cloudy.apps.wear.settings.item; import android.app.PendingIntent; import android.support.annotation.DrawableRes; import android.support.annotation.NonNull; public class PendingIntentSettingsItem extends SettingsItem { public final PendingIntent intent; public PendingIntentSettingsItem(@DrawableRes int iconResId, String title, @NonNull PendingIntent intent) { super(iconResId, title); this.intent = intent; } }
UTF-8
Java
457
java
PendingIntentSettingsItem.java
Java
[]
null
[]
package day.cloudy.apps.wear.settings.item; import android.app.PendingIntent; import android.support.annotation.DrawableRes; import android.support.annotation.NonNull; public class PendingIntentSettingsItem extends SettingsItem { public final PendingIntent intent; public PendingIntentSettingsItem(@DrawableRes int iconResId, String title, @NonNull PendingIntent intent) { super(iconResId, title); this.intent = intent; } }
457
0.774617
0.774617
16
27.5625
29.622561
111
false
false
0
0
0
0
0
0
0.625
false
false
13
2125f3782ec97031e63964b9a6f6801cd5cdd00b
8,684,423,901,600
f082a3f51b93d9179917188c4c0d6de0c89bcbd4
/src/dice.java
273f04fb831a86082cdc8c8b5dfa86d5f1d8f50e
[]
no_license
russiantux/SpergProject
https://github.com/russiantux/SpergProject
5f41386fe642f8b3aa4ae1323c7849e5310ffc41
9dd3f7e2046d47c417dcff81cbf4e448a1a6223a
refs/heads/master
2020-12-30T12:55:30.589000
2017-05-20T05:08:23
2017-05-20T05:08:23
91,368,639
0
0
null
false
2017-05-19T18:13:05
2017-05-15T18:02:20
2017-05-15T18:43:28
2017-05-19T18:13:05
12
0
0
0
Java
null
null
public class dice { // private int dNumSides; private int dNum = 1; public static int rNum = 0; //defined dice has the given number of sides and the number of dice that will be used. public dice(int numSides, int numD) { //Lets the number of sides on dice and the number of dice vary. Default is 1 die. numSides = dNumSides; numD = dNum; } public dice(int numSides){ numSides = dNumSides; } dice d2 = new dice(2); dice d4 = new dice(4); dice d6 = new dice(6); dice d10 = new dice(10); dice d20 = new dice(20); dice d100 = new dice(100); public static int roll(int rollNum){ int rngNum = (int)(Math.random() * rollNum + 1); if( rngNum == 0) { return 1; } else { return rngNum; } //ensures that rolls are randomly generated by the computer. } }
UTF-8
Java
806
java
dice.java
Java
[]
null
[]
public class dice { // private int dNumSides; private int dNum = 1; public static int rNum = 0; //defined dice has the given number of sides and the number of dice that will be used. public dice(int numSides, int numD) { //Lets the number of sides on dice and the number of dice vary. Default is 1 die. numSides = dNumSides; numD = dNum; } public dice(int numSides){ numSides = dNumSides; } dice d2 = new dice(2); dice d4 = new dice(4); dice d6 = new dice(6); dice d10 = new dice(10); dice d20 = new dice(20); dice d100 = new dice(100); public static int roll(int rollNum){ int rngNum = (int)(Math.random() * rollNum + 1); if( rngNum == 0) { return 1; } else { return rngNum; } //ensures that rolls are randomly generated by the computer. } }
806
0.645161
0.612903
42
18.214285
20.835564
87
false
false
0
0
0
0
0
0
1.690476
false
false
13
5697ba1a95dd27ac1234e120000c2071af4b5ebe
11,751,030,523,927
513c1eb639ae80c0c3e9eb0a617cd1d00e2bc034
/src/net/demilich/metastone/game/actions/BattlecryAction.java
782dd57900b16a7c9e9bb7789357b9e9cb3599be
[ "MIT" ]
permissive
hillst/MetaStone
https://github.com/hillst/MetaStone
a21b63a1d2d02646ee3b6226261b4eb3304c175a
5882d834d32028f5f083543f0700e59ccf1aa1fe
refs/heads/master
2021-05-28T22:05:42.911000
2015-06-05T00:58:06
2015-06-05T00:58:06
36,316,023
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package net.demilich.metastone.game.actions; import java.util.function.Predicate; import net.demilich.metastone.game.GameContext; import net.demilich.metastone.game.Player; import net.demilich.metastone.game.entities.Entity; import net.demilich.metastone.game.spells.desc.SpellDesc; import net.demilich.metastone.game.targeting.EntityReference; import net.demilich.metastone.game.targeting.TargetSelection; public class BattlecryAction extends GameAction { public static BattlecryAction createBattlecry(SpellDesc spell) { return createBattlecry(spell, TargetSelection.NONE); } public static BattlecryAction createBattlecry(SpellDesc spell, TargetSelection targetSelection) { BattlecryAction battlecry = new BattlecryAction(spell); battlecry.setTargetRequirement(targetSelection); return battlecry; } private final SpellDesc spell; private boolean resolvedLate = false; private IBattlecryCondition condition; private Predicate<Entity> entityFilter; protected BattlecryAction(SpellDesc spell) { this.spell = spell; setActionType(ActionType.BATTLECRY); } public boolean canBeExecuted(GameContext context, Player player) { if (condition == null) { return true; } return condition.isFulfilled(context, player); } @Override public final boolean canBeExecutedOn(GameContext context, Entity entity) { if (!super.canBeExecutedOn(context, entity)) { return false; } if (getSource().getId() == entity.getId()) { return false; } if (getEntityFilter() == null) { return true; } return getEntityFilter().test(entity); } @Override public BattlecryAction clone() { BattlecryAction clone = BattlecryAction.createBattlecry(getSpell(), getTargetRequirement()); clone.setActionSuffix(getActionSuffix()); clone.setCondition(getCondition()); clone.setEntityFilter(getEntityFilter()); clone.setResolvedLate(isResolvedLate()); clone.setSource(getSource()); return clone; } @Override public void execute(GameContext context, int playerId) { EntityReference target = getSpell().hasPredefinedTarget() ? getSpell().getTarget() : getTargetKey(); context.getLogic().castSpell(playerId, getSpell(), getSource(), target); } public IBattlecryCondition getCondition() { return condition; } public Predicate<Entity> getEntityFilter() { return entityFilter; } @Override public String getPromptText() { return "[Battlecry]"; } public SpellDesc getSpell() { return spell; } public boolean isResolvedLate() { return resolvedLate; } @Override public boolean isSameActionGroup(GameAction anotherAction) { return anotherAction.getActionType() == getActionType(); } public void setCondition(IBattlecryCondition condition) { this.condition = condition; } public void setEntityFilter(Predicate<Entity> entityFilter) { this.entityFilter = entityFilter; } public void setResolvedLate(boolean resolvedLate) { this.resolvedLate = resolvedLate; } @Override public String toString() { return String.format("[%s '%s' resolvedLate:%s]", getActionType(), getSpell().getClass().getSimpleName(), resolvedLate); } }
UTF-8
Java
3,106
java
BattlecryAction.java
Java
[]
null
[]
package net.demilich.metastone.game.actions; import java.util.function.Predicate; import net.demilich.metastone.game.GameContext; import net.demilich.metastone.game.Player; import net.demilich.metastone.game.entities.Entity; import net.demilich.metastone.game.spells.desc.SpellDesc; import net.demilich.metastone.game.targeting.EntityReference; import net.demilich.metastone.game.targeting.TargetSelection; public class BattlecryAction extends GameAction { public static BattlecryAction createBattlecry(SpellDesc spell) { return createBattlecry(spell, TargetSelection.NONE); } public static BattlecryAction createBattlecry(SpellDesc spell, TargetSelection targetSelection) { BattlecryAction battlecry = new BattlecryAction(spell); battlecry.setTargetRequirement(targetSelection); return battlecry; } private final SpellDesc spell; private boolean resolvedLate = false; private IBattlecryCondition condition; private Predicate<Entity> entityFilter; protected BattlecryAction(SpellDesc spell) { this.spell = spell; setActionType(ActionType.BATTLECRY); } public boolean canBeExecuted(GameContext context, Player player) { if (condition == null) { return true; } return condition.isFulfilled(context, player); } @Override public final boolean canBeExecutedOn(GameContext context, Entity entity) { if (!super.canBeExecutedOn(context, entity)) { return false; } if (getSource().getId() == entity.getId()) { return false; } if (getEntityFilter() == null) { return true; } return getEntityFilter().test(entity); } @Override public BattlecryAction clone() { BattlecryAction clone = BattlecryAction.createBattlecry(getSpell(), getTargetRequirement()); clone.setActionSuffix(getActionSuffix()); clone.setCondition(getCondition()); clone.setEntityFilter(getEntityFilter()); clone.setResolvedLate(isResolvedLate()); clone.setSource(getSource()); return clone; } @Override public void execute(GameContext context, int playerId) { EntityReference target = getSpell().hasPredefinedTarget() ? getSpell().getTarget() : getTargetKey(); context.getLogic().castSpell(playerId, getSpell(), getSource(), target); } public IBattlecryCondition getCondition() { return condition; } public Predicate<Entity> getEntityFilter() { return entityFilter; } @Override public String getPromptText() { return "[Battlecry]"; } public SpellDesc getSpell() { return spell; } public boolean isResolvedLate() { return resolvedLate; } @Override public boolean isSameActionGroup(GameAction anotherAction) { return anotherAction.getActionType() == getActionType(); } public void setCondition(IBattlecryCondition condition) { this.condition = condition; } public void setEntityFilter(Predicate<Entity> entityFilter) { this.entityFilter = entityFilter; } public void setResolvedLate(boolean resolvedLate) { this.resolvedLate = resolvedLate; } @Override public String toString() { return String.format("[%s '%s' resolvedLate:%s]", getActionType(), getSpell().getClass().getSimpleName(), resolvedLate); } }
3,106
0.764005
0.764005
114
26.245613
26.605488
122
false
false
0
0
0
0
0
0
1.605263
false
false
13
d261d0a93230c7a9f2d09b63a05200d221f75754
14,963,666,120,488
40dd2c2ba934bcbc611b366cf57762dcb14c48e3
/RI_Stack/java/src/base/org/ocap/event/UserEvent.java
6508b412b2b2b6960b3e9f4d65037313a724e22c
[]
no_license
amirna2/OCAP-RI
https://github.com/amirna2/OCAP-RI
afe0d924dcf057020111406b1d29aa2b3a796e10
254f0a8ebaf5b4f09f4a7c8f4961e9596c49ccb7
refs/heads/master
2020-03-10T03:22:34.355000
2018-04-11T23:08:49
2018-04-11T23:08:49
129,163,048
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
// COPYRIGHT_BEGIN // DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER // // Copyright (C) 2008-2013, Cable Television Laboratories, Inc. // // This software is available under multiple licenses: // // (1) BSD 2-clause // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // ·Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // ·Redistributions in binary form must reproduce the above copyright notice, this list of conditions // and the following disclaimer in the documentation and/or other materials provided with the // distribution. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED // TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A // PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // (2) GPL Version 2 // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, version 2. This program is distributed // in the hope that it will be useful, but WITHOUT ANY WARRANTY; without // even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR // PURPOSE. See the GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with this program.If not, see<http:www.gnu.org/licenses/>. // // (3)CableLabs License // If you or the company you represent has a separate agreement with CableLabs // concerning the use of this code, your rights and obligations with respect // to this code shall be as set forth therein. No license is granted hereunder // for any other purpose. // // Please contact CableLabs if you need additional information or // have any questions. // // CableLabs // 858 Coal Creek Cir // Louisville, CO 80027-9750 // 303 661-9100 // COPYRIGHT_END package org.ocap.event; import org.ocap.system.MonitorAppPermission; import org.cablelabs.impl.util.SecurityUtil; /** * Represents a user event. A user event is defined by a family, a type and * either a code or a character. Unless stated otherwise, all constants used in * this class are defined in <code>org.ocap.ui.event.OcRcEvent</code>, * <code>java.awt.event.KeyEvent</code> and their parent classes. */ //findbugs complains about this pattern - shadowing superclass' name. //Unfortunately, its a common pattern in the RI (so we ignore it). public class UserEvent extends org.dvb.event.UserEvent { /** * Constructor for a new UserEvent object representing a key being pressed. * * @param source * the <code>EventManager</code> which is the source of the * event. * @param family * the event family. * @param type * the event type. Either one of KEY_PRESSED or KEY_RELEASED. * @param code * the event code. One of the constants whose name begins in * "VK_" defined in java.ui.event.KeyEvent, org.havi.ui.event or * org.ocap.ui.event.OcRcEvent. * @param modifiers * the modifiers active when the key was pressed. These have the * same semantics as modifiers in * <code>java.awt.event.KeyEvent</code>. * @param when * a long integer that specifies the time the event occurred. * */ public UserEvent(Object source, int family, int type, int code, int modifiers, long when) { super(source, family, type, code, modifiers, when); } /** * Constructor for a new UserEvent object representing a key being typed. * This is the combination of a key being pressed and then being released. * The type of UserEvents created with this constructor shall be KEY_TYPED. * Key combinations which do not result in characters, such as action keys * like F1, shall not generate KEY_TYPED events. * * @param source * the <code>EventManager</code> which is the source of the event * @param family * the event family. * @param keyChar * the character typed * @since MHP 1.0.1 * @param when * a long integer that specifies the time the event occurred */ public UserEvent(Object source, int family, char keyChar, long when) { super(source, family, keyChar, when); } /** * Modifies the event code. For KEY_TYPED events, the code is VK_UNDEFINED. * * @throws SecurityException * if the caller does not have monitorapplication permission * ("filterUserEvents"). * * @since OCAP 1.0 * */ public void setCode(int code) { checkPermission(); this.code = code; } /** * Modifies the character associated with the key in this event. If no valid * Unicode character exists for this key event, keyChar must be * CHAR_UNDEFINED. * * @throws SecurityException * if the caller does not have monitorapplication permission * ("filterUserEvents"). * * @since OCAP 1.0 */ public void setKeyChar(char keychar) { checkPermission(); this.keyChar = keychar; } /** * Called by <code>setCode()</code> and <code>setKeyChar</code> to verify * adequate permissions. * * @throws SecurityException * if the caller does not have monitorapplication permission * ("filterUserEvents"). */ private void checkPermission() { SecurityUtil.checkPermission(new MonitorAppPermission("filterUserEvents")); } }
UTF-8
Java
6,612
java
UserEvent.java
Java
[]
null
[]
// COPYRIGHT_BEGIN // DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER // // Copyright (C) 2008-2013, Cable Television Laboratories, Inc. // // This software is available under multiple licenses: // // (1) BSD 2-clause // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // ·Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // ·Redistributions in binary form must reproduce the above copyright notice, this list of conditions // and the following disclaimer in the documentation and/or other materials provided with the // distribution. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED // TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A // PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // (2) GPL Version 2 // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, version 2. This program is distributed // in the hope that it will be useful, but WITHOUT ANY WARRANTY; without // even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR // PURPOSE. See the GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with this program.If not, see<http:www.gnu.org/licenses/>. // // (3)CableLabs License // If you or the company you represent has a separate agreement with CableLabs // concerning the use of this code, your rights and obligations with respect // to this code shall be as set forth therein. No license is granted hereunder // for any other purpose. // // Please contact CableLabs if you need additional information or // have any questions. // // CableLabs // 858 Coal Creek Cir // Louisville, CO 80027-9750 // 303 661-9100 // COPYRIGHT_END package org.ocap.event; import org.ocap.system.MonitorAppPermission; import org.cablelabs.impl.util.SecurityUtil; /** * Represents a user event. A user event is defined by a family, a type and * either a code or a character. Unless stated otherwise, all constants used in * this class are defined in <code>org.ocap.ui.event.OcRcEvent</code>, * <code>java.awt.event.KeyEvent</code> and their parent classes. */ //findbugs complains about this pattern - shadowing superclass' name. //Unfortunately, its a common pattern in the RI (so we ignore it). public class UserEvent extends org.dvb.event.UserEvent { /** * Constructor for a new UserEvent object representing a key being pressed. * * @param source * the <code>EventManager</code> which is the source of the * event. * @param family * the event family. * @param type * the event type. Either one of KEY_PRESSED or KEY_RELEASED. * @param code * the event code. One of the constants whose name begins in * "VK_" defined in java.ui.event.KeyEvent, org.havi.ui.event or * org.ocap.ui.event.OcRcEvent. * @param modifiers * the modifiers active when the key was pressed. These have the * same semantics as modifiers in * <code>java.awt.event.KeyEvent</code>. * @param when * a long integer that specifies the time the event occurred. * */ public UserEvent(Object source, int family, int type, int code, int modifiers, long when) { super(source, family, type, code, modifiers, when); } /** * Constructor for a new UserEvent object representing a key being typed. * This is the combination of a key being pressed and then being released. * The type of UserEvents created with this constructor shall be KEY_TYPED. * Key combinations which do not result in characters, such as action keys * like F1, shall not generate KEY_TYPED events. * * @param source * the <code>EventManager</code> which is the source of the event * @param family * the event family. * @param keyChar * the character typed * @since MHP 1.0.1 * @param when * a long integer that specifies the time the event occurred */ public UserEvent(Object source, int family, char keyChar, long when) { super(source, family, keyChar, when); } /** * Modifies the event code. For KEY_TYPED events, the code is VK_UNDEFINED. * * @throws SecurityException * if the caller does not have monitorapplication permission * ("filterUserEvents"). * * @since OCAP 1.0 * */ public void setCode(int code) { checkPermission(); this.code = code; } /** * Modifies the character associated with the key in this event. If no valid * Unicode character exists for this key event, keyChar must be * CHAR_UNDEFINED. * * @throws SecurityException * if the caller does not have monitorapplication permission * ("filterUserEvents"). * * @since OCAP 1.0 */ public void setKeyChar(char keychar) { checkPermission(); this.keyChar = keychar; } /** * Called by <code>setCode()</code> and <code>setKeyChar</code> to verify * adequate permissions. * * @throws SecurityException * if the caller does not have monitorapplication permission * ("filterUserEvents"). */ private void checkPermission() { SecurityUtil.checkPermission(new MonitorAppPermission("filterUserEvents")); } }
6,612
0.657186
0.65053
163
39.552147
30.701841
109
false
false
0
0
0
0
0
0
0.404908
false
false
13
80cd2851dca02de425538292bb71d384d09ab518
11,802,570,170,626
35facf017f078258b1d1652a678d19710e746c1a
/src/Test_3_4/Test_4_4_FootballDemo.java
76486c62c35f1959f9a34063eb872e66ec29e7f9
[]
no_license
rui0820/ImoocTestProj
https://github.com/rui0820/ImoocTestProj
281b5667b0a05f4c85e9cbec51c01890d5aba30d
167ac741a43941dce560044afc8bcc39353ab9e6
refs/heads/master
2020-07-09T22:24:56.096000
2019-09-15T08:25:01
2019-09-15T08:25:01
204,096,657
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package Test_3_4; import java.util.HashMap; import java.util.Iterator; import java.util.Map; import java.util.Map.Entry; import java.util.Set; public class Test_4_4_FootballDemo { public static void main(String[] args) { //定义HashMap的对象并添加数据 Map<String,String> footBall = new HashMap(); footBall.put("2014", "德国"); footBall.put("2010", "西班牙"); footBall.put("2006", "意大利"); footBall.put("2002", "巴西"); footBall.put("1998", "法国"); //使用迭代器的方式遍历 System.out.println("使用迭代器方式进行输出:"); Iterator<String> it = footBall.values().iterator(); while(it.hasNext()) { System.out.print(it.next() + " "); } System.out.println(); //使用EntrySet同时获取key和value System.out.println("使用EntrySet进行输出:"); Set<Entry<String,String>> entrySet = footBall.entrySet(); for(Entry<String,String> entry:entrySet) { System.out.println(entry.getKey() + "-" + entry.getValue()); } } }
UTF-8
Java
1,044
java
Test_4_4_FootballDemo.java
Java
[]
null
[]
package Test_3_4; import java.util.HashMap; import java.util.Iterator; import java.util.Map; import java.util.Map.Entry; import java.util.Set; public class Test_4_4_FootballDemo { public static void main(String[] args) { //定义HashMap的对象并添加数据 Map<String,String> footBall = new HashMap(); footBall.put("2014", "德国"); footBall.put("2010", "西班牙"); footBall.put("2006", "意大利"); footBall.put("2002", "巴西"); footBall.put("1998", "法国"); //使用迭代器的方式遍历 System.out.println("使用迭代器方式进行输出:"); Iterator<String> it = footBall.values().iterator(); while(it.hasNext()) { System.out.print(it.next() + " "); } System.out.println(); //使用EntrySet同时获取key和value System.out.println("使用EntrySet进行输出:"); Set<Entry<String,String>> entrySet = footBall.entrySet(); for(Entry<String,String> entry:entrySet) { System.out.println(entry.getKey() + "-" + entry.getValue()); } } }
1,044
0.649785
0.623922
33
27.121212
17.449074
63
false
false
0
0
0
0
0
0
1.69697
false
false
13
4a20f297f2657d21bebd33651d651f1c7e4aa8fc
20,736,102,144,301
d7e908df2d8ca7c29d905f4919247eddaae08d15
/src/main/java/com/card/app/service/impl/AbstractSubContentService.java
2c8d963a448c2f49c5ca8b9d4eb5ed145fac6819
[]
no_license
ashu8051/playcard
https://github.com/ashu8051/playcard
4d3a0cc64c184bf8f4fd8409270cd937d8be135e
aec82444277922c460555dc30e6be08ed1240eb3
refs/heads/master
2021-01-20T08:33:25.812000
2017-08-29T18:42:55
2017-08-29T18:42:55
101,561,750
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.card.app.service.impl; import java.io.Serializable; import java.util.List; import javax.transaction.Transactional; import org.springframework.beans.factory.annotation.Autowired; import com.card.app.dao.SubContentDao; import com.card.app.model.SubContent; import com.card.app.model.TopicContent; import com.card.app.service.GenericService; public abstract class AbstractSubContentService<E> implements GenericService<SubContent> { @Autowired SubContentDao subContentDao; @Override @Transactional public void delete(SubContent entity) { // TODO Auto-generated method stub subContentDao.delete(entity); } @Override @Transactional public void deleteAll() { // TODO Auto-generated method stub subContentDao.deleteAll(); } @Override public List<SubContent> findAll() { // TODO Auto-generated method stub return subContentDao.findAll(); } @Override public List<SubContent> findAllByExample(SubContent entity) { // TODO Auto-generated method stub return subContentDao.findAllByExample(entity); } @Override public SubContent findById(Serializable id) { // TODO Auto-generated method stub return subContentDao.findById(id); } @Override @Transactional public Serializable save(SubContent entity) { // TODO Auto-generated method stub return subContentDao.save(entity); } @Override @Transactional public void saveOrUpdate(SubContent entity) { // TODO Auto-generated method stub subContentDao.saveOrUpdate(entity); } }
UTF-8
Java
1,570
java
AbstractSubContentService.java
Java
[]
null
[]
package com.card.app.service.impl; import java.io.Serializable; import java.util.List; import javax.transaction.Transactional; import org.springframework.beans.factory.annotation.Autowired; import com.card.app.dao.SubContentDao; import com.card.app.model.SubContent; import com.card.app.model.TopicContent; import com.card.app.service.GenericService; public abstract class AbstractSubContentService<E> implements GenericService<SubContent> { @Autowired SubContentDao subContentDao; @Override @Transactional public void delete(SubContent entity) { // TODO Auto-generated method stub subContentDao.delete(entity); } @Override @Transactional public void deleteAll() { // TODO Auto-generated method stub subContentDao.deleteAll(); } @Override public List<SubContent> findAll() { // TODO Auto-generated method stub return subContentDao.findAll(); } @Override public List<SubContent> findAllByExample(SubContent entity) { // TODO Auto-generated method stub return subContentDao.findAllByExample(entity); } @Override public SubContent findById(Serializable id) { // TODO Auto-generated method stub return subContentDao.findById(id); } @Override @Transactional public Serializable save(SubContent entity) { // TODO Auto-generated method stub return subContentDao.save(entity); } @Override @Transactional public void saveOrUpdate(SubContent entity) { // TODO Auto-generated method stub subContentDao.saveOrUpdate(entity); } }
1,570
0.733121
0.733121
70
20.428572
19.782801
90
false
false
0
0
0
0
0
0
1.171429
false
false
13
69bcfee189ff4b2e914e368cb823dc74bf18031a
5,540,507,819,910
c1c8f9136c59bfa0efcccd2f549729ab17065140
/HuarenLib/src/com/hr/huarenlib/net/request/HttpClientUtil.java
472b4c68a3736a5d69ffa27d12f4fa2b5d29c9b7
[]
no_license
huangmingming/huaren
https://github.com/huangmingming/huaren
084e9b95602011059e88662b281dcd2eee2d97d9
637702ce6de615b68599c71e5d0c0af1ba5ecfcd
refs/heads/master
2021-01-02T08:50:05.571000
2017-08-02T07:27:38
2017-08-02T07:27:38
96,666,793
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.hr.huarenlib.net.request; import java.io.File; import java.io.FileNotFoundException; import java.nio.charset.Charset; import java.util.List; import java.util.Map; import org.apache.http.HttpResponse; import org.apache.http.HttpStatus; import org.apache.http.NameValuePair; import org.apache.http.client.HttpClient; import org.apache.http.client.entity.UrlEncodedFormEntity; import org.apache.http.client.methods.HttpGet; import org.apache.http.client.methods.HttpPost; import org.apache.http.entity.mime.MultipartEntity; import org.apache.http.entity.mime.content.ContentBody; import org.apache.http.entity.mime.content.FileBody; import org.apache.http.entity.mime.content.StringBody; import org.apache.http.impl.client.DefaultHttpClient; import org.apache.http.params.BasicHttpParams; import org.apache.http.params.HttpConnectionParams; import org.apache.http.params.HttpParams; import org.apache.http.util.EntityUtils; import android.util.Log; /** * @auto ysp * http请求工具 **/ public class HttpClientUtil { /** * 连接超时 */ public static final int CONNECTION_TIME_OUT = 1000 * 30; /** * 响应超时 */ public static final int SO_TIMEOUT = 1000 * 30; /** * 发起�?个post请求,包含文件上传,并返回服务器返回的字符串 * * @param url 本次请求的URL路径 * @param map 请求的参�?,该Map集合中Value值只会取两种类型,String & File<br> * <B>注意:</B><br> * <li>1. 如果Value不是File类型,则会调用Value.toString(),如果你保存的是个POJO对象的话,请重写toString()<br> * <li>2. 如果Value是File类型,并且文件不存在的�?,会抛�? FileNotFoundException 异常<br> * @param encoding 请求和接收字符串的编�? 格式,如果因为编码不正�?,则会默认使用UTF-8进行编码 * @return 返回请求的结果字符串 * @throws Exception 可能抛出多种网络或IO异常 */ public static String post(String url, Map<String, Object> map, String encoding) throws Exception { HttpParams params = new BasicHttpParams(); //实例化Post参数对象 HttpConnectionParams.setConnectionTimeout(params, CONNECTION_TIME_OUT); //设置请求超时 HttpConnectionParams.setSoTimeout(params, SO_TIMEOUT); //设置响应超时 HttpClient client = new DefaultHttpClient(params); //实例化一个连接对�? HttpPost post = new HttpPost(url); //根据Post参数,实例化一个Post对象 MultipartEntity entity = new MultipartEntity(); //实例化请求实�?,请求正文 if (map != null && !map.isEmpty()) { for (Map.Entry<String, Object> entry : map.entrySet()) { //迭代Map集合 Object obj = entry.getValue(); //获取集合中的�? ContentBody body = null; //*获取集合中的Value,如果当前的Value是File类型,则new �?个FileBody,如果是字符串类型,则new�?个StringBody //*并将该对象保存到请求实体�? if (obj != null) { if (obj instanceof File) { File file = (File) obj; if (file.exists()) { body = new FileBody(file); } else { throw new FileNotFoundException("File Not Found"); } } else { body = new StringBody(entry.getValue().toString(), Charset.forName(encoding)); } entity.addPart(entry.getKey(), body); //将正文保存到请求实体类中 } } } post.setEntity(entity); //将请求实体保存到Post的实体参数中 try { HttpResponse response = client.execute(post); //执行Post方法 return EntityUtils.toString(response.getEntity(), encoding); //根据字符编码返回字符�? } catch (Exception e) { throw e; } finally { client.getConnectionManager().shutdown(); //释放连接�?有资�? } } /** * 发一起个Post请求,�?单的Text方式 * * @param url 请求URL * @param parameters 请求参数 * @param encoding 字符编码 * @return * @throws Exception */ public static String post(String url, List<NameValuePair> parameters, String encoding) throws Exception { BasicHttpParams httpParameters = new BasicHttpParams(); HttpConnectionParams.setConnectionTimeout(httpParameters, CONNECTION_TIME_OUT); HttpConnectionParams.setSoTimeout(httpParameters, SO_TIMEOUT); HttpClient httpClient = new DefaultHttpClient(httpParameters); HttpPost post = new HttpPost(url); HttpResponse response; /**打印出URL*/ url += "?"; for (int i = 0; i < parameters.size(); i++) { url += parameters.get(i).getName() + "=" + parameters.get(i).getValue(); if (i != parameters.size() - 1) { url += "&"; } } //Log.d("NetHelper", url); try { UrlEncodedFormEntity encode = new UrlEncodedFormEntity(parameters, encoding); post.setEntity(encode); response = httpClient.execute(post); return EntityUtils.toString(response.getEntity()); } catch (Exception e) { throw e; } } /** * 发一起个Post请求,�?单的Text方式,请求数据和返回数据均以UTF-8编码, * * @param url 请求URL * @param parameters 请求参数 * @return Json格式字符�? * @throws Exception */ public static String post(String url, List<NameValuePair> parameters) throws Exception { return post(url, parameters, "UTF-8"); } /** * 发一起个Get请求,�?单的Text方式 * * @param url 请求URL * @throws Exception */ public static String get(String url) throws Exception { BasicHttpParams httpParameters = new BasicHttpParams(); HttpConnectionParams.setConnectionTimeout(httpParameters, CONNECTION_TIME_OUT); HttpConnectionParams.setSoTimeout(httpParameters, SO_TIMEOUT); HttpClient httpClient = new DefaultHttpClient(httpParameters); HttpGet get = new HttpGet(url); HttpResponse response; try { response = httpClient.execute(get); if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) { return EntityUtils.toString(response.getEntity()); } return ""; } catch (Exception e) { throw e; } } }
UTF-8
Java
7,398
java
HttpClientUtil.java
Java
[ { "context": "ityUtils;\n\nimport android.util.Log;\n\n\n/**\n * @auto ysp\n * http请求工具\n **/\npublic class HttpClientUtil {\n ", "end": 979, "score": 0.9985380172729492, "start": 976, "tag": "USERNAME", "value": "ysp" } ]
null
[]
package com.hr.huarenlib.net.request; import java.io.File; import java.io.FileNotFoundException; import java.nio.charset.Charset; import java.util.List; import java.util.Map; import org.apache.http.HttpResponse; import org.apache.http.HttpStatus; import org.apache.http.NameValuePair; import org.apache.http.client.HttpClient; import org.apache.http.client.entity.UrlEncodedFormEntity; import org.apache.http.client.methods.HttpGet; import org.apache.http.client.methods.HttpPost; import org.apache.http.entity.mime.MultipartEntity; import org.apache.http.entity.mime.content.ContentBody; import org.apache.http.entity.mime.content.FileBody; import org.apache.http.entity.mime.content.StringBody; import org.apache.http.impl.client.DefaultHttpClient; import org.apache.http.params.BasicHttpParams; import org.apache.http.params.HttpConnectionParams; import org.apache.http.params.HttpParams; import org.apache.http.util.EntityUtils; import android.util.Log; /** * @auto ysp * http请求工具 **/ public class HttpClientUtil { /** * 连接超时 */ public static final int CONNECTION_TIME_OUT = 1000 * 30; /** * 响应超时 */ public static final int SO_TIMEOUT = 1000 * 30; /** * 发起�?个post请求,包含文件上传,并返回服务器返回的字符串 * * @param url 本次请求的URL路径 * @param map 请求的参�?,该Map集合中Value值只会取两种类型,String & File<br> * <B>注意:</B><br> * <li>1. 如果Value不是File类型,则会调用Value.toString(),如果你保存的是个POJO对象的话,请重写toString()<br> * <li>2. 如果Value是File类型,并且文件不存在的�?,会抛�? FileNotFoundException 异常<br> * @param encoding 请求和接收字符串的编�? 格式,如果因为编码不正�?,则会默认使用UTF-8进行编码 * @return 返回请求的结果字符串 * @throws Exception 可能抛出多种网络或IO异常 */ public static String post(String url, Map<String, Object> map, String encoding) throws Exception { HttpParams params = new BasicHttpParams(); //实例化Post参数对象 HttpConnectionParams.setConnectionTimeout(params, CONNECTION_TIME_OUT); //设置请求超时 HttpConnectionParams.setSoTimeout(params, SO_TIMEOUT); //设置响应超时 HttpClient client = new DefaultHttpClient(params); //实例化一个连接对�? HttpPost post = new HttpPost(url); //根据Post参数,实例化一个Post对象 MultipartEntity entity = new MultipartEntity(); //实例化请求实�?,请求正文 if (map != null && !map.isEmpty()) { for (Map.Entry<String, Object> entry : map.entrySet()) { //迭代Map集合 Object obj = entry.getValue(); //获取集合中的�? ContentBody body = null; //*获取集合中的Value,如果当前的Value是File类型,则new �?个FileBody,如果是字符串类型,则new�?个StringBody //*并将该对象保存到请求实体�? if (obj != null) { if (obj instanceof File) { File file = (File) obj; if (file.exists()) { body = new FileBody(file); } else { throw new FileNotFoundException("File Not Found"); } } else { body = new StringBody(entry.getValue().toString(), Charset.forName(encoding)); } entity.addPart(entry.getKey(), body); //将正文保存到请求实体类中 } } } post.setEntity(entity); //将请求实体保存到Post的实体参数中 try { HttpResponse response = client.execute(post); //执行Post方法 return EntityUtils.toString(response.getEntity(), encoding); //根据字符编码返回字符�? } catch (Exception e) { throw e; } finally { client.getConnectionManager().shutdown(); //释放连接�?有资�? } } /** * 发一起个Post请求,�?单的Text方式 * * @param url 请求URL * @param parameters 请求参数 * @param encoding 字符编码 * @return * @throws Exception */ public static String post(String url, List<NameValuePair> parameters, String encoding) throws Exception { BasicHttpParams httpParameters = new BasicHttpParams(); HttpConnectionParams.setConnectionTimeout(httpParameters, CONNECTION_TIME_OUT); HttpConnectionParams.setSoTimeout(httpParameters, SO_TIMEOUT); HttpClient httpClient = new DefaultHttpClient(httpParameters); HttpPost post = new HttpPost(url); HttpResponse response; /**打印出URL*/ url += "?"; for (int i = 0; i < parameters.size(); i++) { url += parameters.get(i).getName() + "=" + parameters.get(i).getValue(); if (i != parameters.size() - 1) { url += "&"; } } //Log.d("NetHelper", url); try { UrlEncodedFormEntity encode = new UrlEncodedFormEntity(parameters, encoding); post.setEntity(encode); response = httpClient.execute(post); return EntityUtils.toString(response.getEntity()); } catch (Exception e) { throw e; } } /** * 发一起个Post请求,�?单的Text方式,请求数据和返回数据均以UTF-8编码, * * @param url 请求URL * @param parameters 请求参数 * @return Json格式字符�? * @throws Exception */ public static String post(String url, List<NameValuePair> parameters) throws Exception { return post(url, parameters, "UTF-8"); } /** * 发一起个Get请求,�?单的Text方式 * * @param url 请求URL * @throws Exception */ public static String get(String url) throws Exception { BasicHttpParams httpParameters = new BasicHttpParams(); HttpConnectionParams.setConnectionTimeout(httpParameters, CONNECTION_TIME_OUT); HttpConnectionParams.setSoTimeout(httpParameters, SO_TIMEOUT); HttpClient httpClient = new DefaultHttpClient(httpParameters); HttpGet get = new HttpGet(url); HttpResponse response; try { response = httpClient.execute(get); if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) { return EntityUtils.toString(response.getEntity()); } return ""; } catch (Exception e) { throw e; } } }
7,398
0.556527
0.553663
169
38.254436
32.844086
120
false
false
0
0
0
0
0
0
0.668639
false
false
13
623175a8c29548392389d8534667f0ca0e2c445c
3,762,391,418,945
45c668c47c8cc9f066bff6f51dadc5c0bf004be9
/camera/src/main/java/com/videonasocialmedia/camera/utils/VideoCameraFormat.java
f5bd569ae7b15852b1f7765aaf2523bd201e081f
[]
no_license
IAgof/ViMoJo
https://github.com/IAgof/ViMoJo
6a6076d8a778342f0b6c978407c77b207d59056f
06c72da3ea7dd810afd6e3b3694bc641a78b9653
refs/heads/master
2021-10-19T07:09:14.915000
2019-02-18T21:20:38
2019-02-18T21:20:38
62,631,224
2
1
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.videonasocialmedia.camera.utils; import static android.media.MediaRecorder.AudioEncoder.AAC; import static android.media.MediaRecorder.OutputFormat.MPEG_4; import static android.media.MediaRecorder.VideoEncoder.H264; /** * Created by alvaro on 25/01/17. */ public class VideoCameraFormat { private int videoWidth = 1280; private int videoHeight = 720; private int videoBitrate = 16 * 1000 * 1000; private int audioBitrate = 192 * 1000; private int audioChannels = 1; private int samplingRate = 48 * 1000; private int frameRate = 30; private int videoCodec = H264; private int audioCodec = AAC; private int fileFormat = MPEG_4; public VideoCameraFormat(int videoWidth, int videoHeight, int videoBitrate, int frameRate){ this.videoWidth = videoWidth; this.videoHeight = videoHeight; this.videoBitrate = videoBitrate; this.frameRate = frameRate; } public int getVideoWidth() { return videoWidth; } public int getVideoHeight() { return videoHeight; } public int getVideoBitrate() { return videoBitrate; } public int getAudioBitrate() { return audioBitrate; } public int getAudioChannels() { return audioChannels; } public int getAudioSamplingRate() { return samplingRate; } public int getFrameRate() { return frameRate; } public int getVideoCodec() { return videoCodec; } public int getAudioCodec() { return audioCodec; } public int getFileFormat() { return fileFormat; } }
UTF-8
Java
1,520
java
VideoCameraFormat.java
Java
[ { "context": "ediaRecorder.VideoEncoder.H264;\n\n/**\n * Created by alvaro on 25/01/17.\n */\n\npublic class VideoCameraFormat ", "end": 255, "score": 0.9973163604736328, "start": 249, "tag": "USERNAME", "value": "alvaro" } ]
null
[]
package com.videonasocialmedia.camera.utils; import static android.media.MediaRecorder.AudioEncoder.AAC; import static android.media.MediaRecorder.OutputFormat.MPEG_4; import static android.media.MediaRecorder.VideoEncoder.H264; /** * Created by alvaro on 25/01/17. */ public class VideoCameraFormat { private int videoWidth = 1280; private int videoHeight = 720; private int videoBitrate = 16 * 1000 * 1000; private int audioBitrate = 192 * 1000; private int audioChannels = 1; private int samplingRate = 48 * 1000; private int frameRate = 30; private int videoCodec = H264; private int audioCodec = AAC; private int fileFormat = MPEG_4; public VideoCameraFormat(int videoWidth, int videoHeight, int videoBitrate, int frameRate){ this.videoWidth = videoWidth; this.videoHeight = videoHeight; this.videoBitrate = videoBitrate; this.frameRate = frameRate; } public int getVideoWidth() { return videoWidth; } public int getVideoHeight() { return videoHeight; } public int getVideoBitrate() { return videoBitrate; } public int getAudioBitrate() { return audioBitrate; } public int getAudioChannels() { return audioChannels; } public int getAudioSamplingRate() { return samplingRate; } public int getFrameRate() { return frameRate; } public int getVideoCodec() { return videoCodec; } public int getAudioCodec() { return audioCodec; } public int getFileFormat() { return fileFormat; } }
1,520
0.7125
0.681579
71
20.408451
19.235807
93
false
false
0
0
0
0
0
0
0.43662
false
false
13
ab2577a8e4f6e9bcf4debec8728292f91fd62c75
9,182,640,140,471
808f7bf4a87d09f3ccb285988a52f2752722fd47
/manager/com/wanggp/sysuser/WsysuserController.java
35c29c4b8c9ee0e5f8675ffd55745e796c1ad63b
[]
no_license
cfhb/ExampleService
https://github.com/cfhb/ExampleService
c0828294c86f0dae1472ee4c6aea5e80e0be23fe
5ef63ccf4cc04e90994b38301f82b43d81c2d23f
refs/heads/master
2020-02-28T04:55:07.055000
2015-09-15T01:27:34
2015-09-15T01:27:34
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.wanggp.sysuser; import java.io.OutputStream; import java.io.PrintWriter; import java.io.UnsupportedEncodingException; import java.net.URLDecoder; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import jxl.Workbook; import jxl.write.Label; import jxl.write.WritableSheet; import jxl.write.WritableWorkbook; import org.apache.commons.lang.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import com.wanggp.auth.acegi.SessionUtil; import com.wanggp.common.page.Page; import com.wanggp.common.page.PageService; import com.wanggp.common.spring.BaseController; import com.wanggp.testdrivebase.Wtestdrivebase; import com.wanggp.testdrivebase.WtestdrivebaseService; import com.wanggp.tools.MD5Util; import com.wanggp.utils.DateTool; import com.wanggp.utils.JSONTool; @Controller @RequestMapping("/wsysuser") public class WsysuserController extends BaseController { @Autowired private WsysuserService wsysuserService; @Autowired private WtestdrivebaseService wtestdrivebaseService; @Autowired private PageService pageService; @RequestMapping("/main") public String mainPage() { return "/manager/wsysuser/wsysuser_main"; } @SuppressWarnings("unchecked") @RequestMapping("/list") public String listPage(HttpServletRequest request, String search, String searchContent,String baseid) throws UnsupportedEncodingException { if (!"1".equals(search) || StringUtils.isEmpty(searchContent)) { searchContent = ""; search = "0"; } Map<String, Object> params = new HashMap<String, Object>(); if (searchContent != null) { searchContent = URLDecoder.decode(searchContent, "utf-8"); } params.put("searchContent", searchContent); params.put("baseid", baseid); Page page = pageService.pageQuery(request, WsysuserDAO.class.getName(), "getWsysuserList", "countWsysuser", params); request.setAttribute("page", page); request.setAttribute("search", search); request.setAttribute("searchContent", searchContent); request.setAttribute("baseid", baseid); List<Wtestdrivebase> testdrivebaseList = wtestdrivebaseService .getWtestdrivebaseList(); request.setAttribute("testdrivebaseList", testdrivebaseList); return "/manager/wsysuser/wsysuser_list"; } @RequestMapping("/add_form") public String addWsysuserFormPage(Map<String, Object> map, HttpServletRequest request) { Wsysuser wsysuser = new Wsysuser(); map.put("wsysuser", wsysuser); map.put("operation", "add"); List<Wtestdrivebase> testdrivebaseList = wtestdrivebaseService .getWtestdrivebaseList(); map.put("testdrivebaseList", testdrivebaseList); return "manager/wsysuser/wsysuser_form"; } @RequestMapping("/edit_form") public String editWsysuserFormPage(Map<String, Object> map, HttpServletRequest request, String wsysuserId) { map.put("operation", "edit"); Wsysuser wsysuser = wsysuserService.getWsysuserById(wsysuserId); if (wsysuser != null) { map.put("wsysuser", wsysuser); } List<Wtestdrivebase> testdrivebaseList = wtestdrivebaseService .getWtestdrivebaseList(); map.put("testdrivebaseList", testdrivebaseList); return "/manager/wsysuser/wsysuser_form"; } @RequestMapping("/view_form") public String viewWsysuserFormPage(Map<String, Object> map, HttpServletRequest request, String wsysuserId) { map.put("operation", "view"); Wsysuser wsysuser = wsysuserService.getWsysuserById(wsysuserId); if (wsysuser != null) { map.put("wsysuser", wsysuser); } List<Wtestdrivebase> testdrivebaseList = wtestdrivebaseService .getWtestdrivebaseList(); map.put("testdrivebaseList", testdrivebaseList); return "/manager/wsysuser/wsysuser_form"; } @RequestMapping("/delete") public void deleteWsysuser(PrintWriter writer, String wsysuserIds) { Map<String, Object> map = new HashMap<String, Object>(); if (wsysuserIds == null || wsysuserIds.trim().equals("")) { map.put("success", false); map.put("msg", "主键不能为空"); return; } String[] idArray = wsysuserIds.split(","); try { boolean result = wsysuserService.deleteWsysuserById(idArray); map.put("success", result); } catch (Exception e) { map.put("success", false); map.put("msg", "删除失败"); } writer.write(JSONTool.toJson(map)); } @RequestMapping("/load_list") public void loadWsysuserListData(HttpServletRequest request, PrintWriter writer) { Map<String, Object> params = new HashMap<String, Object>(); String json = pageService.gridPageQuery(request, WsysuserDAO.class.getName(), "getWsysuserList", "countWsysuser", params); writer.write(json); } @RequestMapping("/submit_form") public void submitWsysuserForm(HttpServletRequest request, PrintWriter writer, Wsysuser wsysuser, String operation, String pwd1) { try { if (StringUtils.isNotEmpty(pwd1)) wsysuser.setPwd(MD5Util.generatePassword(pwd1)); if ("add".equals(operation)) { wsysuserService.addWsysuser(wsysuser); } else { wsysuserService.updateWsysuser(wsysuser); } writer.write("{\"success\":true}"); } catch (Exception e) { e.printStackTrace(); writer.write("{\"success\":false}"); } } @RequestMapping("/export_list") public void exportWtestdrivebaseListData(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException { List<Wsysuser> list = wsysuserService.getWsysuserList(); response.setContentType("application/x-msdownload"); response.setHeader("Content-Disposition", "attachment; filename=" + new String("系统用户.xls".getBytes("GBK"), "ISO8859_1")); OutputStream os; WritableWorkbook book = null; try { os = response.getOutputStream(); book = Workbook.createWorkbook(os); WritableSheet wsheet = book.createSheet("系统用户列表", 0); Label label = null; label = new Label(0, 0, "姓名"); wsheet.addCell(label); label = new Label(1, 0, "登录帐号"); label = new Label(2, 0, "性别"); wsheet.addCell(label); label = new Label(3, 0, "角色"); wsheet.addCell(label); label = new Label(4, 0, "最后登录时间"); wsheet.addCell(label); label = new Label(5, 0, "电话"); wsheet.addCell(label); for (int r = 0; r < list.size(); r++) { Wsysuser user = list.get(r); label = new Label(0, r + 1, user.getName() + ""); wsheet.addCell(label); label = new Label(1, r + 1, user.getAccout() + ""); if (user.getSex() == 1) label = new Label(2, r + 1, "男" + ""); else label = new Label(2, r + 1, "女" + ""); wsheet.addCell(label); label = new Label(3, r + 1, user.getRoledes() + ""); wsheet.addCell(label); label = new Label(4, r + 1, DateTool.formatDate( user.getLastlogindate(), DateTool.PATTERN_DATETIME)); wsheet.addCell(label); label = new Label(5, r + 1, user.getPhone() + ""); wsheet.addCell(label); } book.write(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } finally { if (book != null) { try { book.close(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } } } @RequestMapping("/validateAccount") public void validateAccount(PrintWriter writer, String account) { // text:有三种状态:1、不重复;0、没变;-1、重复 Wsysuser accountUser = wsysuserService.getWsysuserByAccout(account); // 验证结果 Map<String, String> resultMap = new HashMap<String, String>(); // 默认值 resultMap.put("success", "0"); resultMap.put("text", "此账号已经存在"); if (accountUser == null) { resultMap.put("success", "1"); resultMap.put("text", "账号可用"); } writer.write(JSONTool.toJson(resultMap)); } }
UTF-8
Java
7,945
java
WsysuserController.java
Java
[]
null
[]
package com.wanggp.sysuser; import java.io.OutputStream; import java.io.PrintWriter; import java.io.UnsupportedEncodingException; import java.net.URLDecoder; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import jxl.Workbook; import jxl.write.Label; import jxl.write.WritableSheet; import jxl.write.WritableWorkbook; import org.apache.commons.lang.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import com.wanggp.auth.acegi.SessionUtil; import com.wanggp.common.page.Page; import com.wanggp.common.page.PageService; import com.wanggp.common.spring.BaseController; import com.wanggp.testdrivebase.Wtestdrivebase; import com.wanggp.testdrivebase.WtestdrivebaseService; import com.wanggp.tools.MD5Util; import com.wanggp.utils.DateTool; import com.wanggp.utils.JSONTool; @Controller @RequestMapping("/wsysuser") public class WsysuserController extends BaseController { @Autowired private WsysuserService wsysuserService; @Autowired private WtestdrivebaseService wtestdrivebaseService; @Autowired private PageService pageService; @RequestMapping("/main") public String mainPage() { return "/manager/wsysuser/wsysuser_main"; } @SuppressWarnings("unchecked") @RequestMapping("/list") public String listPage(HttpServletRequest request, String search, String searchContent,String baseid) throws UnsupportedEncodingException { if (!"1".equals(search) || StringUtils.isEmpty(searchContent)) { searchContent = ""; search = "0"; } Map<String, Object> params = new HashMap<String, Object>(); if (searchContent != null) { searchContent = URLDecoder.decode(searchContent, "utf-8"); } params.put("searchContent", searchContent); params.put("baseid", baseid); Page page = pageService.pageQuery(request, WsysuserDAO.class.getName(), "getWsysuserList", "countWsysuser", params); request.setAttribute("page", page); request.setAttribute("search", search); request.setAttribute("searchContent", searchContent); request.setAttribute("baseid", baseid); List<Wtestdrivebase> testdrivebaseList = wtestdrivebaseService .getWtestdrivebaseList(); request.setAttribute("testdrivebaseList", testdrivebaseList); return "/manager/wsysuser/wsysuser_list"; } @RequestMapping("/add_form") public String addWsysuserFormPage(Map<String, Object> map, HttpServletRequest request) { Wsysuser wsysuser = new Wsysuser(); map.put("wsysuser", wsysuser); map.put("operation", "add"); List<Wtestdrivebase> testdrivebaseList = wtestdrivebaseService .getWtestdrivebaseList(); map.put("testdrivebaseList", testdrivebaseList); return "manager/wsysuser/wsysuser_form"; } @RequestMapping("/edit_form") public String editWsysuserFormPage(Map<String, Object> map, HttpServletRequest request, String wsysuserId) { map.put("operation", "edit"); Wsysuser wsysuser = wsysuserService.getWsysuserById(wsysuserId); if (wsysuser != null) { map.put("wsysuser", wsysuser); } List<Wtestdrivebase> testdrivebaseList = wtestdrivebaseService .getWtestdrivebaseList(); map.put("testdrivebaseList", testdrivebaseList); return "/manager/wsysuser/wsysuser_form"; } @RequestMapping("/view_form") public String viewWsysuserFormPage(Map<String, Object> map, HttpServletRequest request, String wsysuserId) { map.put("operation", "view"); Wsysuser wsysuser = wsysuserService.getWsysuserById(wsysuserId); if (wsysuser != null) { map.put("wsysuser", wsysuser); } List<Wtestdrivebase> testdrivebaseList = wtestdrivebaseService .getWtestdrivebaseList(); map.put("testdrivebaseList", testdrivebaseList); return "/manager/wsysuser/wsysuser_form"; } @RequestMapping("/delete") public void deleteWsysuser(PrintWriter writer, String wsysuserIds) { Map<String, Object> map = new HashMap<String, Object>(); if (wsysuserIds == null || wsysuserIds.trim().equals("")) { map.put("success", false); map.put("msg", "主键不能为空"); return; } String[] idArray = wsysuserIds.split(","); try { boolean result = wsysuserService.deleteWsysuserById(idArray); map.put("success", result); } catch (Exception e) { map.put("success", false); map.put("msg", "删除失败"); } writer.write(JSONTool.toJson(map)); } @RequestMapping("/load_list") public void loadWsysuserListData(HttpServletRequest request, PrintWriter writer) { Map<String, Object> params = new HashMap<String, Object>(); String json = pageService.gridPageQuery(request, WsysuserDAO.class.getName(), "getWsysuserList", "countWsysuser", params); writer.write(json); } @RequestMapping("/submit_form") public void submitWsysuserForm(HttpServletRequest request, PrintWriter writer, Wsysuser wsysuser, String operation, String pwd1) { try { if (StringUtils.isNotEmpty(pwd1)) wsysuser.setPwd(MD5Util.generatePassword(pwd1)); if ("add".equals(operation)) { wsysuserService.addWsysuser(wsysuser); } else { wsysuserService.updateWsysuser(wsysuser); } writer.write("{\"success\":true}"); } catch (Exception e) { e.printStackTrace(); writer.write("{\"success\":false}"); } } @RequestMapping("/export_list") public void exportWtestdrivebaseListData(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException { List<Wsysuser> list = wsysuserService.getWsysuserList(); response.setContentType("application/x-msdownload"); response.setHeader("Content-Disposition", "attachment; filename=" + new String("系统用户.xls".getBytes("GBK"), "ISO8859_1")); OutputStream os; WritableWorkbook book = null; try { os = response.getOutputStream(); book = Workbook.createWorkbook(os); WritableSheet wsheet = book.createSheet("系统用户列表", 0); Label label = null; label = new Label(0, 0, "姓名"); wsheet.addCell(label); label = new Label(1, 0, "登录帐号"); label = new Label(2, 0, "性别"); wsheet.addCell(label); label = new Label(3, 0, "角色"); wsheet.addCell(label); label = new Label(4, 0, "最后登录时间"); wsheet.addCell(label); label = new Label(5, 0, "电话"); wsheet.addCell(label); for (int r = 0; r < list.size(); r++) { Wsysuser user = list.get(r); label = new Label(0, r + 1, user.getName() + ""); wsheet.addCell(label); label = new Label(1, r + 1, user.getAccout() + ""); if (user.getSex() == 1) label = new Label(2, r + 1, "男" + ""); else label = new Label(2, r + 1, "女" + ""); wsheet.addCell(label); label = new Label(3, r + 1, user.getRoledes() + ""); wsheet.addCell(label); label = new Label(4, r + 1, DateTool.formatDate( user.getLastlogindate(), DateTool.PATTERN_DATETIME)); wsheet.addCell(label); label = new Label(5, r + 1, user.getPhone() + ""); wsheet.addCell(label); } book.write(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } finally { if (book != null) { try { book.close(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } } } @RequestMapping("/validateAccount") public void validateAccount(PrintWriter writer, String account) { // text:有三种状态:1、不重复;0、没变;-1、重复 Wsysuser accountUser = wsysuserService.getWsysuserByAccout(account); // 验证结果 Map<String, String> resultMap = new HashMap<String, String>(); // 默认值 resultMap.put("success", "0"); resultMap.put("text", "此账号已经存在"); if (accountUser == null) { resultMap.put("success", "1"); resultMap.put("text", "账号可用"); } writer.write(JSONTool.toJson(resultMap)); } }
7,945
0.712819
0.706788
257
29.322958
21.276958
76
false
false
0
0
0
0
0
0
2.680934
false
false
13
a8a8ca82e5a004d41f9fd799cce7dcf787b8f853
25,323,127,222,476
c97d09d93f32b55a44432c05be88b6b1f20748ce
/mercari/WEB-INF/classes/dao/MysqlDaoFactory.java
58aa7807c69e7b03c86bd68a5431af7012a41d0f
[]
no_license
S4K08/practice
https://github.com/S4K08/practice
e37fed4d11d4b714cd009bf87e0bd7a472970f35
1fecaacb60d576eb051e06ff67ccbbe5923da826
refs/heads/master
2023-04-20T01:36:39.746000
2021-05-07T00:41:41
2021-05-07T00:41:41
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package dao; public class MysqlDaoFactory extends AbstractMysqlFactory{ @Override public AdminInterfaceDao getAdminInterfaceDao() { return new AdminDao(); } @Override public CategoryInterfaceDao getCategoryInterfaceDao() { return new CategoryDao(); } @Override public DealInterfaceDao getDealInterfaceDao() { return new DealDao(); } @Override public HardwareInterfaceDao getHardwareInterfaceDao() { return new HardwareDao(); } @Override public ItemInterfaceDao getItemInterfaceDao() { return new ItemDao(); } @Override public NoticeInterfaceDao getNoticeInterfaceDao() { return new NoticeDao(); } @Override public OpenChatInterfaceDao getOpenChatInterfaceDao() { return new OpenChatDao(); } @Override public PaymentLogInterfaceDao getPaymentLogInterfaceDao() { return new PaymentLogDao(); } @Override public PrivateChatInterfaceDao getPrivateChatInterfaceDao() { return new PrivateChatDao(); } @Override public UserInterfaceDao getUserInterfaceDao(){ return new UserDao(); } }
UTF-8
Java
1,110
java
MysqlDaoFactory.java
Java
[]
null
[]
package dao; public class MysqlDaoFactory extends AbstractMysqlFactory{ @Override public AdminInterfaceDao getAdminInterfaceDao() { return new AdminDao(); } @Override public CategoryInterfaceDao getCategoryInterfaceDao() { return new CategoryDao(); } @Override public DealInterfaceDao getDealInterfaceDao() { return new DealDao(); } @Override public HardwareInterfaceDao getHardwareInterfaceDao() { return new HardwareDao(); } @Override public ItemInterfaceDao getItemInterfaceDao() { return new ItemDao(); } @Override public NoticeInterfaceDao getNoticeInterfaceDao() { return new NoticeDao(); } @Override public OpenChatInterfaceDao getOpenChatInterfaceDao() { return new OpenChatDao(); } @Override public PaymentLogInterfaceDao getPaymentLogInterfaceDao() { return new PaymentLogDao(); } @Override public PrivateChatInterfaceDao getPrivateChatInterfaceDao() { return new PrivateChatDao(); } @Override public UserInterfaceDao getUserInterfaceDao(){ return new UserDao(); } }
1,110
0.718018
0.718018
52
19.346153
20.482531
62
false
false
0
0
0
0
0
0
1.038462
false
false
13