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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
b6f9e17f7c6ecf4f7e6d4e6ba0445f71ccc56c8c
| 1,288,490,244,386 |
6f2f83c5e8f152d3883ee22b31d0695ca7e6bdb8
|
/src/main/java/sk/juvius/ulet/cmds/upload/infodialog/AfterDialog.java
|
35f1667ac42aee54fe688896390f01cb1c1e0a83
|
[] |
no_license
|
skv4ro/Ulet
|
https://github.com/skv4ro/Ulet
|
bc13336cd8e86e3729af463320f83c293dc872dc
|
5684d09ab379a48579003dd0f451b687f873e06a
|
refs/heads/master
| 2022-12-26T03:29:43.696000 | 2020-10-09T18:43:11 | 2020-10-09T18:43:11 | 302,725,990 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package sk.juvius.ulet.cmds.upload.infodialog;
import javafx.application.Platform;
import javafx.collections.ObservableList;
import javafx.embed.swing.JFXPanel;
import javafx.scene.Scene;
import sk.juvius.ulet.c;
import javax.swing.*;
import java.awt.*;
import java.util.List;
public class AfterDialog {
private final JDialog jDialog = new JDialog();
private AfterDialogView infoListView;
public AfterDialog() {
jDialog.setTitle("Upload info");
jDialog.setModal(true);
jDialog.setDefaultCloseOperation(JDialog.HIDE_ON_CLOSE);
jDialog.setAlwaysOnTop(true);
JFXPanel jfx = new JFXPanel();
jDialog.add(jfx);
jfx.setScene(initFX());
jDialog.pack();
jDialog.setMinimumSize(new Dimension(150, 300));
jDialog.setSize(new Dimension(500,600));
makeCenter(jDialog);
}
public void show() {
jDialog.setVisible(true);
}
public void fill(java.util.List<String> successList,
List<String> failedList,
int successCount,
int failedCount,
int sucBackupCount,
int failBackupCount) {
successList.sort(String::compareToIgnoreCase);
failedList.sort(String::compareToIgnoreCase);
ObservableList<String> sucObsList = infoListView.getSuccessListView().getItems();
ObservableList<String> failObsList = infoListView.getFailedListView().getItems();
sucObsList.clear();
failObsList.clear();
Platform.runLater(() -> {
sucObsList.addAll(successList);
failObsList.addAll(failedList);
infoListView.getProjectLabel().setText("Project: " + c.curProject.getDisplayName());
infoListView.getSuccessUploadLabel().setText("Successfully uploaded: " + successCount);
infoListView.getFailedUploadLabel().setText("Failed to upload: " + failedCount);
infoListView.getSuccessBackupLabel().setText("Successfully backuped: " + sucBackupCount);
infoListView.getFailedBackupLabel().setText("Failed to backup: " + failBackupCount);
});
}
private void makeCenter(JDialog dialog) {
Toolkit toolkit = Toolkit.getDefaultToolkit();
Dimension screen = toolkit.getScreenSize();
int x = (screen.width - jDialog.getWidth()) / 2;
int y = (screen.height - jDialog.getHeight()) / 2;
dialog.setLocation(x, y);
}
private Scene initFX() {
infoListView = new AfterDialogView(jDialog);
return new Scene(infoListView);
}
}
|
UTF-8
|
Java
| 2,614 |
java
|
AfterDialog.java
|
Java
|
[] | null |
[] |
package sk.juvius.ulet.cmds.upload.infodialog;
import javafx.application.Platform;
import javafx.collections.ObservableList;
import javafx.embed.swing.JFXPanel;
import javafx.scene.Scene;
import sk.juvius.ulet.c;
import javax.swing.*;
import java.awt.*;
import java.util.List;
public class AfterDialog {
private final JDialog jDialog = new JDialog();
private AfterDialogView infoListView;
public AfterDialog() {
jDialog.setTitle("Upload info");
jDialog.setModal(true);
jDialog.setDefaultCloseOperation(JDialog.HIDE_ON_CLOSE);
jDialog.setAlwaysOnTop(true);
JFXPanel jfx = new JFXPanel();
jDialog.add(jfx);
jfx.setScene(initFX());
jDialog.pack();
jDialog.setMinimumSize(new Dimension(150, 300));
jDialog.setSize(new Dimension(500,600));
makeCenter(jDialog);
}
public void show() {
jDialog.setVisible(true);
}
public void fill(java.util.List<String> successList,
List<String> failedList,
int successCount,
int failedCount,
int sucBackupCount,
int failBackupCount) {
successList.sort(String::compareToIgnoreCase);
failedList.sort(String::compareToIgnoreCase);
ObservableList<String> sucObsList = infoListView.getSuccessListView().getItems();
ObservableList<String> failObsList = infoListView.getFailedListView().getItems();
sucObsList.clear();
failObsList.clear();
Platform.runLater(() -> {
sucObsList.addAll(successList);
failObsList.addAll(failedList);
infoListView.getProjectLabel().setText("Project: " + c.curProject.getDisplayName());
infoListView.getSuccessUploadLabel().setText("Successfully uploaded: " + successCount);
infoListView.getFailedUploadLabel().setText("Failed to upload: " + failedCount);
infoListView.getSuccessBackupLabel().setText("Successfully backuped: " + sucBackupCount);
infoListView.getFailedBackupLabel().setText("Failed to backup: " + failBackupCount);
});
}
private void makeCenter(JDialog dialog) {
Toolkit toolkit = Toolkit.getDefaultToolkit();
Dimension screen = toolkit.getScreenSize();
int x = (screen.width - jDialog.getWidth()) / 2;
int y = (screen.height - jDialog.getHeight()) / 2;
dialog.setLocation(x, y);
}
private Scene initFX() {
infoListView = new AfterDialogView(jDialog);
return new Scene(infoListView);
}
}
| 2,614 | 0.648814 | 0.643458 | 70 | 36.342857 | 26.151693 | 101 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.742857 | false | false |
13
|
3b317a0bf226187fd035791a6db464817a5bbd47
| 7,722,351,241,899 |
ab4069100f7f024f0398cef4546144126811490f
|
/app/src/main/java/com/example/econonew/tools/CallBack.java
|
dadeac2017cde5469f7af1d97ae2a7d4913016ba
|
[] |
no_license
|
zuoyandeyingguang/Finance_App
|
https://github.com/zuoyandeyingguang/Finance_App
|
4908655f64a00bab1d18f106331978ac26fe22be
|
20a25afa76f6dfcd4ef632adc3ed87a0f7f927a3
|
refs/heads/master
| 2020-07-31T00:16:05.293000 | 2017-10-30T14:33:32 | 2017-10-30T14:33:32 | 67,576,481 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.example.econonew.tools;
/**
* 回调接口
* Created by mengfei on 2017/6/7.
*/
public interface CallBack<T> {
void callBack(T... t);
}
|
UTF-8
|
Java
| 158 |
java
|
CallBack.java
|
Java
|
[
{
"context": "example.econonew.tools;\n\n/**\n * 回调接口\n * Created by mengfei on 2017/6/7.\n */\npublic interface CallBack<T> {\n\n",
"end": 70,
"score": 0.9995431900024414,
"start": 63,
"tag": "USERNAME",
"value": "mengfei"
}
] | null |
[] |
package com.example.econonew.tools;
/**
* 回调接口
* Created by mengfei on 2017/6/7.
*/
public interface CallBack<T> {
void callBack(T... t);
}
| 158 | 0.64 | 0.6 | 11 | 12.636364 | 14.360759 | 35 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.181818 | false | false |
13
|
0782c5b7644336aea252eb50713d55049137fa36
| 27,127,013,484,276 |
059c0cd55607583c81a2c40da0ca4c00d77e05f3
|
/CamelProjectTask3/src/main/java/cmo/bizruntime/restletdatareading/Addition.java
|
f1ab6f2f08154c8e356bdbfeed6d98ecfde2c0dc
|
[] |
no_license
|
radhakrishnan10192/impdata
|
https://github.com/radhakrishnan10192/impdata
|
72d7eea90da42963402c0092057f718b68f07e38
|
ca3fdae6346f206f0501fbc03e59d2cdaeddd882
|
refs/heads/master
| 2023-08-08T22:10:40.680000 | 2017-05-01T04:19:24 | 2017-05-01T04:19:24 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package cmo.bizruntime.restletdatareading;
public class Addition {
private int firstdata;
private int seconddata;
public int getFirstdata() {
return firstdata;
}
public void setFirstdata(int firstdata) {
this.firstdata = firstdata;
}
public int getSeconddata() {
return seconddata;
}
public void setSeconddata(int seconddata) {
this.seconddata = seconddata;
}
public Addition(int firstdata, int seconddata) {
super();
this.firstdata = firstdata;
this.seconddata = seconddata;
}
public Addition() {
}
@Override
public String toString() {
return "Addition [firstdata=" + firstdata + ", seconddata=" + seconddata + "]";
}
}
|
UTF-8
|
Java
| 670 |
java
|
Addition.java
|
Java
|
[] | null |
[] |
package cmo.bizruntime.restletdatareading;
public class Addition {
private int firstdata;
private int seconddata;
public int getFirstdata() {
return firstdata;
}
public void setFirstdata(int firstdata) {
this.firstdata = firstdata;
}
public int getSeconddata() {
return seconddata;
}
public void setSeconddata(int seconddata) {
this.seconddata = seconddata;
}
public Addition(int firstdata, int seconddata) {
super();
this.firstdata = firstdata;
this.seconddata = seconddata;
}
public Addition() {
}
@Override
public String toString() {
return "Addition [firstdata=" + firstdata + ", seconddata=" + seconddata + "]";
}
}
| 670 | 0.701493 | 0.701493 | 37 | 17.108109 | 18.444633 | 81 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.432432 | false | false |
13
|
aac859bf8087cde34b1baed9da93e900ef065e91
| 31,894,427,199,910 |
4e662eceb2184bcec54fe60c4aeac907a53461e7
|
/src/main/java/com/zben/single/Singleton.java
|
f85926ca2ba846ed4e943689c20961b06bcde8d1
|
[] |
no_license
|
qwzhouben/java-design
|
https://github.com/qwzhouben/java-design
|
a7f9d786502eca5549f5fe757c1b060f6a5ff04e
|
366a3c9650cf808e4acbf26d07232bcbc9e666b3
|
refs/heads/master
| 2021-07-07T10:27:28.086000 | 2019-07-03T02:52:20 | 2019-07-03T02:52:20 | 194,819,463 | 0 | 0 | null | false | 2020-10-13T14:15:28 | 2019-07-02T08:16:00 | 2019-07-03T05:20:22 | 2020-10-13T14:15:26 | 308 | 0 | 0 | 1 |
Java
| false | false |
package com.zben.single;
/**
* @Desc: 优点:延迟加载,适合单线程操作
* 缺点:线程不安全,在多线程容易出现不同步的情况
* @Author: zhouben
* @Date:2019/7/3 9:27
*/
public class Singleton {
//私有静态引用,防止被引用
private static Singleton instance = null;
//私有构造,防止被实例化
private Singleton() {
}
public static Singleton getSingleton() {
if (instance == null) {
instance = new Singleton();
}
return instance;
}
}
|
UTF-8
|
Java
| 560 |
java
|
Singleton.java
|
Java
|
[
{
"context": "线程操作\n * 缺点:线程不安全,在多线程容易出现不同步的情况\n * @Author: zhouben\n * @Date:2019/7/3 9:27\n */\npublic class Singleton",
"end": 109,
"score": 0.999670147895813,
"start": 102,
"tag": "USERNAME",
"value": "zhouben"
}
] | null |
[] |
package com.zben.single;
/**
* @Desc: 优点:延迟加载,适合单线程操作
* 缺点:线程不安全,在多线程容易出现不同步的情况
* @Author: zhouben
* @Date:2019/7/3 9:27
*/
public class Singleton {
//私有静态引用,防止被引用
private static Singleton instance = null;
//私有构造,防止被实例化
private Singleton() {
}
public static Singleton getSingleton() {
if (instance == null) {
instance = new Singleton();
}
return instance;
}
}
| 560 | 0.584475 | 0.563927 | 22 | 18.90909 | 13.901959 | 45 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.181818 | false | false |
13
|
0dcc9bbaa67e4720d60d83e1f1bd499bf3047b58
| 31,104,153,205,395 |
e0d52bbf5d1b657afb07795bf456e8e680302980
|
/Modelibra/src/org/modelibra/ISelectable.java
|
2adc91a86a215300d0cc5cfaa64c771fbdb99beb
|
[
"Apache-2.0"
] |
permissive
|
youp911/modelibra
|
https://github.com/youp911/modelibra
|
acc391da16ab6b14616cd7bda094506a05414b0f
|
00387bd9f1f82df3b7d844650e5a57d2060a2ec7
|
refs/heads/master
| 2021-01-25T09:59:19.388000 | 2011-11-24T21:46:26 | 2011-11-24T21:46:26 | 42,008,889 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
/*
* Modelibra
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
package org.modelibra;
/**
* Selectable interface.
*
* @author Dzenan Ridjanovic
* @version 2007-06-16
*/
public interface ISelectable<T extends IEntity<T>> {
/**
* Checks if the entity satisfies the selector.
*
* @param selector
* selector
* @return <code>true</code> if the entity satisfies the selector
*/
public boolean isSelected(ISelector selector);
}
|
UTF-8
|
Java
| 1,004 |
java
|
ISelectable.java
|
Java
|
[
{
"context": "\r\n\r\n/**\r\n * Selectable interface.\r\n * \r\n * @author Dzenan Ridjanovic\r\n * @version 2007-06-16\r\n */\r\npublic interface IS",
"end": 681,
"score": 0.9998792409896851,
"start": 664,
"tag": "NAME",
"value": "Dzenan Ridjanovic"
}
] | null |
[] |
/*
* Modelibra
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
package org.modelibra;
/**
* Selectable interface.
*
* @author <NAME>
* @version 2007-06-16
*/
public interface ISelectable<T extends IEntity<T>> {
/**
* Checks if the entity satisfies the selector.
*
* @param selector
* selector
* @return <code>true</code> if the entity satisfies the selector
*/
public boolean isSelected(ISelector selector);
}
| 993 | 0.686255 | 0.674303 | 35 | 26.685715 | 28.20615 | 80 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.428571 | false | false |
13
|
9bc1ba8433a0b27b5769ebcd2e7676b8ee47caea
| 17,162,689,364,961 |
3d5dbc4805435217e246083bf532e27fb90d78c1
|
/src/com/company/Read.java
|
79b3fc9245c5a34e07092ab5a3420ef1072dc0c4
|
[] |
no_license
|
hldvp/calculator
|
https://github.com/hldvp/calculator
|
8d7b41557f239baaec0395ae3a8ba0c40975991a
|
0a2c25d93265b244009b50dc9e94b81ec907fc4e
|
refs/heads/main
| 2023-04-05T07:35:56.838000 | 2021-04-16T15:32:11 | 2021-04-16T15:32:11 | 357,898,184 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.company;
public class Read {
public String str;
char znak = '0';
int index;
Read (String str){
this.str = str;
for (int i = 0; i<str.length();i++){
if (str.charAt(i) == '+' || str.charAt(i) == '-' || str.charAt(i) == '*' || str.charAt(i) == '/'){
this.znak = str.charAt(i);
this.index = i;
break;
}
}
if (this.znak == '0'){
System.out.println("The data is incorrect");
System.exit(0);
}
}
}
|
UTF-8
|
Java
| 562 |
java
|
Read.java
|
Java
|
[] | null |
[] |
package com.company;
public class Read {
public String str;
char znak = '0';
int index;
Read (String str){
this.str = str;
for (int i = 0; i<str.length();i++){
if (str.charAt(i) == '+' || str.charAt(i) == '-' || str.charAt(i) == '*' || str.charAt(i) == '/'){
this.znak = str.charAt(i);
this.index = i;
break;
}
}
if (this.znak == '0'){
System.out.println("The data is incorrect");
System.exit(0);
}
}
}
| 562 | 0.421708 | 0.414591 | 23 | 23.434782 | 23.396072 | 110 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.782609 | false | false |
13
|
4f32ad9128842658136beea0e80af054a3319abd
| 18,176,301,640,615 |
7904b87ed8603a4cd0b44fd44e4df1d39013357d
|
/Barclays_Tokenisation_Stub/src/main/java/com/barclays/tokenisation/controller/Tokenisation.java
|
c6706f7fad70357542bed2ca8598f224c81a66b1
|
[] |
no_license
|
neetisaxena/TokenisationStub
|
https://github.com/neetisaxena/TokenisationStub
|
9d15d7312fac1c3feeb20c88a71c1cc8a68f2961
|
ea4025e5e314e9cabccc8b21d6d640036e1330d1
|
refs/heads/master
| 2016-06-05T03:50:39.030000 | 2016-03-10T09:53:17 | 2016-03-10T09:53:17 | 53,564,287 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.barclays.tokenisation.controller;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import javax.ws.rs.Consumes;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import org.json.JSONException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.barclays.tokenisation.utility.Transformer;
import com.barclays.tokenisation.model.RequestData;
import com.barclays.tokenisation.model.ResponseData;
/** Tokenisation class
* This class is entry point for tokenisation web service call
* @author: Neeti Saxena
* @version: 1
*/
@Path("/TokenService")
public class Tokenisation {
final Logger logger = LoggerFactory.getLogger(Tokenisation.class);
final DateFormat newDf = new SimpleDateFormat("dd-MM-yyyy HH:mm:ss.SSS");
private TokenisationController tokenisationController = new TokenisationController();
private StringBuffer emptyMessage = new StringBuffer();
private StringBuffer errorMessage = new StringBuffer();
public StringBuffer getEmptyMessage() {
return emptyMessage;
}
public StringBuffer getErrorMessage() {
return errorMessage;
}
@POST
@Path("/Tokenise")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public Response tokenMain(String jsonMessage)
{
logger.debug(newDf.format(new Date()), "Invoking tokenMain");
String resultJsonString =null;
Boolean authorised = false;
RequestData requestData = new RequestData();
Boolean isAuthenticate = true;
try {
requestData = Transformer.toJavaObject(jsonMessage);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
resultJsonString = tokenisationController.processTokenistion(requestData);
return Response.status(200).entity(resultJsonString).build();
}
/** Method will check for empty fields in Request JSON */
public boolean checkForEmptyFields(RequestData requestData) {
logger.debug(newDf.format(new Date()), "Invoking checkForEmptyFields");
if(requestData.getSourceSystemName() == null || requestData.getSourceSystemName().isEmpty() ){
emptyMessage.append("Source System ");
}
if(requestData.getDomain() == null || requestData.getDomain().isEmpty() ){
if(emptyMessage.length() > 0){
emptyMessage.append(", Domain ");
}
else{
emptyMessage.append("Domain ");
}
}
if(requestData.getOwningBusinessEntity() == null || requestData.getOwningBusinessEntity().isEmpty() ){
if(emptyMessage.length() > 0){
emptyMessage.append(", Business Entity ");
}
else{
emptyMessage.append("Business Entity ");
}
}
if(emptyMessage.length() > 0){
emptyMessage.append("Field(s) Empty");
logger.debug(newDf.format(new Date()), "Exit checkForEmptyFields");
return false;
}
else{
logger.debug(newDf.format(new Date()), "Exit checkForEmptyFields");
return true;
}
}
/** Method will return error response if JSON is invalid */
public ResponseData getJSONErrorResponseToReturn(){
logger.debug(newDf.format(new Date()), "Invoking getJSONErrorResponseToReturn");
ResponseData responseDataError = new ResponseData();
try {
responseDataError.setMessage("JSON_INVALID");
//responseDataError.setCode("204");
responseDataError.setStatus("FAIL");
logger.info(">>>>>>>>>>>>>>>>>>>>>>>Exit getJSONErrorResponseToReturn"+newDf.format(new Date()));
return responseDataError;
} catch (JSONException Ex) {
logger.error("JSON Exception :"+Ex);
}
logger.debug(newDf.format(new Date()), "Exit getJSONErrorResponseToReturn");
return null;
}
/** Method will return error response if any field is empty */
public ResponseData getEmptyResponseToReturn(){
logger.debug(newDf.format(new Date()), "Invoking getEmptyResponseToReturn");
ResponseData responseDataError = new ResponseData();
try {
responseDataError.setMessage(emptyMessage.toString());
responseDataError.setCode("204");
responseDataError.setStatus("No Content");
logger.info(">>>>>>>>>>>>>>>>>>>>>>>Exit getEmptyResponseToReturn"+newDf.format(new Date()));
return responseDataError;
} catch (JSONException e) {
logger.error("JSON Exception :"+e);
}
logger.debug(newDf.format(new Date()), "Exit getEmptyResponseToReturn");
return null;
}
/** Method will return error response if any field is invalid */
public ResponseData getErrorResponseToReturn(){
logger.debug(newDf.format(new Date()), "Invoking getErrorResponseToReturn");
ResponseData responseDataError = new ResponseData();
try {
responseDataError.setMessage(errorMessage.toString());
responseDataError.setCode("204");
responseDataError.setStatus("No Content");
logger.info(">>>>>>>>>>>>>>>>>>>>>>>Exit getErrorResponseToReturn"+newDf.format(new Date()));
return responseDataError;
} catch (JSONException e) {
logger.error("JSON Exception :"+e);
}
logger.debug(newDf.format(new Date()), "Exit getErrorResponseToReturn");
return null;
}
}
|
UTF-8
|
Java
| 5,221 |
java
|
Tokenisation.java
|
Java
|
[
{
"context": "int for tokenisation web service call\r\n * @author: Neeti Saxena\r\n * @version: 1 \r\n */\r\n\r\n\r\n@Path(\"/TokenService\")",
"end": 693,
"score": 0.999740719795227,
"start": 681,
"tag": "NAME",
"value": "Neeti Saxena"
}
] | null |
[] |
package com.barclays.tokenisation.controller;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import javax.ws.rs.Consumes;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import org.json.JSONException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.barclays.tokenisation.utility.Transformer;
import com.barclays.tokenisation.model.RequestData;
import com.barclays.tokenisation.model.ResponseData;
/** Tokenisation class
* This class is entry point for tokenisation web service call
* @author: <NAME>
* @version: 1
*/
@Path("/TokenService")
public class Tokenisation {
final Logger logger = LoggerFactory.getLogger(Tokenisation.class);
final DateFormat newDf = new SimpleDateFormat("dd-MM-yyyy HH:mm:ss.SSS");
private TokenisationController tokenisationController = new TokenisationController();
private StringBuffer emptyMessage = new StringBuffer();
private StringBuffer errorMessage = new StringBuffer();
public StringBuffer getEmptyMessage() {
return emptyMessage;
}
public StringBuffer getErrorMessage() {
return errorMessage;
}
@POST
@Path("/Tokenise")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public Response tokenMain(String jsonMessage)
{
logger.debug(newDf.format(new Date()), "Invoking tokenMain");
String resultJsonString =null;
Boolean authorised = false;
RequestData requestData = new RequestData();
Boolean isAuthenticate = true;
try {
requestData = Transformer.toJavaObject(jsonMessage);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
resultJsonString = tokenisationController.processTokenistion(requestData);
return Response.status(200).entity(resultJsonString).build();
}
/** Method will check for empty fields in Request JSON */
public boolean checkForEmptyFields(RequestData requestData) {
logger.debug(newDf.format(new Date()), "Invoking checkForEmptyFields");
if(requestData.getSourceSystemName() == null || requestData.getSourceSystemName().isEmpty() ){
emptyMessage.append("Source System ");
}
if(requestData.getDomain() == null || requestData.getDomain().isEmpty() ){
if(emptyMessage.length() > 0){
emptyMessage.append(", Domain ");
}
else{
emptyMessage.append("Domain ");
}
}
if(requestData.getOwningBusinessEntity() == null || requestData.getOwningBusinessEntity().isEmpty() ){
if(emptyMessage.length() > 0){
emptyMessage.append(", Business Entity ");
}
else{
emptyMessage.append("Business Entity ");
}
}
if(emptyMessage.length() > 0){
emptyMessage.append("Field(s) Empty");
logger.debug(newDf.format(new Date()), "Exit checkForEmptyFields");
return false;
}
else{
logger.debug(newDf.format(new Date()), "Exit checkForEmptyFields");
return true;
}
}
/** Method will return error response if JSON is invalid */
public ResponseData getJSONErrorResponseToReturn(){
logger.debug(newDf.format(new Date()), "Invoking getJSONErrorResponseToReturn");
ResponseData responseDataError = new ResponseData();
try {
responseDataError.setMessage("JSON_INVALID");
//responseDataError.setCode("204");
responseDataError.setStatus("FAIL");
logger.info(">>>>>>>>>>>>>>>>>>>>>>>Exit getJSONErrorResponseToReturn"+newDf.format(new Date()));
return responseDataError;
} catch (JSONException Ex) {
logger.error("JSON Exception :"+Ex);
}
logger.debug(newDf.format(new Date()), "Exit getJSONErrorResponseToReturn");
return null;
}
/** Method will return error response if any field is empty */
public ResponseData getEmptyResponseToReturn(){
logger.debug(newDf.format(new Date()), "Invoking getEmptyResponseToReturn");
ResponseData responseDataError = new ResponseData();
try {
responseDataError.setMessage(emptyMessage.toString());
responseDataError.setCode("204");
responseDataError.setStatus("No Content");
logger.info(">>>>>>>>>>>>>>>>>>>>>>>Exit getEmptyResponseToReturn"+newDf.format(new Date()));
return responseDataError;
} catch (JSONException e) {
logger.error("JSON Exception :"+e);
}
logger.debug(newDf.format(new Date()), "Exit getEmptyResponseToReturn");
return null;
}
/** Method will return error response if any field is invalid */
public ResponseData getErrorResponseToReturn(){
logger.debug(newDf.format(new Date()), "Invoking getErrorResponseToReturn");
ResponseData responseDataError = new ResponseData();
try {
responseDataError.setMessage(errorMessage.toString());
responseDataError.setCode("204");
responseDataError.setStatus("No Content");
logger.info(">>>>>>>>>>>>>>>>>>>>>>>Exit getErrorResponseToReturn"+newDf.format(new Date()));
return responseDataError;
} catch (JSONException e) {
logger.error("JSON Exception :"+e);
}
logger.debug(newDf.format(new Date()), "Exit getErrorResponseToReturn");
return null;
}
}
| 5,215 | 0.707144 | 0.703697 | 157 | 31.254778 | 26.911722 | 104 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.216561 | false | false |
13
|
0a88325f444cb8b778fc5ecf9c23532e6bce641b
| 28,346,784,219,854 |
7c518b41a937083a6f61ed7af21e5be1fdee10bc
|
/src/java/design/pattern/template/AbstractClass.java
|
6beb3fede7d89a93b8d9af3b1ae60a65c3b692b2
|
[] |
no_license
|
lxcsige/test
|
https://github.com/lxcsige/test
|
9fc1df246110ddb2d20cad7bc62a524b5e41e74f
|
73b091a5313aa40955c3f5ec350a7d68fbdce979
|
refs/heads/master
| 2023-04-13T03:42:58.566000 | 2023-03-24T07:06:10 | 2023-03-24T07:06:10 | 126,112,218 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package design.pattern.template;
/**
* @author liuxucheng
* @since 2023/1/6
*/
public abstract class AbstractClass {
/**
* 模板方法
*/
public final void templateMethod() {
method1();
method2();
}
public abstract void method1();
public abstract void method2();
}
|
UTF-8
|
Java
| 320 |
java
|
AbstractClass.java
|
Java
|
[
{
"context": "package design.pattern.template;\n\n/**\n * @author liuxucheng\n * @since 2023/1/6\n */\npublic abstract class Abst",
"end": 59,
"score": 0.9926558136940002,
"start": 49,
"tag": "USERNAME",
"value": "liuxucheng"
}
] | null |
[] |
package design.pattern.template;
/**
* @author liuxucheng
* @since 2023/1/6
*/
public abstract class AbstractClass {
/**
* 模板方法
*/
public final void templateMethod() {
method1();
method2();
}
public abstract void method1();
public abstract void method2();
}
| 320 | 0.589744 | 0.557692 | 20 | 14.6 | 14.012137 | 40 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.25 | false | false |
13
|
8f5b316b075ddcda664f0d8bff6a203d2ea63959
| 17,910,013,689,052 |
66f53f19a891d14ef08315766c38dfd5b0790879
|
/src/Beans/Program.java
|
43ee5f669936feeab42b914cd6ca283fcd23d77c
|
[] |
no_license
|
Joktaa/Huits_reines
|
https://github.com/Joktaa/Huits_reines
|
dbebbb15fc24a606984dfd85cc277c62e35ce349
|
a15c90ea34e47462caafd8f9d23e7fb11bee9b98
|
refs/heads/master
| 2023-03-08T15:58:38.470000 | 2021-02-24T17:28:34 | 2021-02-24T17:28:34 | 317,605,849 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package Beans;
public class Program implements IIHM {
public static void main(String[] args){
Program p = new Program();
p.Run();
}
public void Run(){
EvolutionaryProcess EP = new EvolutionaryProcess(this, "Problème des huits dames");
EP.Run();
}
@Override
public void PrintBestIndividual(Individual individual, int generation) {
System.out.println(generation + "->" + individual);
}
}
|
UTF-8
|
Java
| 458 |
java
|
Program.java
|
Java
|
[] | null |
[] |
package Beans;
public class Program implements IIHM {
public static void main(String[] args){
Program p = new Program();
p.Run();
}
public void Run(){
EvolutionaryProcess EP = new EvolutionaryProcess(this, "Problème des huits dames");
EP.Run();
}
@Override
public void PrintBestIndividual(Individual individual, int generation) {
System.out.println(generation + "->" + individual);
}
}
| 458 | 0.630197 | 0.630197 | 18 | 24.388889 | 26.614822 | 91 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.444444 | false | false |
13
|
5373f83bc378be86972ded56474d9398a5fc15ff
| 20,237,885,957,280 |
df501259404a61d5c61abb0ae004560c5a182292
|
/app/src/main/java/com/anton/sample/PieChartActivity.java
|
0c2094f536878a7fc493922e039380b2359ee2be
|
[] |
no_license
|
morristech/AndroidId-CustomViews
|
https://github.com/morristech/AndroidId-CustomViews
|
0cb0ce9d9b06bf8cbadc486025d06c9db4ef7017
|
ea1b0063385968f7ef153a9e1b41c277b81a0625
|
refs/heads/master
| 2020-05-03T12:10:00.668000 | 2016-02-09T01:27:20 | 2016-02-09T01:27:20 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.anton.sample;
import android.app.Activity;
import android.content.res.Resources;
import android.os.Bundle;
import android.view.View;
import com.anton.sample.view.PieChart;
public class PieChartActivity extends Activity {
/**
* Called when the activity is first created.
*/
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Resources res = getResources();
setContentView(R.layout.activity_pie_chart);
final PieChart pie = (PieChart) this.findViewById(R.id.Pie);
pie.addItem("Jakarta", 2, res.getColor(R.color.seafoam));
pie.addItem("Bandung", 3.5f, res.getColor(R.color.chartreuse));
pie.addItem("Jogjakarta", 2.5f, res.getColor(R.color.emerald));
pie.addItem("Semarang", 3, res.getColor(R.color.bluegrass));
pie.addItem("Bali", 1, res.getColor(R.color.turquoise));
pie.addItem("Lombok", 3, res.getColor(R.color.slate));
(findViewById(R.id.Reset)).setOnClickListener(new View.OnClickListener() {
public void onClick(View view) {
pie.setCurrentItem(0);
}
});
}
}
|
UTF-8
|
Java
| 1,226 |
java
|
PieChartActivity.java
|
Java
|
[] | null |
[] |
package com.anton.sample;
import android.app.Activity;
import android.content.res.Resources;
import android.os.Bundle;
import android.view.View;
import com.anton.sample.view.PieChart;
public class PieChartActivity extends Activity {
/**
* Called when the activity is first created.
*/
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Resources res = getResources();
setContentView(R.layout.activity_pie_chart);
final PieChart pie = (PieChart) this.findViewById(R.id.Pie);
pie.addItem("Jakarta", 2, res.getColor(R.color.seafoam));
pie.addItem("Bandung", 3.5f, res.getColor(R.color.chartreuse));
pie.addItem("Jogjakarta", 2.5f, res.getColor(R.color.emerald));
pie.addItem("Semarang", 3, res.getColor(R.color.bluegrass));
pie.addItem("Bali", 1, res.getColor(R.color.turquoise));
pie.addItem("Lombok", 3, res.getColor(R.color.slate));
(findViewById(R.id.Reset)).setOnClickListener(new View.OnClickListener() {
public void onClick(View view) {
pie.setCurrentItem(0);
}
});
}
}
| 1,226 | 0.636215 | 0.628874 | 36 | 32 | 26.022427 | 82 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.833333 | false | false |
13
|
35f710140e947cb287d013108faa57bf58625da2
| 360,777,321,265 |
26624f5e1b39b90168d6c825d5c9ba3f714aa8b9
|
/src/main/java/com/kenick/util/AliSmsUtil.java
|
a1916dbe901ac26bf11bbaafd48b323e8a48bfcc
|
[
"Apache-2.0"
] |
permissive
|
kickTec/SmartFinancialManager
|
https://github.com/kickTec/SmartFinancialManager
|
eae0fd0b9b43eb0515619e59f65024da5fcbe20a
|
fa0ece64735734b1ac6b89137867803454ecdad2
|
refs/heads/master
| 2023-07-19T16:56:58.039000 | 2021-07-24T02:22:25 | 2021-07-24T02:22:25 | 147,168,257 | 1 | 0 |
Apache-2.0
| false | 2023-07-17T22:58:57 | 2018-09-03T07:34:12 | 2021-07-24T02:22:27 | 2023-07-17T22:58:57 | 47,621 | 1 | 0 | 1 |
JavaScript
| false | false |
package com.kenick.util;
import com.alibaba.fastjson.JSONObject;
import com.aliyuncs.DefaultAcsClient;
import com.aliyuncs.IAcsClient;
import com.aliyuncs.dysmsapi.model.v20170525.SendSmsRequest;
import com.aliyuncs.dysmsapi.model.v20170525.SendSmsResponse;
import com.aliyuncs.exceptions.ClientException;
import com.aliyuncs.http.MethodType;
import com.aliyuncs.profile.DefaultProfile;
import com.aliyuncs.profile.IClientProfile;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class AliSmsUtil {
public static String accessKeyIdSms; // 阿里短信ID
public static String accessKeySecretSms; // 阿里短信密码
private final static Logger logger = LoggerFactory.getLogger(AliSmsUtil.class);
static {
if(StringUtils.isBlank(accessKeyIdSms)){
accessKeyIdSms = FileUtil.getPropertyByEnv("ali.sms.accessKeyId");
}
if(StringUtils.isBlank(accessKeySecretSms)){
accessKeySecretSms = FileUtil.getPropertyByEnv("ali.sms.accessKeySecret");
}
}
// 阿里发送短信码
public static JSONObject aliSendSmsCode(String phone, String code)
{
JSONObject rtnJson = new JSONObject();
rtnJson.put("flag", true);
// 阿里短信配置
String signName = "智慧仓储";
String templateCodee = "SMS_175533709";
JSONObject sendMessageParam = new JSONObject();
sendMessageParam.put("code", code);
//设置超时时间-可自行调整
System.setProperty("sun.net.client.defaultConnectTimeout", "3000");
System.setProperty("sun.net.client.defaultReadTimeout", "3000");
//初始化ascClient需要的几个参数
final String product = "Dysmsapi"; //短信API产品名称(短信产品名固定,无需修改)
final String domain = "dysmsapi.aliyuncs.com"; //短信API产品域名(接口地址固定,无需修改)
//初始化ascClient,暂时不支持多region
IClientProfile profile = DefaultProfile.getProfile("cn-hangzhou", accessKeyIdSms, accessKeySecretSms);
try {
DefaultProfile.addEndpoint("cn-hangzhou", "cn-hangzhou", product, domain);
} catch (ClientException e) {
logger.error("errorCode: sys_alisms_send_error, errorMessage: 阿里DefaultProfile.addEndpoint添加失败", e);
rtnJson.put("flag", false);
rtnJson.put("errorCode", "sys_alisms_send_error");
rtnJson.put("errorMessage", "阿里DefaultProfile.addEndpoint添加失败");
return rtnJson;
}
IAcsClient acsClient = new DefaultAcsClient(profile);
//组装请求对象
SendSmsRequest request = new SendSmsRequest();
//使用post提交
request.setMethod(MethodType.POST);
//必填:待发送手机号。支持以逗号分隔的形式进行批量调用,批量上限为1000个手机号码,批量调用相对于单条调用及时性稍有延迟,验证码类型的短信推荐使用单条调用的方式
request.setPhoneNumbers(phone);
//必填:短信签名-可在短信控制台中找到
request.setSignName(signName);
//必填:短信模板-可在短信控制台中找到
request.setTemplateCode(templateCodee);
//可选:模板中的变量替换JSON串,如模板内容为"亲爱的${name},您的验证码为${code}"时,此处的值为
//友情提示:如果JSON中需要带换行符,请参照标准的JSON协议对换行符的要求,比如短信内容中包含\r\n的情况在JSON中需要表示成\\r\\n,否则会导致JSON在服务端解析失败
request.setTemplateParam(sendMessageParam.toJSONString());
//可选-上行短信扩展码(无特殊需求用户请忽略此字段)
//request.setSmsUpExtendCode("90997");
//可选:outId为提供给业务方扩展字段,最终在短信回执消息中将此值带回给调用者
request.setOutId(phone);
//请求失败这里会抛ClientException异常
SendSmsResponse sendSmsResponse = null;
try {
sendSmsResponse = acsClient.getAcsResponse(request);
logger.debug("向{}发送{}结果code:{},描述:{}", phone, code, sendSmsResponse.getCode(), sendSmsResponse.getMessage());
if(!"OK".equals(sendSmsResponse.getCode())){
rtnJson.put("flag", false);
rtnJson.put("errorCode", "send_response_noOk");
rtnJson.put("errorMessage", "阿里验证码发送失败");
}
} catch (Exception e) {
logger.error("errorCode: sys_verifycode_send_error, errorMessage: 阿里验证码发送失败", e);
rtnJson.put("flag", false);
rtnJson.put("errorCode", "sys_verifycode_send_error");
rtnJson.put("errorMessage", "阿里验证码发送失败");
return rtnJson;
}
return rtnJson;
}
public static void main(String[] args) {
JSONObject ret = aliSendSmsCode("15910761260", "123456");
System.out.println(ret);
}
}
|
UTF-8
|
Java
| 4,657 |
java
|
AliSmsUtil.java
|
Java
|
[] | null |
[] |
package com.kenick.util;
import com.alibaba.fastjson.JSONObject;
import com.aliyuncs.DefaultAcsClient;
import com.aliyuncs.IAcsClient;
import com.aliyuncs.dysmsapi.model.v20170525.SendSmsRequest;
import com.aliyuncs.dysmsapi.model.v20170525.SendSmsResponse;
import com.aliyuncs.exceptions.ClientException;
import com.aliyuncs.http.MethodType;
import com.aliyuncs.profile.DefaultProfile;
import com.aliyuncs.profile.IClientProfile;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class AliSmsUtil {
public static String accessKeyIdSms; // 阿里短信ID
public static String accessKeySecretSms; // 阿里短信密码
private final static Logger logger = LoggerFactory.getLogger(AliSmsUtil.class);
static {
if(StringUtils.isBlank(accessKeyIdSms)){
accessKeyIdSms = FileUtil.getPropertyByEnv("ali.sms.accessKeyId");
}
if(StringUtils.isBlank(accessKeySecretSms)){
accessKeySecretSms = FileUtil.getPropertyByEnv("ali.sms.accessKeySecret");
}
}
// 阿里发送短信码
public static JSONObject aliSendSmsCode(String phone, String code)
{
JSONObject rtnJson = new JSONObject();
rtnJson.put("flag", true);
// 阿里短信配置
String signName = "智慧仓储";
String templateCodee = "SMS_175533709";
JSONObject sendMessageParam = new JSONObject();
sendMessageParam.put("code", code);
//设置超时时间-可自行调整
System.setProperty("sun.net.client.defaultConnectTimeout", "3000");
System.setProperty("sun.net.client.defaultReadTimeout", "3000");
//初始化ascClient需要的几个参数
final String product = "Dysmsapi"; //短信API产品名称(短信产品名固定,无需修改)
final String domain = "dysmsapi.aliyuncs.com"; //短信API产品域名(接口地址固定,无需修改)
//初始化ascClient,暂时不支持多region
IClientProfile profile = DefaultProfile.getProfile("cn-hangzhou", accessKeyIdSms, accessKeySecretSms);
try {
DefaultProfile.addEndpoint("cn-hangzhou", "cn-hangzhou", product, domain);
} catch (ClientException e) {
logger.error("errorCode: sys_alisms_send_error, errorMessage: 阿里DefaultProfile.addEndpoint添加失败", e);
rtnJson.put("flag", false);
rtnJson.put("errorCode", "sys_alisms_send_error");
rtnJson.put("errorMessage", "阿里DefaultProfile.addEndpoint添加失败");
return rtnJson;
}
IAcsClient acsClient = new DefaultAcsClient(profile);
//组装请求对象
SendSmsRequest request = new SendSmsRequest();
//使用post提交
request.setMethod(MethodType.POST);
//必填:待发送手机号。支持以逗号分隔的形式进行批量调用,批量上限为1000个手机号码,批量调用相对于单条调用及时性稍有延迟,验证码类型的短信推荐使用单条调用的方式
request.setPhoneNumbers(phone);
//必填:短信签名-可在短信控制台中找到
request.setSignName(signName);
//必填:短信模板-可在短信控制台中找到
request.setTemplateCode(templateCodee);
//可选:模板中的变量替换JSON串,如模板内容为"亲爱的${name},您的验证码为${code}"时,此处的值为
//友情提示:如果JSON中需要带换行符,请参照标准的JSON协议对换行符的要求,比如短信内容中包含\r\n的情况在JSON中需要表示成\\r\\n,否则会导致JSON在服务端解析失败
request.setTemplateParam(sendMessageParam.toJSONString());
//可选-上行短信扩展码(无特殊需求用户请忽略此字段)
//request.setSmsUpExtendCode("90997");
//可选:outId为提供给业务方扩展字段,最终在短信回执消息中将此值带回给调用者
request.setOutId(phone);
//请求失败这里会抛ClientException异常
SendSmsResponse sendSmsResponse = null;
try {
sendSmsResponse = acsClient.getAcsResponse(request);
logger.debug("向{}发送{}结果code:{},描述:{}", phone, code, sendSmsResponse.getCode(), sendSmsResponse.getMessage());
if(!"OK".equals(sendSmsResponse.getCode())){
rtnJson.put("flag", false);
rtnJson.put("errorCode", "send_response_noOk");
rtnJson.put("errorMessage", "阿里验证码发送失败");
}
} catch (Exception e) {
logger.error("errorCode: sys_verifycode_send_error, errorMessage: 阿里验证码发送失败", e);
rtnJson.put("flag", false);
rtnJson.put("errorCode", "sys_verifycode_send_error");
rtnJson.put("errorMessage", "阿里验证码发送失败");
return rtnJson;
}
return rtnJson;
}
public static void main(String[] args) {
JSONObject ret = aliSendSmsCode("15910761260", "123456");
System.out.println(ret);
}
}
| 4,657 | 0.752284 | 0.7361 | 106 | 35.14151 | 26.691614 | 112 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.613208 | false | false |
13
|
95679a49a7ddad5eba55b3aa53192fc1cc1cdf19
| 21,844,203,703,334 |
f1092af579fd3f4f391248b0b9e28cf19002c6c7
|
/src/main/java/com/ci/chap3/ds/lists/ListUtil.java
|
a085362475db0130441f502f52539a7ef933d085
|
[] |
no_license
|
sampath516/problem_solving
|
https://github.com/sampath516/problem_solving
|
8eb17a202e133974206776188bea3b5bc4aef88c
|
b452b56f6efaeb06eef3bcc4389854d0d241e453
|
refs/heads/master
| 2021-09-23T16:05:43.031000 | 2021-09-13T10:30:09 | 2021-09-13T10:30:09 | 49,187,250 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.ci.chap3.ds.lists;
import java.util.ArrayList;
import com.ctci.chap2.lists.List;
import com.ctci.chap2.lists.SingleLinkedList.Node;
public class ListUtil {
/**
* <b>Question 13:</b> Please implement a function to print a list from its
* tail to head.
*/
public static java.util.List<Integer> printTailToHeadRecursive(List<Integer> singleLinedList) {
java.util.List<Integer> snapshot = new ArrayList<Integer>();
if (singleLinedList == null || singleLinedList.isEmpty()) {
return snapshot;
}
printTailToHeadRecursive(singleLinedList.getHeader().getNext(), snapshot);
return snapshot;
}
private static void printTailToHeadRecursive(Node<Integer> node, java.util.List<Integer> snapshot) {
if (node == null) {
return;
}
printTailToHeadRecursive(node.getNext(), snapshot);
snapshot.add(node.getData());
}
/**
* <b>Question 16:</b> How do you check whether there is a loop in a linked
* list? For example, the list in Figure 3-9 contains a loop.
*
* Floyd’s Cycle-Finding Algorithm
*/
public static Node<Integer> detectLoopInSingleLinkedList(Node<Integer> head) {
if (head == null || head.getNext() == null) {
return null;
}
Node<Integer> slowPointer = head;
Node<Integer> fastPointer = head;
while (fastPointer != null ) {
slowPointer = slowPointer.getNext();
fastPointer = fastPointer.getNext();
if(fastPointer != null){
fastPointer = fastPointer.getNext();
}
if (slowPointer == fastPointer) {
break;
}
}
return fastPointer;
}
}
|
WINDOWS-1252
|
Java
| 1,545 |
java
|
ListUtil.java
|
Java
|
[] | null |
[] |
package com.ci.chap3.ds.lists;
import java.util.ArrayList;
import com.ctci.chap2.lists.List;
import com.ctci.chap2.lists.SingleLinkedList.Node;
public class ListUtil {
/**
* <b>Question 13:</b> Please implement a function to print a list from its
* tail to head.
*/
public static java.util.List<Integer> printTailToHeadRecursive(List<Integer> singleLinedList) {
java.util.List<Integer> snapshot = new ArrayList<Integer>();
if (singleLinedList == null || singleLinedList.isEmpty()) {
return snapshot;
}
printTailToHeadRecursive(singleLinedList.getHeader().getNext(), snapshot);
return snapshot;
}
private static void printTailToHeadRecursive(Node<Integer> node, java.util.List<Integer> snapshot) {
if (node == null) {
return;
}
printTailToHeadRecursive(node.getNext(), snapshot);
snapshot.add(node.getData());
}
/**
* <b>Question 16:</b> How do you check whether there is a loop in a linked
* list? For example, the list in Figure 3-9 contains a loop.
*
* Floyd’s Cycle-Finding Algorithm
*/
public static Node<Integer> detectLoopInSingleLinkedList(Node<Integer> head) {
if (head == null || head.getNext() == null) {
return null;
}
Node<Integer> slowPointer = head;
Node<Integer> fastPointer = head;
while (fastPointer != null ) {
slowPointer = slowPointer.getNext();
fastPointer = fastPointer.getNext();
if(fastPointer != null){
fastPointer = fastPointer.getNext();
}
if (slowPointer == fastPointer) {
break;
}
}
return fastPointer;
}
}
| 1,545 | 0.695399 | 0.689566 | 61 | 24.295082 | 26.844021 | 101 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.852459 | false | false |
13
|
fe7bfb0d9cbff13e62374ec357cef35a42431eae
| 28,235,115,060,859 |
b041b79f2a2882a3b28daab48bdcd2dc9951b63a
|
/src/main/project/visualisation/MyFrame.java
|
d929c30218f95432f11c2ab55cfcf97f69f55646
|
[] |
no_license
|
zofiagrodecka/Evolution-generator
|
https://github.com/zofiagrodecka/Evolution-generator
|
9eb5253104f9721e65dbad0cb17a091dea91f382
|
895e4db8cf789cbb6ca2b843ff20ac297b200f46
|
refs/heads/master
| 2023-08-03T11:41:57.813000 | 2021-09-16T14:27:54 | 2021-09-16T14:27:54 | 322,641,302 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package project.visualisation;
import project.Simulation;
import javax.swing.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
public class MyFrame extends JFrame {
private Simulation simulation;
public MyFrame(String text, Simulation simulation){
super(text);
this.simulation = simulation;
this.addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
simulation.end();
simulation.setWindowClosed();
}
});
}
}
|
UTF-8
|
Java
| 592 |
java
|
MyFrame.java
|
Java
|
[] | null |
[] |
package project.visualisation;
import project.Simulation;
import javax.swing.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
public class MyFrame extends JFrame {
private Simulation simulation;
public MyFrame(String text, Simulation simulation){
super(text);
this.simulation = simulation;
this.addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
simulation.end();
simulation.setWindowClosed();
}
});
}
}
| 592 | 0.638514 | 0.638514 | 27 | 20.925926 | 18.714079 | 55 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.444444 | false | false |
13
|
c174fdd638887d356300d90a309ff958e94f6356
| 28,810,640,658,354 |
33045dd5111de6d53b64c23155656c946556f7d2
|
/src/main/java/com/vitgon/schedulehib/repository/base/Repository.java
|
25fefe749f501a4cf694d123469d511002038da0
|
[] |
no_license
|
vit-gon/schedule-hibernate
|
https://github.com/vit-gon/schedule-hibernate
|
7fff3ef2b5bfc2092dd29e235d86d913f08568a0
|
b8ca89306b2792ec330937fa427c0ce3241e2dd5
|
refs/heads/master
| 2020-04-09T00:03:22.701000 | 2018-11-30T16:42:00 | 2018-11-30T16:42:00 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.vitgon.schedulehib.repository.base;
import java.util.List;
public interface Repository<T, K> {
K save(T obj);
void update(T obj);
T findById(K id);
List<T> findAll();
}
|
UTF-8
|
Java
| 187 |
java
|
Repository.java
|
Java
|
[] | null |
[] |
package com.vitgon.schedulehib.repository.base;
import java.util.List;
public interface Repository<T, K> {
K save(T obj);
void update(T obj);
T findById(K id);
List<T> findAll();
}
| 187 | 0.71123 | 0.71123 | 10 | 17.700001 | 14.477914 | 47 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.1 | false | false |
13
|
9e12575aff77eafe47ea24895f79d56f72799f36
| 26,190,710,637,677 |
474ac85679eeecf9ee244fdcc1c403d2ec61e308
|
/app/src/main/java/com/example/mackor/ezstudies/Fragments/DA2ListFragment.java
|
eaa6e308f2b77310aea53d8eb394afb6633c725c
|
[] |
no_license
|
mack0r3/EzStudies
|
https://github.com/mack0r3/EzStudies
|
64c2aa543644e3283aff36a629a893243bb8ea90
|
5e8a5de91bdec0cd9b1ddddc21725ba64104a2f2
|
refs/heads/master
| 2021-01-10T07:42:04.583000 | 2016-04-10T12:51:06 | 2016-04-10T12:51:06 | 55,898,424 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.example.mackor.ezstudies.Fragments;
import android.os.Bundle;
import android.support.v4.app.ListFragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ProgressBar;
import android.widget.TextView;
import com.example.mackor.ezstudies.BackEndTools.CustomJSONAdapter;
import com.example.mackor.ezstudies.BackEndTools.Networking;
import com.example.mackor.ezstudies.FrontEndTools.FontManager;
import com.example.mackor.ezstudies.R;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
/**
* Created by Bogus on 2016-02-19.
*/
public class DA2ListFragment extends ListFragment {
ProgressBar progressBar;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View inflatedView = inflater.inflate(R.layout.list_fragment_da2, container, false);
progressBar = (ProgressBar)inflatedView.findViewById(R.id.myProgressBar);
return inflatedView;
}
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
Networking networking = (Networking) new Networking(progressBar, getContext(), new Networking.AsyncResponse() {
@Override
public void processFinish(String output) {
try {
JSONArray jsonArr = SortResults(new JSONArray(output), "DA2");
CustomJSONAdapter myAdapter = new CustomJSONAdapter("276946", jsonArr, getActivity());
setListAdapter(myAdapter);
} catch (JSONException e) {
Log.v("ERROR", e.getMessage());
e.printStackTrace();
}
}
}).execute("GETRESULTS", null);
}
public JSONArray SortResults(JSONArray jsonArr, String group)
{
JSONArray newJSONArr = new JSONArray();
for(int i = 0 ; i < jsonArr.length(); i++)
{
try {
JSONObject json = jsonArr.getJSONObject(i);
if(json.getString("group").equals(group))
{
newJSONArr.put(json);
}
} catch (JSONException e) {
e.printStackTrace();
}
}
return newJSONArr;
}
}
|
UTF-8
|
Java
| 2,412 |
java
|
DA2ListFragment.java
|
Java
|
[
{
"context": "on;\nimport org.json.JSONObject;\n\n/**\n * Created by Bogus on 2016-02-19.\n */\npublic class DA2ListFragment",
"end": 646,
"score": 0.5456273555755615,
"start": 643,
"tag": "NAME",
"value": "Bog"
},
{
"context": "import org.json.JSONObject;\n\n/**\n * Created by Bogus on 2016-02-19.\n */\npublic class DA2ListFragment e",
"end": 648,
"score": 0.5534192323684692,
"start": 646,
"tag": "USERNAME",
"value": "us"
}
] | null |
[] |
package com.example.mackor.ezstudies.Fragments;
import android.os.Bundle;
import android.support.v4.app.ListFragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ProgressBar;
import android.widget.TextView;
import com.example.mackor.ezstudies.BackEndTools.CustomJSONAdapter;
import com.example.mackor.ezstudies.BackEndTools.Networking;
import com.example.mackor.ezstudies.FrontEndTools.FontManager;
import com.example.mackor.ezstudies.R;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
/**
* Created by Bogus on 2016-02-19.
*/
public class DA2ListFragment extends ListFragment {
ProgressBar progressBar;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View inflatedView = inflater.inflate(R.layout.list_fragment_da2, container, false);
progressBar = (ProgressBar)inflatedView.findViewById(R.id.myProgressBar);
return inflatedView;
}
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
Networking networking = (Networking) new Networking(progressBar, getContext(), new Networking.AsyncResponse() {
@Override
public void processFinish(String output) {
try {
JSONArray jsonArr = SortResults(new JSONArray(output), "DA2");
CustomJSONAdapter myAdapter = new CustomJSONAdapter("276946", jsonArr, getActivity());
setListAdapter(myAdapter);
} catch (JSONException e) {
Log.v("ERROR", e.getMessage());
e.printStackTrace();
}
}
}).execute("GETRESULTS", null);
}
public JSONArray SortResults(JSONArray jsonArr, String group)
{
JSONArray newJSONArr = new JSONArray();
for(int i = 0 ; i < jsonArr.length(); i++)
{
try {
JSONObject json = jsonArr.getJSONObject(i);
if(json.getString("group").equals(group))
{
newJSONArr.put(json);
}
} catch (JSONException e) {
e.printStackTrace();
}
}
return newJSONArr;
}
}
| 2,412 | 0.643864 | 0.635987 | 71 | 32.971832 | 27.70619 | 119 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.647887 | false | false |
13
|
e568bade94731a1917aba148b822122f32d7932c
| 9,156,870,337,781 |
810348dcd7b1f2c3fa31348d67b66b159fe1a2b1
|
/markdown/src/main/java/com/zzhoujay/markdown/style/ScaleHeightSpan.java
|
8e418de39380abb1b22dfb7efa39e3c3ee4f6737
|
[
"MIT"
] |
permissive
|
AboutAndroid/Markdown
|
https://github.com/AboutAndroid/Markdown
|
a39491ed8868d35399d67d7f11175ffad88dde48
|
1df53403627359b3942724db79a44bb4165303d3
|
refs/heads/master
| 2021-04-12T08:59:39.903000 | 2016-10-25T13:07:56 | 2016-10-25T13:07:56 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.zzhoujay.markdown.style;
import android.graphics.Paint;
import android.os.Parcel;
import android.os.Parcelable;
import android.text.style.LineHeightSpan;
/**
* Created by zhou on 16-7-2.
*/
public class ScaleHeightSpan implements LineHeightSpan, Parcelable {
private float scale;
public ScaleHeightSpan(float scale) {
this.scale = scale;
}
@Override
public void chooseHeight(CharSequence text, int start, int end, int spanstartv, int v, Paint.FontMetricsInt fm) {
fm.ascent *= scale;
fm.top *= scale;
fm.descent *= scale;
fm.bottom *= scale;
}
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeFloat(this.scale);
}
protected ScaleHeightSpan(Parcel in) {
this.scale = in.readFloat();
}
public static final Parcelable.Creator<ScaleHeightSpan> CREATOR = new Parcelable.Creator<ScaleHeightSpan>() {
@Override
public ScaleHeightSpan createFromParcel(Parcel source) {
return new ScaleHeightSpan(source);
}
@Override
public ScaleHeightSpan[] newArray(int size) {
return new ScaleHeightSpan[size];
}
};
}
|
UTF-8
|
Java
| 1,298 |
java
|
ScaleHeightSpan.java
|
Java
|
[
{
"context": "roid.text.style.LineHeightSpan;\n\n/**\n * Created by zhou on 16-7-2.\n */\npublic class ScaleHeightSpan imple",
"end": 190,
"score": 0.9986438751220703,
"start": 186,
"tag": "USERNAME",
"value": "zhou"
}
] | null |
[] |
package com.zzhoujay.markdown.style;
import android.graphics.Paint;
import android.os.Parcel;
import android.os.Parcelable;
import android.text.style.LineHeightSpan;
/**
* Created by zhou on 16-7-2.
*/
public class ScaleHeightSpan implements LineHeightSpan, Parcelable {
private float scale;
public ScaleHeightSpan(float scale) {
this.scale = scale;
}
@Override
public void chooseHeight(CharSequence text, int start, int end, int spanstartv, int v, Paint.FontMetricsInt fm) {
fm.ascent *= scale;
fm.top *= scale;
fm.descent *= scale;
fm.bottom *= scale;
}
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeFloat(this.scale);
}
protected ScaleHeightSpan(Parcel in) {
this.scale = in.readFloat();
}
public static final Parcelable.Creator<ScaleHeightSpan> CREATOR = new Parcelable.Creator<ScaleHeightSpan>() {
@Override
public ScaleHeightSpan createFromParcel(Parcel source) {
return new ScaleHeightSpan(source);
}
@Override
public ScaleHeightSpan[] newArray(int size) {
return new ScaleHeightSpan[size];
}
};
}
| 1,298 | 0.64869 | 0.644838 | 53 | 23.490566 | 25.802313 | 117 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.45283 | false | false |
13
|
cd0b4bf99edced2f1367d074ffa015f982d8a222
| 31,980,326,519,349 |
b9cda2ac5062235ab7c42f2407790b35c79d8a88
|
/src/main/java/com/hitex/menulife/model/Notification.java
|
315044cc6f5eac9b9319b32e07931e63f2db923d
|
[] |
no_license
|
lkintheend/manulife
|
https://github.com/lkintheend/manulife
|
3d56a7f2be5de1efba446924d1c9c5d11ab4bdb4
|
7e4b181a606f0d43eccc63668afef12a810b9327
|
refs/heads/master
| 2020-03-21T11:58:18.141000 | 2018-06-25T02:23:28 | 2018-06-25T02:23:28 | 138,531,114 | 1 | 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 com.hitex.menulife.model;
import com.hitex.menulife.util.Util;
/**
*
* @author lkintheend
*/
public class Notification {
String id;
String isRead;
String title;
String content;
String status;
String createdAt;
String idUser;
String idService;
String type;
public Notification() {
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getIsRead() {
return isRead;
}
public void setIsRead(String isRead) {
this.isRead = isRead;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getCreatedAt() {
return createdAt;
}
public void setCreatedAt(String createdAt) {
this.createdAt = Util.convertStringToTimestamp(createdAt);
}
public String getIdUser() {
return idUser;
}
public void setIdUser(String idUser) {
this.idUser = idUser;
}
public String getIdService() {
return idService;
}
public void setIdService(String idService) {
this.idService = idService;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
@Override
public String toString() {
return "Notification{" + "id=" + id + ", isRead=" + isRead + ", title=" + title + ", content=" + content + ", status=" + status + ", createdAt=" + createdAt + ", idUser=" + idUser + ", idService=" + idService + ", type=" + type + '}';
}
}
|
UTF-8
|
Java
| 2,134 |
java
|
Notification.java
|
Java
|
[
{
"context": "t com.hitex.menulife.util.Util;\n\n/**\n *\n * @author lkintheend\n */\npublic class Notification {\n\n String id;\n ",
"end": 286,
"score": 0.9994240999221802,
"start": 276,
"tag": "USERNAME",
"value": "lkintheend"
}
] | 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.hitex.menulife.model;
import com.hitex.menulife.util.Util;
/**
*
* @author lkintheend
*/
public class Notification {
String id;
String isRead;
String title;
String content;
String status;
String createdAt;
String idUser;
String idService;
String type;
public Notification() {
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getIsRead() {
return isRead;
}
public void setIsRead(String isRead) {
this.isRead = isRead;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getCreatedAt() {
return createdAt;
}
public void setCreatedAt(String createdAt) {
this.createdAt = Util.convertStringToTimestamp(createdAt);
}
public String getIdUser() {
return idUser;
}
public void setIdUser(String idUser) {
this.idUser = idUser;
}
public String getIdService() {
return idService;
}
public void setIdService(String idService) {
this.idService = idService;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
@Override
public String toString() {
return "Notification{" + "id=" + id + ", isRead=" + isRead + ", title=" + title + ", content=" + content + ", status=" + status + ", createdAt=" + createdAt + ", idUser=" + idUser + ", idService=" + idService + ", type=" + type + '}';
}
}
| 2,134 | 0.591378 | 0.591378 | 107 | 18.943926 | 27.343721 | 242 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.383178 | false | false |
13
|
5446cc9c4b258e546586155eb13e7354dccd2439
| 32,590,211,911,680 |
05319b0fd972ccd2aa8a4d446232924fb8d2fb38
|
/src/main/java/org/gombert/cooking/recipe/domain/IngredientAmount.java
|
5f80ed61e7aba936f27f8548dcab67d649d96d4f
|
[] |
no_license
|
oskar9247/recipe
|
https://github.com/oskar9247/recipe
|
e3eab6c6925a61f90df04448ff7b893cca5bc491
|
00d689a50d123b0144a9fc514cab54f6d6651144
|
refs/heads/main
| 2023-03-31T13:24:21.753000 | 2021-03-27T21:00:15 | 2021-03-27T21:32:07 | 352,175,321 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package org.gombert.cooking.recipe.domain;
import lombok.AccessLevel;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
@Getter(AccessLevel.MODULE)
@Setter(AccessLevel.PRIVATE)
@EqualsAndHashCode
class IngredientAmount extends BaseEntity
{
final private Double amount;
final private Unit unit;
IngredientAmount(final double amount, final String unit)
{
throwExecptionIfNull(amount, "ingredient amount");
this.amount = amount;
this.unit = new Unit(unit);
}
}
|
UTF-8
|
Java
| 533 |
java
|
IngredientAmount.java
|
Java
|
[] | null |
[] |
package org.gombert.cooking.recipe.domain;
import lombok.AccessLevel;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
@Getter(AccessLevel.MODULE)
@Setter(AccessLevel.PRIVATE)
@EqualsAndHashCode
class IngredientAmount extends BaseEntity
{
final private Double amount;
final private Unit unit;
IngredientAmount(final double amount, final String unit)
{
throwExecptionIfNull(amount, "ingredient amount");
this.amount = amount;
this.unit = new Unit(unit);
}
}
| 533 | 0.741088 | 0.741088 | 23 | 22.173914 | 17.991911 | 60 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.521739 | false | false |
13
|
60ea34f5f9c8a7cf2d7418da1fd152b881ef2a59
| 4,088,808,906,027 |
fa1824d91376eb25660a9c8c442d02be6fda1900
|
/app/src/main/java/com/maowu/helpers/AdminUtils.java
|
af834460f9cece165e0ed53f4952de1c096cde09
|
[] |
no_license
|
li8607/MaoWu2
|
https://github.com/li8607/MaoWu2
|
5af0f511c84efb7de45e5f1fe134d450bbb6cdb2
|
c211c8aade3cdb89306dc0477f1eeb4220d697cf
|
refs/heads/master
| 2020-08-23T03:50:39.117000 | 2019-11-05T14:19:01 | 2019-11-05T14:19:01 | 216,537,221 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.maowu.helpers;
import android.content.Context;
import android.widget.Toast;
import cn.leancloud.AVACL;
import cn.leancloud.AVObject;
import cn.leancloud.AVRole;
import cn.leancloud.AVUser;
import io.reactivex.Observer;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.Disposable;
import io.reactivex.schedulers.Schedulers;
public class AdminUtils {
public static void createAdmin(Context context) {
if (AVUser.getCurrentUser() != null) {
AVACL roleACL = new AVACL();
roleACL.setPublicReadAccess(true);
roleACL.setWriteAccess(AVUser.getCurrentUser(), true);
// 新建一个角色,并把为当前用户赋予该角色
AVRole administrator = new AVRole("Administrator", roleACL);//新建角色
administrator.getUsers().add(AVUser.getCurrentUser());//为当前用户赋予该角色
administrator.saveInBackground().subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<AVObject>() {
@Override
public void onSubscribe(Disposable d) {
}
@Override
public void onNext(AVObject avObject) {
Toast.makeText(context, "创建成功", Toast.LENGTH_SHORT).show();
}
@Override
public void onError(Throwable e) {
Toast.makeText(context, "e: " + e, Toast.LENGTH_LONG).show();
}
@Override
public void onComplete() {
}
});//保存到云端
} else {
Toast.makeText(context, "用户未登录", Toast.LENGTH_SHORT).show();
}
}
public static void createAgent(Context context) {
AVACL roleACL = new AVACL();
roleACL.setPublicReadAccess(true);
roleACL.setRoleWriteAccess("Administrator", true);
// 新建一个角色,并把为当前用户赋予该角色
AVRole administrator = new AVRole("Agent", roleACL);//新建角色
administrator.saveInBackground().subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<AVObject>() {
@Override
public void onSubscribe(Disposable d) {
}
@Override
public void onNext(AVObject avObject) {
Toast.makeText(context, "创建成功", Toast.LENGTH_SHORT).show();
}
@Override
public void onError(Throwable e) {
Toast.makeText(context, "e: " + e, Toast.LENGTH_LONG).show();
}
@Override
public void onComplete() {
}
});
}
}
|
UTF-8
|
Java
| 3,073 |
java
|
AdminUtils.java
|
Java
|
[] | null |
[] |
package com.maowu.helpers;
import android.content.Context;
import android.widget.Toast;
import cn.leancloud.AVACL;
import cn.leancloud.AVObject;
import cn.leancloud.AVRole;
import cn.leancloud.AVUser;
import io.reactivex.Observer;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.Disposable;
import io.reactivex.schedulers.Schedulers;
public class AdminUtils {
public static void createAdmin(Context context) {
if (AVUser.getCurrentUser() != null) {
AVACL roleACL = new AVACL();
roleACL.setPublicReadAccess(true);
roleACL.setWriteAccess(AVUser.getCurrentUser(), true);
// 新建一个角色,并把为当前用户赋予该角色
AVRole administrator = new AVRole("Administrator", roleACL);//新建角色
administrator.getUsers().add(AVUser.getCurrentUser());//为当前用户赋予该角色
administrator.saveInBackground().subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<AVObject>() {
@Override
public void onSubscribe(Disposable d) {
}
@Override
public void onNext(AVObject avObject) {
Toast.makeText(context, "创建成功", Toast.LENGTH_SHORT).show();
}
@Override
public void onError(Throwable e) {
Toast.makeText(context, "e: " + e, Toast.LENGTH_LONG).show();
}
@Override
public void onComplete() {
}
});//保存到云端
} else {
Toast.makeText(context, "用户未登录", Toast.LENGTH_SHORT).show();
}
}
public static void createAgent(Context context) {
AVACL roleACL = new AVACL();
roleACL.setPublicReadAccess(true);
roleACL.setRoleWriteAccess("Administrator", true);
// 新建一个角色,并把为当前用户赋予该角色
AVRole administrator = new AVRole("Agent", roleACL);//新建角色
administrator.saveInBackground().subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<AVObject>() {
@Override
public void onSubscribe(Disposable d) {
}
@Override
public void onNext(AVObject avObject) {
Toast.makeText(context, "创建成功", Toast.LENGTH_SHORT).show();
}
@Override
public void onError(Throwable e) {
Toast.makeText(context, "e: " + e, Toast.LENGTH_LONG).show();
}
@Override
public void onComplete() {
}
});
}
}
| 3,073 | 0.534406 | 0.534406 | 84 | 33.773811 | 27.718548 | 115 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.488095 | false | false |
13
|
7574759b9eb35fb9be1051829ee679182957f534
| 24,335,284,702,881 |
5b7f9768758b2332b4effd41d08e13f1c188ba8b
|
/hw17-docker/server/src/test/java/ru/otus/library/config/SecurityTestConfiguration.java
|
5e30ea7418ec1afeff4be81d3f66b1112026b017
|
[] |
no_license
|
regulyator/otus-spring-homework
|
https://github.com/regulyator/otus-spring-homework
|
6e27aa42e18199fe5bbc2efed350cdff5289b5ba
|
02ba7e87bf87c85b2254f7eb6aad32b0bb91f9a5
|
refs/heads/master
| 2023-07-01T18:58:15.923000 | 2021-07-22T15:09:34 | 2021-07-22T15:09:34 | 343,099,726 | 0 | 0 | null | false | 2021-07-22T15:09:34 | 2021-02-28T12:27:45 | 2021-07-22T14:55:12 | 2021-07-22T15:09:34 | 3,263 | 0 | 0 | 0 |
Java
| false | false |
package ru.otus.library.config;
import org.springframework.boot.test.context.TestConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.provisioning.InMemoryUserDetailsManager;
import java.util.Collections;
import java.util.Set;
@TestConfiguration
public class SecurityTestConfiguration {
@Bean
public UserDetailsService userDetailsService() {
return new InMemoryUserDetailsManager(Collections.singletonList(ru.otus.library.domain.User.builder()
.username("user")
.password("password")
.authorities(Set.of(new SimpleGrantedAuthority("ROLE_USER")))
.enabled(true)
.credentialsNonExpired(true)
.accountNonLocked(true)
.accountNonExpired(true)
.build()));
}
}
|
UTF-8
|
Java
| 1,006 |
java
|
SecurityTestConfiguration.java
|
Java
|
[
{
"context": " .username(\"user\")\n .password(\"password\")\n .authorities(Set.of(new SimpleG",
"end": 732,
"score": 0.999046802520752,
"start": 724,
"tag": "PASSWORD",
"value": "password"
}
] | null |
[] |
package ru.otus.library.config;
import org.springframework.boot.test.context.TestConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.provisioning.InMemoryUserDetailsManager;
import java.util.Collections;
import java.util.Set;
@TestConfiguration
public class SecurityTestConfiguration {
@Bean
public UserDetailsService userDetailsService() {
return new InMemoryUserDetailsManager(Collections.singletonList(ru.otus.library.domain.User.builder()
.username("user")
.password("<PASSWORD>")
.authorities(Set.of(new SimpleGrantedAuthority("ROLE_USER")))
.enabled(true)
.credentialsNonExpired(true)
.accountNonLocked(true)
.accountNonExpired(true)
.build()));
}
}
| 1,008 | 0.713718 | 0.713718 | 28 | 34.92857 | 28.521832 | 109 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.321429 | false | false |
13
|
1013b7ac06bebc69ecf34a8dbc2a5492bad4f586
| 24,335,284,701,013 |
0daf833508d7ca22ed37efb272f5962c988dd7f2
|
/src/main/java/com/wzz/api/common/SimpleImageHandle.java
|
fe41c42584ff2b89304c67f0e7ed97abe8ada4a5
|
[] |
no_license
|
wzz820/spring-base
|
https://github.com/wzz820/spring-base
|
b857859b06baff5017509a0b3a04935c5fc4337d
|
d7730a5f549f35e259c06f2a608bbe60f919fff3
|
refs/heads/master
| 2019-06-25T01:19:53.923000 | 2016-09-10T08:40:45 | 2016-09-10T08:40:45 | 67,860,408 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.wzz.api.common;
import java.io.InputStream;
import java.io.OutputStream;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.alibaba.simpleimage.ImageRender;
import com.alibaba.simpleimage.SimpleImageException;
import com.alibaba.simpleimage.render.ReadRender;
import com.alibaba.simpleimage.render.ScaleParameter;
import com.alibaba.simpleimage.render.ScaleRender;
import com.alibaba.simpleimage.render.WriteRender;
/**
* @author chenjiajun@lexue.com
* 图像压缩 列子 ali SimpleImage
*/
public class SimpleImageHandle
{
private static final Logger logger = LoggerFactory.getLogger(SimpleImageHandle.class);
public static void imageHandle(InputStream originalImageInStream, OutputStream compressionImageOutStream)
{
ScaleParameter scaleParam = new ScaleParameter(540, 540); // //将图像缩略到540x540以内,不足540x540则不做任何处理
WriteRender wr = null;
try
{
ImageRender imageRender = new ReadRender(originalImageInStream);
ImageRender scaleRender = new ScaleRender(imageRender, scaleParam);
wr = new WriteRender(scaleRender, compressionImageOutStream);
wr.render(); // 触发图像处理
logger.info("compress image success...");
}
catch (Exception e)
{
e.printStackTrace();
}
finally
{
/*IOUtils.closeQuietly(originalImageInStream); // 图片文件输入输出流必须记得关闭
IOUtils.closeQuietly(compressionImageOutStream);*/
if (wr != null)
{
try
{
wr.dispose(); // 释放simpleImage的内部资源
}
catch (SimpleImageException ignore)
{
// skip ...
logger.info("释放simpleImage的内部资源 失败...");
}
}
}
}
}
|
UTF-8
|
Java
| 1,753 |
java
|
SimpleImageHandle.java
|
Java
|
[
{
"context": "mpleimage.render.WriteRender;\r\n\r\n\r\n/**\r\n * @author chenjiajun@lexue.com\r\n * 图像压缩 列子 ali SimpleImage\r\n */\r\npublic class Si",
"end": 504,
"score": 0.9998260736465454,
"start": 484,
"tag": "EMAIL",
"value": "chenjiajun@lexue.com"
}
] | null |
[] |
package com.wzz.api.common;
import java.io.InputStream;
import java.io.OutputStream;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.alibaba.simpleimage.ImageRender;
import com.alibaba.simpleimage.SimpleImageException;
import com.alibaba.simpleimage.render.ReadRender;
import com.alibaba.simpleimage.render.ScaleParameter;
import com.alibaba.simpleimage.render.ScaleRender;
import com.alibaba.simpleimage.render.WriteRender;
/**
* @author <EMAIL>
* 图像压缩 列子 ali SimpleImage
*/
public class SimpleImageHandle
{
private static final Logger logger = LoggerFactory.getLogger(SimpleImageHandle.class);
public static void imageHandle(InputStream originalImageInStream, OutputStream compressionImageOutStream)
{
ScaleParameter scaleParam = new ScaleParameter(540, 540); // //将图像缩略到540x540以内,不足540x540则不做任何处理
WriteRender wr = null;
try
{
ImageRender imageRender = new ReadRender(originalImageInStream);
ImageRender scaleRender = new ScaleRender(imageRender, scaleParam);
wr = new WriteRender(scaleRender, compressionImageOutStream);
wr.render(); // 触发图像处理
logger.info("compress image success...");
}
catch (Exception e)
{
e.printStackTrace();
}
finally
{
/*IOUtils.closeQuietly(originalImageInStream); // 图片文件输入输出流必须记得关闭
IOUtils.closeQuietly(compressionImageOutStream);*/
if (wr != null)
{
try
{
wr.dispose(); // 释放simpleImage的内部资源
}
catch (SimpleImageException ignore)
{
// skip ...
logger.info("释放simpleImage的内部资源 失败...");
}
}
}
}
}
| 1,740 | 0.716125 | 0.703863 | 61 | 24.770493 | 26.682341 | 106 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.081967 | false | false |
13
|
6f02111e08b250a1842b7d0eb6a922cf774a0298
| 26,774,826,151,015 |
6676c346d8ee9bad9d6349b5ece22fa8bc43b37b
|
/src/main/java/com/spluft/tinkoff/utils/ReaderProperties.java
|
f8447a272f415de1652183155555a7c89ccc56af
|
[] |
no_license
|
spluft/ExampleSeleniumTest
|
https://github.com/spluft/ExampleSeleniumTest
|
cdcd1211a6a614551e9a6b42004f8b679e525832
|
431175abc8ff39c007f0b134120e76c2c6d92901
|
refs/heads/master
| 2021-01-24T21:29:59.796000 | 2018-03-01T11:04:22 | 2018-03-01T11:04:22 | 123,249,341 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.spluft.tinkoff.utils;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Properties;
public class ReaderProperties {
private static Properties properties;
private static File file;
private static FileInputStream fileInput;
static {
final String propertyFile = System.getProperty("user.dir")
+ "\\src\\main\\resources\\properties\\base.properties";
file = new File(propertyFile);
fileInput = null;
try {
fileInput = new FileInputStream(file);
} catch (FileNotFoundException e) {
e.printStackTrace();
}
properties = new Properties();
try {
properties.load(fileInput);
} catch (IOException e) {
e.printStackTrace();
}
}
public static String getBaseUrl() {
return properties.getProperty("baseURL");
}
public static String getBrowser() {
return properties.getProperty("browser");
}
public static String getRegion() {
return properties.getProperty("region");
}
}
|
UTF-8
|
Java
| 1,217 |
java
|
ReaderProperties.java
|
Java
|
[] | null |
[] |
package com.spluft.tinkoff.utils;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Properties;
public class ReaderProperties {
private static Properties properties;
private static File file;
private static FileInputStream fileInput;
static {
final String propertyFile = System.getProperty("user.dir")
+ "\\src\\main\\resources\\properties\\base.properties";
file = new File(propertyFile);
fileInput = null;
try {
fileInput = new FileInputStream(file);
} catch (FileNotFoundException e) {
e.printStackTrace();
}
properties = new Properties();
try {
properties.load(fileInput);
} catch (IOException e) {
e.printStackTrace();
}
}
public static String getBaseUrl() {
return properties.getProperty("baseURL");
}
public static String getBrowser() {
return properties.getProperty("browser");
}
public static String getRegion() {
return properties.getProperty("region");
}
}
| 1,217 | 0.608874 | 0.608874 | 44 | 25.65909 | 19.228226 | 72 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.454545 | false | false |
13
|
7838d1d3b4e6135475f86e8bea5bf7c4c5a4131b
| 8,538,395,002,769 |
df216cc4fb50acc69cc2d23e98917e159fe14f07
|
/app/src/main/java/com/bankingapp/helpers/InputValidation.java
|
8c2e6812da3a23146d0a73e37b4baf18dd59eca1
|
[] |
no_license
|
souravmodgil/BankingApp
|
https://github.com/souravmodgil/BankingApp
|
c00ae3efd4030a0e0128949c3093b9dee14316c3
|
398e145f2d2cac09a80a478ff7950388d60f7ff7
|
refs/heads/master
| 2020-11-25T03:40:13.461000 | 2019-12-16T22:15:37 | 2019-12-16T22:15:37 | 228,485,605 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.bankingapp.helpers;
import android.app.Activity;
import android.content.Context;
import android.support.design.widget.TextInputEditText;
import android.support.design.widget.TextInputLayout;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
public class InputValidation {
private Context context;
/**
* constructor
*
* @param context
*/
public InputValidation(Context context) {
this.context = context;
}
/**
* method to check InputEditText filled .
*
* @param textInputEditText
* @param textInputLayout
* @param message
* @return
*/
public boolean isInputEditTextFilled(TextInputEditText textInputEditText, TextInputLayout textInputLayout, String message) {
String value = textInputEditText.getText().toString().trim();
if (value.isEmpty()) {
textInputLayout.setError(message);
return false;
} else {
textInputLayout.setErrorEnabled(false);
}
return true;
}
/**
* method to Hide keyboard
*
* @param activity
*/
public void hideKeyboardFrom(Activity activity) {
InputMethodManager imm = (InputMethodManager) activity.getSystemService(Activity.INPUT_METHOD_SERVICE);
//Find the currently focused view, so we can grab the correct window token from it.
View view = activity.getCurrentFocus();
//If no view currently has focus, create a new one, just so we can grab a window token from it
if (view == null) {
view = new View(activity);
}
imm.hideSoftInputFromWindow(view.getWindowToken(), 0);
}
}
|
UTF-8
|
Java
| 1,709 |
java
|
InputValidation.java
|
Java
|
[] | null |
[] |
package com.bankingapp.helpers;
import android.app.Activity;
import android.content.Context;
import android.support.design.widget.TextInputEditText;
import android.support.design.widget.TextInputLayout;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
public class InputValidation {
private Context context;
/**
* constructor
*
* @param context
*/
public InputValidation(Context context) {
this.context = context;
}
/**
* method to check InputEditText filled .
*
* @param textInputEditText
* @param textInputLayout
* @param message
* @return
*/
public boolean isInputEditTextFilled(TextInputEditText textInputEditText, TextInputLayout textInputLayout, String message) {
String value = textInputEditText.getText().toString().trim();
if (value.isEmpty()) {
textInputLayout.setError(message);
return false;
} else {
textInputLayout.setErrorEnabled(false);
}
return true;
}
/**
* method to Hide keyboard
*
* @param activity
*/
public void hideKeyboardFrom(Activity activity) {
InputMethodManager imm = (InputMethodManager) activity.getSystemService(Activity.INPUT_METHOD_SERVICE);
//Find the currently focused view, so we can grab the correct window token from it.
View view = activity.getCurrentFocus();
//If no view currently has focus, create a new one, just so we can grab a window token from it
if (view == null) {
view = new View(activity);
}
imm.hideSoftInputFromWindow(view.getWindowToken(), 0);
}
}
| 1,709 | 0.657109 | 0.656524 | 60 | 27.483334 | 28.417419 | 128 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.4 | false | false |
13
|
b11fdb6ef1d6f26de79ae9f9d3963dfc2f4fce6f
| 18,923,625,924,009 |
1bcffb29c355a69d960d5bea8f337b48822db7f8
|
/MapReduceExcercise2-Answer/src/main/java/jp/ac/nii/WordCount.java
|
ad96b00dbb2644c517daf3f80e05873faae0e7a9
|
[
"Apache-2.0"
] |
permissive
|
exKAZUu/MapReduceExcercise
|
https://github.com/exKAZUu/MapReduceExcercise
|
09438385ac11950acae2383315209b91b7b24e4a
|
41cd5575221141ba403acadf466d76b9255b902a
|
refs/heads/master
| 2021-01-18T22:46:59.737000 | 2016-07-09T04:30:15 | 2016-07-09T04:30:15 | 38,878,979 | 0 | 2 | null | false | 2015-09-13T05:47:25 | 2015-07-10T12:21:36 | 2015-07-11T01:30:22 | 2015-09-13T05:47:25 | 1,008 | 0 | 0 | 0 |
Java
| null | null |
package jp.ac.nii;
import java.io.IOException;
import java.io.StringReader;
import java.util.ArrayList;
import java.util.List;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.Mapper;
import org.apache.hadoop.mapreduce.Reducer;
import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
import org.apache.hadoop.mapreduce.lib.input.TextInputFormat;
import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
import org.apache.hadoop.mapreduce.lib.output.TextOutputFormat;
import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.analysis.core.LowerCaseFilter;
import org.apache.lucene.analysis.core.StopFilter;
import org.apache.lucene.analysis.ja.JapaneseAnalyzer;
import org.apache.lucene.analysis.ja.JapaneseBaseFormFilter;
import org.apache.lucene.analysis.ja.JapaneseKatakanaStemFilter;
import org.apache.lucene.analysis.ja.JapanesePartOfSpeechStopFilter;
import org.apache.lucene.analysis.ja.JapaneseTokenizer;
import org.apache.lucene.analysis.miscellaneous.LengthFilter;
import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
public class WordCount {
public static class TokenizerMapper extends
Mapper<Object, Text, Text, IntWritable> {
private final static IntWritable one = new IntWritable(1);
private Text wordText = new Text();
public void map(Object key, Text value, Context context)
throws IOException, InterruptedException {
List<String> words = tokenize(value.toString());
for (String word : words) {
wordText.set(word);
context.write(wordText, one);
}
}
}
public static class IntSumReducer extends
Reducer<Text, IntWritable, Text, IntWritable> {
private IntWritable result = new IntWritable();
public void reduce(Text key, Iterable<IntWritable> values,
Context context) throws IOException, InterruptedException {
int sum = 0;
for (IntWritable val : values) {
sum += val.get();
}
result.set(sum);
context.write(key, result);
}
}
public static List<String> tokenize(String japaneseText) {
JapaneseTokenizer tokenizer = new JapaneseTokenizer(null, true,
JapaneseTokenizer.Mode.NORMAL);
TokenStream stream = tokenizer;
// 参考サイト
// http://www.mwsoft.jp/programming/hadoop/mapreduce_with_lucene_filter.html
// 小文字に統一
stream = new LowerCaseFilter(stream);
// 「こと」「これ」「できる」などの頻出単語を除外
stream = new StopFilter(stream, JapaneseAnalyzer.getDefaultStopSet());
// 16文字以上の単語は除外(あまり長い文字列はいらないよね)
stream = new LengthFilter(stream, 1, 16);
// 動詞の活用を揃える(疲れた => 疲れる)
stream = new JapaneseBaseFormFilter(stream);
// 助詞、助動詞、接続詞などを除外する
stream = new JapanesePartOfSpeechStopFilter(stream,
JapaneseAnalyzer.getDefaultStopTags());
// カタカナ長音の表記揺れを吸収
stream = new JapaneseKatakanaStemFilter(stream);
ArrayList<String> result = new ArrayList<String>();
try {
tokenizer.setReader(new StringReader(japaneseText));
stream.reset();
while (stream.incrementToken()) {
CharTermAttribute term = stream
.getAttribute(CharTermAttribute.class);
result.add(term.toString());
}
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
tokenizer.close();
} catch (IOException e) {
}
}
return result;
}
public static void main(String[] args) throws Exception {
for (String word : tokenize("寿司が食べたい。")) {
System.out.println(word);
}
for (String word : tokenize("メガネが嫌いだ。")) {
System.out.println(word);
}
Configuration conf = new Configuration();
Job job = Job.getInstance(conf, "word count");
job.setJarByClass(WordCount.class);
job.setOutputKeyClass(Text.class);
job.setOutputValueClass(IntWritable.class);
job.setMapperClass(TokenizerMapper.class);
job.setReducerClass(IntSumReducer.class);
job.setInputFormatClass(TextInputFormat.class);
job.setOutputFormatClass(TextOutputFormat.class);
FileInputFormat.addInputPath(job, new Path(args[0]));
FileOutputFormat.setOutputPath(job, new Path(args[1]));
System.exit(job.waitForCompletion(true) ? 0 : 1);
}
}
|
UTF-8
|
Java
| 4,428 |
java
|
WordCount.java
|
Java
|
[] | null |
[] |
package jp.ac.nii;
import java.io.IOException;
import java.io.StringReader;
import java.util.ArrayList;
import java.util.List;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.Mapper;
import org.apache.hadoop.mapreduce.Reducer;
import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
import org.apache.hadoop.mapreduce.lib.input.TextInputFormat;
import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
import org.apache.hadoop.mapreduce.lib.output.TextOutputFormat;
import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.analysis.core.LowerCaseFilter;
import org.apache.lucene.analysis.core.StopFilter;
import org.apache.lucene.analysis.ja.JapaneseAnalyzer;
import org.apache.lucene.analysis.ja.JapaneseBaseFormFilter;
import org.apache.lucene.analysis.ja.JapaneseKatakanaStemFilter;
import org.apache.lucene.analysis.ja.JapanesePartOfSpeechStopFilter;
import org.apache.lucene.analysis.ja.JapaneseTokenizer;
import org.apache.lucene.analysis.miscellaneous.LengthFilter;
import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
public class WordCount {
public static class TokenizerMapper extends
Mapper<Object, Text, Text, IntWritable> {
private final static IntWritable one = new IntWritable(1);
private Text wordText = new Text();
public void map(Object key, Text value, Context context)
throws IOException, InterruptedException {
List<String> words = tokenize(value.toString());
for (String word : words) {
wordText.set(word);
context.write(wordText, one);
}
}
}
public static class IntSumReducer extends
Reducer<Text, IntWritable, Text, IntWritable> {
private IntWritable result = new IntWritable();
public void reduce(Text key, Iterable<IntWritable> values,
Context context) throws IOException, InterruptedException {
int sum = 0;
for (IntWritable val : values) {
sum += val.get();
}
result.set(sum);
context.write(key, result);
}
}
public static List<String> tokenize(String japaneseText) {
JapaneseTokenizer tokenizer = new JapaneseTokenizer(null, true,
JapaneseTokenizer.Mode.NORMAL);
TokenStream stream = tokenizer;
// 参考サイト
// http://www.mwsoft.jp/programming/hadoop/mapreduce_with_lucene_filter.html
// 小文字に統一
stream = new LowerCaseFilter(stream);
// 「こと」「これ」「できる」などの頻出単語を除外
stream = new StopFilter(stream, JapaneseAnalyzer.getDefaultStopSet());
// 16文字以上の単語は除外(あまり長い文字列はいらないよね)
stream = new LengthFilter(stream, 1, 16);
// 動詞の活用を揃える(疲れた => 疲れる)
stream = new JapaneseBaseFormFilter(stream);
// 助詞、助動詞、接続詞などを除外する
stream = new JapanesePartOfSpeechStopFilter(stream,
JapaneseAnalyzer.getDefaultStopTags());
// カタカナ長音の表記揺れを吸収
stream = new JapaneseKatakanaStemFilter(stream);
ArrayList<String> result = new ArrayList<String>();
try {
tokenizer.setReader(new StringReader(japaneseText));
stream.reset();
while (stream.incrementToken()) {
CharTermAttribute term = stream
.getAttribute(CharTermAttribute.class);
result.add(term.toString());
}
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
tokenizer.close();
} catch (IOException e) {
}
}
return result;
}
public static void main(String[] args) throws Exception {
for (String word : tokenize("寿司が食べたい。")) {
System.out.println(word);
}
for (String word : tokenize("メガネが嫌いだ。")) {
System.out.println(word);
}
Configuration conf = new Configuration();
Job job = Job.getInstance(conf, "word count");
job.setJarByClass(WordCount.class);
job.setOutputKeyClass(Text.class);
job.setOutputValueClass(IntWritable.class);
job.setMapperClass(TokenizerMapper.class);
job.setReducerClass(IntSumReducer.class);
job.setInputFormatClass(TextInputFormat.class);
job.setOutputFormatClass(TextOutputFormat.class);
FileInputFormat.addInputPath(job, new Path(args[0]));
FileOutputFormat.setOutputPath(job, new Path(args[1]));
System.exit(job.waitForCompletion(true) ? 0 : 1);
}
}
| 4,428 | 0.752031 | 0.749403 | 133 | 30.481203 | 22.143959 | 78 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.278195 | false | false |
13
|
fe928f5ac7c974239450109cf249fa5e44240f05
| 36,000,415,886,815 |
aec4850d914ade6e5a92f5540f1886e71cc255e1
|
/SchoolManagement/src/main/java/dev/patika/controller/InstructorController.java
|
eddb4e2e4cdfd2fc4f61a12d523826dab2ac7ff6
|
[
"MIT"
] |
permissive
|
bulutharunmurat/fifth-homework-bulutharunmurat
|
https://github.com/bulutharunmurat/fifth-homework-bulutharunmurat
|
a27d97f1b36afd359bd50eb03948382e0256baf3
|
0f3616a721c94958d8158a445d9b3eb53d780371
|
refs/heads/main
| 2023-08-12T22:35:57.520000 | 2021-09-14T18:49:26 | 2021-09-14T18:49:26 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package dev.patika.controller;
import dev.patika.datatransferobject.InstructorDTO;
import dev.patika.datatransferobject.PermanentInstructorDTO;
import dev.patika.datatransferobject.VisitingResearcherDTO;
import dev.patika.entity.Instructor;
import dev.patika.entity.InstructorSalaryUpdateLogger;
import dev.patika.service.InstructorService;
import dev.patika.util.ClientRequestInfo;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.web.PageableDefault;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@RestController
@RequestMapping("/api")
@Slf4j
public class InstructorController {
InstructorService instructorService;
ClientRequestInfo clientRequestInfo;
@Autowired
public InstructorController(InstructorService instructorService, ClientRequestInfo clientRequestInfo) {
this.instructorService = instructorService;
this.clientRequestInfo = clientRequestInfo;
}
@GetMapping("/instructors")
public ResponseEntity<List<Instructor>> findAll(){
return new ResponseEntity<>(instructorService.findAll(), HttpStatus.OK);
}
@GetMapping("/instructors/{id}")
public ResponseEntity<Instructor> findInstructorsById(@PathVariable int id){
return new ResponseEntity<>(instructorService.findById(id), HttpStatus.OK);
}
@PostMapping("/instructors")
public Instructor saveInstructor(@RequestBody InstructorDTO instructorDTO){
return instructorService.save(instructorDTO);
}
@PostMapping("/instructors/visitingResearcher")
public Instructor saveVisitingResearcher(@RequestBody VisitingResearcherDTO visitingResearcherDTO){
return instructorService.saveVisitingResearcher(visitingResearcherDTO);
}
@PostMapping("/instructors/permanentInstructor")
public Instructor savePermanentInstructor(@RequestBody PermanentInstructorDTO permanentInstructorDTO){
return instructorService.savePermanentInstructor(permanentInstructorDTO);
}
@PutMapping("/instructors")
public Instructor updateInstructor(@RequestBody InstructorDTO instructorDTO){
return instructorService.update(instructorDTO);
}
@DeleteMapping("/instructors/{id}")
public String deleteInstructorById(@PathVariable int id){
instructorService.deleteById(id);
return "instructor with "+ id + " id deleted";
}
@GetMapping("/instructors/findByNameContaining/{name}")
public List<Instructor> findByNameContaining(@PathVariable String name){
return instructorService.findByNameContaining(name);
}
@DeleteMapping("/instructors/byname/{name}")
public String deleteInstructorByName(@PathVariable String name){
instructorService.deleteByName(name);
return "instructor with name " + name + " is deleted";
}
@GetMapping("/instructors/getThreeMostEarningInstructor")
public List<Instructor> getThreeMostEarningInstructor(){
return instructorService.getThreeMostEarningInstructor();
}
@PutMapping("/instructors/updateSalary/{instructorId}/{percentage}")
public Instructor updateInstructorSalary(@PathVariable int instructorId,
@PathVariable float percentage
){
log.info(String.valueOf(clientRequestInfo));
return instructorService.updateInstructorSalary(instructorId,percentage);
}
@GetMapping("/getSalaryUpdateById/{id}")
public ResponseEntity<Page<List<InstructorSalaryUpdateLogger>>> getAllTransactionsById(
@PathVariable int id,
@PageableDefault(page = 0, size = 10)Pageable pageable){
return new ResponseEntity<>(instructorService.getAllTransactionsById(id, pageable), HttpStatus.OK);
}
}
|
UTF-8
|
Java
| 4,077 |
java
|
InstructorController.java
|
Java
|
[] | null |
[] |
package dev.patika.controller;
import dev.patika.datatransferobject.InstructorDTO;
import dev.patika.datatransferobject.PermanentInstructorDTO;
import dev.patika.datatransferobject.VisitingResearcherDTO;
import dev.patika.entity.Instructor;
import dev.patika.entity.InstructorSalaryUpdateLogger;
import dev.patika.service.InstructorService;
import dev.patika.util.ClientRequestInfo;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.web.PageableDefault;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@RestController
@RequestMapping("/api")
@Slf4j
public class InstructorController {
InstructorService instructorService;
ClientRequestInfo clientRequestInfo;
@Autowired
public InstructorController(InstructorService instructorService, ClientRequestInfo clientRequestInfo) {
this.instructorService = instructorService;
this.clientRequestInfo = clientRequestInfo;
}
@GetMapping("/instructors")
public ResponseEntity<List<Instructor>> findAll(){
return new ResponseEntity<>(instructorService.findAll(), HttpStatus.OK);
}
@GetMapping("/instructors/{id}")
public ResponseEntity<Instructor> findInstructorsById(@PathVariable int id){
return new ResponseEntity<>(instructorService.findById(id), HttpStatus.OK);
}
@PostMapping("/instructors")
public Instructor saveInstructor(@RequestBody InstructorDTO instructorDTO){
return instructorService.save(instructorDTO);
}
@PostMapping("/instructors/visitingResearcher")
public Instructor saveVisitingResearcher(@RequestBody VisitingResearcherDTO visitingResearcherDTO){
return instructorService.saveVisitingResearcher(visitingResearcherDTO);
}
@PostMapping("/instructors/permanentInstructor")
public Instructor savePermanentInstructor(@RequestBody PermanentInstructorDTO permanentInstructorDTO){
return instructorService.savePermanentInstructor(permanentInstructorDTO);
}
@PutMapping("/instructors")
public Instructor updateInstructor(@RequestBody InstructorDTO instructorDTO){
return instructorService.update(instructorDTO);
}
@DeleteMapping("/instructors/{id}")
public String deleteInstructorById(@PathVariable int id){
instructorService.deleteById(id);
return "instructor with "+ id + " id deleted";
}
@GetMapping("/instructors/findByNameContaining/{name}")
public List<Instructor> findByNameContaining(@PathVariable String name){
return instructorService.findByNameContaining(name);
}
@DeleteMapping("/instructors/byname/{name}")
public String deleteInstructorByName(@PathVariable String name){
instructorService.deleteByName(name);
return "instructor with name " + name + " is deleted";
}
@GetMapping("/instructors/getThreeMostEarningInstructor")
public List<Instructor> getThreeMostEarningInstructor(){
return instructorService.getThreeMostEarningInstructor();
}
@PutMapping("/instructors/updateSalary/{instructorId}/{percentage}")
public Instructor updateInstructorSalary(@PathVariable int instructorId,
@PathVariable float percentage
){
log.info(String.valueOf(clientRequestInfo));
return instructorService.updateInstructorSalary(instructorId,percentage);
}
@GetMapping("/getSalaryUpdateById/{id}")
public ResponseEntity<Page<List<InstructorSalaryUpdateLogger>>> getAllTransactionsById(
@PathVariable int id,
@PageableDefault(page = 0, size = 10)Pageable pageable){
return new ResponseEntity<>(instructorService.getAllTransactionsById(id, pageable), HttpStatus.OK);
}
}
| 4,077 | 0.752514 | 0.751042 | 103 | 38.582523 | 30.485561 | 107 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.446602 | false | false |
13
|
be796a3347c1f9c422ae16e1614ac92b594ee144
| 21,543,555,998,291 |
3c5d576d7656ece9380e6fd31ab6597f49fafe90
|
/src/main/java/fr/persistence/dao/impl/UserDaoImpl.java
|
d90efbe3360fe133b87cfc7cd1f5e2834815d970
|
[] |
no_license
|
gsaad/projetDemo
|
https://github.com/gsaad/projetDemo
|
2055677141691f551fb8a07fb1523020b1676d98
|
32a0e63b8ff5d3c72258da62abefbe6de54d62e4
|
refs/heads/master
| 2021-01-23T08:24:15.219000 | 2014-01-01T16:01:12 | 2014-01-01T16:01:12 | 15,195,779 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package fr.persistence.dao.impl;
import java.util.Date;
import java.util.List;
import org.hibernate.SessionFactory;
import org.hibernate.criterion.Restrictions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Repository;
import fr.persistence.dao.UserDao;
import fr.persistence.domain.Role;
import fr.persistence.domain.RolesEnum;
import fr.persistence.domain.User;
@Repository
public class UserDaoImpl implements UserDao {
@Autowired
private SessionFactory sessionFactory;
@SuppressWarnings("unchecked")
public List<User> findAllUsers() {
List<User> list = sessionFactory.getCurrentSession()
.createCriteria(User.class).list();
return list;
}
public void createUser(User user) {
user.setCreationDate(new Date());;
user.setEnabled(true);
PasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
user.setPassword(passwordEncoder.encode(user.getPassword()));
Role userRole = getRoleByCode(RolesEnum.ROLE_USER.name());
user.getRoles().add(userRole);
user.setLogin(user.getLogin().toLowerCase());
sessionFactory.getCurrentSession().persist("User",
user);
}
@SuppressWarnings("unchecked")
public List<User> findAllUserByLogin(String login) {
List<User> list = sessionFactory.getCurrentSession()
.createCriteria(User.class)
.add(Restrictions.like("login",login+"%")).list();
return list;
}
public User findUserByLogin(String login) {
User user = (User) sessionFactory.getCurrentSession()
.createCriteria(User.class)
.add(Restrictions.like("login",login)).uniqueResult();
return user;
}
public void updateUser(User user) {
PasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
user.setPassword(passwordEncoder.encode(user.getPassword()));
sessionFactory.getCurrentSession().update(user);
}
public Role getRoleByCode(String code){
Role role = (Role) sessionFactory.getCurrentSession()
.createCriteria(Role.class)
.add(Restrictions.like("role",code)).uniqueResult();
return role;
}
}
|
UTF-8
|
Java
| 2,257 |
java
|
UserDaoImpl.java
|
Java
|
[] | null |
[] |
package fr.persistence.dao.impl;
import java.util.Date;
import java.util.List;
import org.hibernate.SessionFactory;
import org.hibernate.criterion.Restrictions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Repository;
import fr.persistence.dao.UserDao;
import fr.persistence.domain.Role;
import fr.persistence.domain.RolesEnum;
import fr.persistence.domain.User;
@Repository
public class UserDaoImpl implements UserDao {
@Autowired
private SessionFactory sessionFactory;
@SuppressWarnings("unchecked")
public List<User> findAllUsers() {
List<User> list = sessionFactory.getCurrentSession()
.createCriteria(User.class).list();
return list;
}
public void createUser(User user) {
user.setCreationDate(new Date());;
user.setEnabled(true);
PasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
user.setPassword(passwordEncoder.encode(user.getPassword()));
Role userRole = getRoleByCode(RolesEnum.ROLE_USER.name());
user.getRoles().add(userRole);
user.setLogin(user.getLogin().toLowerCase());
sessionFactory.getCurrentSession().persist("User",
user);
}
@SuppressWarnings("unchecked")
public List<User> findAllUserByLogin(String login) {
List<User> list = sessionFactory.getCurrentSession()
.createCriteria(User.class)
.add(Restrictions.like("login",login+"%")).list();
return list;
}
public User findUserByLogin(String login) {
User user = (User) sessionFactory.getCurrentSession()
.createCriteria(User.class)
.add(Restrictions.like("login",login)).uniqueResult();
return user;
}
public void updateUser(User user) {
PasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
user.setPassword(passwordEncoder.encode(user.getPassword()));
sessionFactory.getCurrentSession().update(user);
}
public Role getRoleByCode(String code){
Role role = (Role) sessionFactory.getCurrentSession()
.createCriteria(Role.class)
.add(Restrictions.like("role",code)).uniqueResult();
return role;
}
}
| 2,257 | 0.74568 | 0.74568 | 71 | 29.816902 | 22.437588 | 72 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.802817 | false | false |
13
|
abc3eaf58360eb6832b67a7965670789ca736818
| 27,315,992,067,662 |
39261980b25c2b8800589fb5ac54adf2a0eb22b8
|
/lp-datasource-router/src/main/java/com/cn/lp/DataSourceRouterContext.java
|
35ddfc5578181cfa80317f5e1cd42a44bc1c0b46
|
[
"Apache-2.0"
] |
permissive
|
lpppph/lp-demo
|
https://github.com/lpppph/lp-demo
|
2238c7cff408d8590e2cd91c64fb81c6ff610701
|
6bc1bacacac9171c8cd18f7e4dfc36d58f3b8ce5
|
refs/heads/master
| 2023-01-01T00:52:23.634000 | 2020-10-17T12:27:33 | 2020-10-17T12:27:33 | 285,722,306 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.cn.lp;
/**
* 数据库路由环境
*/
public class DataSourceRouterContext {
private static final ThreadLocal<String> holder = new ThreadLocal<>();
private static String defaultDataSource = null;
public static void setDefaultDataSource(String defaultDataSource) {
DataSourceRouterContext.defaultDataSource = defaultDataSource;
}
public static void setDataSource(String dataSource) {
holder.set(dataSource);
}
public static String getDataSource() {
String lookUpKey = holder.get();
return lookUpKey == null ? defaultDataSource : lookUpKey;
}
public static void clear() {
holder.remove();
}
}
|
UTF-8
|
Java
| 693 |
java
|
DataSourceRouterContext.java
|
Java
|
[] | null |
[] |
package com.cn.lp;
/**
* 数据库路由环境
*/
public class DataSourceRouterContext {
private static final ThreadLocal<String> holder = new ThreadLocal<>();
private static String defaultDataSource = null;
public static void setDefaultDataSource(String defaultDataSource) {
DataSourceRouterContext.defaultDataSource = defaultDataSource;
}
public static void setDataSource(String dataSource) {
holder.set(dataSource);
}
public static String getDataSource() {
String lookUpKey = holder.get();
return lookUpKey == null ? defaultDataSource : lookUpKey;
}
public static void clear() {
holder.remove();
}
}
| 693 | 0.681885 | 0.681885 | 29 | 22.413794 | 25.484976 | 74 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.275862 | false | false |
13
|
60b63cbfb218eed4c003540d6d5e172edfbdec90
| 17,222,818,891,190 |
6af6feb0c20984a9358a37540f79096de3018115
|
/core/src/main/java/com/alibaba/alink/pipeline/dataproc/format/ColumnsToJson.java
|
665384333652172b2e8cc612e9c3b18b0eec1ad6
|
[
"Apache-2.0"
] |
permissive
|
Vipamp/Alink
|
https://github.com/Vipamp/Alink
|
613c833d67e81ad688abd6d631b6297640e3b2a3
|
2b5d0ae81c7cf90fe3b68cc5ba39d4b6c9b57ef8
|
refs/heads/mylearn
| 2021-07-21T13:45:27.206000 | 2020-10-29T09:44:41 | 2020-10-29T09:44:41 | 224,653,808 | 0 | 0 |
Apache-2.0
| true | 2020-07-14T05:07:16 | 2019-11-28T12:56:51 | 2020-01-21T02:48:20 | 2020-07-14T05:07:16 | 3,552 | 0 | 0 | 0 |
Java
| false | false |
package com.alibaba.alink.pipeline.dataproc.format;
import com.alibaba.alink.operator.common.dataproc.format.FormatType;
import com.alibaba.alink.params.dataproc.format.ColumnsToJsonParams;
import org.apache.flink.ml.api.misc.param.Params;
public class ColumnsToJson extends BaseFormatTrans<ColumnsToJson> implements ColumnsToJsonParams<ColumnsToJson> {
public ColumnsToJson() {
this(new Params());
}
public ColumnsToJson(Params params) {
super(FormatType.COLUMNS, FormatType.JSON, params);
}
}
|
UTF-8
|
Java
| 533 |
java
|
ColumnsToJson.java
|
Java
|
[] | null |
[] |
package com.alibaba.alink.pipeline.dataproc.format;
import com.alibaba.alink.operator.common.dataproc.format.FormatType;
import com.alibaba.alink.params.dataproc.format.ColumnsToJsonParams;
import org.apache.flink.ml.api.misc.param.Params;
public class ColumnsToJson extends BaseFormatTrans<ColumnsToJson> implements ColumnsToJsonParams<ColumnsToJson> {
public ColumnsToJson() {
this(new Params());
}
public ColumnsToJson(Params params) {
super(FormatType.COLUMNS, FormatType.JSON, params);
}
}
| 533 | 0.767355 | 0.767355 | 16 | 32.1875 | 32.757095 | 113 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.5 | false | false |
13
|
7405384cab0f49974cefb672b9861c0818d05ad8
| 18,047,452,612,578 |
123e7417d563d29cc649cd37eab667244ac90b12
|
/JavaSE/src/Octp1/Static/CallStackTest2.java
|
d3c40683cf5d23feefa4e56eaf525b6f76212300
|
[] |
no_license
|
roseoutz/KH
|
https://github.com/roseoutz/KH
|
248dd83029220c6afc60273d51f7476897303645
|
88ca113cc30014dc1eb977c94b89dcb89018a7a6
|
refs/heads/master
| 2020-04-07T14:55:40.313000 | 2019-02-12T05:44:24 | 2019-02-12T05:44:24 | 158,466,488 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package Octp1.Static;
class CallStackTest2 {
public static void main(String[] args)
{
System.out.println("main(String[] args is started");
firstMethod();
System.out.println("main(String[] args is ended");
}
static void firstMethod()
{
System.out.println("firstMethod() is started");
secondMethod();
System.out.println("firstMethod() is ended");
}
static void secondMethod()
{
System.out.println("secondMethod() is started");
System.out.println("secondMethod() is ended");
}
}
|
UTF-8
|
Java
| 506 |
java
|
CallStackTest2.java
|
Java
|
[] | null |
[] |
package Octp1.Static;
class CallStackTest2 {
public static void main(String[] args)
{
System.out.println("main(String[] args is started");
firstMethod();
System.out.println("main(String[] args is ended");
}
static void firstMethod()
{
System.out.println("firstMethod() is started");
secondMethod();
System.out.println("firstMethod() is ended");
}
static void secondMethod()
{
System.out.println("secondMethod() is started");
System.out.println("secondMethod() is ended");
}
}
| 506 | 0.693676 | 0.689723 | 23 | 21 | 20.123531 | 54 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.565217 | false | false |
13
|
818f2a47ca6e457ad09af97675444749a4a23e59
| 36,541,581,766,005 |
b4541419cd10f29ca985a79f7d8c31c9c6a72c72
|
/Warmup1/src/frontBack.java
|
3a7cd877278ad74f9ae449162c86c39baf974bfb
|
[] |
no_license
|
arunkumaar91/CodingBat
|
https://github.com/arunkumaar91/CodingBat
|
e54eabb09b222fe9ba7354f21df6df464d9bb3b7
|
a8b5544f06cb35710e649f4ab0094ad2a5801c85
|
refs/heads/master
| 2021-08-19T07:50:24.892000 | 2017-11-25T08:48:55 | 2017-11-25T08:48:55 | 111,982,995 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
/**
*
*/
/**
* @author Arunkumaar
*
*/
public class frontBack {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println(front("code"));
System.out.println(front("a"));
System.out.println(front("ab"));
System.out.println(front("arun"));
}
public static String front(String str) {
if (str.length() <= 1) {
return str;
} else {
char firstChar = str.charAt(0);
String middleChar = str.substring(1, str.length() - 1);
char lastChar = str.charAt(str.length() - 1);
String changedStr = Character.toString(lastChar) + middleChar + Character.toString(firstChar);
return changedStr;
}
}
}
|
UTF-8
|
Java
| 690 |
java
|
frontBack.java
|
Java
|
[
{
"context": "/**\n * \n */\n\n/**\n * @author Arunkumaar\n *\n */\npublic class frontBack {\n\n\t/**\n\t * @param ",
"end": 38,
"score": 0.9998103380203247,
"start": 28,
"tag": "NAME",
"value": "Arunkumaar"
}
] | null |
[] |
/**
*
*/
/**
* @author Arunkumaar
*
*/
public class frontBack {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println(front("code"));
System.out.println(front("a"));
System.out.println(front("ab"));
System.out.println(front("arun"));
}
public static String front(String str) {
if (str.length() <= 1) {
return str;
} else {
char firstChar = str.charAt(0);
String middleChar = str.substring(1, str.length() - 1);
char lastChar = str.charAt(str.length() - 1);
String changedStr = Character.toString(lastChar) + middleChar + Character.toString(firstChar);
return changedStr;
}
}
}
| 690 | 0.637681 | 0.630435 | 33 | 19.939394 | 21.575714 | 97 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.575758 | false | false |
13
|
a3bd132eee0e023d25ee7c7a3cf5c2ae37980303
| 35,081,292,886,013 |
97524f5559a53e151719ad2099e092c09ee8d30b
|
/02_FONTES/framework/persistence-framework/src/main/java/br/gov/to/sefaz/persistence/query/builder/hql/select/signature/HqlConditionable.java
|
107d8ab43933b326db67f17901899c9699067ff8
|
[] |
no_license
|
fredsilva/sistema
|
https://github.com/fredsilva/sistema
|
46a4809e96b016f733c715da3c8f57e47996ccbd
|
14dad24f7be8561611d3cdf5d7a8460b1c4300f6
|
refs/heads/master
| 2021-01-12T04:40:34.493000 | 2016-12-20T14:44:51 | 2016-12-20T14:44:51 | 77,699,605 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package br.gov.to.sefaz.persistence.query.builder.hql.select.signature;
import br.gov.to.sefaz.persistence.query.builder.hql.select.where.HqlSelectJunctionBuilder;
import br.gov.to.sefaz.persistence.query.builder.sql.select.signature.Conditionable;
/**
* Interface de assinatura resposável por métodos da cláusula Condicional.
* @author <a href="mailto:gabriel.dias@ntconsult.com.br">gabriel.dias</a>
* @since 01/08/2016 11:39:00
* @param <R> Entidade base.
*/
public interface HqlConditionable<R> extends Conditionable<R> {
/**
* Método responsável por executar o comando Where do HQL informa o parâmetro
* <code>id</code> para a cláusula de condição do where.
*
* @param id chave que consulta a entidade.
*
* @return retornar a montagem da execução do comando Where do HQL.
*/
HqlSelectJunctionBuilder whereId(Object id);
}
|
UTF-8
|
Java
| 888 |
java
|
HqlConditionable.java
|
Java
|
[
{
"context": " cláusula Condicional.\n * @author <a href=\"mailto:gabriel.dias@ntconsult.com.br\">gabriel.dias</a>\n * @since 01/08/2016 11:39:00\n ",
"end": 386,
"score": 0.9999356865882874,
"start": 357,
"tag": "EMAIL",
"value": "gabriel.dias@ntconsult.com.br"
},
{
"context": "or <a href=\"mailto:gabriel.dias@ntconsult.com.br\">gabriel.dias</a>\n * @since 01/08/2016 11:39:00\n * @param <R>",
"end": 398,
"score": 0.7116938829421997,
"start": 388,
"tag": "USERNAME",
"value": "gabriel.di"
},
{
"context": "=\"mailto:gabriel.dias@ntconsult.com.br\">gabriel.dias</a>\n * @since 01/08/2016 11:39:00\n * @param <R> E",
"end": 400,
"score": 0.5063044428825378,
"start": 398,
"tag": "NAME",
"value": "as"
}
] | null |
[] |
package br.gov.to.sefaz.persistence.query.builder.hql.select.signature;
import br.gov.to.sefaz.persistence.query.builder.hql.select.where.HqlSelectJunctionBuilder;
import br.gov.to.sefaz.persistence.query.builder.sql.select.signature.Conditionable;
/**
* Interface de assinatura resposável por métodos da cláusula Condicional.
* @author <a href="mailto:<EMAIL>">gabriel.dias</a>
* @since 01/08/2016 11:39:00
* @param <R> Entidade base.
*/
public interface HqlConditionable<R> extends Conditionable<R> {
/**
* Método responsável por executar o comando Where do HQL informa o parâmetro
* <code>id</code> para a cláusula de condição do where.
*
* @param id chave que consulta a entidade.
*
* @return retornar a montagem da execução do comando Where do HQL.
*/
HqlSelectJunctionBuilder whereId(Object id);
}
| 866 | 0.733181 | 0.717218 | 23 | 37.130436 | 33.047138 | 91 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.173913 | false | false |
13
|
650dcdbccb748c4afdd0c1186dc50ba45fcc9bcb
| 33,517,924,837,780 |
4bf50b1b4bb93cdf9b28e3746c259fac039eacbe
|
/baseDemo/src/main/java/com/ihu/entity/Message.java
|
37bb46e25833ca467131903358be9eacd71aac6e
|
[] |
no_license
|
he615686916/Demos
|
https://github.com/he615686916/Demos
|
d0e8a228e9c1c475cf456f5550bb9bda62817868
|
d3294acf8ebc3fc5271366a2cca0a2f4c78833b6
|
refs/heads/master
| 2020-07-05T12:18:22.870000 | 2020-04-03T10:28:57 | 2020-04-03T10:28:57 | 202,646,542 | 0 | 0 | null | false | 2020-10-13T20:51:59 | 2019-08-16T02:45:57 | 2020-04-03T10:29:12 | 2020-10-13T20:51:57 | 207 | 0 | 0 | 3 |
Java
| false | false |
package com.ihu.entity;
import com.alibaba.fastjson.annotation.JSONField;
import java.io.Serializable;
public class Message implements Serializable {
private static final long serialVersionUID = -3019946799686863536L;
@JSONField(name = "messageInfo")
private String msgInfo;
private Long length;
public String getMsgInfo() {
return msgInfo;
}
public void setMsgInfo(String msgInfo) {
this.msgInfo = msgInfo;
}
public Message(String msgInfo) {
this.msgInfo = msgInfo;
}
public Long getLength() {
return length;
}
public void setLength(Long length) {
this.length = length;
}
@Override
public String toString() {
return "Message{" +
"msgInfo='" + msgInfo + '\'' +
'}';
}
public Message() {
super();
}
}
|
UTF-8
|
Java
| 877 |
java
|
Message.java
|
Java
|
[] | null |
[] |
package com.ihu.entity;
import com.alibaba.fastjson.annotation.JSONField;
import java.io.Serializable;
public class Message implements Serializable {
private static final long serialVersionUID = -3019946799686863536L;
@JSONField(name = "messageInfo")
private String msgInfo;
private Long length;
public String getMsgInfo() {
return msgInfo;
}
public void setMsgInfo(String msgInfo) {
this.msgInfo = msgInfo;
}
public Message(String msgInfo) {
this.msgInfo = msgInfo;
}
public Long getLength() {
return length;
}
public void setLength(Long length) {
this.length = length;
}
@Override
public String toString() {
return "Message{" +
"msgInfo='" + msgInfo + '\'' +
'}';
}
public Message() {
super();
}
}
| 877 | 0.597491 | 0.575827 | 46 | 18.065218 | 17.546711 | 71 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.282609 | false | false |
13
|
7d3cf281f07e61339d71701d641afe01f697881b
| 8,340,826,553,098 |
2bfca2b63d8dea38325271f3767a9a95f18ff506
|
/src/main/java/nl/itslars/jedisjson/listeners/types/Conversation.java
|
47fa72922c1fa671cd685b1a0b9e57d99d7889a7
|
[] |
no_license
|
MeItsLars/JedisJSON
|
https://github.com/MeItsLars/JedisJSON
|
0f8d63d62ab6468d27d0de8e664bcd28af22c257
|
4cff0e652bc6ccaffabb65ff50905cefc1dd60ba
|
refs/heads/master
| 2022-12-02T03:41:35.292000 | 2020-08-19T22:50:36 | 2020-08-19T22:50:36 | 288,817,786 | 0 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package nl.itslars.jedisjson.listeners.types;
import com.google.gson.Gson;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;
import nl.itslars.jedisjson.JedisJSON;
import nl.itslars.jedisjson.packet.JedisJSONPacket;
import nl.itslars.jedisjson.packet.conversation.ConversationEndPacket;
import nl.itslars.jedisjson.packet.conversation.ConversationStartPacket;
import java.io.Closeable;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.Map;
import java.util.function.Consumer;
public class Conversation<T extends JedisJSONPacket> implements JedisJSONPacketListener<T>, Closeable {
private JedisJSON client;
private Gson gson;
private Type packetType;
private String target;
private String conversationID;
@Setter
private int state;
private Map<Integer, Consumer<T>> stateConsumers = new HashMap<>();
@SuppressWarnings("unchecked")
public Conversation(JedisJSON client, Gson gson, Type packetType, String target, String conversationID, boolean start, int initialState) {
this.client = client;
this.gson = gson;
this.packetType = packetType;
this.target = target;
this.conversationID = conversationID;
this.state = initialState;
if (start) client.send(target, new ConversationStartPacket(((Class<T>) packetType).getSimpleName(), conversationID), gson);
}
public Conversation<T> onState(int state, Consumer<T> consumer) {
stateConsumers.put(state, consumer);
return this;
}
public void setState(int state, T t) {
this.state = state;
client.sendWithId(target, t, conversationID, gson);
}
@Override
public void accept(T t) {
Consumer<T> consumer = stateConsumers.get(state);
if (consumer != null) consumer.accept(t);
}
@Override
public Gson getPacketGson() {
return gson;
}
@Override
public Type getPacketType() {
return packetType;
}
@Override
public void close() {
client.send(target, new ConversationEndPacket(conversationID));
client.getJedisPacketHandler().unregisterListener(conversationID);
}
private static Map<Type, ConversationData<?>> acceptableConversations = new HashMap<>();
@SuppressWarnings({"rawtypes", "unchecked"})
public static void initializeConversationStructure(JedisJSON client) {
client.onReceive(ConversationStartPacket.class, packet -> {
acceptableConversations.forEach((type, data) -> {
if (!type.getTypeName().equals(packet.getClazz())) return;
Conversation conversation = new Conversation(client,
data.getGson(),
data.getType(),
packet.getSource(),
packet.getConversationID(),
false,
data.getInitialState());
client.getJedisPacketHandler().registerListener(packet.getConversationID(), conversation, false);
data.getConsumer().accept(conversation);
});
});
client.onReceive(ConversationEndPacket.class, packet -> {
client.getJedisPacketHandler().unregisterListener(packet.getConversationID());
});
}
public static void acceptConversation(ConversationData<?> data) {
acceptableConversations.put(data.getType(), data);
}
@AllArgsConstructor
@Getter
public static class ConversationData<T extends JedisJSONPacket> {
private Type type;
private Gson gson;
private int initialState;
private Consumer<Conversation<T>> consumer;
}
}
|
UTF-8
|
Java
| 3,724 |
java
|
Conversation.java
|
Java
|
[] | null |
[] |
package nl.itslars.jedisjson.listeners.types;
import com.google.gson.Gson;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;
import nl.itslars.jedisjson.JedisJSON;
import nl.itslars.jedisjson.packet.JedisJSONPacket;
import nl.itslars.jedisjson.packet.conversation.ConversationEndPacket;
import nl.itslars.jedisjson.packet.conversation.ConversationStartPacket;
import java.io.Closeable;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.Map;
import java.util.function.Consumer;
public class Conversation<T extends JedisJSONPacket> implements JedisJSONPacketListener<T>, Closeable {
private JedisJSON client;
private Gson gson;
private Type packetType;
private String target;
private String conversationID;
@Setter
private int state;
private Map<Integer, Consumer<T>> stateConsumers = new HashMap<>();
@SuppressWarnings("unchecked")
public Conversation(JedisJSON client, Gson gson, Type packetType, String target, String conversationID, boolean start, int initialState) {
this.client = client;
this.gson = gson;
this.packetType = packetType;
this.target = target;
this.conversationID = conversationID;
this.state = initialState;
if (start) client.send(target, new ConversationStartPacket(((Class<T>) packetType).getSimpleName(), conversationID), gson);
}
public Conversation<T> onState(int state, Consumer<T> consumer) {
stateConsumers.put(state, consumer);
return this;
}
public void setState(int state, T t) {
this.state = state;
client.sendWithId(target, t, conversationID, gson);
}
@Override
public void accept(T t) {
Consumer<T> consumer = stateConsumers.get(state);
if (consumer != null) consumer.accept(t);
}
@Override
public Gson getPacketGson() {
return gson;
}
@Override
public Type getPacketType() {
return packetType;
}
@Override
public void close() {
client.send(target, new ConversationEndPacket(conversationID));
client.getJedisPacketHandler().unregisterListener(conversationID);
}
private static Map<Type, ConversationData<?>> acceptableConversations = new HashMap<>();
@SuppressWarnings({"rawtypes", "unchecked"})
public static void initializeConversationStructure(JedisJSON client) {
client.onReceive(ConversationStartPacket.class, packet -> {
acceptableConversations.forEach((type, data) -> {
if (!type.getTypeName().equals(packet.getClazz())) return;
Conversation conversation = new Conversation(client,
data.getGson(),
data.getType(),
packet.getSource(),
packet.getConversationID(),
false,
data.getInitialState());
client.getJedisPacketHandler().registerListener(packet.getConversationID(), conversation, false);
data.getConsumer().accept(conversation);
});
});
client.onReceive(ConversationEndPacket.class, packet -> {
client.getJedisPacketHandler().unregisterListener(packet.getConversationID());
});
}
public static void acceptConversation(ConversationData<?> data) {
acceptableConversations.put(data.getType(), data);
}
@AllArgsConstructor
@Getter
public static class ConversationData<T extends JedisJSONPacket> {
private Type type;
private Gson gson;
private int initialState;
private Consumer<Conversation<T>> consumer;
}
}
| 3,724 | 0.665145 | 0.665145 | 115 | 31.382608 | 29.84149 | 142 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.730435 | false | false |
13
|
b7a9b81a41df3b2b7afe8d1d901e9c033828aa23
| 7,584,912,296,950 |
ee4e3724d73d0a2178edea1b6ca58a51391b75b0
|
/src/com/company/UI2.java
|
3eb3faeb01857e0bba3276733b72f6907e4c60a3
|
[] |
no_license
|
JarrettPhilips/chronicle
|
https://github.com/JarrettPhilips/chronicle
|
93955ec73cc7b4561c948b936fc46f10edbf48b1
|
5ecde1ab8ecd4b3f3c23e278e1ec659e611d54f4
|
refs/heads/master
| 2022-12-01T04:46:31.025000 | 2020-08-13T04:17:34 | 2020-08-13T04:17:34 | 101,462,305 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.company;
//import com.apple.eawt.Application;
import javax.swing.*;
import javax.swing.border.EmptyBorder;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
public class UI2 extends JFrame{
/*
Variables
*/
private Color primaryColor;
private Color secondaryColor;
private Color highColor;
private Color lowColor;
private Color medianColor;
private Font buttonFont = new Font("Geneva", Font.PLAIN, 25);
private Font titleFont = new Font("Futura", Font.BOLD, 40);
private Font selectionFont = new Font("Palatino", Font.PLAIN, 14);
private Dimension minimumSize = new Dimension(950, 500);
private JPanel contentPanel;
private JScrollPane selectionMenu;
private LoadingFrame loadingFrame;
private JButton newEntryButton;
private JButton editEntryButton;
private JButton refreshEntryButton;
private JButton helpButton;
private boolean newEntryButtonPressed = false;
private boolean editEntryButtonPressed = false;
private boolean refreshEntryButtonPressed = false;
private boolean helpButtonPressed = false;
private String currentEntryDirectory = "";
/*
Constructors
*/
public UI2(Color pc, Color sc, Color hc, Color lc, Color mc){
this.primaryColor = pc;
this.secondaryColor = sc;
this.highColor = hc;
this.lowColor = lc;
this.medianColor = mc;
loadingFrame = new LoadingFrame(primaryColor, secondaryColor, selectionFont);
try {
//UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
ImageIcon img = new ImageIcon("Icon.png");
this.setIconImage(img.getImage());
//Application application = Application.getApplication();
Image image = Toolkit.getDefaultToolkit().getImage("ChronicleSettings/Icon64.png");
//application.setDockIconImage(image);
} catch(Exception e){
System.out.println("Error setting jar icon");
}
loadingFrame.displayMessage("Setting up frame");
this.setMinimumSize(minimumSize);
Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
this.setLocation(dim.width/2-this.getSize().width/2, dim.height/2-this.getSize().height/2);
this.setBackground(secondaryColor);
this.setTitle("Chronicle " + Main.version);
this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
this.setLayout(new GridBagLayout());
GridBagConstraints c = new GridBagConstraints();
JPanel sideMenu = createSideMenu();
selectionMenu = createSelectionMenu();
loadingFrame.displayMessage("Rendering");
contentPanel = createContentPanel();
c.gridx = 0;
c.gridy = 0;
this.add(sideMenu, c);
c.gridy = 1;
c.fill = GridBagConstraints.BOTH;
this.add(selectionMenu, c);
c.gridx = 1;
c.gridy = 0;
c.gridheight = 2;
c.weighty = 1.0;
c.weightx = 1.0;
c.fill = GridBagConstraints.BOTH;
this.add(contentPanel, c);
//Adds a placeholder to content pane until another action is placed
contentPanel.add(createPlaceHolderPanel(), c);
loadingFrame.displayMessage("Done!");
loadingFrame.destroyFrame();
this.setVisible(true);
}
/*
Functions
*/
public void reloadSelectionMenu(){
selectionMenu.removeAll();
selectionMenu = createSelectionMenu();
selectionMenu.updateUI();
this.update(getGraphics());
}
public void setContentPanelToDefault(){
contentPanel.removeAll();
contentPanel.add(createPlaceHolderPanel());
contentPanel.updateUI();
}
private void reloadEntry(){
}
private JScrollPane createSelectionMenu(){ //Contains lots of legacy code... good luck <3
JPanel selectionPanelOverLay = new JPanel();
GridBagConstraints c = new GridBagConstraints();
//This block gathers and organizes entries
ArrayList<LMLEntryPanel> unsortedList = new ArrayList<LMLEntryPanel>();
for(int i = 0; i < Main.c.journalEntries.size(); i ++) {
String entryDirectory = Main.c.journalEntries.get(i).directory;
LMLEntryPanel e = new LMLEntryPanel(entryDirectory, primaryColor, secondaryColor, highColor, lowColor, medianColor); //This may cause a memory issue later...
unsortedList.add(e);
}
final ArrayList<LMLEntryPanel> entryList = Sort.sortEntryList(unsortedList);
//This block prepares to create the JButton panel
ArrayList<JButton> buttonList = new ArrayList<JButton>();
selectionPanelOverLay.setBackground(secondaryColor);
selectionPanelOverLay.setLayout(new GridBagLayout());
c.ipady = 20;
c.ipadx = 10;
c.fill = GridBagConstraints.HORIZONTAL;
c.weightx = 1;
c = new GridBagConstraints();
c.gridy = 1;
//This loop creates a JButton for each entry
for(int i = 0; i < entryList.size(); i ++){
loadingFrame.displayMessage("Loading " + i + " entries");
final int index = i;
JButton b = new JButton(entryList.get(i).getDateString());
b.setFont(selectionFont);
b.setHorizontalAlignment(SwingConstants.LEFT);
b.setBorder(new EmptyBorder(0, 10, 0, 10));
b.setBackground(entryList.get(index).getEntryColor());
b.setForeground(primaryColor);
b.setOpaque(true);
b.addActionListener(new ActionListener(){
@Override
public void actionPerformed(ActionEvent e){
resetSideMenu();
try{
GridBagConstraints c = new GridBagConstraints();
contentPanel.removeAll();
c.fill = GridBagConstraints.BOTH;
c.weightx = 1.0;
c.weighty = 1.0;
contentPanel.add(entryList.get(index), c); //If it does, just have this line create a new entry instead of using a list
currentEntryDirectory = entryList.get(index).getTxtDirectory();
contentPanel.updateUI();
int j = 0;
for(JButton bl: buttonList){
bl.setBackground(entryList.get(j).getEntryColor());
bl.setForeground(primaryColor);
j ++;
}
b.setBackground(primaryColor);
b.setForeground(secondaryColor);
} catch(Exception r){
System.out.println("Error in loading file contents");
}
}
});
c.fill = GridBagConstraints.HORIZONTAL;
c.weightx = 1;
c.ipadx = 10;
c.ipady = 20;
c.gridy ++;
buttonList.add(b);
selectionPanelOverLay.add(b, c);
}
//The rest of this function is just formatting and aesthetic choice
JScrollPane selectionPanel = new JScrollPane(selectionPanelOverLay);
selectionPanel.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
selectionPanel.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
selectionPanel.setBorder(new EmptyBorder(0, 0, 0, 0));
selectionPanelOverLay.setBorder(new EmptyBorder(0, 0, 0, 0));
selectionPanel.validate();
selectionPanelOverLay.validate();
//Adds a blank label to push buttons into correct position
JLabel l = new JLabel();
c.gridy ++;
c.fill = GridBagConstraints.BOTH;
c.weighty = 1;
selectionPanelOverLay.add(l, c);
c = new GridBagConstraints();
c.fill = GridBagConstraints.VERTICAL;
return selectionPanel;
}
private void addButtonToSelectionMenu(){
}
private JPanel createSideMenu(){
JPanel sideMenuPanel = new JPanel();
sideMenuPanel.setBackground(primaryColor);
sideMenuPanel.setLayout(new GridBagLayout());
GridBagConstraints c = new GridBagConstraints();
c.gridx = 0;
c.gridy = 0;
JLabel titleLabel = new JLabel("Chronicle");
titleLabel.setBorder(new EmptyBorder(10, 10, 10, 10));
titleLabel.setForeground(secondaryColor);
titleLabel.setFont(titleFont);
c.gridwidth = 4;
sideMenuPanel.add(titleLabel, c);
c.gridy = 1;
c.gridwidth = 1;
newEntryButton = new JButton("+");
newEntryButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
GridBagConstraints c = new GridBagConstraints();
c.weighty = 1.0;
c.weightx = 1.0;
c.fill = GridBagConstraints.BOTH;
if(newEntryButtonPressed){
resetSideMenu();
newEntryButtonPressed = false;
newEntryButton.setBackground(primaryColor);
newEntryButton.setForeground(secondaryColor);
contentPanel.removeAll();
contentPanel.add(createPlaceHolderPanel(), c);
contentPanel.updateUI();
} else {
resetSideMenu();
newEntryButtonPressed = true;
newEntryButton.setBackground(secondaryColor);
newEntryButton.setForeground(primaryColor);
contentPanel.removeAll();
contentPanel.add(new EditingPanel(primaryColor, secondaryColor), c);
contentPanel.updateUI();
}
}
} );
newEntryButton.setFont(buttonFont);
newEntryButton.setForeground(secondaryColor);
newEntryButton.setBackground(primaryColor);
newEntryButton.setBorder(new EmptyBorder(0, 10, 0, 5));
newEntryButton.setOpaque(true);
sideMenuPanel.add(newEntryButton, c);
c.gridx = 1;
editEntryButton = new JButton("✎");
editEntryButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
GridBagConstraints c = new GridBagConstraints();
c.weighty = 1.0;
c.weightx = 1.0;
c.fill = GridBagConstraints.BOTH;
if(editEntryButtonPressed){
resetSideMenu();
editEntryButtonPressed = false;
editEntryButton.setBackground(primaryColor);
editEntryButton.setForeground(secondaryColor);
contentPanel.removeAll();
contentPanel.add(createPlaceHolderPanel(), c);
contentPanel.updateUI();
} else {
resetSideMenu();
editEntryButtonPressed = true;
editEntryButton.setBackground(secondaryColor);
editEntryButton.setForeground(primaryColor);
contentPanel.removeAll();
contentPanel.add(new EditingPanel(primaryColor, secondaryColor, currentEntryDirectory), c);
contentPanel.updateUI();
}
}
} );
editEntryButton.setFont(buttonFont);
editEntryButton.setForeground(secondaryColor);
editEntryButton.setBackground(primaryColor);
editEntryButton.setBorder(new EmptyBorder(0, 5, 0, 5));
editEntryButton.setOpaque(true);
sideMenuPanel.add(editEntryButton, c);
c.gridx = 2;
refreshEntryButton = new JButton("↻");
refreshEntryButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e){
reloadEntry();
}
} );
refreshEntryButton.setFont(buttonFont);
refreshEntryButton.setForeground(secondaryColor);
refreshEntryButton.setBackground(primaryColor);
refreshEntryButton.setBorder(new EmptyBorder(0, 5, 0, 5));
refreshEntryButton.setOpaque(true);
sideMenuPanel.add(refreshEntryButton, c);
c.gridx = 3;
helpButton = new JButton("H");
helpButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
GridBagConstraints c = new GridBagConstraints();
c.weighty = 1.0;
c.weightx = 1.0;
c.fill = GridBagConstraints.BOTH;
if(helpButtonPressed){
resetSideMenu();
helpButtonPressed = false;
helpButton.setBackground(primaryColor);
helpButton.setForeground(secondaryColor);
contentPanel.removeAll();
contentPanel.add(createPlaceHolderPanel(), c);
contentPanel.updateUI();
} else {
resetSideMenu();
helpButtonPressed = true;
helpButton.setBackground(secondaryColor);
helpButton.setForeground(primaryColor);
contentPanel.removeAll();
contentPanel.add(new HelpPanel(primaryColor, secondaryColor), c);
contentPanel.updateUI();
}
}
} );
helpButton.setFont(buttonFont);
helpButton.setForeground(secondaryColor);
helpButton.setBackground(primaryColor);
helpButton.setBorder(new EmptyBorder(0, 5, 0, 10));
helpButton.setOpaque(true);
sideMenuPanel.add(helpButton, c);
return sideMenuPanel;
}
private void resetSideMenu(){
newEntryButtonPressed = false;
editEntryButtonPressed = false;
refreshEntryButtonPressed = false;
helpButtonPressed = false;
newEntryButton.setBackground(primaryColor);
newEntryButton.setForeground(secondaryColor);
editEntryButton.setBackground(primaryColor);
editEntryButton.setForeground(secondaryColor);
refreshEntryButton.setBackground(primaryColor);
refreshEntryButton.setForeground(secondaryColor);
helpButton.setBackground(primaryColor);
helpButton.setForeground(secondaryColor);
}
private JPanel createPlaceHolderPanel(){
JPanel placeHolderPanel = new JPanel(new BorderLayout());
placeHolderPanel.setBackground(secondaryColor);
ImageIcon image = new ImageIcon(CustomIcon.getCustomChronicleIconBufferedImage(primaryColor, secondaryColor, 256));
JLabel label = new JLabel("", image, JLabel.CENTER);
label.setMaximumSize(new Dimension(64, 64));
placeHolderPanel.add(label, BorderLayout.CENTER );
return placeHolderPanel;
}
private JPanel createContentPanel(){
JPanel contentPanel = new JPanel();
contentPanel.setLayout(new GridBagLayout());
return contentPanel;
}
}
|
UTF-8
|
Java
| 15,316 |
java
|
UI2.java
|
Java
|
[] | null |
[] |
package com.company;
//import com.apple.eawt.Application;
import javax.swing.*;
import javax.swing.border.EmptyBorder;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
public class UI2 extends JFrame{
/*
Variables
*/
private Color primaryColor;
private Color secondaryColor;
private Color highColor;
private Color lowColor;
private Color medianColor;
private Font buttonFont = new Font("Geneva", Font.PLAIN, 25);
private Font titleFont = new Font("Futura", Font.BOLD, 40);
private Font selectionFont = new Font("Palatino", Font.PLAIN, 14);
private Dimension minimumSize = new Dimension(950, 500);
private JPanel contentPanel;
private JScrollPane selectionMenu;
private LoadingFrame loadingFrame;
private JButton newEntryButton;
private JButton editEntryButton;
private JButton refreshEntryButton;
private JButton helpButton;
private boolean newEntryButtonPressed = false;
private boolean editEntryButtonPressed = false;
private boolean refreshEntryButtonPressed = false;
private boolean helpButtonPressed = false;
private String currentEntryDirectory = "";
/*
Constructors
*/
public UI2(Color pc, Color sc, Color hc, Color lc, Color mc){
this.primaryColor = pc;
this.secondaryColor = sc;
this.highColor = hc;
this.lowColor = lc;
this.medianColor = mc;
loadingFrame = new LoadingFrame(primaryColor, secondaryColor, selectionFont);
try {
//UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
ImageIcon img = new ImageIcon("Icon.png");
this.setIconImage(img.getImage());
//Application application = Application.getApplication();
Image image = Toolkit.getDefaultToolkit().getImage("ChronicleSettings/Icon64.png");
//application.setDockIconImage(image);
} catch(Exception e){
System.out.println("Error setting jar icon");
}
loadingFrame.displayMessage("Setting up frame");
this.setMinimumSize(minimumSize);
Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
this.setLocation(dim.width/2-this.getSize().width/2, dim.height/2-this.getSize().height/2);
this.setBackground(secondaryColor);
this.setTitle("Chronicle " + Main.version);
this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
this.setLayout(new GridBagLayout());
GridBagConstraints c = new GridBagConstraints();
JPanel sideMenu = createSideMenu();
selectionMenu = createSelectionMenu();
loadingFrame.displayMessage("Rendering");
contentPanel = createContentPanel();
c.gridx = 0;
c.gridy = 0;
this.add(sideMenu, c);
c.gridy = 1;
c.fill = GridBagConstraints.BOTH;
this.add(selectionMenu, c);
c.gridx = 1;
c.gridy = 0;
c.gridheight = 2;
c.weighty = 1.0;
c.weightx = 1.0;
c.fill = GridBagConstraints.BOTH;
this.add(contentPanel, c);
//Adds a placeholder to content pane until another action is placed
contentPanel.add(createPlaceHolderPanel(), c);
loadingFrame.displayMessage("Done!");
loadingFrame.destroyFrame();
this.setVisible(true);
}
/*
Functions
*/
public void reloadSelectionMenu(){
selectionMenu.removeAll();
selectionMenu = createSelectionMenu();
selectionMenu.updateUI();
this.update(getGraphics());
}
public void setContentPanelToDefault(){
contentPanel.removeAll();
contentPanel.add(createPlaceHolderPanel());
contentPanel.updateUI();
}
private void reloadEntry(){
}
private JScrollPane createSelectionMenu(){ //Contains lots of legacy code... good luck <3
JPanel selectionPanelOverLay = new JPanel();
GridBagConstraints c = new GridBagConstraints();
//This block gathers and organizes entries
ArrayList<LMLEntryPanel> unsortedList = new ArrayList<LMLEntryPanel>();
for(int i = 0; i < Main.c.journalEntries.size(); i ++) {
String entryDirectory = Main.c.journalEntries.get(i).directory;
LMLEntryPanel e = new LMLEntryPanel(entryDirectory, primaryColor, secondaryColor, highColor, lowColor, medianColor); //This may cause a memory issue later...
unsortedList.add(e);
}
final ArrayList<LMLEntryPanel> entryList = Sort.sortEntryList(unsortedList);
//This block prepares to create the JButton panel
ArrayList<JButton> buttonList = new ArrayList<JButton>();
selectionPanelOverLay.setBackground(secondaryColor);
selectionPanelOverLay.setLayout(new GridBagLayout());
c.ipady = 20;
c.ipadx = 10;
c.fill = GridBagConstraints.HORIZONTAL;
c.weightx = 1;
c = new GridBagConstraints();
c.gridy = 1;
//This loop creates a JButton for each entry
for(int i = 0; i < entryList.size(); i ++){
loadingFrame.displayMessage("Loading " + i + " entries");
final int index = i;
JButton b = new JButton(entryList.get(i).getDateString());
b.setFont(selectionFont);
b.setHorizontalAlignment(SwingConstants.LEFT);
b.setBorder(new EmptyBorder(0, 10, 0, 10));
b.setBackground(entryList.get(index).getEntryColor());
b.setForeground(primaryColor);
b.setOpaque(true);
b.addActionListener(new ActionListener(){
@Override
public void actionPerformed(ActionEvent e){
resetSideMenu();
try{
GridBagConstraints c = new GridBagConstraints();
contentPanel.removeAll();
c.fill = GridBagConstraints.BOTH;
c.weightx = 1.0;
c.weighty = 1.0;
contentPanel.add(entryList.get(index), c); //If it does, just have this line create a new entry instead of using a list
currentEntryDirectory = entryList.get(index).getTxtDirectory();
contentPanel.updateUI();
int j = 0;
for(JButton bl: buttonList){
bl.setBackground(entryList.get(j).getEntryColor());
bl.setForeground(primaryColor);
j ++;
}
b.setBackground(primaryColor);
b.setForeground(secondaryColor);
} catch(Exception r){
System.out.println("Error in loading file contents");
}
}
});
c.fill = GridBagConstraints.HORIZONTAL;
c.weightx = 1;
c.ipadx = 10;
c.ipady = 20;
c.gridy ++;
buttonList.add(b);
selectionPanelOverLay.add(b, c);
}
//The rest of this function is just formatting and aesthetic choice
JScrollPane selectionPanel = new JScrollPane(selectionPanelOverLay);
selectionPanel.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
selectionPanel.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
selectionPanel.setBorder(new EmptyBorder(0, 0, 0, 0));
selectionPanelOverLay.setBorder(new EmptyBorder(0, 0, 0, 0));
selectionPanel.validate();
selectionPanelOverLay.validate();
//Adds a blank label to push buttons into correct position
JLabel l = new JLabel();
c.gridy ++;
c.fill = GridBagConstraints.BOTH;
c.weighty = 1;
selectionPanelOverLay.add(l, c);
c = new GridBagConstraints();
c.fill = GridBagConstraints.VERTICAL;
return selectionPanel;
}
private void addButtonToSelectionMenu(){
}
private JPanel createSideMenu(){
JPanel sideMenuPanel = new JPanel();
sideMenuPanel.setBackground(primaryColor);
sideMenuPanel.setLayout(new GridBagLayout());
GridBagConstraints c = new GridBagConstraints();
c.gridx = 0;
c.gridy = 0;
JLabel titleLabel = new JLabel("Chronicle");
titleLabel.setBorder(new EmptyBorder(10, 10, 10, 10));
titleLabel.setForeground(secondaryColor);
titleLabel.setFont(titleFont);
c.gridwidth = 4;
sideMenuPanel.add(titleLabel, c);
c.gridy = 1;
c.gridwidth = 1;
newEntryButton = new JButton("+");
newEntryButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
GridBagConstraints c = new GridBagConstraints();
c.weighty = 1.0;
c.weightx = 1.0;
c.fill = GridBagConstraints.BOTH;
if(newEntryButtonPressed){
resetSideMenu();
newEntryButtonPressed = false;
newEntryButton.setBackground(primaryColor);
newEntryButton.setForeground(secondaryColor);
contentPanel.removeAll();
contentPanel.add(createPlaceHolderPanel(), c);
contentPanel.updateUI();
} else {
resetSideMenu();
newEntryButtonPressed = true;
newEntryButton.setBackground(secondaryColor);
newEntryButton.setForeground(primaryColor);
contentPanel.removeAll();
contentPanel.add(new EditingPanel(primaryColor, secondaryColor), c);
contentPanel.updateUI();
}
}
} );
newEntryButton.setFont(buttonFont);
newEntryButton.setForeground(secondaryColor);
newEntryButton.setBackground(primaryColor);
newEntryButton.setBorder(new EmptyBorder(0, 10, 0, 5));
newEntryButton.setOpaque(true);
sideMenuPanel.add(newEntryButton, c);
c.gridx = 1;
editEntryButton = new JButton("✎");
editEntryButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
GridBagConstraints c = new GridBagConstraints();
c.weighty = 1.0;
c.weightx = 1.0;
c.fill = GridBagConstraints.BOTH;
if(editEntryButtonPressed){
resetSideMenu();
editEntryButtonPressed = false;
editEntryButton.setBackground(primaryColor);
editEntryButton.setForeground(secondaryColor);
contentPanel.removeAll();
contentPanel.add(createPlaceHolderPanel(), c);
contentPanel.updateUI();
} else {
resetSideMenu();
editEntryButtonPressed = true;
editEntryButton.setBackground(secondaryColor);
editEntryButton.setForeground(primaryColor);
contentPanel.removeAll();
contentPanel.add(new EditingPanel(primaryColor, secondaryColor, currentEntryDirectory), c);
contentPanel.updateUI();
}
}
} );
editEntryButton.setFont(buttonFont);
editEntryButton.setForeground(secondaryColor);
editEntryButton.setBackground(primaryColor);
editEntryButton.setBorder(new EmptyBorder(0, 5, 0, 5));
editEntryButton.setOpaque(true);
sideMenuPanel.add(editEntryButton, c);
c.gridx = 2;
refreshEntryButton = new JButton("↻");
refreshEntryButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e){
reloadEntry();
}
} );
refreshEntryButton.setFont(buttonFont);
refreshEntryButton.setForeground(secondaryColor);
refreshEntryButton.setBackground(primaryColor);
refreshEntryButton.setBorder(new EmptyBorder(0, 5, 0, 5));
refreshEntryButton.setOpaque(true);
sideMenuPanel.add(refreshEntryButton, c);
c.gridx = 3;
helpButton = new JButton("H");
helpButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
GridBagConstraints c = new GridBagConstraints();
c.weighty = 1.0;
c.weightx = 1.0;
c.fill = GridBagConstraints.BOTH;
if(helpButtonPressed){
resetSideMenu();
helpButtonPressed = false;
helpButton.setBackground(primaryColor);
helpButton.setForeground(secondaryColor);
contentPanel.removeAll();
contentPanel.add(createPlaceHolderPanel(), c);
contentPanel.updateUI();
} else {
resetSideMenu();
helpButtonPressed = true;
helpButton.setBackground(secondaryColor);
helpButton.setForeground(primaryColor);
contentPanel.removeAll();
contentPanel.add(new HelpPanel(primaryColor, secondaryColor), c);
contentPanel.updateUI();
}
}
} );
helpButton.setFont(buttonFont);
helpButton.setForeground(secondaryColor);
helpButton.setBackground(primaryColor);
helpButton.setBorder(new EmptyBorder(0, 5, 0, 10));
helpButton.setOpaque(true);
sideMenuPanel.add(helpButton, c);
return sideMenuPanel;
}
private void resetSideMenu(){
newEntryButtonPressed = false;
editEntryButtonPressed = false;
refreshEntryButtonPressed = false;
helpButtonPressed = false;
newEntryButton.setBackground(primaryColor);
newEntryButton.setForeground(secondaryColor);
editEntryButton.setBackground(primaryColor);
editEntryButton.setForeground(secondaryColor);
refreshEntryButton.setBackground(primaryColor);
refreshEntryButton.setForeground(secondaryColor);
helpButton.setBackground(primaryColor);
helpButton.setForeground(secondaryColor);
}
private JPanel createPlaceHolderPanel(){
JPanel placeHolderPanel = new JPanel(new BorderLayout());
placeHolderPanel.setBackground(secondaryColor);
ImageIcon image = new ImageIcon(CustomIcon.getCustomChronicleIconBufferedImage(primaryColor, secondaryColor, 256));
JLabel label = new JLabel("", image, JLabel.CENTER);
label.setMaximumSize(new Dimension(64, 64));
placeHolderPanel.add(label, BorderLayout.CENTER );
return placeHolderPanel;
}
private JPanel createContentPanel(){
JPanel contentPanel = new JPanel();
contentPanel.setLayout(new GridBagLayout());
return contentPanel;
}
}
| 15,316 | 0.603056 | 0.595415 | 395 | 37.762024 | 25.01046 | 169 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.875949 | false | false |
13
|
6a583fc92750658b5f01a5e611cdf9a3107193f5
| 19,928,648,293,695 |
f1c211fd2440864c7465ba9c1044083e5f16601c
|
/src/JavaSrc/享元模式/IGoods.java
|
4b82a22a4da2fc41e206267ce9a998aaf4b1e185
|
[] |
no_license
|
LingkaiZhang/LearnDemo
|
https://github.com/LingkaiZhang/LearnDemo
|
27008f5a5109b718d8b17005584b2f79b8f2e28c
|
fc13ae1a970dbbd8ac3e426ed42140ca55e7d5fd
|
refs/heads/master
| 2021-08-28T00:09:35.530000 | 2021-08-20T02:08:16 | 2021-08-20T02:08:16 | 195,782,810 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package JavaSrc.享元模式;
/**
* @Auther: lingkai
* @Date: 2019/7/26 15:39
* @Description: 抽象享元角色
*/
public interface IGoods {
public void showGoodsPrice(String name);
}
|
UTF-8
|
Java
| 195 |
java
|
IGoods.java
|
Java
|
[
{
"context": "package JavaSrc.享元模式;\n\n/**\n * @Auther: lingkai\n * @Date: 2019/7/26 15:39\n * @Description: 抽象享元角",
"end": 46,
"score": 0.9995394349098206,
"start": 39,
"tag": "USERNAME",
"value": "lingkai"
}
] | null |
[] |
package JavaSrc.享元模式;
/**
* @Auther: lingkai
* @Date: 2019/7/26 15:39
* @Description: 抽象享元角色
*/
public interface IGoods {
public void showGoodsPrice(String name);
}
| 195 | 0.674286 | 0.611429 | 10 | 16.5 | 13.640015 | 44 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.2 | false | false |
13
|
c53e01d5389d332402288f2aea576f5e92e1bda7
| 15,693,810,542,523 |
eddb0810905c3ba3a64b0e10f3311ca1e445b037
|
/app/src/main/java/com/appdiscovery/app/cordovaPlugins/Auth.java
|
b3f633633e4c5ab15a13d55151d2c8385ae3dac1
|
[] |
no_license
|
AppDiscovery/android-app
|
https://github.com/AppDiscovery/android-app
|
04ec6ce96dafb85c1e95d74d6d644e919588342b
|
acfee481b6514552bf73afc00d3440757312d54a
|
refs/heads/master
| 2020-03-31T12:10:51.888000 | 2019-11-28T09:01:48 | 2019-11-28T09:01:48 | 152,206,153 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.appdiscovery.app.cordovaPlugins;
import android.app.Activity;
import android.app.Fragment;
import android.app.FragmentTransaction;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.support.annotation.NonNull;
import com.appdiscovery.app.MainActivity;
import com.appdiscovery.app.R;
import com.appdiscovery.app.RequestPaymentDialogFragment;
import com.appdiscovery.app.UserInfoAuthorizationDialogFragment;
import com.appdiscovery.app.services.DigitalSignature;
import com.google.gson.JsonObject;
import org.apache.cordova.CallbackContext;
import org.apache.cordova.CordovaInterface;
import org.apache.cordova.CordovaPlugin;
import org.apache.cordova.CordovaWebView;
import org.apache.cordova.PluginResult;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
public class Auth extends CordovaPlugin {
private static CallbackContext eventCallbackContext;
void showAuthDialog(String[] args, final CallbackContext callbackContext) {
Activity cordovaActivity = cordova.getActivity();
FragmentTransaction ft = cordovaActivity.getFragmentManager().beginTransaction();
Fragment prev = cordovaActivity.getFragmentManager().findFragmentByTag("dialog");
if (prev != null) {
ft.remove(prev);
}
ft.addToBackStack(null);
// Create and show the dialog.
Bundle bundle = new Bundle();
bundle.putStringArray("requestedPermissions", args);
UserInfoAuthorizationDialogFragment newFragment = UserInfoAuthorizationDialogFragment.newInstance(bundle);
newFragment.mOnAccept = view -> {
SharedPreferences sharedPref = cordovaActivity.getSharedPreferences(
cordovaActivity.getString(R.string.preference_file_key), Context.MODE_PRIVATE);
try {
PluginResult result;
JSONObject callbackObj = new JSONObject();
List<String> argsList = Arrays.asList(args);
if (argsList.contains("email")) {
callbackObj.put("email", sharedPref.getString(cordovaActivity.getString(R.string.user_email_key), ""));
}
if (argsList.contains("name")) {
callbackObj.put("name", sharedPref.getString(cordovaActivity.getString(R.string.user_name_key), ""));
}
if (argsList.contains("mobile")) {
callbackObj.put("mobile", sharedPref.getString(cordovaActivity.getString(R.string.user_mobile_key), ""));
}
result = new PluginResult(PluginResult.Status.OK, callbackObj.toString());
result.setKeepCallback(false);
callbackContext.sendPluginResult(result);
} catch (JSONException e) {
e.printStackTrace();
}
};
newFragment.mOnReject = view -> {
PluginResult result;
result = new PluginResult(PluginResult.Status.ERROR);
result.setKeepCallback(false);
callbackContext.sendPluginResult(result);
};
newFragment.show(ft, "dialog");
}
void requestPayment(JSONObject args, final CallbackContext callbackContext) throws JSONException {
Activity cordovaActivity = cordova.getActivity();
FragmentTransaction ft = cordovaActivity.getFragmentManager().beginTransaction();
Fragment prev = cordovaActivity.getFragmentManager().findFragmentByTag("dialog");
if (prev != null) {
ft.remove(prev);
}
ft.addToBackStack(null);
// Create and show the dialog.
Bundle bundle = new Bundle();
final int amountToPay = args.getInt("amountToPay");
final String orderId = args.getString("orderId");
final String orderTitle = args.getString("orderTitle");
final String orderDescription = args.getString("orderDescription");
bundle.putInt("amountToPay", amountToPay);
bundle.putString("orderId", orderId);
bundle.putString("orderTitle", orderTitle);
bundle.putString("orderDescription", orderDescription);
RequestPaymentDialogFragment newFragment = RequestPaymentDialogFragment.newInstance(bundle);
newFragment.mOnAccept = view -> {
SharedPreferences sharedPref = cordovaActivity.getSharedPreferences(
cordovaActivity.getString(R.string.preference_file_key), Context.MODE_PRIVATE);
String privateKey = DigitalSignature.getPrivateKey(cordovaActivity);
String publicKey = DigitalSignature.getPublicKey(cordovaActivity);
try {
JSONObject toSign = null;
toSign = new JSONObject("{}");
toSign.put("app_name", MainActivity.activeAppName);
toSign.put("order_id", orderId);
toSign.put("order_title", orderTitle);
toSign.put("order_description", orderDescription);
toSign.put("timestamp", System.currentTimeMillis());
toSign.put("amount_to_pay", amountToPay);
String signedContent = toSign.toString();
String signature = DigitalSignature.sign(signedContent, privateKey);
try {
PluginResult result;
JSONObject callbackObj = new JSONObject();
callbackObj.put("publicKey", publicKey.trim());
callbackObj.put("signature", signature.trim());
callbackObj.put("signedContent", signedContent.trim());
result = new PluginResult(PluginResult.Status.OK, callbackObj.toString());
result.setKeepCallback(false);
callbackContext.sendPluginResult(result);
} catch (JSONException e) {
e.printStackTrace();
}
} catch (JSONException e) {
e.printStackTrace();
}
};
newFragment.mOnReject = view -> {
PluginResult result;
result = new PluginResult(PluginResult.Status.ERROR);
result.setKeepCallback(false);
callbackContext.sendPluginResult(result);
};
newFragment.show(ft, "payment-dialog");
}
void getUserIdentity(String[] args, final CallbackContext callbackContext) {
Activity cordovaActivity = cordova.getActivity();
String privateKey = DigitalSignature.getPrivateKey(cordovaActivity);
String publicKey = DigitalSignature.getPublicKey(cordovaActivity);
String signedContent = "APP:" + MainActivity.activeAppName + ":" + System.currentTimeMillis();
String signature = DigitalSignature.sign(signedContent, privateKey);
try {
JSONObject userIdentity = new JSONObject();
userIdentity.put("publicKey", publicKey.trim());
userIdentity.put("signature", signature.trim());
userIdentity.put("signedContent", signedContent.trim());
PluginResult result = new PluginResult(PluginResult.Status.OK, userIdentity.toString());
result.setKeepCallback(false);
callbackContext.sendPluginResult(result);
} catch (JSONException e) {
e.printStackTrace();
}
}
public void initialize(CordovaInterface cordova, CordovaWebView webView) {
super.initialize(cordova, webView);
}
public boolean execute(String action, JSONArray args, final CallbackContext callbackContext) throws JSONException {
if ("getUserInfo".equals(action)) {
showAuthDialog(getArgInString(args), callbackContext);
return true;
} else if ("getUserIdentity".equals(action)) {
getUserIdentity(getArgInString(args), callbackContext);
return true;
} else if ("requestPayment".equals(action)) {
requestPayment(args.getJSONObject(0), callbackContext);
return true;
}
return false;
}
@NonNull
private String[] getArgInString(JSONArray args) throws JSONException {
int argsLength = args.length();
String[] argsInString = new String[argsLength];
for (int i = 0; i < argsLength; i++) {
argsInString[i] = args.getString(i);
}
return argsInString;
}
}
|
UTF-8
|
Java
| 8,509 |
java
|
Auth.java
|
Java
|
[] | null |
[] |
package com.appdiscovery.app.cordovaPlugins;
import android.app.Activity;
import android.app.Fragment;
import android.app.FragmentTransaction;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.support.annotation.NonNull;
import com.appdiscovery.app.MainActivity;
import com.appdiscovery.app.R;
import com.appdiscovery.app.RequestPaymentDialogFragment;
import com.appdiscovery.app.UserInfoAuthorizationDialogFragment;
import com.appdiscovery.app.services.DigitalSignature;
import com.google.gson.JsonObject;
import org.apache.cordova.CallbackContext;
import org.apache.cordova.CordovaInterface;
import org.apache.cordova.CordovaPlugin;
import org.apache.cordova.CordovaWebView;
import org.apache.cordova.PluginResult;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
public class Auth extends CordovaPlugin {
private static CallbackContext eventCallbackContext;
void showAuthDialog(String[] args, final CallbackContext callbackContext) {
Activity cordovaActivity = cordova.getActivity();
FragmentTransaction ft = cordovaActivity.getFragmentManager().beginTransaction();
Fragment prev = cordovaActivity.getFragmentManager().findFragmentByTag("dialog");
if (prev != null) {
ft.remove(prev);
}
ft.addToBackStack(null);
// Create and show the dialog.
Bundle bundle = new Bundle();
bundle.putStringArray("requestedPermissions", args);
UserInfoAuthorizationDialogFragment newFragment = UserInfoAuthorizationDialogFragment.newInstance(bundle);
newFragment.mOnAccept = view -> {
SharedPreferences sharedPref = cordovaActivity.getSharedPreferences(
cordovaActivity.getString(R.string.preference_file_key), Context.MODE_PRIVATE);
try {
PluginResult result;
JSONObject callbackObj = new JSONObject();
List<String> argsList = Arrays.asList(args);
if (argsList.contains("email")) {
callbackObj.put("email", sharedPref.getString(cordovaActivity.getString(R.string.user_email_key), ""));
}
if (argsList.contains("name")) {
callbackObj.put("name", sharedPref.getString(cordovaActivity.getString(R.string.user_name_key), ""));
}
if (argsList.contains("mobile")) {
callbackObj.put("mobile", sharedPref.getString(cordovaActivity.getString(R.string.user_mobile_key), ""));
}
result = new PluginResult(PluginResult.Status.OK, callbackObj.toString());
result.setKeepCallback(false);
callbackContext.sendPluginResult(result);
} catch (JSONException e) {
e.printStackTrace();
}
};
newFragment.mOnReject = view -> {
PluginResult result;
result = new PluginResult(PluginResult.Status.ERROR);
result.setKeepCallback(false);
callbackContext.sendPluginResult(result);
};
newFragment.show(ft, "dialog");
}
void requestPayment(JSONObject args, final CallbackContext callbackContext) throws JSONException {
Activity cordovaActivity = cordova.getActivity();
FragmentTransaction ft = cordovaActivity.getFragmentManager().beginTransaction();
Fragment prev = cordovaActivity.getFragmentManager().findFragmentByTag("dialog");
if (prev != null) {
ft.remove(prev);
}
ft.addToBackStack(null);
// Create and show the dialog.
Bundle bundle = new Bundle();
final int amountToPay = args.getInt("amountToPay");
final String orderId = args.getString("orderId");
final String orderTitle = args.getString("orderTitle");
final String orderDescription = args.getString("orderDescription");
bundle.putInt("amountToPay", amountToPay);
bundle.putString("orderId", orderId);
bundle.putString("orderTitle", orderTitle);
bundle.putString("orderDescription", orderDescription);
RequestPaymentDialogFragment newFragment = RequestPaymentDialogFragment.newInstance(bundle);
newFragment.mOnAccept = view -> {
SharedPreferences sharedPref = cordovaActivity.getSharedPreferences(
cordovaActivity.getString(R.string.preference_file_key), Context.MODE_PRIVATE);
String privateKey = DigitalSignature.getPrivateKey(cordovaActivity);
String publicKey = DigitalSignature.getPublicKey(cordovaActivity);
try {
JSONObject toSign = null;
toSign = new JSONObject("{}");
toSign.put("app_name", MainActivity.activeAppName);
toSign.put("order_id", orderId);
toSign.put("order_title", orderTitle);
toSign.put("order_description", orderDescription);
toSign.put("timestamp", System.currentTimeMillis());
toSign.put("amount_to_pay", amountToPay);
String signedContent = toSign.toString();
String signature = DigitalSignature.sign(signedContent, privateKey);
try {
PluginResult result;
JSONObject callbackObj = new JSONObject();
callbackObj.put("publicKey", publicKey.trim());
callbackObj.put("signature", signature.trim());
callbackObj.put("signedContent", signedContent.trim());
result = new PluginResult(PluginResult.Status.OK, callbackObj.toString());
result.setKeepCallback(false);
callbackContext.sendPluginResult(result);
} catch (JSONException e) {
e.printStackTrace();
}
} catch (JSONException e) {
e.printStackTrace();
}
};
newFragment.mOnReject = view -> {
PluginResult result;
result = new PluginResult(PluginResult.Status.ERROR);
result.setKeepCallback(false);
callbackContext.sendPluginResult(result);
};
newFragment.show(ft, "payment-dialog");
}
void getUserIdentity(String[] args, final CallbackContext callbackContext) {
Activity cordovaActivity = cordova.getActivity();
String privateKey = DigitalSignature.getPrivateKey(cordovaActivity);
String publicKey = DigitalSignature.getPublicKey(cordovaActivity);
String signedContent = "APP:" + MainActivity.activeAppName + ":" + System.currentTimeMillis();
String signature = DigitalSignature.sign(signedContent, privateKey);
try {
JSONObject userIdentity = new JSONObject();
userIdentity.put("publicKey", publicKey.trim());
userIdentity.put("signature", signature.trim());
userIdentity.put("signedContent", signedContent.trim());
PluginResult result = new PluginResult(PluginResult.Status.OK, userIdentity.toString());
result.setKeepCallback(false);
callbackContext.sendPluginResult(result);
} catch (JSONException e) {
e.printStackTrace();
}
}
public void initialize(CordovaInterface cordova, CordovaWebView webView) {
super.initialize(cordova, webView);
}
public boolean execute(String action, JSONArray args, final CallbackContext callbackContext) throws JSONException {
if ("getUserInfo".equals(action)) {
showAuthDialog(getArgInString(args), callbackContext);
return true;
} else if ("getUserIdentity".equals(action)) {
getUserIdentity(getArgInString(args), callbackContext);
return true;
} else if ("requestPayment".equals(action)) {
requestPayment(args.getJSONObject(0), callbackContext);
return true;
}
return false;
}
@NonNull
private String[] getArgInString(JSONArray args) throws JSONException {
int argsLength = args.length();
String[] argsInString = new String[argsLength];
for (int i = 0; i < argsLength; i++) {
argsInString[i] = args.getString(i);
}
return argsInString;
}
}
| 8,509 | 0.644259 | 0.644024 | 200 | 41.544998 | 29.840208 | 125 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.83 | false | false |
13
|
09e6de456ae02a11a2f8394ad3b73270901880e4
| 18,133,351,936,670 |
96b6df2d4dbc7b33dc2fe7e979abb79f26540426
|
/src/main/java/hu/aradipatrik/appdev/service/form_validation/exception/EmptyInputException.java
|
62584c6308f0136cd8cdddc0da9bb685e286848f
|
[] |
no_license
|
AradiPatrik/AlkfejlHazi1
|
https://github.com/AradiPatrik/AlkfejlHazi1
|
e917995df52a461823af95d9bee89ce91c67e009
|
bdb1e60431d9a1baf71af65d55e0033162f747cd
|
refs/heads/master
| 2021-04-30T14:08:19.915000 | 2018-02-12T07:00:02 | 2018-02-12T07:00:02 | 121,211,720 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package hu.aradipatrik.appdev.service.form_validation.exception;
public class EmptyInputException extends Exception {
}
|
UTF-8
|
Java
| 122 |
java
|
EmptyInputException.java
|
Java
|
[] | null |
[] |
package hu.aradipatrik.appdev.service.form_validation.exception;
public class EmptyInputException extends Exception {
}
| 122 | 0.836066 | 0.836066 | 5 | 23.4 | 28.506842 | 64 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.2 | false | false |
13
|
b9126d71e301525db694b2183db5c62dc43c41e6
| 21,457,656,648,361 |
6c860fb5c45d1b36e3869e4a23868461a2be4fc5
|
/lingx-core/src/main/java/com/lingx/core/Constants.java
|
64f97bc9fdb55f84683034819471599f818c68b7
|
[
"MIT"
] |
permissive
|
mehome/lingx
|
https://github.com/mehome/lingx
|
22f9597267e3dc27c561ff97bd72910d53209842
|
70484b524fb04c1fd51309c86077e375fb62b217
|
refs/heads/master
| 2022-03-15T02:38:45.704000 | 2019-11-21T10:35:35 | 2019-11-21T10:35:35 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.lingx.core;
public interface Constants {
public static final String GRID_QUERY="grid_query";
public static final String REQUEST_JSON="REQUEST_JSON";
public static final String REQUEST_PARAMS="REQUEST_PARAMS";
public static final String REQUEST_MESSAGES="REQUEST_MESSAGES";
public static final String REQUEST_ATTR="REQUEST_ATTR";
public static final String APPLICATION_ONLINE_USER="APPLICATION_ONLINE_USER";
public static final String SESSION_USER="SESSION_USER";
public static final String IS_SUPER_MAN="IS_SUPER_MAN";
public static final String SESSION_YZM="SESSION_YZM";
public static final String SESSION_LAST_QUERY_SQL="SESSION_LAST_QUERY_SQL";
public static final String SESSION_LANGUAGE="SESSION_LANGUAGE";
public static final String KEY_DATABASE_TYPE="database.type";
public static final String KEY_DATABASE_NAME="database.name";
public static final String KEY_LINGX_LOGIN_VERIFYCODE="lingx.login.verifycode";
public static final String REF_DISPLAY="ref-display";
public static final String REF_VALUE="ref-value";
public static final String REF_DEFAULT="id";
}
|
UTF-8
|
Java
| 1,132 |
java
|
Constants.java
|
Java
|
[] | null |
[] |
package com.lingx.core;
public interface Constants {
public static final String GRID_QUERY="grid_query";
public static final String REQUEST_JSON="REQUEST_JSON";
public static final String REQUEST_PARAMS="REQUEST_PARAMS";
public static final String REQUEST_MESSAGES="REQUEST_MESSAGES";
public static final String REQUEST_ATTR="REQUEST_ATTR";
public static final String APPLICATION_ONLINE_USER="APPLICATION_ONLINE_USER";
public static final String SESSION_USER="SESSION_USER";
public static final String IS_SUPER_MAN="IS_SUPER_MAN";
public static final String SESSION_YZM="SESSION_YZM";
public static final String SESSION_LAST_QUERY_SQL="SESSION_LAST_QUERY_SQL";
public static final String SESSION_LANGUAGE="SESSION_LANGUAGE";
public static final String KEY_DATABASE_TYPE="database.type";
public static final String KEY_DATABASE_NAME="database.name";
public static final String KEY_LINGX_LOGIN_VERIFYCODE="lingx.login.verifycode";
public static final String REF_DISPLAY="ref-display";
public static final String REF_VALUE="ref-value";
public static final String REF_DEFAULT="id";
}
| 1,132 | 0.767668 | 0.767668 | 26 | 41.53846 | 27.596308 | 80 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.461538 | false | false |
13
|
9e687f91b15a360d9c23fbe83e4e495f3b74983d
| 21,595,095,576,989 |
508bfa84504cbcd58d9aae37e27f57ae86711cfa
|
/src/main/java/com/puxin/mp/dao/UserMapper.java
|
56b68ffa95c4b8006792f683c597c9a19f5e6325
|
[] |
no_license
|
yangguoqing0616/mp-springboot
|
https://github.com/yangguoqing0616/mp-springboot
|
40b48eb172b72ac697869b4c9330201b56c117d0
|
bdd99175ac2b1fc1af8edaaee41ecb0a912f523a
|
refs/heads/master
| 2022-07-04T00:39:01.949000 | 2020-05-05T02:37:45 | 2020-05-05T02:37:45 | 213,108,460 | 0 | 0 | null | false | 2022-06-21T01:59:26 | 2019-10-06T04:26:23 | 2020-05-05T02:38:10 | 2022-06-21T01:59:26 | 35 | 0 | 0 | 1 |
Java
| false | false |
package com.puxin.mp.dao;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.puxin.mp.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
import java.util.Map;
@Mapper
public interface UserMapper extends BaseMapper<User> {
@Select("select * from tb_user ${ew.customSqlSegment}") // ${ew.customSqlSegment} 为固定写法
List<User> selectAll(@Param(Constants.WRAPPER) Wrapper wrapper);//@Param(Contants.WRAPPER) 为固定写法
List<Map<String,Object>> selectAlla(@Param(Constants.WRAPPER) Wrapper wrapper);//@Param(Contants.WRAPPER) 为固定写法
IPage<Map<String,Object>> selectMyUserPage(Page<User> page,@Param(Constants.WRAPPER) Wrapper wrapper);
}
|
UTF-8
|
Java
| 1,045 |
java
|
UserMapper.java
|
Java
|
[] | null |
[] |
package com.puxin.mp.dao;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.puxin.mp.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
import java.util.Map;
@Mapper
public interface UserMapper extends BaseMapper<User> {
@Select("select * from tb_user ${ew.customSqlSegment}") // ${ew.customSqlSegment} 为固定写法
List<User> selectAll(@Param(Constants.WRAPPER) Wrapper wrapper);//@Param(Contants.WRAPPER) 为固定写法
List<Map<String,Object>> selectAlla(@Param(Constants.WRAPPER) Wrapper wrapper);//@Param(Contants.WRAPPER) 为固定写法
IPage<Map<String,Object>> selectMyUserPage(Page<User> page,@Param(Constants.WRAPPER) Wrapper wrapper);
}
| 1,045 | 0.794089 | 0.794089 | 26 | 38.03846 | 35.425415 | 115 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.692308 | false | false |
13
|
aecb83d08098f6c23e4a09f2fedceb604e9dff32
| 996,432,453,011 |
3bfe0c9668ab58076941a05a8a0cfdf4af0ebdca
|
/src/domain/Album.java
|
07a2a690c8ad77030c5f38b463548af601aa737e
|
[] |
no_license
|
wangyao88/Anynote
|
https://github.com/wangyao88/Anynote
|
0bae941ba88bf4e94f375174fc4ca97a972e22c1
|
9780c12926277bf31d4fb07671674993e939f8d4
|
refs/heads/master
| 2021-01-10T01:37:56.153000 | 2016-02-16T09:06:02 | 2016-02-16T09:06:02 | 47,605,024 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package domain;
import java.util.Date;
public class Album extends PageDomain
{
private static final long serialVersionUID = -2664912367950031873L;
private Integer albumId;
private String albumName;
private Integer parentId;
private String isleaf;
private String status;
private String delflag;
private String createUser;
private Date createTime;
private String updateUser;
private Date updateTime;
public Integer getAlbumId()
{
return this.albumId;
}
public void setAlbumId(Integer albumId)
{
this.albumId = albumId;
}
public String getAlbumName()
{
return this.albumName;
}
public void setAlbumName(String albumName)
{
this.albumName = albumName;
}
public Integer getParentId()
{
return this.parentId;
}
public void setParentId(Integer parentId)
{
this.parentId = parentId;
}
public String getIsleaf()
{
return this.isleaf;
}
public void setIsleaf(String isleaf)
{
this.isleaf = isleaf;
}
public String getStatus()
{
return this.status;
}
public void setStatus(String status)
{
this.status = status;
}
public String getDelflag()
{
return this.delflag;
}
public void setDelflag(String delflag)
{
this.delflag = delflag;
}
public String getCreateUser()
{
return this.createUser;
}
public void setCreateUser(String createUser)
{
this.createUser = createUser;
}
public Date getCreateTime()
{
return this.createTime;
}
public void setCreateTime(Date createTime)
{
this.createTime = createTime;
}
public String getUpdateUser()
{
return this.updateUser;
}
public void setUpdateUser(String updateUser)
{
this.updateUser = updateUser;
}
public Date getUpdateTime()
{
return this.updateTime;
}
public void setUpdateTime(Date updateTime)
{
this.updateTime = updateTime;
}
}
|
UTF-8
|
Java
| 1,907 |
java
|
Album.java
|
Java
|
[] | null |
[] |
package domain;
import java.util.Date;
public class Album extends PageDomain
{
private static final long serialVersionUID = -2664912367950031873L;
private Integer albumId;
private String albumName;
private Integer parentId;
private String isleaf;
private String status;
private String delflag;
private String createUser;
private Date createTime;
private String updateUser;
private Date updateTime;
public Integer getAlbumId()
{
return this.albumId;
}
public void setAlbumId(Integer albumId)
{
this.albumId = albumId;
}
public String getAlbumName()
{
return this.albumName;
}
public void setAlbumName(String albumName)
{
this.albumName = albumName;
}
public Integer getParentId()
{
return this.parentId;
}
public void setParentId(Integer parentId)
{
this.parentId = parentId;
}
public String getIsleaf()
{
return this.isleaf;
}
public void setIsleaf(String isleaf)
{
this.isleaf = isleaf;
}
public String getStatus()
{
return this.status;
}
public void setStatus(String status)
{
this.status = status;
}
public String getDelflag()
{
return this.delflag;
}
public void setDelflag(String delflag)
{
this.delflag = delflag;
}
public String getCreateUser()
{
return this.createUser;
}
public void setCreateUser(String createUser)
{
this.createUser = createUser;
}
public Date getCreateTime()
{
return this.createTime;
}
public void setCreateTime(Date createTime)
{
this.createTime = createTime;
}
public String getUpdateUser()
{
return this.updateUser;
}
public void setUpdateUser(String updateUser)
{
this.updateUser = updateUser;
}
public Date getUpdateTime()
{
return this.updateTime;
}
public void setUpdateTime(Date updateTime)
{
this.updateTime = updateTime;
}
}
| 1,907 | 0.68537 | 0.675406 | 118 | 15.169492 | 15.600036 | 69 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.279661 | false | false |
13
|
0e30f80e4e8f62badcdd506b2e0e276ba301756e
| 28,570,122,484,890 |
0ac71f85ba5ebafc56bde2f17395027a82354587
|
/app/src/main/java/skkk/gogogo/com/dakaizhihu/HomeGson/Story.java
|
c13ee3dbe6532521124e6d7a69853ff198bcca45
|
[] |
no_license
|
mhgd3250905/ZhiHuRiBao-GoGoGo
|
https://github.com/mhgd3250905/ZhiHuRiBao-GoGoGo
|
88649f323e1f1c75692c91e4fa0208b46db58c3d
|
335f1e40fd309ec531aa5173790e18e23ef7a6bd
|
refs/heads/master
| 2021-01-16T21:54:05.656000 | 2016-10-23T15:34:12 | 2016-10-23T15:34:12 | 61,642,599 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package skkk.gogogo.com.dakaizhihu.HomeGson;
import java.util.List;
/**
* Created by admin on 2016/6/22.
*/
/*
*
* 描 述:今日推送故事类
* 作 者:ksheng
* 时 间:6-22
*/
public class Story {
public List<String> images;
public int type;
public int id;
public String ga_prefix;
public String title;
public String getGa_prefix() {
return ga_prefix;
}
public void setGa_prefix(String ga_prefix) {
this.ga_prefix = ga_prefix;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public List<String> getImages() {
return images;
}
public void setImages(List<String> images) {
this.images = images;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
}
|
UTF-8
|
Java
| 1,035 |
java
|
Story.java
|
Java
|
[
{
"context": "meGson;\n\nimport java.util.List;\n\n/**\n * Created by admin on 2016/6/22.\n */\n/*\n* \n* 描 述:今日推送故事类\n* 作 者",
"end": 93,
"score": 0.966019332408905,
"start": 88,
"tag": "USERNAME",
"value": "admin"
},
{
"context": "on 2016/6/22.\n */\n/*\n* \n* 描 述:今日推送故事类\n* 作 者:ksheng\n* 时 间:6-22\n*/\npublic class Story {\n public ",
"end": 150,
"score": 0.9997110366821289,
"start": 144,
"tag": "USERNAME",
"value": "ksheng"
}
] | null |
[] |
package skkk.gogogo.com.dakaizhihu.HomeGson;
import java.util.List;
/**
* Created by admin on 2016/6/22.
*/
/*
*
* 描 述:今日推送故事类
* 作 者:ksheng
* 时 间:6-22
*/
public class Story {
public List<String> images;
public int type;
public int id;
public String ga_prefix;
public String title;
public String getGa_prefix() {
return ga_prefix;
}
public void setGa_prefix(String ga_prefix) {
this.ga_prefix = ga_prefix;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public List<String> getImages() {
return images;
}
public void setImages(List<String> images) {
this.images = images;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
}
| 1,035 | 0.564307 | 0.554337 | 60 | 15.716666 | 14.300456 | 48 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.283333 | false | false |
13
|
6fee9dff7248e84fbcc460a31b629c995892c26d
| 18,554,258,727,138 |
60079fddd804529d0667bafe928c0c4c9c738410
|
/PHAS0056/src/module9_depreciated/SolarSystem.java
|
07ec76f5f4d81532a4951ec24e2831a583941f06
|
[] |
no_license
|
DuncanBaird/PHAS0056
|
https://github.com/DuncanBaird/PHAS0056
|
de0a880295d1e38753425ff072ef771842ece344
|
9d84f6002347b8958ba8b60330aee5c1f187023f
|
refs/heads/master
| 2022-12-27T10:29:04.322000 | 2019-01-16T17:17:08 | 2019-01-16T17:17:08 | 300,957,218 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package module9_depreciated;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
public class SolarSystem {
public static void createAndDisplayGUI() {
JFrame frame = new JFrame("Swing Example");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel panel = new SimulationGUI();
frame.add(panel);
frame.pack();
frame.setVisible(true);
}
public void actionPerformed(ActionEvent e) {
}
public static void main(String[] args) {
System.out.println(Toolkit.getDefaultToolkit().getScreenSize());
SwingUtilities.invokeLater(new Runnable() {
public void run() {
createAndDisplayGUI();
}
});
}
}
|
UTF-8
|
Java
| 770 |
java
|
SolarSystem.java
|
Java
|
[] | null |
[] |
package module9_depreciated;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
public class SolarSystem {
public static void createAndDisplayGUI() {
JFrame frame = new JFrame("Swing Example");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel panel = new SimulationGUI();
frame.add(panel);
frame.pack();
frame.setVisible(true);
}
public void actionPerformed(ActionEvent e) {
}
public static void main(String[] args) {
System.out.println(Toolkit.getDefaultToolkit().getScreenSize());
SwingUtilities.invokeLater(new Runnable() {
public void run() {
createAndDisplayGUI();
}
});
}
}
| 770 | 0.7 | 0.698701 | 36 | 19.388889 | 18.963821 | 66 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.361111 | false | false |
13
|
006118177dfecb69ae4b198f5c15452da40f1d3f
| 18,554,258,725,138 |
e6ee19b691c476e27a46c763ea0c2ce8051b8467
|
/KVParent/server/src/main/java/com/ebay/kvstore/server/data/handler/DataServerJoinResponseHandler.java
|
bf8852f62a24b4b79e2a471b9df16d75ddce7f3b
|
[] |
no_license
|
luo122174088/thesis
|
https://github.com/luo122174088/thesis
|
110ad54cca75c1a831277d2bf864fe18698c604c
|
1cbe2426dae11fe0caaa43fc3659ce4a757d646c
|
refs/heads/master
| 2016-08-07T07:10:42.700000 | 2013-06-09T06:31:27 | 2013-06-09T06:31:27 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.ebay.kvstore.server.data.handler;
import org.apache.mina.core.session.IoSession;
import com.ebay.kvstore.protocol.ProtocolCode;
import com.ebay.kvstore.protocol.response.DataServerJoinResponse;
import com.ebay.kvstore.server.data.DataServerContext;
import com.ebay.kvstore.server.data.storage.IStoreEngine;
public class DataServerJoinResponseHandler extends DataServerHandler<DataServerJoinResponse> {
@Override
public void handle(DataServerContext context, DataServerJoinResponse protocol) {
IoSession session = context.getSession();
IStoreEngine engine = context.getEngine();
synchronized (engine) {
if (protocol.getRetCode() == ProtocolCode.Success) {
session.setAttribute("success", true);
session.setAttribute("code", protocol.getRetCode());
}
engine.notifyAll();
}
}
}
|
UTF-8
|
Java
| 820 |
java
|
DataServerJoinResponseHandler.java
|
Java
|
[] | null |
[] |
package com.ebay.kvstore.server.data.handler;
import org.apache.mina.core.session.IoSession;
import com.ebay.kvstore.protocol.ProtocolCode;
import com.ebay.kvstore.protocol.response.DataServerJoinResponse;
import com.ebay.kvstore.server.data.DataServerContext;
import com.ebay.kvstore.server.data.storage.IStoreEngine;
public class DataServerJoinResponseHandler extends DataServerHandler<DataServerJoinResponse> {
@Override
public void handle(DataServerContext context, DataServerJoinResponse protocol) {
IoSession session = context.getSession();
IStoreEngine engine = context.getEngine();
synchronized (engine) {
if (protocol.getRetCode() == ProtocolCode.Success) {
session.setAttribute("success", true);
session.setAttribute("code", protocol.getRetCode());
}
engine.notifyAll();
}
}
}
| 820 | 0.786585 | 0.786585 | 25 | 31.799999 | 28.079885 | 94 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.68 | false | false |
13
|
c2f88d8904c4c19083cee676c2ef1f5a6bd66146
| 20,452,634,313,675 |
65eadfa95bb5b0090a592046ba83e6844684c6a4
|
/src/main/java/com/jivesoftware/sbs/plugins/foo/action/JiveSoyAction.java
|
a9e7b6bc6fbded1ef022ff74ace28725da1d8fc4
|
[] |
no_license
|
GopiGorantala/jive-fu-plugin
|
https://github.com/GopiGorantala/jive-fu-plugin
|
115f97fce53809bb99fce449a94c6631c2dad25b
|
187d2c1ed62a05153b8706a23431fc70642330b9
|
refs/heads/master
| 2020-12-26T04:38:23.630000 | 2013-05-03T20:48:54 | 2013-05-03T20:48:54 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.jivesoftware.sbs.plugins.foo.action;
import java.util.HashMap;
import java.util.Map;
import org.apache.log4j.Logger;
import com.jivesoftware.community.web.soy.SoyModelDriven;
public class JiveSoyAction extends JiveFooActionSupport implements SoyModelDriven {
private static final long serialVersionUID = 5443023657218107479L;
private static final Logger s_log = Logger.getLogger(JiveSoyAction.class);
@Override
public String execute() {
if (s_log.isDebugEnabled()) { s_log.debug("execute called..."); }
return SUCCESS;
} // end execute
@Override
public Object getModel() {
if (s_log.isDebugEnabled()) { s_log.debug("getModel called..."); }
Map<String, Object> params = new HashMap<String, Object>();
params.put("foo","bar");
return params;
} // end getModel
} // end class
|
UTF-8
|
Java
| 832 |
java
|
JiveSoyAction.java
|
Java
|
[] | null |
[] |
package com.jivesoftware.sbs.plugins.foo.action;
import java.util.HashMap;
import java.util.Map;
import org.apache.log4j.Logger;
import com.jivesoftware.community.web.soy.SoyModelDriven;
public class JiveSoyAction extends JiveFooActionSupport implements SoyModelDriven {
private static final long serialVersionUID = 5443023657218107479L;
private static final Logger s_log = Logger.getLogger(JiveSoyAction.class);
@Override
public String execute() {
if (s_log.isDebugEnabled()) { s_log.debug("execute called..."); }
return SUCCESS;
} // end execute
@Override
public Object getModel() {
if (s_log.isDebugEnabled()) { s_log.debug("getModel called..."); }
Map<String, Object> params = new HashMap<String, Object>();
params.put("foo","bar");
return params;
} // end getModel
} // end class
| 832 | 0.722356 | 0.698317 | 28 | 28.75 | 26.268702 | 83 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.035714 | false | false |
13
|
f528212229fbbd51139bd07a9693947f966551c9
| 20,452,634,314,583 |
8e8b84a27d83a037a1dc32ccc4aa2c241ab89f64
|
/app/src/main/java/com/hsh/dongzi/jinshang/model/login/BuyerCompanyBean.java
|
af9d8ce4c19fe3e6d85829f40dd45ecded568c6d
|
[] |
no_license
|
HDSKEJGIT/jingShangMall
|
https://github.com/HDSKEJGIT/jingShangMall
|
8cdbaf747396d8e00e8b06456a83cba65f181809
|
00773da57a99decf4fc36789f744faac24fa3de4
|
refs/heads/master
| 2020-07-06T08:55:30.142000 | 2019-08-26T03:54:22 | 2019-08-26T03:54:22 | 202,963,275 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.hsh.dongzi.jinshang.model.login;
import java.io.Serializable;
/**
* 公司信息bean
*/
public class BuyerCompanyBean implements Serializable {
protected String address;// (string, optional): 详细地址 ,
protected String bankaccount;// (string, optional): 银行帐号 ,
protected String bankname;// (string, optional): 开户银行 ,
protected String city;// (string, optional): 市 ,
protected String citysmall;// (string, optional): 区 ,
protected String companyname;// (string, optional): companyname ,
protected String companyno;// (string, optional): 单位编号 ,
protected String createdate;// (string, optional): 创建时间 ,
protected int id;// (integer, optional),
protected String invoicetype;// (string, optional): 发票类型 ,
protected String legalperson;// (string, optional): 法人代表 ,
protected int memberid;// (integer, optional): ,
protected String methodsettingaccount;// (string, optional): 结算方式 ,
protected String mobile;// (string, optional): 联系手机 ,
protected String postaladdress;// (string, optional): 通讯地址 ,
protected String province;// (string, optional): 省 ,
protected String shortname;// (string, optional): shortname ,
protected String taxregistrationcertificate;// (string, optional): 纳税号 ,
protected String updatedate;// (string, optional): 更新时间 ,
protected String worktelephone;// (string, optional): 单位电话 ,
protected String zipcode;// (string, optional): 邮编
protected String businesslicencenumberphoto;//营业执照
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getBankaccount() {
return bankaccount;
}
public void setBankaccount(String bankaccount) {
this.bankaccount = bankaccount;
}
public String getBankname() {
return bankname;
}
public void setBankname(String bankname) {
this.bankname = bankname;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getCitysmall() {
return citysmall;
}
public void setCitysmall(String citysmall) {
this.citysmall = citysmall;
}
public String getCompanyname() {
return companyname;
}
public void setCompanyname(String companyname) {
this.companyname = companyname;
}
public String getCompanyno() {
return companyno;
}
public void setCompanyno(String companyno) {
this.companyno = companyno;
}
public String getCreatedate() {
return createdate;
}
public void setCreatedate(String createdate) {
this.createdate = createdate;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getInvoicetype() {
return invoicetype;
}
public void setInvoicetype(String invoicetype) {
this.invoicetype = invoicetype;
}
public String getLegalperson() {
return legalperson;
}
public void setLegalperson(String legalperson) {
this.legalperson = legalperson;
}
public int getMemberid() {
return memberid;
}
public void setMemberid(int memberid) {
this.memberid = memberid;
}
public String getMethodsettingaccount() {
return methodsettingaccount;
}
public void setMethodsettingaccount(String methodsettingaccount) {
this.methodsettingaccount = methodsettingaccount;
}
public String getMobile() {
return mobile;
}
public void setMobile(String mobil) {
this.mobile = mobil;
}
public String getPostaladdress() {
return postaladdress;
}
public void setPostaladdress(String postaladdress) {
this.postaladdress = postaladdress;
}
public String getProvince() {
return province;
}
public void setProvince(String province) {
this.province = province;
}
public String getShortname() {
return shortname;
}
public void setShortname(String shortname) {
this.shortname = shortname;
}
public String getTaxregistrationcertificate() {
return taxregistrationcertificate;
}
public void setTaxregistrationcertificate(String taxregistrationcertificate) {
this.taxregistrationcertificate = taxregistrationcertificate;
}
public String getUpdatedate() {
return updatedate;
}
public void setUpdatedate(String updatedate) {
this.updatedate = updatedate;
}
public String getWorktelephone() {
return worktelephone;
}
public void setWorktelephone(String worktelephone) {
this.worktelephone = worktelephone;
}
public String getZipcode() {
return zipcode;
}
public void setZipcode(String zipcode) {
this.zipcode = zipcode;
}
public String getBusinesslicencenumberphoto() {
return businesslicencenumberphoto;
}
public void setBusinesslicencenumberphoto(String businesslicencenumberphoto) {
this.businesslicencenumberphoto = businesslicencenumberphoto;
}
}
|
UTF-8
|
Java
| 5,377 |
java
|
BuyerCompanyBean.java
|
Java
|
[] | null |
[] |
package com.hsh.dongzi.jinshang.model.login;
import java.io.Serializable;
/**
* 公司信息bean
*/
public class BuyerCompanyBean implements Serializable {
protected String address;// (string, optional): 详细地址 ,
protected String bankaccount;// (string, optional): 银行帐号 ,
protected String bankname;// (string, optional): 开户银行 ,
protected String city;// (string, optional): 市 ,
protected String citysmall;// (string, optional): 区 ,
protected String companyname;// (string, optional): companyname ,
protected String companyno;// (string, optional): 单位编号 ,
protected String createdate;// (string, optional): 创建时间 ,
protected int id;// (integer, optional),
protected String invoicetype;// (string, optional): 发票类型 ,
protected String legalperson;// (string, optional): 法人代表 ,
protected int memberid;// (integer, optional): ,
protected String methodsettingaccount;// (string, optional): 结算方式 ,
protected String mobile;// (string, optional): 联系手机 ,
protected String postaladdress;// (string, optional): 通讯地址 ,
protected String province;// (string, optional): 省 ,
protected String shortname;// (string, optional): shortname ,
protected String taxregistrationcertificate;// (string, optional): 纳税号 ,
protected String updatedate;// (string, optional): 更新时间 ,
protected String worktelephone;// (string, optional): 单位电话 ,
protected String zipcode;// (string, optional): 邮编
protected String businesslicencenumberphoto;//营业执照
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getBankaccount() {
return bankaccount;
}
public void setBankaccount(String bankaccount) {
this.bankaccount = bankaccount;
}
public String getBankname() {
return bankname;
}
public void setBankname(String bankname) {
this.bankname = bankname;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getCitysmall() {
return citysmall;
}
public void setCitysmall(String citysmall) {
this.citysmall = citysmall;
}
public String getCompanyname() {
return companyname;
}
public void setCompanyname(String companyname) {
this.companyname = companyname;
}
public String getCompanyno() {
return companyno;
}
public void setCompanyno(String companyno) {
this.companyno = companyno;
}
public String getCreatedate() {
return createdate;
}
public void setCreatedate(String createdate) {
this.createdate = createdate;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getInvoicetype() {
return invoicetype;
}
public void setInvoicetype(String invoicetype) {
this.invoicetype = invoicetype;
}
public String getLegalperson() {
return legalperson;
}
public void setLegalperson(String legalperson) {
this.legalperson = legalperson;
}
public int getMemberid() {
return memberid;
}
public void setMemberid(int memberid) {
this.memberid = memberid;
}
public String getMethodsettingaccount() {
return methodsettingaccount;
}
public void setMethodsettingaccount(String methodsettingaccount) {
this.methodsettingaccount = methodsettingaccount;
}
public String getMobile() {
return mobile;
}
public void setMobile(String mobil) {
this.mobile = mobil;
}
public String getPostaladdress() {
return postaladdress;
}
public void setPostaladdress(String postaladdress) {
this.postaladdress = postaladdress;
}
public String getProvince() {
return province;
}
public void setProvince(String province) {
this.province = province;
}
public String getShortname() {
return shortname;
}
public void setShortname(String shortname) {
this.shortname = shortname;
}
public String getTaxregistrationcertificate() {
return taxregistrationcertificate;
}
public void setTaxregistrationcertificate(String taxregistrationcertificate) {
this.taxregistrationcertificate = taxregistrationcertificate;
}
public String getUpdatedate() {
return updatedate;
}
public void setUpdatedate(String updatedate) {
this.updatedate = updatedate;
}
public String getWorktelephone() {
return worktelephone;
}
public void setWorktelephone(String worktelephone) {
this.worktelephone = worktelephone;
}
public String getZipcode() {
return zipcode;
}
public void setZipcode(String zipcode) {
this.zipcode = zipcode;
}
public String getBusinesslicencenumberphoto() {
return businesslicencenumberphoto;
}
public void setBusinesslicencenumberphoto(String businesslicencenumberphoto) {
this.businesslicencenumberphoto = businesslicencenumberphoto;
}
}
| 5,377 | 0.656316 | 0.656316 | 207 | 24.357489 | 22.763174 | 82 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.52657 | false | false |
13
|
145d574c05915477181da4580480b86f62b91bfc
| 22,411,139,351,571 |
cba3c1c781e2f8481d62cf7eee01654c383c038a
|
/trade-core/src/main/java/com/centaline/trans/common/service/impl/QuickQueryGetSubjectNameServiceImpl.java
|
7f5cdd9e994c05d5917473b13e13898fa6f2acef
|
[] |
no_license
|
zhouhantong/trade-web
|
https://github.com/zhouhantong/trade-web
|
90e5d93e74996271163521405a6fd2d1e92cf794
|
84f09f27dca2e733a2da24485a19c7bddba23c37
|
HEAD
| 2018-12-25T01:07:50.539000 | 2018-10-18T01:27:15 | 2018-10-18T01:27:15 | 110,204,197 | 1 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null |
/**
*
*/
package com.centaline.trans.common.service.impl;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import com.aist.common.quickQuery.service.CustomDictService;
import com.aist.common.quickQuery.utils.QuickQueryJdbcTemplate;
/**
*
* @author
* @date
*/
public class QuickQueryGetSubjectNameServiceImpl implements CustomDictService{
@Autowired
private QuickQueryJdbcTemplate jdbcTemplate;
private String code;
private static String sql = "SELECT SUBJECT_NAME FROM sctrans.T_TS_COM_SUBJECT WHERE SUBJECT_CODE =:subjectCode";
@Override
public List<Map<String, Object>> findDicts(List<Map<String, Object>> keys) {
for (Map<String, Object> key : keys) {
Object subjectCode= key.values().iterator().next();
Map paramMap = new HashMap();
paramMap.put("subjectCode", subjectCode);
String realName1 = "";
if(null != subjectCode && !StringUtils.isBlank((String)subjectCode)){
realName1 = jdbcTemplate.queryForObject(sql, paramMap, String.class);
}
key.put("val", realName1);
}
return keys;
}
@Override
public Boolean getIsBatch() {
return true;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
}
|
UTF-8
|
Java
| 1,364 |
java
|
QuickQueryGetSubjectNameServiceImpl.java
|
Java
|
[] | null |
[] |
/**
*
*/
package com.centaline.trans.common.service.impl;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import com.aist.common.quickQuery.service.CustomDictService;
import com.aist.common.quickQuery.utils.QuickQueryJdbcTemplate;
/**
*
* @author
* @date
*/
public class QuickQueryGetSubjectNameServiceImpl implements CustomDictService{
@Autowired
private QuickQueryJdbcTemplate jdbcTemplate;
private String code;
private static String sql = "SELECT SUBJECT_NAME FROM sctrans.T_TS_COM_SUBJECT WHERE SUBJECT_CODE =:subjectCode";
@Override
public List<Map<String, Object>> findDicts(List<Map<String, Object>> keys) {
for (Map<String, Object> key : keys) {
Object subjectCode= key.values().iterator().next();
Map paramMap = new HashMap();
paramMap.put("subjectCode", subjectCode);
String realName1 = "";
if(null != subjectCode && !StringUtils.isBlank((String)subjectCode)){
realName1 = jdbcTemplate.queryForObject(sql, paramMap, String.class);
}
key.put("val", realName1);
}
return keys;
}
@Override
public Boolean getIsBatch() {
return true;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
}
| 1,364 | 0.719208 | 0.717009 | 63 | 20.650793 | 25.742411 | 114 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.31746 | false | false |
13
|
240667f8fa77f879edbc4b59f5c562baec3592e9
| 2,989,297,274,460 |
8ae002e978a96b2f009cbf4ae7bcc9a3c784c98c
|
/src/VoterList.java
|
b6af1269ce1ef02988f7f50dea8975bd9f54d884
|
[] |
no_license
|
JayaKrishna7057/Lab6Assignment__JayaKrishna
|
https://github.com/JayaKrishna7057/Lab6Assignment__JayaKrishna
|
757598e9097a788fb4d32c7b1cf9594619093b0f
|
15bcaf9f68481f68310db14aaf1c3440187c61b4
|
refs/heads/master
| 2023-01-04T03:25:57.216000 | 2020-11-06T08:09:44 | 2020-11-06T08:09:44 | 310,531,544 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
/**
*
Author : JayaKrishna
Date : 06/11/2020
Desc : VoterList
*
**/
import java.util.*;
public class VoterList { // //created class VoterList
public static void main(String[] args) {
Map<Integer,Integer> voterList=new HashMap<Integer,Integer>(); //object creation for HashMap
voterList.put(101, 44);
voterList.put(102, 12);
voterList.put(103, 30);
voterList.put(104, 22);
List<Integer>voterDetails=votersList(voterList);
System.out.println(voterDetails);
}
private static List<Integer> votersList(Map<Integer, Integer> voterList) { //Method created voterList() with Argument (HashMap)
List<Integer> voterDetails=new ArrayList<>();
for(Map.Entry<Integer, Integer>entry: voterList.entrySet()) { //used for loop
if(entry.getValue()>18) {
voterDetails.add(entry.getKey());
}
}
return voterDetails; //return type List
}
}
|
UTF-8
|
Java
| 937 |
java
|
VoterList.java
|
Java
|
[
{
"context": "/**\n * \n Author : JayaKrishna\n Date : 06/11/2020\n Desc : VoterList\n *",
"end": 32,
"score": 0.9996466636657715,
"start": 21,
"tag": "NAME",
"value": "JayaKrishna"
}
] | null |
[] |
/**
*
Author : JayaKrishna
Date : 06/11/2020
Desc : VoterList
*
**/
import java.util.*;
public class VoterList { // //created class VoterList
public static void main(String[] args) {
Map<Integer,Integer> voterList=new HashMap<Integer,Integer>(); //object creation for HashMap
voterList.put(101, 44);
voterList.put(102, 12);
voterList.put(103, 30);
voterList.put(104, 22);
List<Integer>voterDetails=votersList(voterList);
System.out.println(voterDetails);
}
private static List<Integer> votersList(Map<Integer, Integer> voterList) { //Method created voterList() with Argument (HashMap)
List<Integer> voterDetails=new ArrayList<>();
for(Map.Entry<Integer, Integer>entry: voterList.entrySet()) { //used for loop
if(entry.getValue()>18) {
voterDetails.add(entry.getKey());
}
}
return voterDetails; //return type List
}
}
| 937 | 0.648879 | 0.616862 | 32 | 28.3125 | 32.102802 | 131 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.71875 | false | false |
13
|
41030a65f853a30a40e0bfdd966d120b85285208
| 25,185,688,243,477 |
9eb8a74111434788cbc15d6ca5fc1a72b165dbe0
|
/ec-survey-front/src/main/java/com/ecarinfo/survey/service/impl/CarReportServiceImpl.java
|
3730a53b5407f6178ff629af470d7af8a0762ea9
|
[] |
no_license
|
xiaobbbbbbb/ec-survey
|
https://github.com/xiaobbbbbbb/ec-survey
|
9eb2370209b79d011ec8ddda684d07c92642f770
|
87cf77fd741deff8924436616dfb0141df64f48c
|
refs/heads/master
| 2016-09-06T13:49:14.854000 | 2014-04-22T07:40:51 | 2014-04-22T07:40:51 | 19,019,666 | 1 | 2 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.ecarinfo.survey.service.impl;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service;
import com.ecarinfo.persist.criteria.Criteria;
import com.ecarinfo.persist.criteria.Criteria.CondtionSeparator;
import com.ecarinfo.persist.criteria.Criteria.OrderType;
import com.ecarinfo.persist.paging.ECPage;
import com.ecarinfo.persist.util.RowMapperUtils;
import com.ecarinfo.ralasafe.dto.Constant;
import com.ecarinfo.ralasafe.dto.SystemContext;
import com.ecarinfo.ralasafe.utils.EcUtil;
import com.ecarinfo.ralasafe.utils.PageHelper;
import com.ecarinfo.survey.dao.CarReportDao;
import com.ecarinfo.survey.rm.CarInfoRM;
import com.ecarinfo.survey.rm.CarReportDayRM;
import com.ecarinfo.survey.rm.CarReportRM;
import com.ecarinfo.survey.service.CarReportService;
import com.ecarinfo.survey.view.CarReportToDayView;
import com.ecarinfo.survey.view.CarReportView;
import com.ecarinfo.survey.view.TablePrefix;
@Service("carReportService")
public class CarReportServiceImpl implements CarReportService {
@Resource
private CarReportDao carReportDao;
/**
* 次报
*/
@Override
public ECPage<CarReportView> queryCarReportSecondReportPages(String startTime, String endTime,Integer carId,String month) {
int pagerOffset = SystemContext.getPageOffset();
Criteria whereBy = new Criteria();
whereBy.eq("1", 1);
if (StringUtils.isNotEmpty(startTime)) {
whereBy.greateThenOrEquals(TablePrefix.CarReportFix+ CarReportRM.createTime, startTime + " 00:00:00",CondtionSeparator.AND);
}
if (StringUtils.isNotEmpty(endTime)) {
whereBy.lessThenOrEquals(TablePrefix.CarReportFix + CarReportRM.createTime, endTime + " 23:59:59",CondtionSeparator.AND);
}
if(carId!=null && carId>0){
whereBy.eq(TablePrefix.CarReportFix + CarReportRM.carId, carId,CondtionSeparator.AND);
}
if (StringUtils.isNotEmpty(month)) {
whereBy.like(TablePrefix.CarReportFix + CarReportRM.createTime, "%" +month+ "%",CondtionSeparator.AND);
}
whereBy.eq(TablePrefix.CarInfoFix + CarInfoRM.orgId, EcUtil.getCurrentUser().getOrgId(), CondtionSeparator.AND);
long counts = carReportDao.findCarReportSecondCountByCriteria(whereBy);
whereBy.setPage(pagerOffset, Constant.DEFAULT_SIZE).orderBy(TablePrefix.CarReportFix + CarReportRM.pk,OrderType.ASC);
List<Map<String, Object>> map = carReportDao.findCarReportSecondByCriteria(whereBy);
List<CarReportView> list = RowMapperUtils.map2List(map,CarReportView.class);
ECPage<CarReportView> page = PageHelper.list(counts, list, whereBy);
return page;
}
/**
*导出报表
*/
public List<CarReportView> findCarReportInfoReport(String startTime, String endTime,Integer carId,String month){
Criteria whereBy = new Criteria();
whereBy.eq("1", 1);
if (StringUtils.isNotEmpty(startTime)) {
whereBy.greateThenOrEquals(TablePrefix.CarReportFix+ CarReportRM.createTime, startTime + " 00:00:00",CondtionSeparator.AND);
}
if (StringUtils.isNotEmpty(endTime)) {
whereBy.lessThenOrEquals(TablePrefix.CarReportFix + CarReportRM.createTime, endTime + " 23:59:59",CondtionSeparator.AND);
}
if(carId!=null && carId>0){
whereBy.eq(TablePrefix.CarReportFix + CarReportRM.carId, carId,CondtionSeparator.AND);
}
if (StringUtils.isNotEmpty(month)) {
whereBy.like(TablePrefix.CarReportFix + CarReportRM.createTime, "%" +month+ "%",CondtionSeparator.AND);
}
whereBy.eq(TablePrefix.CarInfoFix + CarInfoRM.orgId, EcUtil.getCurrentUser().getOrgId(), CondtionSeparator.AND);
List<Map<String, Object>> map = carReportDao.findCarReportSecondByCriteria(whereBy);
List<CarReportView> list = RowMapperUtils.map2List(map,CarReportView.class);
return list;
}
/**
* 查询昨天的次报汇总生成日报告
*/
public List<CarReportToDayView> findCarReportToDayByCriteria(String startTime,String endTime){
Criteria whereBy = new Criteria();
whereBy.eq("1", 1);
whereBy.greateThenOrEquals(TablePrefix.CarReportFix + CarReportDayRM.createTime, startTime + " 00:00:00", CondtionSeparator.AND);
whereBy.lessThenOrEquals(TablePrefix.CarReportFix + CarReportDayRM.createTime, endTime + " 23:59:59", CondtionSeparator.AND);
List<Map<String, Object>> map =carReportDao.findCarReportToDayByCriteria(whereBy);
List<CarReportToDayView> list =RowMapperUtils.map2List(map,CarReportToDayView.class);
return list;
}
}
|
UTF-8
|
Java
| 4,516 |
java
|
CarReportServiceImpl.java
|
Java
|
[] | null |
[] |
package com.ecarinfo.survey.service.impl;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service;
import com.ecarinfo.persist.criteria.Criteria;
import com.ecarinfo.persist.criteria.Criteria.CondtionSeparator;
import com.ecarinfo.persist.criteria.Criteria.OrderType;
import com.ecarinfo.persist.paging.ECPage;
import com.ecarinfo.persist.util.RowMapperUtils;
import com.ecarinfo.ralasafe.dto.Constant;
import com.ecarinfo.ralasafe.dto.SystemContext;
import com.ecarinfo.ralasafe.utils.EcUtil;
import com.ecarinfo.ralasafe.utils.PageHelper;
import com.ecarinfo.survey.dao.CarReportDao;
import com.ecarinfo.survey.rm.CarInfoRM;
import com.ecarinfo.survey.rm.CarReportDayRM;
import com.ecarinfo.survey.rm.CarReportRM;
import com.ecarinfo.survey.service.CarReportService;
import com.ecarinfo.survey.view.CarReportToDayView;
import com.ecarinfo.survey.view.CarReportView;
import com.ecarinfo.survey.view.TablePrefix;
@Service("carReportService")
public class CarReportServiceImpl implements CarReportService {
@Resource
private CarReportDao carReportDao;
/**
* 次报
*/
@Override
public ECPage<CarReportView> queryCarReportSecondReportPages(String startTime, String endTime,Integer carId,String month) {
int pagerOffset = SystemContext.getPageOffset();
Criteria whereBy = new Criteria();
whereBy.eq("1", 1);
if (StringUtils.isNotEmpty(startTime)) {
whereBy.greateThenOrEquals(TablePrefix.CarReportFix+ CarReportRM.createTime, startTime + " 00:00:00",CondtionSeparator.AND);
}
if (StringUtils.isNotEmpty(endTime)) {
whereBy.lessThenOrEquals(TablePrefix.CarReportFix + CarReportRM.createTime, endTime + " 23:59:59",CondtionSeparator.AND);
}
if(carId!=null && carId>0){
whereBy.eq(TablePrefix.CarReportFix + CarReportRM.carId, carId,CondtionSeparator.AND);
}
if (StringUtils.isNotEmpty(month)) {
whereBy.like(TablePrefix.CarReportFix + CarReportRM.createTime, "%" +month+ "%",CondtionSeparator.AND);
}
whereBy.eq(TablePrefix.CarInfoFix + CarInfoRM.orgId, EcUtil.getCurrentUser().getOrgId(), CondtionSeparator.AND);
long counts = carReportDao.findCarReportSecondCountByCriteria(whereBy);
whereBy.setPage(pagerOffset, Constant.DEFAULT_SIZE).orderBy(TablePrefix.CarReportFix + CarReportRM.pk,OrderType.ASC);
List<Map<String, Object>> map = carReportDao.findCarReportSecondByCriteria(whereBy);
List<CarReportView> list = RowMapperUtils.map2List(map,CarReportView.class);
ECPage<CarReportView> page = PageHelper.list(counts, list, whereBy);
return page;
}
/**
*导出报表
*/
public List<CarReportView> findCarReportInfoReport(String startTime, String endTime,Integer carId,String month){
Criteria whereBy = new Criteria();
whereBy.eq("1", 1);
if (StringUtils.isNotEmpty(startTime)) {
whereBy.greateThenOrEquals(TablePrefix.CarReportFix+ CarReportRM.createTime, startTime + " 00:00:00",CondtionSeparator.AND);
}
if (StringUtils.isNotEmpty(endTime)) {
whereBy.lessThenOrEquals(TablePrefix.CarReportFix + CarReportRM.createTime, endTime + " 23:59:59",CondtionSeparator.AND);
}
if(carId!=null && carId>0){
whereBy.eq(TablePrefix.CarReportFix + CarReportRM.carId, carId,CondtionSeparator.AND);
}
if (StringUtils.isNotEmpty(month)) {
whereBy.like(TablePrefix.CarReportFix + CarReportRM.createTime, "%" +month+ "%",CondtionSeparator.AND);
}
whereBy.eq(TablePrefix.CarInfoFix + CarInfoRM.orgId, EcUtil.getCurrentUser().getOrgId(), CondtionSeparator.AND);
List<Map<String, Object>> map = carReportDao.findCarReportSecondByCriteria(whereBy);
List<CarReportView> list = RowMapperUtils.map2List(map,CarReportView.class);
return list;
}
/**
* 查询昨天的次报汇总生成日报告
*/
public List<CarReportToDayView> findCarReportToDayByCriteria(String startTime,String endTime){
Criteria whereBy = new Criteria();
whereBy.eq("1", 1);
whereBy.greateThenOrEquals(TablePrefix.CarReportFix + CarReportDayRM.createTime, startTime + " 00:00:00", CondtionSeparator.AND);
whereBy.lessThenOrEquals(TablePrefix.CarReportFix + CarReportDayRM.createTime, endTime + " 23:59:59", CondtionSeparator.AND);
List<Map<String, Object>> map =carReportDao.findCarReportToDayByCriteria(whereBy);
List<CarReportToDayView> list =RowMapperUtils.map2List(map,CarReportToDayView.class);
return list;
}
}
| 4,516 | 0.767426 | 0.756926 | 99 | 43.121212 | 39.137745 | 131 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.232323 | false | false |
13
|
e53219d421f9091f7096aff94f50a79649d41437
| 12,876,311,957,652 |
9179fffbb50eeb894a4b1eb34a053eee5827d04b
|
/StickManWars/src/stickmanwars/AudioPlayer.java
|
3be39b23a6f7f9699f8cda5da67fda9d34e386a2
|
[] |
no_license
|
madnesso/StickMan
|
https://github.com/madnesso/StickMan
|
184c46fbce29c778d4ffdaf9a6068da98cd5d69f
|
df6d6bae6fecaeb5e9d7b5ea664dbf566af9c5af
|
refs/heads/master
| 2020-05-26T17:16:57.241000 | 2019-05-25T10:20:38 | 2019-05-25T10:20:38 | 188,315,954 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package stickmanwars;
import org.newdawn.slick.Music;
import org.newdawn.slick.SlickException;
import org.newdawn.slick.Sound;
import java.util.HashMap;
import java.util.Map;
public class AudioPlayer {
public static Map<String, Sound> soundMap = new HashMap<String, Sound>();
public static Map<String, Music> musicMap = new HashMap<String, Music>();
public static void load() {
try {
soundMap.put("dead", new Sound("sounds/dead.ogg"));
soundMap.put("jump", new Sound("sounds/jump.ogg"));
soundMap.put("pickup", new Sound("sounds/pickup.ogg"));
soundMap.put("shoot", new Sound("sounds/shoot.ogg"));
musicMap.put("background", new Music("sounds/background.ogg"));
} catch (SlickException e) {
e.printStackTrace();
}
}
public static Sound getSoundMap(String key) {
return soundMap.get(key);
}
public static Music getMusicMap(String key) {
return musicMap.get(key);
}
}
|
UTF-8
|
Java
| 1,015 |
java
|
AudioPlayer.java
|
Java
|
[] | null |
[] |
package stickmanwars;
import org.newdawn.slick.Music;
import org.newdawn.slick.SlickException;
import org.newdawn.slick.Sound;
import java.util.HashMap;
import java.util.Map;
public class AudioPlayer {
public static Map<String, Sound> soundMap = new HashMap<String, Sound>();
public static Map<String, Music> musicMap = new HashMap<String, Music>();
public static void load() {
try {
soundMap.put("dead", new Sound("sounds/dead.ogg"));
soundMap.put("jump", new Sound("sounds/jump.ogg"));
soundMap.put("pickup", new Sound("sounds/pickup.ogg"));
soundMap.put("shoot", new Sound("sounds/shoot.ogg"));
musicMap.put("background", new Music("sounds/background.ogg"));
} catch (SlickException e) {
e.printStackTrace();
}
}
public static Sound getSoundMap(String key) {
return soundMap.get(key);
}
public static Music getMusicMap(String key) {
return musicMap.get(key);
}
}
| 1,015 | 0.637438 | 0.637438 | 33 | 29.787878 | 25.313498 | 77 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.757576 | false | false |
13
|
575d829a8928c5d7397b562162e949b72e8bfc60
| 2,001,454,797,704 |
f4cbf0f4ad6027746255dfd8081e41a432691093
|
/app/src/main/java/com/neurondigital/selfcare/Measurements.java
|
ef0b935661691bc8a27ce5468b84a236825ed2a4
|
[] |
no_license
|
hongthang152/SelfCareManagement
|
https://github.com/hongthang152/SelfCareManagement
|
6cb63ae70b796e603ca77d2c17ae367d05a59a0a
|
92cbba3f4863904d97afcdeee132067cba7d4376
|
refs/heads/master
| 2023-04-03T10:01:46.896000 | 2021-04-11T19:03:06 | 2021-04-11T19:03:06 | 332,115,211 | 0 | 0 | null | false | 2021-04-11T19:03:07 | 2021-01-23T03:03:16 | 2021-04-11T15:29:17 | 2021-04-11T19:03:06 | 1,483 | 0 | 0 | 0 |
Java
| false | false |
package com.neurondigital.selfcare;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import android.content.DialogInterface;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.SimpleAdapter;
import android.widget.Toast;
import com.neurondigital.selfcare.treatment.manuallymphdrainagemassage.MLDModel;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.HashMap;
public class Measurements extends AppCompatActivity {
MeasureDatabase db = new MeasureDatabase(Measurements.this);
private ListView listView;
ArrayList<MLDModel> userList1 = new ArrayList<>();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_measurements);
Button yes = findViewById(R.id.yes);
MeasureDatabase db = new MeasureDatabase(this);
loadDataFromDatabase(); //get any previously saved Contact objects
ListView lv = findViewById(R.id.measurement_list);
ArrayList<HashMap<String, String>> measurelist = db.getAll();
final SimpleAdapter adapter = new SimpleAdapter(Measurements.this, measurelist, R.layout.measurelist, new String[]{"type"}, new int[]{R.id.Date});
lv.setAdapter(adapter);
yes.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View btn) {
AlertDialog alertDialog = new AlertDialog.Builder( Measurements.this)
//set icon
.setIcon(android.R.drawable.ic_dialog_alert)
//set title
.setTitle("Are you sure?")
//set message
.setMessage("")
//set positive button
.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
//set what would happen when positive button is clicked
// finish();
MeasureDatabase db = new MeasureDatabase(Measurements.this);
String date = new SimpleDateFormat("dd-MM-yyyy").format(Calendar.getInstance().getTime());
db.addmodel(new MeasureClass(date));
loadDataFromDatabase();
}
})
//set negative button
.setNegativeButton("No", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
//set what should happen when negative button is clicked
Toast.makeText(getApplicationContext(),"",Toast.LENGTH_LONG).show();
}
})
.show();
}
});
}
public void loadDataFromDatabase() {
MeasureDatabase db = new MeasureDatabase(this);
ArrayList<HashMap<String, String>> userList = db.getAll();
ListView lv = findViewById(R.id.measurement_list);
ListAdapter adapter = new SimpleAdapter(Measurements.this, userList, R.layout.measurelist, new String[]{"startTime"}, new int[]{R.id.Date});
lv.setAdapter(adapter);
}
}
|
UTF-8
|
Java
| 3,618 |
java
|
Measurements.java
|
Java
|
[] | null |
[] |
package com.neurondigital.selfcare;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import android.content.DialogInterface;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.SimpleAdapter;
import android.widget.Toast;
import com.neurondigital.selfcare.treatment.manuallymphdrainagemassage.MLDModel;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.HashMap;
public class Measurements extends AppCompatActivity {
MeasureDatabase db = new MeasureDatabase(Measurements.this);
private ListView listView;
ArrayList<MLDModel> userList1 = new ArrayList<>();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_measurements);
Button yes = findViewById(R.id.yes);
MeasureDatabase db = new MeasureDatabase(this);
loadDataFromDatabase(); //get any previously saved Contact objects
ListView lv = findViewById(R.id.measurement_list);
ArrayList<HashMap<String, String>> measurelist = db.getAll();
final SimpleAdapter adapter = new SimpleAdapter(Measurements.this, measurelist, R.layout.measurelist, new String[]{"type"}, new int[]{R.id.Date});
lv.setAdapter(adapter);
yes.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View btn) {
AlertDialog alertDialog = new AlertDialog.Builder( Measurements.this)
//set icon
.setIcon(android.R.drawable.ic_dialog_alert)
//set title
.setTitle("Are you sure?")
//set message
.setMessage("")
//set positive button
.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
//set what would happen when positive button is clicked
// finish();
MeasureDatabase db = new MeasureDatabase(Measurements.this);
String date = new SimpleDateFormat("dd-MM-yyyy").format(Calendar.getInstance().getTime());
db.addmodel(new MeasureClass(date));
loadDataFromDatabase();
}
})
//set negative button
.setNegativeButton("No", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
//set what should happen when negative button is clicked
Toast.makeText(getApplicationContext(),"",Toast.LENGTH_LONG).show();
}
})
.show();
}
});
}
public void loadDataFromDatabase() {
MeasureDatabase db = new MeasureDatabase(this);
ArrayList<HashMap<String, String>> userList = db.getAll();
ListView lv = findViewById(R.id.measurement_list);
ListAdapter adapter = new SimpleAdapter(Measurements.this, userList, R.layout.measurelist, new String[]{"startTime"}, new int[]{R.id.Date});
lv.setAdapter(adapter);
}
}
| 3,618 | 0.608071 | 0.607794 | 101 | 34.831684 | 34.079426 | 154 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.564356 | false | false |
13
|
3b4a666f57ea9866bdc72d56d1959627c9a2586b
| 22,917,945,529,086 |
2fe6ac9ed83ba68df98e7db311111d0f09925c31
|
/app/src/main/java/com/workable/movierama/adapters/PageAdapter.java
|
f60c055bdd6d53f67c6771aba33dd36b83185944
|
[
"Apache-2.0"
] |
permissive
|
milouk/MovieRama
|
https://github.com/milouk/MovieRama
|
7f0b0653697509214534e7bb42e585e2045545b2
|
e5fdbc194da4eb1d6caddf39559609fca7b6df24
|
refs/heads/master
| 2020-05-31T08:05:05.539000 | 2019-10-17T19:31:25 | 2019-10-17T19:31:25 | 190,179,537 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.workable.movierama.adapters;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;
import com.workable.movierama.fragments.MovieFragment;
import com.workable.movierama.fragments.TvShowFragment;
public class PageAdapter extends FragmentPagerAdapter {
private int numOfTabs;
public PageAdapter(@NonNull FragmentManager fm, int behavior) {
super(fm, behavior);
this.numOfTabs = behavior;
}
@NonNull
@Override
public Fragment getItem(int position) {
switch (position) {
case 0:
return new MovieFragment();
case 1:
return new TvShowFragment();
default:
final Fragment o = null;
return o;
}
}
@Override
public int getCount() {
return numOfTabs;
}
}
|
UTF-8
|
Java
| 960 |
java
|
PageAdapter.java
|
Java
|
[] | null |
[] |
package com.workable.movierama.adapters;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;
import com.workable.movierama.fragments.MovieFragment;
import com.workable.movierama.fragments.TvShowFragment;
public class PageAdapter extends FragmentPagerAdapter {
private int numOfTabs;
public PageAdapter(@NonNull FragmentManager fm, int behavior) {
super(fm, behavior);
this.numOfTabs = behavior;
}
@NonNull
@Override
public Fragment getItem(int position) {
switch (position) {
case 0:
return new MovieFragment();
case 1:
return new TvShowFragment();
default:
final Fragment o = null;
return o;
}
}
@Override
public int getCount() {
return numOfTabs;
}
}
| 960 | 0.651042 | 0.648958 | 38 | 24.263159 | 19.329123 | 67 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.447368 | false | false |
13
|
9b8e95bbc62a2d89b9188be9ee37b1366ea863cf
| 970,662,621,948 |
99df33221344f41165ea255f589a7be2b4af51fe
|
/API/src/main/java/com/multimif/util/DataException.java
|
8a7a94cf7c88c2324d04b25134d680d1af4e4e86
|
[] |
no_license
|
hadjiszs/OnlineGitIDE
|
https://github.com/hadjiszs/OnlineGitIDE
|
5257a73914050fdcc490b30e91974dd12abe6f95
|
a95758d7cdd6aca0f6564c416f800d14dd6764c1
|
refs/heads/master
| 2020-06-11T01:13:43.709000 | 2018-11-19T23:06:20 | 2018-11-19T23:06:20 | 75,824,848 | 2 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.multimif.util;
/**
*
* Cette exception a été définiée pour récupérer les exceptions qui sont propres de
* la logique de notre application.
*
* @author Amaia Nazábal
* @version 1.0
* @since 1.0 10/21/16.
*/
public class DataException extends Exception {
public DataException(String exception){
super(exception);
}
}
|
UTF-8
|
Java
| 360 |
java
|
DataException.java
|
Java
|
[
{
"context": "\n * la logique de notre application.\n *\n * @author Amaia Nazábal\n * @version 1.0\n * @since 1.0 10/21/16.\n */\npubli",
"end": 182,
"score": 0.9998728632926941,
"start": 169,
"tag": "NAME",
"value": "Amaia Nazábal"
}
] | null |
[] |
package com.multimif.util;
/**
*
* Cette exception a été définiée pour récupérer les exceptions qui sont propres de
* la logique de notre application.
*
* @author <NAME>
* @version 1.0
* @since 1.0 10/21/16.
*/
public class DataException extends Exception {
public DataException(String exception){
super(exception);
}
}
| 352 | 0.694051 | 0.665722 | 17 | 19.764706 | 21.856564 | 83 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.117647 | false | false |
13
|
1ae8c6dbab4fef4de49a00f8658536dcc63539ce
| 5,574,867,602,037 |
76ea241c0f0c95e2c14c838feb4ed9de1d93a2e9
|
/src/main/java/cloud/web/rest/BookReturnResource.java
|
2e1c700ed97707f33de21c75eabf27dd737fdfe5
|
[] |
no_license
|
zshuvo26/cloud
|
https://github.com/zshuvo26/cloud
|
156685eb182417c93083496348353ddf4f7d4ca1
|
809bcc68fad6d6a0caf35632ea25bddb464f6fd8
|
refs/heads/master
| 2021-06-28T13:39:53.570000 | 2018-06-30T17:13:54 | 2018-06-30T17:13:54 | 135,336,242 | 0 | 0 | null | false | 2020-09-18T14:40:23 | 2018-05-29T18:19:59 | 2018-06-30T17:24:23 | 2018-06-30T17:24:20 | 4,420 | 0 | 1 | 1 |
Java
| false | false |
package cloud.web.rest;
import com.codahale.metrics.annotation.Timed;
import cloud.service.BookReturnService;
import cloud.web.rest.errors.BadRequestAlertException;
import cloud.web.rest.util.HeaderUtil;
import cloud.web.rest.util.PaginationUtil;
import cloud.service.dto.BookReturnDTO;
import io.github.jhipster.web.util.ResponseUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.List;
import java.util.Optional;
/**
* REST controller for managing BookReturn.
*/
@RestController
@RequestMapping("/api")
public class BookReturnResource {
private final Logger log = LoggerFactory.getLogger(BookReturnResource.class);
private static final String ENTITY_NAME = "bookReturn";
private final BookReturnService bookReturnService;
public BookReturnResource(BookReturnService bookReturnService) {
this.bookReturnService = bookReturnService;
}
/**
* POST /book-returns : Create a new bookReturn.
*
* @param bookReturnDTO the bookReturnDTO to create
* @return the ResponseEntity with status 201 (Created) and with body the new bookReturnDTO, or with status 400 (Bad Request) if the bookReturn has already an ID
* @throws URISyntaxException if the Location URI syntax is incorrect
*/
@PostMapping("/book-returns")
@Timed
public ResponseEntity<BookReturnDTO> createBookReturn(@RequestBody BookReturnDTO bookReturnDTO) throws URISyntaxException {
log.debug("REST request to save BookReturn : {}", bookReturnDTO);
if (bookReturnDTO.getId() != null) {
throw new BadRequestAlertException("A new bookReturn cannot already have an ID", ENTITY_NAME, "idexists");
}
BookReturnDTO result = bookReturnService.save(bookReturnDTO);
return ResponseEntity.created(new URI("/api/book-returns/" + result.getId()))
.headers(HeaderUtil.createEntityCreationAlert(ENTITY_NAME, result.getId().toString()))
.body(result);
}
/**
* PUT /book-returns : Updates an existing bookReturn.
*
* @param bookReturnDTO the bookReturnDTO to update
* @return the ResponseEntity with status 200 (OK) and with body the updated bookReturnDTO,
* or with status 400 (Bad Request) if the bookReturnDTO is not valid,
* or with status 500 (Internal Server Error) if the bookReturnDTO couldn't be updated
* @throws URISyntaxException if the Location URI syntax is incorrect
*/
@PutMapping("/book-returns")
@Timed
public ResponseEntity<BookReturnDTO> updateBookReturn(@RequestBody BookReturnDTO bookReturnDTO) throws URISyntaxException {
log.debug("REST request to update BookReturn : {}", bookReturnDTO);
if (bookReturnDTO.getId() == null) {
return createBookReturn(bookReturnDTO);
}
BookReturnDTO result = bookReturnService.save(bookReturnDTO);
return ResponseEntity.ok()
.headers(HeaderUtil.createEntityUpdateAlert(ENTITY_NAME, bookReturnDTO.getId().toString()))
.body(result);
}
/**
* GET /book-returns : get all the bookReturns.
*
* @param pageable the pagination information
* @return the ResponseEntity with status 200 (OK) and the list of bookReturns in body
*/
@GetMapping("/book-returns")
@Timed
public ResponseEntity<List<BookReturnDTO>> getAllBookReturns(Pageable pageable) {
log.debug("REST request to get a page of BookReturns");
Page<BookReturnDTO> page = bookReturnService.findAll(pageable);
HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(page, "/api/book-returns");
return new ResponseEntity<>(page.getContent(), headers, HttpStatus.OK);
}
/**
* GET /book-returns/:id : get the "id" bookReturn.
*
* @param id the id of the bookReturnDTO to retrieve
* @return the ResponseEntity with status 200 (OK) and with body the bookReturnDTO, or with status 404 (Not Found)
*/
@GetMapping("/book-returns/{id}")
@Timed
public ResponseEntity<BookReturnDTO> getBookReturn(@PathVariable Long id) {
log.debug("REST request to get BookReturn : {}", id);
BookReturnDTO bookReturnDTO = bookReturnService.findOne(id);
return ResponseUtil.wrapOrNotFound(Optional.ofNullable(bookReturnDTO));
}
/**
* DELETE /book-returns/:id : delete the "id" bookReturn.
*
* @param id the id of the bookReturnDTO to delete
* @return the ResponseEntity with status 200 (OK)
*/
@DeleteMapping("/book-returns/{id}")
@Timed
public ResponseEntity<Void> deleteBookReturn(@PathVariable Long id) {
log.debug("REST request to delete BookReturn : {}", id);
bookReturnService.delete(id);
return ResponseEntity.ok().headers(HeaderUtil.createEntityDeletionAlert(ENTITY_NAME, id.toString())).build();
}
}
|
UTF-8
|
Java
| 5,223 |
java
|
BookReturnResource.java
|
Java
|
[
{
"context": "cloud.service.dto.BookReturnDTO;\nimport io.github.jhipster.web.util.ResponseUtil;\nimport org.slf4j.Logger;\ni",
"end": 313,
"score": 0.9804673194885254,
"start": 305,
"tag": "USERNAME",
"value": "jhipster"
}
] | null |
[] |
package cloud.web.rest;
import com.codahale.metrics.annotation.Timed;
import cloud.service.BookReturnService;
import cloud.web.rest.errors.BadRequestAlertException;
import cloud.web.rest.util.HeaderUtil;
import cloud.web.rest.util.PaginationUtil;
import cloud.service.dto.BookReturnDTO;
import io.github.jhipster.web.util.ResponseUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.List;
import java.util.Optional;
/**
* REST controller for managing BookReturn.
*/
@RestController
@RequestMapping("/api")
public class BookReturnResource {
private final Logger log = LoggerFactory.getLogger(BookReturnResource.class);
private static final String ENTITY_NAME = "bookReturn";
private final BookReturnService bookReturnService;
public BookReturnResource(BookReturnService bookReturnService) {
this.bookReturnService = bookReturnService;
}
/**
* POST /book-returns : Create a new bookReturn.
*
* @param bookReturnDTO the bookReturnDTO to create
* @return the ResponseEntity with status 201 (Created) and with body the new bookReturnDTO, or with status 400 (Bad Request) if the bookReturn has already an ID
* @throws URISyntaxException if the Location URI syntax is incorrect
*/
@PostMapping("/book-returns")
@Timed
public ResponseEntity<BookReturnDTO> createBookReturn(@RequestBody BookReturnDTO bookReturnDTO) throws URISyntaxException {
log.debug("REST request to save BookReturn : {}", bookReturnDTO);
if (bookReturnDTO.getId() != null) {
throw new BadRequestAlertException("A new bookReturn cannot already have an ID", ENTITY_NAME, "idexists");
}
BookReturnDTO result = bookReturnService.save(bookReturnDTO);
return ResponseEntity.created(new URI("/api/book-returns/" + result.getId()))
.headers(HeaderUtil.createEntityCreationAlert(ENTITY_NAME, result.getId().toString()))
.body(result);
}
/**
* PUT /book-returns : Updates an existing bookReturn.
*
* @param bookReturnDTO the bookReturnDTO to update
* @return the ResponseEntity with status 200 (OK) and with body the updated bookReturnDTO,
* or with status 400 (Bad Request) if the bookReturnDTO is not valid,
* or with status 500 (Internal Server Error) if the bookReturnDTO couldn't be updated
* @throws URISyntaxException if the Location URI syntax is incorrect
*/
@PutMapping("/book-returns")
@Timed
public ResponseEntity<BookReturnDTO> updateBookReturn(@RequestBody BookReturnDTO bookReturnDTO) throws URISyntaxException {
log.debug("REST request to update BookReturn : {}", bookReturnDTO);
if (bookReturnDTO.getId() == null) {
return createBookReturn(bookReturnDTO);
}
BookReturnDTO result = bookReturnService.save(bookReturnDTO);
return ResponseEntity.ok()
.headers(HeaderUtil.createEntityUpdateAlert(ENTITY_NAME, bookReturnDTO.getId().toString()))
.body(result);
}
/**
* GET /book-returns : get all the bookReturns.
*
* @param pageable the pagination information
* @return the ResponseEntity with status 200 (OK) and the list of bookReturns in body
*/
@GetMapping("/book-returns")
@Timed
public ResponseEntity<List<BookReturnDTO>> getAllBookReturns(Pageable pageable) {
log.debug("REST request to get a page of BookReturns");
Page<BookReturnDTO> page = bookReturnService.findAll(pageable);
HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(page, "/api/book-returns");
return new ResponseEntity<>(page.getContent(), headers, HttpStatus.OK);
}
/**
* GET /book-returns/:id : get the "id" bookReturn.
*
* @param id the id of the bookReturnDTO to retrieve
* @return the ResponseEntity with status 200 (OK) and with body the bookReturnDTO, or with status 404 (Not Found)
*/
@GetMapping("/book-returns/{id}")
@Timed
public ResponseEntity<BookReturnDTO> getBookReturn(@PathVariable Long id) {
log.debug("REST request to get BookReturn : {}", id);
BookReturnDTO bookReturnDTO = bookReturnService.findOne(id);
return ResponseUtil.wrapOrNotFound(Optional.ofNullable(bookReturnDTO));
}
/**
* DELETE /book-returns/:id : delete the "id" bookReturn.
*
* @param id the id of the bookReturnDTO to delete
* @return the ResponseEntity with status 200 (OK)
*/
@DeleteMapping("/book-returns/{id}")
@Timed
public ResponseEntity<Void> deleteBookReturn(@PathVariable Long id) {
log.debug("REST request to delete BookReturn : {}", id);
bookReturnService.delete(id);
return ResponseEntity.ok().headers(HeaderUtil.createEntityDeletionAlert(ENTITY_NAME, id.toString())).build();
}
}
| 5,223 | 0.711851 | 0.706299 | 126 | 40.452381 | 34.897266 | 165 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.460317 | false | false |
13
|
0209adfcf7ccc8824fddcf7f8099cb3a446b1eab
| 30,090,540,911,714 |
e34659bdc5388ba3f17539006f73ca06aad5cf4f
|
/modules/vue-portlet-1/src/main/java/com/dnebinger/vue/portlet/PortletKeys.java
|
b1cd107a5315f6774b2e4c549c4e3f92fc799222
|
[] |
no_license
|
dnebing/liferay-vuejs
|
https://github.com/dnebing/liferay-vuejs
|
164aa0270fa08c44db6917d102575f79c134cfe3
|
8b3efcbc287f1ef137ab2a96bf1e738c91643b7c
|
refs/heads/master
| 2020-12-03T09:22:38.133000 | 2017-07-10T23:31:54 | 2017-07-10T23:31:54 | 95,618,304 | 4 | 3 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.dnebinger.vue.portlet;
/**
* Created by dnebinger on 6/27/17.
*/
public class PortletKeys {
public static final String KEY = "com_dnebinger_vue_portlet_1";
}
|
UTF-8
|
Java
| 175 |
java
|
PortletKeys.java
|
Java
|
[
{
"context": "kage com.dnebinger.vue.portlet;\n\n/**\n * Created by dnebinger on 6/27/17.\n */\npublic class PortletKeys {\n\n\tpubl",
"end": 63,
"score": 0.9994921684265137,
"start": 54,
"tag": "USERNAME",
"value": "dnebinger"
},
{
"context": "PortletKeys {\n\n\tpublic static final String KEY = \"com_dnebinger_vue_portlet_1\";\n}\n",
"end": 170,
"score": 0.9989302158355713,
"start": 143,
"tag": "KEY",
"value": "com_dnebinger_vue_portlet_1"
}
] | null |
[] |
package com.dnebinger.vue.portlet;
/**
* Created by dnebinger on 6/27/17.
*/
public class PortletKeys {
public static final String KEY = "com_dnebinger_vue_portlet_1";
}
| 175 | 0.714286 | 0.68 | 9 | 18.444445 | 21.370338 | 64 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.333333 | false | false |
13
|
e87b511b2a2e2cb0477bc2e24817971f4e2977aa
| 27,041,114,108,276 |
b5783da791a27e313d2fbca53adb467682e8f654
|
/src/main/java/com/je/jsboot/services/rentals/RentalServiceImpl.java
|
38276bad638cc238d02213668d2374f808079465
|
[] |
no_license
|
masanchezr/jewelry
|
https://github.com/masanchezr/jewelry
|
d7fbceb83c7c99654d9ba8e42bcbab0c5f30ff31
|
39d95a0eb94a72f1b5f8a6a50e1b1e20ae42abfb
|
refs/heads/master
| 2023-08-17T01:11:05.418000 | 2023-08-08T08:46:35 | 2023-08-08T08:46:35 | 99,904,774 | 0 | 0 | null | false | 2023-02-22T08:10:01 | 2017-08-10T09:17:00 | 2022-01-06T17:49:16 | 2023-02-22T08:10:00 | 61,359 | 0 | 0 | 1 |
Java
| false | false |
package com.je.jsboot.services.rentals;
import java.util.Calendar;
import java.util.Date;
import org.modelmapper.ModelMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.je.jsboot.dbaccess.entities.PlaceEntity;
import com.je.jsboot.dbaccess.entities.RentalEntity;
import com.je.jsboot.dbaccess.repositories.PlaceUserRepository;
import com.je.jsboot.dbaccess.repositories.RentalsRepository;
import com.je.jsboot.dbaccess.repositories.UsersRepository;
import com.je.jsboot.services.dailies.Daily;
import com.je.jsboot.services.dailies.DailyService;
import com.je.jsboot.utils.date.DateUtil;
@Service
public class RentalServiceImpl implements RentalService {
/** The daily service. */
@Autowired
private DailyService dailyService;
@Autowired
private RentalsRepository rentalsRepository;
@Autowired
private PlaceUserRepository placeUserRepository;
@Autowired
private UsersRepository usersRepository;
@Autowired
private ModelMapper mapper;
@Override
public Daily saveRental(Rental rental) {
Date date = DateUtil.getDate(rental.getRentaldate());
PlaceEntity place = placeUserRepository.findByUser(usersRepository.findByUsername(rental.getUser())).get(0)
.getPlace();
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
String id = String.valueOf(calendar.get(Calendar.YEAR)).concat(String.valueOf(calendar.get(Calendar.MONTH) + 1))
.concat(String.valueOf(place.getIdplace()));
RentalEntity entity = new RentalEntity();
entity.setCreationdate(new Date());
entity.setIdrental(Long.valueOf(id));
entity.setPlace(place);
mapper.map(rental, entity);
rentalsRepository.save(entity);
return dailyService.getDaily(DateUtil.getDateFormated(new Date()), place, null);
}
@Override
public boolean existsLocalRental(Rental rental) {
Date date = DateUtil.getDate(rental.getRentaldate());
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
String id = String.valueOf(calendar.get(Calendar.YEAR)).concat(String.valueOf(calendar.get(Calendar.MONTH) + 1))
.concat(String.valueOf(placeUserRepository.findByUser(usersRepository.findByUsername(rental.getUser()))
.get(0).getPlace().getIdplace()));
return rentalsRepository.existsById(Long.valueOf(id));
}
}
|
UTF-8
|
Java
| 2,388 |
java
|
RentalServiceImpl.java
|
Java
|
[] | null |
[] |
package com.je.jsboot.services.rentals;
import java.util.Calendar;
import java.util.Date;
import org.modelmapper.ModelMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.je.jsboot.dbaccess.entities.PlaceEntity;
import com.je.jsboot.dbaccess.entities.RentalEntity;
import com.je.jsboot.dbaccess.repositories.PlaceUserRepository;
import com.je.jsboot.dbaccess.repositories.RentalsRepository;
import com.je.jsboot.dbaccess.repositories.UsersRepository;
import com.je.jsboot.services.dailies.Daily;
import com.je.jsboot.services.dailies.DailyService;
import com.je.jsboot.utils.date.DateUtil;
@Service
public class RentalServiceImpl implements RentalService {
/** The daily service. */
@Autowired
private DailyService dailyService;
@Autowired
private RentalsRepository rentalsRepository;
@Autowired
private PlaceUserRepository placeUserRepository;
@Autowired
private UsersRepository usersRepository;
@Autowired
private ModelMapper mapper;
@Override
public Daily saveRental(Rental rental) {
Date date = DateUtil.getDate(rental.getRentaldate());
PlaceEntity place = placeUserRepository.findByUser(usersRepository.findByUsername(rental.getUser())).get(0)
.getPlace();
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
String id = String.valueOf(calendar.get(Calendar.YEAR)).concat(String.valueOf(calendar.get(Calendar.MONTH) + 1))
.concat(String.valueOf(place.getIdplace()));
RentalEntity entity = new RentalEntity();
entity.setCreationdate(new Date());
entity.setIdrental(Long.valueOf(id));
entity.setPlace(place);
mapper.map(rental, entity);
rentalsRepository.save(entity);
return dailyService.getDaily(DateUtil.getDateFormated(new Date()), place, null);
}
@Override
public boolean existsLocalRental(Rental rental) {
Date date = DateUtil.getDate(rental.getRentaldate());
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
String id = String.valueOf(calendar.get(Calendar.YEAR)).concat(String.valueOf(calendar.get(Calendar.MONTH) + 1))
.concat(String.valueOf(placeUserRepository.findByUser(usersRepository.findByUsername(rental.getUser()))
.get(0).getPlace().getIdplace()));
return rentalsRepository.existsById(Long.valueOf(id));
}
}
| 2,388 | 0.768425 | 0.76675 | 67 | 33.641792 | 28.863396 | 114 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.61194 | false | false |
13
|
1099d95f9301bc310d7979b6c863d298e9853405
| 927,712,946,239 |
0dbc9ef513a7636f527d0ce707282af06fd919a2
|
/src/com/foodlasso/service/CategoryManager.java
|
91cca3889e30e14187c3f35d894ac5c734491424
|
[] |
no_license
|
joem236/Foodlasso
|
https://github.com/joem236/Foodlasso
|
01ea86b6b21749d3e1f0b6210edf9e1afb72534d
|
e6df88ab6e3018d3f4a63a37a8bebaec6e6768db
|
refs/heads/master
| 2021-01-16T19:14:20.884000 | 2012-10-30T15:42:08 | 2012-10-30T15:42:08 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.foodlasso.service;
import java.util.List;
import com.foodlasso.domain.Category;
public class CategoryManager implements ICategoryManager {
private static final long serialVersionUID = -5721867259612846995L;
@Override
public List<Category> getCategories(int menuId) {
// TODO Auto-generated method stub
return null;
}
@Override
public Category getCategoryById(int categoryId) {
// TODO Auto-generated method stub
return null;
}
}
|
UTF-8
|
Java
| 484 |
java
|
CategoryManager.java
|
Java
|
[] | null |
[] |
package com.foodlasso.service;
import java.util.List;
import com.foodlasso.domain.Category;
public class CategoryManager implements ICategoryManager {
private static final long serialVersionUID = -5721867259612846995L;
@Override
public List<Category> getCategories(int menuId) {
// TODO Auto-generated method stub
return null;
}
@Override
public Category getCategoryById(int categoryId) {
// TODO Auto-generated method stub
return null;
}
}
| 484 | 0.739669 | 0.700413 | 22 | 20 | 21.46244 | 68 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.954545 | false | false |
13
|
3f51833418b0e29ee156c5c8a7fcb1312c04e026
| 927,712,947,128 |
915073fa1390b4b9d9af70f17fc6e6a9623ac26b
|
/LinkGame/src/com/itjiehun/link/game/GameLevel.java
|
4832332232454d3c6fde5c4e1c92bf62559cac86
|
[] |
no_license
|
liufeiit/link
|
https://github.com/liufeiit/link
|
c48862a6f577aa2820d7ee399ae65dfa6d1b5ad3
|
fb0e6037a895721985a0965bebbefa63e553b6cf
|
refs/heads/master
| 2021-01-01T16:20:33.884000 | 2014-07-03T16:29:49 | 2014-07-03T16:29:49 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.itjiehun.link.game;
public enum GameLevel {
L_3_4_10(1, 3, 4, 10),
L_3_6_13(2, 3, 6, 13),
L_4_5_15(3, 4, 5, 15),
L_4_6_18(4, 4, 6, 18),
L_5_6_25(5, 5, 6, 25),
L_5_8_28(6, 5, 8, 28),
L_6_7_30(7, 6, 7, 30),
L_6_8_35(8, 6, 8, 35),
L_6_9_38(9, 6, 9, 38),
L_6_10_40(10, 6, 10, 40);
public static final int MAX_H_CARDS_COUNT = 6;
public static final int MAX_V_CARDS_COUNT = 10;
public final int maxTime ;//当前关卡的最大时间
public final int hCardCount ;//水平方向上的卡片的数量
public final int vCardCount ;//垂直方向上的卡片的数量
public final int level;
private GameLevel(int level, int hCardCount, int vCardCount, int maxTime) {
this.level = level;
this.hCardCount = hCardCount;
this.vCardCount = vCardCount;
this.maxTime = maxTime;
}
public static GameLevel level(int level) {
for(GameLevel l : values()) {
if(l.level == level) {
return l;
}
}
return L_3_4_10;
}
}
|
UTF-8
|
Java
| 962 |
java
|
GameLevel.java
|
Java
|
[] | null |
[] |
package com.itjiehun.link.game;
public enum GameLevel {
L_3_4_10(1, 3, 4, 10),
L_3_6_13(2, 3, 6, 13),
L_4_5_15(3, 4, 5, 15),
L_4_6_18(4, 4, 6, 18),
L_5_6_25(5, 5, 6, 25),
L_5_8_28(6, 5, 8, 28),
L_6_7_30(7, 6, 7, 30),
L_6_8_35(8, 6, 8, 35),
L_6_9_38(9, 6, 9, 38),
L_6_10_40(10, 6, 10, 40);
public static final int MAX_H_CARDS_COUNT = 6;
public static final int MAX_V_CARDS_COUNT = 10;
public final int maxTime ;//当前关卡的最大时间
public final int hCardCount ;//水平方向上的卡片的数量
public final int vCardCount ;//垂直方向上的卡片的数量
public final int level;
private GameLevel(int level, int hCardCount, int vCardCount, int maxTime) {
this.level = level;
this.hCardCount = hCardCount;
this.vCardCount = vCardCount;
this.maxTime = maxTime;
}
public static GameLevel level(int level) {
for(GameLevel l : values()) {
if(l.level == level) {
return l;
}
}
return L_3_4_10;
}
}
| 962 | 0.624444 | 0.513333 | 40 | 21.5 | 16.880463 | 76 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.6 | false | false |
13
|
c9b5343b777136d76212a51cacf17030c352eea2
| 9,337,258,951,793 |
98db62fb49fffe151933dc94978ae171f65ffe5b
|
/src/share/classes/java/io/NotActiveException.java
|
85206fdbbd2949ad1fd2775b3b0530da5ecee370
|
[] |
no_license
|
isaacreath/jdk8
|
https://github.com/isaacreath/jdk8
|
07a16ec6d142a6c72a5498259efe83587616e08a
|
4d793f9a7a165aea5fc3c599baf74cf97ba08fe5
|
refs/heads/master
| 2023-04-25T21:48:42.166000 | 2017-08-14T01:14:52 | 2017-08-14T01:14:52 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package java.io;
public class NotActiveException extends ObjectStreamException {
private static final long serialVersionUID = -3893467273049808895L;
public NotActiveException(String reason) {
super(reason);
}
public NotActiveException() {
super();
}
}
|
UTF-8
|
Java
| 288 |
java
|
NotActiveException.java
|
Java
|
[] | null |
[] |
package java.io;
public class NotActiveException extends ObjectStreamException {
private static final long serialVersionUID = -3893467273049808895L;
public NotActiveException(String reason) {
super(reason);
}
public NotActiveException() {
super();
}
}
| 288 | 0.708333 | 0.642361 | 10 | 27.799999 | 23.523605 | 71 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.4 | false | false |
13
|
a387c42a9e7794d1dfdc3ed7b93a584d95af98bc
| 30,081,950,941,755 |
123bf872744bbea5171e39709a2c563d53d47a08
|
/src/main/java/servlets/ProfileServlet.java
|
31dae48375d5f3c4c6a6e788c310664194cedb85
|
[] |
no_license
|
tomaslori/PawSprint1
|
https://github.com/tomaslori/PawSprint1
|
61c7332f99f7823100575413dbc35dd4504840db
|
8bf60ff7f665aaffee907c6a206552e37ef113a4
|
refs/heads/master
| 2020-04-05T23:18:22.976000 | 2014-09-22T17:29:06 | 2014-09-22T17:29:06 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package servlets;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import model.User;
import services.UserService;
public class ProfileServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
private UserService userService = UserService.getInstance();
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
String email = req.getParameter("email");
HttpSession session = req.getSession(false);
User userSession = (User) session.getAttribute("user");
if (email == null) {
if (userSession != null)
resp.sendRedirect("profile?email=" + userSession.getEmail());
else
req.getRequestDispatcher("/WEB-INF/jsp/login.jsp").forward(req, resp);
} else {
User user = userService.getUser(email);
if (user != null) {
if (userSession != null) {
if (user.getEmail().equals(userSession.getEmail())) {
req.setAttribute("isOwner", true);
}
}
req.setAttribute("email", user);
} else {
resp.sendRedirect("profile");
return;
}
req.getRequestDispatcher("/WEB-INF/jsp/profile.jsp").forward(req, resp);
}
}
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
// TODO: check... (nothing yet)
}
}
|
UTF-8
|
Java
| 1,520 |
java
|
ProfileServlet.java
|
Java
|
[] | null |
[] |
package servlets;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import model.User;
import services.UserService;
public class ProfileServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
private UserService userService = UserService.getInstance();
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
String email = req.getParameter("email");
HttpSession session = req.getSession(false);
User userSession = (User) session.getAttribute("user");
if (email == null) {
if (userSession != null)
resp.sendRedirect("profile?email=" + userSession.getEmail());
else
req.getRequestDispatcher("/WEB-INF/jsp/login.jsp").forward(req, resp);
} else {
User user = userService.getUser(email);
if (user != null) {
if (userSession != null) {
if (user.getEmail().equals(userSession.getEmail())) {
req.setAttribute("isOwner", true);
}
}
req.setAttribute("email", user);
} else {
resp.sendRedirect("profile");
return;
}
req.getRequestDispatcher("/WEB-INF/jsp/profile.jsp").forward(req, resp);
}
}
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
// TODO: check... (nothing yet)
}
}
| 1,520 | 0.724342 | 0.723684 | 55 | 26.636364 | 23.242878 | 75 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.254545 | false | false |
13
|
33278d3402d344d9ea7a997288a3c0aa3143204c
| 12,764,642,865,984 |
8a7e9aec23b4aef99ce0b466547b676a8abd612b
|
/app/src/test/java/org/agp8x/android/logging/myloggingapplication/ExampleUnitTest.java
|
192fc141a50440b80a8ab71ad11b33dd26317b9e
|
[] |
no_license
|
agp8x/android-logging
|
https://github.com/agp8x/android-logging
|
a6a8dea888e666fab8a44d6b8d07d12d117c53fd
|
b9123cf26b46be510c0ec0c7996158955ef128bc
|
refs/heads/master
| 2021-01-17T20:32:41.260000 | 2016-07-14T17:21:44 | 2016-07-14T17:21:44 | 63,352,287 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package org.agp8x.android.logging.myloggingapplication;
import org.junit.Before;
import org.junit.Test;
import org.slf4j.Logger;
/**
* To work on unit tests, switch the Test Artifact in the Build Variants view.
*/
public class ExampleUnitTest {
private Logger log;
@Before
public void setUp() throws Exception {
log = LogUtil.getLog(this.getClass());
}
@Test
public void addition_isCorrect() throws Exception {
System.out.println("test");
log.error("i am a log error");
log.info("i am just informing");
}
}
|
UTF-8
|
Java
| 575 |
java
|
ExampleUnitTest.java
|
Java
|
[] | null |
[] |
package org.agp8x.android.logging.myloggingapplication;
import org.junit.Before;
import org.junit.Test;
import org.slf4j.Logger;
/**
* To work on unit tests, switch the Test Artifact in the Build Variants view.
*/
public class ExampleUnitTest {
private Logger log;
@Before
public void setUp() throws Exception {
log = LogUtil.getLog(this.getClass());
}
@Test
public void addition_isCorrect() throws Exception {
System.out.println("test");
log.error("i am a log error");
log.info("i am just informing");
}
}
| 575 | 0.664348 | 0.66087 | 27 | 20.333334 | 21.478672 | 78 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.37037 | false | false |
13
|
94a8a9a720361eadadde0e572a1b0691956768b2
| 20,478,404,069,135 |
3d68328d1f13e2aedd8e956a4075f99e265aaabf
|
/src/test/java/befaster/solutions/FIZ/FizSolutionTest.java
|
2d69de447286ed36cd1c9db0c40bbe7f3874c5cb
|
[
"Apache-2.0"
] |
permissive
|
DPNT-Sourcecode/FIZ-cknu01
|
https://github.com/DPNT-Sourcecode/FIZ-cknu01
|
2ee82f2108bf77d5a4cdc9a32b301e64c7a21237
|
1824549a8c68350ac05f199f4f436bed91ef61c9
|
refs/heads/master
| 2020-04-29T12:55:07.244000 | 2019-03-18T05:26:36 | 2019-03-17T20:26:59 | 176,154,139 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package befaster.solutions.FIZ;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
public class FizSolutionTest {
private FizzBuzzSolution fizzBuzzSolution ;
@Before
public void setUp() {
fizzBuzzSolution = new FizzBuzzSolution();
}
@Test
@Ignore
public void fizzBuzz() {
System.out.println(fizzBuzzSolution.fizzBuzz(1));
assert(fizzBuzzSolution.fizzBuzz(1).equals("1"));
System.out.println(fizzBuzzSolution.fizzBuzz(9999));
assert(fizzBuzzSolution.fizzBuzz(9999).equals("fizz"));
System.out.println(fizzBuzzSolution.fizzBuzz(3));
assert(fizzBuzzSolution.fizzBuzz(3).equals("fizz"));
System.out.println(fizzBuzzSolution.fizzBuzz(15));
assert(fizzBuzzSolution.fizzBuzz(15).equals("fizz buzz"));
}
@Test
@Ignore
public void fizzBuzz2() {
assert(fizzBuzzSolution.fizzBuzz(1).equals("1"));
assert(fizzBuzzSolution.fizzBuzz(9999).equals("fizz"));
assert(fizzBuzzSolution.fizzBuzz(3).equals("fizz"));
assert(fizzBuzzSolution.fizzBuzz(31).equals("fizz"));
assert(fizzBuzzSolution.fizzBuzz(315).equals("fizz buzz"));
assert(fizzBuzzSolution.fizzBuzz(5).equals("buzz"));
assert(fizzBuzzSolution.fizzBuzz(60).equals("fizz buzz"));
assert(fizzBuzzSolution.fizzBuzz(15).equals("fizz buzz"));
}
@Test
public void fizzBuzz3() {
assert(fizzBuzzSolution.fizzBuzz(1).equals("1"));
assert(fizzBuzzSolution.fizzBuzz(9999).equals("fizz"));
assert(fizzBuzzSolution.fizzBuzz(3).equals("fizz fake deluxe"));
assert(fizzBuzzSolution.fizzBuzz(31).equals("fizz"));
assert(fizzBuzzSolution.fizzBuzz(315).equals("fizz buzz fake deluxe"));
assert(fizzBuzzSolution.fizzBuzz(5).equals("buzz fake deluxe"));
assert(fizzBuzzSolution.fizzBuzz(60).equals("fizz buzz"));
assert(fizzBuzzSolution.fizzBuzz(15).equals("fizz buzz fake deluxe"));
// New
assert(fizzBuzzSolution.fizzBuzz(10).equals("buzz"));
assert(fizzBuzzSolution.fizzBuzz(33).equals("fizz fake deluxe"));
assert(fizzBuzzSolution.fizzBuzz(55).equals("buzz fake deluxe"));
assert(fizzBuzzSolution.fizzBuzz(50).equals("buzz deluxe"));
assert(fizzBuzzSolution.fizzBuzz(350).equals("fizz buzz deluxe"));
assert(fizzBuzzSolution.fizzBuzz(555).equals("fizz buzz fake deluxe"));
}
}
|
UTF-8
|
Java
| 2,522 |
java
|
FizSolutionTest.java
|
Java
|
[] | null |
[] |
package befaster.solutions.FIZ;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
public class FizSolutionTest {
private FizzBuzzSolution fizzBuzzSolution ;
@Before
public void setUp() {
fizzBuzzSolution = new FizzBuzzSolution();
}
@Test
@Ignore
public void fizzBuzz() {
System.out.println(fizzBuzzSolution.fizzBuzz(1));
assert(fizzBuzzSolution.fizzBuzz(1).equals("1"));
System.out.println(fizzBuzzSolution.fizzBuzz(9999));
assert(fizzBuzzSolution.fizzBuzz(9999).equals("fizz"));
System.out.println(fizzBuzzSolution.fizzBuzz(3));
assert(fizzBuzzSolution.fizzBuzz(3).equals("fizz"));
System.out.println(fizzBuzzSolution.fizzBuzz(15));
assert(fizzBuzzSolution.fizzBuzz(15).equals("fizz buzz"));
}
@Test
@Ignore
public void fizzBuzz2() {
assert(fizzBuzzSolution.fizzBuzz(1).equals("1"));
assert(fizzBuzzSolution.fizzBuzz(9999).equals("fizz"));
assert(fizzBuzzSolution.fizzBuzz(3).equals("fizz"));
assert(fizzBuzzSolution.fizzBuzz(31).equals("fizz"));
assert(fizzBuzzSolution.fizzBuzz(315).equals("fizz buzz"));
assert(fizzBuzzSolution.fizzBuzz(5).equals("buzz"));
assert(fizzBuzzSolution.fizzBuzz(60).equals("fizz buzz"));
assert(fizzBuzzSolution.fizzBuzz(15).equals("fizz buzz"));
}
@Test
public void fizzBuzz3() {
assert(fizzBuzzSolution.fizzBuzz(1).equals("1"));
assert(fizzBuzzSolution.fizzBuzz(9999).equals("fizz"));
assert(fizzBuzzSolution.fizzBuzz(3).equals("fizz fake deluxe"));
assert(fizzBuzzSolution.fizzBuzz(31).equals("fizz"));
assert(fizzBuzzSolution.fizzBuzz(315).equals("fizz buzz fake deluxe"));
assert(fizzBuzzSolution.fizzBuzz(5).equals("buzz fake deluxe"));
assert(fizzBuzzSolution.fizzBuzz(60).equals("fizz buzz"));
assert(fizzBuzzSolution.fizzBuzz(15).equals("fizz buzz fake deluxe"));
// New
assert(fizzBuzzSolution.fizzBuzz(10).equals("buzz"));
assert(fizzBuzzSolution.fizzBuzz(33).equals("fizz fake deluxe"));
assert(fizzBuzzSolution.fizzBuzz(55).equals("buzz fake deluxe"));
assert(fizzBuzzSolution.fizzBuzz(50).equals("buzz deluxe"));
assert(fizzBuzzSolution.fizzBuzz(350).equals("fizz buzz deluxe"));
assert(fizzBuzzSolution.fizzBuzz(555).equals("fizz buzz fake deluxe"));
}
}
| 2,522 | 0.658208 | 0.631642 | 66 | 36.18182 | 28.731205 | 79 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.545455 | false | false |
13
|
aff92c1105ce7660b7e444d778d4d609d6047933
| 27,049,704,094,859 |
671f14d80b90156df474b7623f118bb0b4f5bba4
|
/src/examples/facefilter/android-studio/app/src/main/java/com/elucideye/facefilter/FaceFilterGLSurfaceView.java
|
af76367b2f7447aec8286a925ec81cd6807fb4b7
|
[
"BSD-3-Clause"
] |
permissive
|
ZJCRT/drishti
|
https://github.com/ZJCRT/drishti
|
fde64c05b424e054a98f2bcb4faaaa03cf952b0c
|
7c0da7e71cd4cff838b0b8ef195855cb68951839
|
refs/heads/master
| 2020-10-01T18:04:29.446000 | 2019-12-13T09:29:57 | 2019-12-13T09:29:57 | 227,594,066 | 0 | 0 |
BSD-3-Clause
| true | 2019-12-12T11:46:56 | 2019-12-12T11:46:55 | 2019-12-12T09:44:28 | 2019-09-04T19:09:19 | 12,790 | 0 | 0 | 0 | null | false | false |
/*
FaceFilterGLSurfaceView.java
Implementation of the facefilter GLSurfaceView
Copyright 2017-2018 Elucideye, Inc. All rights reserved. [All modifications]
This file is released under the 3 Clause BSD License. [All modifications]
Reference: http://maninara.blogspot.com/2015/03/render-camera-preview-using-opengl-es.html
*/
package com.elucideye.facefilter;
import android.content.Context;
import android.opengl.GLSurfaceView;
import android.util.AttributeSet;
import android.util.Log;
import android.view.SurfaceHolder;
import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
public class FaceFilterGLSurfaceView extends GLSurfaceView
{
private static String TAG = "FaceFilterGLSurfaceView";
FaceFilterRenderer mRenderer;
private boolean mContextDestroyed;
final Lock lock = new ReentrantLock();
final Condition callbackFromRender = lock.newCondition();
public FaceFilterGLSurfaceView(Context context) { this(context, null); }
public FaceFilterGLSurfaceView(Context context, AttributeSet attrs)
{
super(context, attrs);
}
// Called from FaceFilterFragment.onViewCreated()
public void onViewCreated(FaceFilterCameraManager cameraManager,
FaceFilterFragment fragment)
{
if (mRenderer == null)
{
mRenderer = new FaceFilterRenderer(this, cameraManager, fragment);
}
setEGLContextClientVersion(3);
// Register onSurfaceCreated listener
// (note: setRenderer can be called only once in the life-cycle of the
// GLSurfaceView)
setRenderer(mRenderer);
setRenderMode(GLSurfaceView.RENDERMODE_WHEN_DIRTY);
}
// Called from FaceFilterFragment.onPause()
@Override
public void onPause()
{
mContextDestroyed = false;
// We have to notify the "render thread" about the coming GL context
// destruction event.
queueEvent(new Runnable() {
@Override
public void run()
{
mRenderer.onPause();
}
});
// Now we have to wait for the "render thread" to respond, otherwise we
// can have a situation when the Java GL context is destroyed but the JNI
// GL context related items not.
lock.lock();
try
{
while (!mContextDestroyed)
{
callbackFromRender.await();
}
}
catch (InterruptedException e)
{
Log.e(TAG, "Await: InterruptedException." + e);
}
finally
{
lock.unlock();
}
// Confirmation received. JNI GL items are destroyed, so now we can destroy
// the Java GL context.
super.onPause();
}
// Called from FaceFilterRender.onPause
// Thread: "render thread"
public void jniContextDestroyed()
{
lock.lock();
try
{
if (mContextDestroyed)
{
Log.e(TAG, "Already destroyed");
}
mContextDestroyed = true;
callbackFromRender.signal();
}
finally
{
lock.unlock();
}
}
}
|
UTF-8
|
Java
| 3,295 |
java
|
FaceFilterGLSurfaceView.java
|
Java
|
[] | null |
[] |
/*
FaceFilterGLSurfaceView.java
Implementation of the facefilter GLSurfaceView
Copyright 2017-2018 Elucideye, Inc. All rights reserved. [All modifications]
This file is released under the 3 Clause BSD License. [All modifications]
Reference: http://maninara.blogspot.com/2015/03/render-camera-preview-using-opengl-es.html
*/
package com.elucideye.facefilter;
import android.content.Context;
import android.opengl.GLSurfaceView;
import android.util.AttributeSet;
import android.util.Log;
import android.view.SurfaceHolder;
import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
public class FaceFilterGLSurfaceView extends GLSurfaceView
{
private static String TAG = "FaceFilterGLSurfaceView";
FaceFilterRenderer mRenderer;
private boolean mContextDestroyed;
final Lock lock = new ReentrantLock();
final Condition callbackFromRender = lock.newCondition();
public FaceFilterGLSurfaceView(Context context) { this(context, null); }
public FaceFilterGLSurfaceView(Context context, AttributeSet attrs)
{
super(context, attrs);
}
// Called from FaceFilterFragment.onViewCreated()
public void onViewCreated(FaceFilterCameraManager cameraManager,
FaceFilterFragment fragment)
{
if (mRenderer == null)
{
mRenderer = new FaceFilterRenderer(this, cameraManager, fragment);
}
setEGLContextClientVersion(3);
// Register onSurfaceCreated listener
// (note: setRenderer can be called only once in the life-cycle of the
// GLSurfaceView)
setRenderer(mRenderer);
setRenderMode(GLSurfaceView.RENDERMODE_WHEN_DIRTY);
}
// Called from FaceFilterFragment.onPause()
@Override
public void onPause()
{
mContextDestroyed = false;
// We have to notify the "render thread" about the coming GL context
// destruction event.
queueEvent(new Runnable() {
@Override
public void run()
{
mRenderer.onPause();
}
});
// Now we have to wait for the "render thread" to respond, otherwise we
// can have a situation when the Java GL context is destroyed but the JNI
// GL context related items not.
lock.lock();
try
{
while (!mContextDestroyed)
{
callbackFromRender.await();
}
}
catch (InterruptedException e)
{
Log.e(TAG, "Await: InterruptedException." + e);
}
finally
{
lock.unlock();
}
// Confirmation received. JNI GL items are destroyed, so now we can destroy
// the Java GL context.
super.onPause();
}
// Called from FaceFilterRender.onPause
// Thread: "render thread"
public void jniContextDestroyed()
{
lock.lock();
try
{
if (mContextDestroyed)
{
Log.e(TAG, "Already destroyed");
}
mContextDestroyed = true;
callbackFromRender.signal();
}
finally
{
lock.unlock();
}
}
}
| 3,295 | 0.623672 | 0.618816 | 121 | 26.231405 | 24.083794 | 92 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.363636 | false | false |
0
|
a380b2875116694ff9949172b30eb23d35871f2b
| 26,336,739,490,975 |
473cd07b9c34a749855afadf3c734c0b930af516
|
/src/main/java/br/ibict/domain/Answer.java
|
c74c31438003ab86b95cf5c0782e775f857710a9
|
[] |
no_license
|
taosut/sbrt
|
https://github.com/taosut/sbrt
|
58b4bdf7dc5530fbdb8af59f4a128a08b4345631
|
e2d2ae77eac8b4bdbdf85365bf57ee564fdb9cd1
|
refs/heads/master
| 2022-10-09T13:39:15.194000 | 2019-10-10T19:13:15 | 2019-10-10T19:13:15 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package br.ibict.domain;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.io.Serializable;
import java.time.Instant;
import java.util.Base64;
import java.util.HashSet;
import java.util.Set;
import java.util.Objects;
/**
* A Answer.
*/
@Entity
@Table(name = "answer")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public class Answer implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sequenceGenerator")
@SequenceGenerator(name = "sequenceGenerator")
private Long id;
@NotNull
@Column(name = "title", nullable = false)
private String title;
@Column(name = "description")
private String description;
@NotNull
@Column(name = "date_published", nullable = false)
private Instant datePublished;
@Column(name = "content")
private String content;
@Min(value = 0)
@Column(name = "times_seen")
private Integer timesSeen;
@Column(name = "is_referential_only")
private Boolean isReferentialOnly;
@Column(name = "pdf_file", columnDefinition="BLOB")
private byte[] pdfFile;
@ManyToOne
@JsonIgnore
private User user;
@ManyToOne
@JsonIgnore
private Question question;
@ManyToOne
@JsonIgnore
private LegalEntity legalEntity;
@ManyToOne
@JsonIgnore
private Cnae cnae;
@OneToMany(mappedBy = "answer")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
private Set<Keyword> keywords = new HashSet<>();
@ManyToMany
@JoinTable(
name = "answer_answer_references",
joinColumns = {@JoinColumn(name = "original_answer_id", referencedColumnName = "id")},
inverseJoinColumns = {@JoinColumn(name = "reference_answer_id", referencedColumnName = "id")})
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
private Set<Answer> references = new HashSet<>();
// jhipster-needle-entity-add-field - JHipster will add fields here, do not remove
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getTitle() {
return title;
}
public Answer title(String title) {
this.title = title;
return this;
}
public void setTitle(String title) {
this.title = title;
}
public String getDescription() {
return description;
}
public Answer description(String description) {
this.description = description;
return this;
}
public void setDescription(String description) {
this.description = description;
}
public Instant getDatePublished() {
return datePublished;
}
public Answer datePublished(Instant datePublished) {
this.datePublished = datePublished;
return this;
}
public void setDatePublished(Instant datePublished) {
this.datePublished = datePublished;
}
public String getContent() {
return content;
}
public Answer content(String content) {
this.content = content;
return this;
}
public void setContent(String content) {
this.content = content;
}
public Integer getTimesSeen() {
return timesSeen;
}
public Answer timesSeen(Integer timesSeen) {
this.timesSeen = timesSeen;
return this;
}
public void setTimesSeen(Integer timesSeen) {
this.timesSeen = timesSeen;
}
public User getUser() {
return user;
}
public Answer user(User user) {
this.user = user;
return this;
}
public void setUser(User user) {
this.user = user;
}
public Question getQuestion() {
return question;
}
public Answer question(Question question) {
this.question = question;
return this;
}
public void setQuestion(Question question) {
this.question = question;
}
public LegalEntity getLegalEntity() {
return legalEntity;
}
public Answer legalEntity(LegalEntity legalEntity) {
this.legalEntity = legalEntity;
return this;
}
public void setLegalEntity(LegalEntity legalEntity) {
this.legalEntity = legalEntity;
}
public Cnae getCnae() {
return cnae;
}
public Answer cnae(Cnae cnae) {
this.cnae = cnae;
return this;
}
public void setCnae(Cnae cnae) {
this.cnae = cnae;
}
public String getPdfFile() {
byte[] encodedBytes = Base64.getEncoder().encode(pdfFile);
return new String(encodedBytes) ;
}
public void setPdfFile(String encodedData){
byte[] decodedBytes = Base64.getDecoder().decode(encodedData.getBytes());
this.pdfFile = decodedBytes;
}
@JsonProperty("keywords")
public Set<Keyword> getKeywords() {
return keywords;
}
public Answer keywords(Set<Keyword> keywords) {
this.keywords = keywords;
return this;
}
public Answer addKeyword(Keyword keyword) {
this.keywords.add(keyword);
keyword.setAnswer(this);
return this;
}
public Answer removeKeyword(Keyword keyword) {
this.keywords.remove(keyword);
keyword.setAnswer(null);
return this;
}
public void setKeywords(Set<Keyword> keywords) {
this.keywords = keywords;
}
public Boolean getIsReferentialOnly() {
return isReferentialOnly;
}
public void setIsReferentialOnly(Boolean isReferentialOnly) {
this.isReferentialOnly = isReferentialOnly;
}
public Set<Answer> getReferences() {
return references;
}
public void setReferences(Set<Answer> references) {
this.references = references;
}
// jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove
public Integer incrementSeen() {
return ++this.timesSeen;
}
@JsonInclude(Include.NON_NULL)
@JsonProperty("userId")
public Long getUserId() {
return this.user.getId();
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Answer answer = (Answer) o;
if (answer.getId() == null || getId() == null) {
return false;
}
return Objects.equals(getId(), answer.getId());
}
@Override
public int hashCode() {
return Objects.hashCode(getId());
}
@Override
public String toString() {
return "Answer{" +
"id=" + getId() +
", title='" + getTitle() + "'" +
", description='" + getDescription() + "'" +
", datePublished='" + getDatePublished() + "'" +
", content='" + getContent() + "'" +
", timesSeen=" + getTimesSeen() +
", keywords=" + getKeywords() +
", pdfFile=" + getPdfFile() +
"}";
}
}
|
UTF-8
|
Java
| 7,486 |
java
|
Answer.java
|
Java
|
[] | null |
[] |
package br.ibict.domain;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.io.Serializable;
import java.time.Instant;
import java.util.Base64;
import java.util.HashSet;
import java.util.Set;
import java.util.Objects;
/**
* A Answer.
*/
@Entity
@Table(name = "answer")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public class Answer implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sequenceGenerator")
@SequenceGenerator(name = "sequenceGenerator")
private Long id;
@NotNull
@Column(name = "title", nullable = false)
private String title;
@Column(name = "description")
private String description;
@NotNull
@Column(name = "date_published", nullable = false)
private Instant datePublished;
@Column(name = "content")
private String content;
@Min(value = 0)
@Column(name = "times_seen")
private Integer timesSeen;
@Column(name = "is_referential_only")
private Boolean isReferentialOnly;
@Column(name = "pdf_file", columnDefinition="BLOB")
private byte[] pdfFile;
@ManyToOne
@JsonIgnore
private User user;
@ManyToOne
@JsonIgnore
private Question question;
@ManyToOne
@JsonIgnore
private LegalEntity legalEntity;
@ManyToOne
@JsonIgnore
private Cnae cnae;
@OneToMany(mappedBy = "answer")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
private Set<Keyword> keywords = new HashSet<>();
@ManyToMany
@JoinTable(
name = "answer_answer_references",
joinColumns = {@JoinColumn(name = "original_answer_id", referencedColumnName = "id")},
inverseJoinColumns = {@JoinColumn(name = "reference_answer_id", referencedColumnName = "id")})
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
private Set<Answer> references = new HashSet<>();
// jhipster-needle-entity-add-field - JHipster will add fields here, do not remove
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getTitle() {
return title;
}
public Answer title(String title) {
this.title = title;
return this;
}
public void setTitle(String title) {
this.title = title;
}
public String getDescription() {
return description;
}
public Answer description(String description) {
this.description = description;
return this;
}
public void setDescription(String description) {
this.description = description;
}
public Instant getDatePublished() {
return datePublished;
}
public Answer datePublished(Instant datePublished) {
this.datePublished = datePublished;
return this;
}
public void setDatePublished(Instant datePublished) {
this.datePublished = datePublished;
}
public String getContent() {
return content;
}
public Answer content(String content) {
this.content = content;
return this;
}
public void setContent(String content) {
this.content = content;
}
public Integer getTimesSeen() {
return timesSeen;
}
public Answer timesSeen(Integer timesSeen) {
this.timesSeen = timesSeen;
return this;
}
public void setTimesSeen(Integer timesSeen) {
this.timesSeen = timesSeen;
}
public User getUser() {
return user;
}
public Answer user(User user) {
this.user = user;
return this;
}
public void setUser(User user) {
this.user = user;
}
public Question getQuestion() {
return question;
}
public Answer question(Question question) {
this.question = question;
return this;
}
public void setQuestion(Question question) {
this.question = question;
}
public LegalEntity getLegalEntity() {
return legalEntity;
}
public Answer legalEntity(LegalEntity legalEntity) {
this.legalEntity = legalEntity;
return this;
}
public void setLegalEntity(LegalEntity legalEntity) {
this.legalEntity = legalEntity;
}
public Cnae getCnae() {
return cnae;
}
public Answer cnae(Cnae cnae) {
this.cnae = cnae;
return this;
}
public void setCnae(Cnae cnae) {
this.cnae = cnae;
}
public String getPdfFile() {
byte[] encodedBytes = Base64.getEncoder().encode(pdfFile);
return new String(encodedBytes) ;
}
public void setPdfFile(String encodedData){
byte[] decodedBytes = Base64.getDecoder().decode(encodedData.getBytes());
this.pdfFile = decodedBytes;
}
@JsonProperty("keywords")
public Set<Keyword> getKeywords() {
return keywords;
}
public Answer keywords(Set<Keyword> keywords) {
this.keywords = keywords;
return this;
}
public Answer addKeyword(Keyword keyword) {
this.keywords.add(keyword);
keyword.setAnswer(this);
return this;
}
public Answer removeKeyword(Keyword keyword) {
this.keywords.remove(keyword);
keyword.setAnswer(null);
return this;
}
public void setKeywords(Set<Keyword> keywords) {
this.keywords = keywords;
}
public Boolean getIsReferentialOnly() {
return isReferentialOnly;
}
public void setIsReferentialOnly(Boolean isReferentialOnly) {
this.isReferentialOnly = isReferentialOnly;
}
public Set<Answer> getReferences() {
return references;
}
public void setReferences(Set<Answer> references) {
this.references = references;
}
// jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove
public Integer incrementSeen() {
return ++this.timesSeen;
}
@JsonInclude(Include.NON_NULL)
@JsonProperty("userId")
public Long getUserId() {
return this.user.getId();
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Answer answer = (Answer) o;
if (answer.getId() == null || getId() == null) {
return false;
}
return Objects.equals(getId(), answer.getId());
}
@Override
public int hashCode() {
return Objects.hashCode(getId());
}
@Override
public String toString() {
return "Answer{" +
"id=" + getId() +
", title='" + getTitle() + "'" +
", description='" + getDescription() + "'" +
", datePublished='" + getDatePublished() + "'" +
", content='" + getContent() + "'" +
", timesSeen=" + getTimesSeen() +
", keywords=" + getKeywords() +
", pdfFile=" + getPdfFile() +
"}";
}
}
| 7,486 | 0.622763 | 0.621694 | 313 | 22.916933 | 21.038216 | 109 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.373802 | false | false |
0
|
ed24d903ef833d5d8fc1c4de9a4491eb028d19ac
| 25,769,854,466 |
5cf6e3aff36091e65722ddef3252d9756a962cb6
|
/Java总结/JavaWeb code/1.JavaWeb基础 Code/19_2 DBUtils TxQueryRunner/day19_2/src/main/java/cn/itcast/jdbc/Demo1.java
|
8b01e406e95e35878b5bb513c92d9706f3450ed6
|
[] |
no_license
|
shuoGG1239/Notes
|
https://github.com/shuoGG1239/Notes
|
0f79c813151ae908e6797d1f0c210a31f672e80d
|
45e60b73a1e3ebfe6d04f3af54b1c24c71abc4db
|
refs/heads/master
| 2018-12-22T09:51:05.334000 | 2018-12-18T11:16:33 | 2018-12-18T11:16:33 | 125,630,684 | 1 | 0 | null | false | 2019-11-13T05:53:01 | 2018-03-17T13:14:36 | 2019-09-27T11:00:17 | 2019-11-13T05:52:59 | 98,592 | 1 | 0 | 1 |
Java
| false | false |
package cn.itcast.jdbc;
import java.sql.SQLException;
import org.junit.Test;
public class Demo1 {
private AccountDao dao = new AccountDao();
@Test
public void serviceMethod() throws Exception {
try {
JdbcUtils.beginTransaction();
dao.update("zs", -100);
if(true) throw new RuntimeException();
dao.update("ls", 100);
JdbcUtils.commitTransaction();
} catch (Exception e) {
try {
JdbcUtils.rollbackTransaction();
} catch (SQLException e1) {
}
throw e;
}
}
}
|
UTF-8
|
Java
| 546 |
java
|
Demo1.java
|
Java
|
[] | null |
[] |
package cn.itcast.jdbc;
import java.sql.SQLException;
import org.junit.Test;
public class Demo1 {
private AccountDao dao = new AccountDao();
@Test
public void serviceMethod() throws Exception {
try {
JdbcUtils.beginTransaction();
dao.update("zs", -100);
if(true) throw new RuntimeException();
dao.update("ls", 100);
JdbcUtils.commitTransaction();
} catch (Exception e) {
try {
JdbcUtils.rollbackTransaction();
} catch (SQLException e1) {
}
throw e;
}
}
}
| 546 | 0.615385 | 0.600733 | 30 | 16.200001 | 14.934077 | 47 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.2 | false | false |
0
|
506056cf30ae1a1228437e68bcabf4fdc7f05ada
| 6,536,940,284,308 |
e14e452ca97a8f81895abdb0f5e271666478d63f
|
/src/visa/net/authorize/api/contract/v1/CreditCardType.java
|
a8783034097784ad8a194c094a2e9d14ff73497e
|
[] |
no_license
|
Skillpier/Skillpier-Server-Dev
|
https://github.com/Skillpier/Skillpier-Server-Dev
|
6ea0e061a897b97da49af539f27018ce0ec988c9
|
d0a966579e13a9ec91168f37c3dd177017a9abb9
|
refs/heads/master
| 2021-01-19T07:49:50.488000 | 2017-04-07T18:27:00 | 2017-04-07T18:27:00 | 87,575,144 | 0 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null |
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2016.08.11 at 11:22:30 PM IST
//
package net.authorize.api.contract.v1;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for creditCardType complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="creditCardType">
* <complexContent>
* <extension base="{AnetApi/xml/v1/schema/AnetApiSchema.xsd}creditCardSimpleType">
* <sequence>
* <element name="cardCode" type="{AnetApi/xml/v1/schema/AnetApiSchema.xsd}cardCode" minOccurs="0"/>
* <element name="isPaymentToken" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
* <element name="cryptogram" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* </sequence>
* </extension>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "creditCardType", propOrder = {
"cardCode",
"isPaymentToken",
"cryptogram"
})
public class CreditCardType
extends CreditCardSimpleType
{
protected String cardCode;
protected Boolean isPaymentToken;
protected String cryptogram;
/**
* Gets the value of the cardCode property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getCardCode() {
return cardCode;
}
/**
* Sets the value of the cardCode property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setCardCode(String value) {
this.cardCode = value;
}
/**
* Gets the value of the isPaymentToken property.
*
* @return
* possible object is
* {@link Boolean }
*
*/
public Boolean isIsPaymentToken() {
return isPaymentToken;
}
/**
* Sets the value of the isPaymentToken property.
*
* @param value
* allowed object is
* {@link Boolean }
*
*/
public void setIsPaymentToken(Boolean value) {
this.isPaymentToken = value;
}
/**
* Gets the value of the cryptogram property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getCryptogram() {
return cryptogram;
}
/**
* Sets the value of the cryptogram property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setCryptogram(String value) {
this.cryptogram = value;
}
}
|
UTF-8
|
Java
| 3,200 |
java
|
CreditCardType.java
|
Java
|
[] | null |
[] |
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2016.08.11 at 11:22:30 PM IST
//
package net.authorize.api.contract.v1;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for creditCardType complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="creditCardType">
* <complexContent>
* <extension base="{AnetApi/xml/v1/schema/AnetApiSchema.xsd}creditCardSimpleType">
* <sequence>
* <element name="cardCode" type="{AnetApi/xml/v1/schema/AnetApiSchema.xsd}cardCode" minOccurs="0"/>
* <element name="isPaymentToken" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
* <element name="cryptogram" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* </sequence>
* </extension>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "creditCardType", propOrder = {
"cardCode",
"isPaymentToken",
"cryptogram"
})
public class CreditCardType
extends CreditCardSimpleType
{
protected String cardCode;
protected Boolean isPaymentToken;
protected String cryptogram;
/**
* Gets the value of the cardCode property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getCardCode() {
return cardCode;
}
/**
* Sets the value of the cardCode property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setCardCode(String value) {
this.cardCode = value;
}
/**
* Gets the value of the isPaymentToken property.
*
* @return
* possible object is
* {@link Boolean }
*
*/
public Boolean isIsPaymentToken() {
return isPaymentToken;
}
/**
* Sets the value of the isPaymentToken property.
*
* @param value
* allowed object is
* {@link Boolean }
*
*/
public void setIsPaymentToken(Boolean value) {
this.isPaymentToken = value;
}
/**
* Gets the value of the cryptogram property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getCryptogram() {
return cryptogram;
}
/**
* Sets the value of the cryptogram property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setCryptogram(String value) {
this.cryptogram = value;
}
}
| 3,200 | 0.579687 | 0.56625 | 123 | 24.01626 | 25.47691 | 122 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.227642 | false | false |
0
|
e34f9f46fe8bbd6a1acf9e0202c980a0ff971831
| 11,287,174,106,161 |
c351ee0973a32e2f615a9f87b3fdec32fd02de23
|
/Server/src/edu/cornell/artillerymenagerie/NewUnitIDServlet.java
|
d2422cb14b993bf3ca831022f88bf2a595ef4c5f
|
[] |
no_license
|
als364/Artillery-Menagerie
|
https://github.com/als364/Artillery-Menagerie
|
c37b31b76a251d1332283973b22e08c3310055cb
|
448fedb8fd8f480c45c60df4917478433b88b95e
|
refs/heads/master
| 2021-03-12T22:15:38.592000 | 2013-08-14T19:34:15 | 2013-08-14T19:34:15 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package edu.cornell.artillerymenagerie;
import java.io.IOException;
import java.util.Date;
import java.util.logging.Logger;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.google.appengine.api.datastore.DatastoreService;
import com.google.appengine.api.datastore.DatastoreServiceFactory;
import com.google.appengine.api.datastore.Entity;
import com.google.appengine.api.datastore.KeyFactory;
import com.google.appengine.api.datastore.Text;
public class NewUnitIDServlet extends HttpServlet {
private static final Logger log = Logger.getLogger(NewBattleServlet.class.getName());
public void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException {
String player = req.getParameter("player");
// Create new unit entity
Entity unit = new Entity("UnitID");
unit.setProperty("player", player);
DatastoreService datastore = DatastoreServiceFactory.getDatastoreService();
datastore.put(unit);
resp.getWriter().print(KeyFactory.keyToString(unit.getKey()));
}
}
|
UTF-8
|
Java
| 1,163 |
java
|
NewUnitIDServlet.java
|
Java
|
[] | null |
[] |
package edu.cornell.artillerymenagerie;
import java.io.IOException;
import java.util.Date;
import java.util.logging.Logger;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.google.appengine.api.datastore.DatastoreService;
import com.google.appengine.api.datastore.DatastoreServiceFactory;
import com.google.appengine.api.datastore.Entity;
import com.google.appengine.api.datastore.KeyFactory;
import com.google.appengine.api.datastore.Text;
public class NewUnitIDServlet extends HttpServlet {
private static final Logger log = Logger.getLogger(NewBattleServlet.class.getName());
public void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException {
String player = req.getParameter("player");
// Create new unit entity
Entity unit = new Entity("UnitID");
unit.setProperty("player", player);
DatastoreService datastore = DatastoreServiceFactory.getDatastoreService();
datastore.put(unit);
resp.getWriter().print(KeyFactory.keyToString(unit.getKey()));
}
}
| 1,163 | 0.760103 | 0.760103 | 33 | 34.242424 | 27.096941 | 93 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.787879 | false | false |
0
|
59bbb332e1edc31bdd864062d3786b3a9126c0b0
| 7,739,531,129,687 |
c83d118469751ceccae7d8dca7a259bb4bd09142
|
/src/main/java/com/example/jwt/controller/TestController.java
|
b0e6c85c36fe73844d114d019e7bcc620610b080
|
[] |
no_license
|
kaoding/jwt
|
https://github.com/kaoding/jwt
|
4c44404b2a51d3349d82f1398c5daf381e1e799a
|
4b8a297095df7742aa54aecefd684c8785dc0b60
|
refs/heads/master
| 2020-03-19T18:31:44.438000 | 2018-06-12T08:47:17 | 2018-06-12T08:47:17 | 136,813,384 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.example.jwt.controller;
import com.example.jwt.domain.Device;
import com.example.jwt.domain.Product;
import com.example.jwt.domain.Role;
import com.example.jwt.domain.User;
import com.example.jwt.repository.DeviceRepository;
import com.example.jwt.repository.ProductRepository;
import com.example.jwt.repository.RoleRepository;
import com.example.jwt.repository.UserRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Optional;
/**
* TestController
*
* @author lijiehua
* @date 2018-06-11
*/
@RestController
@RequestMapping("/test")
public class TestController {
@Autowired
private UserRepository userRepository;
@Autowired
private RoleRepository roleRepository;
@Autowired
private ProductRepository productRepository;
@Autowired
private DeviceRepository deviceRepository;
@PostMapping("/role/add")
public User addRole(@RequestBody UserRole ur) {
Optional<User> optionalUser = userRepository.findById(ur.getUserId());
Optional<Role> optionalRole = roleRepository.findById(ur.getRoleId());
User user = optionalUser.get();
Role role = optionalRole.get();
user.getRoles().add(role);
return userRepository.save(user);
}
@PostMapping("/role/remove")
public User removeRole(@RequestBody UserRole ur) {
Optional<User> optionalUser = userRepository.findById(ur.getUserId());
Optional<Role> optionalRole = roleRepository.findById(ur.getRoleId());
User user = optionalUser.get();
Role role = optionalRole.get();
user.getRoles().remove(role);
return userRepository.save(user);
}
@PostMapping("/device/add/{id}")
public Device addDevice(@PathVariable("id") String id, @RequestBody Device device) {
Optional<Product> optionalProduct = productRepository.findById(id);
Product product = optionalProduct.get();
device.setProduct(product);
return deviceRepository.save(device);
}
@PostMapping("/device/remove/{id}")
public void removeDevice(@PathVariable("id") String id) {
deviceRepository.deleteById(id);
}
}
|
UTF-8
|
Java
| 2,225 |
java
|
TestController.java
|
Java
|
[
{
"context": "til.Optional;\n\n/**\n * TestController\n *\n * @author lijiehua\n * @date 2018-06-11\n */\n@RestController\n@RequestM",
"end": 577,
"score": 0.9940854907035828,
"start": 569,
"tag": "USERNAME",
"value": "lijiehua"
}
] | null |
[] |
package com.example.jwt.controller;
import com.example.jwt.domain.Device;
import com.example.jwt.domain.Product;
import com.example.jwt.domain.Role;
import com.example.jwt.domain.User;
import com.example.jwt.repository.DeviceRepository;
import com.example.jwt.repository.ProductRepository;
import com.example.jwt.repository.RoleRepository;
import com.example.jwt.repository.UserRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Optional;
/**
* TestController
*
* @author lijiehua
* @date 2018-06-11
*/
@RestController
@RequestMapping("/test")
public class TestController {
@Autowired
private UserRepository userRepository;
@Autowired
private RoleRepository roleRepository;
@Autowired
private ProductRepository productRepository;
@Autowired
private DeviceRepository deviceRepository;
@PostMapping("/role/add")
public User addRole(@RequestBody UserRole ur) {
Optional<User> optionalUser = userRepository.findById(ur.getUserId());
Optional<Role> optionalRole = roleRepository.findById(ur.getRoleId());
User user = optionalUser.get();
Role role = optionalRole.get();
user.getRoles().add(role);
return userRepository.save(user);
}
@PostMapping("/role/remove")
public User removeRole(@RequestBody UserRole ur) {
Optional<User> optionalUser = userRepository.findById(ur.getUserId());
Optional<Role> optionalRole = roleRepository.findById(ur.getRoleId());
User user = optionalUser.get();
Role role = optionalRole.get();
user.getRoles().remove(role);
return userRepository.save(user);
}
@PostMapping("/device/add/{id}")
public Device addDevice(@PathVariable("id") String id, @RequestBody Device device) {
Optional<Product> optionalProduct = productRepository.findById(id);
Product product = optionalProduct.get();
device.setProduct(product);
return deviceRepository.save(device);
}
@PostMapping("/device/remove/{id}")
public void removeDevice(@PathVariable("id") String id) {
deviceRepository.deleteById(id);
}
}
| 2,225 | 0.715955 | 0.71236 | 67 | 32.208954 | 23.265846 | 88 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.507463 | false | false |
0
|
340095dc0fa1ecef1446df8519fa0f255672dcca
| 8,375,186,289,530 |
ce55e10448040cf27b4abccc9fb2b46e83ffb434
|
/trunk/common/src/main/java/gov/nih/nci/ncicb/tcga/dcc/common/webservice/bean/BarcodeWS.java
|
0ae791512b7515da573108f4317a79a47f476c46
|
[] |
no_license
|
NCIP/tcga-sandbox-v1
|
https://github.com/NCIP/tcga-sandbox-v1
|
0518dee6ee9e31a48c6ebddd1c10d20dca33c898
|
c8230c07199ddaf9d69564480ff9124782525cf5
|
refs/heads/master
| 2021-01-19T04:07:08.906000 | 2013-05-29T18:00:15 | 2013-05-29T18:00:15 | 87,348,860 | 1 | 7 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package gov.nih.nci.ncicb.tcga.dcc.common.webservice.bean;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
/**
* bean describing a barcode to be used in jersey web services
*
* @author Rohini Raman
* Last updated by: $Author$
* @version $Rev$
*/
@XmlRootElement(name = "barcode")
@XmlAccessorType(XmlAccessType.FIELD)
public class BarcodeWS {
@XmlAttribute
private String createdOn;
@XmlAttribute
private Boolean exists;
private String barcode;
public BarcodeWS() {
}
public BarcodeWS(String createdOn, String barcode) {
this.createdOn = createdOn;
this.barcode = barcode;
}
public String getCreatedOn() {
return createdOn;
}
public void setCreatedOn(String createdOn) {
this.createdOn = createdOn;
}
public String getBarcode() {
return barcode;
}
public void setBarcode(String barcode) {
this.barcode = barcode;
}
public Boolean getExists() {
return exists;
}
public void setExists(Boolean exists) {
this.exists = exists;
}
public Boolean isExists() {
return exists;
}
}
|
UTF-8
|
Java
| 1,372 |
java
|
BarcodeWS.java
|
Java
|
[
{
"context": " to be used in jersey web services\r\n *\r\n * @author Rohini Raman\r\n * Last updated by: $Author$\r\n * @versio",
"end": 358,
"score": 0.9998741149902344,
"start": 346,
"tag": "NAME",
"value": "Rohini Raman"
}
] | null |
[] |
package gov.nih.nci.ncicb.tcga.dcc.common.webservice.bean;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
/**
* bean describing a barcode to be used in jersey web services
*
* @author <NAME>
* Last updated by: $Author$
* @version $Rev$
*/
@XmlRootElement(name = "barcode")
@XmlAccessorType(XmlAccessType.FIELD)
public class BarcodeWS {
@XmlAttribute
private String createdOn;
@XmlAttribute
private Boolean exists;
private String barcode;
public BarcodeWS() {
}
public BarcodeWS(String createdOn, String barcode) {
this.createdOn = createdOn;
this.barcode = barcode;
}
public String getCreatedOn() {
return createdOn;
}
public void setCreatedOn(String createdOn) {
this.createdOn = createdOn;
}
public String getBarcode() {
return barcode;
}
public void setBarcode(String barcode) {
this.barcode = barcode;
}
public Boolean getExists() {
return exists;
}
public void setExists(Boolean exists) {
this.exists = exists;
}
public Boolean isExists() {
return exists;
}
}
| 1,366 | 0.634111 | 0.634111 | 62 | 20.129032 | 18.26815 | 62 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.290323 | false | false |
0
|
6f43058023d94545e3c0f495cab0228f41a49e39
| 12,670,153,590,516 |
b78cf480afea4adefe44e69e18279233f5507872
|
/src/test/java/cn/hxh/util/file/ZipUtilTest.java
|
23ce2d668dadffaadef66f21cecd29cca3940c7f
|
[] |
no_license
|
Shaneue/shane
|
https://github.com/Shaneue/shane
|
23895464c8328b6227a2e23c28eb29d95134c14f
|
bcc48f892880749ff43824dd86a40ed79e8ab0f4
|
refs/heads/master
| 2022-05-13T05:37:40.397000 | 2022-05-04T11:38:38 | 2022-05-04T11:38:38 | 146,678,479 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package cn.hxh.util.file;
import cn.hxh.TestUtil;
import cn.hxh.constant.TestConstants;
import org.junit.Test;
import java.io.File;
import static org.junit.Assert.assertEquals;
public class ZipUtilTest {
String parentPath = TestConstants.TEST_RESOURCES_PATH + "ZipTest/";
@Test
public void zip() throws Exception {
File toZipped = new File(parentPath);
String zip = TestConstants.TEMP_DIR + "test.zip";
ZipUtils.zip(toZipped, zip);
String md5 = TestUtil.computeFileMd5(new File(zip));
FileUtils.deleteFile(zip);
assertEquals(24, md5.length());
}
@Test
public void unZipFiles() throws Exception {
File toZipped = new File(parentPath);
String zip = TestConstants.TEMP_DIR + "test.zip";
ZipUtils.zip(toZipped, zip);
String unzip = TestConstants.TEMP_DIR + "unzip";
ZipUtils.unZipFiles(new File(zip), unzip);
String test1 = FileUtils.readFile(TestConstants.TEMP_DIR + "unzip/txt");
String test2 = FileUtils.readFile(TestConstants.TEMP_DIR + "unzip/folder/txt");
FileUtils.deleteDirRecursively(unzip);
FileUtils.deleteFile(zip);
assertEquals("to test zip file", test1);
assertEquals("to test zip file", test2);
}
}
|
UTF-8
|
Java
| 1,280 |
java
|
ZipUtilTest.java
|
Java
|
[] | null |
[] |
package cn.hxh.util.file;
import cn.hxh.TestUtil;
import cn.hxh.constant.TestConstants;
import org.junit.Test;
import java.io.File;
import static org.junit.Assert.assertEquals;
public class ZipUtilTest {
String parentPath = TestConstants.TEST_RESOURCES_PATH + "ZipTest/";
@Test
public void zip() throws Exception {
File toZipped = new File(parentPath);
String zip = TestConstants.TEMP_DIR + "test.zip";
ZipUtils.zip(toZipped, zip);
String md5 = TestUtil.computeFileMd5(new File(zip));
FileUtils.deleteFile(zip);
assertEquals(24, md5.length());
}
@Test
public void unZipFiles() throws Exception {
File toZipped = new File(parentPath);
String zip = TestConstants.TEMP_DIR + "test.zip";
ZipUtils.zip(toZipped, zip);
String unzip = TestConstants.TEMP_DIR + "unzip";
ZipUtils.unZipFiles(new File(zip), unzip);
String test1 = FileUtils.readFile(TestConstants.TEMP_DIR + "unzip/txt");
String test2 = FileUtils.readFile(TestConstants.TEMP_DIR + "unzip/folder/txt");
FileUtils.deleteDirRecursively(unzip);
FileUtils.deleteFile(zip);
assertEquals("to test zip file", test1);
assertEquals("to test zip file", test2);
}
}
| 1,280 | 0.665625 | 0.658594 | 39 | 31.846153 | 23.982407 | 87 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.769231 | false | false |
0
|
7151a3e5a638b08677a32ed88632085ee371d1cc
| 26,431,228,784,792 |
fa91450deb625cda070e82d5c31770be5ca1dec6
|
/Diff-Raw-Data/14/14_22b06e208d9816433c3b384e732a3c0a61f09b40/TypeMarshaller/14_22b06e208d9816433c3b384e732a3c0a61f09b40_TypeMarshaller_s.java
|
f5e1cd3dcbcf2ecb0d76b9a5c0f0ba4b6f3b9201
|
[] |
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 org.jboss.errai.enterprise.rebind;
import org.jboss.errai.codegen.framework.Parameter;
import org.jboss.errai.codegen.framework.Statement;
import org.jboss.errai.codegen.framework.Variable;
import org.jboss.errai.codegen.framework.meta.MetaClass;
import org.jboss.errai.codegen.framework.meta.MetaClassFactory;
import org.jboss.errai.codegen.framework.util.Stmt;
import org.jboss.errai.common.client.json.JSONDecoderCli;
import org.jboss.errai.common.client.json.JSONEncoderCli;
import org.jboss.errai.common.client.types.EncodingContext;
/**
* Generates the required {@link Statement}s for type marshalling.
*
* @author Christian Sadilek <csadilek@redhat.com>
*/
public class TypeMarshaller {
public static Statement marshal(Parameter param) {
return marshal(param.getType(), Variable.get(param.getName()));
}
public static Statement marshal(MetaClass type, Statement statement) {
Statement marshallingStatement;
if (type.asUnboxed().isPrimitive() || type.equals(MetaClassFactory.get(String.class))) {
marshallingStatement = PrimitiveTypeMarshaller.marshal(type, statement);
}
else {
marshallingStatement = Stmt.nestedCall(Stmt.newObject(JSONEncoderCli.class))
.invoke( "encode", statement, Stmt.newObject(EncodingContext.class));
}
return marshallingStatement;
}
public static Statement demarshal(Parameter param) {
return demarshal(param.getType(), Variable.get(param.getName()));
}
public static Statement demarshal(MetaClass type, Statement statement) {
Statement demarshallingStatement;
if (type.asUnboxed().isPrimitive() || type.equals(MetaClassFactory.get(String.class))) {
demarshallingStatement = PrimitiveTypeMarshaller.demarshal(type, statement);
}
else {
demarshallingStatement = Stmt.invokeStatic(JSONDecoderCli.class, "decode", statement);
}
return demarshallingStatement;
}
/**
* Works for all types that have a 'copy constructor', a toString() representation
* and a valueOf() method (all primitive wrapper types and java.lang.String).
*/
private static class PrimitiveTypeMarshaller {
private static Statement marshal(MetaClass type, Statement statement) {
return Stmt.nestedCall(Stmt.newObject(type.asBoxed()).withParameters(statement)).invoke("toString");
}
private static Statement demarshal(MetaClass type, Statement statement) {
if (MetaClassFactory.get(void.class).equals(type))
return Stmt.load(null);
return Stmt.invokeStatic(type.asBoxed(), "valueOf", statement);
}
}
}
|
UTF-8
|
Java
| 2,665 |
java
|
14_22b06e208d9816433c3b384e732a3c0a61f09b40_TypeMarshaller_s.java
|
Java
|
[
{
"context": "Statement}s for type marshalling.\n * \n * @author Christian Sadilek <csadilek@redhat.com>\n */\n public class TypeMars",
"end": 667,
"score": 0.9998852014541626,
"start": 650,
"tag": "NAME",
"value": "Christian Sadilek"
},
{
"context": " marshalling.\n * \n * @author Christian Sadilek <csadilek@redhat.com>\n */\n public class TypeMarshaller {\n \n public ",
"end": 688,
"score": 0.9999172687530518,
"start": 669,
"tag": "EMAIL",
"value": "csadilek@redhat.com"
}
] | null |
[] |
package org.jboss.errai.enterprise.rebind;
import org.jboss.errai.codegen.framework.Parameter;
import org.jboss.errai.codegen.framework.Statement;
import org.jboss.errai.codegen.framework.Variable;
import org.jboss.errai.codegen.framework.meta.MetaClass;
import org.jboss.errai.codegen.framework.meta.MetaClassFactory;
import org.jboss.errai.codegen.framework.util.Stmt;
import org.jboss.errai.common.client.json.JSONDecoderCli;
import org.jboss.errai.common.client.json.JSONEncoderCli;
import org.jboss.errai.common.client.types.EncodingContext;
/**
* Generates the required {@link Statement}s for type marshalling.
*
* @author <NAME> <<EMAIL>>
*/
public class TypeMarshaller {
public static Statement marshal(Parameter param) {
return marshal(param.getType(), Variable.get(param.getName()));
}
public static Statement marshal(MetaClass type, Statement statement) {
Statement marshallingStatement;
if (type.asUnboxed().isPrimitive() || type.equals(MetaClassFactory.get(String.class))) {
marshallingStatement = PrimitiveTypeMarshaller.marshal(type, statement);
}
else {
marshallingStatement = Stmt.nestedCall(Stmt.newObject(JSONEncoderCli.class))
.invoke( "encode", statement, Stmt.newObject(EncodingContext.class));
}
return marshallingStatement;
}
public static Statement demarshal(Parameter param) {
return demarshal(param.getType(), Variable.get(param.getName()));
}
public static Statement demarshal(MetaClass type, Statement statement) {
Statement demarshallingStatement;
if (type.asUnboxed().isPrimitive() || type.equals(MetaClassFactory.get(String.class))) {
demarshallingStatement = PrimitiveTypeMarshaller.demarshal(type, statement);
}
else {
demarshallingStatement = Stmt.invokeStatic(JSONDecoderCli.class, "decode", statement);
}
return demarshallingStatement;
}
/**
* Works for all types that have a 'copy constructor', a toString() representation
* and a valueOf() method (all primitive wrapper types and java.lang.String).
*/
private static class PrimitiveTypeMarshaller {
private static Statement marshal(MetaClass type, Statement statement) {
return Stmt.nestedCall(Stmt.newObject(type.asBoxed()).withParameters(statement)).invoke("toString");
}
private static Statement demarshal(MetaClass type, Statement statement) {
if (MetaClassFactory.get(void.class).equals(type))
return Stmt.load(null);
return Stmt.invokeStatic(type.asBoxed(), "valueOf", statement);
}
}
}
| 2,642 | 0.724203 | 0.724203 | 68 | 38.176472 | 32.412754 | 107 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.617647 | false | false |
0
|
74189ade9953f51634c09eb566758d2209504e8a
| 16,612,933,543,903 |
0a32261becabac7977852a4d2747d2b58276d5fc
|
/src/main/java/top/leejay/springboot/chapter2/classes/Yellow.java
|
56f18acafdc4ac7d771c6d6cdd489697f931b9f2
|
[] |
no_license
|
xiaokexiang/deep-in-springboot
|
https://github.com/xiaokexiang/deep-in-springboot
|
b6a27225ffcb8f486e28c6a09b869fad2002d7d5
|
fd8ffd0309ad76b264e1cc1346cc32a3c19a8ee8
|
refs/heads/master
| 2021-01-03T06:53:03.892000 | 2020-09-22T09:45:12 | 2020-09-22T09:45:12 | 239,968,714 | 3 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package top.leejay.springboot.chapter2.classes;
/**
* @author xiaokexiang
* @since 2020/2/12
* 2. 配置类
* IOC容器中的名称: top.leejay.springboot.chapter2.ColorConfiguration2; yellow
*/
public class Yellow {
}
|
UTF-8
|
Java
| 225 |
java
|
Yellow.java
|
Java
|
[
{
"context": "eejay.springboot.chapter2.classes;\n\n/**\n * @author xiaokexiang\n * @since 2020/2/12\n * 2. 配置类\n * IOC容器中的名称: top.l",
"end": 75,
"score": 0.9934577941894531,
"start": 64,
"tag": "USERNAME",
"value": "xiaokexiang"
}
] | null |
[] |
package top.leejay.springboot.chapter2.classes;
/**
* @author xiaokexiang
* @since 2020/2/12
* 2. 配置类
* IOC容器中的名称: top.leejay.springboot.chapter2.ColorConfiguration2; yellow
*/
public class Yellow {
}
| 225 | 0.7343 | 0.681159 | 10 | 19.700001 | 22.131651 | 72 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.2 | false | false |
0
|
2bf519c88d078d3aecb8c5ac21b84311cf96a2f8
| 154,618,861,215 |
ac5df03258a05d681c03d62e4d5770e4538f6161
|
/code-maven-plugin/src/main/resources/hbhktemplate/module-web/src/main/java/org/hbhk/${project}/${module}/shared/pojo/${iterator}${typename}Entity.java
|
65ddf13f2f3edb54f0f144092340cee6693ab26a
|
[] |
no_license
|
konglingjuanyi/aili
|
https://github.com/konglingjuanyi/aili
|
4988d1e7b88867939c9b8afb507a3d3b1358555c
|
d73efb1fd36b63a7fa53c8d0db2dabcded321fa8
|
refs/heads/master
| 2021-01-18T09:01:32.738000 | 2015-06-29T14:17:40 | 2015-06-29T14:17:40 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
[#ftl]
[#assign properties="id,createDate,createUser,modifyDate,modifyUser"]
package com.deppon.${project}.module.${module}.shared.domain;
import java.sql.Timestamp;
import java.util.Date;
import com.deppon.foss.framework.entity.BaseEntity;
/**
* ${table.name}
*
* @author DPAP ${.now}
*
*/
public class ${table.typeName}Entity extends BaseEntity {
private static final long serialVersionUID = 1L;
[#list table.columnList as column]
[#if properties?index_of(column.columnName) = -1]
//${column.comment}
private ${column.javaDataType} ${column.columnName};
[/#if]
[/#list]
[#list table.columnList as column]
[#if properties?index_of(column.columnName) = -1]
public ${column.javaDataType} get${column.columnName?cap_first}(){
return ${column.columnName};
}
public void set${column.columnName?cap_first}(${column.javaDataType} ${column.columnName}) {
this.${column.columnName} = ${column.columnName};
}
[/#if]
[/#list]
}
|
UTF-8
|
Java
| 988 |
java
|
${iterator}${typename}Entity.java
|
Java
|
[
{
"context": "aseEntity;\r\n/**\r\n * ${table.name}\r\n * \r\n * @author DPAP ${.now}\r\n * \r\n */\r\npublic class ${table.typeName}",
"end": 290,
"score": 0.999445915222168,
"start": 286,
"tag": "USERNAME",
"value": "DPAP"
}
] | null |
[] |
[#ftl]
[#assign properties="id,createDate,createUser,modifyDate,modifyUser"]
package com.deppon.${project}.module.${module}.shared.domain;
import java.sql.Timestamp;
import java.util.Date;
import com.deppon.foss.framework.entity.BaseEntity;
/**
* ${table.name}
*
* @author DPAP ${.now}
*
*/
public class ${table.typeName}Entity extends BaseEntity {
private static final long serialVersionUID = 1L;
[#list table.columnList as column]
[#if properties?index_of(column.columnName) = -1]
//${column.comment}
private ${column.javaDataType} ${column.columnName};
[/#if]
[/#list]
[#list table.columnList as column]
[#if properties?index_of(column.columnName) = -1]
public ${column.javaDataType} get${column.columnName?cap_first}(){
return ${column.columnName};
}
public void set${column.columnName?cap_first}(${column.javaDataType} ${column.columnName}) {
this.${column.columnName} = ${column.columnName};
}
[/#if]
[/#list]
}
| 988 | 0.681174 | 0.678138 | 35 | 26.285715 | 25.605324 | 93 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.8 | false | false |
0
|
4fe0af68a3d89578fcd51c80ff2737351f74b1e0
| 13,280,038,935,338 |
9c161e5a1154f89f2851c1db37d7b2cfeb440ca5
|
/HackerRank/src/main/java/cmp/softwareAG/TesterClass2.java
|
c1212bde178e2a858f66ae0596e08e2eb7e6d7ad
|
[] |
no_license
|
nehapsb/Practise
|
https://github.com/nehapsb/Practise
|
31bb4fdac518b709e543aac67f369d70dddf6a2b
|
a818a3e4e033c1c780f050aa6c4ccf9094f12c66
|
refs/heads/master
| 2022-12-23T02:15:42.112000 | 2022-12-16T07:37:09 | 2022-12-16T07:37:09 | 144,556,883 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package main.java.cmp.softwareAG;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
public class TesterClass2 {
Map m = new HashMap();
Set s = new HashSet();
public int countStrings(int n){
int[] a = new int[n];
int[] b = new int[n];
a[0] = b[0] = 1;
for(int i = 1; i<n ; i++){
a[i] = a[i-1] + b[i-1];
b[i] = a[i-1];
}
System.out.println(2 << n); //1 << n is equivalent to 2^n
return (1 << n) - a[n-1] - b[n-1];
}
public static void main(String[] args){
String s = "617";
System.out.println("\nPermutations for " + s + " are: \n" + permutationFinder(s));
}
public static Set<String> permutationFinder(String str) {
Set<String> perm = new HashSet<String>();
//Handling error scenarios
if (str == null) {
return null;
} else if (str.length() == 0) {
perm.add("");
return perm;
}
char initial = str.charAt(0); // first character
String rem = str.substring(1); // Full string without first character
Set<String> words = permutationFinder(rem);
for (String strNew : words) {
for (int i = 0;i<=strNew.length();i++){
perm.add(charInsert(strNew, initial, i));
}
}
return perm;
}
public static String charInsert(String str, char c, int j) {
String begin = str.substring(0, j);
String end = str.substring(j);
return begin + c + end;
}
static void ispermuation_divisibleby8(String[] arr) {
for(int i=0; i<Integer.parseInt(arr[0]); i++) {
Set<String> abc = permutationFinder(arr[i]);
Boolean flag = false;
for(String str : abc) {
if(Integer.parseInt(str) %8==0) {
flag=true;
System.out.println("YES");
break;
}
}
if(!flag) {
System.out.println("NO");
}
}
}
}
|
UTF-8
|
Java
| 2,161 |
java
|
TesterClass2.java
|
Java
|
[] | null |
[] |
package main.java.cmp.softwareAG;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
public class TesterClass2 {
Map m = new HashMap();
Set s = new HashSet();
public int countStrings(int n){
int[] a = new int[n];
int[] b = new int[n];
a[0] = b[0] = 1;
for(int i = 1; i<n ; i++){
a[i] = a[i-1] + b[i-1];
b[i] = a[i-1];
}
System.out.println(2 << n); //1 << n is equivalent to 2^n
return (1 << n) - a[n-1] - b[n-1];
}
public static void main(String[] args){
String s = "617";
System.out.println("\nPermutations for " + s + " are: \n" + permutationFinder(s));
}
public static Set<String> permutationFinder(String str) {
Set<String> perm = new HashSet<String>();
//Handling error scenarios
if (str == null) {
return null;
} else if (str.length() == 0) {
perm.add("");
return perm;
}
char initial = str.charAt(0); // first character
String rem = str.substring(1); // Full string without first character
Set<String> words = permutationFinder(rem);
for (String strNew : words) {
for (int i = 0;i<=strNew.length();i++){
perm.add(charInsert(strNew, initial, i));
}
}
return perm;
}
public static String charInsert(String str, char c, int j) {
String begin = str.substring(0, j);
String end = str.substring(j);
return begin + c + end;
}
static void ispermuation_divisibleby8(String[] arr) {
for(int i=0; i<Integer.parseInt(arr[0]); i++) {
Set<String> abc = permutationFinder(arr[i]);
Boolean flag = false;
for(String str : abc) {
if(Integer.parseInt(str) %8==0) {
flag=true;
System.out.println("YES");
break;
}
}
if(!flag) {
System.out.println("NO");
}
}
}
}
| 2,161 | 0.487274 | 0.47478 | 72 | 27.958334 | 20.332266 | 90 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.625 | false | false |
0
|
01e7d1ef659b433085ef516a52c3dcc04be912b5
| 36,344,013,268,598 |
e029acee88b3984914838a6f78da68ff1b4564c4
|
/JavaProgramming/src/main/java/chapter2/MadLibs2.java
|
3e5f8be9bc909b65df97c902d40f44a943f9f48c
|
[] |
no_license
|
yherrera001/CodeAlong
|
https://github.com/yherrera001/CodeAlong
|
ef5024ff0bd04364a35ce52f60185f0adc059b39
|
414fa83bf5bca224ea5a7b1cf9cf949b74fe63aa
|
refs/heads/master
| 2022-12-09T21:39:44.010000 | 2020-09-16T04:54:30 | 2020-09-16T04:54:30 | 295,802,513 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package chapter2;
import java.sql.SQLOutput;
import java.util.Scanner;
public class MadLibs2 {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
//ask for an adjective + season
System.out.println("Enter an adj and a season ");
String adj = scanner.nextLine();
//asking for a whole number + adjective
System.out.println("Enter a whole number with an adj ");
String wholeNumberAdj = scanner.nextLine();
//display
System.out.println("On a " + adj + " day, I drink a minimum of " + wholeNumberAdj +" cups of coffee.");
}
}
|
UTF-8
|
Java
| 637 |
java
|
MadLibs2.java
|
Java
|
[] | null |
[] |
package chapter2;
import java.sql.SQLOutput;
import java.util.Scanner;
public class MadLibs2 {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
//ask for an adjective + season
System.out.println("Enter an adj and a season ");
String adj = scanner.nextLine();
//asking for a whole number + adjective
System.out.println("Enter a whole number with an adj ");
String wholeNumberAdj = scanner.nextLine();
//display
System.out.println("On a " + adj + " day, I drink a minimum of " + wholeNumberAdj +" cups of coffee.");
}
}
| 637 | 0.632653 | 0.629513 | 21 | 29.333334 | 27.859056 | 111 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.47619 | false | false |
0
|
77fc297b1c1fd8176f3f7b2b4a1547d630e29733
| 34,815,004,914,160 |
ce560c4890f7e4b8ea7ff39483a3abfb20d2e984
|
/src/main/java/nl/solutionweb/rbysim/stats/BaseStats.java
|
0e8d2625a7109fb978f48b868df0190c7137c95b
|
[] |
no_license
|
bertptrs/rbysim
|
https://github.com/bertptrs/rbysim
|
05cae701d988c0763e3f1eee87626507eea2675e
|
10bb598094d3d61c803affd27bc570686bfc1a80
|
refs/heads/master
| 2021-06-24T04:50:56.290000 | 2016-02-03T11:49:25 | 2016-02-03T11:49:25 | 26,240,719 | 0 | 0 | null | false | 2021-01-26T11:14:38 | 2014-11-05T21:32:08 | 2021-01-26T11:14:09 | 2021-01-26T11:14:37 | 100 | 0 | 0 | 1 |
Java
| false | false |
package nl.solutionweb.rbysim.stats;
/**
* Class for representing BaseStats.
*
* @author Bert Peters
*/
public class BaseStats extends AbstractStats {
public static final int MAX_VALUE = 0xff;
/**
* Base stat definition for Mew.
*/
public static final BaseStats MEW = new BaseStats(100, 100, 100, 100, 100);
/**
* Base stat definition for Mewtwo.
*/
public static final BaseStats MEWTWO = new BaseStats(106, 110, 90, 130, 154);
public BaseStats(int hp, int attack, int defense, int speed, int special) {
super(attack, defense, speed, special, hp);
}
}
|
UTF-8
|
Java
| 617 |
java
|
BaseStats.java
|
Java
|
[
{
"context": " * Class for representing BaseStats.\n *\n * @author Bert Peters\n */\npublic class BaseStats extends AbstractStats ",
"end": 104,
"score": 0.9996962547302246,
"start": 93,
"tag": "NAME",
"value": "Bert Peters"
}
] | null |
[] |
package nl.solutionweb.rbysim.stats;
/**
* Class for representing BaseStats.
*
* @author <NAME>
*/
public class BaseStats extends AbstractStats {
public static final int MAX_VALUE = 0xff;
/**
* Base stat definition for Mew.
*/
public static final BaseStats MEW = new BaseStats(100, 100, 100, 100, 100);
/**
* Base stat definition for Mewtwo.
*/
public static final BaseStats MEWTWO = new BaseStats(106, 110, 90, 130, 154);
public BaseStats(int hp, int attack, int defense, int speed, int special) {
super(attack, defense, speed, special, hp);
}
}
| 612 | 0.65154 | 0.602917 | 25 | 23.68 | 26.760748 | 81 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.84 | false | false |
0
|
a1e93025c7ed0b45edfcabb9d19dc7ee4ed26c09
| 13,280,038,941,538 |
c4ea58f4ee01230fe4ca13878dad9023d03f1d62
|
/src/main/java/org/gvm/product/gvmpoin/module/rewardsystem/promotion/PromotionRepository.java
|
34c6f00539760201168a7c878ceb499f55dfb96e
|
[] |
no_license
|
christianekasaputratog/oauth2-sample-gpoin
|
https://github.com/christianekasaputratog/oauth2-sample-gpoin
|
6f91a26559bfcdecf68b3bc2943d714459a7913c
|
baf2ba2dd5b396b8171839bec2ec55065ced3454
|
refs/heads/master
| 2022-10-05T09:15:55.176000 | 2020-06-04T11:05:25 | 2020-06-04T11:05:25 | 269,336,549 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package org.gvm.product.gvmpoin.module.rewardsystem.promotion;
import org.gvm.product.gvmpoin.module.common.BaseRepository;
import org.gvm.product.gvmpoin.module.common.GlobalStatus;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import java.util.List;
/**
* Created by bobbi.sinaga on 7/17/2017.
*/
public interface PromotionRepository extends BaseRepository<Promotion, Long> {
@Query(value = "SELECT p FROM Promotion p WHERE p.status = :globalStatus AND p.id IN :ids ")
List<Promotion> findAllByStatusByIds(@Param("globalStatus") Integer globalStatus,
Pageable pageable, @Param("ids") List<Long> ids);
}
|
UTF-8
|
Java
| 734 |
java
|
PromotionRepository.java
|
Java
|
[
{
"context": ".Param;\n\nimport java.util.List;\n\n/**\n * Created by bobbi.sinaga on 7/17/2017.\n */\npublic interface PromotionRepos",
"end": 398,
"score": 0.9988597631454468,
"start": 386,
"tag": "USERNAME",
"value": "bobbi.sinaga"
}
] | null |
[] |
package org.gvm.product.gvmpoin.module.rewardsystem.promotion;
import org.gvm.product.gvmpoin.module.common.BaseRepository;
import org.gvm.product.gvmpoin.module.common.GlobalStatus;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import java.util.List;
/**
* Created by bobbi.sinaga on 7/17/2017.
*/
public interface PromotionRepository extends BaseRepository<Promotion, Long> {
@Query(value = "SELECT p FROM Promotion p WHERE p.status = :globalStatus AND p.id IN :ids ")
List<Promotion> findAllByStatusByIds(@Param("globalStatus") Integer globalStatus,
Pageable pageable, @Param("ids") List<Long> ids);
}
| 734 | 0.786104 | 0.776567 | 19 | 37.684212 | 31.697672 | 95 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.578947 | false | false |
0
|
ed867961ee6ca208db448dcc03048ad34e61d213
| 26,199,300,546,295 |
ac4a1db687c14ff29af5d870d10263841b9d3577
|
/src/eu/senla/JavaLab33/actions/bookings/DisplayGuestsByKey.java
|
83bf8a8a644e62256caf4cb4f8c7dd29694d99ab
|
[] |
no_license
|
vadimbitel/Lab4
|
https://github.com/vadimbitel/Lab4
|
8d0afe1aa2a0c7422c95bce8a12fae7ddf58eb05
|
c1791027221bdcd4c74305bd690a39903a348e1e
|
refs/heads/master
| 2023-05-05T23:48:15.703000 | 2021-05-05T14:14:54 | 2021-05-05T14:14:54 | 364,989,944 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package eu.senla.JavaLab33.actions.bookings;
import eu.senla.JavaLab33.actions.Action;
import eu.senla.JavaLab33.controllers.BookingController;
import eu.senla.JavaLab33.controllers.GuestController;
import eu.senla.JavaLab33.controllers.RoomController;
import eu.senla.JavaLab33.exceptions.WrongChoiceException;
import eu.senla.JavaLab33.model.Booking;
import eu.senla.JavaLab33.model.Guest;
import eu.senla.JavaLab33.model.enums.RoomStatus;
import eu.senla.JavaLab33.utils.ConsoleUtil;
import java.util.Comparator;
import java.util.Date;
import java.util.List;
public class DisplayGuestsByKey implements Action {
GuestController guestController = GuestController.getInstance();
RoomController roomController = RoomController.getInstance();
@Override
public void execute() throws Exception {
BookingController bookingController = BookingController.getInstance();
System.out.print("""
Список постояльцев и их номеров, отсортированный по:
1. По алфавиту
2. По дате освобождения
Ваш выбор:\s""");
byte choice = ConsoleUtil.getScanner().nextByte();
System.out.println();
Date currentDate = new Date();
switch (choice) {
case 1:
search(guestController.getGuestsSortedByKey(Comparator.comparing(Guest::getSecondName)),
currentDate,
bookingController.getAllBookings());
break;
case 2:
search(guestController.getAllGuests(),
currentDate,
bookingController.getBookingsSortedByKey(Comparator.comparing(Booking::getCheckOutDate)));
break;
default:
throw new WrongChoiceException();
}
}
private void search(List<Guest> guests, Date currentDate, List<Booking> bookings) {
for (Guest guest : guests) {
for (Booking booking : bookings) {
if (booking.getRoom().getStatus() == RoomStatus.SERVED &&
booking.getGuests().contains(guest) &&
booking.getCheckOutDate().getTime() > currentDate.getTime()) {
guestController.displayGuestInfo(guest.getId());
roomController.displayRoomInfo(booking.getRoom().getId());
}
}
}
}
}
|
UTF-8
|
Java
| 2,511 |
java
|
DisplayGuestsByKey.java
|
Java
|
[] | null |
[] |
package eu.senla.JavaLab33.actions.bookings;
import eu.senla.JavaLab33.actions.Action;
import eu.senla.JavaLab33.controllers.BookingController;
import eu.senla.JavaLab33.controllers.GuestController;
import eu.senla.JavaLab33.controllers.RoomController;
import eu.senla.JavaLab33.exceptions.WrongChoiceException;
import eu.senla.JavaLab33.model.Booking;
import eu.senla.JavaLab33.model.Guest;
import eu.senla.JavaLab33.model.enums.RoomStatus;
import eu.senla.JavaLab33.utils.ConsoleUtil;
import java.util.Comparator;
import java.util.Date;
import java.util.List;
public class DisplayGuestsByKey implements Action {
GuestController guestController = GuestController.getInstance();
RoomController roomController = RoomController.getInstance();
@Override
public void execute() throws Exception {
BookingController bookingController = BookingController.getInstance();
System.out.print("""
Список постояльцев и их номеров, отсортированный по:
1. По алфавиту
2. По дате освобождения
Ваш выбор:\s""");
byte choice = ConsoleUtil.getScanner().nextByte();
System.out.println();
Date currentDate = new Date();
switch (choice) {
case 1:
search(guestController.getGuestsSortedByKey(Comparator.comparing(Guest::getSecondName)),
currentDate,
bookingController.getAllBookings());
break;
case 2:
search(guestController.getAllGuests(),
currentDate,
bookingController.getBookingsSortedByKey(Comparator.comparing(Booking::getCheckOutDate)));
break;
default:
throw new WrongChoiceException();
}
}
private void search(List<Guest> guests, Date currentDate, List<Booking> bookings) {
for (Guest guest : guests) {
for (Booking booking : bookings) {
if (booking.getRoom().getStatus() == RoomStatus.SERVED &&
booking.getGuests().contains(guest) &&
booking.getCheckOutDate().getTime() > currentDate.getTime()) {
guestController.displayGuestInfo(guest.getId());
roomController.displayRoomInfo(booking.getRoom().getId());
}
}
}
}
}
| 2,511 | 0.630605 | 0.620732 | 65 | 36.400002 | 27.741554 | 114 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.523077 | false | false |
0
|
b739430de041050267fec015927656f5a4bf1724
| 37,812,892,075,077 |
647ec12ce50f06e7380fdbfb5b71e9e2d1ac03b4
|
/com.tencent.minihd.qq/assets/exlibs.1.jar/classes.jar/com/tencent/mobileqq/theme/diy/ScrollLayout.java
|
6eef978c07ca3f7185bb9cba7e14950a12adf369
|
[] |
no_license
|
tsuzcx/qq_apk
|
https://github.com/tsuzcx/qq_apk
|
0d5e792c3c7351ab781957bac465c55c505caf61
|
afe46ef5640d0ba6850cdefd3c11badbd725a3f6
|
refs/heads/main
| 2022-07-02T10:32:11.651000 | 2022-02-01T12:41:38 | 2022-02-01T12:41:38 | 453,860,108 | 36 | 9 | null | false | 2022-01-31T09:46:26 | 2022-01-31T02:43:22 | 2022-01-31T06:56:43 | 2022-01-31T09:46:26 | 167,304 | 0 | 1 | 1 |
Java
| false | false |
package com.tencent.mobileqq.theme.diy;
import android.content.Context;
import android.os.Handler;
import android.os.Message;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.VelocityTracker;
import android.view.View;
import android.view.View.MeasureSpec;
import android.view.ViewConfiguration;
import android.view.ViewGroup;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.view.animation.ScaleAnimation;
import android.widget.Scroller;
import java.io.PrintStream;
public class ScrollLayout
extends ViewGroup
{
static final float ALPHA_H = 1.0F;
static final float ALPHA_L = 0.4F;
static final float ALPHA_STEP = 0.6F;
static final float SCALE_H = 1.2F;
static final float SCALE_L = 1.0F;
static final float SCALE_STEP = 0.2000001F;
static final int SNAP_VELOCITY = 600;
static final String TAG = "ScrollLayout";
static final int TOUCH_STATE_REST = 0;
static final int TOUCH_STATE_SCROLLING = 1;
int frameWidth = 0;
int mCurScreen;
int mDefaultScreen = 0;
Handler mHandler = null;
float mLastMotionX;
Scroller mScroller;
int mTouchSlop;
int mTouchState = 0;
VelocityTracker mVelocityTracker;
ScrollLayout.OnScreenChangeListener onScreenChangeListener;
ScrollLayout.OnScreenChangeListenerDataLoad onScreenChangeListenerDataLoad;
public ScrollLayout(Context paramContext, AttributeSet paramAttributeSet)
{
this(paramContext, paramAttributeSet, 0);
}
public ScrollLayout(Context paramContext, AttributeSet paramAttributeSet, int paramInt)
{
super(paramContext, paramAttributeSet, paramInt);
this.mScroller = new Scroller(paramContext);
this.mCurScreen = this.mDefaultScreen;
this.mTouchSlop = ViewConfiguration.get(getContext()).getScaledTouchSlop();
this.mHandler = new ScrollLayout.1(this);
}
public boolean changeAlpha(View paramView, boolean paramBoolean, int paramInt)
{
if ((paramView == null) || (!(paramView.getTag() instanceof ThemeDIYActivity.ViewHolder))) {
return false;
}
ThemeDIYActivity.ViewHolder localViewHolder = (ThemeDIYActivity.ViewHolder)paramView.getTag();
label99:
label113:
Object localObject;
if (((paramBoolean) && (localViewHolder.scale == 1.0F)) || ((!paramBoolean) && (localViewHolder.scale == 1.2F)))
{
if (((paramBoolean) && (localViewHolder.alpha == 0.4F)) || ((!paramBoolean) && (localViewHolder.alpha == 1.0F))) {
return true;
}
}
else
{
float f3 = localViewHolder.scale;
if (paramBoolean)
{
f1 = 1.0F;
float f4 = localViewHolder.scale;
if (!paramBoolean) {
break label183;
}
f2 = 1.0F;
localObject = new ScaleAnimation(f3, f1, f4, f2, 1, 0.5F, 1, 0.5F);
((ScaleAnimation)localObject).setDuration(paramInt);
((ScaleAnimation)localObject).setFillAfter(true);
localViewHolder.scaleView.startAnimation((Animation)localObject);
if (!paramBoolean) {
break label190;
}
}
label183:
label190:
for (f1 = 1.0F;; f1 = 1.2F)
{
localViewHolder.scale = f1;
break;
f1 = 1.2F;
break label99;
f2 = 1.2F;
break label113;
}
}
float f2 = localViewHolder.alpha;
if (paramBoolean)
{
f1 = 0.4F;
label212:
localObject = new AlphaAnimation(f2, f1);
((AlphaAnimation)localObject).setFillAfter(true);
((AlphaAnimation)localObject).setDuration(paramInt);
paramView.startAnimation((Animation)localObject);
if (!paramBoolean) {
break label268;
}
}
label268:
for (float f1 = 0.4F;; f1 = 1.0F)
{
localViewHolder.alpha = f1;
break;
f1 = 1.0F;
break label212;
}
}
void changeAlphaImmediately(int paramInt)
{
View localView = super.getChildAt(paramInt);
if (localView == null) {
return;
}
changeAlphaImmediately(localView, 1.0F - Math.abs((getScrollX() - localView.getLeft() * 1.0F) / getFrameWith()) * 0.6F, 0);
}
boolean changeAlphaImmediately(View paramView, float paramFloat, int paramInt)
{
boolean bool = true;
if ((paramView == null) || (!(paramView.getTag() instanceof ThemeDIYActivity.ViewHolder))) {
bool = false;
}
ThemeDIYActivity.ViewHolder localViewHolder;
do
{
return bool;
localViewHolder = (ThemeDIYActivity.ViewHolder)paramView.getTag();
} while (localViewHolder.alpha == paramFloat);
AlphaAnimation localAlphaAnimation = new AlphaAnimation(localViewHolder.alpha, paramFloat);
localAlphaAnimation.setFillAfter(true);
localAlphaAnimation.setDuration(paramInt);
paramView.startAnimation(localAlphaAnimation);
localViewHolder.alpha = paramFloat;
paramFloat = 1.0F + (paramFloat - 0.4F) / 0.6F * 0.2000001F;
paramView = new ScaleAnimation(localViewHolder.scale, paramFloat, localViewHolder.scale, paramFloat, 1, 0.5F, 1, 0.5F);
paramView.setFillAfter(true);
paramView.setDuration(paramInt);
localViewHolder.scaleView.startAnimation(paramView);
localViewHolder.scale = paramFloat;
return true;
}
public void computeScroll()
{
if (this.mScroller.computeScrollOffset())
{
super.scrollTo(this.mScroller.getCurrX(), this.mScroller.getCurrY());
postInvalidate();
}
}
public int getCurScreen()
{
return this.mCurScreen;
}
int getFrameWith()
{
if (this.frameWidth == 0) {
this.frameWidth = ((int)(getWidth() * 0.72D));
}
return this.frameWidth;
}
public boolean onInterceptTouchEvent(MotionEvent paramMotionEvent)
{
int i = paramMotionEvent.getAction();
if ((i == 2) && (this.mTouchState != 0)) {}
for (;;)
{
return true;
float f = paramMotionEvent.getX();
paramMotionEvent.getY();
switch (i)
{
}
while (this.mTouchState == 0)
{
return false;
if ((int)Math.abs(this.mLastMotionX - f) > this.mTouchSlop)
{
this.mTouchState = 1;
continue;
this.mLastMotionX = f;
if (this.mScroller.isFinished()) {}
for (i = 0;; i = 1)
{
this.mTouchState = i;
break;
}
this.mTouchState = 0;
}
}
}
}
protected void onLayout(boolean paramBoolean, int paramInt1, int paramInt2, int paramInt3, int paramInt4)
{
paramInt4 = super.getChildCount();
System.out.println("childCount=" + paramInt4);
paramInt1 = 0;
for (paramInt2 = 0; paramInt1 < paramInt4; paramInt2 = paramInt3)
{
View localView = super.getChildAt(paramInt1);
paramInt3 = paramInt2;
if (localView.getVisibility() != 8)
{
paramInt3 = getFrameWith();
localView.layout(paramInt2, 0, getWidth() + paramInt2, localView.getMeasuredHeight());
paramInt3 = paramInt2 + paramInt3;
}
paramInt1 += 1;
}
}
protected void onMeasure(int paramInt1, int paramInt2)
{
super.onMeasure(paramInt1, paramInt2);
int j = getFrameWith();
if (View.MeasureSpec.getMode(paramInt1) != 1073741824) {
throw new IllegalStateException("ScrollLayout only canmCurScreen run at EXACTLY mode!");
}
if (View.MeasureSpec.getMode(paramInt2) != 1073741824) {
throw new IllegalStateException("ScrollLayout only can run at EXACTLY mode!");
}
int k = super.getChildCount();
int i = 0;
while (i < k)
{
super.getChildAt(i).measure(paramInt1, paramInt2);
i += 1;
}
System.out.println("moving to screen " + this.mCurScreen);
super.scrollTo(this.mCurScreen * j, 0);
}
public boolean onTouchEvent(MotionEvent paramMotionEvent)
{
if (this.mVelocityTracker == null) {
this.mVelocityTracker = VelocityTracker.obtain();
}
this.mVelocityTracker.addMovement(paramMotionEvent);
int i = paramMotionEvent.getAction();
float f = paramMotionEvent.getX();
paramMotionEvent.getY();
switch (i)
{
}
for (;;)
{
return true;
if (!this.mScroller.isFinished()) {
this.mScroller.abortAnimation();
}
this.mLastMotionX = f;
continue;
i = (int)(this.mLastMotionX - f);
this.mLastMotionX = f;
scrollBy(i, 0);
i = (getScrollX() + getFrameWith() / 2) / getFrameWith();
changeAlphaImmediately(i);
if (i > 0) {
changeAlphaImmediately(i - 1);
}
if (i < super.getChildCount() - 1)
{
changeAlphaImmediately(i + 1);
continue;
paramMotionEvent = this.mVelocityTracker;
paramMotionEvent.computeCurrentVelocity(1000);
i = (int)paramMotionEvent.getXVelocity();
if ((i > 600) && (this.mCurScreen > 0))
{
this.onScreenChangeListener.onScreenChange(this.mCurScreen - 1);
System.out.println("mCurScreen=" + (this.mCurScreen - 1));
snapToScreen(this.mCurScreen - 1);
}
for (;;)
{
if (this.mVelocityTracker != null)
{
this.mVelocityTracker.recycle();
this.mVelocityTracker = null;
}
this.mTouchState = 0;
break;
if ((i < -600) && (this.mCurScreen < super.getChildCount() - 1))
{
this.onScreenChangeListener.onScreenChange(this.mCurScreen + 1);
this.onScreenChangeListenerDataLoad.onScreenChange(this.mCurScreen + 1);
snapToScreen(this.mCurScreen + 1);
}
else
{
snapToDestination();
}
}
this.mTouchState = 0;
}
}
}
public void setOnScreenChangeListener(ScrollLayout.OnScreenChangeListener paramOnScreenChangeListener)
{
this.onScreenChangeListener = paramOnScreenChangeListener;
}
public void setOnScreenChangeListenerDataLoad(ScrollLayout.OnScreenChangeListenerDataLoad paramOnScreenChangeListenerDataLoad)
{
this.onScreenChangeListenerDataLoad = paramOnScreenChangeListenerDataLoad;
}
public void setToScreen(int paramInt1, int paramInt2)
{
View localView = super.getChildAt(paramInt1);
if ((localView == null) || (!(localView.getTag() instanceof ThemeDIYActivity.ViewHolder))) {}
do
{
return;
ThemeDIYActivity.ViewHolder localViewHolder = (ThemeDIYActivity.ViewHolder)localView.getTag();
localViewHolder.alpha -= 0.01F;
changeAlpha(localView, false, paramInt2);
if (paramInt1 > 0) {
changeAlpha(super.getChildAt(paramInt1 - 1), true, paramInt2);
}
} while (paramInt1 >= super.getChildCount() - 1);
changeAlpha(super.getChildAt(paramInt1 + 1), true, paramInt2);
}
public void snapToDestination()
{
int i = (getScrollX() + getFrameWith() / 2) / getFrameWith();
snapToScreen(i);
this.onScreenChangeListener.onScreenChange(i);
}
public void snapToScreen(int paramInt)
{
int i = 300;
int j = Math.max(0, Math.min(paramInt, super.getChildCount() - 1));
int k;
if (getScrollX() != getFrameWith() * j)
{
k = getFrameWith() * j - getScrollX();
paramInt = Math.abs(k) * 2;
if (paramInt >= 300) {
break label111;
}
paramInt = i;
}
label111:
for (;;)
{
this.mScroller.startScroll(getScrollX(), 0, k, 0, paramInt);
this.mCurScreen = j;
invalidate();
this.mHandler.sendMessageDelayed(Message.obtain(this.mHandler, j, Integer.valueOf(paramInt)), 10L);
return;
}
}
}
/* Location: L:\local\mybackup\temp\qq_apk\com.tencent.minihd.qq\assets\exlibs.1.jar\classes.jar
* Qualified Name: com.tencent.mobileqq.theme.diy.ScrollLayout
* JD-Core Version: 0.7.0.1
*/
|
UTF-8
|
Java
| 12,208 |
java
|
ScrollLayout.java
|
Java
|
[] | null |
[] |
package com.tencent.mobileqq.theme.diy;
import android.content.Context;
import android.os.Handler;
import android.os.Message;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.VelocityTracker;
import android.view.View;
import android.view.View.MeasureSpec;
import android.view.ViewConfiguration;
import android.view.ViewGroup;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.view.animation.ScaleAnimation;
import android.widget.Scroller;
import java.io.PrintStream;
public class ScrollLayout
extends ViewGroup
{
static final float ALPHA_H = 1.0F;
static final float ALPHA_L = 0.4F;
static final float ALPHA_STEP = 0.6F;
static final float SCALE_H = 1.2F;
static final float SCALE_L = 1.0F;
static final float SCALE_STEP = 0.2000001F;
static final int SNAP_VELOCITY = 600;
static final String TAG = "ScrollLayout";
static final int TOUCH_STATE_REST = 0;
static final int TOUCH_STATE_SCROLLING = 1;
int frameWidth = 0;
int mCurScreen;
int mDefaultScreen = 0;
Handler mHandler = null;
float mLastMotionX;
Scroller mScroller;
int mTouchSlop;
int mTouchState = 0;
VelocityTracker mVelocityTracker;
ScrollLayout.OnScreenChangeListener onScreenChangeListener;
ScrollLayout.OnScreenChangeListenerDataLoad onScreenChangeListenerDataLoad;
public ScrollLayout(Context paramContext, AttributeSet paramAttributeSet)
{
this(paramContext, paramAttributeSet, 0);
}
public ScrollLayout(Context paramContext, AttributeSet paramAttributeSet, int paramInt)
{
super(paramContext, paramAttributeSet, paramInt);
this.mScroller = new Scroller(paramContext);
this.mCurScreen = this.mDefaultScreen;
this.mTouchSlop = ViewConfiguration.get(getContext()).getScaledTouchSlop();
this.mHandler = new ScrollLayout.1(this);
}
public boolean changeAlpha(View paramView, boolean paramBoolean, int paramInt)
{
if ((paramView == null) || (!(paramView.getTag() instanceof ThemeDIYActivity.ViewHolder))) {
return false;
}
ThemeDIYActivity.ViewHolder localViewHolder = (ThemeDIYActivity.ViewHolder)paramView.getTag();
label99:
label113:
Object localObject;
if (((paramBoolean) && (localViewHolder.scale == 1.0F)) || ((!paramBoolean) && (localViewHolder.scale == 1.2F)))
{
if (((paramBoolean) && (localViewHolder.alpha == 0.4F)) || ((!paramBoolean) && (localViewHolder.alpha == 1.0F))) {
return true;
}
}
else
{
float f3 = localViewHolder.scale;
if (paramBoolean)
{
f1 = 1.0F;
float f4 = localViewHolder.scale;
if (!paramBoolean) {
break label183;
}
f2 = 1.0F;
localObject = new ScaleAnimation(f3, f1, f4, f2, 1, 0.5F, 1, 0.5F);
((ScaleAnimation)localObject).setDuration(paramInt);
((ScaleAnimation)localObject).setFillAfter(true);
localViewHolder.scaleView.startAnimation((Animation)localObject);
if (!paramBoolean) {
break label190;
}
}
label183:
label190:
for (f1 = 1.0F;; f1 = 1.2F)
{
localViewHolder.scale = f1;
break;
f1 = 1.2F;
break label99;
f2 = 1.2F;
break label113;
}
}
float f2 = localViewHolder.alpha;
if (paramBoolean)
{
f1 = 0.4F;
label212:
localObject = new AlphaAnimation(f2, f1);
((AlphaAnimation)localObject).setFillAfter(true);
((AlphaAnimation)localObject).setDuration(paramInt);
paramView.startAnimation((Animation)localObject);
if (!paramBoolean) {
break label268;
}
}
label268:
for (float f1 = 0.4F;; f1 = 1.0F)
{
localViewHolder.alpha = f1;
break;
f1 = 1.0F;
break label212;
}
}
void changeAlphaImmediately(int paramInt)
{
View localView = super.getChildAt(paramInt);
if (localView == null) {
return;
}
changeAlphaImmediately(localView, 1.0F - Math.abs((getScrollX() - localView.getLeft() * 1.0F) / getFrameWith()) * 0.6F, 0);
}
boolean changeAlphaImmediately(View paramView, float paramFloat, int paramInt)
{
boolean bool = true;
if ((paramView == null) || (!(paramView.getTag() instanceof ThemeDIYActivity.ViewHolder))) {
bool = false;
}
ThemeDIYActivity.ViewHolder localViewHolder;
do
{
return bool;
localViewHolder = (ThemeDIYActivity.ViewHolder)paramView.getTag();
} while (localViewHolder.alpha == paramFloat);
AlphaAnimation localAlphaAnimation = new AlphaAnimation(localViewHolder.alpha, paramFloat);
localAlphaAnimation.setFillAfter(true);
localAlphaAnimation.setDuration(paramInt);
paramView.startAnimation(localAlphaAnimation);
localViewHolder.alpha = paramFloat;
paramFloat = 1.0F + (paramFloat - 0.4F) / 0.6F * 0.2000001F;
paramView = new ScaleAnimation(localViewHolder.scale, paramFloat, localViewHolder.scale, paramFloat, 1, 0.5F, 1, 0.5F);
paramView.setFillAfter(true);
paramView.setDuration(paramInt);
localViewHolder.scaleView.startAnimation(paramView);
localViewHolder.scale = paramFloat;
return true;
}
public void computeScroll()
{
if (this.mScroller.computeScrollOffset())
{
super.scrollTo(this.mScroller.getCurrX(), this.mScroller.getCurrY());
postInvalidate();
}
}
public int getCurScreen()
{
return this.mCurScreen;
}
int getFrameWith()
{
if (this.frameWidth == 0) {
this.frameWidth = ((int)(getWidth() * 0.72D));
}
return this.frameWidth;
}
public boolean onInterceptTouchEvent(MotionEvent paramMotionEvent)
{
int i = paramMotionEvent.getAction();
if ((i == 2) && (this.mTouchState != 0)) {}
for (;;)
{
return true;
float f = paramMotionEvent.getX();
paramMotionEvent.getY();
switch (i)
{
}
while (this.mTouchState == 0)
{
return false;
if ((int)Math.abs(this.mLastMotionX - f) > this.mTouchSlop)
{
this.mTouchState = 1;
continue;
this.mLastMotionX = f;
if (this.mScroller.isFinished()) {}
for (i = 0;; i = 1)
{
this.mTouchState = i;
break;
}
this.mTouchState = 0;
}
}
}
}
protected void onLayout(boolean paramBoolean, int paramInt1, int paramInt2, int paramInt3, int paramInt4)
{
paramInt4 = super.getChildCount();
System.out.println("childCount=" + paramInt4);
paramInt1 = 0;
for (paramInt2 = 0; paramInt1 < paramInt4; paramInt2 = paramInt3)
{
View localView = super.getChildAt(paramInt1);
paramInt3 = paramInt2;
if (localView.getVisibility() != 8)
{
paramInt3 = getFrameWith();
localView.layout(paramInt2, 0, getWidth() + paramInt2, localView.getMeasuredHeight());
paramInt3 = paramInt2 + paramInt3;
}
paramInt1 += 1;
}
}
protected void onMeasure(int paramInt1, int paramInt2)
{
super.onMeasure(paramInt1, paramInt2);
int j = getFrameWith();
if (View.MeasureSpec.getMode(paramInt1) != 1073741824) {
throw new IllegalStateException("ScrollLayout only canmCurScreen run at EXACTLY mode!");
}
if (View.MeasureSpec.getMode(paramInt2) != 1073741824) {
throw new IllegalStateException("ScrollLayout only can run at EXACTLY mode!");
}
int k = super.getChildCount();
int i = 0;
while (i < k)
{
super.getChildAt(i).measure(paramInt1, paramInt2);
i += 1;
}
System.out.println("moving to screen " + this.mCurScreen);
super.scrollTo(this.mCurScreen * j, 0);
}
public boolean onTouchEvent(MotionEvent paramMotionEvent)
{
if (this.mVelocityTracker == null) {
this.mVelocityTracker = VelocityTracker.obtain();
}
this.mVelocityTracker.addMovement(paramMotionEvent);
int i = paramMotionEvent.getAction();
float f = paramMotionEvent.getX();
paramMotionEvent.getY();
switch (i)
{
}
for (;;)
{
return true;
if (!this.mScroller.isFinished()) {
this.mScroller.abortAnimation();
}
this.mLastMotionX = f;
continue;
i = (int)(this.mLastMotionX - f);
this.mLastMotionX = f;
scrollBy(i, 0);
i = (getScrollX() + getFrameWith() / 2) / getFrameWith();
changeAlphaImmediately(i);
if (i > 0) {
changeAlphaImmediately(i - 1);
}
if (i < super.getChildCount() - 1)
{
changeAlphaImmediately(i + 1);
continue;
paramMotionEvent = this.mVelocityTracker;
paramMotionEvent.computeCurrentVelocity(1000);
i = (int)paramMotionEvent.getXVelocity();
if ((i > 600) && (this.mCurScreen > 0))
{
this.onScreenChangeListener.onScreenChange(this.mCurScreen - 1);
System.out.println("mCurScreen=" + (this.mCurScreen - 1));
snapToScreen(this.mCurScreen - 1);
}
for (;;)
{
if (this.mVelocityTracker != null)
{
this.mVelocityTracker.recycle();
this.mVelocityTracker = null;
}
this.mTouchState = 0;
break;
if ((i < -600) && (this.mCurScreen < super.getChildCount() - 1))
{
this.onScreenChangeListener.onScreenChange(this.mCurScreen + 1);
this.onScreenChangeListenerDataLoad.onScreenChange(this.mCurScreen + 1);
snapToScreen(this.mCurScreen + 1);
}
else
{
snapToDestination();
}
}
this.mTouchState = 0;
}
}
}
public void setOnScreenChangeListener(ScrollLayout.OnScreenChangeListener paramOnScreenChangeListener)
{
this.onScreenChangeListener = paramOnScreenChangeListener;
}
public void setOnScreenChangeListenerDataLoad(ScrollLayout.OnScreenChangeListenerDataLoad paramOnScreenChangeListenerDataLoad)
{
this.onScreenChangeListenerDataLoad = paramOnScreenChangeListenerDataLoad;
}
public void setToScreen(int paramInt1, int paramInt2)
{
View localView = super.getChildAt(paramInt1);
if ((localView == null) || (!(localView.getTag() instanceof ThemeDIYActivity.ViewHolder))) {}
do
{
return;
ThemeDIYActivity.ViewHolder localViewHolder = (ThemeDIYActivity.ViewHolder)localView.getTag();
localViewHolder.alpha -= 0.01F;
changeAlpha(localView, false, paramInt2);
if (paramInt1 > 0) {
changeAlpha(super.getChildAt(paramInt1 - 1), true, paramInt2);
}
} while (paramInt1 >= super.getChildCount() - 1);
changeAlpha(super.getChildAt(paramInt1 + 1), true, paramInt2);
}
public void snapToDestination()
{
int i = (getScrollX() + getFrameWith() / 2) / getFrameWith();
snapToScreen(i);
this.onScreenChangeListener.onScreenChange(i);
}
public void snapToScreen(int paramInt)
{
int i = 300;
int j = Math.max(0, Math.min(paramInt, super.getChildCount() - 1));
int k;
if (getScrollX() != getFrameWith() * j)
{
k = getFrameWith() * j - getScrollX();
paramInt = Math.abs(k) * 2;
if (paramInt >= 300) {
break label111;
}
paramInt = i;
}
label111:
for (;;)
{
this.mScroller.startScroll(getScrollX(), 0, k, 0, paramInt);
this.mCurScreen = j;
invalidate();
this.mHandler.sendMessageDelayed(Message.obtain(this.mHandler, j, Integer.valueOf(paramInt)), 10L);
return;
}
}
}
/* Location: L:\local\mybackup\temp\qq_apk\com.tencent.minihd.qq\assets\exlibs.1.jar\classes.jar
* Qualified Name: com.tencent.mobileqq.theme.diy.ScrollLayout
* JD-Core Version: 0.7.0.1
*/
| 12,208 | 0.620331 | 0.597313 | 390 | 29.317949 | 26.79421 | 128 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.694872 | false | false |
0
|
22fa1b2e29152e18f889311fc54abdaea3621d79
| 34,162,169,897,519 |
3db4fa0806538cf0beceb9fa150b3ab4b92c0c99
|
/src/com/graduate/childsecure/activity/BaseActivity.java
|
ea273e9e237980c78c8df490f5487751c0fc4021
|
[] |
no_license
|
mrzou/CAS
|
https://github.com/mrzou/CAS
|
467146b99b4e0332c16dfabd3b96b32ebf392462
|
2f9eab99da285e82141289155c66bb5039889a1e
|
refs/heads/master
| 2021-01-01T04:56:41.668000 | 2016-04-24T16:08:41 | 2016-04-24T16:08:41 | 56,657,180 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.graduate.childsecure.activity;
import cn.bmob.im.BmobUserManager;
import android.app.Activity;
import android.os.Bundle;
public class BaseActivity extends Activity {
BmobUserManager userManager;
public static String applicationId = "5484c31f27bcf5e6c8fa6ebe4ce44851";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
userManager = BmobUserManager.getInstance(this);
}
public void onDetach() {
// TODO Auto-generated method stub
}
}
|
UTF-8
|
Java
| 516 |
java
|
BaseActivity.java
|
Java
|
[] | null |
[] |
package com.graduate.childsecure.activity;
import cn.bmob.im.BmobUserManager;
import android.app.Activity;
import android.os.Bundle;
public class BaseActivity extends Activity {
BmobUserManager userManager;
public static String applicationId = "5484c31f27bcf5e6c8fa6ebe4ce44851";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
userManager = BmobUserManager.getInstance(this);
}
public void onDetach() {
// TODO Auto-generated method stub
}
}
| 516 | 0.790698 | 0.755814 | 22 | 22.454546 | 21.379105 | 73 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.090909 | false | false |
0
|
d79e2e8914310cb0d00b10b4b0ca4c7df45d909e
| 26,508,538,193,301 |
75e4eb632e0a617b482e1c65c301e71a1db0cc91
|
/src/com/legend/scheduler/CreateLogTablesTask.java
|
a4c7a961fac6bfae092583167abae1b4781ef807
|
[] |
no_license
|
Airche/DataCollectionSystem
|
https://github.com/Airche/DataCollectionSystem
|
6b35ba333403966a86211fa9d3542352167856cd
|
e6869f0ef6df54a76ed4c5dd6d0ea79be7eace2d
|
refs/heads/master
| 2020-12-02T06:35:01.892000 | 2016-04-01T02:03:43 | 2016-04-01T02:03:43 | 96,858,282 | 1 | 0 | null | true | 2017-07-11T06:23:11 | 2017-07-11T06:23:11 | 2016-01-26T13:06:47 | 2016-04-01T02:03:44 | 31,981 | 0 | 0 | 0 | null | null | null |
package com.legend.scheduler;
import javax.annotation.Resource;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.scheduling.quartz.QuartzJobBean;
import com.legend.service.LogService;
import com.legend.util.LogUtil;
/**
* 创建石英任务
*
*/
public class CreateLogTablesTask extends QuartzJobBean{
private LogService logService;
public void setLogService(LogService logService) {
this.logService = logService;
}
/**
* 生成日志表
*/
protected void executeInternal(JobExecutionContext arg0) throws JobExecutionException {
String tableName = LogUtil.generateLogTableName(1);
logService.createLogTable(tableName);
tableName = LogUtil.generateLogTableName(2);
logService.createLogTable(tableName);
tableName = LogUtil.generateLogTableName(3);
logService.createLogTable(tableName);
}
}
|
UTF-8
|
Java
| 942 |
java
|
CreateLogTablesTask.java
|
Java
|
[] | null |
[] |
package com.legend.scheduler;
import javax.annotation.Resource;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.scheduling.quartz.QuartzJobBean;
import com.legend.service.LogService;
import com.legend.util.LogUtil;
/**
* 创建石英任务
*
*/
public class CreateLogTablesTask extends QuartzJobBean{
private LogService logService;
public void setLogService(LogService logService) {
this.logService = logService;
}
/**
* 生成日志表
*/
protected void executeInternal(JobExecutionContext arg0) throws JobExecutionException {
String tableName = LogUtil.generateLogTableName(1);
logService.createLogTable(tableName);
tableName = LogUtil.generateLogTableName(2);
logService.createLogTable(tableName);
tableName = LogUtil.generateLogTableName(3);
logService.createLogTable(tableName);
}
}
| 942 | 0.743478 | 0.73913 | 43 | 19.39535 | 22.554472 | 88 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.069767 | false | false |
0
|
8d4604599b18316709eaa4dc6365b365329dddf9
| 35,725,537,991,864 |
4ea520ba151f3616b845881c2fbb2108c44b38d4
|
/lottery_android.git/src/com/caixiang/lottery/core/service/user/resp/WalletInfoResp.java
|
406e813424edf848f69dc0d0c9261df0f6bf44f4
|
[] |
no_license
|
DirkZhao/java-git
|
https://github.com/DirkZhao/java-git
|
1274649c3fa2eb42f72c81757b2e0bdc4332d62e
|
b2d133dcda64bfbc57896e8b8ccc3dcb526aed2f
|
refs/heads/master
| 2016-05-22T17:19:12.993000 | 2015-03-16T05:48:33 | 2015-03-16T05:48:33 | 30,006,971 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.caixiang.lottery.core.service.user.resp;
import com.caixiang.lottery.core.service.RestResp;
import com.caixiang.lottery.core.service.user.model.WalletInfo;
public class WalletInfoResp extends RestResp<WalletInfo>{
}
|
UTF-8
|
Java
| 235 |
java
|
WalletInfoResp.java
|
Java
|
[] | null |
[] |
package com.caixiang.lottery.core.service.user.resp;
import com.caixiang.lottery.core.service.RestResp;
import com.caixiang.lottery.core.service.user.model.WalletInfo;
public class WalletInfoResp extends RestResp<WalletInfo>{
}
| 235 | 0.812766 | 0.812766 | 8 | 28.375 | 27.381277 | 63 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.375 | false | false |
0
|
f932b267f447ac7790c34f3ddc854b20f13760c1
| 35,725,537,993,847 |
c5051f3cab0df36fb9ee32377b62deedd9764bcb
|
/DesignPatternNotes/cr_AbstractFactory2/src/HotelBRoom.java
|
b9fdf72e35b111e600258e4d7e4e4af6d141996b
|
[] |
no_license
|
ddulhddul/Guide
|
https://github.com/ddulhddul/Guide
|
4bc984dcb2f80c934099f582d88246c8489b1a33
|
7c55ecb4fd072c04c7424df239c0fb96d61f5cc5
|
refs/heads/master
| 2021-01-20T14:16:47.433000 | 2017-11-04T08:13:59 | 2017-11-04T08:13:59 | 90,583,444 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
public class HotelBRoom implements IRoom {
public void getDescription() {
System.out.println("HotelB RoomList getDescription() method...");
}
public void getRate() {
System.out.println("HotelB RoomList getRate() method..");
}
}
|
UTF-8
|
Java
| 236 |
java
|
HotelBRoom.java
|
Java
|
[] | null |
[] |
public class HotelBRoom implements IRoom {
public void getDescription() {
System.out.println("HotelB RoomList getDescription() method...");
}
public void getRate() {
System.out.println("HotelB RoomList getRate() method..");
}
}
| 236 | 0.720339 | 0.720339 | 8 | 28.5 | 24.448927 | 67 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.25 | false | false |
0
|
82bc093cb5a529e17a37c113a820a7f642eeb2d6
| 36,051,955,499,750 |
8ccb69966a78f66fd788b2c5fdaba60b89b60473
|
/bi-portal-bootstrap/src/main/java/com/yinlu/bi/portal/bootstrap/BootstrapApplication.java
|
ea97f201a00079c7866be963f25ad6b5286d64fe
|
[] |
no_license
|
DINGDANGMAOUP/bi-portal
|
https://github.com/DINGDANGMAOUP/bi-portal
|
6d1d1a261e4662b6956b67c736ded2833d04fc63
|
a1cbf4e3ae17079532a867fb2182cba2b1c648ae
|
refs/heads/main
| 2023-04-22T09:01:59.623000 | 2021-04-30T03:49:42 | 2021-04-30T03:49:42 | 363,019,337 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.yinlu.bi.portal.bootstrap;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import org.apache.coyote.Request;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication(scanBasePackages = {
"com.yinlu.bi.portal.*"
})
public class BootstrapApplication {
public static void main(String[] args) {
SpringApplication.run(BootstrapApplication.class, args);
}
}
|
UTF-8
|
Java
| 493 |
java
|
BootstrapApplication.java
|
Java
|
[] | null |
[] |
package com.yinlu.bi.portal.bootstrap;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import org.apache.coyote.Request;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication(scanBasePackages = {
"com.yinlu.bi.portal.*"
})
public class BootstrapApplication {
public static void main(String[] args) {
SpringApplication.run(BootstrapApplication.class, args);
}
}
| 493 | 0.780933 | 0.780933 | 18 | 26.388889 | 22.484905 | 68 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.444444 | false | false |
0
|
4ae618ce2fc5bd15fe0e41e326dab7a9814f7018
| 10,806,137,782,833 |
4d5f6808aa8bd4c247666a9aae99e12df5dfeadc
|
/app/src/main/java/com/iterationtechnology/jalarambook/model/AuthorList.java
|
6b2cd06f1b62113ce3e436bc850105ae3a62f2b7
|
[] |
no_license
|
AnkitaPatel994/JalaramBookStore
|
https://github.com/AnkitaPatel994/JalaramBookStore
|
5dfa32b59c029af5a971227aedcba301144fd9aa
|
63aff90846af8c2c1c3364e83fb997892790ddc0
|
refs/heads/master
| 2020-06-21T23:57:16.687000 | 2019-10-10T13:11:44 | 2019-10-10T13:11:44 | 197,583,529 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.iterationtechnology.jalarambook.model;
import com.google.gson.annotations.SerializedName;
import java.util.ArrayList;
public class AuthorList {
@SerializedName("status")
private String status;
@SerializedName("message")
private String message;
@SerializedName("author")
private ArrayList<Author> authorList;
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public ArrayList<Author> getAuthorList() {
return authorList;
}
public void setAuthorList(ArrayList<Author> authorList) {
this.authorList = authorList;
}
}
|
UTF-8
|
Java
| 828 |
java
|
AuthorList.java
|
Java
|
[] | null |
[] |
package com.iterationtechnology.jalarambook.model;
import com.google.gson.annotations.SerializedName;
import java.util.ArrayList;
public class AuthorList {
@SerializedName("status")
private String status;
@SerializedName("message")
private String message;
@SerializedName("author")
private ArrayList<Author> authorList;
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public ArrayList<Author> getAuthorList() {
return authorList;
}
public void setAuthorList(ArrayList<Author> authorList) {
this.authorList = authorList;
}
}
| 828 | 0.667874 | 0.667874 | 39 | 20.23077 | 17.969292 | 61 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.307692 | false | false |
0
|
9bd01ba064a6f8d19df6dde6dc4d7a8e0e4d20ea
| 10,806,137,784,319 |
c7bd043df951a495199f9d13e87f4e3d2db57f72
|
/Travel Guide App/app/src/main/java/com/example/task_1/Gopalganj_District.java
|
634c6912f49ae7cadb617b9a339949ce89c8b058
|
[] |
no_license
|
Saqib-Sizan-Khan/Android_Development_Projects
|
https://github.com/Saqib-Sizan-Khan/Android_Development_Projects
|
89d96beed7e8bd7d43a8b125cd7857c919185d4d
|
b8689baef7ac1c1c714e71b26f6d98bcfa9f8944
|
refs/heads/master
| 2023-03-21T09:23:56.061000 | 2021-03-15T16:44:41 | 2021-03-15T16:44:41 | 346,277,039 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.example.task_1;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.ListView;
public class Gopalganj_District extends AppCompatActivity {
private ListView tourSpotListView;
private String[] tourSpotName;
private String[] tourSpotDescription;
private int[] tourSpotImage = {R.drawable.bangabandhu_mausoleum};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_gopalganj__district);
tourSpotName = getResources().getStringArray(R.array.gopalganjTourSpot_name);
tourSpotDescription = getResources().getStringArray(R.array.gopalganjTourSpot_description);
tourSpotListView = (ListView) findViewById(R.id.gopalganjDisListViewId);
TourSpot_Adapter adapter = new TourSpot_Adapter(tourSpotImage, tourSpotName,tourSpotDescription,this);
tourSpotListView.setAdapter(adapter);
}
}
|
UTF-8
|
Java
| 997 |
java
|
Gopalganj_District.java
|
Java
|
[] | null |
[] |
package com.example.task_1;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.ListView;
public class Gopalganj_District extends AppCompatActivity {
private ListView tourSpotListView;
private String[] tourSpotName;
private String[] tourSpotDescription;
private int[] tourSpotImage = {R.drawable.bangabandhu_mausoleum};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_gopalganj__district);
tourSpotName = getResources().getStringArray(R.array.gopalganjTourSpot_name);
tourSpotDescription = getResources().getStringArray(R.array.gopalganjTourSpot_description);
tourSpotListView = (ListView) findViewById(R.id.gopalganjDisListViewId);
TourSpot_Adapter adapter = new TourSpot_Adapter(tourSpotImage, tourSpotName,tourSpotDescription,this);
tourSpotListView.setAdapter(adapter);
}
}
| 997 | 0.76329 | 0.762287 | 26 | 37.346153 | 32.494904 | 110 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.692308 | false | false |
0
|
98da5ba726502a37b32f8998701ce19584e5ea71
| 37,048,387,905,319 |
bac25b5c0b94713dbeb93a7bf6fab4cf6cb1839e
|
/code02-intermediate/day14-code/src/cn/itcast/day14/homework/Practice07.java
|
bfdd45f004703cf9ae39da424f6167e5c09d69e0
|
[] |
no_license
|
Reolcharm/Zero2One
|
https://github.com/Reolcharm/Zero2One
|
c1de348ee1c951ad81160a2f9ad22b3425f7e065
|
91a8d207dcffba888bbc4cdfc5f32fae27ba1756
|
refs/heads/master
| 2020-03-28T18:46:01.472000 | 2018-10-19T16:12:01 | 2018-10-19T16:12:01 | 148,908,892 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package cn.itcast.day14.homework;
import java.util.ArrayList;
import java.util.List;
/**
* @Description:
* @Author: Rekol
* @CreateDate: 2018/8/4 15:47 - 16:20
* @version: 1.0
*/
/*七、向list集合添加姓名
{张三,李四,王五,二丫,钱六,孙七},将二丫替换为王小丫。*/
public class Practice07 {
public static void main(String[] args) {
List<String> list = new ArrayList<String>();
list.add("张三");
list.add("李四");
list.add("王五");
list.add("二丫");
list.add("钱六");
list.add("孙七");
//todo replaceAll() "元素替换的方法总结"
for (int i = 0; i < list.size(); i++) {
if("二丫".equals(list.get(i))){
list.set(i, "王小丫");
System.out.println("list1 = " + list);
}
}
int count = 0;
for (String s : list) {
if ("二丫".equals(s)) {
list.set(count, "王小丫");
System.out.println("list2 = " + list);
}
count++;
}
}
}
|
UTF-8
|
Java
| 1,144 |
java
|
Practice07.java
|
Java
|
[
{
"context": "a.util.List;\r\n\r\n/**\r\n * @Description:\r\n * @Author: Rekol\r\n * @CreateDate: 2018/8/4 15:47 - 16:20\r\n * @vers",
"end": 132,
"score": 0.9705401062965393,
"start": 127,
"tag": "USERNAME",
"value": "Rekol"
},
{
"context": "- 16:20\r\n * @version: 1.0\r\n */\r\n/*七、向list集合添加姓名\r\n{张三,李四,王五,二丫,钱六,孙七},将二丫替换为王小丫。*/\r\npublic class Practi",
"end": 217,
"score": 0.9843350648880005,
"start": 215,
"tag": "NAME",
"value": "张三"
},
{
"context": "6:20\r\n * @version: 1.0\r\n */\r\n/*七、向list集合添加姓名\r\n{张三,李四,王五,二丫,钱六,孙七},将二丫替换为王小丫。*/\r\npublic class Practice0",
"end": 220,
"score": 0.9257650971412659,
"start": 218,
"tag": "NAME",
"value": "李四"
},
{
"context": "\r\n * @version: 1.0\r\n */\r\n/*七、向list集合添加姓名\r\n{张三,李四,王五,二丫,钱六,孙七},将二丫替换为王小丫。*/\r\npublic class Practice07 {",
"end": 223,
"score": 0.5963795781135559,
"start": 222,
"tag": "NAME",
"value": "五"
},
{
"context": "ist = new ArrayList<String>();\r\n list.add(\"张三\");\r\n list.add(\"李四\");\r\n list.add(\"王五",
"end": 395,
"score": 0.9817267656326294,
"start": 393,
"tag": "NAME",
"value": "张三"
},
{
"context": "g>();\r\n list.add(\"张三\");\r\n list.add(\"李四\");\r\n list.add(\"王五\");\r\n list.add(\"二丫",
"end": 420,
"score": 0.9308992028236389,
"start": 418,
"tag": "NAME",
"value": "李四"
}
] | null |
[] |
package cn.itcast.day14.homework;
import java.util.ArrayList;
import java.util.List;
/**
* @Description:
* @Author: Rekol
* @CreateDate: 2018/8/4 15:47 - 16:20
* @version: 1.0
*/
/*七、向list集合添加姓名
{张三,李四,王五,二丫,钱六,孙七},将二丫替换为王小丫。*/
public class Practice07 {
public static void main(String[] args) {
List<String> list = new ArrayList<String>();
list.add("张三");
list.add("李四");
list.add("王五");
list.add("二丫");
list.add("钱六");
list.add("孙七");
//todo replaceAll() "元素替换的方法总结"
for (int i = 0; i < list.size(); i++) {
if("二丫".equals(list.get(i))){
list.set(i, "王小丫");
System.out.println("list1 = " + list);
}
}
int count = 0;
for (String s : list) {
if ("二丫".equals(s)) {
list.set(count, "王小丫");
System.out.println("list2 = " + list);
}
count++;
}
}
}
| 1,144 | 0.458824 | 0.435294 | 41 | 22.878048 | 15.367364 | 54 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.634146 | false | false |
0
|
296cea4f5df1bfc00290543cec0d35b6a36222bb
| 22,814,866,302,925 |
d8a9532bcec78c756aa25cc24e4745ef3c03c127
|
/Adapter/src/main/java/adapter/model/PayGatewayOldImpl.java
|
fc829a27d348434e65dc695a286e84bc53122f2c
|
[] |
no_license
|
DENMROOT/Gof_Patterns
|
https://github.com/DENMROOT/Gof_Patterns
|
79c494e8e9727834b542fb2b73e5639dd0794021
|
c4cf8f4a3e05bc9ecf6be51e4ec1879e1b989bf2
|
refs/heads/master
| 2021-01-10T17:39:00.844000 | 2015-10-23T10:10:40 | 2015-10-23T10:10:40 | 44,247,299 | 0 | 0 | null | false | 2015-10-22T18:42:38 | 2015-10-14T12:53:00 | 2015-10-14T13:01:09 | 2015-10-22T18:42:37 | 240 | 0 | 0 | 0 |
Java
| null | null |
package adapter.model;
import com.google.common.base.Objects;
/**
* Created by dmakarov on 10/7/2015.
*/
public class PayGatewayOldImpl implements PayGetewayOld{
private String gatewayName="Old Pay gateway";
private String creditCardNo;
private String clientName;
private float amount;
public String getGatewayName() {
return gatewayName;
}
public String getCreditCardNo() {
return this.creditCardNo;
}
public String getClientName() {
return this.clientName;
}
public float getAmount() {
return this.amount;
}
public void setCreditCardNo(String number) {
this.creditCardNo = number;
}
public void setClientName(String name) {
this.clientName = name;
}
public void setAmount(float amount) {
this.amount = amount;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
PayGatewayOldImpl that = (PayGatewayOldImpl) o;
return Objects.equal(amount, that.amount) &&
Objects.equal(gatewayName, that.gatewayName) &&
Objects.equal(creditCardNo, that.creditCardNo) &&
Objects.equal(clientName, that.clientName);
}
@Override
public int hashCode() {
return Objects.hashCode(gatewayName, creditCardNo, clientName, amount);
}
@Override
public String toString() {
return "PayGatewayOldImpl{" +
"gatewayName='" + gatewayName + '\'' +
", creditCardNo='" + creditCardNo + '\'' +
", clientName='" + clientName + '\'' +
", amount=" + amount +
'}';
}
}
|
UTF-8
|
Java
| 1,765 |
java
|
PayGatewayOldImpl.java
|
Java
|
[
{
"context": "com.google.common.base.Objects;\n\n/**\n * Created by dmakarov on 10/7/2015.\n */\npublic class PayGatewayOldImpl ",
"end": 90,
"score": 0.9996400475502014,
"start": 82,
"tag": "USERNAME",
"value": "dmakarov"
}
] | null |
[] |
package adapter.model;
import com.google.common.base.Objects;
/**
* Created by dmakarov on 10/7/2015.
*/
public class PayGatewayOldImpl implements PayGetewayOld{
private String gatewayName="Old Pay gateway";
private String creditCardNo;
private String clientName;
private float amount;
public String getGatewayName() {
return gatewayName;
}
public String getCreditCardNo() {
return this.creditCardNo;
}
public String getClientName() {
return this.clientName;
}
public float getAmount() {
return this.amount;
}
public void setCreditCardNo(String number) {
this.creditCardNo = number;
}
public void setClientName(String name) {
this.clientName = name;
}
public void setAmount(float amount) {
this.amount = amount;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
PayGatewayOldImpl that = (PayGatewayOldImpl) o;
return Objects.equal(amount, that.amount) &&
Objects.equal(gatewayName, that.gatewayName) &&
Objects.equal(creditCardNo, that.creditCardNo) &&
Objects.equal(clientName, that.clientName);
}
@Override
public int hashCode() {
return Objects.hashCode(gatewayName, creditCardNo, clientName, amount);
}
@Override
public String toString() {
return "PayGatewayOldImpl{" +
"gatewayName='" + gatewayName + '\'' +
", creditCardNo='" + creditCardNo + '\'' +
", clientName='" + clientName + '\'' +
", amount=" + amount +
'}';
}
}
| 1,765 | 0.593201 | 0.589235 | 68 | 24.955883 | 21.562109 | 79 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.455882 | false | false |
0
|
e13b5035a366694e2864bfe691223ec151e42d15
| 11,493,332,554,211 |
8139c0b2eaaf2148e4b995b6ae02aef90131b1d7
|
/app/src/main/java/me/abir/dailycricketbd/model/poll/Option.java
|
7f8db73ebc043c9b32f57ea49e191ecd2761d150
|
[] |
no_license
|
pastoral/DailyCricket
|
https://github.com/pastoral/DailyCricket
|
d3f60cea9b8b76cba7c30bb376674ac7f177ea6b
|
81be3ec6c5fd9ccf19b164ac4bafa6ca661f84c3
|
refs/heads/master
| 2020-11-26T12:59:14.469000 | 2019-12-19T18:34:26 | 2019-12-19T18:34:26 | 229,078,036 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package me.abir.dailycricketbd.model.poll;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
public class Option {
@SerializedName("id")
@Expose
private Integer id;
@SerializedName("user_id")
@Expose
private Integer userId;
@SerializedName("poll_question_id")
@Expose
private Integer pollQuestionId;
@SerializedName("option")
@Expose
private String option;
@SerializedName("vote")
@Expose
private Object vote;
@SerializedName("created_at")
@Expose
private String createdAt;
@SerializedName("updated_at")
@Expose
private String updatedAt;
//Extra transient field to detect if app user has selected this option or not
private Boolean userChecked = false;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getUserId() {
return userId;
}
public void setUserId(Integer userId) {
this.userId = userId;
}
public Integer getPollQuestionId() {
return pollQuestionId;
}
public void setPollQuestionId(Integer pollQuestionId) {
this.pollQuestionId = pollQuestionId;
}
public String getOption() {
return option;
}
public void setOption(String option) {
this.option = option;
}
public Object getVote() {
return vote;
}
public void setVote(Object vote) {
this.vote = vote;
}
public String getCreatedAt() {
return createdAt;
}
public void setCreatedAt(String createdAt) {
this.createdAt = createdAt;
}
public String getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(String updatedAt) {
this.updatedAt = updatedAt;
}
public Boolean getUserChecked() {
return userChecked;
}
public void setUserChecked(Boolean userChecked) {
this.userChecked = userChecked;
}
}
|
UTF-8
|
Java
| 2,016 |
java
|
Option.java
|
Java
|
[] | null |
[] |
package me.abir.dailycricketbd.model.poll;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
public class Option {
@SerializedName("id")
@Expose
private Integer id;
@SerializedName("user_id")
@Expose
private Integer userId;
@SerializedName("poll_question_id")
@Expose
private Integer pollQuestionId;
@SerializedName("option")
@Expose
private String option;
@SerializedName("vote")
@Expose
private Object vote;
@SerializedName("created_at")
@Expose
private String createdAt;
@SerializedName("updated_at")
@Expose
private String updatedAt;
//Extra transient field to detect if app user has selected this option or not
private Boolean userChecked = false;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getUserId() {
return userId;
}
public void setUserId(Integer userId) {
this.userId = userId;
}
public Integer getPollQuestionId() {
return pollQuestionId;
}
public void setPollQuestionId(Integer pollQuestionId) {
this.pollQuestionId = pollQuestionId;
}
public String getOption() {
return option;
}
public void setOption(String option) {
this.option = option;
}
public Object getVote() {
return vote;
}
public void setVote(Object vote) {
this.vote = vote;
}
public String getCreatedAt() {
return createdAt;
}
public void setCreatedAt(String createdAt) {
this.createdAt = createdAt;
}
public String getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(String updatedAt) {
this.updatedAt = updatedAt;
}
public Boolean getUserChecked() {
return userChecked;
}
public void setUserChecked(Boolean userChecked) {
this.userChecked = userChecked;
}
}
| 2,016 | 0.637401 | 0.637401 | 96 | 20.010416 | 17.391027 | 81 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.28125 | false | false |
0
|
919543c584c78d6023ea6bfcf9e60294a2c82d27
| 36,593,121,378,372 |
8760f72be736005a0f923c5b9abe30352a02a66f
|
/src/test/java/com/qunar/lvshichang/guava/ObjectsTest.java
|
0fc831edc55fa110d7e2493e77e9e30a51a4c9e1
|
[] |
no_license
|
imangry/plots
|
https://github.com/imangry/plots
|
cb51e7de212e72988d8b65580c805ae21ba951ec
|
435fc9126397f49357a16c129db623559b8a892f
|
refs/heads/master
| 2020-03-17T20:08:26.936000 | 2018-05-18T02:52:15 | 2018-05-18T02:52:15 | 133,894,870 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.qunar.lvshichang.guava;
import com.google.common.base.MoreObjects;
import com.google.common.base.Objects;
import org.junit.Test;
public class ObjectsTest {
@Test
public void objectTest(){
boolean equal = Objects.equal(Integer.valueOf(1), 1);
System.out.println(equal);
Integer integer = MoreObjects.firstNonNull(1, null);
System.out.println(integer);
int i = Objects.hashCode(1, 2, 3);
System.out.println(i);
}
}
|
UTF-8
|
Java
| 493 |
java
|
ObjectsTest.java
|
Java
|
[] | null |
[] |
package com.qunar.lvshichang.guava;
import com.google.common.base.MoreObjects;
import com.google.common.base.Objects;
import org.junit.Test;
public class ObjectsTest {
@Test
public void objectTest(){
boolean equal = Objects.equal(Integer.valueOf(1), 1);
System.out.println(equal);
Integer integer = MoreObjects.firstNonNull(1, null);
System.out.println(integer);
int i = Objects.hashCode(1, 2, 3);
System.out.println(i);
}
}
| 493 | 0.663286 | 0.651116 | 23 | 20.434782 | 20.18787 | 61 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.608696 | false | false |
0
|
d2456d9895653e875219d0398847b6a5746b8142
| 34,780,645,187,083 |
1a25afaa1194af92c5396fa147d1e9f96e4b4f42
|
/messenger/src/main/java/org/RESTful/messenger/exception/DataNotFoundExceptionMapper.java
|
1f831121ef6ca3f3858cad0e323ed8d2f317fb11
|
[] |
no_license
|
YoXo/congenial-succotash
|
https://github.com/YoXo/congenial-succotash
|
e660e7355db553d153a0239eed2bff9ebf0cedc8
|
07d9b604caff6ac22060b8e4ed531793b7d27fb1
|
refs/heads/master
| 2020-09-21T11:36:14.581000 | 2016-11-17T15:44:45 | 2016-11-17T15:44:45 | 66,398,760 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package org.RESTful.messenger.exception;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;
import javax.ws.rs.ext.ExceptionMapper;
import javax.ws.rs.ext.Provider;
import org.RESTful.messenger.model.ErrorMessage;
@Provider
public class DataNotFoundExceptionMapper
implements ExceptionMapper<DataNotFoundException>
{
@Override
public Response toResponse(DataNotFoundException ex)
{
ErrorMessage errorMessage = new ErrorMessage(ex.getMessage(), 404,
"https://kowshik.github.io/JPregel/documents/javadoc/exceptions/DataNotFoundException.html");
return Response.status(Status.NOT_FOUND).entity(errorMessage).build();
}
}
|
UTF-8
|
Java
| 661 |
java
|
DataNotFoundExceptionMapper.java
|
Java
|
[] | null |
[] |
package org.RESTful.messenger.exception;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;
import javax.ws.rs.ext.ExceptionMapper;
import javax.ws.rs.ext.Provider;
import org.RESTful.messenger.model.ErrorMessage;
@Provider
public class DataNotFoundExceptionMapper
implements ExceptionMapper<DataNotFoundException>
{
@Override
public Response toResponse(DataNotFoundException ex)
{
ErrorMessage errorMessage = new ErrorMessage(ex.getMessage(), 404,
"https://kowshik.github.io/JPregel/documents/javadoc/exceptions/DataNotFoundException.html");
return Response.status(Status.NOT_FOUND).entity(errorMessage).build();
}
}
| 661 | 0.804841 | 0.800303 | 23 | 27.73913 | 27.864918 | 97 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.043478 | false | false |
0
|
56d4f2fa5c8871ad836ee14685fbf0ee3ed48dfa
| 32,186,484,964,819 |
f1a2a051542706d747edf70786f1e89055a2d256
|
/Inheritence/src/com/company/SuperClass.java
|
f6ba088057157f943d98e9229ef00dd56c1d6ad1
|
[] |
no_license
|
aplmhd/JAVAFall
|
https://github.com/aplmhd/JAVAFall
|
d89e3ba3b5a75b114eedf990181ddc0accea349e
|
e65bb774f0f06b2376865bd59d8781e294843bb0
|
refs/heads/master
| 2021-08-18T19:19:41.498000 | 2017-11-23T16:13:05 | 2017-11-23T16:13:05 | 111,828,361 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.company;
public class SuperClass {
int a;
int b;
int c;
String name;
public void display(){
System.out.println("Super Class");
}
public SuperClass(){
a=b=c=-1;
name = null;
}
void show(){
System.out.println("Super duper hit");
}
public SuperClass(int a, int b, int c, String name){
this.a =a;
this.b = b;
this.c = c;
this.name = name;
}
public int getProduct(){
return a*b*c;
}
}
|
UTF-8
|
Java
| 536 |
java
|
SuperClass.java
|
Java
|
[] | null |
[] |
package com.company;
public class SuperClass {
int a;
int b;
int c;
String name;
public void display(){
System.out.println("Super Class");
}
public SuperClass(){
a=b=c=-1;
name = null;
}
void show(){
System.out.println("Super duper hit");
}
public SuperClass(int a, int b, int c, String name){
this.a =a;
this.b = b;
this.c = c;
this.name = name;
}
public int getProduct(){
return a*b*c;
}
}
| 536 | 0.492537 | 0.490672 | 40 | 12.4 | 13.992498 | 57 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.425 | false | false |
0
|
e296fc69a7926262a887f8ffea34ab436c8a7de4
| 23,261,542,930,988 |
d2f6d2b5467daa2ff0bd0704bd81c644c0ba6ed2
|
/src/main/java/no/imr/nmdapi/client/biotic/export/BioticGenerator.java
|
966d6a3c40b21c532a3ad6946c268065b85e32e3
|
[] |
no_license
|
Institute-of-Marine-Research-NMD/Application-export-biotic
|
https://github.com/Institute-of-Marine-Research-NMD/Application-export-biotic
|
07652a1abc378c5d402c4076524bfd7e3db34473
|
0da230f23f654608f71a81252f729cbfecba275e
|
refs/heads/master
| 2021-01-10T17:50:37.521000 | 2018-02-15T12:33:59 | 2018-02-15T12:33:59 | 44,244,711 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package no.imr.nmdapi.client.biotic.export;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import no.imr.nmdapi.client.biotic.export.dao.AgeDeterminationDAO;
import no.imr.nmdapi.client.biotic.export.dao.CatchSampleDAO;
import no.imr.nmdapi.client.biotic.export.dao.FishStationDAO;
import no.imr.nmdapi.client.biotic.export.dao.FixedCoastalstationDAO;
import no.imr.nmdapi.client.biotic.export.dao.IndividualSampleDAO;
import no.imr.nmdapi.client.biotic.export.dao.PlatformDAO;
import no.imr.nmdapi.client.biotic.export.dao.PreyDAO;
import no.imr.nmdapi.client.biotic.export.dao.StockDAO;
import no.imr.nmdapi.client.biotic.export.dao.TagDAO;
import no.imr.nmdapi.client.biotic.export.dao.TaxaDAO;
import no.imr.nmdapi.client.biotic.export.dao.UdpDAO;
import no.imr.nmdapi.client.biotic.export.pojo.AgeDetermination;
import no.imr.nmdapi.client.biotic.export.pojo.CatchSample;
import no.imr.nmdapi.client.biotic.export.pojo.FishStation;
import no.imr.nmdapi.client.biotic.export.pojo.FixedCoastalStation;
import no.imr.nmdapi.client.biotic.export.pojo.IndividualSample;
import no.imr.nmdapi.client.biotic.export.pojo.Mission;
import no.imr.nmdapi.client.biotic.export.pojo.Prey;
import no.imr.nmdapi.client.biotic.export.pojo.Taxa;
import no.imr.nmdapi.client.biotic.export.pojo.UdpValue;
import no.imr.nmdapi.generic.nmdbiotic.domain.v1_4.AgedeterminationType;
import no.imr.nmdapi.generic.nmdbiotic.domain.v1_4.CatchsampleType;
import no.imr.nmdapi.generic.nmdbiotic.domain.v1_4.CopepodedevstageType;
import no.imr.nmdapi.generic.nmdbiotic.domain.v1_4.FishstationType;
import no.imr.nmdapi.generic.nmdbiotic.domain.v1_4.IndividualType;
import no.imr.nmdapi.generic.nmdbiotic.domain.v1_4.MissionType;
import no.imr.nmdapi.generic.nmdbiotic.domain.v1_4.PreyType;
import no.imr.nmdapi.generic.nmdbiotic.domain.v1_4.PreylengthType;
import no.imr.nmdapi.generic.nmdbiotic.domain.v1_4.StringDescriptionType;
import no.imr.nmdapi.generic.nmdbiotic.domain.v1_4.TagType;
/**
*
* @author Terry Hannant <a5119>
*/
public class BioticGenerator {
private static final org.slf4j.Logger LOG = LoggerFactory.getLogger(BioticGenerator.class);
@Autowired
PlatformDAO platformDAO;
@Autowired
FishStationDAO fishstationDAO;
@Autowired
CatchSampleDAO catchSampleDAO;
@Autowired
IndividualSampleDAO individualDAO;
@Autowired
AgeDeterminationDAO ageDeterminationDAO;
@Autowired
TagDAO tagDAO;
@Autowired
PreyDAO preyDAO;
@Autowired
TaxaDAO taxaDAO;
@Autowired
StockDAO stockDAO;
@Autowired
UdpDAO udpDAO;
@Autowired
FixedCoastalstationDAO fixedstation;
public MissionType generate(Mission mission, String cruiseCode) {
boolean missingTaxa = false;
boolean missingTaxaName = false;
MissionType biotic = new MissionType();
biotic.setMissionnumber(BigInteger.valueOf(mission.getMissionNumber()));
biotic.setMissiontype(mission.getMissionTypeCode());
biotic.setMissiontypename(mission.getMissionType());
biotic.setYear(BigInteger.valueOf(mission.getStartYear()));
Map<String, String> platformCodes = platformDAO.getCruisePlatformCodes(mission.getId());
//TODO check if this is still needed
if (platformCodes.containsKey("Ship Name")) {
biotic.setPlatformname(platformCodes.get("Ship Name"));
}
if (platformCodes.containsKey("ITU Call Sign")) {
biotic.setCallsignal(platformCodes.get("ITU Call Sign"));
}
biotic.setPlatform(platformDAO.getPlatform(mission.getId()));
if ((cruiseCode != null) && (cruiseCode.trim().length() > 0)) {
biotic.setCruise(cruiseCode);
}
biotic.setStartdate(mission.getStartTime());
biotic.setStopdate(mission.getStopTime());
biotic.setPurpose(mission.getPurpose());
String stockCode;
List<FishStation> fishStations = fishstationDAO.getFIshStations(mission.getId());
for (FishStation fishStation : fishStations) {
addFishStationUDPLookups(fishStation.getType());
addFishStationUDPValues(fishStation);
if (fishStation.getType().getFixedstation() != null && fishStation.getType().getFixedstation().getValue() != null && !fishStation.getType().getFixedstation().getValue().equals("")) {
List<FixedCoastalStation> fcs = fixedstation.getFIshStations(fishStation.getType().getFixedstation().getValue());
if (!fcs.isEmpty()) {
StringDescriptionType fx = new StringDescriptionType();
fx.setValue(fcs.get(0).getName());
fishStation.getType().setFixedstation(fx);
}
}
List<CatchSample> catchSamples = catchSampleDAO.getCatchSamples(fishStation.getId());
for (CatchSample catchSample : catchSamples) {
if (catchSample.getTaxaID() != null) {
List<Taxa> taxaNames = taxaDAO.getTaxaWithName(catchSample.getTaxaID());
//Mandatory checks
if (!taxaNames.isEmpty()) {
catchSample.getType().setAphia(taxaNames.get(0).getAphia());
if (catchSample.getStockID() != null) {
//Hard coded in Editor
stockCode = stockDAO.getCode(catchSample.getStockID());
catchSample.getType().setSpecies(taxaNames.get(0).getTsn() + "." + stockCode);
catchSample.getType().setNoname(taxaNames.get(0).getName() + "'" + stockCode);
} else {
catchSample.getType().setSpecies(taxaNames.get(0).getTsn());
catchSample.getType().setNoname(taxaNames.get(0).getName());
}
} else {
//TODO Should we bale out at this point or keep generating
missingTaxaName = true;
}
addCatchSampleUDILookups(catchSample.getType());
addCatchSampleUDPValues(catchSample);
HashMap<String, BigInteger> individualSpecienno = new HashMap<String, BigInteger>();
List<IndividualSample> individualSamples = individualDAO.getIndividualSamples(catchSample.getId());
for (IndividualSample individualSample : individualSamples) {
addIndividualSampleUDPLookups(individualSample.getType());
addAgeDetermination(individualSample);
addTag(individualSample);
addIndividualUdapValues(individualSample);
catchSample.getType().getIndividual().add(individualSample.getType());
individualSpecienno.put(individualSample.getId(), individualSample.getType().getSpecimenno());
}
//Now deal with prey child records
List<Prey> preyList = preyDAO.getPreyBySample(catchSample.getId());
for (Prey prey : preyList) {
//prey.getType().setFishno(individualSample.getType().getSpecimenno());
prey.getType().setFishno(individualSpecienno.get(prey.getIndividualID()));
if (prey.getTaxaID() != null) {
prey.getType().setSpecies(taxaDAO.getTaxaTSN(prey.getTaxaID()));
}
if (prey.getWeighUnittID() != null) {
String weightRes = udpDAO.getName(prey.getWeighUnittID());
if ((weightRes != null) && (!weightRes.isEmpty())) {
StringDescriptionType weigthResType = new StringDescriptionType();
weigthResType.setValue(weightRes);
prey.getType().setWeightresolution(weigthResType);
}
}
addPreyUDPLookups(prey.getType());
addPreyLengths(prey);
addPreyDevStage(prey);
catchSample.getType().getPrey().add(prey.getType());
}
} else {
missingTaxa = true;
}
fishStation.getType().getCatchsample().add(catchSample.getType());
}
biotic.getFishstation().add(fishStation.getType());
}
//Check for missing manadatory data
if ((missingTaxa) || (missingTaxaName)) {
//TODO Should throw processing exception
}
return biotic;
}
private void addFishStationUDPLookups(FishstationType fishStation) {
fishStation.setStationtype(getUDPLookup(fishStation.getStationtype()));
fishStation.setGearcondition(getUDPLookup(fishStation.getGearcondition()));
fishStation.setTrawlquality(getUDPLookup(fishStation.getTrawlquality()));
fishStation.setDataquality(getUDPLookup(fishStation.getDataquality()));
}
private void addCatchSampleUDILookups(CatchsampleType catchSample) {
catchSample.setSampletype(getUDPLookup(catchSample.getSampletype()));
catchSample.setConservation(getUDPLookup(catchSample.getConservation()));
catchSample.setGroup(getUDPLookup(catchSample.getGroup()));
catchSample.setLengthmeasurement(getUDPLookup(catchSample.getLengthmeasurement()));
catchSample.setProducttype(getUDPLookup(catchSample.getProducttype()));
catchSample.setParasite(getUDPLookup(catchSample.getParasite()));
catchSample.setGenetics(getUDPLookup(catchSample.getGenetics()));
catchSample.setSampleproducttype(getUDPLookup(catchSample.getSampleproducttype()));
catchSample.setStomach(getUDPLookup(catchSample.getStomach()));
catchSample.setAgingstructure(getUDPLookup(catchSample.getAgingstructure()));
catchSample.setForeignobject(getUDPLookup(catchSample.getForeignobject()));
}
private void addIndividualSampleUDPLookups(IndividualType individualSample) {
individualSample.setLengthunit(getUDPLookup(individualSample.getLengthunit()));
individualSample.setSex(getUDPLookup(individualSample.getSex()));
individualSample.setStage(getUDPLookup(individualSample.getStage()));
individualSample.setDigestion(getUDPLookup(individualSample.getDigestion()));
individualSample.setFat(getUDPLookup(individualSample.getFat()));
individualSample.setLiver(getUDPLookup(individualSample.getLiver()));
individualSample.setStomachfillfield(getUDPLookup(individualSample.getStomachfillfield()));
individualSample.setLiverparasite(getUDPLookup(individualSample.getLiverparasite()));
individualSample.setProducttype(getUDPLookup(individualSample.getProducttype()));
individualSample.setStomachfilllab(getUDPLookup(individualSample.getStomachfilllab()));
//special case to ensure no blank elements are added if blank udp values are found
// if ( (individualSample.getProducttype()!= null) && (individualSample.getProducttype().getValue().isEmpty())) {
// individualSample.setProducttype(null);
// }
}
private void addPreyUDPLookups(PreyType prey) {
prey.setDigestion(getUDPLookup(prey.getDigestion()));
prey.setLengthmeasurement(getUDPLookup(prey.getLengthmeasurement()));
prey.setInterval(getUDPLookup(prey.getInterval()));
prey.setDevstage(getUDPLookup(prey.getDevstage()));
}
private void addAgeDeterminationUDPLookups(AgedeterminationType ageDetermination) {
ageDetermination.setReadability(getUDPLookup(ageDetermination.getReadability()));
ageDetermination.setOtolithcentre(getUDPLookup(ageDetermination.getOtolithcentre()));
ageDetermination.setOtolithedge(getUDPLookup(ageDetermination.getOtolithedge()));
ageDetermination.setOtolithtype(getUDPLookup(ageDetermination.getOtolithtype()));
}
private StringDescriptionType getUDPLookup(StringDescriptionType type) {
String udpName;
StringDescriptionType result = null;
if (type != null) {
udpName = udpDAO.getName(type.getValue());
if (udpName.length() > 0) {
type.setValue(udpName);
result = type;
}
}
return result;
}
private void addAgeDetermination(IndividualSample individualSample) {
List<AgeDetermination> ageDeterminationList = ageDeterminationDAO.getAgeDetermination(individualSample.getId());
BigInteger no = BigInteger.ONE;
for (AgeDetermination ageDetermine : ageDeterminationList) {
ageDetermine.getType().setNo(no);
addAgeDeterminationUDPLookups(ageDetermine.getType());
individualSample.getType().getAgedetermination().add(ageDetermine.getType());
no.add(BigInteger.ONE);
}
}
private void addTag(IndividualSample individualSample) {
List<TagType> tagList = tagDAO.getTag(individualSample.getId());
if (tagList.size() > 0) {
for (TagType tagList1 : tagList) {
tagList1.setTagtype(getUDPLookup(tagList1.getTagtype()));
individualSample.getType().getTag().add(tagList1);
}
//TODO Can there ever be more than one tag?
}
}
private void addPreyDevStage(Prey prey) {
List<CopepodedevstageType> preyDevStageList = preyDAO.getCopepodedevstage(prey.getId());
for (CopepodedevstageType preyDevStage : preyDevStageList) {
prey.getType().getCopepodedevstage().add(preyDevStage);
}
}
private void addPreyLengths(Prey prey) {
List<PreylengthType> preyLengthList = preyDAO.getPreyLength(prey.getId());
for (PreylengthType preyLength : preyLengthList) {
prey.getType().getPreylength().add(preyLength);
}
}
private void addIndividualUdapValues(IndividualSample individualSample) {
List<UdpValue> udpValues = udpDAO.getUdpValues("nmdbiotic", individualSample.getId());
for (UdpValue udpValue : udpValues) {
StringDescriptionType stringDesc = new StringDescriptionType();
stringDesc.setValue(udpValue.getValueUDPListID());
//TODO Check if single property value can apear more than once
switch (udpValue.getPropertyName()) {
case "sopp_hjerte":
individualSample.getType().setFungusheart(getUDPLookup(stringDesc));
break;
case "sopp_ytre":
individualSample.getType().setFungusouter(getUDPLookup(stringDesc));
break;
case "specialstage":
individualSample.getType().setSpecialstage(getUDPLookup(stringDesc));
break;
case "gjellesvull":
individualSample.getType().setSwollengills(getUDPLookup(stringDesc));
break;
case "carapacewidth":
individualSample.getType().setCarapacewidth(BigDecimal.valueOf(udpValue.getValueDouble()));
break;
case "abdomenwidth":
individualSample.getType().setAbdomenwidth(BigDecimal.valueOf(udpValue.getValueDouble()));
break;
case "carapacelength":
individualSample.getType().setCarapacelength(BigDecimal.valueOf(udpValue.getValueDouble()));
break;
case "developmentalstage":
individualSample.getType().setDevelopmentalstage(getUDPLookup(stringDesc));
break;
case "diametre":
individualSample.getType().setDiameter(BigDecimal.valueOf(udpValue.getValueDouble()));
break;
case "eggstage":
individualSample.getType().setEggstage(getUDPLookup(stringDesc));
break;
case "fatpercent":
individualSample.getType().setFatpercent(BigDecimal.valueOf(udpValue.getValueDouble()));
break;
case "forklength":
individualSample.getType().setForklength(BigDecimal.valueOf(udpValue.getValueDouble()));
break;
case "geneticsnumber":
individualSample.getType().setGeneticsnumber(BigInteger.valueOf(udpValue.getValueInteger()));
break;
case "gjellemakk":
individualSample.getType().setGillworms(getUDPLookup(stringDesc));
break;
case "headlength":
individualSample.getType().setHeadlength(BigDecimal.valueOf(udpValue.getValueDouble()));
break;
case "japanesecut":
individualSample.getType().setJapanesecut(BigDecimal.valueOf(udpValue.getValueDouble()));
break;
case "lengthwithouthead":
individualSample.getType().setLengthwithouthead(BigDecimal.valueOf(udpValue.getValueDouble()));
break;
case "mantlelength":
individualSample.getType().setMantlelength(BigDecimal.valueOf(udpValue.getValueDouble()));
break;
case "meroslength":
individualSample.getType().setMeroslength(BigDecimal.valueOf(udpValue.getValueDouble()));
break;
case "meroswidth":
individualSample.getType().setMeroswidth(BigDecimal.valueOf(udpValue.getValueDouble()));
break;
case "rightclawlength":
individualSample.getType().setRightclawlength(BigDecimal.valueOf(udpValue.getValueDouble()));
break;
case "rightclawwidth":
individualSample.getType().setRightclawwidth(BigDecimal.valueOf(udpValue.getValueDouble()));
break;
case "snouttoanalfin":
individualSample.getType().setSnouttoanalfin(BigDecimal.valueOf(udpValue.getValueDouble()));
break;
case "snouttoboneknob":
individualSample.getType().setSnouttoboneknob(BigDecimal.valueOf(udpValue.getValueDouble()));
break;
case "snouttodorsalfin":
individualSample.getType().setSnouttodorsalfin(BigDecimal.valueOf(udpValue.getValueDouble()));
break;
case "snouttoendoftail":
individualSample.getType().setSnouttoendoftail(BigDecimal.valueOf(udpValue.getValueDouble()));
break;
case "snouttoendsqueezed":
individualSample.getType().setSnouttoendsqueezed(BigDecimal.valueOf(udpValue.getValueDouble()));
break;
case "sopp_sporer":
individualSample.getType().setFungusspores(getUDPLookup(stringDesc));
break;
case "svartprikk":
individualSample.getType().setBlackspot(getUDPLookup(stringDesc));
break;
case "skallalder":
individualSample.getType().setMoultingstage(getUDPLookup(stringDesc));
break;
}
}
}
private void addCatchSampleUDPValues(CatchSample catchSample) {
List<UdpValue> udpValues = udpDAO.getUdpValues("nmdbiotic", catchSample.getId());
for (UdpValue udpValue : udpValues) {
StringDescriptionType stringDesc = new StringDescriptionType();
stringDesc.setValue(udpValue.getValueUDPListID());
switch (udpValue.getPropertyName()) {
case "AbundanceCategory":
catchSample.getType().setAbundancecategory(getUDPLookup(stringDesc));
break;
}
}
}
private void addFishStationUDPValues(FishStation fishStation) {
List<UdpValue> udpValues = udpDAO.getUdpValues("nmdbiotic", fishStation.getId());
for (UdpValue udpValue : udpValues) {
StringDescriptionType stringDesc = new StringDescriptionType();
stringDesc.setValue(udpValue.getValueUDPListID());
switch (udpValue.getPropertyName()) {
case "clouds":
fishStation.getType().setClouds(getUDPLookup(stringDesc));
break;
case "FishAmount":
fishStation.getType().setFishabundance(getUDPLookup(stringDesc));
break;
case "FishDistribution":
fishStation.getType().setFishdistribution(getUDPLookup(stringDesc));
break;
case "FishingGround":
fishStation.getType().setFishingground(getUDPLookup(stringDesc));
break;
case "Flora":
fishStation.getType().setFlora(getUDPLookup(stringDesc));
break;
case "flowconst":
fishStation.getType().setFlowconst(BigDecimal.valueOf(udpValue.getValueDouble()));
break;
case "flowcount":
fishStation.getType().setFlowcount(BigInteger.valueOf(udpValue.getValueInteger()));
break;
case "HaulValidity":
fishStation.getType().setHaulvalidity(getUDPLookup(stringDesc));
break;
case "sea":
fishStation.getType().setSea(getUDPLookup(stringDesc));
break;
case "VegetationCover":
fishStation.getType().setVegetationcover(getUDPLookup(stringDesc));
break;
case "Visibility":
fishStation.getType().setVisibility(getUDPLookup(stringDesc));
break;
case "waterlevel":
fishStation.getType().setWaterlevel(BigDecimal.valueOf(udpValue.getValueDouble()));
break;
case "weather":
fishStation.getType().setWeather(getUDPLookup(stringDesc));
break;
case "winddirection":
fishStation.getType().setWinddirection(BigDecimal.valueOf(udpValue.getValueDouble()));
break;
case "windspeed":
fishStation.getType().setWindspeed(BigDecimal.valueOf(udpValue.getValueDouble()));
break;
case "DeliveryPlace":
fishStation.getType().setLandingsite(getUDPLookup(stringDesc));
break;
case "NumberOfGroundVessels":
fishStation.getType().setCountofvessels(BigInteger.valueOf(udpValue.getValueInteger()));
break;
}
}
}
}
|
UTF-8
|
Java
| 24,005 |
java
|
BioticGenerator.java
|
Java
|
[
{
"context": "biotic.domain.v1_4.TagType;\r\n\r\n/**\r\n *\r\n * @author Terry Hannant <a5119>\r\n */\r\npublic class BioticGenerator {\r\n\r\n ",
"end": 2224,
"score": 0.9995070695877075,
"start": 2211,
"tag": "NAME",
"value": "Terry Hannant"
},
{
"context": "4.TagType;\r\n\r\n/**\r\n *\r\n * @author Terry Hannant <a5119>\r\n */\r\npublic class BioticGenerator {\r\n\r\n pr",
"end": 2229,
"score": 0.6190589666366577,
"start": 2227,
"tag": "USERNAME",
"value": "51"
},
{
"context": " break;\r\n case \"gjellesvull\":\r\n individualSample.getType()",
"end": 15598,
"score": 0.9659479856491089,
"start": 15587,
"tag": "USERNAME",
"value": "gjellesvull"
}
] | null |
[] |
package no.imr.nmdapi.client.biotic.export;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import no.imr.nmdapi.client.biotic.export.dao.AgeDeterminationDAO;
import no.imr.nmdapi.client.biotic.export.dao.CatchSampleDAO;
import no.imr.nmdapi.client.biotic.export.dao.FishStationDAO;
import no.imr.nmdapi.client.biotic.export.dao.FixedCoastalstationDAO;
import no.imr.nmdapi.client.biotic.export.dao.IndividualSampleDAO;
import no.imr.nmdapi.client.biotic.export.dao.PlatformDAO;
import no.imr.nmdapi.client.biotic.export.dao.PreyDAO;
import no.imr.nmdapi.client.biotic.export.dao.StockDAO;
import no.imr.nmdapi.client.biotic.export.dao.TagDAO;
import no.imr.nmdapi.client.biotic.export.dao.TaxaDAO;
import no.imr.nmdapi.client.biotic.export.dao.UdpDAO;
import no.imr.nmdapi.client.biotic.export.pojo.AgeDetermination;
import no.imr.nmdapi.client.biotic.export.pojo.CatchSample;
import no.imr.nmdapi.client.biotic.export.pojo.FishStation;
import no.imr.nmdapi.client.biotic.export.pojo.FixedCoastalStation;
import no.imr.nmdapi.client.biotic.export.pojo.IndividualSample;
import no.imr.nmdapi.client.biotic.export.pojo.Mission;
import no.imr.nmdapi.client.biotic.export.pojo.Prey;
import no.imr.nmdapi.client.biotic.export.pojo.Taxa;
import no.imr.nmdapi.client.biotic.export.pojo.UdpValue;
import no.imr.nmdapi.generic.nmdbiotic.domain.v1_4.AgedeterminationType;
import no.imr.nmdapi.generic.nmdbiotic.domain.v1_4.CatchsampleType;
import no.imr.nmdapi.generic.nmdbiotic.domain.v1_4.CopepodedevstageType;
import no.imr.nmdapi.generic.nmdbiotic.domain.v1_4.FishstationType;
import no.imr.nmdapi.generic.nmdbiotic.domain.v1_4.IndividualType;
import no.imr.nmdapi.generic.nmdbiotic.domain.v1_4.MissionType;
import no.imr.nmdapi.generic.nmdbiotic.domain.v1_4.PreyType;
import no.imr.nmdapi.generic.nmdbiotic.domain.v1_4.PreylengthType;
import no.imr.nmdapi.generic.nmdbiotic.domain.v1_4.StringDescriptionType;
import no.imr.nmdapi.generic.nmdbiotic.domain.v1_4.TagType;
/**
*
* @author <NAME> <a5119>
*/
public class BioticGenerator {
private static final org.slf4j.Logger LOG = LoggerFactory.getLogger(BioticGenerator.class);
@Autowired
PlatformDAO platformDAO;
@Autowired
FishStationDAO fishstationDAO;
@Autowired
CatchSampleDAO catchSampleDAO;
@Autowired
IndividualSampleDAO individualDAO;
@Autowired
AgeDeterminationDAO ageDeterminationDAO;
@Autowired
TagDAO tagDAO;
@Autowired
PreyDAO preyDAO;
@Autowired
TaxaDAO taxaDAO;
@Autowired
StockDAO stockDAO;
@Autowired
UdpDAO udpDAO;
@Autowired
FixedCoastalstationDAO fixedstation;
public MissionType generate(Mission mission, String cruiseCode) {
boolean missingTaxa = false;
boolean missingTaxaName = false;
MissionType biotic = new MissionType();
biotic.setMissionnumber(BigInteger.valueOf(mission.getMissionNumber()));
biotic.setMissiontype(mission.getMissionTypeCode());
biotic.setMissiontypename(mission.getMissionType());
biotic.setYear(BigInteger.valueOf(mission.getStartYear()));
Map<String, String> platformCodes = platformDAO.getCruisePlatformCodes(mission.getId());
//TODO check if this is still needed
if (platformCodes.containsKey("Ship Name")) {
biotic.setPlatformname(platformCodes.get("Ship Name"));
}
if (platformCodes.containsKey("ITU Call Sign")) {
biotic.setCallsignal(platformCodes.get("ITU Call Sign"));
}
biotic.setPlatform(platformDAO.getPlatform(mission.getId()));
if ((cruiseCode != null) && (cruiseCode.trim().length() > 0)) {
biotic.setCruise(cruiseCode);
}
biotic.setStartdate(mission.getStartTime());
biotic.setStopdate(mission.getStopTime());
biotic.setPurpose(mission.getPurpose());
String stockCode;
List<FishStation> fishStations = fishstationDAO.getFIshStations(mission.getId());
for (FishStation fishStation : fishStations) {
addFishStationUDPLookups(fishStation.getType());
addFishStationUDPValues(fishStation);
if (fishStation.getType().getFixedstation() != null && fishStation.getType().getFixedstation().getValue() != null && !fishStation.getType().getFixedstation().getValue().equals("")) {
List<FixedCoastalStation> fcs = fixedstation.getFIshStations(fishStation.getType().getFixedstation().getValue());
if (!fcs.isEmpty()) {
StringDescriptionType fx = new StringDescriptionType();
fx.setValue(fcs.get(0).getName());
fishStation.getType().setFixedstation(fx);
}
}
List<CatchSample> catchSamples = catchSampleDAO.getCatchSamples(fishStation.getId());
for (CatchSample catchSample : catchSamples) {
if (catchSample.getTaxaID() != null) {
List<Taxa> taxaNames = taxaDAO.getTaxaWithName(catchSample.getTaxaID());
//Mandatory checks
if (!taxaNames.isEmpty()) {
catchSample.getType().setAphia(taxaNames.get(0).getAphia());
if (catchSample.getStockID() != null) {
//Hard coded in Editor
stockCode = stockDAO.getCode(catchSample.getStockID());
catchSample.getType().setSpecies(taxaNames.get(0).getTsn() + "." + stockCode);
catchSample.getType().setNoname(taxaNames.get(0).getName() + "'" + stockCode);
} else {
catchSample.getType().setSpecies(taxaNames.get(0).getTsn());
catchSample.getType().setNoname(taxaNames.get(0).getName());
}
} else {
//TODO Should we bale out at this point or keep generating
missingTaxaName = true;
}
addCatchSampleUDILookups(catchSample.getType());
addCatchSampleUDPValues(catchSample);
HashMap<String, BigInteger> individualSpecienno = new HashMap<String, BigInteger>();
List<IndividualSample> individualSamples = individualDAO.getIndividualSamples(catchSample.getId());
for (IndividualSample individualSample : individualSamples) {
addIndividualSampleUDPLookups(individualSample.getType());
addAgeDetermination(individualSample);
addTag(individualSample);
addIndividualUdapValues(individualSample);
catchSample.getType().getIndividual().add(individualSample.getType());
individualSpecienno.put(individualSample.getId(), individualSample.getType().getSpecimenno());
}
//Now deal with prey child records
List<Prey> preyList = preyDAO.getPreyBySample(catchSample.getId());
for (Prey prey : preyList) {
//prey.getType().setFishno(individualSample.getType().getSpecimenno());
prey.getType().setFishno(individualSpecienno.get(prey.getIndividualID()));
if (prey.getTaxaID() != null) {
prey.getType().setSpecies(taxaDAO.getTaxaTSN(prey.getTaxaID()));
}
if (prey.getWeighUnittID() != null) {
String weightRes = udpDAO.getName(prey.getWeighUnittID());
if ((weightRes != null) && (!weightRes.isEmpty())) {
StringDescriptionType weigthResType = new StringDescriptionType();
weigthResType.setValue(weightRes);
prey.getType().setWeightresolution(weigthResType);
}
}
addPreyUDPLookups(prey.getType());
addPreyLengths(prey);
addPreyDevStage(prey);
catchSample.getType().getPrey().add(prey.getType());
}
} else {
missingTaxa = true;
}
fishStation.getType().getCatchsample().add(catchSample.getType());
}
biotic.getFishstation().add(fishStation.getType());
}
//Check for missing manadatory data
if ((missingTaxa) || (missingTaxaName)) {
//TODO Should throw processing exception
}
return biotic;
}
private void addFishStationUDPLookups(FishstationType fishStation) {
fishStation.setStationtype(getUDPLookup(fishStation.getStationtype()));
fishStation.setGearcondition(getUDPLookup(fishStation.getGearcondition()));
fishStation.setTrawlquality(getUDPLookup(fishStation.getTrawlquality()));
fishStation.setDataquality(getUDPLookup(fishStation.getDataquality()));
}
private void addCatchSampleUDILookups(CatchsampleType catchSample) {
catchSample.setSampletype(getUDPLookup(catchSample.getSampletype()));
catchSample.setConservation(getUDPLookup(catchSample.getConservation()));
catchSample.setGroup(getUDPLookup(catchSample.getGroup()));
catchSample.setLengthmeasurement(getUDPLookup(catchSample.getLengthmeasurement()));
catchSample.setProducttype(getUDPLookup(catchSample.getProducttype()));
catchSample.setParasite(getUDPLookup(catchSample.getParasite()));
catchSample.setGenetics(getUDPLookup(catchSample.getGenetics()));
catchSample.setSampleproducttype(getUDPLookup(catchSample.getSampleproducttype()));
catchSample.setStomach(getUDPLookup(catchSample.getStomach()));
catchSample.setAgingstructure(getUDPLookup(catchSample.getAgingstructure()));
catchSample.setForeignobject(getUDPLookup(catchSample.getForeignobject()));
}
private void addIndividualSampleUDPLookups(IndividualType individualSample) {
individualSample.setLengthunit(getUDPLookup(individualSample.getLengthunit()));
individualSample.setSex(getUDPLookup(individualSample.getSex()));
individualSample.setStage(getUDPLookup(individualSample.getStage()));
individualSample.setDigestion(getUDPLookup(individualSample.getDigestion()));
individualSample.setFat(getUDPLookup(individualSample.getFat()));
individualSample.setLiver(getUDPLookup(individualSample.getLiver()));
individualSample.setStomachfillfield(getUDPLookup(individualSample.getStomachfillfield()));
individualSample.setLiverparasite(getUDPLookup(individualSample.getLiverparasite()));
individualSample.setProducttype(getUDPLookup(individualSample.getProducttype()));
individualSample.setStomachfilllab(getUDPLookup(individualSample.getStomachfilllab()));
//special case to ensure no blank elements are added if blank udp values are found
// if ( (individualSample.getProducttype()!= null) && (individualSample.getProducttype().getValue().isEmpty())) {
// individualSample.setProducttype(null);
// }
}
private void addPreyUDPLookups(PreyType prey) {
prey.setDigestion(getUDPLookup(prey.getDigestion()));
prey.setLengthmeasurement(getUDPLookup(prey.getLengthmeasurement()));
prey.setInterval(getUDPLookup(prey.getInterval()));
prey.setDevstage(getUDPLookup(prey.getDevstage()));
}
private void addAgeDeterminationUDPLookups(AgedeterminationType ageDetermination) {
ageDetermination.setReadability(getUDPLookup(ageDetermination.getReadability()));
ageDetermination.setOtolithcentre(getUDPLookup(ageDetermination.getOtolithcentre()));
ageDetermination.setOtolithedge(getUDPLookup(ageDetermination.getOtolithedge()));
ageDetermination.setOtolithtype(getUDPLookup(ageDetermination.getOtolithtype()));
}
private StringDescriptionType getUDPLookup(StringDescriptionType type) {
String udpName;
StringDescriptionType result = null;
if (type != null) {
udpName = udpDAO.getName(type.getValue());
if (udpName.length() > 0) {
type.setValue(udpName);
result = type;
}
}
return result;
}
private void addAgeDetermination(IndividualSample individualSample) {
List<AgeDetermination> ageDeterminationList = ageDeterminationDAO.getAgeDetermination(individualSample.getId());
BigInteger no = BigInteger.ONE;
for (AgeDetermination ageDetermine : ageDeterminationList) {
ageDetermine.getType().setNo(no);
addAgeDeterminationUDPLookups(ageDetermine.getType());
individualSample.getType().getAgedetermination().add(ageDetermine.getType());
no.add(BigInteger.ONE);
}
}
private void addTag(IndividualSample individualSample) {
List<TagType> tagList = tagDAO.getTag(individualSample.getId());
if (tagList.size() > 0) {
for (TagType tagList1 : tagList) {
tagList1.setTagtype(getUDPLookup(tagList1.getTagtype()));
individualSample.getType().getTag().add(tagList1);
}
//TODO Can there ever be more than one tag?
}
}
private void addPreyDevStage(Prey prey) {
List<CopepodedevstageType> preyDevStageList = preyDAO.getCopepodedevstage(prey.getId());
for (CopepodedevstageType preyDevStage : preyDevStageList) {
prey.getType().getCopepodedevstage().add(preyDevStage);
}
}
private void addPreyLengths(Prey prey) {
List<PreylengthType> preyLengthList = preyDAO.getPreyLength(prey.getId());
for (PreylengthType preyLength : preyLengthList) {
prey.getType().getPreylength().add(preyLength);
}
}
private void addIndividualUdapValues(IndividualSample individualSample) {
List<UdpValue> udpValues = udpDAO.getUdpValues("nmdbiotic", individualSample.getId());
for (UdpValue udpValue : udpValues) {
StringDescriptionType stringDesc = new StringDescriptionType();
stringDesc.setValue(udpValue.getValueUDPListID());
//TODO Check if single property value can apear more than once
switch (udpValue.getPropertyName()) {
case "sopp_hjerte":
individualSample.getType().setFungusheart(getUDPLookup(stringDesc));
break;
case "sopp_ytre":
individualSample.getType().setFungusouter(getUDPLookup(stringDesc));
break;
case "specialstage":
individualSample.getType().setSpecialstage(getUDPLookup(stringDesc));
break;
case "gjellesvull":
individualSample.getType().setSwollengills(getUDPLookup(stringDesc));
break;
case "carapacewidth":
individualSample.getType().setCarapacewidth(BigDecimal.valueOf(udpValue.getValueDouble()));
break;
case "abdomenwidth":
individualSample.getType().setAbdomenwidth(BigDecimal.valueOf(udpValue.getValueDouble()));
break;
case "carapacelength":
individualSample.getType().setCarapacelength(BigDecimal.valueOf(udpValue.getValueDouble()));
break;
case "developmentalstage":
individualSample.getType().setDevelopmentalstage(getUDPLookup(stringDesc));
break;
case "diametre":
individualSample.getType().setDiameter(BigDecimal.valueOf(udpValue.getValueDouble()));
break;
case "eggstage":
individualSample.getType().setEggstage(getUDPLookup(stringDesc));
break;
case "fatpercent":
individualSample.getType().setFatpercent(BigDecimal.valueOf(udpValue.getValueDouble()));
break;
case "forklength":
individualSample.getType().setForklength(BigDecimal.valueOf(udpValue.getValueDouble()));
break;
case "geneticsnumber":
individualSample.getType().setGeneticsnumber(BigInteger.valueOf(udpValue.getValueInteger()));
break;
case "gjellemakk":
individualSample.getType().setGillworms(getUDPLookup(stringDesc));
break;
case "headlength":
individualSample.getType().setHeadlength(BigDecimal.valueOf(udpValue.getValueDouble()));
break;
case "japanesecut":
individualSample.getType().setJapanesecut(BigDecimal.valueOf(udpValue.getValueDouble()));
break;
case "lengthwithouthead":
individualSample.getType().setLengthwithouthead(BigDecimal.valueOf(udpValue.getValueDouble()));
break;
case "mantlelength":
individualSample.getType().setMantlelength(BigDecimal.valueOf(udpValue.getValueDouble()));
break;
case "meroslength":
individualSample.getType().setMeroslength(BigDecimal.valueOf(udpValue.getValueDouble()));
break;
case "meroswidth":
individualSample.getType().setMeroswidth(BigDecimal.valueOf(udpValue.getValueDouble()));
break;
case "rightclawlength":
individualSample.getType().setRightclawlength(BigDecimal.valueOf(udpValue.getValueDouble()));
break;
case "rightclawwidth":
individualSample.getType().setRightclawwidth(BigDecimal.valueOf(udpValue.getValueDouble()));
break;
case "snouttoanalfin":
individualSample.getType().setSnouttoanalfin(BigDecimal.valueOf(udpValue.getValueDouble()));
break;
case "snouttoboneknob":
individualSample.getType().setSnouttoboneknob(BigDecimal.valueOf(udpValue.getValueDouble()));
break;
case "snouttodorsalfin":
individualSample.getType().setSnouttodorsalfin(BigDecimal.valueOf(udpValue.getValueDouble()));
break;
case "snouttoendoftail":
individualSample.getType().setSnouttoendoftail(BigDecimal.valueOf(udpValue.getValueDouble()));
break;
case "snouttoendsqueezed":
individualSample.getType().setSnouttoendsqueezed(BigDecimal.valueOf(udpValue.getValueDouble()));
break;
case "sopp_sporer":
individualSample.getType().setFungusspores(getUDPLookup(stringDesc));
break;
case "svartprikk":
individualSample.getType().setBlackspot(getUDPLookup(stringDesc));
break;
case "skallalder":
individualSample.getType().setMoultingstage(getUDPLookup(stringDesc));
break;
}
}
}
private void addCatchSampleUDPValues(CatchSample catchSample) {
List<UdpValue> udpValues = udpDAO.getUdpValues("nmdbiotic", catchSample.getId());
for (UdpValue udpValue : udpValues) {
StringDescriptionType stringDesc = new StringDescriptionType();
stringDesc.setValue(udpValue.getValueUDPListID());
switch (udpValue.getPropertyName()) {
case "AbundanceCategory":
catchSample.getType().setAbundancecategory(getUDPLookup(stringDesc));
break;
}
}
}
private void addFishStationUDPValues(FishStation fishStation) {
List<UdpValue> udpValues = udpDAO.getUdpValues("nmdbiotic", fishStation.getId());
for (UdpValue udpValue : udpValues) {
StringDescriptionType stringDesc = new StringDescriptionType();
stringDesc.setValue(udpValue.getValueUDPListID());
switch (udpValue.getPropertyName()) {
case "clouds":
fishStation.getType().setClouds(getUDPLookup(stringDesc));
break;
case "FishAmount":
fishStation.getType().setFishabundance(getUDPLookup(stringDesc));
break;
case "FishDistribution":
fishStation.getType().setFishdistribution(getUDPLookup(stringDesc));
break;
case "FishingGround":
fishStation.getType().setFishingground(getUDPLookup(stringDesc));
break;
case "Flora":
fishStation.getType().setFlora(getUDPLookup(stringDesc));
break;
case "flowconst":
fishStation.getType().setFlowconst(BigDecimal.valueOf(udpValue.getValueDouble()));
break;
case "flowcount":
fishStation.getType().setFlowcount(BigInteger.valueOf(udpValue.getValueInteger()));
break;
case "HaulValidity":
fishStation.getType().setHaulvalidity(getUDPLookup(stringDesc));
break;
case "sea":
fishStation.getType().setSea(getUDPLookup(stringDesc));
break;
case "VegetationCover":
fishStation.getType().setVegetationcover(getUDPLookup(stringDesc));
break;
case "Visibility":
fishStation.getType().setVisibility(getUDPLookup(stringDesc));
break;
case "waterlevel":
fishStation.getType().setWaterlevel(BigDecimal.valueOf(udpValue.getValueDouble()));
break;
case "weather":
fishStation.getType().setWeather(getUDPLookup(stringDesc));
break;
case "winddirection":
fishStation.getType().setWinddirection(BigDecimal.valueOf(udpValue.getValueDouble()));
break;
case "windspeed":
fishStation.getType().setWindspeed(BigDecimal.valueOf(udpValue.getValueDouble()));
break;
case "DeliveryPlace":
fishStation.getType().setLandingsite(getUDPLookup(stringDesc));
break;
case "NumberOfGroundVessels":
fishStation.getType().setCountofvessels(BigInteger.valueOf(udpValue.getValueInteger()));
break;
}
}
}
}
| 23,998 | 0.608274 | 0.606649 | 486 | 47.382717 | 33.822788 | 194 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.578189 | false | false |
0
|
a54bd962c12801c17e02709f837b149a99783305
| 35,338,990,945,070 |
ba13b4390895550c28db1a0b32e57d848e85de50
|
/online_examination_system/online-examination-service-api/src/main/java/com/zxh/api/exception/UserException.java
|
ecb46ac27260dafe69a1922a37c073d6897a0b02
|
[] |
no_license
|
zhaoxiaohe123/online
|
https://github.com/zhaoxiaohe123/online
|
040c3c76aeed2090285785af1bce391b2abe5524
|
fc19bc1ce437f08b9247c8f252b3e5efa9c0b0fc
|
refs/heads/master
| 2020-05-22T22:50:14.140000 | 2019-05-14T09:28:38 | 2019-05-14T09:28:38 | 186,540,079 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.zxh.api.exception;
public class UserException extends BaseException{
/**
*
*/
private static final long serialVersionUID = 1L;
public UserException() {
super();
// TODO Auto-generated constructor stub
}
public UserException(String code, String message, Throwable cause) {
super(code, message, cause);
// TODO Auto-generated constructor stub
}
public UserException(String code, String message) {
super(code, message);
// TODO Auto-generated constructor stub
}
public UserException(String message, Throwable cause) {
super(message, cause);
// TODO Auto-generated constructor stub
}
public UserException(String message) {
super(message);
// TODO Auto-generated constructor stub
}
}
|
UTF-8
|
Java
| 742 |
java
|
UserException.java
|
Java
|
[] | null |
[] |
package com.zxh.api.exception;
public class UserException extends BaseException{
/**
*
*/
private static final long serialVersionUID = 1L;
public UserException() {
super();
// TODO Auto-generated constructor stub
}
public UserException(String code, String message, Throwable cause) {
super(code, message, cause);
// TODO Auto-generated constructor stub
}
public UserException(String code, String message) {
super(code, message);
// TODO Auto-generated constructor stub
}
public UserException(String message, Throwable cause) {
super(message, cause);
// TODO Auto-generated constructor stub
}
public UserException(String message) {
super(message);
// TODO Auto-generated constructor stub
}
}
| 742 | 0.721024 | 0.719677 | 38 | 18.526316 | 20.696728 | 69 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.368421 | false | false |
0
|
7b59819f17b2948f3e20b2f4abada08a230c01ee
| 13,924,284,034,164 |
be1d482c346b2ebe663d925ed8ead327acbf06c1
|
/src/main/java/com/dasanjos/java/util/file/CSVReader.java
|
ecb23496cb3760f5c51ea93867a59a4daabeab81
|
[] |
no_license
|
YoXo/java-examples
|
https://github.com/YoXo/java-examples
|
f49b9111dd543a584ef37cf612919587b8fa13af
|
021fbdfba9095e735f7cf3e520c66f9b2a447b5f
|
refs/heads/master
| 2020-07-28T05:38:10.134000 | 2014-05-28T07:47:44 | 2014-05-28T07:47:44 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.dasanjos.java.util.file;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.StringReader;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;
public class CSVReader {
private final String delim;
private final BufferedReader reader;
/**
* Parses a CSV file with default delimiter (semicolon)
*
* @param path path to CSV file to be parsed
* @throws FileNotFoundException
*/
public CSVReader(String path) throws FileNotFoundException {
this.delim = ";";
this.reader = new BufferedReader(new FileReader(new File(path)));
}
/**
* Parses a CSV file content (String) with configurable list of delimiters
*
* @param content String with CSV file contents to be parsed
* @param delim String with delimiter used in CSV file
*/
public CSVReader(String content, String delim) {
this.delim = delim;
this.reader = new BufferedReader(new StringReader(content));
}
/**
* Parses next line of CSV file for values
*
* @return List<String> of values on current line or null if EOF
*/
public List<String> readLine() {
List<String> values = null;
try {
String strLine = reader.readLine();
StringTokenizer st = null;
if (strLine != null) {
st = new StringTokenizer(strLine, delim);
values = new ArrayList<String>();
while (st.hasMoreTokens()) {
values.add(st.nextToken());
}
}
} catch (IOException e) {
// TODO Add logging
}
return values;
}
}
|
UTF-8
|
Java
| 1,579 |
java
|
CSVReader.java
|
Java
|
[] | null |
[] |
package com.dasanjos.java.util.file;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.StringReader;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;
public class CSVReader {
private final String delim;
private final BufferedReader reader;
/**
* Parses a CSV file with default delimiter (semicolon)
*
* @param path path to CSV file to be parsed
* @throws FileNotFoundException
*/
public CSVReader(String path) throws FileNotFoundException {
this.delim = ";";
this.reader = new BufferedReader(new FileReader(new File(path)));
}
/**
* Parses a CSV file content (String) with configurable list of delimiters
*
* @param content String with CSV file contents to be parsed
* @param delim String with delimiter used in CSV file
*/
public CSVReader(String content, String delim) {
this.delim = delim;
this.reader = new BufferedReader(new StringReader(content));
}
/**
* Parses next line of CSV file for values
*
* @return List<String> of values on current line or null if EOF
*/
public List<String> readLine() {
List<String> values = null;
try {
String strLine = reader.readLine();
StringTokenizer st = null;
if (strLine != null) {
st = new StringTokenizer(strLine, delim);
values = new ArrayList<String>();
while (st.hasMoreTokens()) {
values.add(st.nextToken());
}
}
} catch (IOException e) {
// TODO Add logging
}
return values;
}
}
| 1,579 | 0.702977 | 0.702977 | 65 | 23.292307 | 20.710253 | 75 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.615385 | false | false |
0
|
8ec489e57f2e8db6b381db7a659bca0b8b216b21
| 36,447,092,498,549 |
33d146b50571522b2f11a7866b11c80b66c35ae3
|
/src/test/java/com/expertzlab/javabasics/generics/PoundCurrency.java
|
a1138ee9db95195dcf8bbbfb39a2551ae793043f
|
[] |
no_license
|
expertzlab/selenium-webdriver-training
|
https://github.com/expertzlab/selenium-webdriver-training
|
4bfbc894fb825bb7fe2f84d264956f7d8d76de0c
|
4988e228357e21381c4ab803837b98d902f6134b
|
refs/heads/master
| 2021-01-18T21:37:17.188000 | 2017-05-24T11:25:19 | 2017-05-24T11:25:19 | 87,015,843 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.expertzlab.javabasics.generics;
/**
* Created by gireeshbabu on 11/05/17.
*/
public class PoundCurrency extends Money {
public PoundCurrency(float v){
super(v);
}
float getRupeeValue(){
return value * 85;
}
}
|
UTF-8
|
Java
| 258 |
java
|
PoundCurrency.java
|
Java
|
[
{
"context": "expertzlab.javabasics.generics;\n\n/**\n * Created by gireeshbabu on 11/05/17.\n */\npublic class PoundCurrency exten",
"end": 74,
"score": 0.9983008503913879,
"start": 63,
"tag": "USERNAME",
"value": "gireeshbabu"
}
] | null |
[] |
package com.expertzlab.javabasics.generics;
/**
* Created by gireeshbabu on 11/05/17.
*/
public class PoundCurrency extends Money {
public PoundCurrency(float v){
super(v);
}
float getRupeeValue(){
return value * 85;
}
}
| 258 | 0.635659 | 0.604651 | 15 | 16.200001 | 16.302147 | 43 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.2 | false | false |
0
|
290d6d01a42369bc3c0ab7e62a8e0cc93cbe3e94
| 31,722,628,518,917 |
950ad02850d365a4de859562a276cd5ce31d2ccb
|
/app/src/main/java/com/zakhulhaq/filmku/Detail.java
|
9b2287ce0f70a5180d99c25b19f2b01f42694783
|
[] |
no_license
|
DafaZakhulhaq27/FilmKu
|
https://github.com/DafaZakhulhaq27/FilmKu
|
4d94c053c25c1dfbcd105acd53d9e6fe25367908
|
d4a38471cf47285515a86e91a745de3edea008d4
|
refs/heads/master
| 2020-07-30T14:33:36.280000 | 2019-10-04T04:32:34 | 2019-10-04T04:32:34 | 210,265,034 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.zakhulhaq.filmku;
import android.os.Bundle;
import android.widget.ImageView;
import android.widget.RatingBar;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.zakhulhaq.filmku.ui.film.FilmItem;
public class Detail extends AppCompatActivity {
public static final String EXTRA_MOVIE = "extra_title";
TextView tv_popularity, tv_vote_count, tv_overview, tv_release;
RatingBar ratingBar;
ImageView poster, backdrop;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_detail);
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
tv_vote_count = findViewById(R.id.tv_vote_count);
tv_popularity = findViewById(R.id.tv_popularity);
tv_overview = findViewById(R.id.tv_overview);
tv_release = findViewById(R.id.tv_release_date);
ratingBar = findViewById(R.id.ratingBar);
poster = findViewById(R.id.movie_poster);
backdrop = findViewById(R.id.img_poster);
FilmItem film = getIntent().getParcelableExtra(EXTRA_MOVIE);
tv_vote_count.setText(film.getVoteCount() + "");
tv_popularity.setText(film.getPopularity() + "");
tv_overview.setText(film.getOverview());
tv_release.setText(film.getReleaseDate());
float score = (float) (film.getVoteAverage() / 2);
ratingBar.setRating(score);
setTitle(film.getTitle());
Glide.with(this)
.load("https://image.tmdb.org/t/p/w185/" + film.getPosterPath())
.apply(new RequestOptions().override(600, 200))
.into(poster);
Glide.with(this)
.load("https://image.tmdb.org/t/p/w185/" + film.getBackdropPath())
.into(backdrop);
}
}
|
UTF-8
|
Java
| 2,012 |
java
|
Detail.java
|
Java
|
[] | null |
[] |
package com.zakhulhaq.filmku;
import android.os.Bundle;
import android.widget.ImageView;
import android.widget.RatingBar;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.zakhulhaq.filmku.ui.film.FilmItem;
public class Detail extends AppCompatActivity {
public static final String EXTRA_MOVIE = "extra_title";
TextView tv_popularity, tv_vote_count, tv_overview, tv_release;
RatingBar ratingBar;
ImageView poster, backdrop;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_detail);
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
tv_vote_count = findViewById(R.id.tv_vote_count);
tv_popularity = findViewById(R.id.tv_popularity);
tv_overview = findViewById(R.id.tv_overview);
tv_release = findViewById(R.id.tv_release_date);
ratingBar = findViewById(R.id.ratingBar);
poster = findViewById(R.id.movie_poster);
backdrop = findViewById(R.id.img_poster);
FilmItem film = getIntent().getParcelableExtra(EXTRA_MOVIE);
tv_vote_count.setText(film.getVoteCount() + "");
tv_popularity.setText(film.getPopularity() + "");
tv_overview.setText(film.getOverview());
tv_release.setText(film.getReleaseDate());
float score = (float) (film.getVoteAverage() / 2);
ratingBar.setRating(score);
setTitle(film.getTitle());
Glide.with(this)
.load("https://image.tmdb.org/t/p/w185/" + film.getPosterPath())
.apply(new RequestOptions().override(600, 200))
.into(poster);
Glide.with(this)
.load("https://image.tmdb.org/t/p/w185/" + film.getBackdropPath())
.into(backdrop);
}
}
| 2,012 | 0.672465 | 0.666004 | 52 | 37.692307 | 21.874237 | 82 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.769231 | false | false |
0
|
ca99bc9e84e9f60b2ae07b53aa272778d395b20c
| 28,028,956,630,711 |
435ebdf7026396fe50483bb9668c8541f2abd4cd
|
/POM-Framework/src/test/java/freeCrm/TestCase/Reg_Test.java
|
bea88c7b33acf96c54b03be026ecf72f674fc6c7
|
[] |
no_license
|
ShwetaMendhe/Framework-POM
|
https://github.com/ShwetaMendhe/Framework-POM
|
46cca76aa8ebc78b8db68e6855d2e547ede04f54
|
a34b0617ad324484bb5dedf83267e16a785ae662
|
refs/heads/master
| 2023-05-11T22:34:12.820000 | 2019-07-26T06:47:39 | 2019-07-26T06:47:39 | 194,817,327 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package freeCrm.TestCase;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import freeCrm.Base.TestBase;
import freeCrm.Pages.LoginPage;
import freeCrm.Pages.RegPage;
import freeCrm.Util.Helper;
public class Reg_Test extends TestBase{
LoginPage loginpage;
RegPage regpage;
@BeforeMethod
public void setUp(){
browserSetUp();
loginpage = new LoginPage();
regpage = loginpage.clickToSignUpLink();
}
@Test(dataProvider= "getExcelData")
public void createNewUser_Test(String dd_Text, String firstname, String lastname, String EmailId,
String confirmEmailId, String usernm, String pwd, String confirmPwd){
Helper.captureScreenshots(driver);
//regpage.createNewUser("Edition", "Vasant", "Chavan","vasant@gmail.com", "vasant@gmail.com","Vasant", "Vasant@123", "Vasant@123");
regpage.createNewUser(dd_Text, firstname, lastname, EmailId, confirmEmailId, usernm, pwd, confirmPwd);
Helper.captureScreenshots(driver);
}
@DataProvider
public Object[][] getExcelData(){
return dataprovider.getExcelData("sheet2");
}
/*@AfterMethod
public void tearDown(){
driver.quit();
}*/
}
|
UTF-8
|
Java
| 1,315 |
java
|
Reg_Test.java
|
Java
|
[
{
"context": "iver);\r\n\t\t\r\n\t\t//regpage.createNewUser(\"Edition\", \"Vasant\", \"Chavan\",\"vasant@gmail.com\", \"vasant@gmail.com\"",
"end": 876,
"score": 0.9941494464874268,
"start": 870,
"tag": "NAME",
"value": "Vasant"
},
{
"context": "\r\n\t\t//regpage.createNewUser(\"Edition\", \"Vasant\", \"Chavan\",\"vasant@gmail.com\", \"vasant@gmail.com\",\"Vasant\",",
"end": 886,
"score": 0.9320423603057861,
"start": 880,
"tag": "NAME",
"value": "Chavan"
},
{
"context": "page.createNewUser(\"Edition\", \"Vasant\", \"Chavan\",\"vasant@gmail.com\", \"vasant@gmail.com\",\"Vasant\", \"Vasant@123\", \"Vas",
"end": 905,
"score": 0.9999256134033203,
"start": 889,
"tag": "EMAIL",
"value": "vasant@gmail.com"
},
{
"context": "Edition\", \"Vasant\", \"Chavan\",\"vasant@gmail.com\", \"vasant@gmail.com\",\"Vasant\", \"Vasant@123\", \"Vasant@123\");\r\n\t\t\r\n\t\tre",
"end": 925,
"score": 0.9999253749847412,
"start": 909,
"tag": "EMAIL",
"value": "vasant@gmail.com"
},
{
"context": "t@gmail.com\", \"vasant@gmail.com\",\"Vasant\", \"Vasant@123\", \"Vasant@123\");\r\n\t\t\r\n\t\tregpage.createNewUser(dd",
"end": 947,
"score": 0.5646345615386963,
"start": 944,
"tag": "PASSWORD",
"value": "@12"
},
{
"context": "\", \"vasant@gmail.com\",\"Vasant\", \"Vasant@123\", \"Vasant@123\");\r\n\t\t\r\n\t\tregpage.createNewUser(dd_Text, firstnam",
"end": 962,
"score": 0.6205383539199829,
"start": 955,
"tag": "PASSWORD",
"value": "ant@123"
}
] | null |
[] |
package freeCrm.TestCase;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import freeCrm.Base.TestBase;
import freeCrm.Pages.LoginPage;
import freeCrm.Pages.RegPage;
import freeCrm.Util.Helper;
public class Reg_Test extends TestBase{
LoginPage loginpage;
RegPage regpage;
@BeforeMethod
public void setUp(){
browserSetUp();
loginpage = new LoginPage();
regpage = loginpage.clickToSignUpLink();
}
@Test(dataProvider= "getExcelData")
public void createNewUser_Test(String dd_Text, String firstname, String lastname, String EmailId,
String confirmEmailId, String usernm, String pwd, String confirmPwd){
Helper.captureScreenshots(driver);
//regpage.createNewUser("Edition", "Vasant", "Chavan","<EMAIL>", "<EMAIL>","Vasant", "Vasant@123", "Vas<PASSWORD>");
regpage.createNewUser(dd_Text, firstname, lastname, EmailId, confirmEmailId, usernm, pwd, confirmPwd);
Helper.captureScreenshots(driver);
}
@DataProvider
public Object[][] getExcelData(){
return dataprovider.getExcelData("sheet2");
}
/*@AfterMethod
public void tearDown(){
driver.quit();
}*/
}
| 1,300 | 0.710266 | 0.704943 | 55 | 21.90909 | 27.619673 | 133 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.836364 | false | false |
0
|
030748aea93f272b90d79cc58a36dd2368514718
| 34,333,968,617,086 |
5998c3cac1ec7c2735db51a7b0de59e9b94acb59
|
/asnmt/src/main/java/com/example/asn/domain/RecordDTO.java
|
59cc325129f186091e0f773f9500b10f9b78e1a4
|
[] |
no_license
|
pallenJ/exe
|
https://github.com/pallenJ/exe
|
d89bfd0f105969cd8e6f5cda218a619f2e849ce2
|
370235dedc0ff471cb6164ab0e33726c724788c5
|
refs/heads/master
| 2022-12-24T17:45:40.270000 | 2019-09-05T07:33:45 | 2019-09-05T07:33:45 | 187,769,520 | 0 | 0 | null | false | 2022-12-16T00:43:56 | 2019-05-21T05:45:22 | 2019-09-05T07:33:52 | 2022-12-16T00:43:53 | 1,277 | 0 | 0 | 44 |
JavaScript
| false | false |
package com.example.asn.domain;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
import java.util.TreeSet;
import java.util.concurrent.ConcurrentHashMap;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
@Slf4j
@Getter
public class RecordDTO extends ConcurrentHashMap<String, Map<String, Double>> {
private static final long serialVersionUID = 1L;
public static final int D=0, K=1, E=2 , M=3, T = 4, A=5, LT=6, LA=7 ,RMAX=8 , RMIN = 9;
public static final String[] keys={"default","korean","english","math","sta_total","sta_average","sta_lec_total","sta_lec_average", "rc_MAX", "rc_MIN"};
String[] lectures = {keys[K],keys[E],keys[M]};
public static final List<String> STD_NAME_LIST = new ArrayList<String>(Arrays.asList(new String[]{"정형돈", "정준하" , "유재석" , "박명수", "하하","지석진" , "김종국", "개리" , "이광수", "송지효"})) ;
public RecordDTO() {
keyRecord = new HashMap<>();
lectureSetting();
}
private Map<String, Map<Double, Set<String>>> keyRecord;// 과목 - > 점수 - > 이름
private void lectureSetting() {
for (String lec : lectures) {
this.put(lec, new HashMap<>());
keyRecord.put(lec, new HashMap<>());
}
this.put("sta_total", new HashMap<>());
keyRecord.put("sta_total", new HashMap<>());
this.put("sta_average", new HashMap<>());
keyRecord.put("sta_average", new HashMap<>());
}
public void putlec(String lecture) {
if (this.containsKey(lecture)) {
log.info("이미 존재하는 과목 입니다");
}
this.put(lecture, new HashMap<>());
}
public void putRec(String lecture, String name, double record) {
if (!this.containsKey(lecture)) {
this.putlec(lecture);
}
this.get(lecture).put(name, record);
putRecRev(lecture, name, record);
}
private void putRecRev(String lecture, String name, double record) {
Map<Double, Set<String>> revMap = keyRecord.get(lecture);
if (!revMap.containsKey(record))
revMap.put(record, new HashSet<>());
revMap.get(record).add(name);
}
public void putRec(String lecture, Map<String, Double> rmap) {
if (rmap == null || rmap.keySet().size() == 0)
return;
this.put(lecture, rmap);
for (String stdName : rmap.keySet()) {
putRecRev(lecture, stdName, rmap.get(stdName));
}
}
public List<String> stdSortList(int lec){
if(lec == D) return RecordDTO.STD_NAME_LIST;
List<String> stdNameList = new ArrayList<>();
String lecStr = keys[lec];
Map<Double, Set<String>> invRecTable = new TreeMap<>(keyRecord.get(lecStr));
for (Iterator<Double> itr = invRecTable.keySet().iterator(); itr.hasNext();) {
double recTemp = itr.next();
stdNameList.addAll(new TreeSet<String>(invRecTable.get(recTemp)));
}
return stdNameList;
}
public void setSta() {
//과목별 개인별 평균/합을 위한 Map들
Map<String, Double> totalRec = new HashMap<>();
Map<String, Double> aveRec = new HashMap<>();
Map<String, Double> totalLec = new HashMap<>();
Map<String, Double> aveLec = new HashMap<>();
// 개인 과목 평균은 0에서 점수를 하나씩 더하는 식으로. 평균은 그 값에서 과목수만큼 나누는 식으로.
double stdCnt = RecordDTO.STD_NAME_LIST.size();
double lecCnt = lectures.length;
totalRec = new HashMap<>();
double l_total;
double adderRec;//더해질 점수 temp
double bfRec;//이전 점수
for (String lecture : lectures) {
l_total = 0.0;
Map<String, Double> stdTemp = this.get(lecture);
for (String name : stdTemp.keySet()) {
adderRec = stdTemp.get(name);
l_total += adderRec;
if (!totalRec.containsKey(name)) {
totalRec.put(name, 0.0);
aveRec.put(name, 0.0);
}
bfRec = totalRec.get(name);
totalRec.replace(name, bfRec + adderRec);
aveRec.replace(name, (bfRec + adderRec) / lecCnt);
}
totalLec.put(lecture, l_total);
aveLec.put(lecture, l_total / stdCnt);
}
Map<Double, Set<String>> totalInv = keyRecord.get("sta_total");
Map<Double, Set<String>> avgInv = keyRecord.get("sta_average");
double totalRecV;// 총합 temp
double avgRecV;// 평균 temp
for (String name : totalRec.keySet()) {
totalRecV = totalRec.get(name);
avgRecV = totalRecV / lecCnt;
if (!totalInv.containsKey(totalRecV)) {
totalInv.put(totalRecV, new HashSet<>());
avgInv.put(avgRecV, new HashSet<>());
}
totalInv.get(totalRecV).add(name);
avgInv.get(avgRecV).add(name);
}
if (this.keySet().contains(keys[T])) {
this.replace(keys[T], totalRec);
this.replace(keys[A], aveRec);
} else {
this.put(keys[T], totalRec);
this.put(keys[A], aveRec);
}
if (this.containsKey(keys[LT])) {
this.replace(keys[LT], totalLec);
this.replace(keys[LA], aveLec);
} else {
this.put(keys[LT], totalLec);
this.put(keys[LA], aveLec);
}
setMaxMin();
}
private void setMaxMin() {
Map<String, Double> lecMAX = new HashMap<>();
Map<String, Double> lecMIN = new HashMap<>();
//과목별 1등과 꼴지의 점수를 저장하기 위한 메소드
double maxTemp;
double minTemp;
List<String> lecList = new ArrayList<String>(Arrays.asList(lectures));
lecList.add(keys[T]);
lecList.add(keys[A]);
for (String lecture : lecList) {
Set<Double> recTemp = keyRecord.get(lecture).keySet();
lecMAX.put(lecture, 0.0);
lecMIN.put(lecture, 1000.0);
for (Double rec : recTemp){
maxTemp = lecMAX.get(lecture);
minTemp = lecMIN.get(lecture);
if(rec>maxTemp) lecMAX.replace(lecture, rec);
if(rec<minTemp) lecMIN.replace(lecture, rec);
}
}
this.put(keys[RMAX],lecMAX);
this.put(keys[RMIN],lecMIN);
}
}
|
UTF-8
|
Java
| 6,031 |
java
|
RecordDTO.java
|
Java
|
[] | null |
[] |
package com.example.asn.domain;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
import java.util.TreeSet;
import java.util.concurrent.ConcurrentHashMap;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
@Slf4j
@Getter
public class RecordDTO extends ConcurrentHashMap<String, Map<String, Double>> {
private static final long serialVersionUID = 1L;
public static final int D=0, K=1, E=2 , M=3, T = 4, A=5, LT=6, LA=7 ,RMAX=8 , RMIN = 9;
public static final String[] keys={"default","korean","english","math","sta_total","sta_average","sta_lec_total","sta_lec_average", "rc_MAX", "rc_MIN"};
String[] lectures = {keys[K],keys[E],keys[M]};
public static final List<String> STD_NAME_LIST = new ArrayList<String>(Arrays.asList(new String[]{"정형돈", "정준하" , "유재석" , "박명수", "하하","지석진" , "김종국", "개리" , "이광수", "송지효"})) ;
public RecordDTO() {
keyRecord = new HashMap<>();
lectureSetting();
}
private Map<String, Map<Double, Set<String>>> keyRecord;// 과목 - > 점수 - > 이름
private void lectureSetting() {
for (String lec : lectures) {
this.put(lec, new HashMap<>());
keyRecord.put(lec, new HashMap<>());
}
this.put("sta_total", new HashMap<>());
keyRecord.put("sta_total", new HashMap<>());
this.put("sta_average", new HashMap<>());
keyRecord.put("sta_average", new HashMap<>());
}
public void putlec(String lecture) {
if (this.containsKey(lecture)) {
log.info("이미 존재하는 과목 입니다");
}
this.put(lecture, new HashMap<>());
}
public void putRec(String lecture, String name, double record) {
if (!this.containsKey(lecture)) {
this.putlec(lecture);
}
this.get(lecture).put(name, record);
putRecRev(lecture, name, record);
}
private void putRecRev(String lecture, String name, double record) {
Map<Double, Set<String>> revMap = keyRecord.get(lecture);
if (!revMap.containsKey(record))
revMap.put(record, new HashSet<>());
revMap.get(record).add(name);
}
public void putRec(String lecture, Map<String, Double> rmap) {
if (rmap == null || rmap.keySet().size() == 0)
return;
this.put(lecture, rmap);
for (String stdName : rmap.keySet()) {
putRecRev(lecture, stdName, rmap.get(stdName));
}
}
public List<String> stdSortList(int lec){
if(lec == D) return RecordDTO.STD_NAME_LIST;
List<String> stdNameList = new ArrayList<>();
String lecStr = keys[lec];
Map<Double, Set<String>> invRecTable = new TreeMap<>(keyRecord.get(lecStr));
for (Iterator<Double> itr = invRecTable.keySet().iterator(); itr.hasNext();) {
double recTemp = itr.next();
stdNameList.addAll(new TreeSet<String>(invRecTable.get(recTemp)));
}
return stdNameList;
}
public void setSta() {
//과목별 개인별 평균/합을 위한 Map들
Map<String, Double> totalRec = new HashMap<>();
Map<String, Double> aveRec = new HashMap<>();
Map<String, Double> totalLec = new HashMap<>();
Map<String, Double> aveLec = new HashMap<>();
// 개인 과목 평균은 0에서 점수를 하나씩 더하는 식으로. 평균은 그 값에서 과목수만큼 나누는 식으로.
double stdCnt = RecordDTO.STD_NAME_LIST.size();
double lecCnt = lectures.length;
totalRec = new HashMap<>();
double l_total;
double adderRec;//더해질 점수 temp
double bfRec;//이전 점수
for (String lecture : lectures) {
l_total = 0.0;
Map<String, Double> stdTemp = this.get(lecture);
for (String name : stdTemp.keySet()) {
adderRec = stdTemp.get(name);
l_total += adderRec;
if (!totalRec.containsKey(name)) {
totalRec.put(name, 0.0);
aveRec.put(name, 0.0);
}
bfRec = totalRec.get(name);
totalRec.replace(name, bfRec + adderRec);
aveRec.replace(name, (bfRec + adderRec) / lecCnt);
}
totalLec.put(lecture, l_total);
aveLec.put(lecture, l_total / stdCnt);
}
Map<Double, Set<String>> totalInv = keyRecord.get("sta_total");
Map<Double, Set<String>> avgInv = keyRecord.get("sta_average");
double totalRecV;// 총합 temp
double avgRecV;// 평균 temp
for (String name : totalRec.keySet()) {
totalRecV = totalRec.get(name);
avgRecV = totalRecV / lecCnt;
if (!totalInv.containsKey(totalRecV)) {
totalInv.put(totalRecV, new HashSet<>());
avgInv.put(avgRecV, new HashSet<>());
}
totalInv.get(totalRecV).add(name);
avgInv.get(avgRecV).add(name);
}
if (this.keySet().contains(keys[T])) {
this.replace(keys[T], totalRec);
this.replace(keys[A], aveRec);
} else {
this.put(keys[T], totalRec);
this.put(keys[A], aveRec);
}
if (this.containsKey(keys[LT])) {
this.replace(keys[LT], totalLec);
this.replace(keys[LA], aveLec);
} else {
this.put(keys[LT], totalLec);
this.put(keys[LA], aveLec);
}
setMaxMin();
}
private void setMaxMin() {
Map<String, Double> lecMAX = new HashMap<>();
Map<String, Double> lecMIN = new HashMap<>();
//과목별 1등과 꼴지의 점수를 저장하기 위한 메소드
double maxTemp;
double minTemp;
List<String> lecList = new ArrayList<String>(Arrays.asList(lectures));
lecList.add(keys[T]);
lecList.add(keys[A]);
for (String lecture : lecList) {
Set<Double> recTemp = keyRecord.get(lecture).keySet();
lecMAX.put(lecture, 0.0);
lecMIN.put(lecture, 1000.0);
for (Double rec : recTemp){
maxTemp = lecMAX.get(lecture);
minTemp = lecMIN.get(lecture);
if(rec>maxTemp) lecMAX.replace(lecture, rec);
if(rec<minTemp) lecMIN.replace(lecture, rec);
}
}
this.put(keys[RMAX],lecMAX);
this.put(keys[RMIN],lecMIN);
}
}
| 6,031 | 0.634206 | 0.629007 | 201 | 26.711443 | 24.848923 | 173 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.776119 | false | false |
0
|
f6cc8649b3edc9b343ba01a5bbff90c2306fb180
| 34,187,939,732,533 |
a671ef4acca452a6018a63101bb6b91ffe037083
|
/DoublyLinkedList.java
|
ed46897534906aa96e659ba685686e6bb0522b5d
|
[] |
no_license
|
rsrika/Linked_List_Practice
|
https://github.com/rsrika/Linked_List_Practice
|
5157765eff1757d6dcbb6dddcb276a7df6739e0a
|
c668760fcbe471efcec6b6335cb743c66c122c7e
|
refs/heads/main
| 2023-02-06T19:34:39.882000 | 2020-12-31T00:05:36 | 2020-12-31T00:05:36 | 325,672,011 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
import java.util.NoSuchElementException;
public class DoublyLinkedList<T>
{
T data;
Node<T> head;
public DoublyLinkedList()
{
head = null;
}
public DoublyLinkedList(T t)
{
head = new Node<T>(t);
}
public static String author()
{
return "Srikanth, Roshni";
}
public boolean isEmpty()
{
if(head == null)
{
return true;
}
return false;
}
public int size()
{
int i = 1;
if(isEmpty())
{
return 0;
}
else
{
Node<T> currentNode = head;
while(currentNode.next != null)
{
i++;
currentNode = currentNode.next;
}
}
return i;
}
public String toString()
{
String i = "";
if(isEmpty())
{
return "null";
}
else
{
i+= "null <-- ";
Node<T> currentNode = head;
T val = currentNode.data;
i+= val;
currentNode = currentNode.next;
while(currentNode != null)
{
val = currentNode.data;
i+= " <--> "+val;
currentNode = currentNode.next;
}
i+=" --> null";
}
return i;
}
public T get(int index)
{
int size = size();
if(index< 0 || index>= size || isEmpty())
{
throw new IndexOutOfBoundsException();
}
else
{
Node<T> currentNode = head;
int i = 0;
while(i<index)
{
currentNode = currentNode.next;
i++;
}
return currentNode.data;
}
}
public boolean contains(T t)
{
if(isEmpty())
{
return false;
}
int size = size();
for(int i = 0; i< size; i++)
{
if(t == get(i))
{
return true;
}
}
return false;
}
public Node<T> getNode(int index)
{
int size = size();
Node<T> currentNode = head;
if(index< 0 || index>= size|| isEmpty())
{
throw new IndexOutOfBoundsException();
}
else
{
int i = 0;
while(i<index)
{
currentNode = currentNode.next;
i++;
}
}
return currentNode;
}
public void add(int index, T n)
{
int size = size();
if((index<0 || index>=size) && index !=0)
{
throw new IndexOutOfBoundsException();
}
if(isEmpty() && index == 0)
{
add(n);
}
else if( index>0 && index<=size-1)
{
Node<T> newNode = new Node<T>(n);
Node<T> previousNode = getNode(index);
Node<T> nextNode =previousNode.next;
newNode.next = nextNode;
previousNode.next = newNode;
newNode.prev = previousNode;
if(nextNode!= null)
{
nextNode.prev = newNode;
}
}
else if( index==1&& size ==2)
{
Node<T> firstNode = getNode(0);
Node<T> secondNode = getNode(1);
Node<T> newNode = new Node<T>(n);
newNode.next = secondNode;
secondNode.prev = newNode;
firstNode.next = newNode;
newNode.prev = firstNode;
secondNode.next = null;
}
else if (index == 0)
{
Node<T> newNode = new Node<T>(n);
newNode.next = head;
head = newNode;
head.next.prev = newNode;
newNode.prev = null;
}
}
// adds at the end of the list
public void add(T n)
{
int size = size();
if(isEmpty())
{
head = new Node<T>(n);
}
else
{
Node<T> newNode = new Node<T>(n);
Node<T> lastNode = getNode(size-1);
lastNode.next = newNode;
newNode.prev = lastNode;
}
}
// removes the first node of the list, returns the firstNode data
public T remove()
{
if(isEmpty())
{
throw new NoSuchElementException();
}
T toReturn = head.data;
head = head.next;
head.prev = null;
return toReturn;
}
// removes the Node at index, returns the value of the node at index
public T remove(int index)
{
int size = size();
if(isEmpty() || index<0 || index>=size)
{
throw new IndexOutOfBoundsException();
}
if(index>0&& index< size-1)
{
Node<T> previousNode = getNode(index-1);
Node<T> nextNode = getNode(index+1);
previousNode.next = nextNode;
nextNode.prev = previousNode;
return get(index);
}
else if(index == 0)
{
remove();
}
else if(index == size-1)
{
Node<T> previousNode = getNode(index-1);
previousNode.next = null;
}
return get(index);
}
public static class Node<T>
{
private T data;
private Node<T> next;
private Node<T> prev;
public Node()
{
data = null;
next = null;
prev = null;
}
public Node(T n)
{
data = n;
next = null;
prev = null;
}
public Node(T n, Node<T> nextNode, Node<T> prevNode)
{
data = n;
next = nextNode;
prev = prevNode;
}
}
}
|
UTF-8
|
Java
| 4,576 |
java
|
DoublyLinkedList.java
|
Java
|
[
{
"context": "\n\t\r\n\tpublic static String author()\r\n\t{\r\n\t\treturn \"Srikanth, Roshni\";\r\n\t}\r\n\t\r\n\tpublic boolean isEmpty()\r\n\t{\r\n\t\tif(hea",
"end": 293,
"score": 0.9998956918716431,
"start": 277,
"tag": "NAME",
"value": "Srikanth, Roshni"
}
] | null |
[] |
import java.util.NoSuchElementException;
public class DoublyLinkedList<T>
{
T data;
Node<T> head;
public DoublyLinkedList()
{
head = null;
}
public DoublyLinkedList(T t)
{
head = new Node<T>(t);
}
public static String author()
{
return "<NAME>";
}
public boolean isEmpty()
{
if(head == null)
{
return true;
}
return false;
}
public int size()
{
int i = 1;
if(isEmpty())
{
return 0;
}
else
{
Node<T> currentNode = head;
while(currentNode.next != null)
{
i++;
currentNode = currentNode.next;
}
}
return i;
}
public String toString()
{
String i = "";
if(isEmpty())
{
return "null";
}
else
{
i+= "null <-- ";
Node<T> currentNode = head;
T val = currentNode.data;
i+= val;
currentNode = currentNode.next;
while(currentNode != null)
{
val = currentNode.data;
i+= " <--> "+val;
currentNode = currentNode.next;
}
i+=" --> null";
}
return i;
}
public T get(int index)
{
int size = size();
if(index< 0 || index>= size || isEmpty())
{
throw new IndexOutOfBoundsException();
}
else
{
Node<T> currentNode = head;
int i = 0;
while(i<index)
{
currentNode = currentNode.next;
i++;
}
return currentNode.data;
}
}
public boolean contains(T t)
{
if(isEmpty())
{
return false;
}
int size = size();
for(int i = 0; i< size; i++)
{
if(t == get(i))
{
return true;
}
}
return false;
}
public Node<T> getNode(int index)
{
int size = size();
Node<T> currentNode = head;
if(index< 0 || index>= size|| isEmpty())
{
throw new IndexOutOfBoundsException();
}
else
{
int i = 0;
while(i<index)
{
currentNode = currentNode.next;
i++;
}
}
return currentNode;
}
public void add(int index, T n)
{
int size = size();
if((index<0 || index>=size) && index !=0)
{
throw new IndexOutOfBoundsException();
}
if(isEmpty() && index == 0)
{
add(n);
}
else if( index>0 && index<=size-1)
{
Node<T> newNode = new Node<T>(n);
Node<T> previousNode = getNode(index);
Node<T> nextNode =previousNode.next;
newNode.next = nextNode;
previousNode.next = newNode;
newNode.prev = previousNode;
if(nextNode!= null)
{
nextNode.prev = newNode;
}
}
else if( index==1&& size ==2)
{
Node<T> firstNode = getNode(0);
Node<T> secondNode = getNode(1);
Node<T> newNode = new Node<T>(n);
newNode.next = secondNode;
secondNode.prev = newNode;
firstNode.next = newNode;
newNode.prev = firstNode;
secondNode.next = null;
}
else if (index == 0)
{
Node<T> newNode = new Node<T>(n);
newNode.next = head;
head = newNode;
head.next.prev = newNode;
newNode.prev = null;
}
}
// adds at the end of the list
public void add(T n)
{
int size = size();
if(isEmpty())
{
head = new Node<T>(n);
}
else
{
Node<T> newNode = new Node<T>(n);
Node<T> lastNode = getNode(size-1);
lastNode.next = newNode;
newNode.prev = lastNode;
}
}
// removes the first node of the list, returns the firstNode data
public T remove()
{
if(isEmpty())
{
throw new NoSuchElementException();
}
T toReturn = head.data;
head = head.next;
head.prev = null;
return toReturn;
}
// removes the Node at index, returns the value of the node at index
public T remove(int index)
{
int size = size();
if(isEmpty() || index<0 || index>=size)
{
throw new IndexOutOfBoundsException();
}
if(index>0&& index< size-1)
{
Node<T> previousNode = getNode(index-1);
Node<T> nextNode = getNode(index+1);
previousNode.next = nextNode;
nextNode.prev = previousNode;
return get(index);
}
else if(index == 0)
{
remove();
}
else if(index == size-1)
{
Node<T> previousNode = getNode(index-1);
previousNode.next = null;
}
return get(index);
}
public static class Node<T>
{
private T data;
private Node<T> next;
private Node<T> prev;
public Node()
{
data = null;
next = null;
prev = null;
}
public Node(T n)
{
data = n;
next = null;
prev = null;
}
public Node(T n, Node<T> nextNode, Node<T> prevNode)
{
data = n;
next = nextNode;
prev = prevNode;
}
}
}
| 4,566 | 0.542395 | 0.536713 | 265 | 15.267924 | 13.841145 | 69 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.615094 | false | false |
0
|
c2262b1a35a40b390bec27d5c489bac38d788fc6
| 39,616,778,344,095 |
869afb5ddb2406a8f23d6bddde22161f3f97517d
|
/Annotations/src/lti/pojo/Book.java
|
3f748b1d98eef5e0eb09ae6c4a7ad5f010d61b08
|
[] |
no_license
|
krish71/training
|
https://github.com/krish71/training
|
343db43581dad9c71348aa7c1254e36de5c7be69
|
a004632a5c83dd20d48b99e7d70d96c647e5ae18
|
refs/heads/master
| 2020-03-24T23:56:12.555000 | 2018-08-29T13:16:11 | 2018-08-29T13:16:11 | 143,161,430 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package lti.pojo;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import org.hibernate.annotations.NaturalId;
@Entity
@Table
public class Book {
public Book(int i, String string, String string2, int j) {
}
public int getId() {
return Id;
}
public void setId(int id) {
Id = id;
}
public int getIsbn() {
return isbn;
}
public void setIsbn(int isbn) {
this.isbn = isbn;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getAuthor() {
return author;
}
public void setAuthor(String author) {
this.author = author;
}
public double getPrice() {
return price;
}
public void setPrice(double price) {
this.price = price;
}
@Id
@GeneratedValue
private int Id;
@NaturalId
private int isbn;
private String title;
private String author;
private double price;
}
|
UTF-8
|
Java
| 1,013 |
java
|
Book.java
|
Java
|
[] | null |
[] |
package lti.pojo;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import org.hibernate.annotations.NaturalId;
@Entity
@Table
public class Book {
public Book(int i, String string, String string2, int j) {
}
public int getId() {
return Id;
}
public void setId(int id) {
Id = id;
}
public int getIsbn() {
return isbn;
}
public void setIsbn(int isbn) {
this.isbn = isbn;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getAuthor() {
return author;
}
public void setAuthor(String author) {
this.author = author;
}
public double getPrice() {
return price;
}
public void setPrice(double price) {
this.price = price;
}
@Id
@GeneratedValue
private int Id;
@NaturalId
private int isbn;
private String title;
private String author;
private double price;
}
| 1,013 | 0.669299 | 0.668312 | 55 | 16.418182 | 13.698959 | 59 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.363636 | false | false |
0
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.