blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 410 | content_id stringlengths 40 40 | detected_licenses listlengths 0 51 | license_type stringclasses 2
values | repo_name stringlengths 5 132 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringlengths 4 80 | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 684M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 22
values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 132
values | src_encoding stringclasses 34
values | language stringclasses 1
value | is_vendor bool 1
class | is_generated bool 2
classes | length_bytes int64 3 9.45M | extension stringclasses 28
values | content stringlengths 3 9.45M | authors listlengths 1 1 | author_id stringlengths 0 352 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
a5f51551cb24953f00f2036715b371b8bafc3f6c | 66278bc86a63822c7ad4a5a04b3ec570f55d627c | /io/github/bananapuncher714/operation/gunsmoke/api/entity/npc/NPCAction.java | 9939bb770d52e1cb083d9c6192d152b6d899209a | [] | no_license | BananaPuncher714/OperationGunsmoke | 24658989eebc16b28f54d26d5ce86fa8d73c4a74 | 567f55ddde9321a95492c43e7fac20e162705468 | refs/heads/master | 2022-04-17T07:13:03.417418 | 2020-03-27T19:08:33 | 2020-03-27T19:08:33 | 250,623,669 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 264 | java | package io.github.bananapuncher714.operation.gunsmoke.api.entity.npc;
public enum NPCAction {
LEFT_CLICK,
HOLD_RIGHT_CLICK,
RELEASE_RIGHT_CLICK,
START_SNEAKING,
STOP_SNEAKING,
START_SPRINTING,
STOP_SPRINTING,
START_FALL_FLYING,
F,
L,
Q,
CTRL_Q,
E;
}
| [
"danielgu714@gmail.com"
] | danielgu714@gmail.com |
8e9b9727214a34a2de06a2f871874edf8b41c340 | 9c39efec82b655936d8c48157e88f1c9ae2f85c4 | /seauto-core/src/main/java/com/partnet/automation/http/RequestBuilder.java | 57f974dcaa54fa107d2f37d196934204b2a78727 | [
"Apache-2.0"
] | permissive | bbarke/seauto | 439b0283732f60055d86f996a09cc988f8ca84b9 | ee76f671aacf39fff07e47be31a633a1792e4bfb | refs/heads/master | 2021-01-18T15:36:16.809276 | 2016-01-14T01:47:38 | 2016-01-14T01:47:38 | 32,940,185 | 0 | 0 | null | 2015-03-26T16:51:26 | 2015-03-26T16:51:25 | Java | UTF-8 | Java | false | false | 4,495 | java | /*
* Copyright 2015 Partnet, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.partnet.automation.http;
import org.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.net.URI;
import java.util.ArrayList;
import java.util.List;
/**
* Created by Brent Barker on 12/7/15.
*/
public class RequestBuilder<T extends RequestBuilder> {
private static final Logger LOG = LoggerFactory.getLogger(RequestBuilder.class);
private final String domain;
private String path;
private HttpAdapter httpAdapter;
private HttpMethod method;
private String body;
private String contentType;
private List<HeaderAdapter> headers = new ArrayList<>();
private List<Parameter> parameters = new ArrayList<>();
private List<CookieAdapter> cookies = new ArrayList<>();
public RequestBuilder(String domain, HttpAdapter httpAdapter) {
this.domain = domain;
this.httpAdapter = httpAdapter;
}
public T setMethod(HttpMethod method) {
this.method = method;
return (T) this;
}
public T setPath(String path) {
this.path = path;
return (T) this;
}
public T setBody(String body) {
this.body = body;
return (T) this;
}
public T setBody(JSONObject body) {
return setBody(body.toString());
}
public T setContentType(String contentType) {
this.contentType = contentType;
return (T) this;
}
public T addParameter(String name, String value) {
parameters.add(new Parameter(name, value));
return (T) this;
}
public T addHeader(HeaderAdapter header) {
headers.add(header);
return (T) this;
}
public T addCookie(CookieAdapter cookie) {
this.cookies.add(cookie);
return (T) this;
}
public T addCookies(List<CookieAdapter> cookies) {
this.cookies.addAll(cookies);
return (T) this;
}
public T addHeader(String name, String value) {
headers.add(new HeaderAdapter(name, value));
return (T) this;
}
/**
* Clears the cookies in this builder object along with the cookies in the {@link HttpAdapter}
*/
public void clearCookies() {
httpAdapter.clearCookies();
cookies.clear();
}
public Response build() {
HeaderAdapter[] headerAdapArray = headers.toArray(new HeaderAdapter[headers.size()]);
Response response;
URI uri = getUri();
httpAdapter.addCookies(cookies);
if(method == null)
throw new IllegalStateException("Http method can not be null!");
if((method == HttpMethod.DELETE || method == HttpMethod.GET) && body != null)
LOG.warn("Setting a body for DELETE or GET methods has no impact");
switch(method){
case GET:
response = httpAdapter.get(uri, headerAdapArray);
break;
case POST:
response = httpAdapter.post(uri, headerAdapArray, contentType, body);
break;
case PUT:
response = httpAdapter.put(uri, headerAdapArray, contentType, body);
break;
case DELETE:
response = httpAdapter.delete(uri, headerAdapArray);
break;
default:
throw new IllegalArgumentException(String.format("Unknown http method: %s", method));
}
//clear previous values
headers.clear();
parameters.clear();
path = null;
return response;
}
private URI getUri() {
StringBuilder sb = new StringBuilder();
sb.append(domain).append(path);
if(parameters.size() > 0) {
sb.append("?")
.append(parameters.get(0).name)
.append("=")
.append(parameters.get(0).value);
}
for(int i = 1; i < parameters.size(); i++) {
sb.append("&")
.append(parameters.get(i).name)
.append("=")
.append(parameters.get(i).value);
}
return URI.create(sb.toString());
}
private class Parameter {
private final String name;
private final String value;
public Parameter(String name, String value) {
this.name = name;
this.value = value;
}
}
}
| [
"bbarker@part.net"
] | bbarker@part.net |
a23b1f2799c4bf4cc9da80f5a93035f6cd87fa41 | 082e26b011e30dc62a62fae95f375e4f87d9e99c | /docs/weixin_7.0.4_source/反编译源码/未反混淆/src/main/java/com/tencent/mm/plugin/appbrand/page/at.java | 0cebb7ba7bbb69cc86527a1375b2d270e85505fb | [] | no_license | xsren/AndroidReverseNotes | 9631a5aabc031006e795a112b7ac756a8edd4385 | 9202c276fe9f04a978e4e08b08e42645d97ca94b | refs/heads/master | 2021-04-07T22:50:51.072197 | 2019-07-16T02:24:43 | 2019-07-16T02:24:43 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,935 | java | package com.tencent.mm.plugin.appbrand.page;
import a.f.b.j;
import a.l;
import android.content.res.Resources;
import android.view.View;
import com.tencent.matrix.trace.core.AppMethodBeat;
import me.imid.swipebacklayout.lib.SwipeBackLayout;
@l(dWo = {1, 1, 13}, dWp = {"\u0000\u0018\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\bÀ\u0002\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J\u0012\u0010\u0003\u001a\u00020\u00042\b\u0010\u0005\u001a\u0004\u0018\u00010\u0006H\u0007¨\u0006\u0007"}, dWq = {"Lcom/tencent/mm/plugin/appbrand/page/SwipeBackLayoutSettingsAlignmentWC;", "", "()V", "alignSettings", "", "maybeSwipeLayout", "Landroid/view/View;", "plugin-appbrand-integration_release"})
public final class at {
public static final at ivg = new at();
static {
AppMethodBeat.i(134776);
AppMethodBeat.o(134776);
}
private at() {
}
public static final void cr(View view) {
View view2;
AppMethodBeat.i(134775);
if (view instanceof SwipeBackLayout) {
view2 = view;
} else {
view2 = null;
}
SwipeBackLayout swipeBackLayout = (SwipeBackLayout) view2;
if (swipeBackLayout != null) {
Resources resources = swipeBackLayout.getResources();
j.o(resources, "page.resources");
float f = resources.getDisplayMetrics().density;
float f2 = 300.0f * f;
swipeBackLayout.setMinVelocity(100.0f * f);
swipeBackLayout.setMaxVelocity(f2);
swipeBackLayout.setEdgeTrackingEnabled(1);
swipeBackLayout.setEdgeSize((int) ((f * 20.0f) + 0.5f));
swipeBackLayout.setEdgeTrackingEnabled(1);
swipeBackLayout.setScrimColor(0);
AppMethodBeat.o(134775);
return;
}
AppMethodBeat.o(134775);
}
}
| [
"alwangsisi@163.com"
] | alwangsisi@163.com |
0a777899ee171eff115aeca7c2c9cd320c2c1a89 | e9c682bf01665cada3b5a9aa73b851e4ba4de9b2 | /src/ROZNICA_DATY/asd.java | d86d937598707c0304205e68bdca3b89999451c4 | [] | no_license | strzelaczinho/ZadaniaLista | 70710776d5536b6b3f1a2fa49d8463a35fda726b | 103e9273ddaba0510eeb30c4d347d258121e4f31 | refs/heads/master | 2020-03-30T10:46:52.524670 | 2018-10-02T01:06:43 | 2018-10-02T01:06:43 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,986 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package ROZNICA_DATY;
/**
*
* @author adam
*/
import java.util.*;
import java.lang.*;
import java.io.*;
import java.text.SimpleDateFormat;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.time.temporal.ChronoUnit;
class Date{
int d,m,y;
Date(int d, int m, int y){
this.d=d;
this.m=m;
this.y=y;
}
int dayInMonth(int i){
if(i==1||i==3||i==5||i==7||i==8||i==10||i==12)
return 31;
else if(i==2)
return 28;
else
return 30;
}
int checkLeap()
{
if(m<=2)
y--;
return y/4-y/100+y/400;
}
long noOfDays(){
int d1=y*365+d;
for(int i=1;i<m;i++){
d1+=dayInMonth(i);
}
d1+=checkLeap();
return d1;
}
}
class GFG {
public static void main (String[] args) throws Exception {
//code
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int t = Integer.parseInt(br.readLine());
for(int i=1;i<=t;i++){
String temp1[] = br.readLine().split(" ");
int d1 = Integer.parseInt(temp1[0]);
int m1 = Integer.parseInt(temp1[1]);
int y1 = Integer.parseInt(temp1[2]);
Date date1 = new Date(d1,m1,y1);
String temp2[] = br.readLine().split(" ");
int d2 = Integer.parseInt(temp2[0]);
int m2 = Integer.parseInt(temp2[1]);
int y2 = Integer.parseInt(temp2[2]);
Date date2 = new Date(d2,m2,y2);
System.out.println(Math.abs(date2.noOfDays()-date1.noOfDays()));
}
}
} | [
"szkolnymajl@gmail.com"
] | szkolnymajl@gmail.com |
f72d7ccb0225512cde236761bbeb412cac890721 | 3b543ecce70b31d3e9e8c8604ef7c672012e785e | /app/src/androidTest/java/com/example/floatnote/ExampleInstrumentedTest.java | 559e45c1bb0b895417d76431e3bc4efb9fa065da | [] | no_license | venkatanagasai6/float_note | 3ba260455ee724fc8a028261dabeb88cf73ac25c | e527567343770a57a6d20732fcfe7796446c901a | refs/heads/master | 2022-08-24T01:47:19.918591 | 2020-05-22T13:19:45 | 2020-05-22T13:19:45 | 266,115,036 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 758 | java | package com.example.floatnote;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("com.example.floatnote", appContext.getPackageName());
}
}
| [
"venkatanagasai6@gmail.com"
] | venkatanagasai6@gmail.com |
2b0f7eab414b27c0a1c2890cae1980986a445b78 | 32333d8fc848089b0323e251157c095885560586 | /ttm-web/src/main/java/com/elsa/ttm/test/FileUtil.java | 1bf45d8fc308b08f1d545520755790891a5d6893 | [] | no_license | elsa-yun/ttm | 92a9ae5823a32035bf0638041bad7909d5d7df56 | e7ed01c8e6c9e291b13b42bf9ed8ea77e248a5f4 | refs/heads/main | 2023-01-28T00:14:30.680257 | 2020-12-09T05:32:16 | 2020-12-09T05:32:16 | 319,815,158 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,114 | java | package com.elsa.ttm.test;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.nio.channels.FileChannel;
import java.nio.channels.FileLock;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang.ArrayUtils;
import org.apache.log4j.Logger;
public class FileUtil {
private static Logger log = Logger.getLogger(FileUtil.class);
private static final int LOCAL_FILE_NUM = 5;
public static boolean writeFile(String filePath, String content) {
FileOutputStream outputStream = null;
FileLock fileLock = null;
FileChannel channel = null;
try {
String folderPath = filePath.substring(0, filePath.lastIndexOf("/"));
File file = new File(folderPath);
mkDir(file);
File configFile = new File(filePath);
outputStream = new FileOutputStream(configFile,true);
channel = outputStream.getChannel();
fileLock = channel.lock();
outputStream.write(content.getBytes());
outputStream.flush();
} catch (Exception e) {
log.error(e.getMessage());
} finally {
if (fileLock != null) {
try {
fileLock.release();
fileLock = null;
} catch (IOException e) {
log.error(e.getMessage(), e);
}
}
if (channel != null) {
try {
channel.close();
channel = null;
} catch (IOException e) {
log.error(e.getMessage(), e);
}
}
if (outputStream != null) {
try {
outputStream.close();
} catch (IOException e) {
log.error(e.getMessage(), e);
}
}
}
writeFileTrimLine(filePath, filePath);
return true;
}
public static void mkDir(File file) {
if (file.getParentFile().exists()) {
file.mkdir();
} else {
mkDir(file.getParentFile());
file.mkdir();
}
}
public static void copyFile(String sourceFilePath, String retFilePath) {
File sourceFile = new File(sourceFilePath);
File retFile = new File(retFilePath);
try {
FileUtils.copyFile(sourceFile, retFile);
} catch (IOException e) {
} catch (Exception e) {
}
}
private static void sortStringList(List<String> stringList) {
Collections.sort(stringList, new Comparator<String>() {
public int compare(String o1, String o2) {
String str1 = (String) o1;
String str2 = (String) o2;
return str1.compareTo(str2);
}
});
}
private static List<String> listFiles(String path) {
List<String> list = new ArrayList<String>();
File directory = new File(path);
File[] directoryFiles = directory.listFiles();
if (!ArrayUtils.isEmpty(directoryFiles)) {
for (File file : directoryFiles) {
if (file.isDirectory()) {
List<String> l = listFiles(path + file.getName() + "/");
list.addAll(l);
} else {
if (file.getName().contains(".properties")) {
list.add(path + file.getName());
}
}
}
}
return list;
}
private static Map<String, List<String>> getLocalConfigFilesMaps(String path) {
List<String> list = listFiles(path);
Map<String, List<String>> map = new HashMap<String, List<String>>();
if (!list.isEmpty()) {
for (String str : list) {
String substring = str.substring(path.length());
String[] strArr = substring.split("_");
String key = strArr[0];
List<String> values = map.get(key);
if (null == values || values.isEmpty()) {
values = new ArrayList<String>();
}
values.add(str);
map.put(key, values);
}
}
return map;
}
/**
* b.properties=>e:/gen/b.properties_201240506121207
* config/a.properties=>e:/gen/config/a.properties_20150212160707
*
* @param path
* @return
*/
public static Map<String, String> getLocalAllConfigFileMap(String path) {
Map<String, List<String>> map = getLocalConfigFilesMaps(path);
Map<String, String> returnMap = new HashMap<String, String>();
if (!map.isEmpty()) {
for (Map.Entry<String, List<String>> entry : map.entrySet()) {
List<String> values = entry.getValue();
sortStringList(values);
int index = values.size() - 1;
String filePath = values.get(index);
returnMap.put(entry.getKey(), filePath);
}
}
return returnMap;
}
public static boolean setBackFileList(String backFolder) {
File backFileFolder = new File(backFolder);
File[] fileArray = backFileFolder.listFiles();
List<String> allFiles = new ArrayList<String>();
if (!ArrayUtils.isEmpty(fileArray)) {
for (File file : fileArray) {
if (file.isFile()) {
allFiles.add(file.getName());
}
}
Map<String, List<String>> map = new HashMap<String, List<String>>();
for (String str : allFiles) {
if (str.contains("_")) {
String[] arr = str.split("_");
if (arr.length > 0) {
String key = arr[0];
if (map.containsKey(key)) {
map.get(key).add(str);
} else {
List<String> fileNameList = new ArrayList<String>();
fileNameList.add(str);
map.put(key, fileNameList);
}
}
}
}
if (!map.isEmpty()) {
for (Map.Entry<String, List<String>> entry : map.entrySet()) {
List<String> fileList = entry.getValue();
sortStringList(fileList);
int size = fileList.size();
if (size > LOCAL_FILE_NUM) {
List<String> removeList = fileList.subList(0, size - LOCAL_FILE_NUM);
for (String str : removeList) {
File f = new File(backFolder + str);
if (f.exists()) {
f.delete();
}
}
fileList.removeAll(removeList);
}
}
}
}
return true;
}
public static String getFolder(String fullTargetFilePath) {
return fullTargetFilePath.substring(0, fullTargetFilePath.lastIndexOf("/") + 1);
}
public static String genrateBackFileName(String filePath) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
String format = sdf.format(new Date());
return filePath + "_" + format;
}
public static List<String> readFileByLines(String fileName) {
List<String> set = new ArrayList<String>();
File file = new File(fileName);
BufferedReader reader = null;
try {
reader = new BufferedReader(new FileReader(file));
String tempString = null;
int line = 1;
while ((tempString = reader.readLine()) != null) {
if (null != tempString && !"".equals(tempString) && !tempString.startsWith("#")) {
set.add(tempString.trim());
}
line++;
}
} catch (IOException e) {
log.error(e.getMessage(), e);
} catch (Exception e) {
log.error(e.getMessage(), e);
} finally {
if (reader != null) {
try {
reader.close();
} catch (IOException e1) {
}
}
}
return set;
}
public static void writeFileTrimLine(String source_file_path, String ret_file_path) {
List<String> list = readFileByLines(source_file_path);
Iterator<String> iterator = list.iterator();
File file = new File(ret_file_path);
FileWriter fw = null;
BufferedWriter writer = null;
try {
fw = new FileWriter(file);
writer = new BufferedWriter(fw);
while (iterator.hasNext()) {
writer.write(iterator.next());
writer.newLine();
}
writer.flush();
} catch (FileNotFoundException e) {
log.error(e.getMessage(), e);
} catch (IOException e) {
log.error(e.getMessage(), e);
} catch (Exception e) {
log.error(e.getMessage(), e);
} finally {
try {
if (fw != null) {
fw.close();
}
if (writer != null) {
writer.close();
}
} catch (IOException e) {
}
}
}
public static void main(String args[]) {
// String source_file_path =
// "D:\\configserver\\configserver-web\\src\\main\\resources\\config\\config.properties";
// String ret_file_path =
// "D:\\configserver\\configserver-web\\src\\main\\resources\\config\\config.txt";
// writeFileTrimLine(source_file_path, source_file_path);
//setBackFileList("D:/abc/config/");
}
}
| [
"longhaisheng@chexiang.com"
] | longhaisheng@chexiang.com |
cea912289c48d11b994b91ba65b0b5af8a9087a2 | 328472841867209fff5e98767fcc69f18827dc94 | /trash/workspace/android/javah/com/hello/world.java | eeb96e50e8553f2bbce0ce3d8168ae7bbbd84ce9 | [] | no_license | hyz/dotfiles | a59ca1befdf1581f9dddd7af52806ac5af605c4e | 5e9e26ae6bc26cf7f5d3f79587751ccb42edc368 | refs/heads/master | 2023-05-27T18:14:39.292339 | 2023-05-21T06:48:33 | 2023-05-21T06:48:33 | 296,289 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 197 | java | package com.hello;
class world
{
public native void foo();
public static native void hello();
public static native String about();
public static native String about(int index);
}
| [
"jiyong.wu@gmail.com"
] | jiyong.wu@gmail.com |
2bc6a1fc85bcbd70d97756f088aeecc533e12e24 | 1fb4647888e7390a156e2d9f0ef49443da7345e2 | /src/main/java/com/lhy/commons/utils/CookieUtils.java | acd96950390c95d8b77ffc41fc15960d1a5c8f92 | [
"Apache-2.0"
] | permissive | lhy0719/xhtBlog | 408896cc79dc87aa143ee4dc817bf73f8e64add6 | d5ff31725820c3406b41040800f5322b387c8653 | refs/heads/master | 2021-01-01T05:15:00.110066 | 2016-05-19T15:26:41 | 2016-05-19T15:26:41 | 58,355,436 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,027 | java | /**
* Copyright © 2012-2014 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
*/
package com.lhy.commons.utils;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.net.URLEncoder;
/**
* Cookie工具类
* @author ThinkGem
* @version 2013-01-15
*/
public class CookieUtils {
/**
* 设置 Cookie(生成时间为1天)
* @param name 名称
* @param value 值
*/
public static void setCookie(HttpServletResponse response, String name, String value) {
setCookie(response, name, value, 60*60*24);
}
/**
* 设置 Cookie
* @param name 名称
* @param value 值
* @param maxAge 生存时间(单位秒)
* @param uri 路径
*/
public static void setCookie(HttpServletResponse response, String name, String value, String path) {
setCookie(response, name, value, path, 60*60*24);
}
/**
* 设置 Cookie
* @param name 名称
* @param value 值
* @param maxAge 生存时间(单位秒)
* @param uri 路径
*/
public static void setCookie(HttpServletResponse response, String name, String value, int maxAge) {
setCookie(response, name, value, "/", maxAge);
}
/**
* 设置 Cookie
* @param name 名称
* @param value 值
* @param maxAge 生存时间(单位秒)
* @param uri 路径
*/
public static void setCookie(HttpServletResponse response, String name, String value, String path, int maxAge) {
Cookie cookie = new Cookie(name, null);
cookie.setPath(path);
cookie.setMaxAge(maxAge);
try {
cookie.setValue(URLEncoder.encode(value, "utf-8"));
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
response.addCookie(cookie);
}
/**
* 获得指定Cookie的值
* @param name 名称
* @return 值
*/
public static String getCookie(HttpServletRequest request, String name) {
return getCookie(request, null, name, false);
}
/**
* 获得指定Cookie的值,并删除。
* @param name 名称
* @return 值
*/
public static String getCookie(HttpServletRequest request, HttpServletResponse response, String name) {
return getCookie(request, response, name, true);
}
/**
* 获得指定Cookie的值
* @param request 请求对象
* @param response 响应对象
* @param name 名字
* @param isRemove 是否移除
* @return 值
*/
public static String getCookie(HttpServletRequest request, HttpServletResponse response, String name, boolean isRemove) {
String value = null;
Cookie[] cookies = request.getCookies();
if (cookies != null) {
for (Cookie cookie : cookies) {
if (cookie.getName().equals(name)) {
try {
value = URLDecoder.decode(cookie.getValue(), "utf-8");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
if (isRemove) {
cookie.setMaxAge(0);
response.addCookie(cookie);
}
}
}
}
return value;
}
}
| [
"xuhaitao@jd.com"
] | xuhaitao@jd.com |
b87c2d5feab6f26ca1163756fdcecd5895bda469 | 7641a92c397b7be5a59f0ad55b4254009601f9d2 | /src/java/FollowersResult.java | 4449d8faaad08aa2bce111bc6e2ddad282e7bcb6 | [] | no_license | avinash8792/Twitter-prototype | daf6081587cbc7be27c5f10114219e154e2b6980 | e3bf40ff4d393b8eceb3609903be2e94a1d6cda7 | refs/heads/master | 2020-05-22T02:12:03.100286 | 2017-03-11T15:46:20 | 2017-03-11T15:46:20 | 84,660,853 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 474 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
public class FollowersResult {
private String followloginID;
public String getFollowloginID() {
return followloginID;
}
public void setFollowloginID(String followloginID) {
this.followloginID = followloginID;
}
public FollowersResult() {
}
}
| [
"avinash8792@gmail.com"
] | avinash8792@gmail.com |
d8c0c39fdc31f5a65fb2b44b3bf10caffe355b21 | 93bb4679a18b29b41d60065f34b7fec770cdbd00 | /jbpm-human-task/jbpm-human-task-core/src/test/java/org/jbpm/process/workitem/wsht/test/async/AsyncTestQHTWorkItemHandlerTest.java | 0d55673de40659aaf95e262c018932c667e80c64 | [] | no_license | tcharman/jbpm | 9636bf2da7b14aa198246aae03491776b4817a2d | c91e48310534e33d64455d312763bd52a44f33f2 | refs/heads/master | 2021-01-17T16:01:53.188719 | 2012-05-29T14:42:28 | 2012-05-30T16:32:18 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,691 | java | /**
* Copyright 2010 JBoss Inc
*
* 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.jbpm.process.workitem.wsht.test.async;
import static org.jbpm.task.service.test.impl.TestServerUtil.startAsyncServer;
import org.jbpm.process.workitem.wsht.async.WSHumanTaskHandlerBaseAsyncTest;
import org.jbpm.task.TestStatefulKnowledgeSession;
import org.jbpm.task.service.TaskServer;
import org.jbpm.task.service.test.impl.AsyncTestHTWorkItemHandler;
public class AsyncTestQHTWorkItemHandlerTest extends WSHumanTaskHandlerBaseAsyncTest {
private TaskServer server;
@Override
protected void setUp() throws Exception {
super.setUp();
server = startAsyncServer(taskService, 1);
while (!server.isRunning()) {
Thread.sleep(50);
}
AsyncTestHTWorkItemHandler handler = new AsyncTestHTWorkItemHandler(new TestStatefulKnowledgeSession(), server);
setClient(handler.getClient());
setHandler(handler);
}
protected void tearDown() throws Exception {
((AsyncTestHTWorkItemHandler) getHandler()).dispose();
getClient().disconnect();
server.stop();
super.tearDown();
}
}
| [
"mrietvel@redhat.com"
] | mrietvel@redhat.com |
3cfe84643e1f0136ad7f194400e874f2a597b631 | 0be01d0bcbf8468fe3e475f2cfa57273106589bd | /src/main/java/com/hippsterhouse/web/rest/errors/FieldErrorVM.java | 0139bb6980857ca64cbc98ba82ad637b1f57b7d4 | [] | no_license | jolly1980/hippsterhouse | 475c674ccfe6312749000bea10adba6296947607 | d15b3bf88b5c189db335f1f0efa7475cdb07c0ee | refs/heads/master | 2020-05-16T09:25:10.309917 | 2019-04-23T11:07:06 | 2019-04-23T11:07:06 | 182,947,562 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 649 | java | package com.hippsterhouse.web.rest.errors;
import java.io.Serializable;
public class FieldErrorVM implements Serializable {
private static final long serialVersionUID = 1L;
private final String objectName;
private final String field;
private final String message;
public FieldErrorVM(String dto, String field, String message) {
this.objectName = dto;
this.field = field;
this.message = message;
}
public String getObjectName() {
return objectName;
}
public String getField() {
return field;
}
public String getMessage() {
return message;
}
}
| [
"thzoller@tsn.at"
] | thzoller@tsn.at |
fed59438ce61c35623935ff36e74f21ffedbb580 | b4bd4f75642545bb87417980f680d5e020d76a61 | /oa_07/src/com/bjsxt/oa/managers/impl/UserManagerImpl.java | e7fa5fd5979b637741dc5f423e9a187535869814 | [] | no_license | yomea/Java2 | 9404299fa08b9be32c5577be8f2d90d00604eac8 | 78abbf319b1c950a977391171fa49235481dfb49 | refs/heads/master | 2021-09-04T05:15:57.560334 | 2018-01-16T06:12:45 | 2018-01-16T06:12:45 | 72,603,240 | 1 | 0 | null | null | null | null | GB18030 | Java | false | false | 3,339 | java | package com.bjsxt.oa.managers.impl;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import com.bjsxt.oa.managers.SystemException;
import com.bjsxt.oa.managers.UserManager;
import com.bjsxt.oa.model.Person;
import com.bjsxt.oa.model.Role;
import com.bjsxt.oa.model.User;
import com.bjsxt.oa.model.UsersRoles;
public class UserManagerImpl extends AbstractManager implements UserManager {
public void addOrUpdateUserRole(int userId, int roleId, int orderNo) {
//首先根据userId和roleId查找UsersRoles对象
UsersRoles ur = findUsersRoles(userId,roleId);
if(ur == null){
ur = new UsersRoles();
ur.setOrderNo(orderNo);
ur.setRole((Role)getHibernateTemplate().load(Role.class, roleId));
ur.setUser((User)getHibernateTemplate().load(User.class, userId));
getHibernateTemplate().save(ur);
return;
}
//
ur.setOrderNo(orderNo);
getHibernateTemplate().update(ur);
}
public void addUser(User user, int personId) {
if(personId == 0){
throw new SystemException("必须选择相应的人员信息");
}
user.setPerson((Person)getHibernateTemplate().load(Person.class, personId));
//设置创建时间
user.setCreateTime(new Date());
getHibernateTemplate().save(user);
}
public void delUser(int userId) {
getHibernateTemplate().delete(getHibernateTemplate().load(User.class, userId));
}
public void delUserRole(int userId, int roleId) {
getHibernateTemplate().delete(findUsersRoles(userId,roleId));
}
public User findUser(int userId) {
return (User)getHibernateTemplate().load(User.class, userId);
}
public User login(String username, String password) {
/**
* 因为设置了User的auto-import="false",所以,在这里使用
* HQL查询的时候,必须使用全路径的类名
*/
User user = (User)getSession().createQuery(
"select u from com.bjsxt.oa.model.User u where u.username = ?")
.setParameter(0, username)
.uniqueResult();
if(user == null){
throw new SystemException("没有这个用户");
}
if(!user.getPassword().equals(password)){
throw new SystemException("密码错误!");
}
if(user.getExpireTime() != null){
//现在时间
Calendar now = Calendar.getInstance();
//失效时间
Calendar expireTime = Calendar.getInstance();
expireTime.setTime(user.getExpireTime());
//如果现在在失效时间之后
if(now.after(expireTime)){
throw new SystemException("用户信息已失效!");
}
}
return user;
}
public List searchUserRoles(int userId) {
return getHibernateTemplate().find("select ur from UsersRoles ur where ur.user.id = ?", userId);
}
public void updateUser(User user, int personId) {
if(personId == 0){
throw new SystemException("必须选择相应的人员信息");
}
user.setPerson((Person)getHibernateTemplate().load(Person.class, personId));
getHibernateTemplate().update(user);
}
private UsersRoles findUsersRoles(int userId,int roleId){
return (UsersRoles)getSession().createQuery(
"select ur from UsersRoles ur where ur.role.id = ? and ur.user.id = ?")
.setParameter(0, roleId)
.setParameter(1, userId)
.uniqueResult();
}
}
| [
"951645267@qq.com"
] | 951645267@qq.com |
33ac749254b8edf257f97e18a349286559f65060 | 8f0ec1c17765fea176ef8187df7e853e20ea1bd3 | /src/main/java/com/example/app/ws/DemoMobileAppWsApplication.java | 1a2c6f4f9140e888a2462d0f30a3daa590126dfb | [] | no_license | Aakashchauhan17/demo-mobile-app-ws | b377d5a8271557f80634557acd18efef44ea9158 | a6c0af55b3e8aeea2ee711dc40e8d6cdc798964b | refs/heads/master | 2020-04-15T07:47:08.650892 | 2019-01-07T21:45:51 | 2019-01-07T21:45:51 | 164,501,511 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 559 | java | package com.example.app.ws;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
@SpringBootApplication
public class DemoMobileAppWsApplication {
public static void main(String[] args) {
SpringApplication.run(DemoMobileAppWsApplication.class, args);
}
@Bean
public BCryptPasswordEncoder bCryptPasswordEncoder() {
return new BCryptPasswordEncoder();
}
}
| [
"aakash.chauhan1994@gmail.com"
] | aakash.chauhan1994@gmail.com |
3781c8dbbba5a46d1e123e1257c1eae298a73480 | d615e594c501269c1ba18600d9b66f3070bc6f47 | /src/main/java/com/sample/taxation/service/TaxCalculateService.java | 49bce9a8c46ed9cf5eb335f0685357e2b5413975 | [] | no_license | tejpratap4/taxation | 618cb2de28b632de0cb994a3814d282fb62e9060 | cecd1fc985e0172536926080135c27a3a321f7ba | refs/heads/master | 2021-05-07T07:44:39.231862 | 2017-11-03T01:36:45 | 2017-11-03T01:36:45 | 109,254,957 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,599 | java | package com.sample.taxation.service;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.sample.taxation.domain.Product;
import com.sample.taxation.exception.ErrorEnum;
import com.sample.taxation.exception.NotFoundInMapException;
import com.sample.taxation.persistence.MapProductRepository;
/**
* TaxCalculateService call the tax engines to apply the tax on given product.
*
*/
@Service
public class TaxCalculateService {
private MapProductRepository productRepository;
private List<TaxEngine> taxes;
@Autowired
public TaxCalculateService(MapProductRepository productRepository, TaxEngine... taxes) {
this.productRepository = productRepository;
this.taxes = Arrays.asList(taxes);
}
/**
* calculateTax find the product based on product name and call the
* taxEngine for calculating the tax.
*
* @param productName name of the product.
* @param actualAmount on we need to apply the tax.
* @return return the sum of taxes those are applicable for that product.
*/
public BigDecimal calculateTax(String productName, BigDecimal actualAmount) {
Product product = getProductByName(productName);
if (product == null) {
throw new NotFoundInMapException(ErrorEnum.PRODUCT_NOT_FOUND_IN_MAP);
}
return taxes.stream().map(tax -> tax.calculate(product, actualAmount)).reduce(BigDecimal.ZERO, BigDecimal::add);
}
public Product getProductByName(String name) {
return productRepository.findByProductName(name);
}
}
| [
"tejpratap.yadav@oracle.com"
] | tejpratap.yadav@oracle.com |
3e6083f2857b2acf91e0265ece7128d4455dcd22 | 07a61deb5db9c9fcf3287542d0729c53c72001e7 | /src/main/java/com/revisaon2/junit/entidades/Locacao.java | 045a06d0295956ba1ac6059283c1188abb172098 | [] | no_license | robsonpsdesv/project-junit | 1be08fab839c459dad81d21a4e3ef5f5eccf5b30 | b76f607a87c6fcdec1e167a5e3fc4169483de9cf | refs/heads/master | 2021-07-23T21:05:56.623011 | 2019-12-02T01:30:54 | 2019-12-02T01:30:54 | 225,253,158 | 0 | 0 | null | 2020-10-13T17:53:37 | 2019-12-02T00:34:27 | Java | UTF-8 | Java | false | false | 986 | java | package com.revisaon2.junit.entidades;
import java.util.Date;
public class Locacao {
private Usuario usuario;
private Filme filme;
private Date dataLocacao;
private Date dataRetorno;
private Double valor;
public Usuario getUsuario() {
return usuario;
}
public void setUsuario(Usuario usuario) {
this.usuario = usuario;
}
public Filme getFilme() {
return filme;
}
public void setFilme(Filme filme) {
this.filme = filme;
}
public Date getDataLocacao() {
return dataLocacao;
}
public void setDataLocacao(Date dataLocacao) {
this.dataLocacao = dataLocacao;
}
public Date getDataRetorno() {
return dataRetorno;
}
public void setDataRetorno(Date dataRetorno) {
this.dataRetorno = dataRetorno;
}
public Double getValor() {
return valor;
}
public void setValor(Double valor) {
this.valor = valor;
}
}
| [
"robson.silva.cr@gmail.com"
] | robson.silva.cr@gmail.com |
c879bb81a8f729b1351cfce5d95ea480102971c3 | 56d1c5242e970ca0d257801d4e627e2ea14c8aeb | /src/com/csms/leetcode/number/n800/n860/Leetcode871.java | b1ed941c7b90996dd77e1f75ded9cd762c005d21 | [] | no_license | dai-zi/leetcode | e002b41f51f1dbd5c960e79624e8ce14ac765802 | 37747c2272f0fb7184b0e83f052c3943c066abb7 | refs/heads/master | 2022-12-14T11:20:07.816922 | 2020-07-24T03:37:51 | 2020-07-24T03:37:51 | 282,111,073 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 636 | java | package com.csms.leetcode.number.n800.n860;
//最低加油次数
//困难
public class Leetcode871 {
public int minRefuelStops(int target, int startFuel, int[][] stations) {
int N = stations.length;
long[] dp = new long[N + 1];
dp[0] = startFuel;
for (int i = 0; i < N; ++i)
for (int t = i; t >= 0; --t)
if (dp[t] >= stations[i][0])
dp[t+1] = Math.max(dp[t+1], dp[t] + (long) stations[i][1]);
for (int i = 0; i <= N; ++i)
if (dp[i] >= target) return i;
return -1;
}
public static void main(String[] args) {
}
} | [
"liuxiaotongdaizi@sina.com"
] | liuxiaotongdaizi@sina.com |
c5fa0c36e31dd56e8f397276ffd2599f5a9539ed | 4570050f771e0ea8c712d4306dbf2916470917cf | /hibernate-plus/src/main/java/com/baomidou/hibernateplus/generator/config/rules/NamingStrategy.java | 853f11622c4fc8489874a8a3be8134ad7fc858a9 | [
"MIT"
] | permissive | jqmtony/hibernate-plus | a4cf574a84b7a816498478da1ae3ba645c084b2e | 5d025bbbfba36bf95478e43a1e6499277a06b57b | refs/heads/master | 2020-03-21T06:47:56.993845 | 2017-04-02T18:57:07 | 2017-04-02T18:57:07 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,008 | java | /**
* Copyright (c) 2011-2020, hubin (jobob@qq.com).
* <p>
* 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
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
package com.baomidou.hibernateplus.generator.config.rules;
import com.baomidou.hibernateplus.generator.config.ConstVal;
import com.baomidou.hibernateplus.utils.StringUtils;
/**
* 从数据库表到文件的命名策略
*
* @author YangHu, tangguo
* @since 2016/8/30
*/
public enum NamingStrategy {
/**
* 不做任何改变,原样输出
*/
nochange,
/**
* 下划线转驼峰命名
*/
underline_to_camel,
/**
* 仅去掉前缀
*/
remove_prefix,
/**
* 去掉前缀并且转驼峰
*/
remove_prefix_and_camel;
public static String underlineToCamel(String name) {
// 快速检查
if (StringUtils.isBlank(name)) {
// 没必要转换
return StringUtils.EMPTY;
}
StringBuilder result = new StringBuilder();
// 用下划线将原始字符串分割
String camels[] = name.toLowerCase().split(ConstVal.UNDERLINE);
for (String camel : camels) {
// 跳过原始字符串中开头、结尾的下换线或双重下划线
if (StringUtils.isBlank(camel)) {
continue;
}
// 处理真正的驼峰片段
if (result.length() == 0) {
// 第一个驼峰片段,全部字母都小写
result.append(camel);
} else {
// 其他的驼峰片段,首字母大写
result.append(capitalFirst(camel));
}
}
return result.toString();
}
/**
* 去掉下划线前缀
*
* @param name
* @return
*/
public static String removePrefix(String name) {
if (StringUtils.isBlank(name)) {
return StringUtils.EMPTY;
}
int idx = name.indexOf(ConstVal.UNDERLINE);
if (idx == -1) {
return name;
}
return name.substring(idx + 1);
}
/**
* 去掉指定的前缀
*
* @param name
* @param prefix
* @return
*/
public static String removePrefix(String name, String prefix) {
if (StringUtils.isBlank(name)) {
return StringUtils.EMPTY;
}
int idx = name.indexOf(ConstVal.UNDERLINE);
if (prefix != null && !"".equals(prefix.trim())) {
if (name.toLowerCase().matches("^" + prefix.toLowerCase() + ".*")) { // 判断是否有匹配的前缀,然后截取前缀
idx = prefix.length() - 1;
}
}
if (idx == -1) {
return name;
}
return name.substring(idx + 1);
}
/**
* 去掉下划线前缀且将后半部分转成驼峰格式
*
* @param name
* @param tablePrefix
* @return
*/
public static String removePrefixAndCamel(String name, String tablePrefix) {
return underlineToCamel(removePrefix(name, tablePrefix));
}
/**
* 实体首字母大写
*
* @param name 待转换的字符串
* @return 转换后的字符串
*/
public static String capitalFirst(String name) {
if (StringUtils.isNotBlank(name)) {
return name.substring(0, 1).toUpperCase() + name.substring(1);
/*char[] array = name.toCharArray();
array[0] -= 32;
return String.valueOf(array);*/
}
return StringUtils.EMPTY;
}
}
| [
"330952486@qq.com"
] | 330952486@qq.com |
c9c2b47db85bdc0d32ebfe10b2630549c43e7dcf | 1302a788aa73d8da772c6431b083ddd76eef937f | /WORKING_DIRECTORY/cts/tests/tests/renderscript/src/android/renderscript/cts/generated/TestFract.java | b11b36e0aa9a1536e0361df186254c1322a2f2d9 | [] | no_license | rockduan/androidN-android-7.1.1_r28 | b3c1bcb734225aa7813ab70639af60c06d658bf6 | 10bab435cd61ffa2e93a20c082624954c757999d | refs/heads/master | 2021-01-23T03:54:32.510867 | 2017-03-30T07:17:08 | 2017-03-30T07:17:08 | 86,135,431 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 71,313 | java | /*
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Don't edit this file! It is auto-generated by frameworks/rs/api/generate.sh.
package android.renderscript.cts;
import android.renderscript.Allocation;
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
import android.renderscript.cts.Target;
import java.util.Arrays;
public class TestFract extends RSBaseCompute {
private ScriptC_TestFract script;
private ScriptC_TestFractRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
script = new ScriptC_TestFract(mRS);
scriptRelaxed = new ScriptC_TestFractRelaxed(mRS);
}
public class ArgumentsFloatFloatFloat {
public float inV;
public Target.Floaty outFloor;
public Target.Floaty out;
}
private void checkFractFloatFloatFloat() {
Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x3c675d27l, false);
try {
Allocation outFloor = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
script.set_gAllocOutFloor(outFloor);
script.forEach_testFractFloatFloatFloat(inV, out);
verifyResultsFractFloatFloatFloat(inV, outFloor, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFractFloatFloatFloat: " + e.toString());
}
try {
Allocation outFloor = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
scriptRelaxed.set_gAllocOutFloor(outFloor);
scriptRelaxed.forEach_testFractFloatFloatFloat(inV, out);
verifyResultsFractFloatFloatFloat(inV, outFloor, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFractFloatFloatFloat: " + e.toString());
}
}
private void verifyResultsFractFloatFloatFloat(Allocation inV, Allocation outFloor, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 1];
Arrays.fill(arrayInV, (float) 42);
inV.copyTo(arrayInV);
float[] arrayOutFloor = new float[INPUTSIZE * 1];
Arrays.fill(arrayOutFloor, (float) 42);
outFloor.copyTo(arrayOutFloor);
float[] arrayOut = new float[INPUTSIZE * 1];
Arrays.fill(arrayOut, (float) 42);
out.copyTo(arrayOut);
StringBuilder message = new StringBuilder();
boolean errorFound = false;
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 1 ; j++) {
// Extract the inputs.
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
args.inV = arrayInV[i];
// Figure out what the outputs should have been.
Target target = new Target(Target.FunctionType.NORMAL, Target.ReturnType.FLOAT, relaxed);
CoreMathVerifier.computeFract(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.outFloor.couldBe(arrayOutFloor[i * 1 + j])) {
valid = false;
}
if (!args.out.couldBe(arrayOut[i * 1 + j])) {
valid = false;
}
if (!valid) {
if (!errorFound) {
errorFound = true;
message.append("Input inV: ");
appendVariableToMessage(message, args.inV);
message.append("\n");
message.append("Expected output outFloor: ");
appendVariableToMessage(message, args.outFloor);
message.append("\n");
message.append("Actual output outFloor: ");
appendVariableToMessage(message, arrayOutFloor[i * 1 + j]);
if (!args.outFloor.couldBe(arrayOutFloor[i * 1 + j])) {
message.append(" FAIL");
}
message.append("\n");
message.append("Expected output out: ");
appendVariableToMessage(message, args.out);
message.append("\n");
message.append("Actual output out: ");
appendVariableToMessage(message, arrayOut[i * 1 + j]);
if (!args.out.couldBe(arrayOut[i * 1 + j])) {
message.append(" FAIL");
}
message.append("\n");
message.append("Errors at");
}
message.append(" [");
message.append(Integer.toString(i));
message.append(", ");
message.append(Integer.toString(j));
message.append("]");
}
}
}
assertFalse("Incorrect output for checkFractFloatFloatFloat" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), errorFound);
}
private void checkFractFloat2Float2Float2() {
Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xcdf8f525l, false);
try {
Allocation outFloor = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
script.set_gAllocOutFloor(outFloor);
script.forEach_testFractFloat2Float2Float2(inV, out);
verifyResultsFractFloat2Float2Float2(inV, outFloor, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFractFloat2Float2Float2: " + e.toString());
}
try {
Allocation outFloor = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
scriptRelaxed.set_gAllocOutFloor(outFloor);
scriptRelaxed.forEach_testFractFloat2Float2Float2(inV, out);
verifyResultsFractFloat2Float2Float2(inV, outFloor, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFractFloat2Float2Float2: " + e.toString());
}
}
private void verifyResultsFractFloat2Float2Float2(Allocation inV, Allocation outFloor, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 2];
Arrays.fill(arrayInV, (float) 42);
inV.copyTo(arrayInV);
float[] arrayOutFloor = new float[INPUTSIZE * 2];
Arrays.fill(arrayOutFloor, (float) 42);
outFloor.copyTo(arrayOutFloor);
float[] arrayOut = new float[INPUTSIZE * 2];
Arrays.fill(arrayOut, (float) 42);
out.copyTo(arrayOut);
StringBuilder message = new StringBuilder();
boolean errorFound = false;
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 2 ; j++) {
// Extract the inputs.
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
args.inV = arrayInV[i * 2 + j];
// Figure out what the outputs should have been.
Target target = new Target(Target.FunctionType.NORMAL, Target.ReturnType.FLOAT, relaxed);
CoreMathVerifier.computeFract(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.outFloor.couldBe(arrayOutFloor[i * 2 + j])) {
valid = false;
}
if (!args.out.couldBe(arrayOut[i * 2 + j])) {
valid = false;
}
if (!valid) {
if (!errorFound) {
errorFound = true;
message.append("Input inV: ");
appendVariableToMessage(message, args.inV);
message.append("\n");
message.append("Expected output outFloor: ");
appendVariableToMessage(message, args.outFloor);
message.append("\n");
message.append("Actual output outFloor: ");
appendVariableToMessage(message, arrayOutFloor[i * 2 + j]);
if (!args.outFloor.couldBe(arrayOutFloor[i * 2 + j])) {
message.append(" FAIL");
}
message.append("\n");
message.append("Expected output out: ");
appendVariableToMessage(message, args.out);
message.append("\n");
message.append("Actual output out: ");
appendVariableToMessage(message, arrayOut[i * 2 + j]);
if (!args.out.couldBe(arrayOut[i * 2 + j])) {
message.append(" FAIL");
}
message.append("\n");
message.append("Errors at");
}
message.append(" [");
message.append(Integer.toString(i));
message.append(", ");
message.append(Integer.toString(j));
message.append("]");
}
}
}
assertFalse("Incorrect output for checkFractFloat2Float2Float2" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), errorFound);
}
private void checkFractFloat3Float3Float3() {
Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xcfd6f6c6l, false);
try {
Allocation outFloor = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
script.set_gAllocOutFloor(outFloor);
script.forEach_testFractFloat3Float3Float3(inV, out);
verifyResultsFractFloat3Float3Float3(inV, outFloor, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFractFloat3Float3Float3: " + e.toString());
}
try {
Allocation outFloor = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
scriptRelaxed.set_gAllocOutFloor(outFloor);
scriptRelaxed.forEach_testFractFloat3Float3Float3(inV, out);
verifyResultsFractFloat3Float3Float3(inV, outFloor, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFractFloat3Float3Float3: " + e.toString());
}
}
private void verifyResultsFractFloat3Float3Float3(Allocation inV, Allocation outFloor, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 4];
Arrays.fill(arrayInV, (float) 42);
inV.copyTo(arrayInV);
float[] arrayOutFloor = new float[INPUTSIZE * 4];
Arrays.fill(arrayOutFloor, (float) 42);
outFloor.copyTo(arrayOutFloor);
float[] arrayOut = new float[INPUTSIZE * 4];
Arrays.fill(arrayOut, (float) 42);
out.copyTo(arrayOut);
StringBuilder message = new StringBuilder();
boolean errorFound = false;
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 3 ; j++) {
// Extract the inputs.
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(Target.FunctionType.NORMAL, Target.ReturnType.FLOAT, relaxed);
CoreMathVerifier.computeFract(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.outFloor.couldBe(arrayOutFloor[i * 4 + j])) {
valid = false;
}
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
valid = false;
}
if (!valid) {
if (!errorFound) {
errorFound = true;
message.append("Input inV: ");
appendVariableToMessage(message, args.inV);
message.append("\n");
message.append("Expected output outFloor: ");
appendVariableToMessage(message, args.outFloor);
message.append("\n");
message.append("Actual output outFloor: ");
appendVariableToMessage(message, arrayOutFloor[i * 4 + j]);
if (!args.outFloor.couldBe(arrayOutFloor[i * 4 + j])) {
message.append(" FAIL");
}
message.append("\n");
message.append("Expected output out: ");
appendVariableToMessage(message, args.out);
message.append("\n");
message.append("Actual output out: ");
appendVariableToMessage(message, arrayOut[i * 4 + j]);
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
message.append(" FAIL");
}
message.append("\n");
message.append("Errors at");
}
message.append(" [");
message.append(Integer.toString(i));
message.append(", ");
message.append(Integer.toString(j));
message.append("]");
}
}
}
assertFalse("Incorrect output for checkFractFloat3Float3Float3" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), errorFound);
}
private void checkFractFloat4Float4Float4() {
Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xd1b4f867l, false);
try {
Allocation outFloor = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
script.set_gAllocOutFloor(outFloor);
script.forEach_testFractFloat4Float4Float4(inV, out);
verifyResultsFractFloat4Float4Float4(inV, outFloor, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFractFloat4Float4Float4: " + e.toString());
}
try {
Allocation outFloor = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
scriptRelaxed.set_gAllocOutFloor(outFloor);
scriptRelaxed.forEach_testFractFloat4Float4Float4(inV, out);
verifyResultsFractFloat4Float4Float4(inV, outFloor, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFractFloat4Float4Float4: " + e.toString());
}
}
private void verifyResultsFractFloat4Float4Float4(Allocation inV, Allocation outFloor, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 4];
Arrays.fill(arrayInV, (float) 42);
inV.copyTo(arrayInV);
float[] arrayOutFloor = new float[INPUTSIZE * 4];
Arrays.fill(arrayOutFloor, (float) 42);
outFloor.copyTo(arrayOutFloor);
float[] arrayOut = new float[INPUTSIZE * 4];
Arrays.fill(arrayOut, (float) 42);
out.copyTo(arrayOut);
StringBuilder message = new StringBuilder();
boolean errorFound = false;
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 4 ; j++) {
// Extract the inputs.
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(Target.FunctionType.NORMAL, Target.ReturnType.FLOAT, relaxed);
CoreMathVerifier.computeFract(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.outFloor.couldBe(arrayOutFloor[i * 4 + j])) {
valid = false;
}
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
valid = false;
}
if (!valid) {
if (!errorFound) {
errorFound = true;
message.append("Input inV: ");
appendVariableToMessage(message, args.inV);
message.append("\n");
message.append("Expected output outFloor: ");
appendVariableToMessage(message, args.outFloor);
message.append("\n");
message.append("Actual output outFloor: ");
appendVariableToMessage(message, arrayOutFloor[i * 4 + j]);
if (!args.outFloor.couldBe(arrayOutFloor[i * 4 + j])) {
message.append(" FAIL");
}
message.append("\n");
message.append("Expected output out: ");
appendVariableToMessage(message, args.out);
message.append("\n");
message.append("Actual output out: ");
appendVariableToMessage(message, arrayOut[i * 4 + j]);
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
message.append(" FAIL");
}
message.append("\n");
message.append("Errors at");
}
message.append(" [");
message.append(Integer.toString(i));
message.append(", ");
message.append(Integer.toString(j));
message.append("]");
}
}
}
assertFalse("Incorrect output for checkFractFloat4Float4Float4" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), errorFound);
}
public class ArgumentsFloatFloat {
public float inV;
public Target.Floaty out;
}
private void checkFractFloatFloat() {
Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x9db2cad3l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
script.forEach_testFractFloatFloat(inV, out);
verifyResultsFractFloatFloat(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFractFloatFloat: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
scriptRelaxed.forEach_testFractFloatFloat(inV, out);
verifyResultsFractFloatFloat(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFractFloatFloat: " + e.toString());
}
}
private void verifyResultsFractFloatFloat(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 1];
Arrays.fill(arrayInV, (float) 42);
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 1];
Arrays.fill(arrayOut, (float) 42);
out.copyTo(arrayOut);
StringBuilder message = new StringBuilder();
boolean errorFound = false;
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 1 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
args.inV = arrayInV[i];
// Figure out what the outputs should have been.
Target target = new Target(Target.FunctionType.NORMAL, Target.ReturnType.FLOAT, relaxed);
CoreMathVerifier.computeFract(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 1 + j])) {
valid = false;
}
if (!valid) {
if (!errorFound) {
errorFound = true;
message.append("Input inV: ");
appendVariableToMessage(message, args.inV);
message.append("\n");
message.append("Expected output out: ");
appendVariableToMessage(message, args.out);
message.append("\n");
message.append("Actual output out: ");
appendVariableToMessage(message, arrayOut[i * 1 + j]);
if (!args.out.couldBe(arrayOut[i * 1 + j])) {
message.append(" FAIL");
}
message.append("\n");
message.append("Errors at");
}
message.append(" [");
message.append(Integer.toString(i));
message.append(", ");
message.append(Integer.toString(j));
message.append("]");
}
}
}
assertFalse("Incorrect output for checkFractFloatFloat" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), errorFound);
}
private void checkFractFloat2Float2() {
Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xc4d52edfl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
script.forEach_testFractFloat2Float2(inV, out);
verifyResultsFractFloat2Float2(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFractFloat2Float2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
scriptRelaxed.forEach_testFractFloat2Float2(inV, out);
verifyResultsFractFloat2Float2(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFractFloat2Float2: " + e.toString());
}
}
private void verifyResultsFractFloat2Float2(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 2];
Arrays.fill(arrayInV, (float) 42);
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 2];
Arrays.fill(arrayOut, (float) 42);
out.copyTo(arrayOut);
StringBuilder message = new StringBuilder();
boolean errorFound = false;
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 2 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
args.inV = arrayInV[i * 2 + j];
// Figure out what the outputs should have been.
Target target = new Target(Target.FunctionType.NORMAL, Target.ReturnType.FLOAT, relaxed);
CoreMathVerifier.computeFract(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 2 + j])) {
valid = false;
}
if (!valid) {
if (!errorFound) {
errorFound = true;
message.append("Input inV: ");
appendVariableToMessage(message, args.inV);
message.append("\n");
message.append("Expected output out: ");
appendVariableToMessage(message, args.out);
message.append("\n");
message.append("Actual output out: ");
appendVariableToMessage(message, arrayOut[i * 2 + j]);
if (!args.out.couldBe(arrayOut[i * 2 + j])) {
message.append(" FAIL");
}
message.append("\n");
message.append("Errors at");
}
message.append(" [");
message.append(Integer.toString(i));
message.append(", ");
message.append(Integer.toString(j));
message.append("]");
}
}
}
assertFalse("Incorrect output for checkFractFloat2Float2" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), errorFound);
}
private void checkFractFloat3Float3() {
Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xbaf04fbdl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
script.forEach_testFractFloat3Float3(inV, out);
verifyResultsFractFloat3Float3(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFractFloat3Float3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
scriptRelaxed.forEach_testFractFloat3Float3(inV, out);
verifyResultsFractFloat3Float3(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFractFloat3Float3: " + e.toString());
}
}
private void verifyResultsFractFloat3Float3(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 4];
Arrays.fill(arrayInV, (float) 42);
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
Arrays.fill(arrayOut, (float) 42);
out.copyTo(arrayOut);
StringBuilder message = new StringBuilder();
boolean errorFound = false;
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 3 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(Target.FunctionType.NORMAL, Target.ReturnType.FLOAT, relaxed);
CoreMathVerifier.computeFract(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
valid = false;
}
if (!valid) {
if (!errorFound) {
errorFound = true;
message.append("Input inV: ");
appendVariableToMessage(message, args.inV);
message.append("\n");
message.append("Expected output out: ");
appendVariableToMessage(message, args.out);
message.append("\n");
message.append("Actual output out: ");
appendVariableToMessage(message, arrayOut[i * 4 + j]);
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
message.append(" FAIL");
}
message.append("\n");
message.append("Errors at");
}
message.append(" [");
message.append(Integer.toString(i));
message.append(", ");
message.append(Integer.toString(j));
message.append("]");
}
}
}
assertFalse("Incorrect output for checkFractFloat3Float3" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), errorFound);
}
private void checkFractFloat4Float4() {
Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xb10b709bl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
script.forEach_testFractFloat4Float4(inV, out);
verifyResultsFractFloat4Float4(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFractFloat4Float4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
scriptRelaxed.forEach_testFractFloat4Float4(inV, out);
verifyResultsFractFloat4Float4(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFractFloat4Float4: " + e.toString());
}
}
private void verifyResultsFractFloat4Float4(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 4];
Arrays.fill(arrayInV, (float) 42);
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
Arrays.fill(arrayOut, (float) 42);
out.copyTo(arrayOut);
StringBuilder message = new StringBuilder();
boolean errorFound = false;
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 4 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(Target.FunctionType.NORMAL, Target.ReturnType.FLOAT, relaxed);
CoreMathVerifier.computeFract(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
valid = false;
}
if (!valid) {
if (!errorFound) {
errorFound = true;
message.append("Input inV: ");
appendVariableToMessage(message, args.inV);
message.append("\n");
message.append("Expected output out: ");
appendVariableToMessage(message, args.out);
message.append("\n");
message.append("Actual output out: ");
appendVariableToMessage(message, arrayOut[i * 4 + j]);
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
message.append(" FAIL");
}
message.append("\n");
message.append("Errors at");
}
message.append(" [");
message.append(Integer.toString(i));
message.append(", ");
message.append(Integer.toString(j));
message.append("]");
}
}
}
assertFalse("Incorrect output for checkFractFloat4Float4" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), errorFound);
}
public class ArgumentsHalfHalfHalf {
public short inV;
public double inVDouble;
public Target.Floaty outFloor;
public Target.Floaty out;
}
private void checkFractHalfHalfHalf() {
Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_16, 1, 0x64a42fb6l, false);
try {
Allocation outFloor = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_16, 1), INPUTSIZE);
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_16, 1), INPUTSIZE);
script.set_gAllocOutFloor(outFloor);
script.forEach_testFractHalfHalfHalf(inV, out);
verifyResultsFractHalfHalfHalf(inV, outFloor, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFractHalfHalfHalf: " + e.toString());
}
try {
Allocation outFloor = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_16, 1), INPUTSIZE);
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_16, 1), INPUTSIZE);
scriptRelaxed.set_gAllocOutFloor(outFloor);
scriptRelaxed.forEach_testFractHalfHalfHalf(inV, out);
verifyResultsFractHalfHalfHalf(inV, outFloor, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFractHalfHalfHalf: " + e.toString());
}
}
private void verifyResultsFractHalfHalfHalf(Allocation inV, Allocation outFloor, Allocation out, boolean relaxed) {
short[] arrayInV = new short[INPUTSIZE * 1];
Arrays.fill(arrayInV, (short) 42);
inV.copyTo(arrayInV);
short[] arrayOutFloor = new short[INPUTSIZE * 1];
Arrays.fill(arrayOutFloor, (short) 42);
outFloor.copyTo(arrayOutFloor);
short[] arrayOut = new short[INPUTSIZE * 1];
Arrays.fill(arrayOut, (short) 42);
out.copyTo(arrayOut);
StringBuilder message = new StringBuilder();
boolean errorFound = false;
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 1 ; j++) {
// Extract the inputs.
ArgumentsHalfHalfHalf args = new ArgumentsHalfHalfHalf();
args.inV = arrayInV[i];
args.inVDouble = Float16Utils.convertFloat16ToDouble(args.inV);
// Figure out what the outputs should have been.
Target target = new Target(Target.FunctionType.NORMAL, Target.ReturnType.HALF, relaxed);
CoreMathVerifier.computeFract(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.outFloor.couldBe(Float16Utils.convertFloat16ToDouble(arrayOutFloor[i * 1 + j]))) {
valid = false;
}
if (!args.out.couldBe(Float16Utils.convertFloat16ToDouble(arrayOut[i * 1 + j]))) {
valid = false;
}
if (!valid) {
if (!errorFound) {
errorFound = true;
message.append("Input inV: ");
appendVariableToMessage(message, args.inV);
message.append("\n");
message.append("Expected output outFloor: ");
appendVariableToMessage(message, args.outFloor);
message.append("\n");
message.append("Actual output outFloor: ");
appendVariableToMessage(message, arrayOutFloor[i * 1 + j]);
message.append("\n");
message.append("Actual output outFloor (in double): ");
appendVariableToMessage(message, Float16Utils.convertFloat16ToDouble(arrayOutFloor[i * 1 + j]));
if (!args.outFloor.couldBe(Float16Utils.convertFloat16ToDouble(arrayOutFloor[i * 1 + j]))) {
message.append(" FAIL");
}
message.append("\n");
message.append("Expected output out: ");
appendVariableToMessage(message, args.out);
message.append("\n");
message.append("Actual output out: ");
appendVariableToMessage(message, arrayOut[i * 1 + j]);
message.append("\n");
message.append("Actual output out (in double): ");
appendVariableToMessage(message, Float16Utils.convertFloat16ToDouble(arrayOut[i * 1 + j]));
if (!args.out.couldBe(Float16Utils.convertFloat16ToDouble(arrayOut[i * 1 + j]))) {
message.append(" FAIL");
}
message.append("\n");
message.append("Errors at");
}
message.append(" [");
message.append(Integer.toString(i));
message.append(", ");
message.append(Integer.toString(j));
message.append("]");
}
}
}
assertFalse("Incorrect output for checkFractHalfHalfHalf" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), errorFound);
}
private void checkFractHalf2Half2Half2() {
Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_16, 2, 0x734da11cl, false);
try {
Allocation outFloor = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_16, 2), INPUTSIZE);
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_16, 2), INPUTSIZE);
script.set_gAllocOutFloor(outFloor);
script.forEach_testFractHalf2Half2Half2(inV, out);
verifyResultsFractHalf2Half2Half2(inV, outFloor, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFractHalf2Half2Half2: " + e.toString());
}
try {
Allocation outFloor = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_16, 2), INPUTSIZE);
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_16, 2), INPUTSIZE);
scriptRelaxed.set_gAllocOutFloor(outFloor);
scriptRelaxed.forEach_testFractHalf2Half2Half2(inV, out);
verifyResultsFractHalf2Half2Half2(inV, outFloor, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFractHalf2Half2Half2: " + e.toString());
}
}
private void verifyResultsFractHalf2Half2Half2(Allocation inV, Allocation outFloor, Allocation out, boolean relaxed) {
short[] arrayInV = new short[INPUTSIZE * 2];
Arrays.fill(arrayInV, (short) 42);
inV.copyTo(arrayInV);
short[] arrayOutFloor = new short[INPUTSIZE * 2];
Arrays.fill(arrayOutFloor, (short) 42);
outFloor.copyTo(arrayOutFloor);
short[] arrayOut = new short[INPUTSIZE * 2];
Arrays.fill(arrayOut, (short) 42);
out.copyTo(arrayOut);
StringBuilder message = new StringBuilder();
boolean errorFound = false;
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 2 ; j++) {
// Extract the inputs.
ArgumentsHalfHalfHalf args = new ArgumentsHalfHalfHalf();
args.inV = arrayInV[i * 2 + j];
args.inVDouble = Float16Utils.convertFloat16ToDouble(args.inV);
// Figure out what the outputs should have been.
Target target = new Target(Target.FunctionType.NORMAL, Target.ReturnType.HALF, relaxed);
CoreMathVerifier.computeFract(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.outFloor.couldBe(Float16Utils.convertFloat16ToDouble(arrayOutFloor[i * 2 + j]))) {
valid = false;
}
if (!args.out.couldBe(Float16Utils.convertFloat16ToDouble(arrayOut[i * 2 + j]))) {
valid = false;
}
if (!valid) {
if (!errorFound) {
errorFound = true;
message.append("Input inV: ");
appendVariableToMessage(message, args.inV);
message.append("\n");
message.append("Expected output outFloor: ");
appendVariableToMessage(message, args.outFloor);
message.append("\n");
message.append("Actual output outFloor: ");
appendVariableToMessage(message, arrayOutFloor[i * 2 + j]);
message.append("\n");
message.append("Actual output outFloor (in double): ");
appendVariableToMessage(message, Float16Utils.convertFloat16ToDouble(arrayOutFloor[i * 2 + j]));
if (!args.outFloor.couldBe(Float16Utils.convertFloat16ToDouble(arrayOutFloor[i * 2 + j]))) {
message.append(" FAIL");
}
message.append("\n");
message.append("Expected output out: ");
appendVariableToMessage(message, args.out);
message.append("\n");
message.append("Actual output out: ");
appendVariableToMessage(message, arrayOut[i * 2 + j]);
message.append("\n");
message.append("Actual output out (in double): ");
appendVariableToMessage(message, Float16Utils.convertFloat16ToDouble(arrayOut[i * 2 + j]));
if (!args.out.couldBe(Float16Utils.convertFloat16ToDouble(arrayOut[i * 2 + j]))) {
message.append(" FAIL");
}
message.append("\n");
message.append("Errors at");
}
message.append(" [");
message.append(Integer.toString(i));
message.append(", ");
message.append(Integer.toString(j));
message.append("]");
}
}
}
assertFalse("Incorrect output for checkFractHalf2Half2Half2" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), errorFound);
}
private void checkFractHalf3Half3Half3() {
Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_16, 3, 0xd1ecb1ebl, false);
try {
Allocation outFloor = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_16, 3), INPUTSIZE);
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_16, 3), INPUTSIZE);
script.set_gAllocOutFloor(outFloor);
script.forEach_testFractHalf3Half3Half3(inV, out);
verifyResultsFractHalf3Half3Half3(inV, outFloor, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFractHalf3Half3Half3: " + e.toString());
}
try {
Allocation outFloor = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_16, 3), INPUTSIZE);
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_16, 3), INPUTSIZE);
scriptRelaxed.set_gAllocOutFloor(outFloor);
scriptRelaxed.forEach_testFractHalf3Half3Half3(inV, out);
verifyResultsFractHalf3Half3Half3(inV, outFloor, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFractHalf3Half3Half3: " + e.toString());
}
}
private void verifyResultsFractHalf3Half3Half3(Allocation inV, Allocation outFloor, Allocation out, boolean relaxed) {
short[] arrayInV = new short[INPUTSIZE * 4];
Arrays.fill(arrayInV, (short) 42);
inV.copyTo(arrayInV);
short[] arrayOutFloor = new short[INPUTSIZE * 4];
Arrays.fill(arrayOutFloor, (short) 42);
outFloor.copyTo(arrayOutFloor);
short[] arrayOut = new short[INPUTSIZE * 4];
Arrays.fill(arrayOut, (short) 42);
out.copyTo(arrayOut);
StringBuilder message = new StringBuilder();
boolean errorFound = false;
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 3 ; j++) {
// Extract the inputs.
ArgumentsHalfHalfHalf args = new ArgumentsHalfHalfHalf();
args.inV = arrayInV[i * 4 + j];
args.inVDouble = Float16Utils.convertFloat16ToDouble(args.inV);
// Figure out what the outputs should have been.
Target target = new Target(Target.FunctionType.NORMAL, Target.ReturnType.HALF, relaxed);
CoreMathVerifier.computeFract(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.outFloor.couldBe(Float16Utils.convertFloat16ToDouble(arrayOutFloor[i * 4 + j]))) {
valid = false;
}
if (!args.out.couldBe(Float16Utils.convertFloat16ToDouble(arrayOut[i * 4 + j]))) {
valid = false;
}
if (!valid) {
if (!errorFound) {
errorFound = true;
message.append("Input inV: ");
appendVariableToMessage(message, args.inV);
message.append("\n");
message.append("Expected output outFloor: ");
appendVariableToMessage(message, args.outFloor);
message.append("\n");
message.append("Actual output outFloor: ");
appendVariableToMessage(message, arrayOutFloor[i * 4 + j]);
message.append("\n");
message.append("Actual output outFloor (in double): ");
appendVariableToMessage(message, Float16Utils.convertFloat16ToDouble(arrayOutFloor[i * 4 + j]));
if (!args.outFloor.couldBe(Float16Utils.convertFloat16ToDouble(arrayOutFloor[i * 4 + j]))) {
message.append(" FAIL");
}
message.append("\n");
message.append("Expected output out: ");
appendVariableToMessage(message, args.out);
message.append("\n");
message.append("Actual output out: ");
appendVariableToMessage(message, arrayOut[i * 4 + j]);
message.append("\n");
message.append("Actual output out (in double): ");
appendVariableToMessage(message, Float16Utils.convertFloat16ToDouble(arrayOut[i * 4 + j]));
if (!args.out.couldBe(Float16Utils.convertFloat16ToDouble(arrayOut[i * 4 + j]))) {
message.append(" FAIL");
}
message.append("\n");
message.append("Errors at");
}
message.append(" [");
message.append(Integer.toString(i));
message.append(", ");
message.append(Integer.toString(j));
message.append("]");
}
}
}
assertFalse("Incorrect output for checkFractHalf3Half3Half3" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), errorFound);
}
private void checkFractHalf4Half4Half4() {
Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_16, 4, 0x308bc2bal, false);
try {
Allocation outFloor = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_16, 4), INPUTSIZE);
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_16, 4), INPUTSIZE);
script.set_gAllocOutFloor(outFloor);
script.forEach_testFractHalf4Half4Half4(inV, out);
verifyResultsFractHalf4Half4Half4(inV, outFloor, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFractHalf4Half4Half4: " + e.toString());
}
try {
Allocation outFloor = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_16, 4), INPUTSIZE);
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_16, 4), INPUTSIZE);
scriptRelaxed.set_gAllocOutFloor(outFloor);
scriptRelaxed.forEach_testFractHalf4Half4Half4(inV, out);
verifyResultsFractHalf4Half4Half4(inV, outFloor, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFractHalf4Half4Half4: " + e.toString());
}
}
private void verifyResultsFractHalf4Half4Half4(Allocation inV, Allocation outFloor, Allocation out, boolean relaxed) {
short[] arrayInV = new short[INPUTSIZE * 4];
Arrays.fill(arrayInV, (short) 42);
inV.copyTo(arrayInV);
short[] arrayOutFloor = new short[INPUTSIZE * 4];
Arrays.fill(arrayOutFloor, (short) 42);
outFloor.copyTo(arrayOutFloor);
short[] arrayOut = new short[INPUTSIZE * 4];
Arrays.fill(arrayOut, (short) 42);
out.copyTo(arrayOut);
StringBuilder message = new StringBuilder();
boolean errorFound = false;
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 4 ; j++) {
// Extract the inputs.
ArgumentsHalfHalfHalf args = new ArgumentsHalfHalfHalf();
args.inV = arrayInV[i * 4 + j];
args.inVDouble = Float16Utils.convertFloat16ToDouble(args.inV);
// Figure out what the outputs should have been.
Target target = new Target(Target.FunctionType.NORMAL, Target.ReturnType.HALF, relaxed);
CoreMathVerifier.computeFract(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.outFloor.couldBe(Float16Utils.convertFloat16ToDouble(arrayOutFloor[i * 4 + j]))) {
valid = false;
}
if (!args.out.couldBe(Float16Utils.convertFloat16ToDouble(arrayOut[i * 4 + j]))) {
valid = false;
}
if (!valid) {
if (!errorFound) {
errorFound = true;
message.append("Input inV: ");
appendVariableToMessage(message, args.inV);
message.append("\n");
message.append("Expected output outFloor: ");
appendVariableToMessage(message, args.outFloor);
message.append("\n");
message.append("Actual output outFloor: ");
appendVariableToMessage(message, arrayOutFloor[i * 4 + j]);
message.append("\n");
message.append("Actual output outFloor (in double): ");
appendVariableToMessage(message, Float16Utils.convertFloat16ToDouble(arrayOutFloor[i * 4 + j]));
if (!args.outFloor.couldBe(Float16Utils.convertFloat16ToDouble(arrayOutFloor[i * 4 + j]))) {
message.append(" FAIL");
}
message.append("\n");
message.append("Expected output out: ");
appendVariableToMessage(message, args.out);
message.append("\n");
message.append("Actual output out: ");
appendVariableToMessage(message, arrayOut[i * 4 + j]);
message.append("\n");
message.append("Actual output out (in double): ");
appendVariableToMessage(message, Float16Utils.convertFloat16ToDouble(arrayOut[i * 4 + j]));
if (!args.out.couldBe(Float16Utils.convertFloat16ToDouble(arrayOut[i * 4 + j]))) {
message.append(" FAIL");
}
message.append("\n");
message.append("Errors at");
}
message.append(" [");
message.append(Integer.toString(i));
message.append(", ");
message.append(Integer.toString(j));
message.append("]");
}
}
}
assertFalse("Incorrect output for checkFractHalf4Half4Half4" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), errorFound);
}
public class ArgumentsHalfHalf {
public short inV;
public double inVDouble;
public Target.Floaty out;
}
private void checkFractHalfHalf() {
Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_16, 1, 0x96468e55l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_16, 1), INPUTSIZE);
script.forEach_testFractHalfHalf(inV, out);
verifyResultsFractHalfHalf(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFractHalfHalf: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_16, 1), INPUTSIZE);
scriptRelaxed.forEach_testFractHalfHalf(inV, out);
verifyResultsFractHalfHalf(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFractHalfHalf: " + e.toString());
}
}
private void verifyResultsFractHalfHalf(Allocation inV, Allocation out, boolean relaxed) {
short[] arrayInV = new short[INPUTSIZE * 1];
Arrays.fill(arrayInV, (short) 42);
inV.copyTo(arrayInV);
short[] arrayOut = new short[INPUTSIZE * 1];
Arrays.fill(arrayOut, (short) 42);
out.copyTo(arrayOut);
StringBuilder message = new StringBuilder();
boolean errorFound = false;
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 1 ; j++) {
// Extract the inputs.
ArgumentsHalfHalf args = new ArgumentsHalfHalf();
args.inV = arrayInV[i];
args.inVDouble = Float16Utils.convertFloat16ToDouble(args.inV);
// Figure out what the outputs should have been.
Target target = new Target(Target.FunctionType.NORMAL, Target.ReturnType.HALF, relaxed);
CoreMathVerifier.computeFract(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(Float16Utils.convertFloat16ToDouble(arrayOut[i * 1 + j]))) {
valid = false;
}
if (!valid) {
if (!errorFound) {
errorFound = true;
message.append("Input inV: ");
appendVariableToMessage(message, args.inV);
message.append("\n");
message.append("Expected output out: ");
appendVariableToMessage(message, args.out);
message.append("\n");
message.append("Actual output out: ");
appendVariableToMessage(message, arrayOut[i * 1 + j]);
message.append("\n");
message.append("Actual output out (in double): ");
appendVariableToMessage(message, Float16Utils.convertFloat16ToDouble(arrayOut[i * 1 + j]));
if (!args.out.couldBe(Float16Utils.convertFloat16ToDouble(arrayOut[i * 1 + j]))) {
message.append(" FAIL");
}
message.append("\n");
message.append("Errors at");
}
message.append(" [");
message.append(Integer.toString(i));
message.append(", ");
message.append(Integer.toString(j));
message.append("]");
}
}
}
assertFalse("Incorrect output for checkFractHalfHalf" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), errorFound);
}
private void checkFractHalf2Half2() {
Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_16, 2, 0xad1120fl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_16, 2), INPUTSIZE);
script.forEach_testFractHalf2Half2(inV, out);
verifyResultsFractHalf2Half2(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFractHalf2Half2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_16, 2), INPUTSIZE);
scriptRelaxed.forEach_testFractHalf2Half2(inV, out);
verifyResultsFractHalf2Half2(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFractHalf2Half2: " + e.toString());
}
}
private void verifyResultsFractHalf2Half2(Allocation inV, Allocation out, boolean relaxed) {
short[] arrayInV = new short[INPUTSIZE * 2];
Arrays.fill(arrayInV, (short) 42);
inV.copyTo(arrayInV);
short[] arrayOut = new short[INPUTSIZE * 2];
Arrays.fill(arrayOut, (short) 42);
out.copyTo(arrayOut);
StringBuilder message = new StringBuilder();
boolean errorFound = false;
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 2 ; j++) {
// Extract the inputs.
ArgumentsHalfHalf args = new ArgumentsHalfHalf();
args.inV = arrayInV[i * 2 + j];
args.inVDouble = Float16Utils.convertFloat16ToDouble(args.inV);
// Figure out what the outputs should have been.
Target target = new Target(Target.FunctionType.NORMAL, Target.ReturnType.HALF, relaxed);
CoreMathVerifier.computeFract(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(Float16Utils.convertFloat16ToDouble(arrayOut[i * 2 + j]))) {
valid = false;
}
if (!valid) {
if (!errorFound) {
errorFound = true;
message.append("Input inV: ");
appendVariableToMessage(message, args.inV);
message.append("\n");
message.append("Expected output out: ");
appendVariableToMessage(message, args.out);
message.append("\n");
message.append("Actual output out: ");
appendVariableToMessage(message, arrayOut[i * 2 + j]);
message.append("\n");
message.append("Actual output out (in double): ");
appendVariableToMessage(message, Float16Utils.convertFloat16ToDouble(arrayOut[i * 2 + j]));
if (!args.out.couldBe(Float16Utils.convertFloat16ToDouble(arrayOut[i * 2 + j]))) {
message.append(" FAIL");
}
message.append("\n");
message.append("Errors at");
}
message.append(" [");
message.append(Integer.toString(i));
message.append(", ");
message.append(Integer.toString(j));
message.append("]");
}
}
}
assertFalse("Incorrect output for checkFractHalf2Half2" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), errorFound);
}
private void checkFractHalf3Half3() {
Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_16, 3, 0x69d8d703l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_16, 3), INPUTSIZE);
script.forEach_testFractHalf3Half3(inV, out);
verifyResultsFractHalf3Half3(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFractHalf3Half3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_16, 3), INPUTSIZE);
scriptRelaxed.forEach_testFractHalf3Half3(inV, out);
verifyResultsFractHalf3Half3(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFractHalf3Half3: " + e.toString());
}
}
private void verifyResultsFractHalf3Half3(Allocation inV, Allocation out, boolean relaxed) {
short[] arrayInV = new short[INPUTSIZE * 4];
Arrays.fill(arrayInV, (short) 42);
inV.copyTo(arrayInV);
short[] arrayOut = new short[INPUTSIZE * 4];
Arrays.fill(arrayOut, (short) 42);
out.copyTo(arrayOut);
StringBuilder message = new StringBuilder();
boolean errorFound = false;
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 3 ; j++) {
// Extract the inputs.
ArgumentsHalfHalf args = new ArgumentsHalfHalf();
args.inV = arrayInV[i * 4 + j];
args.inVDouble = Float16Utils.convertFloat16ToDouble(args.inV);
// Figure out what the outputs should have been.
Target target = new Target(Target.FunctionType.NORMAL, Target.ReturnType.HALF, relaxed);
CoreMathVerifier.computeFract(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(Float16Utils.convertFloat16ToDouble(arrayOut[i * 4 + j]))) {
valid = false;
}
if (!valid) {
if (!errorFound) {
errorFound = true;
message.append("Input inV: ");
appendVariableToMessage(message, args.inV);
message.append("\n");
message.append("Expected output out: ");
appendVariableToMessage(message, args.out);
message.append("\n");
message.append("Actual output out: ");
appendVariableToMessage(message, arrayOut[i * 4 + j]);
message.append("\n");
message.append("Actual output out (in double): ");
appendVariableToMessage(message, Float16Utils.convertFloat16ToDouble(arrayOut[i * 4 + j]));
if (!args.out.couldBe(Float16Utils.convertFloat16ToDouble(arrayOut[i * 4 + j]))) {
message.append(" FAIL");
}
message.append("\n");
message.append("Errors at");
}
message.append(" [");
message.append(Integer.toString(i));
message.append(", ");
message.append(Integer.toString(j));
message.append("]");
}
}
}
assertFalse("Incorrect output for checkFractHalf3Half3" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), errorFound);
}
private void checkFractHalf4Half4() {
Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_16, 4, 0xc8e09bf7l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_16, 4), INPUTSIZE);
script.forEach_testFractHalf4Half4(inV, out);
verifyResultsFractHalf4Half4(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFractHalf4Half4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_16, 4), INPUTSIZE);
scriptRelaxed.forEach_testFractHalf4Half4(inV, out);
verifyResultsFractHalf4Half4(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFractHalf4Half4: " + e.toString());
}
}
private void verifyResultsFractHalf4Half4(Allocation inV, Allocation out, boolean relaxed) {
short[] arrayInV = new short[INPUTSIZE * 4];
Arrays.fill(arrayInV, (short) 42);
inV.copyTo(arrayInV);
short[] arrayOut = new short[INPUTSIZE * 4];
Arrays.fill(arrayOut, (short) 42);
out.copyTo(arrayOut);
StringBuilder message = new StringBuilder();
boolean errorFound = false;
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 4 ; j++) {
// Extract the inputs.
ArgumentsHalfHalf args = new ArgumentsHalfHalf();
args.inV = arrayInV[i * 4 + j];
args.inVDouble = Float16Utils.convertFloat16ToDouble(args.inV);
// Figure out what the outputs should have been.
Target target = new Target(Target.FunctionType.NORMAL, Target.ReturnType.HALF, relaxed);
CoreMathVerifier.computeFract(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(Float16Utils.convertFloat16ToDouble(arrayOut[i * 4 + j]))) {
valid = false;
}
if (!valid) {
if (!errorFound) {
errorFound = true;
message.append("Input inV: ");
appendVariableToMessage(message, args.inV);
message.append("\n");
message.append("Expected output out: ");
appendVariableToMessage(message, args.out);
message.append("\n");
message.append("Actual output out: ");
appendVariableToMessage(message, arrayOut[i * 4 + j]);
message.append("\n");
message.append("Actual output out (in double): ");
appendVariableToMessage(message, Float16Utils.convertFloat16ToDouble(arrayOut[i * 4 + j]));
if (!args.out.couldBe(Float16Utils.convertFloat16ToDouble(arrayOut[i * 4 + j]))) {
message.append(" FAIL");
}
message.append("\n");
message.append("Errors at");
}
message.append(" [");
message.append(Integer.toString(i));
message.append(", ");
message.append(Integer.toString(j));
message.append("]");
}
}
}
assertFalse("Incorrect output for checkFractHalf4Half4" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), errorFound);
}
public void testFract() {
checkFractFloatFloatFloat();
checkFractFloat2Float2Float2();
checkFractFloat3Float3Float3();
checkFractFloat4Float4Float4();
checkFractFloatFloat();
checkFractFloat2Float2();
checkFractFloat3Float3();
checkFractFloat4Float4();
checkFractHalfHalfHalf();
checkFractHalf2Half2Half2();
checkFractHalf3Half3Half3();
checkFractHalf4Half4Half4();
checkFractHalfHalf();
checkFractHalf2Half2();
checkFractHalf3Half3();
checkFractHalf4Half4();
}
}
| [
"duanliangsilence@gmail.com"
] | duanliangsilence@gmail.com |
8475f53c785fa928cbfb95539e340999a92905bb | 290e458df5a40ac57a960582dc6dc54d2f0370d1 | /EnvieFashionMagazine/app/src/main/java/team/envie/fashion/enviefashion/logic/LocaleState.java | 1e125bc7e7a5a86cf4456854a22ee29468506933 | [
"Apache-2.0"
] | permissive | Sror/EnvieFashionMagazine | fd2fea2030d8c86e30d3efaaa732c77bcb4f473d | 7461b9177c7fe3acb93d79cf534748f561c2f51c | refs/heads/master | 2021-01-17T06:29:10.912308 | 2014-04-24T13:47:32 | 2014-04-24T13:47:32 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,539 | java | package team.envie.fashion.enviefashion.logic;
import android.app.Activity;
import android.content.res.Configuration;
import java.util.Locale;
import team.envie.fashion.enviefashion.entity.Constants;
public enum LocaleState {
JAPAN {
@Override
public void changeLocale(Activity activity) {
LocaleState.setUp(Locale.JAPAN, activity);
Constants.changeLocale(activity);
}
},
ENGLISH {
@Override
public void changeLocale(Activity activity) {
LocaleState.setUp(Locale.ENGLISH, activity);
team.envie.fashion.enviefashion.entity.Constants.changeLocale(activity);
}
},
CHINESE {
@Override
public void changeLocale(Activity activity) {
LocaleState.setUp(Locale.CHINA, activity);
team.envie.fashion.enviefashion.entity.Constants.changeLocale(activity);
}
},
ESPANOL {
@Override
public void changeLocale(Activity activity) {
LocaleState.setUp(new Locale("es"), activity);
team.envie.fashion.enviefashion.entity.Constants.changeLocale(activity);
}
},
FRANCE {
@Override
public void changeLocale(Activity activity) {
LocaleState.setUp(Locale.FRANCE, activity);
team.envie.fashion.enviefashion.entity.Constants.changeLocale(activity);
}
},
DEUTSCH {
@Override
public void changeLocale(Activity activity) {
LocaleState.setUp(Locale.GERMANY, activity);
team.envie.fashion.enviefashion.entity.Constants.changeLocale(activity);
}
};
/* ***************************************************************************************
abstract Method
*************************************************************************************** */
public abstract void changeLocale(Activity activity);
/* ***************************************************************************************
private method
*************************************************************************************** */
private static void setUp(Locale locale, Activity activity) {
Locale.setDefault(locale);
Configuration configuration = new Configuration();
configuration.locale = locale;
activity.getApplicationContext().getResources().updateConfiguration(configuration, null);
}
}
| [
"unus6812"
] | unus6812 |
e7d2826118a03f062ee6d2a28d4131606916f961 | be6b0d81bc87acd4ce3e61f3b0f7ddfa749aecfa | /src/main/java/common/RoutingKeyAggregatorSerializer.java | 3ce2f4d0efdbf6d991344302085eadb4b26413e6 | [] | no_license | LarsKrogJensen/hazelcast-test | a74f3f97f5766dde67dafe5da5bae78120019a52 | e4b64aa3df75f4de3f04160f25e26511969f6a86 | refs/heads/master | 2020-04-11T04:58:02.425205 | 2019-02-15T18:30:25 | 2019-02-15T18:30:25 | 161,533,536 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 565 | java | package common;
import com.hazelcast.nio.ObjectDataInput;
import com.hazelcast.nio.ObjectDataOutput;
public class RoutingKeyAggregatorSerializer extends SerializerBase<RoutingKeyAggregator> {
public RoutingKeyAggregatorSerializer() {
super(124, RoutingKeyAggregator.class);
}
@Override
public void write(ObjectDataOutput dataOutput, RoutingKeyAggregator object) {
super.write(dataOutput, object);
}
@Override
public RoutingKeyAggregator read(ObjectDataInput dataInput) {
return super.read(dataInput);
}
} | [
"lars.krogjensen@gmail.com"
] | lars.krogjensen@gmail.com |
456240c75121f07e143b86a5ca08b4d33ff131d9 | 425ac2b3d2ba036202c1dc72c561d3a904df33ad | /support/cas-server-support-pac4j-webflow/src/main/java/org/apereo/cas/web/flow/DefaultDelegatedClientIdentityProviderConfigurationProducer.java | b26b58527d0541cb1b7d7bb36db59112af48f956 | [
"LicenseRef-scancode-free-unknown",
"Apache-2.0",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | fogbeam/cas_mirror | fee69b4b1a7bf5cac87da75b209edc3cc3c1d5d6 | b7daea814f1238e95a6674663b2553555a5b2eed | refs/heads/master | 2023-01-07T08:34:26.200966 | 2021-08-12T19:14:41 | 2021-08-12T19:14:41 | 41,710,765 | 1 | 2 | Apache-2.0 | 2022-12-27T15:39:03 | 2015-09-01T01:53:24 | Java | UTF-8 | Java | false | false | 8,098 | java | package org.apereo.cas.web.flow;
import org.apereo.cas.authentication.AuthenticationServiceSelectionPlan;
import org.apereo.cas.authentication.principal.Service;
import org.apereo.cas.authentication.principal.WebApplicationService;
import org.apereo.cas.configuration.CasConfigurationProperties;
import org.apereo.cas.pac4j.client.DelegatedClientAuthenticationRequestCustomizer;
import org.apereo.cas.services.ServicesManager;
import org.apereo.cas.util.LoggingUtils;
import org.apereo.cas.validation.DelegatedAuthenticationAccessStrategyHelper;
import org.apereo.cas.web.DelegatedClientIdentityProviderConfiguration;
import org.apereo.cas.web.DelegatedClientIdentityProviderConfigurationFactory;
import org.apereo.cas.web.cookie.CasCookieBuilder;
import org.apereo.cas.web.support.WebUtils;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import lombok.val;
import org.apache.commons.lang3.StringUtils;
import org.pac4j.core.client.Client;
import org.pac4j.core.client.Clients;
import org.pac4j.core.client.IndirectClient;
import org.pac4j.core.context.JEEContext;
import org.springframework.http.HttpStatus;
import org.springframework.webflow.execution.RequestContext;
import javax.servlet.http.HttpServletRequest;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Optional;
import java.util.Set;
/**
* This is {@link DefaultDelegatedClientIdentityProviderConfigurationProducer}.
*
* @author Misagh Moayyed
* @since 6.2.0
*/
@Slf4j
@RequiredArgsConstructor
public class DefaultDelegatedClientIdentityProviderConfigurationProducer implements DelegatedClientIdentityProviderConfigurationProducer {
/**
* The Services manager.
*/
private final ServicesManager servicesManager;
private final AuthenticationServiceSelectionPlan authenticationRequestServiceSelectionStrategies;
private final Clients clients;
private final DelegatedAuthenticationAccessStrategyHelper delegatedAuthenticationAccessStrategyHelper;
private final CasConfigurationProperties casProperties;
private final CasCookieBuilder delegatedAuthenticationCookieBuilder;
private final List<DelegatedClientAuthenticationRequestCustomizer> delegatedClientAuthenticationRequestCustomizers;
@Override
public Set<DelegatedClientIdentityProviderConfiguration> produce(final RequestContext context) {
val currentService = WebUtils.getService(context);
val service = authenticationRequestServiceSelectionStrategies.resolveService(currentService, WebApplicationService.class);
val request = WebUtils.getHttpServletRequestFromExternalWebflowContext(context);
val response = WebUtils.getHttpServletResponseFromExternalWebflowContext(context);
val webContext = new JEEContext(request, response);
LOGGER.debug("Initialized context with request parameters [{}]", webContext.getRequestParameters());
val allClients = this.clients.findAllClients();
val providers = new LinkedHashSet<DelegatedClientIdentityProviderConfiguration>(allClients.size());
allClients
.stream()
.filter(client -> client instanceof IndirectClient && isDelegatedClientAuthorizedForService(client, service, request))
.map(IndirectClient.class::cast)
.forEach(client -> {
try {
val provider = produce(context, client);
provider.ifPresent(p -> {
providers.add(p);
determineAutoRedirectPolicyForProvider(context, service, p);
});
} catch (final Exception e) {
LOGGER.error("Cannot process client [{}]", client);
LoggingUtils.error(LOGGER, e);
}
});
if (!providers.isEmpty()) {
WebUtils.putDelegatedAuthenticationProviderConfigurations(context, providers);
} else if (response.getStatus() != HttpStatus.UNAUTHORIZED.value()) {
LOGGER.warn("No delegated authentication providers could be determined based on the provided configuration. "
+ "Either no clients are configured, or the current access strategy rules prohibit CAS from using authentication providers");
}
return providers;
}
@Override
public Optional<DelegatedClientIdentityProviderConfiguration> produce(final RequestContext requestContext,
final IndirectClient client) {
val request = WebUtils.getHttpServletRequestFromExternalWebflowContext(requestContext);
val response = WebUtils.getHttpServletResponseFromExternalWebflowContext(requestContext);
val webContext = new JEEContext(request, response);
val currentService = WebUtils.getService(requestContext);
LOGGER.debug("Initializing client [{}] with request parameters [{}] and service [{}]",
client, requestContext.getRequestParameters(), currentService);
client.init();
if (delegatedClientAuthenticationRequestCustomizers.isEmpty()
|| delegatedClientAuthenticationRequestCustomizers.stream().anyMatch(c -> c.isAuthorized(webContext, client, currentService))) {
return DelegatedClientIdentityProviderConfigurationFactory.builder()
.client(client)
.webContext(webContext)
.service(currentService)
.casProperties(casProperties)
.build()
.resolve();
}
return Optional.empty();
}
/**
* Determine auto redirect policy for provider.
*
* @param context the context
* @param service the service
* @param provider the provider
*/
protected void determineAutoRedirectPolicyForProvider(final RequestContext context,
final WebApplicationService service,
final DelegatedClientIdentityProviderConfiguration provider) {
if (service != null) {
val registeredService = servicesManager.findServiceBy(service);
val delegatedPolicy = registeredService.getAccessStrategy().getDelegatedAuthenticationPolicy();
if (delegatedPolicy.isExclusive() && delegatedPolicy.getAllowedProviders().size() == 1
&& provider.getName().equalsIgnoreCase(delegatedPolicy.getAllowedProviders().iterator().next())) {
LOGGER.trace("Registered service [{}] is exclusively allowed to use provider [{}]", registeredService, provider);
provider.setAutoRedirect(true);
WebUtils.putDelegatedAuthenticationProviderPrimary(context, provider);
}
}
if (WebUtils.getDelegatedAuthenticationProviderPrimary(context) == null && provider.isAutoRedirect()) {
LOGGER.trace("Provider [{}] is configured to auto-redirect", provider);
WebUtils.putDelegatedAuthenticationProviderPrimary(context, provider);
}
val cookieProps = casProperties.getAuthn().getPac4j().getCookie();
if (cookieProps.isEnabled()) {
val request = WebUtils.getHttpServletRequestFromExternalWebflowContext(context);
val cookieValue = delegatedAuthenticationCookieBuilder.retrieveCookieValue(request);
if (StringUtils.equalsIgnoreCase(cookieValue, provider.getName())) {
LOGGER.trace("Provider [{}] is chosen via cookie value preference as primary", provider);
provider.setAutoRedirect(true);
WebUtils.putDelegatedAuthenticationProviderPrimary(context, provider);
}
}
}
private boolean isDelegatedClientAuthorizedForService(final Client client, final Service service,
final HttpServletRequest request) {
return delegatedAuthenticationAccessStrategyHelper.isDelegatedClientAuthorizedForService(client, service, request);
}
}
| [
"mm1844@gmail.com"
] | mm1844@gmail.com |
c7c32a2db163d341c9ba3ae126b06e77aea8ef45 | de57949f86e8162775f533bf30f1aaf03e9755fa | /src/main/java/manas/springboot/sampe/myapp/repository/EventsRepository.java | 3ab0a857387ef75551afa31a3b9470250fc60294 | [] | no_license | manaspratimdas/SampleSpringBoot | b2b58ac3c7c8ff955763788283f2ec0065cf0e53 | 2648db23455df414e81c0deaed9ee079d1bd68d2 | refs/heads/master | 2020-06-10T16:50:19.319612 | 2017-08-19T11:07:49 | 2017-08-19T11:07:49 | 75,930,826 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 352 | java | package manas.springboot.sampe.myapp.repository;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import manas.springboot.sampe.myapp.beans.Event;
@Repository
public interface EventsRepository extends JpaRepository<Event, Long> {
Event findByName(String name);
}
| [
"MNGR@IE67LT530DG32"
] | MNGR@IE67LT530DG32 |
3675ac76b993a41afba14c306625cb0361d81540 | fdc2527fa33576a85d15aaf76e15343107213b1e | /app/src/test/java/huskiehack2k16/com/huskiehackproject/ExampleUnitTest.java | 3319a14ba8e8b03f3f586cc20dabb7e66ecf379b | [] | no_license | ciardll2/HuskieHackProject | 29c62c62261a6a1ebaa6ad423528302239a6810d | 7bc31c33b0c16bf91f44b7b3dc92cadbd5b8b2f8 | refs/heads/master | 2021-01-11T10:38:55.161779 | 2016-11-05T20:35:38 | 2016-11-05T20:35:38 | 72,952,967 | 0 | 0 | null | 2016-11-05T20:59:48 | 2016-11-05T20:59:48 | null | UTF-8 | Java | false | false | 414 | java | package huskiehack2k16.com.huskiehackproject;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
} | [
"rdaruwala@gmail.com"
] | rdaruwala@gmail.com |
2833d3cafd8d2d6f8f4116aca7d336682dfb5f8f | dfffbcfcf0558e2411ca5e9e589cf3185eef5431 | /jolie-xtext/playground/joliepse/jolie.xtext/src-gen/jolie/xtext/jolie/TypeDefinition.java | 3414b0bb6ad3082c84e19a81c6c89c2c01de047f | [] | no_license | jolie/experimental | 79778e8dbf6f3f6681b229de1dce328ed19086ad | 4d1234136e92a53f9955d0944f23acedcf0ea247 | refs/heads/master | 2021-01-10T01:00:55.791681 | 2014-05-21T07:08:21 | 2014-05-21T07:08:21 | 32,292,184 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,130 | java | /**
* <copyright>
* </copyright>
*
*/
package jolie.xtext.jolie;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EObject;
/**
* <!-- begin-user-doc -->
* A representation of the model object '<em><b>Type Definition</b></em>'.
* <!-- end-user-doc -->
*
* <p>
* The following features are supported:
* <ul>
* <li>{@link jolie.xtext.jolie.TypeDefinition#getType <em>Type</em>}</li>
* </ul>
* </p>
*
* @see jolie.xtext.jolie.JoliePackage#getTypeDefinition()
* @model
* @generated
*/
public interface TypeDefinition extends EObject
{
/**
* Returns the value of the '<em><b>Type</b></em>' reference list.
* The list contents are of type {@link jolie.xtext.jolie.Type}.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Type</em>' reference list isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Type</em>' reference list.
* @see jolie.xtext.jolie.JoliePackage#getTypeDefinition_Type()
* @model
* @generated
*/
EList<Type> getType();
} // TypeDefinition
| [
"castronu@gmail.com"
] | castronu@gmail.com |
fd6dbaa04eda7a32c3711699903ba7e891557e36 | dfe5caf190661c003619bfe7a7944c527c917ee4 | /src/main/java/com/vmware/vim25/VirtualAppSummary.java | 1767a52f6fe524a68809af45ac5e1559baf3154f | [
"BSD-3-Clause"
] | permissive | timtasse/vijava | c9787f9f9b3116a01f70a89d6ea29cc4f6dc3cd0 | 5d75bc0bd212534d44f78e5a287abf3f909a2e8e | refs/heads/master | 2023-06-01T08:20:39.601418 | 2022-10-31T12:43:24 | 2022-10-31T12:43:24 | 150,118,529 | 4 | 1 | BSD-3-Clause | 2023-05-01T21:19:53 | 2018-09-24T14:46:15 | Java | UTF-8 | Java | false | false | 2,847 | java | /*================================================================================
Copyright (c) 2013 Steve Jin. All Rights Reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of VMware, Inc. nor the names of its contributors may be used
to endorse or promote products derived from this software without specific prior
written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL VMWARE, INC. OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
================================================================================*/
package com.vmware.vim25;
/**
* @author Steve Jin (http://www.doublecloud.org)
* @version 5.1
*/
@SuppressWarnings("all")
public class VirtualAppSummary extends ResourcePoolSummary {
public VAppProductInfo product;
public VirtualAppVAppState vAppState;
public Boolean suspended;
public Boolean installBootRequired;
public String instanceUuid;
public VAppProductInfo getProduct() {
return this.product;
}
public VirtualAppVAppState getVAppState() {
return this.vAppState;
}
public Boolean getSuspended() {
return this.suspended;
}
public Boolean getInstallBootRequired() {
return this.installBootRequired;
}
public String getInstanceUuid() {
return this.instanceUuid;
}
public void setProduct(VAppProductInfo product) {
this.product=product;
}
public void setVAppState(VirtualAppVAppState vAppState) {
this.vAppState=vAppState;
}
public void setSuspended(Boolean suspended) {
this.suspended=suspended;
}
public void setInstallBootRequired(Boolean installBootRequired) {
this.installBootRequired=installBootRequired;
}
public void setInstanceUuid(String instanceUuid) {
this.instanceUuid=instanceUuid;
}
} | [
"stefan.dilk@freenet.ag"
] | stefan.dilk@freenet.ag |
3cc2a6568290db3e138ff70c29f1d71487f2b54b | c5cfd07d5b8fa2ae11383be133e06f2d28b63816 | /src/main/java/eu/tng/policymanager/Messaging/DeployedNSListener.java | 9c13ac5342c764d1e731b1ca0abd48c202c690a9 | [
"Apache-2.0"
] | permissive | felipevicens/tng-policy-mngr | 2b4c699527a7987b13c0ab7225ebbbeb3a34e592 | 23c5c92a481f87a61e8fda8179df953faad2e4ae | refs/heads/master | 2020-03-25T17:45:40.330567 | 2018-08-08T11:57:12 | 2018-08-08T11:57:12 | 143,994,349 | 0 | 0 | null | 2018-08-08T09:53:07 | 2018-08-08T09:53:07 | null | UTF-8 | Java | false | false | 15,701 | java | /*
* Copyright (c) 2015 SONATA-NFV, 2017 5GTANGO [, ANY ADDITIONAL AFFILIATION]
* ALL RIGHTS RESERVED.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Neither the name of the SONATA-NFV, 5GTANGO [, ANY ADDITIONAL AFFILIATION]
* nor the names of its contributors may be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* This work has been performed in the framework of the SONATA project,
* funded by the European Commission under Grant number 671517 through
* the Horizon 2020 and 5G-PPP programmes. The authors would like to
* acknowledge the contributions of their colleagues of the SONATA
* partner consortium (www.sonata-nfv.eu).
*
* This work has been performed in the framework of the 5GTANGO project,
* funded by the European Commission under Grant number 761493 through
* the Horizon 2020 and 5G-PPP programmes. The authors would like to
* acknowledge the contributions of their colleagues of the 5GTANGO
* partner consortium (www.5gtango.eu).
*/
package eu.tng.policymanager.Messaging;
import eu.tng.policymanager.RulesEngineApp;
import eu.tng.policymanager.RulesEngineService;
import eu.tng.policymanager.repository.MonitoringRule;
import eu.tng.policymanager.repository.PolicyYamlFile;
import eu.tng.policymanager.repository.dao.RuntimePolicyRecordRepository;
import eu.tng.policymanager.repository.dao.RuntimePolicyRepository;
import eu.tng.policymanager.repository.domain.RuntimePolicy;
import eu.tng.policymanager.repository.domain.RuntimePolicyRecord;
import eu.tng.policymanager.rules.generation.Util;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.List;
import java.util.Optional;
import java.util.logging.Level;
import org.springframework.stereotype.Component;
import java.util.logging.Logger;
import okhttp3.MediaType;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;
import org.json.JSONArray;
import org.json.JSONObject;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
import org.springframework.web.client.HttpClientErrorException;
import org.springframework.web.client.RestTemplate;
@Component
public class DeployedNSListener {
private static final Logger logger = Logger.getLogger(DeployedNSListener.class.getName());
@Autowired
RulesEngineService rulesEngineService;
@Autowired
RuntimePolicyRepository runtimePolicyRepository;
@Autowired
RuntimePolicyRecordRepository runtimePolicyRecordRepository;
@Value("${monitoring.manager}")
private String monitoring_manager;
@Value("${tng.cat.policies}")
private String policies_url;
//private static final String current_dir = System.getProperty("user.dir");
@RabbitListener(queues = RulesEngineApp.NS_INSTATIATION_QUEUE)
public void deployedNSMessageReceived(byte[] message) {
logger.log(Level.INFO, "A new message has been received");
String deployedNSasYaml = new String(message, StandardCharsets.UTF_8);
//String deployedNSasYaml = message;
try {
enforceRuntimePolicy(deployedNSasYaml);
} catch (Exception e) {
logger.log(Level.WARNING, "Exception message {0}", e.getMessage());
}
}
private String dopostcall(String url, JSONObject prometheous_rules) throws IOException {
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, prometheous_rules.toString());
Request request = new Request.Builder()
.url(url)
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
return response.body().string() + " with message " + response.message();
}
private void enforceRuntimePolicy(String deployedNSasYaml) {
String jsonobject = Util.convertYamlToJson(deployedNSasYaml);
JSONObject newDeployedGraph = new JSONObject(jsonobject);
if (newDeployedGraph.has("status")) {
String status = newDeployedGraph.get("status").toString();
if (status.equalsIgnoreCase("READY")) {
if (newDeployedGraph.has("nsr")) {
String ns_id = newDeployedGraph.getJSONObject("nsr").getString("descriptor_reference");
logger.log(Level.INFO, "status {0} for nsr_id {1}", new Object[]{status, ns_id});
logger.log(Level.INFO, "A new service is Deployed: {0}", deployedNSasYaml);
String nsr_id = newDeployedGraph.getJSONObject("nsr").getString("id");
Optional<RuntimePolicy> runtimepolicy = null;
if (newDeployedGraph.has("sla_id")) {
Object sla_id = newDeployedGraph.get("sla_id");
if (!sla_id.equals(null)) {
logger.log(Level.INFO, "Check for policy binded with SLA {0} and NS {1}", new Object[]{sla_id.toString(), ns_id});
runtimepolicy = runtimePolicyRepository.findBySlaidAndNsid(sla_id.toString(), ns_id);
} else {
logger.log(Level.INFO, "Check for default policy for ns {0}", ns_id);
runtimepolicy = runtimePolicyRepository.findByNsidAndDefaultPolicyTrue(ns_id);
}
} else {
logger.log(Level.INFO, "Check for default policy for ns {0}", ns_id);
runtimepolicy = runtimePolicyRepository.findByNsidAndDefaultPolicyTrue(ns_id);
}
if (runtimepolicy != null && runtimepolicy.isPresent()) {
String runtimepolicy_id = runtimepolicy.get().getPolicyid();
//1. Fech yml file from catalogues
RestTemplate restTemplate = new RestTemplate();
HttpHeaders headers = new HttpHeaders();
headers.setContentType(org.springframework.http.MediaType.APPLICATION_JSON);
HttpEntity<String> entity = new HttpEntity<>(headers);
ResponseEntity<String> response;
try {
response = restTemplate.exchange(policies_url + "/" + runtimepolicy_id, HttpMethod.GET, entity, String.class);
} catch (HttpClientErrorException e) {
logger.warning("{\"error\": \"The PLD ID " + runtimepolicy_id + " does not exist at catalogues. Message : "
+ e.getMessage() + "\"}");
return;
}
//File policydescriptor = new File(current_dir + "/" + POLICY_DESCRIPTORS_PACKAGE + "/" + runtimepolicy.get().getPolicyid() + ".yml");
//logger.info("get file from - " + current_dir + "/" + POLICY_DESCRIPTORS_PACKAGE + "/" + runtimepolicy.get().getPolicyid() + ".yml");
JSONObject policydescriptorRaw = new JSONObject(response.getBody());
logger.info("response" + policydescriptorRaw.toString());
JSONObject pld = policydescriptorRaw.getJSONObject("pld");
String policyAsYaml = Util.jsonToYaml(pld);
logger.log(Level.INFO, "Activate policy for NSR {0}", nsr_id);
boolean is_enforcement_succesfull = rulesEngineService.addNewKnowledgebase("s" + nsr_id.replaceAll("-", ""), runtimepolicy.get().getPolicyid(), policyAsYaml);
if (is_enforcement_succesfull) {
//submit monitoring-rules to son-broker
//fecth monitoring rules from policy
// update dbpolicy mongo repo
RuntimePolicyRecord policyrecord = new RuntimePolicyRecord();
policyrecord.setNsrid(nsr_id);
policyrecord.setPolicyid(runtimepolicy_id);
runtimePolicyRecordRepository.save(policyrecord);
PolicyYamlFile policyyml = PolicyYamlFile.readYaml(Util.jsonToYaml(pld));
//2. create hashmap with monitoring rules
List<MonitoringRule> monitoringRules = policyyml.getMonitoring_rules();
//3. construct prometheus rules
JSONObject prometheous_rules = new JSONObject();
prometheous_rules.put("plc_cnt", nsr_id);
JSONArray prometheous_vnfs = new JSONArray();
//parse newDeployedGraph
JSONArray vnfrs = newDeployedGraph.getJSONArray("vnfrs");
for (int i = 0; i < vnfrs.length(); i++) {
JSONObject prometheus_vnf = new JSONObject();
JSONObject vnfr_object = vnfrs.getJSONObject(i);
logger.info("vnfr_object--> " + vnfr_object);
String vnfr_id = vnfr_object.getString("id"); //or descriptor_reference to ask
prometheus_vnf.put("nvfid", vnfr_id);
JSONArray prometheus_vdus = new JSONArray();
JSONArray virtual_deployment_units = vnfr_object.getJSONArray("virtual_deployment_units");
for (int j = 0; j < virtual_deployment_units.length(); j++) {
JSONObject virtual_deployment_unit = virtual_deployment_units.getJSONObject(j);
logger.info("virtual_deployment_unit--> " + virtual_deployment_unit);
String vdu_reference = virtual_deployment_unit.getString("vdu_reference");
JSONArray vnfc_instances = virtual_deployment_unit.getJSONArray("vnfc_instance");
//MonitoringRule monitoringRule = (MonitoringRule) monitoring_rules_hashmap.get(vdu_reference);
for (int k = 0; k < vnfc_instances.length(); k++) {
JSONObject vnfc_instance = vnfc_instances.getJSONObject(k);
logger.info("vnfc_instance--> " + vnfc_instance);
JSONObject prometheus_vdu = new JSONObject();
String vc_id = vnfc_instance.getString("vc_id");
prometheus_vdu.put("vdu_id", vc_id);
//add prometheus rules
JSONArray prometheus_rules = new JSONArray();
for (MonitoringRule monitoringRule : monitoringRules) {
logger.info("MonitoringRule--> " + monitoringRule.toString());
//Formatted like this : <vnf_name>:<vdu_id>-<record_id>
String policy_vdu_reference = monitoringRule.getName().split(":")[2]
+ ":" + monitoringRule.getName().split(":")[4]
+ "-" + vnfr_id;
logger.info("policy_vdu_reference--> " + policy_vdu_reference);
logger.info("vdu_reference--> " + vdu_reference);
if (vdu_reference.equals(policy_vdu_reference)) {
JSONObject prometheus_rule = new JSONObject();
prometheus_rule.put("name", monitoringRule.getName().replace(":", "_").replace("-", "_"));
logger.info("rule name-->" + monitoringRule.getName().replace(":", "_").replace("-", "_"));
prometheus_rule.put("duration", monitoringRule.getDuration() + monitoringRule.getDuration_unit());
prometheus_rule.put("description", monitoringRule.getDescription());
prometheus_rule.put("summary", "");
prometheus_rule.put("notification_type", new JSONObject("{\"id\": 2,\"type\":\"rabbitmq\"}"));
logger.info("monitoringRule condition " + monitoringRule.getCondition());
prometheus_rule.put("condition", monitoringRule.getCondition() + "{resource_id=\"" + vc_id + "\"}" + monitoringRule.getThreshold());
prometheus_rules.put(prometheus_rule);
}
}
prometheus_vdu.put("rules", prometheus_rules);
prometheus_vdus.put(prometheus_vdu);
}
}
prometheus_vnf.put("vdus", prometheus_vdus);
prometheous_vnfs.put(prometheus_vnf);
}
prometheous_rules.put("vnfs", prometheous_vnfs);
logger.info("prometheous_rules " + prometheous_rules);
// Create PLC rules to son-monitor
String monitoring_url = "http://" + monitoring_manager + "/api/v1/policymng/rules/service/" + nsr_id + "/configuration";
logger.info("monitoring_manager " + monitoring_url);
try {
String monitoring_response = dopostcall(monitoring_url, prometheous_rules);
logger.info("monitoring_response " + monitoring_response);
} catch (IOException ex) {
Logger.getLogger(DeployedNSListener.class.getName()).log(Level.SEVERE, null, ex);
}
}
} else {
logger.log(Level.INFO, "NSR " + nsr_id + " is deployed withoun any policy");
}
}
}
}
}
}
| [
"fwtopoulou@gmail.com"
] | fwtopoulou@gmail.com |
85bdc8f6cb6a77236da3c14474138e416ae861e2 | e1cf82259a7e02d1aeab448fc7ee9c76dd38514f | /templates/spring-boot-kt/templates/${projectName}/${adminModuleName}/${javaSrc}/${basePackage_dir}/models/condition/order/${className}OrderCondition.java | a3da06e4a3f4d6912e12125b5fc5421ae5394db0 | [] | no_license | rarexixi/code-generator | 182b8b89311d124679529e7e14b2bf02f3cfeda0 | bfb4058885f3ef383c6adb41dc7a1acc03c085dc | refs/heads/master | 2023-04-30T19:26:48.794286 | 2023-03-08T06:41:37 | 2023-03-08T06:41:37 | 112,711,480 | 0 | 1 | null | 2023-03-08T06:41:38 | 2017-12-01T07:55:45 | Java | UTF-8 | Java | false | false | 969 | java | <#include "/include/table/properties.ftl">
package ${basePackage}.models.condition.order;
import ${basePackage}.common.model.OrderCondition;
<#include "/include/java_copyright.ftl">
public class ${className}OrderCondition extends OrderCondition {
<#list table.columns as column>
<#include "/include/column/properties.ftl">
<#if (column.ignoreSearch || column.dataType?ends_with("text"))>
<#else>
/**
* 以${columnComment}排序 (null不排序,true升序,false降序)
*/
public Boolean ${fieldName}Sort;
</#if>
</#list>
<#list table.columns as column>
<#include "/include/column/properties.ftl">
<#if (column.ignoreSearch || column.dataType?ends_with("text"))>
<#else>
public void set${propertyName}Sort(Boolean ${fieldName}Sort) {
this.${fieldName}Sort = ${fieldName}Sort;
}
public Boolean get${propertyName}Sort() {
return ${fieldName}Sort;
}
</#if>
</#list>
}
| [
"xishihao@chehejia.com"
] | xishihao@chehejia.com |
c09c8defef1948e784fe158fc377d6e776b6c7e2 | 5b1ae9187cb6c3eda44d049d786df4f1cb7111fc | /src/main/java/com/itmuch/gateway/TimeBetweenRoutePredicateFactory.java | c322b4b6b6d06d5911a2481d51bf9130cdf91a10 | [] | no_license | zhanyouu/gateway | 0262b9fee2ca71764bd05ce3e37b2f6b848cbb0d | da6f08746d3c77c8078b11381f328fd057283931 | refs/heads/main | 2023-08-05T22:34:42.609347 | 2021-09-27T14:59:07 | 2021-09-27T14:59:07 | 409,630,460 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,275 | java | package com.itmuch.gateway;
import org.springframework.cloud.gateway.handler.predicate.AbstractRoutePredicateFactory;
import org.springframework.stereotype.Component;
import org.springframework.web.server.ServerWebExchange;
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;
import java.time.format.FormatStyle;
import java.util.Arrays;
import java.util.List;
import java.util.function.Predicate;
@Component
public class TimeBetweenRoutePredicateFactory extends AbstractRoutePredicateFactory<TimeBetweenConfig> {
public TimeBetweenRoutePredicateFactory() {
super(TimeBetweenConfig.class);
}
@Override
public Predicate<ServerWebExchange> apply(TimeBetweenConfig config) {
LocalTime start = config.getStart();
LocalTime end = config.getEnd();
return exchange -> {
LocalTime now = LocalTime.now();
return now.isAfter(start)&&now.isBefore(end);
};
}
@Override
public List<String> shortcutFieldOrder() {
return Arrays.asList("start","end");
}
public static void main(String[] args) {
DateTimeFormatter formatter = DateTimeFormatter.ofLocalizedTime(FormatStyle.SHORT);
System.out.println(formatter.format(LocalTime.now()));
}
}
| [
"751642772@qq.com"
] | 751642772@qq.com |
ce4b296b99c83e18dab50f91c0abdd1ab8079188 | 7af6ecb1ecdc4d1f1fc639a6b191a210cc0a3482 | /hhzmy/src/main/java/com/hhzmy/view/My_shouye_grid_view1.java | dec4f13825314e7b0b150492d8a554e534090879 | [] | no_license | USMengXiangyang/ShiXunYi | 8a3f9e89ae86b446d6472347e884a87a546dc818 | 7157d4c6165329438601db4395ea9b38b9fec976 | refs/heads/master | 2020-06-16T16:35:24.808931 | 2016-12-29T13:51:35 | 2016-12-29T13:51:35 | 75,082,999 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 801 | java | package com.hhzmy.view;
import android.content.Context;
import android.util.AttributeSet;
import android.widget.GridView;
/**
* Created by asus on 2016/11/15.
*/
public class My_shouye_grid_view1 extends GridView {
public My_shouye_grid_view1(Context context) {
super(context);
}
public My_shouye_grid_view1(Context context, AttributeSet attrs) {
super(context, attrs);
}
public My_shouye_grid_view1(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
int expandSpce = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE>>2,MeasureSpec.AT_MOST);
super.onMeasure(widthMeasureSpec, expandSpce);
}
}
| [
"1171134249@qq.com"
] | 1171134249@qq.com |
5609dc1e52d1841ca5dbf203349fc19bbbb829bc | f766baf255197dd4c1561ae6858a67ad23dcda68 | /app/src/main/java/com/tencent/mm/plugin/appbrand/jsapi/auth/b.java | 9921d797d4a09e4a431acea7726cd7d8531b0796 | [] | no_license | jianghan200/wxsrc6.6.7 | d83f3fbbb77235c7f2c8bc945fa3f09d9bac3849 | eb6c56587cfca596f8c7095b0854cbbc78254178 | refs/heads/master | 2020-03-19T23:40:49.532494 | 2018-06-12T06:00:50 | 2018-06-12T06:00:50 | 137,015,278 | 4 | 2 | null | null | null | null | UTF-8 | Java | false | false | 353 | java | package com.tencent.mm.plugin.appbrand.jsapi.auth;
public abstract interface b
{
public abstract void aia();
}
/* Location: /Users/Han/Desktop/wxall/微信反编译/反编译 6.6.7/dex2jar-2.0/classes2-dex2jar.jar!/com/tencent/mm/plugin/appbrand/jsapi/auth/b.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | [
"526687570@qq.com"
] | 526687570@qq.com |
a948187d96c65ab18a0cceacf5db74ea08066d8a | 8e77c5efdb21bee3f9a9d8374e8941e7cedb31d1 | /src/main/java/net/regnormc/dimenager/dimensions/DimensionRepository.java | 4dce704f5727394ad477c4e4a0501330052b4d89 | [
"BSD-3-Clause"
] | permissive | RegnorMC/dimenager | 34c6b0c99f3e642fcc5084ba7de7b45531cbcefe | 1e738d7ecf3ba6eccf399ad6694a14371d36e03b | refs/heads/main | 2023-04-07T16:49:13.674023 | 2021-04-14T12:40:46 | 2021-04-14T12:40:46 | 350,294,978 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 9,225 | java | package net.regnormc.dimenager.dimensions;
import net.regnormc.dimenager.Dimenager;
import net.regnormc.dimenager.GeneratedAndConfiguredRepository;
import net.regnormc.dimenager.generators.Generator;
import net.regnormc.dimenager.mixin.MinecraftServerAccessor;
import com.google.common.collect.ImmutableList;
import com.google.gson.JsonObject;
import com.google.gson.JsonSyntaxException;
import net.minecraft.resource.ResourceManager;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.WorldGenerationProgressListener;
import net.minecraft.server.command.ServerCommandSource;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.text.LiteralText;
import net.minecraft.text.Texts;
import net.minecraft.util.Identifier;
import net.minecraft.util.JsonHelper;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.ChunkPos;
import net.minecraft.util.registry.Registry;
import net.minecraft.util.registry.RegistryKey;
import net.minecraft.world.World;
import net.minecraft.world.biome.source.BiomeAccess;
import net.minecraft.world.chunk.ChunkStatus;
import net.minecraft.world.dimension.DimensionType;
import net.minecraft.world.gen.GeneratorOptions;
import net.minecraft.world.gen.chunk.ChunkGenerator;
import net.minecraft.world.level.UnmodifiableLevelProperties;
import net.minecraft.world.level.storage.LevelStorage;
import org.jetbrains.annotations.Nullable;
import java.io.IOException;
import java.util.Collection;
import java.util.Map;
public class DimensionRepository extends GeneratedAndConfiguredRepository<GeneratedDimension, ServerWorld> {
private final Map<RegistryKey<World>, ServerWorld> serverLevels;
public DimensionRepository(ResourceManager resourceManager, LevelStorage.Session levelStorageAccess, Map<RegistryKey<World>, ServerWorld> serverLevels) {
super(resourceManager, levelStorageAccess, "dimension");
this.serverLevels = serverLevels;
}
@Override
protected GeneratedDimension fromJson(Identifier identifier, JsonObject json) throws JsonSyntaxException {
boolean enabled = JsonHelper.getBoolean(json, "enabled", true);
Identifier dimensionTypeIdentifier = new Identifier(JsonHelper.getString(json, "dimension_type"));
Identifier generatorIdentifier = new Identifier(JsonHelper.getString(json, "generator"));
Generator generator = Dimenager.generatorRepository.get(generatorIdentifier);
if (generator == null) throw new JsonSyntaxException("Unknown generator '" + generatorIdentifier + "'");
return new GeneratedDimension(identifier, generatedDirectory, enabled, Dimenager.dimensionTypeRepository.get(dimensionTypeIdentifier), dimensionTypeIdentifier, generator);
}
@Override
protected void addConfiguredItems() {
for (Map.Entry<RegistryKey<World>, ServerWorld> level : serverLevels.entrySet()) {
items.put(level.getKey().getValue(), level.getValue());
}
}
public void createLevels(WorldGenerationProgressListener chunkProgressListener, MinecraftServer server) {
for (GeneratedDimension generatedDimension : generatedItems.values()) {
if (generatedDimension.getType() == null) {
Dimenager.LOGGER.error("Could not load dimension '" + generatedDimension.getIdentifier() + "': dimension type is not loaded");
} else if (generatedDimension.isEnabled()) {
createLevel(generatedDimension, server, chunkProgressListener);
}
}
}
private void createLevel(GeneratedDimension generatedDimension, MinecraftServer server, WorldGenerationProgressListener chunkProgressListener) {
RegistryKey<World> resourceKey = RegistryKey.of(Registry.DIMENSION, generatedDimension.getIdentifier());
MinecraftServerAccessor serverAccessor = (MinecraftServerAccessor) server;
UnmodifiableLevelProperties derivedLevelData = new UnmodifiableLevelProperties(server.getSaveProperties(), server.getSaveProperties().getMainWorldProperties());
GeneratorOptions worldGenSettings = server.getSaveProperties().getGeneratorOptions();
ChunkGenerator chunkGenerator = generatedDimension.getGenerator().getChunkGenerator();
ServerWorld serverLevel = new ServerWorld(server, serverAccessor.getWorkerExecutor(),
serverAccessor.getSession(), derivedLevelData, resourceKey, generatedDimension.getType(),
chunkProgressListener, chunkGenerator, worldGenSettings.isDebugWorld(),
BiomeAccess.hashSeed(worldGenSettings.getSeed()), ImmutableList.of(), false);
items.replace(generatedDimension.getIdentifier(), serverLevel);
serverLevels.put(resourceKey, serverLevel);
}
private void createLevel(GeneratedDimension dimension, ServerCommandSource source) {
createLevel(dimension, source.getMinecraftServer(), new WorldGenerationProgressListener() {
@Override
public void start(ChunkPos spawnPos) {
}
@Override
public void setChunkStatus(ChunkPos pos, @Nullable ChunkStatus status) {
}
@Override
public void stop() {
}
});
}
public int createDimension(ServerCommandSource source, Identifier identifier, DimensionType dimensionType, Identifier dimensionTypeIdentifier, Generator generator) {
if (items.containsKey(identifier)) {
source.sendError(new LiteralText("A dimension with id '" + identifier + "' already exists"));
return 0;
}
GeneratedDimension dimension = new GeneratedDimension(identifier, generatedDirectory, true, dimensionType, dimensionTypeIdentifier, generator);
addGeneratedItem(dimension);
createLevel(dimension, source);
source.sendFeedback(new LiteralText("Created a new dimension with id '" + identifier + "'"), true);
return 1;
}
public int deleteDimension(ServerCommandSource source, GeneratedDimension dimension) {
items.remove(dimension.getIdentifier());
generatedItems.remove(dimension.getIdentifier());
dimension.removeFile();
source.sendFeedback(new LiteralText("Removed the dimension with id '" + dimension.getIdentifier() + "'"), true);
return 1;
}
public int listDimensions(ServerCommandSource source) {
if (items.isEmpty()) {
source.sendFeedback(new LiteralText("There are no dimensions"), false);
} else {
Collection<Identifier> identifiers = items.keySet();
source.sendFeedback(new LiteralText("There are " + items.size() + " dimensions: ").append(Texts.join(identifiers, identifier -> new LiteralText(identifier.toString()))), false);
}
return items.size();
}
public int setEnabled(ServerCommandSource source, GeneratedDimension dimension, boolean value) {
dimension.setEnabled(value);
source.sendFeedback(new LiteralText((value ? "Enabled" : "Disabled") + " dimension '" + dimension.getIdentifier() + "; it will now be loaded on startup"), true);
return 1;
}
public int setType(ServerCommandSource source, GeneratedDimension dimension, DimensionType type, Identifier typeIdentifier) {
dimension.setType(type, typeIdentifier);
source.sendFeedback(new LiteralText("The dimension type of '" + dimension.getIdentifier() + "' dimension was set to '" + typeIdentifier + "'"), true);
return 1;
}
public int setGenerator(ServerCommandSource source, GeneratedDimension dimension, Generator generator) {
dimension.setGenerator(generator);
source.sendFeedback(new LiteralText("The generator of '" + dimension.getIdentifier() + "' dimension was set to '" + generator.getIdentifier() + "'"), true);
return 1;
}
public int load(ServerCommandSource source, GeneratedDimension dimension) {
if (items.get(dimension.getIdentifier()) != null) {
source.sendError(new LiteralText("Dimension " + dimension.getIdentifier() + " is already loaded"));
return 0;
}
source.sendFeedback(new LiteralText("Loading dimension '" + dimension.getIdentifier() + "'..."), true);
createLevel(dimension, source);
return 1;
}
public int unload(ServerCommandSource source, GeneratedDimension dimension) {
if (items.get(dimension.getIdentifier()) == null) {
source.sendError(new LiteralText("Dimension " + dimension.getIdentifier() + " isn't loaded"));
return 0;
}
ServerWorld level = items.get(dimension.getIdentifier());
int playersAmount = level.getPlayers().size();
for (int i = 0; i < playersAmount; i++) {
BlockPos spawnPos = level.getServer().getOverworld().getSpawnPos();
float spawnAngle = level.getServer().getOverworld().getSpawnAngle();
level.getPlayers().get(i).teleport(level.getServer().getOverworld(), spawnPos.getX(), spawnPos.getY(), spawnPos.getZ(), spawnAngle, 0f);
}
if (playersAmount > 0) {
source.sendFeedback(new LiteralText("Teleported " + playersAmount + " to the Overworld's spawn, to allow dimension unloading"), true);
}
Dimenager.LOGGER.info("Saving chunks for level '{}'/{}", level, dimension.getIdentifier());
level.save(null, true, true);
try {
level.close();
} catch (IOException exception) {
source.sendError(new LiteralText("Could not close the dimension " + dimension.getIdentifier() + "! See the server console for more information"));
Dimenager.LOGGER.error("Closing dimension '" + dimension.getIdentifier() + "' failed with an exception", exception);
return 0;
}
serverLevels.remove(level.getRegistryKey());
items.replace(dimension.getIdentifier(), null);
source.sendFeedback(new LiteralText("Unloaded dimension '" + dimension.getIdentifier() + "'"), true);
return 1;
}
}
| [
"beetmacol@gmail.com"
] | beetmacol@gmail.com |
267e7197b49eacf4fcb6aa4fb7060f52488eb47e | 4410e9c660a5246bdc682e7ace0f5e1cebbb0041 | /trunk/src/main/java/com/leweiyou/cache/redis/queue/BaseRedisQueueListener.java | f1dd675fa26132235d9c5f9c0a2177043e49641d | [] | no_license | zhangweican/cs-cache | b3c90c865f0bffbc89fbfd39aeb41e3f6c029fcf | 21904aa43edfb88c2c18c038834da628bff0de39 | refs/heads/master | 2020-12-01T10:55:02.659661 | 2018-10-17T06:25:46 | 2018-10-17T06:25:46 | 66,921,273 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 274 | java | package com.leweiyou.cache.redis.queue;
/**
* 基本队列监听器
* @author Zhangweican
*
*/
public class BaseRedisQueueListener implements RedisQueueListener{
public void onMessage(RedisCallbackObject<?> value){
value.callback();
}
} | [
"515632400@qq.com"
] | 515632400@qq.com |
ed3d28c1bcc9fa84b1a3c3ecee191312da2eee78 | e87f985fdd9177e92966f8b2e85b6e57662e7cf6 | /jOOQ-test/examples/org/jooq/examples/sqlserver/adventureworks/humanresources/tables/records/vJobCandidate.java | b1da4a14009618d39c97fadf52b91573a5d61e75 | [
"BSD-3-Clause",
"Apache-2.0"
] | permissive | ben-manes/jOOQ | 5ef43f8ea8c5c942dc0b2e0669cc927dca6f2ff7 | 9f160d5e869de1a9d66408d90718148f76c5e000 | refs/heads/master | 2023-09-05T03:27:56.109520 | 2013-08-26T09:48:14 | 2013-08-26T10:05:05 | 12,375,424 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 16,916 | java | /**
* This class is generated by jOOQ
*/
package org.jooq.examples.sqlserver.adventureworks.humanresources.tables.records;
/**
* This class is generated by jOOQ.
*/
@java.lang.SuppressWarnings("all")
@javax.persistence.Entity
@javax.persistence.Table(name = "vJobCandidate", schema = "HumanResources")
public class vJobCandidate extends org.jooq.impl.TableRecordImpl<org.jooq.examples.sqlserver.adventureworks.humanresources.tables.records.vJobCandidate> implements org.jooq.Record16<java.lang.Integer, java.lang.Integer, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.sql.Timestamp> {
private static final long serialVersionUID = -2023754967;
/**
* Setter for <code>HumanResources.vJobCandidate.JobCandidateID</code>.
*/
public void setJobCandidateID(java.lang.Integer value) {
setValue(org.jooq.examples.sqlserver.adventureworks.humanresources.tables.vJobCandidate.vJobCandidate.JobCandidateID, value);
}
/**
* Getter for <code>HumanResources.vJobCandidate.JobCandidateID</code>.
*/
@javax.persistence.Column(name = "JobCandidateID", nullable = false, precision = 10)
public java.lang.Integer getJobCandidateID() {
return getValue(org.jooq.examples.sqlserver.adventureworks.humanresources.tables.vJobCandidate.vJobCandidate.JobCandidateID);
}
/**
* Setter for <code>HumanResources.vJobCandidate.EmployeeID</code>.
*/
public void setEmployeeID(java.lang.Integer value) {
setValue(org.jooq.examples.sqlserver.adventureworks.humanresources.tables.vJobCandidate.vJobCandidate.EmployeeID, value);
}
/**
* Getter for <code>HumanResources.vJobCandidate.EmployeeID</code>.
*/
@javax.persistence.Column(name = "EmployeeID", precision = 10)
public java.lang.Integer getEmployeeID() {
return getValue(org.jooq.examples.sqlserver.adventureworks.humanresources.tables.vJobCandidate.vJobCandidate.EmployeeID);
}
/**
* Setter for <code>HumanResources.vJobCandidate.Name.Prefix</code>.
*/
public void setName_Prefix(java.lang.String value) {
setValue(org.jooq.examples.sqlserver.adventureworks.humanresources.tables.vJobCandidate.vJobCandidate.Name_Prefix, value);
}
/**
* Getter for <code>HumanResources.vJobCandidate.Name.Prefix</code>.
*/
@javax.persistence.Column(name = "Name.Prefix", length = 30)
public java.lang.String getName_Prefix() {
return getValue(org.jooq.examples.sqlserver.adventureworks.humanresources.tables.vJobCandidate.vJobCandidate.Name_Prefix);
}
/**
* Setter for <code>HumanResources.vJobCandidate.Name.First</code>.
*/
public void setName_First(java.lang.String value) {
setValue(org.jooq.examples.sqlserver.adventureworks.humanresources.tables.vJobCandidate.vJobCandidate.Name_First, value);
}
/**
* Getter for <code>HumanResources.vJobCandidate.Name.First</code>.
*/
@javax.persistence.Column(name = "Name.First", length = 30)
public java.lang.String getName_First() {
return getValue(org.jooq.examples.sqlserver.adventureworks.humanresources.tables.vJobCandidate.vJobCandidate.Name_First);
}
/**
* Setter for <code>HumanResources.vJobCandidate.Name.Middle</code>.
*/
public void setName_Middle(java.lang.String value) {
setValue(org.jooq.examples.sqlserver.adventureworks.humanresources.tables.vJobCandidate.vJobCandidate.Name_Middle, value);
}
/**
* Getter for <code>HumanResources.vJobCandidate.Name.Middle</code>.
*/
@javax.persistence.Column(name = "Name.Middle", length = 30)
public java.lang.String getName_Middle() {
return getValue(org.jooq.examples.sqlserver.adventureworks.humanresources.tables.vJobCandidate.vJobCandidate.Name_Middle);
}
/**
* Setter for <code>HumanResources.vJobCandidate.Name.Last</code>.
*/
public void setName_Last(java.lang.String value) {
setValue(org.jooq.examples.sqlserver.adventureworks.humanresources.tables.vJobCandidate.vJobCandidate.Name_Last, value);
}
/**
* Getter for <code>HumanResources.vJobCandidate.Name.Last</code>.
*/
@javax.persistence.Column(name = "Name.Last", length = 30)
public java.lang.String getName_Last() {
return getValue(org.jooq.examples.sqlserver.adventureworks.humanresources.tables.vJobCandidate.vJobCandidate.Name_Last);
}
/**
* Setter for <code>HumanResources.vJobCandidate.Name.Suffix</code>.
*/
public void setName_Suffix(java.lang.String value) {
setValue(org.jooq.examples.sqlserver.adventureworks.humanresources.tables.vJobCandidate.vJobCandidate.Name_Suffix, value);
}
/**
* Getter for <code>HumanResources.vJobCandidate.Name.Suffix</code>.
*/
@javax.persistence.Column(name = "Name.Suffix", length = 30)
public java.lang.String getName_Suffix() {
return getValue(org.jooq.examples.sqlserver.adventureworks.humanresources.tables.vJobCandidate.vJobCandidate.Name_Suffix);
}
/**
* Setter for <code>HumanResources.vJobCandidate.Skills</code>.
*/
public void setSkills(java.lang.String value) {
setValue(org.jooq.examples.sqlserver.adventureworks.humanresources.tables.vJobCandidate.vJobCandidate.Skills, value);
}
/**
* Getter for <code>HumanResources.vJobCandidate.Skills</code>.
*/
@javax.persistence.Column(name = "Skills")
public java.lang.String getSkills() {
return getValue(org.jooq.examples.sqlserver.adventureworks.humanresources.tables.vJobCandidate.vJobCandidate.Skills);
}
/**
* Setter for <code>HumanResources.vJobCandidate.Addr.Type</code>.
*/
public void setAddr_Type(java.lang.String value) {
setValue(org.jooq.examples.sqlserver.adventureworks.humanresources.tables.vJobCandidate.vJobCandidate.Addr_Type, value);
}
/**
* Getter for <code>HumanResources.vJobCandidate.Addr.Type</code>.
*/
@javax.persistence.Column(name = "Addr.Type", length = 30)
public java.lang.String getAddr_Type() {
return getValue(org.jooq.examples.sqlserver.adventureworks.humanresources.tables.vJobCandidate.vJobCandidate.Addr_Type);
}
/**
* Setter for <code>HumanResources.vJobCandidate.Addr.Loc.CountryRegion</code>.
*/
public void setAddr_Loc_CountryRegion(java.lang.String value) {
setValue(org.jooq.examples.sqlserver.adventureworks.humanresources.tables.vJobCandidate.vJobCandidate.Addr_Loc_CountryRegion, value);
}
/**
* Getter for <code>HumanResources.vJobCandidate.Addr.Loc.CountryRegion</code>.
*/
@javax.persistence.Column(name = "Addr.Loc.CountryRegion", length = 100)
public java.lang.String getAddr_Loc_CountryRegion() {
return getValue(org.jooq.examples.sqlserver.adventureworks.humanresources.tables.vJobCandidate.vJobCandidate.Addr_Loc_CountryRegion);
}
/**
* Setter for <code>HumanResources.vJobCandidate.Addr.Loc.State</code>.
*/
public void setAddr_Loc_State(java.lang.String value) {
setValue(org.jooq.examples.sqlserver.adventureworks.humanresources.tables.vJobCandidate.vJobCandidate.Addr_Loc_State, value);
}
/**
* Getter for <code>HumanResources.vJobCandidate.Addr.Loc.State</code>.
*/
@javax.persistence.Column(name = "Addr.Loc.State", length = 100)
public java.lang.String getAddr_Loc_State() {
return getValue(org.jooq.examples.sqlserver.adventureworks.humanresources.tables.vJobCandidate.vJobCandidate.Addr_Loc_State);
}
/**
* Setter for <code>HumanResources.vJobCandidate.Addr.Loc.City</code>.
*/
public void setAddr_Loc_City(java.lang.String value) {
setValue(org.jooq.examples.sqlserver.adventureworks.humanresources.tables.vJobCandidate.vJobCandidate.Addr_Loc_City, value);
}
/**
* Getter for <code>HumanResources.vJobCandidate.Addr.Loc.City</code>.
*/
@javax.persistence.Column(name = "Addr.Loc.City", length = 100)
public java.lang.String getAddr_Loc_City() {
return getValue(org.jooq.examples.sqlserver.adventureworks.humanresources.tables.vJobCandidate.vJobCandidate.Addr_Loc_City);
}
/**
* Setter for <code>HumanResources.vJobCandidate.Addr.PostalCode</code>.
*/
public void setAddr_PostalCode(java.lang.String value) {
setValue(org.jooq.examples.sqlserver.adventureworks.humanresources.tables.vJobCandidate.vJobCandidate.Addr_PostalCode, value);
}
/**
* Getter for <code>HumanResources.vJobCandidate.Addr.PostalCode</code>.
*/
@javax.persistence.Column(name = "Addr.PostalCode", length = 20)
public java.lang.String getAddr_PostalCode() {
return getValue(org.jooq.examples.sqlserver.adventureworks.humanresources.tables.vJobCandidate.vJobCandidate.Addr_PostalCode);
}
/**
* Setter for <code>HumanResources.vJobCandidate.EMail</code>.
*/
public void setEMail(java.lang.String value) {
setValue(org.jooq.examples.sqlserver.adventureworks.humanresources.tables.vJobCandidate.vJobCandidate.EMail, value);
}
/**
* Getter for <code>HumanResources.vJobCandidate.EMail</code>.
*/
@javax.persistence.Column(name = "EMail")
public java.lang.String getEMail() {
return getValue(org.jooq.examples.sqlserver.adventureworks.humanresources.tables.vJobCandidate.vJobCandidate.EMail);
}
/**
* Setter for <code>HumanResources.vJobCandidate.WebSite</code>.
*/
public void setWebSite(java.lang.String value) {
setValue(org.jooq.examples.sqlserver.adventureworks.humanresources.tables.vJobCandidate.vJobCandidate.WebSite, value);
}
/**
* Getter for <code>HumanResources.vJobCandidate.WebSite</code>.
*/
@javax.persistence.Column(name = "WebSite")
public java.lang.String getWebSite() {
return getValue(org.jooq.examples.sqlserver.adventureworks.humanresources.tables.vJobCandidate.vJobCandidate.WebSite);
}
/**
* Setter for <code>HumanResources.vJobCandidate.ModifiedDate</code>.
*/
public void setModifiedDate(java.sql.Timestamp value) {
setValue(org.jooq.examples.sqlserver.adventureworks.humanresources.tables.vJobCandidate.vJobCandidate.ModifiedDate, value);
}
/**
* Getter for <code>HumanResources.vJobCandidate.ModifiedDate</code>.
*/
@javax.persistence.Column(name = "ModifiedDate", nullable = false)
public java.sql.Timestamp getModifiedDate() {
return getValue(org.jooq.examples.sqlserver.adventureworks.humanresources.tables.vJobCandidate.vJobCandidate.ModifiedDate);
}
// -------------------------------------------------------------------------
// Record16 type implementation
// -------------------------------------------------------------------------
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Row16<java.lang.Integer, java.lang.Integer, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.sql.Timestamp> fieldsRow() {
return org.jooq.impl.DSL.row(field1(), field2(), field3(), field4(), field5(), field6(), field7(), field8(), field9(), field10(), field11(), field12(), field13(), field14(), field15(), field16());
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Row16<java.lang.Integer, java.lang.Integer, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.sql.Timestamp> valuesRow() {
return org.jooq.impl.DSL.row(value1(), value2(), value3(), value4(), value5(), value6(), value7(), value8(), value9(), value10(), value11(), value12(), value13(), value14(), value15(), value16());
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.Integer> field1() {
return org.jooq.examples.sqlserver.adventureworks.humanresources.tables.vJobCandidate.vJobCandidate.JobCandidateID;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.Integer> field2() {
return org.jooq.examples.sqlserver.adventureworks.humanresources.tables.vJobCandidate.vJobCandidate.EmployeeID;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.String> field3() {
return org.jooq.examples.sqlserver.adventureworks.humanresources.tables.vJobCandidate.vJobCandidate.Name_Prefix;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.String> field4() {
return org.jooq.examples.sqlserver.adventureworks.humanresources.tables.vJobCandidate.vJobCandidate.Name_First;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.String> field5() {
return org.jooq.examples.sqlserver.adventureworks.humanresources.tables.vJobCandidate.vJobCandidate.Name_Middle;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.String> field6() {
return org.jooq.examples.sqlserver.adventureworks.humanresources.tables.vJobCandidate.vJobCandidate.Name_Last;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.String> field7() {
return org.jooq.examples.sqlserver.adventureworks.humanresources.tables.vJobCandidate.vJobCandidate.Name_Suffix;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.String> field8() {
return org.jooq.examples.sqlserver.adventureworks.humanresources.tables.vJobCandidate.vJobCandidate.Skills;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.String> field9() {
return org.jooq.examples.sqlserver.adventureworks.humanresources.tables.vJobCandidate.vJobCandidate.Addr_Type;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.String> field10() {
return org.jooq.examples.sqlserver.adventureworks.humanresources.tables.vJobCandidate.vJobCandidate.Addr_Loc_CountryRegion;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.String> field11() {
return org.jooq.examples.sqlserver.adventureworks.humanresources.tables.vJobCandidate.vJobCandidate.Addr_Loc_State;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.String> field12() {
return org.jooq.examples.sqlserver.adventureworks.humanresources.tables.vJobCandidate.vJobCandidate.Addr_Loc_City;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.String> field13() {
return org.jooq.examples.sqlserver.adventureworks.humanresources.tables.vJobCandidate.vJobCandidate.Addr_PostalCode;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.String> field14() {
return org.jooq.examples.sqlserver.adventureworks.humanresources.tables.vJobCandidate.vJobCandidate.EMail;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.String> field15() {
return org.jooq.examples.sqlserver.adventureworks.humanresources.tables.vJobCandidate.vJobCandidate.WebSite;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.sql.Timestamp> field16() {
return org.jooq.examples.sqlserver.adventureworks.humanresources.tables.vJobCandidate.vJobCandidate.ModifiedDate;
}
/**
* {@inheritDoc}
*/
@Override
public java.lang.Integer value1() {
return getJobCandidateID();
}
/**
* {@inheritDoc}
*/
@Override
public java.lang.Integer value2() {
return getEmployeeID();
}
/**
* {@inheritDoc}
*/
@Override
public java.lang.String value3() {
return getName_Prefix();
}
/**
* {@inheritDoc}
*/
@Override
public java.lang.String value4() {
return getName_First();
}
/**
* {@inheritDoc}
*/
@Override
public java.lang.String value5() {
return getName_Middle();
}
/**
* {@inheritDoc}
*/
@Override
public java.lang.String value6() {
return getName_Last();
}
/**
* {@inheritDoc}
*/
@Override
public java.lang.String value7() {
return getName_Suffix();
}
/**
* {@inheritDoc}
*/
@Override
public java.lang.String value8() {
return getSkills();
}
/**
* {@inheritDoc}
*/
@Override
public java.lang.String value9() {
return getAddr_Type();
}
/**
* {@inheritDoc}
*/
@Override
public java.lang.String value10() {
return getAddr_Loc_CountryRegion();
}
/**
* {@inheritDoc}
*/
@Override
public java.lang.String value11() {
return getAddr_Loc_State();
}
/**
* {@inheritDoc}
*/
@Override
public java.lang.String value12() {
return getAddr_Loc_City();
}
/**
* {@inheritDoc}
*/
@Override
public java.lang.String value13() {
return getAddr_PostalCode();
}
/**
* {@inheritDoc}
*/
@Override
public java.lang.String value14() {
return getEMail();
}
/**
* {@inheritDoc}
*/
@Override
public java.lang.String value15() {
return getWebSite();
}
/**
* {@inheritDoc}
*/
@Override
public java.sql.Timestamp value16() {
return getModifiedDate();
}
// -------------------------------------------------------------------------
// Constructors
// -------------------------------------------------------------------------
/**
* Create a detached vJobCandidate
*/
public vJobCandidate() {
super(org.jooq.examples.sqlserver.adventureworks.humanresources.tables.vJobCandidate.vJobCandidate);
}
}
| [
"lukas.eder@gmail.com"
] | lukas.eder@gmail.com |
71720de516ea749cda207f9bd4e7335211aa7ca4 | 3c85181fc5fbf37bf4a94ba5b9612d4f7e1c3819 | /APEC_YG002_User/user-server/src/main/java/com/apec/user/util/HttpClientUtil.java | 2d4ecdaa2b9d029f6bb7d4e0bf07d54ab9de6da5 | [] | no_license | haitincjg2012/ygdb | e73a78133ea9bf1841570dad54300e0395a1b6dc | 31cdbfca681e1eef2647c86e5a99a56fa07a005e | refs/heads/master | 2021-09-08T02:35:35.643355 | 2018-03-06T01:55:50 | 2018-03-06T01:55:50 | 102,995,594 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 5,488 | java | package com.apec.user.util;
import org.apache.http.HttpEntity;
import org.apache.http.NameValuePair;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.utils.HttpClientUtils;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.util.EntityUtils;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
* Created by wubi on 2017/10/9.
* @author wubi
*/
public class HttpClientUtil {
private RequestConfig requestConfig = RequestConfig.custom()
.setSocketTimeout(15000)
.setConnectTimeout(15000)
.setConnectionRequestTimeout(15000)
.build();
private static HttpClientUtil instance = null;
private HttpClientUtil(){}
public static HttpClientUtil getInstance(){
if (instance == null) {
instance = new HttpClientUtil();
}
return instance;
}
/**
* * 发送 post请求
* @param httpUrl 地址
* @return String
* @throws IOException IOException
*/
public String sendHttpPost(String httpUrl) throws IOException {
// 创建httpPost
HttpPost httpPost = new HttpPost(httpUrl);
return sendHttpPost(httpPost);
}
/**
* 发送 post请求
* @param httpUrl 地址
* @param params 参数(格式:key1=value1&key2=value2)
* @return String
* @throws IOException IOException
*/
public String sendHttpPost(String httpUrl, String params) throws IOException {
// 创建httpPost
HttpPost httpPost = new HttpPost(httpUrl);
try {
//设置参数
StringEntity stringEntity = new StringEntity(params, "UTF-8");
stringEntity.setContentType("application/x-www-form-urlencoded");
httpPost.setEntity(stringEntity);
} catch (Exception e) {
e.printStackTrace();
}
return sendHttpPost(httpPost);
}
/**
* 发送 post请求
* @param httpUrl 地址
* @param maps 参数
*/
public String sendHttpPost(String httpUrl, Map<String, String> maps) throws IOException {
// 创建httpPost
HttpPost httpPost = new HttpPost(httpUrl);
// 创建参数队列
List<NameValuePair> nameValuePairs = new ArrayList<>();
for (String key : maps.keySet()) {
nameValuePairs.add(new BasicNameValuePair(key, maps.get(key)));
}
httpPost.setEntity(new UrlEncodedFormEntity(nameValuePairs, "UTF-8"));
return sendHttpPost(httpPost);
}
/**
* 发送Post请求
* @param httpPost httpPost
* @return String
* @throws IOException IOException
*/
private String sendHttpPost(HttpPost httpPost) throws IOException {
CloseableHttpClient httpClient = null;
CloseableHttpResponse response = null;
HttpEntity entity;
String responseContent;
try {
// 创建默认的httpClient实例.
httpClient = HttpClients.createDefault();
httpPost.setConfig(requestConfig);
// 执行请求
response = httpClient.execute(httpPost);
entity = response.getEntity();
responseContent = EntityUtils.toString(entity, "UTF-8");
} finally {
try {
// 关闭连接,释放资源
close(httpClient, response);
} catch (IOException e) {
e.printStackTrace();
}
}
return responseContent;
}
/**
* 发送 get请求
* @param httpUrl httpUrl
* @return String
* @throws IOException IOException
*/
public String sendHttpGet(String httpUrl) throws IOException {
// 创建get请求
HttpGet httpGet = new HttpGet(httpUrl);
return sendHttpGet(httpGet);
}
/**
* 发送Get请求
* @param httpGet httpGet
* @return String
* @throws IOException IOException
*/
private String sendHttpGet(HttpGet httpGet) throws IOException {
CloseableHttpClient httpClient = null;
CloseableHttpResponse response = null;
HttpEntity entity;
String responseContent;
try {
// 创建默认的httpClient实例.
httpClient = HttpClients.createDefault();
httpGet.setConfig(requestConfig);
// 执行请求
response = httpClient.execute(httpGet);
entity = response.getEntity();
responseContent = EntityUtils.toString(entity, "UTF-8");
} finally {
try {
// 关闭连接,释放资源
close(httpClient, response);
} catch (IOException e) {
e.printStackTrace();
}
}
return responseContent;
}
private void close(CloseableHttpClient httpClient, CloseableHttpResponse response) throws IOException {
// 关闭连接,释放资源
HttpClientUtils.closeQuietly(response);
HttpClientUtils.closeQuietly(httpClient);
}
}
| [
"532186767@qq.com"
] | 532186767@qq.com |
f0aadad789e80d0044174a1c7e473935e1a937c4 | 2b7db6b45cd63b4e8e658d31abbaabb9903c22b2 | /spring-test/src/test/java/org/springframework/test/context/hierarchies/web/DispatcherWacRootWacEarTests.java | aa42080dd832fd2f21133ae8b4f1c219b4e857f4 | [
"MIT"
] | permissive | CrazyLiu-9527/spring-analysis-note | 413b2448d0ae45f72d6d49ef82a8b6283b3218c3 | 7df0ce990d1a6b48e63ac9ff8f45b6bd353ce5bb | refs/heads/master | 2022-08-29T00:29:20.546633 | 2020-05-28T08:39:15 | 2020-05-28T08:39:15 | 267,532,779 | 0 | 0 | MIT | 2020-05-28T08:16:34 | 2020-05-28T08:16:33 | null | UTF-8 | Java | false | false | 2,839 | java | /*
* Copyright 2002-2019 the original author or authors.
*
* 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
*
* https://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.springframework.test.context.hierarchies.web;
import javax.servlet.ServletContext;
import org.junit.Ignore;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.ContextHierarchy;
import org.springframework.web.context.WebApplicationContext;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
/**
* @author Sam Brannen
* @since 3.2.2
*/
@ContextHierarchy(@ContextConfiguration)
public class DispatcherWacRootWacEarTests extends RootWacEarTests {
@Autowired
private WebApplicationContext wac;
@Autowired
private String ear;
@Autowired
private String root;
@Autowired
private String dispatcher;
@Ignore("Superseded by verifyDispatcherWacConfig()")
@Test
@Override
public void verifyEarConfig() {
/* no-op */
}
@Ignore("Superseded by verifyDispatcherWacConfig()")
@Test
@Override
public void verifyRootWacConfig() {
/* no-op */
}
@Test
public void verifyDispatcherWacConfig() {
ApplicationContext parent = wac.getParent();
assertNotNull(parent);
assertTrue(parent instanceof WebApplicationContext);
ApplicationContext grandParent = parent.getParent();
assertNotNull(grandParent);
assertFalse(grandParent instanceof WebApplicationContext);
ServletContext dispatcherServletContext = wac.getServletContext();
assertNotNull(dispatcherServletContext);
ServletContext rootServletContext = ((WebApplicationContext) parent).getServletContext();
assertNotNull(rootServletContext);
assertSame(dispatcherServletContext, rootServletContext);
assertSame(parent,
rootServletContext.getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE));
assertSame(parent,
dispatcherServletContext.getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE));
assertEquals("ear", ear);
assertEquals("root", root);
assertEquals("dispatcher", dispatcher);
}
}
| [
"850366301@qq.com"
] | 850366301@qq.com |
b86410731dd40eb565f55ec51e99bdbe0fc05bb4 | 35563cbf1d5c737300b107a3c649e9fc8c1ce1a1 | /src/java/org/cspk4j/DefaultCspEventExecutor.java | 4fbb4748f4c1302c4a958708f93b1cd1f1063d0f | [
"LicenseRef-scancode-warranty-disclaimer"
] | no_license | mkleine/cspk4j | 032ff35747ebf25d10423a8e6e8e4f6b88cec75b | a7533d9b11c6f4086509ce6f64f69ae19f9b12d8 | refs/heads/master | 2020-12-25T18:23:03.869970 | 2010-09-22T09:50:31 | 2010-09-22T09:50:31 | 889,272 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,158 | java | /**
* This file is part of CSPk4J the CSP concurrency library for Java.
*
* CSPk4J is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* CSPk4J is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with CSPk4J. If not, see <http://www.gnu.org/licenses/>.
*
**/
package org.cspk4j;
public class DefaultCspEventExecutor implements CspEventExecutor {
public void execute(CspProcess process, String event) {
System.out.println("performing "+event);
}
public String resolve(ProcessInternalChoice internalChoice) {
return internalChoice.delegateNames.iterator().next();
}
public void timedOut(ProcessTimeout timeout) {
System.out.println(timeout.getName()+" timed out");
}
} | [
"mkleine@cs.tu-berlin.de"
] | mkleine@cs.tu-berlin.de |
0488b963c632d9c7edce5b283d838e7dfbc42141 | 896a95a97dadc6eb034469c75eaaab4626d29dde | /src/main/java/com/qfedu/fourstudy/transport/EsUtil.java | 77f6122237ceaddd0919b783d729e1c5ca58f1f2 | [] | no_license | xingpenghui/FourStudy1901 | 176d9e9d200c671c0b4453a23ee2e84f43cfe07a | 69b28242b87fdfc0a0341eb295fad9d5a077dbfa | refs/heads/master | 2022-07-03T21:08:31.168483 | 2019-07-11T04:57:40 | 2019-07-11T04:57:40 | 196,322,455 | 0 | 0 | null | 2022-06-21T01:26:11 | 2019-07-11T04:57:33 | Java | UTF-8 | Java | false | false | 5,699 | java | package com.qfedu.fourstudy.transport;
import com.alibaba.fastjson.JSON;
import org.elasticsearch.action.bulk.BulkRequestBuilder;
import org.elasticsearch.action.delete.DeleteResponse;
import org.elasticsearch.action.get.GetResponse;
import org.elasticsearch.action.index.IndexResponse;
import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.action.update.UpdateResponse;
import org.elasticsearch.client.transport.TransportClient;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.transport.InetSocketTransportAddress;
import org.elasticsearch.common.xcontent.XContentType;
import org.elasticsearch.index.query.QueryBuilder;
import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.index.query.TermQueryBuilder;
import org.elasticsearch.search.SearchHit;
import org.elasticsearch.search.builder.SearchSourceBuilder;
import org.elasticsearch.transport.client.PreBuiltTransportClient;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.List;
/**
*@Author feri
*@Date Created in 2019/6/20 15:34
* 基于Transport实现对象ES的封装处理
*/
public class EsUtil {
private TransportClient client;
public EsUtil(String clusterName,String host,int port){
Settings settings=Settings.builder().put("cluster.name",clusterName).build();
//2、创建连接对象
try {
client=new PreBuiltTransportClient(settings).addTransportAddress(
new InetSocketTransportAddress(InetAddress.getByName(host),port));
} catch (UnknownHostException e) {
e.printStackTrace();
}
}
//新增
public boolean save(String indexName,String typeName,String id,String res){
IndexResponse response=client.prepareIndex(indexName,typeName,id).setSource(res,XContentType.JSON).get();
return response.getResult().name().equals("CREATED");
}
//修改
public boolean update(String indexName,String typeName,String id,String res){
UpdateResponse updateResponse=client.prepareUpdate(indexName,typeName,id).setDoc(res,XContentType.JSON).get();
return updateResponse.status().name().equals("OK");
}
//删除
public boolean delete(String indexName,String typeName,String id){
DeleteResponse deleteResponse=client.prepareDelete(indexName, typeName, id).get();
return deleteResponse.status().name().equals("OK");
}
//查询
public String getById(String indexName,String typeName,String id){
GetResponse getResponse=client.prepareGet(indexName, typeName, id).get();
return getResponse.getSourceAsString();
}
//自定义泛型
public <T> T getByIdObj(String indexName,String typeName,String id,Class<T> clz){
String json=getById(indexName, typeName, id);
if(json!=null){
return JSON.parseObject(json,clz);
}else {
return null;
}
}
//批量新增
public <T> boolean batchSave(String indexName,String typeName,List<String> ids,List<String> res){
BulkRequestBuilder requestBuilder=client.prepareBulk();
for(int i=0;i<ids.size();i++){
requestBuilder.add(client.prepareIndex(indexName,typeName,ids.get(i)).
setSource(res.get(i),XContentType.JSON));
}
return requestBuilder.get().status().name().equals("OK");
}
//批量修改
public <T> boolean batchUpdate(String indexName,String typeName,List<String> ids,List<String> res){
BulkRequestBuilder requestBuilder=client.prepareBulk();
for(int i=0;i<ids.size();i++){
requestBuilder.add(client.prepareUpdate(indexName,typeName,ids.get(i)).
setDoc(res.get(i),XContentType.JSON));
}
return requestBuilder.get().status().name().equals("OK");
}
//批量删除
public <T> boolean batchDelete(String indexName,String typeName,List<String> ids){
BulkRequestBuilder requestBuilder=client.prepareBulk();
for(int i=0;i<ids.size();i++){
requestBuilder.add(client.prepareDelete(indexName,typeName,ids.get(i)));
}
return requestBuilder.get().status().name().equals("OK");
}
//复杂查询-单值
public String searhValue(String indexName, String typeName,String field,Object value){
TermQueryBuilder termQueryBuilder= QueryBuilders.termQuery(field,value);
List<String> list= search(indexName,typeName,0,1,termQueryBuilder);
if(list!=null) {
return list.get(0);
}else {
return null;
}
}
//复杂查询-多值
//复杂查询-模糊
//复杂查询-范围
//查询
public List<String> search(String indexName, String typeName,int start,int count, QueryBuilder queryBuilder){
SearchSourceBuilder sourceBuilder=new SearchSourceBuilder();
sourceBuilder.query(queryBuilder);
SearchResponse searchResponse=client.prepareSearch(indexName).setTypes(typeName).setFrom(start).setSize(count).setQuery(sourceBuilder.query()).get();
SearchHit[] hits=searchResponse.getHits().getHits();
List<String> list=new ArrayList<>();
for(SearchHit sh:hits){
list.add(sh.getSourceAsString());
}
return list;
}
public <T> List<T> searchList(String indexName, String typeName,int start,int count, QueryBuilder queryBuilder,Class<T> clz){
List<String> arr=search(indexName, typeName, start, count, queryBuilder);
String json=JSON.toJSONString(arr);
List<T> list=JSON.parseArray(json,clz);
return list;
}
}
| [
"xingfei_work@163.com"
] | xingfei_work@163.com |
1d055c45baef32313a7d2d21922371ac98b04f29 | 3083507a0be36b642456b57d60fb5726eb1afe26 | /day01/springIOC/src/main/java/com/huawei/dao/impl/AccountDaoImpl.java | bb6bcf871ebe35dd03f4a9d2dd8048eb9cc0acf6 | [] | no_license | yqx1314/springStudy | 5fc59ee7f10897ef190f11b02cc2bbbc1bb8332d | 540e78feab635debf1859b5bbfae0c403cb745fe | refs/heads/master | 2023-03-22T01:49:38.889156 | 2021-03-26T09:23:21 | 2021-03-26T09:23:21 | 313,031,719 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 311 | java | package com.huawei.dao.impl;
import com.huawei.dao.IAccountDao;
/**
* @author yqx
* @Company https://www.huawei.com
* @date 2021/3/26 9:32
* @desc
*/
public class AccountDaoImpl implements IAccountDao {
@Override
public void saveAccount() {
System.out.println("保存了账户");
}
}
| [
"2269941675@qq.com"
] | 2269941675@qq.com |
f71b4ae494afc6f37d934878934a47c4f839ca11 | fe8a99718f97dac59dcf76d50713a0a1c6ea2efb | /src/main/java/com/axxes/store/demo/domain/Basket.java | 889a69519574fb4f9a222d221df02938fad3918f | [] | no_license | CelPyn/store-demo | 41ad5a4fb1885c37e2e6722deac73fefebf53372 | e2f5bb1cc0101f4d90291f66785acc39cd4412d8 | refs/heads/master | 2023-05-04T23:05:40.692588 | 2021-05-23T10:35:37 | 2021-05-23T10:35:37 | 337,008,938 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 127 | java | package com.axxes.store.demo.domain;
import java.util.List;
public interface Basket {
List<BasketItem> getContent();
}
| [
"celpynenborg@gmail.com"
] | celpynenborg@gmail.com |
09e7fcb55be5f111fc3737ad8a3439a5ea3bdee9 | 4419bbecc195b63a8d0b23cd0a646477c652fb85 | /my-java-core-app/src/main/java/com/app/concurrency/app01/blockingqueue/priority/MyQueueProducer.java | 0a29db0b9eeae78b6bbd1cc77c1f08016d3866f8 | [] | no_license | softwareengineerhub/test | c81affe5a53d5e9d3f2e052b8921abb4c4662c21 | 26915613b2613c1112219b2d3efebcbbf82097f3 | refs/heads/master | 2022-11-22T00:54:35.738807 | 2020-03-15T20:16:51 | 2020-03-15T20:16:51 | 143,843,743 | 0 | 1 | null | 2022-11-16T11:51:41 | 2018-08-07T08:32:22 | Java | UTF-8 | Java | false | false | 2,161 | java | package com.app.concurrency.app01.blockingqueue.priority;
import java.util.concurrent.BlockingQueue;
public class MyQueueProducer extends Thread {
private BlockingQueue blockingQueue;
public MyQueueProducer(BlockingQueue blockingQueue) {
this.blockingQueue = blockingQueue;
}
public void run(){
MyData myData1 = new MyData("Added1", 0);
MyData myData2 = new MyData("Added2", 1);
MyData myData3 = new MyData("Added3", -5);
MyData myData4 = new MyData("Added4", 6);
MyData myData5 = new MyData("Added5", 2);
MyData myData6 = new MyData("Added6", 3);
MyData myData7 = new MyData("Added7", 4);
MyData myData8 = new MyData("Added8", 5);
MyData myData9 = new MyData("Added9", 6);
MyData myData10 = new MyData("Added10", 7);
MyData myData11 = new MyData("Added11", 8);
MyData myData12 = new MyData("Added12", 9);
try {
blockingQueue.put(myData1);
System.out.println("Produced: "+myData1);
blockingQueue.put(myData2);
System.out.println("Produced: "+myData2);
blockingQueue.put(myData3);
System.out.println("Produced: "+myData3);
blockingQueue.put(myData4);
System.out.println("Produced: "+myData4);
blockingQueue.put(myData5);
System.out.println("Produced: "+myData5);
blockingQueue.put(myData6);
System.out.println("Produced: "+myData6);
blockingQueue.put(myData7);
System.out.println("Produced: "+myData7);
blockingQueue.put(myData8);
System.out.println("Produced: "+myData8);
blockingQueue.put(myData9);
System.out.println("Produced: "+myData9);
blockingQueue.put(myData10);
System.out.println("Produced: "+myData10);
blockingQueue.put(myData11);
System.out.println("Produced: "+myData11);
blockingQueue.put(myData12);
System.out.println("Produced: "+myData12);
}catch(Exception ex){
ex.printStackTrace();
}
}
}
| [
"denis4321@ukr.net"
] | denis4321@ukr.net |
9aa3cdc1923a2e552b39bc6463ab96354f2f82ef | 1cd0c1b5a42cf746cf047fc185703f2df5bd0826 | /src/test/java/com/projects/model/service/impl/EmployeeServiceTest.java | fcbe6744bdcc6d0ed133b69d47dfb4ed3302d7df | [] | no_license | ZheniaGritsay/cash-register-system | 0089b03f2b283992213b660cdd78b3cb5639d022 | f81f9675e4bf1f37be07d4481cfad6928f72369b | refs/heads/master | 2021-05-11T09:08:10.545953 | 2018-01-23T10:16:28 | 2018-01-23T10:16:28 | 118,069,527 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,050 | java | package com.projects.model.service.impl;
import com.projects.helpers.Dummies;
import com.projects.model.dao.EmployeeDao;
import com.projects.model.dao.exception.DaoException;
import com.projects.model.domain.dto.Employee;
import com.projects.model.service.EmployeeService;
import org.junit.Test;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
public class EmployeeServiceTest {
private EmployeeDao employeeDao = mock(EmployeeDao.class);
private EmployeeService employeeService = new EmployeeServiceImpl(employeeDao);
@Test
public void create() throws DaoException {
Employee employee = Dummies.getDummyEmployee(0L);
employeeService.create(employee);
verify(employeeDao, times(1)).create(employee);
}
@Test
public void findById() throws DaoException {
employeeService.findById(1L);
verify(employeeDao, times(1)).getById(1L);
}
@Test
public void update() throws DaoException {
Employee employee = Dummies.getDummyEmployee(1L);
employeeService.update(employee);
verify(employeeDao, times(1)).update(employee);
}
@Test
public void delete() throws DaoException {
employeeService.delete(2L);
verify(employeeDao, times(1)).delete(2L);
}
@Test
public void findAll() throws DaoException {
employeeService.findAll();
verify(employeeDao, times(1)).getAll();
}
@Test
public void getForPage() throws DaoException {
employeeService.getForPage(5, 0);
verify(employeeDao, times(1)).getPerPage(5, 0);
}
@Test
public void getRecords() throws DaoException {
employeeService.getRecords();
verify(employeeDao, times(1)).getCount();
}
@Test
public void findByFirstAndLastName() throws DaoException {
employeeService.findByFirstAndLastName("John", "Williams");
verify(employeeDao, times(1)).getByFirstAndLastName("John", "Williams");
}
}
| [
"zhenia.gritsay@gmail.com"
] | zhenia.gritsay@gmail.com |
7cb7038b70abc44e10fb858bdddd36da2a1fc8c5 | fb5074e86ce327a2ea6a8c3a60765ef228764204 | /UdeskSDKUI/src/main/java/cn/udesk/config/UdeskBaseInfo.java | 1de9aebf132dc21723c9fcde057ad3888e79209e | [] | no_license | gcy1070398201/NewAppStution | 260b9245b75628ad50e9fedecd47d0d93ce0a5b8 | 95c26456ff25b7b81e134e9d7cc73aeb86dcd48c | refs/heads/master | 2021-07-12T10:47:31.876200 | 2017-10-18T05:39:41 | 2017-10-18T05:39:41 | 103,375,051 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,955 | java | package cn.udesk.config;
import java.util.Map;
import cn.udesk.model.UdeskCommodityItem;
/**
* Created by user on 2017/1/4.
*/
public class UdeskBaseInfo {
/**
* 注册udesk系统生成的二级域名
*/
public static String domain = "";
/**
* udesk系统创建应用生成的App Id
*/
public static String App_Id = "";
/**
* udesk系统创建应用生成的App Key
*/
public static String App_Key = "";
/**
* 用户唯一的标识
*/
public static String sdkToken = null;
/**
* 用户的基本信息
*/
public static Map<String, String> userinfo = null;
/**
* 用户自定义字段文本信息
*/
public static Map<String, String> textField = null;
/**
* 用户自定义字段的列表信息
*/
public static Map<String, String> roplist = null;
/**
* 用户需要更新的基本信息
*/
public static Map<String, String> updateUserinfo = null;
/**
* 用户需要更新自定义字段文本信息
*/
public static Map<String, String> updateTextField = null;
/**
* 用户需要更新自定义列表字段信息
*/
public static Map<String, String> updateRoplist = null;
//相关推送平台注册生成的ID
public static String registerId = "";
/**
* 创建用户成功时 生成的id值
*/
public static String customerId = null;
/**
* 保存客户的头像地址,由用户app传递
*/
public static String customerUrl = null;
/**
* 控制在线时的消息的通知 在聊天界面的时候 关闭,不在聊天的界面的开启
*/
public static boolean isNeedMsgNotice = true;
//发送商品链接的mode
public static UdeskCommodityItem commodity = null;
//发送商品链接的mode
public static String strText = null;
public static String sendMsgTo = "";
}
| [
"gu159357"
] | gu159357 |
b954977f1a31b361ec1a80c5e94d0f95965b339a | f823f023ce0835c62a35c3fad6f03df26802b0cf | /apps/testnorge-hodejegeren/src/main/java/no/nav/registre/hodejegeren/provider/rs/responses/NavEnhetResponse.java | 70cd31cb5fbfb27bcb02acaded23efb5700d3af6 | [
"MIT"
] | permissive | abdukerim/testnorge | b4778f97f9a51d3591aa29d7ef8bfb1c1f11cdd9 | 31ea38d2286db6de244eb1ab71c4751cc01f8d05 | refs/heads/master | 2023-08-23T11:49:12.549613 | 2021-11-03T14:10:23 | 2021-11-03T14:10:23 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 389 | java | package no.nav.registre.hodejegeren.provider.rs.responses;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class NavEnhetResponse {
private String ident;
private String navEnhet;
private String navEnhetBeskrivelse;
}
| [
"kristoffer.mjelva@nav.no"
] | kristoffer.mjelva@nav.no |
b56556a9a68d72213cee4cc06cd8d00592e0eb3b | 4c2205d56a6cee559871b70add0773a261d6719a | /interview/src/test/java/com/calvin/educative/io/math/PythagTripletsInArrayTest.java | 3af1a9208d38f77c7a05cc4ded9640b26015585e | [] | no_license | wonvincal/practice | 5fa4303ec1aae3de1ed65ff001f445fe6c6def54 | 8fc0c333e98df3a2d1688d7c97424fc502a255cf | refs/heads/master | 2021-05-10T21:58:39.494282 | 2018-01-29T08:11:36 | 2018-01-29T08:11:36 | 118,245,519 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 386 | java | package com.calvin.educative.io.math;
import java.util.List;
import org.junit.Test;
import com.calvin.educative.io.math.PythagTripletsInArray;
public class PythagTripletsInArrayTest {
@Test
public void test(){
int[] items = new int[]{4,16,1,2,3,5,6,8,25,10};
List<String> triplets = PythagTripletsInArray.find(items);
triplets.forEach((c) -> {System.out.println(c);});
}
}
| [
"bc@codacapitalpartners.com"
] | bc@codacapitalpartners.com |
35a5c4451d81e13001b2dc3aecafc69e24331d8c | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/3/3_895c2ca6f10f557815e714767c75883b30d6b600/PowderSimJ/3_895c2ca6f10f557815e714767c75883b30d6b600_PowderSimJ_t.java | 8f21ddc367e23a2fbb7cb457d60817187a653d38 | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 10,852 | java | package net.psj;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;
import java.nio.channels.Channels;
import net.psj.Interface.MenuData;
import net.psj.Interface.Overlay;
import net.psj.Simulation.Air;
import net.psj.Simulation.ParticleData;
import net.psj.Simulation.ShaderData;
import net.psj.Simulation.WallData;
import net.psj.Walls.WallFan;
import org.lwjgl.opengl.GL11;
import org.newdawn.slick.AppGameContainer;
import org.newdawn.slick.BasicGame;
import org.newdawn.slick.GameContainer;
import org.newdawn.slick.Graphics;
import org.newdawn.slick.Input;
import org.newdawn.slick.KeyListener;
import org.newdawn.slick.MouseListener;
import org.newdawn.slick.SlickException;
public class PowderSimJ extends BasicGame implements MouseListener,KeyListener{
static boolean hasGotNatives = false;
public static final int width = 612;
public static final int height = 384;
public static final int cenX = width/2;
public static final int cenY = height/2;
public static final int menuSize = 40;
public static final int barSize = 17;
public static final int cell = 4;
public static final int MAX_TEMP = 9000;
public static final int MIN_TEMP = 0;
public static File appDir;
/* Settings */
public static int AA = 0;
public static boolean VSync = false;
public static boolean Debug = true;
public static int targetFrames = 60;
public static int mouseX;
public static int mouseY;
public static int selectedl = 1;/*0x00 - 0xFF are particles */
public static int selectedr = 0;
public static int wallStart = 4096; //Basically the element limit.
int fanX,fanY;
boolean isSettingFan = false;
int keyTick = 5;
public boolean isPaused = false;
public boolean airHeat = false;
public static GameContainer gc;
public Air air = new Air();
public WallData wall = new WallData();
public static ParticleData ptypes = new ParticleData();
public static int brushSize = 10;
public static String version = "0.1 Alpha";
public PowderSimJ()
{
super("Powder Sim Java");
}
@Override
public void init(GameContainer gc) throws SlickException {
PowderSimJ.gc = gc;
RenderUtils.setAntiAliasing(true);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glShadeModel(GL11.GL_SMOOTH);
RenderUtils.init();
ShaderData.init();
}
public static void main(String[] args) throws SlickException
{
System.out.println(getDirectory());
while(hasGotNatives==false)
{
}
System.setProperty("org.lwjgl.librarypath",getDirectory() + "/natives/" + getOs() + "");
AppGameContainer app = new AppGameContainer(new PowderSimJ());
app.setDisplayMode(width+barSize, height+menuSize, false);
app.setVSync(VSync);
app.setMultiSample(AA);
app.setVerbose(Debug);
app.setTargetFrameRate(targetFrames);
app.setShowFPS(false);
app.start();
}
@Override
public void render(GameContainer arg0, Graphics arg1) throws SlickException {
if(!isSettingFan)
air.drawAir();
wall.renderWalls();
ShaderData.blurH.activate();
ShaderData.blurV.activate();
ShaderData.fancy.activate();
ptypes.render();
ShaderData.blurH.deactivate();
ShaderData.blurV.deactivate();
ShaderData.fancy.deactivate();
MenuData.draw();
if(isSettingFan)
RenderUtils.drawLine(fanX,fanY,mouseX,mouseY, 1,1.0f,1.0f,1.0f);
else
{
int x1 = mouseX, y1 = mouseY;
x1 = x1-(PowderSimJ.brushSize/2);
y1 = y1-(PowderSimJ.brushSize/2);
RenderUtils.drawRectLine(x1, y1, x1+brushSize, y1+brushSize, 1.0f, 1.0f, 1.0f);
}
Overlay.drawInfoBar();
Overlay.drawPixInfo();
}
@Override
public void update(GameContainer arg0, int arg1) throws SlickException
{
if(!isPaused)
{
air.update_air();
air.make_kernel();
if(airHeat)
air.update_airh();
ptypes.update();
}
Input input = arg0.getInput();
mouseX = input.getMouseX();
mouseY = input.getMouseY();
if(input.isMouseButtonDown(Input.MOUSE_LEFT_BUTTON))
onMouseClick(arg0,0);
if(input.isMouseButtonDown(Input.MOUSE_RIGHT_BUTTON))
onMouseClick(arg0,4);
}
@Override
public void keyPressed(int key, char c)
{
if(key==Input.KEY_EQUALS)
for (int y=0; y<height/cell; y++)
for (int x=0; x<width/cell; x++)
{
Air.pv[y][x] = 0f;
Air.vy[y][x] = 0f;
Air.vx[y][x] = 0f;
air.hv[y][x] = 0f;
}
if(key==Input.KEY_SPACE)
isPaused = !isPaused;
if(key==Input.KEY_LBRACKET)
brushSize-=20;
if(key==Input.KEY_RBRACKET)
brushSize+=20;
if(brushSize<1) brushSize = 1;
}
@Override
public void mouseWheelMoved(int change) {
brushSize += change/100;
if(brushSize<1) brushSize = 1;
}
@Override
public void mouseReleased(int button, int x, int y)
{
//TODO make more brush types;
}
@Override
public void mouseClicked(int button, int x, int y, int clickCount)
{
MenuData.click(button,x,y);
if(mouseY>0 && mouseY<height)
{
if(mouseX>0 && mouseX<width)
{
while(!(mouseY%cell==0))
mouseY--;
while(!(mouseX%cell==0))
mouseX--;
if(WallData.bmap[mouseY/cell][mouseX/cell] instanceof WallFan && gc.getInput().isKeyDown(Input.KEY_LSHIFT))
{
isSettingFan = !isSettingFan;
fanX = mouseX;
fanY = mouseY;
return;
}
else if(isSettingFan)
{
float nfvx = (mouseX-fanX)*0.055f;
float nfvy = (mouseY-fanY)*0.055f;
air.fvx[fanY/cell][fanX/cell] = nfvx;
air.fvy[fanY/cell][fanX/cell] = nfvy;
isSettingFan = false;
return;
}
}
}
}
public static boolean isInPlayField(int x, int y)
{
if(mouseY>0 && mouseY<height)
if(mouseX>0 && mouseX<width)
return true;
return false;
}
public void onMouseClick(GameContainer arg0, int button)
{
if(isInPlayField(mouseX,mouseY))
{
if(button==0)
{
if(selectedl<wallStart)
ptypes.create_parts(mouseX, mouseY, selectedl);
else
wall.create_walls(mouseX/4, mouseY/4, selectedl);
}
else if(button==4)
ptypes.create_parts(mouseX, mouseY, selectedr);
}
}
private static String getOs()
{
String s = System.getProperty("os.name").toLowerCase();
if (s.contains("win"))
{
return "windows";
}
if (s.contains("mac"))
{
return "macosx";
}
if (s.contains("solaris"))
{
return "solaris";
}
if (s.contains("sunos"))
{
return "solaris";
}
if (s.contains("linux"))
{
return "linux";
}
if (s.contains("unix"))
{
return "linux";
}
else
{
return "linux";
}
}
public static File getDirectory()
{
if (appDir == null)
{
appDir = getAppDir("powdersimj");
}
File natives = new File(appDir, "natives/");
if(!natives.exists())
natives.mkdir();
File os = new File(natives, getOs());
if(!os.exists())
{
os.mkdir();
}
downloadFiles("http://dl.dropbox.com/u/20806998/PS/natives/" + getOs() + "/files.txt",os);
return appDir;
}
public static File getAppDir(String par0Str)
{
String s = System.getProperty("user.home", ".");
File file = null;
if(getOs().equalsIgnoreCase("windows"))
{
String s1 = System.getenv("APPDATA");
if (s1 != null)
{
file = new File(s1, (new StringBuilder()).append(".").append(par0Str).append('/').toString());
}
else
{
file = new File(s, (new StringBuilder()).append('.').append(par0Str).append('/').toString());
}
}
else if (getOs().equalsIgnoreCase("macosx"))
{
file = new File(s, (new StringBuilder()).append("Library/Application Support/").append(par0Str).toString());
}
else if(getOs().equalsIgnoreCase("solaris"))
{
file = new File(s, (new StringBuilder()).append('.').append(par0Str).append('/').toString());
}
else if(getOs().equalsIgnoreCase("linux"))
{}
else
{
file = new File(s, (new StringBuilder()).append(par0Str).append('/').toString());
}
if (!file.exists() && !file.mkdirs())
{
throw new RuntimeException((new StringBuilder()).append("The working directory could not be created: ").append(file).toString());
}
else
{
return file;
}
}
public static void downloadFiles(String list, File outputDir)
{
try
{
URL url = new URL(list);
URLConnection urlconnection = url.openConnection();
urlconnection.setReadTimeout(5000);
urlconnection.setDoOutput(true);
BufferedReader bufferedreader = new BufferedReader(new InputStreamReader(urlconnection.getInputStream()));
String s;
while ((s = bufferedreader.readLine()) != null)
{
downloadFile(list.replace("files.txt", s),new File(outputDir, s));
}
bufferedreader.close();
if(hasGotNatives==false)
hasGotNatives = true;
}
catch(Exception e){e.printStackTrace();}
}
public static void downloadFile(final String url, final File out)
{
if(out.exists()) return;
try
{
URL url1 = new URL(url);
java.nio.channels.ReadableByteChannel readablebytechannel = Channels.newChannel(url1.openStream());
FileOutputStream fileoutputstream = new FileOutputStream(out);
fileoutputstream.getChannel().transferFrom(readablebytechannel, 0L, 0x1000000L);
fileoutputstream.close();
}
catch (Exception exception)
{
exception.printStackTrace();
}
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
03ecc14178b41365df261daf068012d091392d5b | 4f87958e4ad9fc57b62ad65c224e5fa27c8440bf | /SpMVC_29_MyShop/src/main/java/com/biz/shop/domain/ProductVO.java | 9bc92d52eeeb077ff26e0808d448e19940cfdfb8 | [] | no_license | leeiter/_biz_spring2 | cb546d26b333f5a7673a34bfafd72777ad6123f3 | 2ec1f731d59ebbdb93dcdf332d79c5e0f38ee16a | refs/heads/master | 2022-12-23T18:24:58.192876 | 2020-06-05T06:29:31 | 2020-06-05T06:29:31 | 240,149,045 | 1 | 0 | null | 2022-12-16T15:38:50 | 2020-02-13T01:07:37 | Java | UTF-8 | Java | false | false | 642 | java | package com.biz.shop.domain;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@ToString
@Builder
public class ProductVO {
private String p_code;
private String p_name;
private String p_bcode; // 품목코드
private String p_dcode; // 주매입처 코드
private int p_iprice; // 매입가격
private int p_oprice; // 판매가격
private boolean p_vat; // 과세여부 true : 과세, false : 면세
private String p_file; // 상품의 대표 이미지
}
| [
"iterlees@gmail.com"
] | iterlees@gmail.com |
5085b37c3968b732f2bacde377084fc56666003d | 8b628d5d70fd9fc1481961f5c41e4d0216a398ca | /app/src/main/java/com/latihan/materi5_fragment/SecondFragment.java | ffbab1aaa1dc9566958b20781bf8b27c192cc8c7 | [] | no_license | kresnamukti48/Android_Materi5_Fragment | 7b0021f91e18aa79f1af4a731c1a55ad53154c4c | 3255a07261dacfb87553e9ed3788701737beb746 | refs/heads/master | 2023-03-11T18:41:12.333915 | 2021-02-24T16:25:07 | 2021-02-24T16:25:07 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,046 | java | package com.latihan.materi5_fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.fragment.app.Fragment;
/**
* A simple {@link Fragment} subclass.
* Use the {@link SecondFragment#newInstance} factory method to
* create an instance of this fragment.
*/
public class SecondFragment extends Fragment {
// TODO: Rename parameter arguments, choose names that match
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
private static final String ARG_PARAM1 = "param1";
private static final String ARG_PARAM2 = "param2";
// TODO: Rename and change types of parameters
private String mParam1;
private String mParam2;
public SecondFragment() {
// Required empty public constructor
}
/**
* Use this factory method to create a new instance of
* this fragment using the provided parameters.
*
* @param param1 Parameter 1.
* @param param2 Parameter 2.
* @return A new instance of fragment SecondFragment.
*/
// TODO: Rename and change types and number of parameters
public static SecondFragment newInstance(String param1, String param2) {
SecondFragment fragment = new SecondFragment();
Bundle args = new Bundle();
args.putString(ARG_PARAM1, param1);
args.putString(ARG_PARAM2, param2);
fragment.setArguments(args);
return fragment;
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getArguments() != null) {
mParam1 = getArguments().getString(ARG_PARAM1);
mParam2 = getArguments().getString(ARG_PARAM2);
}
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_second, container, false);
}
} | [
"kresnamukti48@gmail.com"
] | kresnamukti48@gmail.com |
fe8120958e639e36a392a688c3fda33d9bf231db | 8c8b9ff89d9db43a9e7549c54fb685930e121883 | /app/build/generated/source/r/AnZhiShiChang/debug/com/facebook/drawee/backends/pipeline/R.java | b6e723fd35368da83ab1ef5179abc185ecd20540 | [] | no_license | tank2014gz/shizhong-Android | bdb92ab5e7791a48fdfc3c3952cfabf362050acd | 8a13d01a3550c0bd103559a168608429bcc0e3f0 | refs/heads/master | 2021-12-14T02:54:25.501898 | 2021-11-09T07:25:09 | 2021-11-09T07:25:09 | 147,283,304 | 6 | 2 | null | null | null | null | UTF-8 | Java | false | false | 5,036 | java | /* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* gradle plugin from the resource data it found. It
* should not be modified by hand.
*/
package com.facebook.drawee.backends.pipeline;
public final class R {
public static final class attr {
public static final int actualImageScaleType = 0x7f030004;
public static final int actualImageUri = 0x7f030005;
public static final int backgroundImage = 0x7f030007;
public static final int fadeDuration = 0x7f030026;
public static final int failureImage = 0x7f030029;
public static final int failureImageScaleType = 0x7f03002a;
public static final int overlayImage = 0x7f03004b;
public static final int placeholderImage = 0x7f03004e;
public static final int placeholderImageScaleType = 0x7f03004f;
public static final int pressedStateOverlayImage = 0x7f030050;
public static final int progressBarAutoRotateInterval = 0x7f030051;
public static final int progressBarImage = 0x7f030052;
public static final int progressBarImageScaleType = 0x7f030053;
public static final int retryImage = 0x7f030071;
public static final int retryImageScaleType = 0x7f030072;
public static final int roundAsCircle = 0x7f030074;
public static final int roundBottomLeft = 0x7f030075;
public static final int roundBottomRight = 0x7f030076;
public static final int roundTopLeft = 0x7f030077;
public static final int roundTopRight = 0x7f030078;
public static final int roundWithOverlayColor = 0x7f030079;
public static final int roundedCornerRadius = 0x7f03007a;
public static final int roundingBorderColor = 0x7f03007b;
public static final int roundingBorderPadding = 0x7f03007c;
public static final int roundingBorderWidth = 0x7f03007d;
public static final int viewAspectRatio = 0x7f030095;
}
public static final class id {
public static final int center = 0x7f080032;
public static final int centerCrop = 0x7f080033;
public static final int centerInside = 0x7f080034;
public static final int fitCenter = 0x7f080087;
public static final int fitEnd = 0x7f080088;
public static final int fitStart = 0x7f080089;
public static final int fitXY = 0x7f08008a;
public static final int focusCrop = 0x7f080093;
public static final int none = 0x7f08015b;
}
public static final class styleable {
public static final int[] GenericDraweeHierarchy = { 0x7f030004, 0x7f030007, 0x7f030026, 0x7f030029, 0x7f03002a, 0x7f03004b, 0x7f03004e, 0x7f03004f, 0x7f030050, 0x7f030051, 0x7f030052, 0x7f030053, 0x7f030071, 0x7f030072, 0x7f030074, 0x7f030075, 0x7f030076, 0x7f030077, 0x7f030078, 0x7f030079, 0x7f03007a, 0x7f03007b, 0x7f03007c, 0x7f03007d, 0x7f030095 };
public static final int GenericDraweeHierarchy_actualImageScaleType = 0;
public static final int GenericDraweeHierarchy_backgroundImage = 1;
public static final int GenericDraweeHierarchy_fadeDuration = 2;
public static final int GenericDraweeHierarchy_failureImage = 3;
public static final int GenericDraweeHierarchy_failureImageScaleType = 4;
public static final int GenericDraweeHierarchy_overlayImage = 5;
public static final int GenericDraweeHierarchy_placeholderImage = 6;
public static final int GenericDraweeHierarchy_placeholderImageScaleType = 7;
public static final int GenericDraweeHierarchy_pressedStateOverlayImage = 8;
public static final int GenericDraweeHierarchy_progressBarAutoRotateInterval = 9;
public static final int GenericDraweeHierarchy_progressBarImage = 10;
public static final int GenericDraweeHierarchy_progressBarImageScaleType = 11;
public static final int GenericDraweeHierarchy_retryImage = 12;
public static final int GenericDraweeHierarchy_retryImageScaleType = 13;
public static final int GenericDraweeHierarchy_roundAsCircle = 14;
public static final int GenericDraweeHierarchy_roundBottomLeft = 15;
public static final int GenericDraweeHierarchy_roundBottomRight = 16;
public static final int GenericDraweeHierarchy_roundTopLeft = 17;
public static final int GenericDraweeHierarchy_roundTopRight = 18;
public static final int GenericDraweeHierarchy_roundWithOverlayColor = 19;
public static final int GenericDraweeHierarchy_roundedCornerRadius = 20;
public static final int GenericDraweeHierarchy_roundingBorderColor = 21;
public static final int GenericDraweeHierarchy_roundingBorderPadding = 22;
public static final int GenericDraweeHierarchy_roundingBorderWidth = 23;
public static final int GenericDraweeHierarchy_viewAspectRatio = 24;
public static final int[] SimpleDraweeView = { 0x7f030005 };
public static final int SimpleDraweeView_actualImageUri = 0;
}
}
| [
"sundaoran@qq.com"
] | sundaoran@qq.com |
729bc00c25c27bf5af082883abd873359b8787e2 | bcf03d43318239f6242e53e0bdd3c4753c08fc79 | /java/okio/Base64.java | d0b2b5314f4df277468ee1ed25c419537aa9a82b | [] | no_license | morristech/Candid | 24699d45f9efb08787316154d05ad5e6a7a181a5 | 102dd9504cac407326b67ca7a36df8adf6a8b450 | refs/heads/master | 2021-01-22T21:07:12.067146 | 2016-12-22T18:40:30 | 2016-12-22T18:40:30 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,443 | java | package okio;
import defpackage.um$h;
import java.io.UnsupportedEncodingException;
final class Base64 {
private static final byte[] MAP = new byte[]{(byte) 65, (byte) 66, (byte) 67, (byte) 68, (byte) 69, (byte) 70, (byte) 71, (byte) 72, (byte) 73, (byte) 74, (byte) 75, (byte) 76, (byte) 77, (byte) 78, (byte) 79, (byte) 80, (byte) 81, (byte) 82, (byte) 83, (byte) 84, (byte) 85, (byte) 86, (byte) 87, (byte) 88, (byte) 89, (byte) 90, (byte) 97, (byte) 98, (byte) 99, (byte) 100, (byte) 101, (byte) 102, (byte) 103, (byte) 104, (byte) 105, (byte) 106, (byte) 107, (byte) 108, (byte) 109, (byte) 110, (byte) 111, (byte) 112, (byte) 113, (byte) 114, (byte) 115, (byte) 116, (byte) 117, (byte) 118, (byte) 119, (byte) 120, (byte) 121, (byte) 122, (byte) 48, (byte) 49, (byte) 50, (byte) 51, (byte) 52, (byte) 53, (byte) 54, (byte) 55, (byte) 56, (byte) 57, (byte) 43, (byte) 47};
private static final byte[] URL_MAP = new byte[]{(byte) 65, (byte) 66, (byte) 67, (byte) 68, (byte) 69, (byte) 70, (byte) 71, (byte) 72, (byte) 73, (byte) 74, (byte) 75, (byte) 76, (byte) 77, (byte) 78, (byte) 79, (byte) 80, (byte) 81, (byte) 82, (byte) 83, (byte) 84, (byte) 85, (byte) 86, (byte) 87, (byte) 88, (byte) 89, (byte) 90, (byte) 97, (byte) 98, (byte) 99, (byte) 100, (byte) 101, (byte) 102, (byte) 103, (byte) 104, (byte) 105, (byte) 106, (byte) 107, (byte) 108, (byte) 109, (byte) 110, (byte) 111, (byte) 112, (byte) 113, (byte) 114, (byte) 115, (byte) 116, (byte) 117, (byte) 118, (byte) 119, (byte) 120, (byte) 121, (byte) 122, (byte) 48, (byte) 49, (byte) 50, (byte) 51, (byte) 52, (byte) 53, (byte) 54, (byte) 55, (byte) 56, (byte) 57, (byte) 45, (byte) 95};
private Base64() {
}
public static byte[] decode(String in) {
int limit = in.length();
while (limit > 0) {
char c = in.charAt(limit - 1);
if (c != '=' && c != '\n' && c != '\r' && c != ' ' && c != '\t') {
break;
}
limit--;
}
byte[] out = new byte[((int) ((((long) limit) * 6) / 8))];
int inCount = 0;
int word = 0;
int pos = 0;
int outCount = 0;
while (pos < limit) {
int bits;
int outCount2;
c = in.charAt(pos);
if (c >= 'A' && c <= 'Z') {
bits = c - 65;
} else if (c >= 'a' && c <= 'z') {
bits = c - 71;
} else if (c >= '0' && c <= '9') {
bits = c + 4;
} else if (c == '+' || c == '-') {
bits = 62;
} else if (c == '/' || c == '_') {
bits = 63;
} else {
if (!(c == '\n' || c == '\r' || c == ' ')) {
if (c == '\t') {
outCount2 = outCount;
pos++;
outCount = outCount2;
} else {
outCount2 = outCount;
return null;
}
}
outCount2 = outCount;
pos++;
outCount = outCount2;
}
word = (word << 6) | ((byte) bits);
inCount++;
if (inCount % 4 == 0) {
outCount2 = outCount + 1;
out[outCount] = (byte) (word >> 16);
outCount = outCount2 + 1;
out[outCount2] = (byte) (word >> 8);
outCount2 = outCount + 1;
out[outCount] = (byte) word;
pos++;
outCount = outCount2;
}
outCount2 = outCount;
pos++;
outCount = outCount2;
}
int lastWordChars = inCount % 4;
if (lastWordChars == 1) {
outCount2 = outCount;
return null;
}
if (lastWordChars == 2) {
outCount2 = outCount + 1;
out[outCount] = (byte) ((word << 12) >> 16);
} else {
if (lastWordChars == 3) {
word <<= 6;
outCount2 = outCount + 1;
out[outCount] = (byte) (word >> 16);
outCount = outCount2 + 1;
out[outCount2] = (byte) (word >> 8);
}
outCount2 = outCount;
}
if (outCount2 == out.length) {
return out;
}
byte[] prefix = new byte[outCount2];
System.arraycopy(out, 0, prefix, 0, outCount2);
return prefix;
}
public static String encode(byte[] in) {
return encode(in, MAP);
}
public static String encodeUrl(byte[] in) {
return encode(in, URL_MAP);
}
private static String encode(byte[] in, byte[] map) {
int i;
byte[] out = new byte[(((in.length + 2) * 4) / 3)];
int end = in.length - (in.length % 3);
int index = 0;
for (int i2 = 0; i2 < end; i2 += 3) {
i = index + 1;
out[index] = map[(in[i2] & 255) >> 2];
index = i + 1;
out[i] = map[((in[i2] & 3) << 4) | ((in[i2 + 1] & 255) >> 4)];
i = index + 1;
out[index] = map[((in[i2 + 1] & 15) << 2) | ((in[i2 + 2] & 255) >> 6)];
index = i + 1;
out[i] = map[in[i2 + 2] & 63];
}
switch (in.length % 3) {
case um$h.com_facebook_profile_picture_view_com_facebook_is_cropped /*1*/:
i = index + 1;
out[index] = map[(in[end] & 255) >> 2];
index = i + 1;
out[i] = map[(in[end] & 3) << 4];
i = index + 1;
out[index] = (byte) 61;
index = i + 1;
out[i] = (byte) 61;
i = index;
break;
case um$h.com_facebook_login_view_com_facebook_logout_text /*2*/:
i = index + 1;
out[index] = map[(in[end] & 255) >> 2];
index = i + 1;
out[i] = map[((in[end] & 3) << 4) | ((in[end + 1] & 255) >> 4)];
i = index + 1;
out[index] = map[(in[end + 1] & 15) << 2];
index = i + 1;
out[i] = (byte) 61;
break;
}
i = index;
try {
return new String(out, 0, i, "US-ASCII");
} catch (UnsupportedEncodingException e) {
throw new AssertionError(e);
}
}
}
| [
"admin@timo.de.vc"
] | admin@timo.de.vc |
0aa2d14d06c97c57cf1c5b291fdffc8b69d9e56d | 1be624803db2fd74f71596407eb6ea8032505b75 | /Problem 13/Solution.java | 25d2e7adaa547a30a7f0c22a54e14835660e1971 | [] | no_license | Atikul789/Hackerrank_Java_Solution | 1a4cf4613fed8cbe8697aaf93a2ecfdbdb8fbb3d | 9cba82332f629d9500cf1b2c910e374ef57c9879 | refs/heads/master | 2020-06-30T19:52:27.238255 | 2019-08-06T23:02:13 | 2019-08-06T23:02:13 | 200,935,771 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 697 | java | //Complete this code or write your own from scratch
import java.util.*;
import java.io.*;
class Solution{
public static void main(String []argh)
{
Scanner in = new Scanner(System.in);
int n=in.nextInt();
in.nextLine();
Map<String, Integer> phonebook = new HashMap<>();
for(int i=0;i<n;i++)
{
String name=in.nextLine();
int phone=in.nextInt();
in.nextLine();
phonebook.put(name, phone);
}
while(in.hasNext())
{
String s=in.nextLine();
if (phonebook.containsKey(s))
System.out.println(s + "=" +phonebook.get(s));
else
{
System.out.println("Not found");
}
}
}
}
| [
"atikulprogramming@gmail.com"
] | atikulprogramming@gmail.com |
e297f33b73f2868b93408e0ebe54a48e8b3bac6b | ec2deb507e6da0382257ca7d893464cb8a82ea1f | /src/main/java/com/demo/convert/numbers/model/NumberWordMapper.java | b7fa8b3637f358703273c7acea4648ef589e65f1 | [] | no_license | bibhudendumishra/Test | aa23f1d0c5fb503156e081ca6c38fb10c4acbf67 | 81f7c067d3b7d3f60e766e2ba14016f51ae6062a | refs/heads/master | 2021-07-07T07:30:12.966878 | 2019-05-28T13:02:42 | 2019-05-28T13:02:42 | 188,844,941 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,894 | java | package com.demo.convert.numbers.model;
import java.util.HashMap;
import java.util.Map;
/**
* Initializes and returns Word Equivalent
*
*
* @author Bibhu Mishra
*
*/
public class NumberWordMapper {
private static Map<Integer, wordEnum> wordMapper = new HashMap<Integer, wordEnum> ();
private enum wordEnum { ZERO, ONE, TWO, THREE, FOUR, FIVE, SIX, SEVEN, EIGHT, NINE, TEN, ELEVEN, TWELVE,
THIRTEEN, FOURTEEN, FIFTEEN, SIXTEEN, SEVENTEEN, EIGHTEEN, NINTEEN,
TWENTY, THIRTY, FORTY, FIFTY, SIXTY, SEVENTY, EIGHTY, NINTY }
static {
wordMapper.put(0, wordEnum.ZERO);
wordMapper.put(1, wordEnum.ONE);
wordMapper.put(2, wordEnum.TWO);
wordMapper.put(3, wordEnum.THREE);
wordMapper.put(4, wordEnum.FOUR);
wordMapper.put(5, wordEnum.FIVE);
wordMapper.put(6, wordEnum.SIX);
wordMapper.put(7, wordEnum.SEVEN);
wordMapper.put(8, wordEnum.EIGHT);
wordMapper.put(9, wordEnum.NINE);
wordMapper.put(10, wordEnum.TEN);
wordMapper.put(11, wordEnum.ELEVEN);
wordMapper.put(12, wordEnum.TWELVE);
wordMapper.put(13, wordEnum.THIRTEEN);
wordMapper.put(14, wordEnum.FOURTEEN);
wordMapper.put(15, wordEnum.FIFTEEN);
wordMapper.put(16, wordEnum.SIXTEEN);
wordMapper.put(17, wordEnum.SEVENTEEN);
wordMapper.put(18, wordEnum.EIGHTEEN);
wordMapper.put(19, wordEnum.NINTEEN);
wordMapper.put(20, wordEnum.TWENTY);
wordMapper.put(30, wordEnum.THIRTY);
wordMapper.put(40, wordEnum.FORTY);
wordMapper.put(50, wordEnum.FIFTY);
wordMapper.put(60, wordEnum.SIXTY);
wordMapper.put(70, wordEnum.SEVENTY);
wordMapper.put(80, wordEnum.EIGHTY);
wordMapper.put(90, wordEnum.NINTY);
}
public Map<Integer, wordEnum> getWordMapper() {
return wordMapper;
}
public String getWordMapping(int i) {
return wordMapper.get(i).toString();
}
}
| [
"BIBHUDENDUM@HDLBIBHUDENDU.Virtusa.com"
] | BIBHUDENDUM@HDLBIBHUDENDU.Virtusa.com |
8a27d491f4b250d76368a70aae36fa6812ba74c1 | de19ef8df933fcade953f95eeb6c79bf143ee979 | /carParkWeb/src/main/java/com/park/pojo/Record.java | 3fb20e57c6b26625b0924cd4be82d03dc91e9333 | [] | no_license | winborg/Shared-parking-system | ec631fbba636b06b1da2844db7538e1e22f6a13e | f4a3b13349c2a717a86573a3534e2d4ba105ab8b | refs/heads/master | 2023-05-16T19:01:39.284012 | 2021-06-10T01:05:51 | 2021-06-10T01:05:51 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,657 | java | /**
* @Title: Record.java
* @Package com.carsystem.model
* @Description: TODO(用一句话描述该文件做什么)
* @author Administrator
* @date 2020年2月3日
*/
package com.park.pojo;
/**
* @ClassName: Record
* @Description: TODO(这里用一句话描述这个类的作用)
* @author Administrator
* @date 2020年2月3日
*/
public class Record {
private Integer id; //id
private String parkName;//停车场名字
private String location;//停车场位
private String userName;//用户名
private String inTime;//进入时间
private String outTime;//出去时间
private String isCharge;//是否结算
private String charge;//消费
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getParkName() {
return parkName;
}
public void setParkName(String parkName) {
this.parkName = parkName;
}
public String getLocation() {
return location;
}
public void setLocation(String location) {
this.location = location;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getInTime() {
return inTime;
}
public void setInTime(String inTime) {
this.inTime = inTime;
}
public String getOutTime() {
return outTime;
}
public void setOutTime(String outTime) {
this.outTime = outTime;
}
public String getIsCharge() {
return isCharge;
}
public void setIsCharge(String isCharge) {
this.isCharge = isCharge;
}
public String getCharge() {
return charge;
}
public void setCharge(String charge) {
this.charge = charge;
}
}
| [
"18501995007@163.com"
] | 18501995007@163.com |
c79391f36dbb682f4102b400a921c82255967300 | 92f50f398d968ad6c72d841669b73c4a5dee6ba1 | /app/src/main/java/com/chaos/wavedemo/MainActivity.java | 387423cc3f5b690e5d60a47a03dfc5b5e24e7515 | [] | no_license | ChaosOctopus/WaveDemo | 598f66564db78969554371f7723db1168838b460 | 4ce4bd3ebadd0af4b3ee1eb3f4a8ee5b5460c147 | refs/heads/master | 2021-08-11T00:05:32.550757 | 2017-11-13T03:05:09 | 2017-11-13T03:05:09 | 110,493,512 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 878 | java | package com.chaos.wavedemo;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.ImageView;
import static java.lang.Thread.sleep;
public class MainActivity extends AppCompatActivity {
private ImageView iv;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
new Thread(new Runnable() {
@Override
public void run() {
try {
sleep(2000);
Intent intent = new Intent(MainActivity.this,NewActivity.class);
startActivity(intent);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}).start();
}
}
| [
"871479975@qq.com"
] | 871479975@qq.com |
394219da57996f4b4a0a8d361b097cd8403840ec | d968a06d356d43483338bf7778f26f93c8943be7 | /src/test/java/com/ivelum/exceptions/PasswordChangeRequiredExampleException.java | 7e3cb574c34de63e29d6f06b8d4574f5907f23a9 | [
"MIT"
] | permissive | praetoriandigital/cub-java | cd2beb6f495f83653c01022eb07da61bb9c4ab63 | 9b7985710082442a10eb4dfcc3d197ee127c6b45 | refs/heads/master | 2021-06-17T15:03:43.698139 | 2021-03-09T22:19:25 | 2021-03-09T22:19:25 | 180,067,013 | 2 | 2 | MIT | 2020-10-12T18:42:36 | 2019-04-08T04:02:54 | Java | UTF-8 | Java | false | false | 587 | java | package com.ivelum.exceptions;
import com.ivelum.exception.BadRequestException;
import com.ivelum.model.ApiError;
/**
* Example of exception around handling User.login BadRequest exceptions
*/
public class PasswordChangeRequiredExampleException extends BadRequestException {
private String redirectUrl;
public PasswordChangeRequiredExampleException(ApiError err) {
super(err);
this.redirectUrl = err.params.get("redirect");
}
/**
* @return redirect value to the password reset page
*/
public String getRedirectUrl() {
return this.redirectUrl;
}
}
| [
"zadoev@gmail.com"
] | zadoev@gmail.com |
c04ddaacc67bc344e13b4cf871f369f1f5eab40c | 1db26f3be2847a582154062609592791bcc4e224 | /src/sample/zombie.java | 61a77252626a21ef83c6e4f3736b2063b98bca50 | [] | no_license | red0c6777/plantsVsZombie.v1 | 85ec56aa25b5fa96bf077a9e8c1eaec227d36fdc | 4dbef67101dde068d178f8284a2736d5b1727ac3 | refs/heads/master | 2022-05-03T14:47:01.054035 | 2019-12-01T01:19:00 | 2019-12-01T01:19:00 | 218,106,397 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,567 | java | package sample;
import javafx.animation.TranslateTransition;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.layout.Pane;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
import javafx.util.Duration;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.Serializable;
import java.util.Random;
public class zombie implements Serializable {
transient Image image = new Image(new FileInputStream("res//images//zombie//zombieFlying.gif"),114,144,false,false);
transient ImageView imageview = new ImageView(image);
double posX;
double posY;
double resumedPosX;
double resumePosY;
int row;
int health;
double speed;
int type;
transient StackPane zombiePane;
int initialPosX = 1300;
int initialPosY;
public zombie() throws FileNotFoundException {
zombiePane = new StackPane();
posX = this.zombiePane.getLayoutX();
posY = this.zombiePane.getLayoutY();
zombiePane.getChildren().add(imageview);
health = 100;
speed = 0.1;
}
public static zombie zombieSpawner(Pane primaryPane) throws FileNotFoundException {
zombie newZombie = new zombie();
Random rand = new Random();
int randomRow = rand.nextInt(5)+1;
switch(randomRow){
case 1:
newZombie.initialPosY = 78;
newZombie.row = 1;
break;
case 2:
newZombie.initialPosY = 199;
newZombie.row = 2;
break;
case 3:
newZombie.initialPosY = 319;
newZombie.row = 3;
break;
case 4:
newZombie.initialPosY = 440;
newZombie.row = 4;
break;
case 5:
newZombie.initialPosY = 562;
newZombie.row = 5;
break;
}
newZombie.initialPosX = (1280 + rand.nextInt(5000));
newZombie.zombiePane.setLayoutX(newZombie.initialPosX);
newZombie.posX = newZombie.initialPosX;
newZombie.zombiePane.setLayoutY(newZombie.initialPosY);
newZombie.posY = newZombie.initialPosY;
primaryPane.getChildren().add(newZombie.zombiePane);
return newZombie;
}
void dead(Pane primaryPane){
zombiePane.getChildren().remove(imageview);
primaryPane.getChildren().remove(zombiePane);
}
void step(){
this.zombiePane.setLayoutX(this.zombiePane.getLayoutX() - speed);
posX = posX - speed;
}
protected double getPosX(){
return this.posX;
}
protected double getPosY(){
return this.posY;
}
protected double getPos(){
return this.zombiePane.getLayoutY();
}
public Image getImage() {
return image;
}
public void setImage(Image image) {
this.image = image;
}
public ImageView getImageview() {
return imageview;
}
public void setImageview(ImageView imageview) {
this.imageview = imageview;
}
public void setPosX(double posX) {
this.posX = posX;
}
public void setPosY(double posY) {
this.posY = posY;
}
public void setRow(int row) {
this.row = row;
}
public int getHealth() {
return health;
}
public void setHealth(int health) {
this.health = health;
}
public double getSpeed() {
return speed;
}
public void setSpeed(double speed) {
this.speed = speed;
}
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
public StackPane getZombiePane() {
return zombiePane;
}
public void setZombiePane(StackPane zombiePane) {
this.zombiePane = zombiePane;
}
public int getInitialPosX() {
return initialPosX;
}
public void setInitialPosX(int initialPosX) {
this.initialPosX = initialPosX;
}
public int getInitialPosY() {
return initialPosY;
}
public void setInitialPosY(int initialPosY) {
this.initialPosY = initialPosY;
}
public int getRow() {
return this.row;
}
protected void damage(double d) {
this.health -= d;
}
protected void setLayoutX(double px){
this.zombiePane.setLayoutX(px);
}
protected void setLayoutY(double py){
this.zombiePane.setLayoutY(py);
}
}
| [
"harshkumarvc@gmail.com"
] | harshkumarvc@gmail.com |
0c77cb52fe7972df1591bc4ca59800b967fcdcc7 | 97ef1dc4474820ffff9b24a6700baec41e090d1e | /src/main/java/com/whatsmode/custservice/shopify/order/response/LineItem.java | 8fc607f85f9e20fb99148dc9edf41eb66ec88f84 | [] | no_license | peterzhao1981/Shopify-Order-Lookup | 1dd829723fd6ba4410e539545c69e291eb656a6d | b2578153306270148ef43f80f14070b01451ac28 | refs/heads/master | 2020-03-28T00:51:20.282605 | 2018-09-07T09:56:44 | 2018-09-07T09:56:44 | 147,454,930 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 802 | java | package com.whatsmode.custservice.shopify.order.response;
/**
* Created by zhaoweiwei on 2018/9/3.
*/
public class LineItem {
private long id;
private String title;
private String sku;
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getSku() {
return sku;
}
public void setSku(String sku) {
this.sku = sku;
}
@Override
public String toString() {
return "{"
+ "\"id\":" + id
+ ", \"title\":\"" + title + "\""
+ ", \"sku\":\"" + sku + "\""
+ "}";
}
}
| [
"z_w_w@hotmail.com"
] | z_w_w@hotmail.com |
b4466e603f20bf003800237dd5be8738e1c54bbe | 565a1a95a343a01e43aa3026a46da677cb05b4a1 | /2018_fall_semester/Service_Oriented_Computing/Oauth/restServerWithOAuthClient/src/main/java/koreatech/cse/domain/oauth2/facebook/like/Datum.java | 2198c6cf56fa5f9d04c5fffb21b691e4ffee2280 | [] | no_license | younggyu0906/koreatech_class_projects | af31ed35eaa14a1a4977a39cf00603265acaa049 | b97dedcb0bf4a459bbe0b6bb9cf9828552951921 | refs/heads/master | 2021-07-11T07:13:08.184777 | 2019-02-26T09:14:55 | 2019-02-26T09:14:55 | 102,804,792 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,252 | java | package koreatech.cse.domain.oauth2.facebook.like;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import javax.annotation.Generated;
@JsonInclude(JsonInclude.Include.NON_NULL)
@Generated("org.jsonschema2pojo")
@JsonPropertyOrder({
"name",
"id",
"created_time"
})
public class Datum {
@JsonProperty("name")
private String name;
@JsonProperty("id")
private String id;
@JsonProperty("created_time")
private String createdTime;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getCreatedTime() {
return createdTime;
}
public void setCreatedTime(String createdTime) {
this.createdTime = createdTime;
}
@Override
public String toString() {
return "Datum{" +
"name='" + name + '\'' +
", id='" + id + '\'' +
", createdTime='" + createdTime + '\'' +
'}';
}
} | [
"younggyu0906@naver.com"
] | younggyu0906@naver.com |
98ea43750e1877f7dad71141810f42c1e0eaa269 | b3e6d1215ce2b43b6a62852d7d7023bdd7402569 | /app/src/main/java/com/example/inshape/detailVideo.java | 7ace7df940fa98c51f91e7d8716345fed2dfd36c | [] | no_license | pradeeproand/InShape | 4ad879b56249d561e148315c89f03688c8dc42d5 | b8993a01dca721cc2c491c8372abc20f589dfdca | refs/heads/master | 2022-07-07T02:29:55.109291 | 2020-05-14T14:03:16 | 2020-05-14T14:03:16 | 263,930,070 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,359 | java | package com.example.inshape;
import androidx.appcompat.app.AppCompatActivity;
import android.app.ProgressDialog;
import android.media.MediaPlayer;
import android.net.Uri;
import android.os.Bundle;
import android.widget.MediaController;
import android.widget.Toast;
import android.widget.VideoView;
import com.google.android.youtube.player.YouTubeBaseActivity;
import com.google.android.youtube.player.YouTubeInitializationResult;
import com.google.android.youtube.player.YouTubePlayer;
import com.google.android.youtube.player.YouTubePlayerView;
public class detailVideo extends YouTubeBaseActivity implements YouTubePlayer.OnInitializedListener {
YouTubePlayerView youTubePlayer;
String title,video_url;
String youtube_id = "AIzaSyBleyiUrjMdwJ6vU0oIbzMgWZ62f4F5cJ0";
String video_id;
VideoView videoView;
ProgressDialog progressDialog;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_detail_video);
youTubePlayer = (YouTubePlayerView)findViewById(R.id.exercise_video);
progressDialog = new ProgressDialog(this);
title = getIntent().getStringExtra("title");
if(title.equals("20 barbell bicep curl")){video_id = "LY1V6UbRHFM";}
else if(title.equals("20 hammer curl")){video_id = "TwD-YGVP4Bk";}
else if(title.equals("25 diamond pushups")){video_id = "J0DnG1_S92I";}
else if(title.equals("25 close-grip pushups")){video_id = "iFb3DPTWwD8";}
else if(title.equals("15 decline triceps extension")){video_id = "zSxRVoI8ktQ";}
else if(title.equals("15 triceps kickback")){video_id = "m9me06UBPKc";}
else if(title.equals("3 minutes plank")){video_id = "ASdvN_XEl_c";}
else if(title.equals("2 mintues reverse plank")){video_id = "ZNAxdJ6Bt00";}
else if(title.equals("15 dynamic chest streches")){video_id = "urICkMgMrjk";}
else if(title.equals("8 barbell bench press")){video_id = "rT7DgCr-3pg";}
else if(title.equals("10 bench dumbbell press")){video_id = "VmB1G1K7v94";}
else if(title.equals("10 incline barbell bench press")){video_id = "SrqOu55lrYU";}
else if(title.equals("12 incline dumbbell press")){video_id = "0G2_XV7slIg";}
else if(title.equals("15dembbell pullovers")){video_id = "ZhPOEQJRzBU";}
else if(title.equals("20 mountain climbers")){video_id = "nmwgirgXLYM";}
else if(title.equals("10 chest dips")){video_id = "dX_nSOOJIsE";}
else if(title.equals("25 wide pushups")){video_id = "rr6eFNNDQdU";}
else if(title.equals("15 chest shoulder stretches")){video_id = "XMsBC9-vSDs";}
else if(title.equals("20 shoulder rotation")){video_id = "-SKM8uWVG2Y&t=1s";}
else if(title.equals("15 dumbbell incline bench press")){video_id = "8iPEnn-ltC8";}
else if(title.equals("15 dumbbell lateral raise")){video_id = "3VcKaXpzqRo";}
else if(title.equals("10 dumbbell rear latteral raise")){video_id = "Z0HTsZEMedA";}
else if(title.equals("16 dumbell alt latteral raise")){video_id = "MstS-f1EbwU";}
else if(title.equals("15 dumbbell seated shoulder press")){video_id = "qEwKCR5JCog";}
else if(title.equals("10 dumbell standing alt raise")){video_id = "TEs1Kj0itQE";}
else if(title.equals("20 sit-ups")){video_id = "jDwoBqPH0jk";}
else if(title.equals("20 air bikes")){video_id = "i6mPCVUrtNk";}
else if(title.equals("25 crunches")){video_id = "Xyd_fa5zoEU";}
else if(title.equals("15 decline crunches")){video_id = "QhGU5cmNZds";}
else if(title.equals("3 min plank")){video_id = "ASdvN_XEl_c";}
else if(title.equals("10 lying leg raise")){video_id = "JB2oyawG9KI";}
else if(title.equals("2 min side plank")){video_id = "K2VljzCC16g";}
else if(title.equals("20 russian twist")){video_id = "wkD8rjkodUI";}
else if(title.equals("10 V-ups")){video_id = "iP2fjvG0g3w";}
else
{ Toast.makeText(this, "video not found",Toast.LENGTH_SHORT).show(); }
youTubePlayer.initialize(youtube_id, this);
}
/*public void video_view_method(String video_url) {
MediaController mediaController = new MediaController(this);
mediaController.setAnchorView(videoView);
progressDialog.setMessage("Buffering video please wait");
progressDialog.show();
videoView.setMediaController(mediaController);
videoView.setVideoURI(Uri.parse(video_url));
videoView.requestFocus();
videoView.start();
videoView.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
@Override
public void onPrepared(MediaPlayer mp) {
progressDialog.dismiss();
}
});
progressDialog.dismiss();
}*/
@Override
public void onInitializationSuccess(YouTubePlayer.Provider provider, YouTubePlayer youTubePlayer, boolean video_present) {
if(!video_present)
{
youTubePlayer.cueVideo(video_id);
youTubePlayer.play();
}
}
@Override
public void onInitializationFailure(YouTubePlayer.Provider provider, YouTubeInitializationResult youTubeInitializationResult) {
Toast.makeText(this, "no video uploaded", Toast.LENGTH_SHORT).show();
}
}
| [
"pradeeproand@users.noreply.github.com"
] | pradeeproand@users.noreply.github.com |
3a28feddec97f67abae7c6544f9e27faafaff65d | 1d3b3c652d79f201e09d1843cec338e1f3292bb9 | /Rake Project/mobile/Rake/gen/com/example/rake/BuildConfig.java | 564faa207024b34d27304fa23a26766f06c5b05f | [] | no_license | anthonysuanschool/ict249 | bd8ba1014e146eed74f7ca5d5fc9a217760c0825 | 4d6166b18b5c7d5f3cc55a49d71031380896c474 | refs/heads/master | 2016-09-05T18:20:41.335844 | 2013-10-04T07:25:59 | 2013-10-04T07:25:59 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 158 | java | /** Automatically generated file. DO NOT MODIFY */
package com.example.rake;
public final class BuildConfig {
public final static boolean DEBUG = true;
} | [
"school@anthonysuan.com"
] | school@anthonysuan.com |
3fe835b06d252726e0ad1299b099d43797c2dceb | e635fb4ec1a29afd113145531e661eb644ea84ce | /inference-framework/checker-framework/checkers/inference-tests/swift/src/webil/ui/CheckBox.java | 78bec0bc1edf66d0578142349c54bfb331eb4e8c | [] | no_license | flankerhqd/type-inference | 82f4538db3dd46021403cd3867faab2ee09aa6e3 | 437af6525c050bb6689d8626e696d14cb6742cbf | refs/heads/master | 2016-08-04T00:38:21.756067 | 2015-05-04T03:10:56 | 2015-05-04T03:10:56 | 35,372,790 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,099 | java | package webil.ui;
public class CheckBox extends ClickableWidget
{
public CheckBox(String text) {
super();
setText(text);
}
public CheckBox(String id, String text) {
super(id);
setText(text);
}
protected void initWidget() {
this.widgetImpl = new CheckBoxImpl(this);
}
public String getText() {
CheckBoxImpl b = (CheckBoxImpl)widgetImpl;
return b.getText();
}
public void setText(String text) {
CheckBoxImpl b = (CheckBoxImpl)widgetImpl;
b.setText(text);
}
public boolean isChecked() {
CheckBoxImpl b = (CheckBoxImpl)widgetImpl;
return b.isChecked();
}
public boolean isEnabled() {
CheckBoxImpl b = (CheckBoxImpl)widgetImpl;
return b.isEnabled();
}
public void setChecked(boolean check) {
CheckBoxImpl b = (CheckBoxImpl)widgetImpl;
b.setChecked(check);
}
public void setEnabled(boolean enable) {
CheckBoxImpl b = (CheckBoxImpl)widgetImpl;
b.setChecked(enable);
}
}
| [
"dongyao83@gmail.com@e039eaa7-eea3-5927-096b-721137851c37"
] | dongyao83@gmail.com@e039eaa7-eea3-5927-096b-721137851c37 |
f53c2529e0048457cbba36e02643b4cd0bae0882 | 629970dbccfdd11c120321ed212a6df3da11dd45 | /src/test/java/test/mainpage/MenuBarTest.java | 49e4cfc5146edae8f4d18f986b7cd5515ab259a1 | [] | no_license | viktoriakachuk/selenium-recruiting | cce0fb55cb2eaa58a944b8028da634d048939213 | 725e91850787031f4f811694d31b5aa7df38298c | refs/heads/master | 2020-03-07T23:31:58.413876 | 2018-04-16T08:02:16 | 2018-04-16T08:02:16 | 127,783,912 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,361 | java | package test.mainpage;
import driver.WebDriverSingleton;
import io.qameta.allure.*;
import io.qameta.allure.junit4.DisplayName;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import test.Login;
import web.page.LoginPage;
import web.page.MenuBarPage;
import java.awt.*;
import java.io.IOException;
import static helper.Helper.closeBrowser;
public class MenuBarTest extends Login {
private WebDriver driver = WebDriverSingleton.getInstance();
MenuBarPage mbp = new MenuBarPage();
@Before
public void doLoginAsRecruiter(){
super.login("recruiter");
};
@Test
@DisplayName("Переход на главную страницу")
@Description("Переход на главную страницу")
@Feature("Меню")
@Story("Сценарий 1 – Навигация по меню")
@Severity(SeverityLevel.NORMAL)
public void loadHomePageFromMenuBar(){
mbp.clickHomeButton();
Assert.assertEquals("Главная - Конструктор Талантов",driver.getTitle());
}
@Test
@DisplayName("Переход на страницу подбор и адаптация")
@Description("Переход на страницу подбор и адаптация")
@Feature("Меню")
@Story("Сценарий 1 – Навигация по меню")
@Severity(SeverityLevel.NORMAL)
public void loadRecruitingPageFromMenuBar(){
mbp.clickRecruitingButton();
Assert.assertEquals("Подбор и адаптация - Конструктор Талантов",driver.getTitle());
}
@Test
@DisplayName("Переход на страницу справочники")
@Description("Переход на страницу справочники")
@Feature("Меню")
@Story("Сценарий 1 – Навигация по меню")
@Severity(SeverityLevel.NORMAL)
public void loadDirectoriesPageFromMenuBar(){
mbp.clickDirectoriesButton();
Assert.assertEquals("Справочники - Конструктор Талантов",driver.getTitle());
}
@After
public void shutDown() throws IOException {
closeBrowser();
}
}
| [
"viktoriagd38@gmail.com"
] | viktoriagd38@gmail.com |
be18ccb3c1073373a1e0bde4753717007adf12e8 | be73270af6be0a811bca4f1710dc6a038e4a8fd2 | /crash-reproduction-moho/results/XWIKI-13942-2-1-NSGA_II-LineCoverage:ExceptionType:StackTraceSimilarity/org/xwiki/model/internal/reference/AbstractEntityReferenceResolver_ESTest.java | b592c5a8bece82b708d093eef635342d5c182244 | [] | no_license | STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application | cf118b23ecb87a8bf59643e42f7556b521d1f754 | 3bb39683f9c343b8ec94890a00b8f260d158dfe3 | refs/heads/master | 2022-07-29T14:44:00.774547 | 2020-08-10T15:14:49 | 2020-08-10T15:14:49 | 285,804,495 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,103 | java | /*
* This file was automatically generated by EvoSuite
* Sun Apr 05 13:44:29 UTC 2020
*/
package org.xwiki.model.internal.reference;
import org.junit.Test;
import static org.junit.Assert.*;
import static org.evosuite.runtime.EvoAssertions.*;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.junit.runner.RunWith;
import org.xwiki.model.EntityType;
import org.xwiki.model.internal.reference.ExplicitStringEntityReferenceResolver;
@RunWith(EvoRunner.class) @EvoRunnerParameters(useVFS = true, useJEE = true)
public class AbstractEntityReferenceResolver_ESTest extends AbstractEntityReferenceResolver_ESTest_scaffolding {
@Test(timeout = 4000)
public void test0() throws Throwable {
ExplicitStringEntityReferenceResolver explicitStringEntityReferenceResolver0 = new ExplicitStringEntityReferenceResolver();
EntityType entityType0 = EntityType.OBJECT;
Object[] objectArray0 = new Object[0];
// Undeclared exception!
explicitStringEntityReferenceResolver0.resolveDefaultReference(entityType0, objectArray0);
}
}
| [
"pouria.derakhshanfar@gmail.com"
] | pouria.derakhshanfar@gmail.com |
1a2b60ccb7f2d4303935b70f35d64d6fdc8aba67 | ed107eefd4714aac8f3c34acacc2bcc7b582c24b | /src/main/java/com/wolf/concurrenttest/threadpool/MyTask1.java | c5b7987427f4a0095e7275f0b192f76afe865fbf | [] | no_license | liyork/concurrenttest | 07a7a14546b473e65e372941ebe1a444251747c6 | 5da7b5d4a0551ea7c39e0d86a8fca991b682efb0 | refs/heads/master | 2022-10-22T11:02:45.490207 | 2021-09-28T14:06:29 | 2021-09-28T14:06:29 | 167,670,022 | 0 | 2 | null | 2022-10-05T00:08:53 | 2019-01-26T09:08:17 | Java | UTF-8 | Java | false | false | 692 | java | package com.wolf.concurrenttest.threadpool;
import java.util.Random;
import java.util.concurrent.Callable;
/**
* <p> Description:
* <p/>
* Date: 2016/6/23
* Time: 11:51
*
* @author 李超
* @version 1.0
* @since 1.0
*/
public class MyTask1 implements Callable<Boolean> {
@Override
public Boolean call() throws Exception {
System.out.println(Thread.currentThread().getName() + " is in call");
Random random = new Random();
// 总计耗时约10秒
for(int i = 0; i < 10L; i++) {
int millis = random.nextInt(5000);
Thread.sleep(millis);
System.out.print('-');
}
return Boolean.TRUE;
}
} | [
"lichao27270891@163.com"
] | lichao27270891@163.com |
e212475222eb2c4a2a2f0bd95b138201f481f631 | d5515553d071bdca27d5d095776c0e58beeb4a9a | /src/net/sourceforge/plantuml/ugraphic/AbstractUGraphic.java | 94800e509706771abc2ce6442b7ee09f876c85d8 | [] | no_license | ccamel/plantuml | 29dfda0414a3dbecc43696b63d4dadb821719489 | 3100d49b54ee8e98537051e071915e2060fe0b8e | refs/heads/master | 2022-07-07T12:03:37.351931 | 2016-12-14T21:01:03 | 2016-12-14T21:01:03 | 77,067,872 | 1 | 0 | null | 2022-05-30T09:56:21 | 2016-12-21T16:26:58 | Java | UTF-8 | Java | false | false | 2,806 | java | /* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* (C) Copyright 2009-2017, Arnaud Roques
*
* Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
* PlantUML is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* PlantUML distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
* License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
* USA.
*
*
* Original Author: Arnaud Roques
*
*
*/
package net.sourceforge.plantuml.ugraphic;
import java.util.HashMap;
import java.util.Map;
public abstract class AbstractUGraphic<O> extends AbstractCommonUGraphic {
private final O g2d;
private final Map<Class<? extends UShape>, UDriver<O>> drivers = new HashMap<Class<? extends UShape>, UDriver<O>>();
public AbstractUGraphic(ColorMapper colorMapper, O g2d) {
super(colorMapper);
this.g2d = g2d;
}
protected AbstractUGraphic(AbstractUGraphic<O> other) {
super(other);
this.g2d = other.g2d;
// this.drivers.putAll(other.drivers);
}
protected final O getGraphicObject() {
return g2d;
}
protected boolean manageHiddenAutomatically() {
return true;
}
final protected void registerDriver(Class<? extends UShape> cl, UDriver<O> driver) {
this.drivers.put(cl, driver);
}
public final void draw(UShape shape) {
if (shape instanceof UEmpty) {
return;
}
if (shape instanceof UComment) {
drawComment((UComment) shape);
return;
}
final UDriver<O> driver = drivers.get(shape.getClass());
if (driver == null) {
throw new UnsupportedOperationException(shape.getClass().toString() + " " + this.getClass());
}
if (getParam().isHidden() && manageHiddenAutomatically()) {
return;
}
beforeDraw();
if (shape instanceof Scalable) {
final double scale = getParam().getScale();
shape = ((Scalable) shape).getScaled(scale);
driver.draw(shape, getTranslateX(), getTranslateY(), getColorMapper(), getParam(), g2d);
} else {
driver.draw(shape, getTranslateX(), getTranslateY(), getColorMapper(), getParam(), g2d);
}
afterDraw();
}
protected void drawComment(UComment shape) {
}
protected void beforeDraw() {
}
protected void afterDraw() {
}
}
| [
"plantuml@gmail.com"
] | plantuml@gmail.com |
988d4c328f9365f9c27500a3acfa0793d6d2d96d | 34b713d69bae7d83bb431b8d9152ae7708109e74 | /common/src/main/java/org/broadleafcommerce/common/copy/MultiTenantCopierExtensionManager.java | 8c7b4e21270f01341ef0bf85eef5e74c5aad9c1e | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | sinotopia/BroadleafCommerce | d367a22af589b51cc16e2ad094f98ec612df1577 | 502ff293d2a8d58ba50a640ed03c2847cb6369f6 | refs/heads/BroadleafCommerce-4.0.x | 2021-01-23T14:14:45.029362 | 2019-07-26T14:18:05 | 2019-07-26T14:18:05 | 93,246,635 | 0 | 0 | null | 2017-06-03T12:27:13 | 2017-06-03T12:27:13 | null | UTF-8 | Java | false | false | 1,355 | java | /*
* #%L
* BroadleafCommerce Common Libraries
* %%
* Copyright (C) 2009 - 2014 Broadleaf Commerce
* %%
* 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.
* #L%
*/
package org.broadleafcommerce.common.copy;
import org.broadleafcommerce.common.extension.ExtensionManager;
import org.springframework.stereotype.Service;
@Service("blMultiTenantCopierExtensionManager")
public class MultiTenantCopierExtensionManager extends ExtensionManager<MultiTenantCopierExtensionHandler> {
public MultiTenantCopierExtensionManager() {
super(MultiTenantCopierExtensionHandler.class);
}
/**
* By default,this extension manager will continue on handled allowing multiple handlers to interact with the order.
*/
public boolean continueOnHandled() {
return true;
}
}
| [
"sinosie7en@gmail.com"
] | sinosie7en@gmail.com |
e95a4acbe80a9ffa6fca3973caf927d7be67a5c9 | c546b4fa6fb8c58ed6489bc9f48c88cb11f4a9ef | /RecyclerViewBlues/app/src/main/java/com/gmail/gosnellwebdesign/recyclerviewblues/HockeyTeamAdapter.java | e52861de8adb86dbc2f27dfd1eeb9542971ebddd | [] | no_license | lukegosnellranken/AllAndroidProjects | 897a7e34592a3028b2450cc19b93d2240948c9cc | 3aa7266b85a46ba45b1a1d655c0b0ec4d604e952 | refs/heads/master | 2023-06-21T16:44:27.161687 | 2021-07-22T01:53:02 | 2021-07-22T01:53:02 | 245,257,274 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,768 | java | package com.gmail.gosnellwebdesign.recyclerviewblues;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.recyclerview.widget.RecyclerView;
import java.util.List;
//The HockeyTeam class is responsible for creating
//the ViewHolder objects and also for binding the data to them.
//NOTE:This class extends the RecyclerView.Adapter class and manages
//the ViewHold objects
public class HockeyTeamAdapter extends RecyclerView.Adapter<HockeyTeamAdapter.ViewHolder>{
public List<HockeyTeam> teamList;
//Full-Arg constructor
//The adapter is responsible for creating the ViewHolder objects as needed
//It also creates new viewHolder objects as the user scrolls through the list of items
public HockeyTeamAdapter(List<HockeyTeam> bluesTeamList){
teamList = bluesTeamList;
}
//Note: There are three methods that must be overridden when using the adapter. They are shown below.
//Also: It is customary to define the ViewHolder class inside of the adapter class. This inner class
//initializes the textViews
public class ViewHolder extends RecyclerView.ViewHolder {
TextView tvName;
TextView tvPositionPlayed;
TextView tvNumber;
//Full-Arg Constructor
public ViewHolder(View itemView) {
super(itemView);
tvName = itemView.findViewById(R.id.tvName);
tvPositionPlayed = itemView.findViewById(R.id.tvPositionPlayed);
tvNumber = itemView.findViewById(R.id.tvNumber);
}
}
//The onCreateViewHolder() method is used for creating the ViewHolder and inflating the layout
//created earlier inside it
public HockeyTeamAdapter.ViewHolder onCreateViewHolder(
ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext()).inflate(
R.layout.row, parent, false);
return new ViewHolder(view);
}
//The onBinderViewHolder() method is used to bind the data to
//the ViewHolder. It determines the data that needs to be
//displayed based on the list position. It is populated by the ViewHolder
@Override
public void onBindViewHolder(HockeyTeamAdapter.ViewHolder holder, int position){
holder.tvName.setText(teamList.get(position).getName());
holder.tvPositionPlayed.setText(teamList.get(position).getPositionPlayed());
holder.tvNumber.setText(teamList.get(position).getNumber());
}
//The getItemCount() method returns the size of the dataset,
//i.e. the number of items in the dataset
@Override
public int getItemCount(){
return teamList.size();
}
} //End public class HockeyTeamAdapter
| [
"luke_gosnell@ranken.edu"
] | luke_gosnell@ranken.edu |
ae3a3d5a592ee6f785e7a70d095060792ca39209 | fd18820b40f576c062ad4dd790f925e5ca7b01e1 | /OntoPlay/app/messages/SendJobExecutionConditionsMessage.java | 26591eeb9fde09b1d554ed90c91cbd5cbcbea510 | [] | no_license | malagus/OntoPlay | ae5273efb6ffc056a0dcdf5d98cb95f0ccb89cd5 | 09721fa62ba28b828d4eeb36b4262530a3310c7f | refs/heads/master | 2021-01-18T13:35:57.190703 | 2015-01-08T20:47:13 | 2015-01-08T20:47:13 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 781 | java | package messages;
import conf.Config;
import jade.core.AID;
import jade.lang.acl.ACLMessage;
import agent.ACLBaseMessage;
public class SendJobExecutionConditionsMessage extends ACLBaseMessage {
private String contractDescriptionOWL;
public SendJobExecutionConditionsMessage(String contractDescriptionOWL, String recipientAID) {
super(recipientAID);
this.contractDescriptionOWL = contractDescriptionOWL;
}
@Override
protected ACLMessage createMessage() {
ACLMessage message = new ACLMessage(ACLMessage.REQUEST);
//TODO: Use Pawel's library in some way to send the OWL description of the resource looking for teams to join.
message.setContent(contractDescriptionOWL);
message.setOntology(Config.GUIOntology);
return message;
}
}
| [
"drozd@aee9c372-37dd-4c14-8de0-c3efb7df3e6b"
] | drozd@aee9c372-37dd-4c14-8de0-c3efb7df3e6b |
1bf3adfa850dd3c19f04255792be1c89847e8949 | d5b8084532ab76c1a75d311375427cf73a22ecd8 | /src/main/java/com/epmweb/server/domain/BuyingGroups.java | 8448f52b45b4ae8aa5a8197e1a27fb9912454c2e | [] | no_license | thetlwinoo/epm-web | 4959f71e2766284f53e29eaf892467822bc6493b | ae6e41fc4df0767301909e536c30f63f58d8a489 | refs/heads/master | 2022-12-21T15:44:42.018331 | 2020-03-27T11:44:53 | 2020-03-27T11:44:53 | 250,519,805 | 1 | 1 | null | 2022-12-16T04:42:45 | 2020-03-27T11:43:54 | Java | UTF-8 | Java | false | false | 2,593 | java | package com.epmweb.server.domain;
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;
/**
* A BuyingGroups.
*/
@Entity
@Table(name = "buying_groups")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public class BuyingGroups implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sequenceGenerator")
@SequenceGenerator(name = "sequenceGenerator")
private Long id;
@Column(name = "name")
private String name;
@NotNull
@Column(name = "valid_from", nullable = false)
private Instant validFrom;
@NotNull
@Column(name = "valid_to", nullable = false)
private Instant validTo;
// 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 getName() {
return name;
}
public BuyingGroups name(String name) {
this.name = name;
return this;
}
public void setName(String name) {
this.name = name;
}
public Instant getValidFrom() {
return validFrom;
}
public BuyingGroups validFrom(Instant validFrom) {
this.validFrom = validFrom;
return this;
}
public void setValidFrom(Instant validFrom) {
this.validFrom = validFrom;
}
public Instant getValidTo() {
return validTo;
}
public BuyingGroups validTo(Instant validTo) {
this.validTo = validTo;
return this;
}
public void setValidTo(Instant validTo) {
this.validTo = validTo;
}
// jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof BuyingGroups)) {
return false;
}
return id != null && id.equals(((BuyingGroups) o).id);
}
@Override
public int hashCode() {
return 31;
}
@Override
public String toString() {
return "BuyingGroups{" +
"id=" + getId() +
", name='" + getName() + "'" +
", validFrom='" + getValidFrom() + "'" +
", validTo='" + getValidTo() + "'" +
"}";
}
}
| [
"thetlwinoo85@yahoo.com"
] | thetlwinoo85@yahoo.com |
c48b74a77a0fc75d5a91cf052d9feccebfc548d0 | 7bd91222d410aa2178bdf10f5aef6114b6e1897f | /TV/tests/unit/src/com/android/tv/recommendation/ChannelRecordTest.java | bf8fecdeaf25dffe76dbb5f663a80d2025d09770 | [
"Apache-2.0"
] | permissive | huimingli/androidsourccode | 657c53c26dbdf7e22754e8e8634f5899bf45edb7 | 74eeb77e12de91e1f14f582a64b550c5f7c33a19 | refs/heads/master | 2021-04-29T09:48:29.403003 | 2016-12-30T02:55:09 | 2016-12-30T02:55:09 | 77,655,025 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,163 | java | /*
* Copyright (C) 2015 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.tv.recommendation;
import android.test.AndroidTestCase;
import android.test.suitebuilder.annotation.SmallTest;
import com.android.tv.testing.Utils;
import java.util.Random;
import java.util.concurrent.TimeUnit;
/**
* Unit tests for {@link ChannelRecord}.
*/
@SmallTest
public class ChannelRecordTest extends AndroidTestCase {
private static final int CHANNEL_RECORD_MAX_HISTORY_SIZE = ChannelRecord.MAX_HISTORY_SIZE;
private Random mRandom;
private ChannelRecord mChannelRecord;
private long mLatestWatchEndTimeMs;
@Override
public void setUp() throws Exception {
super.setUp();
mLatestWatchEndTimeMs = System.currentTimeMillis() - TimeUnit.DAYS.toMillis(1);
mChannelRecord = new ChannelRecord(getContext(), null, false);
mRandom = Utils.createTestRandom();
}
public void testGetLastWatchEndTime_noHistory() {
assertEquals(0, mChannelRecord.getLastWatchEndTimeMs());
}
public void testGetLastWatchEndTime_oneHistory() {
addWatchLog();
assertEquals(mLatestWatchEndTimeMs, mChannelRecord.getLastWatchEndTimeMs());
}
public void testGetLastWatchEndTime_maxHistories() {
for (int i = 0; i < CHANNEL_RECORD_MAX_HISTORY_SIZE; ++i) {
addWatchLog();
}
assertEquals(mLatestWatchEndTimeMs, mChannelRecord.getLastWatchEndTimeMs());
}
public void testGetLastWatchEndTime_moreThanMaxHistories() {
for (int i = 0; i < CHANNEL_RECORD_MAX_HISTORY_SIZE + 1; ++i) {
addWatchLog();
}
assertEquals(mLatestWatchEndTimeMs, mChannelRecord.getLastWatchEndTimeMs());
}
public void testGetTotalWatchDuration_noHistory() {
assertEquals(0, mChannelRecord.getTotalWatchDurationMs());
}
public void testGetTotalWatchDuration_oneHistory() {
long durationMs = addWatchLog();
assertEquals(durationMs, mChannelRecord.getTotalWatchDurationMs());
}
public void testGetTotalWatchDuration_maxHistories() {
long totalWatchTimeMs = 0;
for (int i = 0; i < CHANNEL_RECORD_MAX_HISTORY_SIZE; ++i) {
long durationMs = addWatchLog();
totalWatchTimeMs += durationMs;
}
assertEquals(totalWatchTimeMs, mChannelRecord.getTotalWatchDurationMs());
}
public void testGetTotalWatchDuration_moreThanMaxHistories() {
long totalWatchTimeMs = 0;
long firstDurationMs = 0;
for (int i = 0; i < CHANNEL_RECORD_MAX_HISTORY_SIZE + 1; ++i) {
long durationMs = addWatchLog();
totalWatchTimeMs += durationMs;
if (i == 0) {
firstDurationMs = durationMs;
}
}
// Only latest CHANNEL_RECORD_MAX_HISTORY_SIZE logs are remained.
assertEquals(totalWatchTimeMs - firstDurationMs, mChannelRecord.getTotalWatchDurationMs());
}
/**
* Add new log history to channelRecord which its duration is lower than 1 minute.
*
* @return New watch log's duration time in milliseconds.
*/
private long addWatchLog() {
// Time hopping with random seconds.
mLatestWatchEndTimeMs += TimeUnit.SECONDS.toMillis(mRandom.nextInt(60) + 1);
long durationMs = TimeUnit.SECONDS.toMillis(mRandom.nextInt(60) + 1);
mChannelRecord.logWatchHistory(new WatchedProgram(null,
mLatestWatchEndTimeMs, mLatestWatchEndTimeMs + durationMs));
mLatestWatchEndTimeMs += durationMs;
return durationMs;
}
}
| [
"1573717522@qq.com"
] | 1573717522@qq.com |
e6d21787355d7a9e2e93096fbe26034fbb29d3c4 | b5cbcf4d6defc84667ab5ee01fc7b1fe06276726 | /app/src/main/java/me/ele/example/ref/RefUser.java | 659d476becfc59616703d0854765e23f7e09f0ac | [
"Apache-2.0"
] | permissive | cizkey/Intimate | 75429f5eb491b34800f1019687ce70d123d34f7e | f54c31678e6a25f1fdd3acf45a15b49bc72d6ddc | refs/heads/master | 2020-05-26T21:54:54.050432 | 2018-01-15T09:16:52 | 2018-01-15T09:16:52 | 188,388,521 | 1 | 0 | null | 2019-05-24T08:57:31 | 2019-05-24T08:57:31 | null | UTF-8 | Java | false | false | 815 | java | package me.ele.example.ref;
import me.ele.example.lib.User;
import me.ele.intimate.annotation.GetField;
import me.ele.intimate.annotation.Method;
import me.ele.intimate.annotation.RefTarget;
import me.ele.intimate.annotation.SetField;
/**
* Created by lizhaoxuan on 2017/12/18.
*/
@RefTarget(clazz = User.class, optimizationRef = true)
public interface RefUser {
@Method
void setAge(int a, int b);
@GetField("name")
String getName();
@SetField("name")
void setName(String value);
@SetField("age")
void setName(int value);
@GetField("sex")
String getSex();
@GetField("age")
int getAge();
@SetField("sex")
void setSexRef(String sex);
@Method
String getAgeStr();
@Method
String getSexStr();
@Method
String getClassName();
}
| [
"zhaoxuan.li@ele.me"
] | zhaoxuan.li@ele.me |
bb6ddde9e8bae94e805332aaaad8eeb51dd8a8e7 | 2e59fdd393bcac77d34d2e3b3d67905a4f290fe9 | /src/main/java/com/pm/repository/FileRepository.java | bbcaa53800e33ddb4eda29d06bf95c4f0de16812 | [] | no_license | ngoctungg/dictionary-demo | 211142e0da6d6032f7dc0421ca6c49981f428b18 | dd445e5d976ee4d86d50b0ef7552f569fc8db5ec | refs/heads/main | 2023-01-13T12:30:22.545669 | 2020-11-11T13:54:32 | 2020-11-11T13:54:32 | 305,391,345 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 535 | java | package com.pm.repository;
import com.pm.entity.FileEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import java.util.List;
import java.util.Optional;
public interface FileRepository extends JpaRepository<FileEntity, Integer> {
Optional<FileEntity> findByIdAndPost_Id(Integer id, Integer postId);
@Query("select f from FileEntity f where f.id in :ids and f.post.id = :postId")
List<FileEntity> getAllByIds(List<Integer> ids, Integer postId);
}
| [
"m.ngoctung@gmail.com"
] | m.ngoctung@gmail.com |
2f107d84113f20451dd3312d375fd3a001fb3985 | 8cd562fb015d3e2e48260c87ca8314cf2da5b551 | /GenericiteService/src/domaine/Personne.java | 44b722e97df3e2327c77025e93a467099bfd8f78 | [] | no_license | kamiroudj/GenericiteService | 8cd7f3c5bb439351305d572c3fe4a172a58418c1 | aa9c20115b778f7abe332c3f9e21f8bec44759e8 | refs/heads/master | 2020-03-19T00:05:39.723773 | 2018-05-30T20:45:46 | 2018-05-30T20:45:46 | 135,452,577 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,642 | java | package domaine;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
public class Personne {
private int IdPersonne;
private String nom;
private String prenom;
private int age;
private Login login;
private Collection<Compte> comptes = new HashSet<Compte>();
private Collection<Club> clubs = new ArrayList<Club>();
// ************* CONSTRUCTEURS ************* //
/**
* @param idPersonne
* @param nom
* @param prenom
* @param age
*/
public Personne(int idPersonne, String nom, String prenom, int age) {
super();
IdPersonne = idPersonne;
this.nom = nom;
this.prenom = prenom;
this.age = age;
}
/**
*
*/
public Personne() {
super();
// TODO Auto-generated constructor stub
}
// ************* GETTERS & SETTERS ************* //
/**
* @return the idPersonne
*/
public int getIdPersonne() {
return IdPersonne;
}
/**
* @return the login
*/
public Login getLogin() {
return login;
}
/**
* @param login the login to set
*/
public void setLogin(Login login) {
this.login = login;
}
/**
* @return the comptes
*/
public Collection<Compte> getComptes() {
return comptes;
}
/**
* @param comptes the comptes to set
*/
public void setComptes(Collection<Compte> comptes) {
this.comptes = comptes;
}
/**
* @return the clubs
*/
public Collection<Club> getClubs() {
return clubs;
}
/**
* @param clubs the clubs to set
*/
public void setClubs(Collection<Club> clubs) {
this.clubs = clubs;
}
/**
* @param idPersonne the idPersonne to set
*/
public void setIdPersonne(int idPersonne) {
IdPersonne = idPersonne;
}
/**
* @return the nom
*/
public String getNom() {
return nom;
}
/**
* @param nom the nom to set
*/
public void setNom(String nom) {
this.nom = nom;
}
/**
* @return the prenom
*/
public String getPrenom() {
return prenom;
}
/**
* @param prenom the prenom to set
*/
public void setPrenom(String prenom) {
this.prenom = prenom;
}
/**
* @return the age
*/
public int getAge() {
return age;
}
/**
* @param age the age to set
*/
public void setAge(int age) {
this.age = age;
}
@Override
public String toString() {
return "Personne [IdPersonne=" + IdPersonne + ", nom=" + nom + ", prenom=" + prenom + ", age=" + age + "]";
}
} | [
"kamirelsisi2017@gmail.com"
] | kamirelsisi2017@gmail.com |
cf14b7869a85c4eab4b0e64de756226b2aaf7d1e | 945c93a7b28b548b9540aaedf88d18bfca4fef3e | /src/main/java/com/ssafy/study_with_us/config/DatabaseConfig.java | 3c0b6bd5718ac49bc87128f6db7107efdf989f2e | [] | no_license | alb7979s/study_with_us | 71018686ea1a8eb35a7a2d0e69b23e1e34df0445 | a1232184d00639dc64041aae6572c069a0397de3 | refs/heads/main | 2023-08-24T02:49:04.034035 | 2021-10-20T09:41:13 | 2021-10-20T09:41:13 | 387,488,635 | 1 | 1 | null | 2021-07-23T02:32:14 | 2021-07-19T14:15:46 | Java | UTF-8 | Java | false | false | 607 | java | package com.ssafy.study_with_us.config;
import com.querydsl.jpa.impl.JPAQueryFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
@EnableJpaAuditing
@Configuration
public class DatabaseConfig {
@PersistenceContext
private EntityManager entityManager;
@Bean
public JPAQueryFactory jpaQueryFactory(){
return new JPAQueryFactory(entityManager);
}
}
| [
"alb7979s@naver.com"
] | alb7979s@naver.com |
d9cd1f60e6c154aa710f32e3386e5419acbeae41 | e1e305a479ea298e464e7e5aa14f4c691abc7a78 | /syj-videos-dev-pojo/src/main/java/com/syj/pojo/Bgm.java | 45b9dc6d888810a3a7a7e709ad32b986a8e3ebcf | [] | no_license | shenyoujian/hsyj-video-dev | 21d3592e2d04a5f691e06914a57ace87fc4c5402 | 9b395ce3138b8e5e8330a659196fbb5e2c7120fb | refs/heads/master | 2020-03-28T06:13:54.627659 | 2018-09-21T07:50:37 | 2018-09-21T07:50:37 | 147,821,947 | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 1,117 | java | package com.syj.pojo;
import javax.persistence.*;
public class Bgm {
@Id
private String id;
private String author;
private String name;
/**
* 播放地址
*/
private String path;
/**
* @return id
*/
public String getId() {
return id;
}
/**
* @param id
*/
public void setId(String id) {
this.id = id;
}
/**
* @return author
*/
public String getAuthor() {
return author;
}
/**
* @param author
*/
public void setAuthor(String author) {
this.author = author;
}
/**
* @return name
*/
public String getName() {
return name;
}
/**
* @param name
*/
public void setName(String name) {
this.name = name;
}
/**
* 获取播放地址
*
* @return path - 播放地址
*/
public String getPath() {
return path;
}
/**
* 设置播放地址
*
* @param path 播放地址
*/
public void setPath(String path) {
this.path = path;
}
} | [
"shenyoujian2.163.com"
] | shenyoujian2.163.com |
a10e3f4da59f855760f925ba6e42e0b7b7f35e0e | f706385f54d5ab1e7c2b7f02f6abcf104653e719 | /src/main/demo/com/newtouch/cloud/demo/server/action/DataAccessDemo1Action.java | 7922a6e15e975ee9d2d75d9fe15126aa9378e9c1 | [] | no_license | zw-james/shzy | 0301420a4c064d224008d5e6c7c5192f7f3d97ef | a97046b8e2d3aed0507039c711b586e9cc997afc | refs/heads/master | 2020-04-11T16:09:15.878762 | 2018-12-17T07:18:21 | 2018-12-17T07:18:21 | 161,914,682 | 1 | 1 | null | 2018-12-17T07:18:22 | 2018-12-15T14:50:34 | HTML | UTF-8 | Java | false | false | 3,563 | java | package com.newtouch.cloud.demo.server.action;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import com.newtouch.cloud.common.ActionResultUtil;
import com.newtouch.cloud.common.EntityUtil;
import com.newtouch.cloud.common.entity.ActionResult;
import com.newtouch.cloud.common.entity.ConditionMap;
import com.newtouch.cloud.common.entity.EntityMap;
import com.newtouch.cloud.common.entity.PageData;
import com.newtouch.cloud.demo.server.bp.DataAccessDemo1BP;
import com.newtouch.cloud.demo.ui.entity.DemoCityEntity;
@Controller
@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
@RequestMapping("/demo/server/da1")
public class DataAccessDemo1Action
{
@Autowired
private DataAccessDemo1BP bp;
@RequestMapping("/list/entity")
@ResponseBody
public ActionResult getEntityList(@RequestParam String jsonCondition)
{
try
{
ConditionMap cdtMap = new ConditionMap(jsonCondition);
List<DemoCityEntity> list = this.bp.getEntityList(cdtMap);
return ActionResultUtil.toData(list);
}
catch(Exception ex)
{
ex.printStackTrace();
return ActionResultUtil.toException(ex);
}
}
@RequestMapping("/list/map")
@ResponseBody
public ActionResult getMapList(@RequestParam String jsonCondition)
{
try
{
ConditionMap cdtMap = new ConditionMap(jsonCondition);
List<EntityMap> list = this.bp.getMapList(cdtMap);
return ActionResultUtil.toData(list);
}
catch(Exception ex)
{
ex.printStackTrace();
return ActionResultUtil.toException(ex);
}
}
@RequestMapping("/page/entity")
@ResponseBody
public ActionResult getEntityPage(@RequestParam String jsonCondition,
@RequestParam Integer start,
@RequestParam Integer limit)
{
try
{
ConditionMap cdtMap = new ConditionMap(jsonCondition, start, limit);
PageData<DemoCityEntity> page = this.bp.getEntityPage(cdtMap);
return ActionResultUtil.toPageData(page);
}
catch(Exception ex)
{
ex.printStackTrace();
return ActionResultUtil.toException(ex);
}
}
@RequestMapping("/page/map")
@ResponseBody
public ActionResult getMapPage(@RequestParam String jsonCondition,
@RequestParam Integer start,
@RequestParam Integer limit)
{
try
{
ConditionMap cdtMap = new ConditionMap(jsonCondition, start, limit);
PageData<EntityMap> page = this.bp.getMapPage(cdtMap);
return ActionResultUtil.toPageData(page);
}
catch(Exception ex)
{
ex.printStackTrace();
return ActionResultUtil.toException(ex);
}
}
@RequestMapping("/get")
@ResponseBody
public ActionResult queryCityCode(@RequestParam String id)
{
try
{
String code = this.bp.queryCityCode(id);
return ActionResultUtil.toSingleResult(code);
}
catch(Exception ex)
{
ex.printStackTrace();
return ActionResultUtil.toException(ex);
}
}
@RequestMapping("/execute")
@ResponseBody
public ActionResult execute(@RequestParam(name="city", required=false) String jsonCity)
{
try
{
DemoCityEntity city = EntityUtil.EntityFromJSON(jsonCity, DemoCityEntity.class);
this.bp.execute(city);
return ActionResultUtil.toSuccess();
}
catch(Exception ex)
{
ex.printStackTrace();
return ActionResultUtil.toException(ex);
}
}
}
| [
"wei.zhang7@newtouch"
] | wei.zhang7@newtouch |
438f6b18b6509da95e8ddd71c3763eb8dd38ce7d | 4bc80bdfc139e33c84a8dcf9b292d212fe59cd08 | /src/main/java/com/emp/exception/ResourceNotFoundException.java | f171411517a8b45f65d6099c92f63215f035905d | [] | no_license | ranghosh9231/empPortal | 17f8cb0e092b3dd3398b23727bc9d626a6fa2118 | 1377c91acb43d97d620fc1e4a18978c88cef162e | refs/heads/master | 2020-06-08T07:56:01.534526 | 2019-09-15T06:57:47 | 2019-09-15T06:57:47 | 193,191,287 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 380 | java | package com.emp.exception;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ResponseStatus;
@ResponseStatus(value = HttpStatus.NOT_FOUND)
public class ResourceNotFoundException extends Exception {
private static final long serialVersionUID = 1L;
public ResourceNotFoundException(String message) {
super(message);
}
}
| [
"ranjanghosh9231@gmail.com"
] | ranjanghosh9231@gmail.com |
0f387f177759e4e888f83285f07741e36322136a | 1bf10318cc2d80da27fc3eb40837021aa556d55e | /src/main/java/com/affinion/customereventsource/events/CustomerEventHandler.java | 549602aed77f9f5c54461cb7aef8a64cc88ba1c1 | [] | no_license | sapatil-tavisca/cqrs-example | 5f7627dd80fa3f6bb2bd8da3789389a0e784d727 | 961fa10d65628556cf058007278697b9a232d441 | refs/heads/master | 2020-07-05T16:12:56.219819 | 2019-08-16T09:22:57 | 2019-08-16T09:22:57 | 202,695,827 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 752 | java | package com.affinion.customereventsource.events;
import com.affinion.customereventsource.domain.Customer;
import com.affinion.customereventsource.repository.CustomerRepository;
import lombok.RequiredArgsConstructor;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.annotation.StreamListener;
import org.springframework.cloud.stream.messaging.Sink;
import org.springframework.stereotype.Service;
@Service
@RequiredArgsConstructor
@EnableBinding(Sink.class)
public class CustomerEventHandler {
private final CustomerRepository customerRepository;
@StreamListener(Sink.INPUT)
public void handleCustomerEvents(Customer customer) {
customerRepository.save(customer);
}
}
| [
"sapatil@tavisca.com"
] | sapatil@tavisca.com |
433fedd431a2c0277e76072811b7f071e1ef5843 | 0320b72fc986188472694d350b25ed557ed3f408 | /library_webapp/library_webapp_model/src/main/java/com/projet3/library_webapp/library_webapp_model/book/GetNextBookReturnResponse.java | 215824264f8ca0b64430bf2020f5f07239bfab3c | [] | no_license | onlynks/Projet_6_Java | cefa2e189f49514a083b386c04ad33d4ff8f41f5 | 0a1caa656ee46f161d4f57388f8e8557d673ad18 | refs/heads/master | 2022-11-23T13:42:28.569937 | 2019-10-07T20:10:58 | 2019-10-07T20:10:58 | 196,548,727 | 0 | 0 | null | 2022-11-16T11:52:36 | 2019-07-12T09:17:59 | Java | UTF-8 | Java | false | false | 1,713 | java |
package com.projet3.library_webapp.library_webapp_model.book;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.datatype.XMLGregorianCalendar;
/**
* <p>Classe Java pour getNextBookReturnResponse complex type.
*
* <p>Le fragment de schéma suivant indique le contenu attendu figurant dans cette classe.
*
* <pre>
* <complexType name="getNextBookReturnResponse">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="return" type="{http://www.w3.org/2001/XMLSchema}dateTime" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "getNextBookReturnResponse", propOrder = {
"_return"
})
public class GetNextBookReturnResponse {
@XmlElement(name = "return")
@XmlSchemaType(name = "dateTime")
protected XMLGregorianCalendar _return;
/**
* Obtient la valeur de la propriété return.
*
* @return
* possible object is
* {@link XMLGregorianCalendar }
*
*/
public XMLGregorianCalendar getReturn() {
return _return;
}
/**
* Définit la valeur de la propriété return.
*
* @param value
* allowed object is
* {@link XMLGregorianCalendar }
*
*/
public void setReturn(XMLGregorianCalendar value) {
this._return = value;
}
}
| [
"nicogar12@gmail.com"
] | nicogar12@gmail.com |
715b8a0362cc8dfd515bedbc8284e8ab17227188 | 70348320d90284ab78a21f6ec1bb25330ed22331 | /app/src/main/java/com/socket/org/join/ws/serv/entity/GzipEntity.java | daf7811d8f079f53d293132e21252ec5b8e1e1b8 | [] | no_license | liyimeifeng/AndroidHttpServer | 6d30940d1356a25def1ab78927bb0bc65ce2b189 | e3012c6380157d0a72f018cce42eb669364ef275 | refs/heads/master | 2021-01-22T20:13:19.420301 | 2017-07-12T01:28:58 | 2017-07-12T01:28:58 | 85,295,259 | 7 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,900 | java | package com.socket.org.join.ws.serv.entity;
import com.socket.org.join.ws.Constants;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.zip.GZIPOutputStream;
import org.apache.http.Header;
import org.apache.http.entity.AbstractHttpEntity;
import org.apache.http.message.BasicHeader;
/**
* 基础Gzip实体
* @author Join
*/
public abstract class GzipEntity extends AbstractHttpEntity implements Cloneable {
/**
* @brief 输入流拷贝进输出流
* @warning When outstream is GZIPOutputStream, it will call finish(). But won't close any stream.
* @param instream 输入流
* @param outstream
* @throws IOException 输出流
*/
protected void copy(InputStream instream, OutputStream outstream) throws IOException {
byte[] tmp = new byte[Constants.Config.BUFFER_LENGTH];
int l;
while ((l = instream.read(tmp)) != -1) {
outstream.write(tmp, 0, l);
}
if (outstream instanceof GZIPOutputStream) {
((GZIPOutputStream) outstream).flush(); //4.4系统把finish方法改为flush,防止stream error异常
}
outstream.close();
}
@Override
public boolean isRepeatable() {
return true;
}
@Override
public boolean isStreaming() {
return false;
}
@Override
public InputStream getContent() throws IOException {
ByteArrayOutputStream buf = new ByteArrayOutputStream();
writeTo(buf);
return new ByteArrayInputStream(buf.toByteArray());
}
@Override
public Header getContentEncoding() {
return new BasicHeader("Content-Encoding", "gzip");
}
@Override
public Object clone() throws CloneNotSupportedException {
return super.clone();
}
}
| [
"liyi@dftcmedia.com"
] | liyi@dftcmedia.com |
4a6232dedbe2cd7adab0b64cc957c059803855d1 | 3c7eff012e25f97e66d3e6c920e5495e2c261512 | /src/main/java/com/yangnk/spring/springMVCDemo/filter/FilterTest.java | 621c434f273b2dd731b58a284e8803ad2d566d0d | [] | no_license | yangnk/MyJavaWeb | 70509a98da01f351368cf0e9f6c89017912a9eaf | cdf1ab5d93ea3f44fb5ad51504f2d72c36298d76 | refs/heads/master | 2020-04-06T15:18:21.695708 | 2019-04-14T04:18:55 | 2019-04-14T04:18:55 | 157,573,320 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,197 | java | package com.yangnk.spring.springMVCDemo.filter;
import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
/**
* 过滤器 Filter 的工作原理
*/
public class FilterTest implements Filter{
public void destroy() {
System.out.println("----Filter销毁----");
}
public void doFilter(ServletRequest request, ServletResponse response,FilterChain filterChain) throws IOException, ServletException {
// 对 request、response 进行一些预处理
request.setCharacterEncoding("UTF-8");
response.setCharacterEncoding("UTF-8");
response.setContentType("text/html;charset=UTF-8");
System.out.println("----调用service之前执行一段代码----");
// 执行目标资源,放行
filterChain.doFilter(request, response);
System.out.println("----调用service之后执行一段代码----");
}
public void init(FilterConfig arg0) throws ServletException {
System.out.println("----Filter初始化----");
}
} | [
"yangningkai@qq.com"
] | yangningkai@qq.com |
1b084ddaca728b23fa4d57d9263ed335a8e68d92 | 4cdd2cacba6c7cb2843aa3342356572cb2fda5e1 | /src/main/java/nmbp/p1/web/init/Inicijalizacija.java | 6f2747ceca714d8355e129507b5d79ab6b5ec60c | [] | no_license | dariansaric/pretrazivanje-teksta-napredni-sql | de8db2000037e7a1cd4464ac0f344312572c1722 | 2194b134487ca12f19fb6acd562fc537edd68f28 | refs/heads/master | 2020-04-01T11:46:00.103484 | 2018-10-23T20:35:31 | 2018-10-23T20:35:31 | 153,176,754 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,065 | java | package nmbp.p1.web.init;
import nmbp.p1.dao.jpa.JPAEMFProvider;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;
/**
* This {@linkplain WebListener} generates an {@linkplain EntityManagerFactory} on startup and stores it as a
* servlet context attribute.
*/
@WebListener
public class Inicijalizacija implements ServletContextListener {
@Override
public void contextInitialized(ServletContextEvent sce) {
EntityManagerFactory emf = Persistence.createEntityManagerFactory("nmbp.projekt1");
sce.getServletContext().setAttribute("emf", emf);
JPAEMFProvider.setEmf(emf);
}
@Override
public void contextDestroyed(ServletContextEvent sce) {
JPAEMFProvider.setEmf(null);
EntityManagerFactory emf = (EntityManagerFactory) sce.getServletContext().getAttribute("emf");
if (emf != null) {
emf.close();
}
}
} | [
"darian.saric@fer.hr"
] | darian.saric@fer.hr |
d1800be598050dfc2ad2527ef09efdb57bf5c1b6 | 8540e8d3d4c387cc57aa500cd4e5b4ac5dd2455d | /Spring-Mybatis/src/main/java/com/example/demo/controller/UserController.java | 1eeb30bae8bb0d95f0339b43b74626b7e100b09c | [] | no_license | giftlmy/Spring-Mybatis2 | f148b0047b8c98505404a2e14664b674b8974f0d | cc32f62130b9f828cc321c911daf6d2a09d58daa | refs/heads/master | 2022-07-08T01:31:32.261234 | 2019-08-10T10:18:28 | 2019-08-10T10:18:28 | 201,613,882 | 0 | 0 | null | 2022-06-21T01:38:35 | 2019-08-10T10:16:25 | Java | UTF-8 | Java | false | false | 1,344 | java | package com.example.demo.controller;
import com.example.demo.entity.User;
import com.example.demo.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* @Author:0xOO
* @Date: 2018/9/26 0026
* @Time: 14:42
*/
@RestController
@RequestMapping("/testuser")
public class UserController {
@Autowired
private UserService userService;
@RequestMapping("getUser/{id}")
public String GetUser(@PathVariable int id){
return userService.Sel(id).toString();
}
@RequestMapping("getAllUser")
public List<User> GetAllUser(){
return userService.getAllUser();
}
@RequestMapping("insertOne")
public void insertOne(){
User uer=new User(9,"kkkk");
userService.insertOne(uer);
}
@RequestMapping("updateOne")
public void updateOne(){
User uer=new User(3,"dddddddddd");
userService.updateByID(uer);
}
@RequestMapping("deleteOne/{id}")
public void deleteOne(@PathVariable Integer id){
userService.deleteById(id);
}
}
| [
"1094465220@qq.com"
] | 1094465220@qq.com |
c4d663530d25c2c02e234e6c6b2e809077af2c95 | 0f4e0da7ba36b0417be8f981d29cd93bdfad6092 | /src/test/java/com/hgkimer/springboot/web/dto/HelloResponseDtoTest.java | 055e23dfb3c145346da60441a6742c71d0fcc6bb | [] | no_license | hgkimer/aws-spring-boot | 032622dada2d1633f2cc84d956744a095ac1b860 | 3a06a1e4c52e8dcf8b7205939e5ae6fbf9e1be3a | refs/heads/master | 2023-06-27T00:02:15.090618 | 2021-07-02T09:08:22 | 2021-07-02T09:08:22 | 381,580,250 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 407 | java | package com.hgkimer.springboot.web.dto;
import org.junit.Test;
import static org.assertj.core.api.Assertions.assertThat;
public class HelloResponseDtoTest {
@Test
public void lombockTest() {
String name = "test";
int amount = 1000;
HelloResponseDto dto = new HelloResponseDto(name, amount);
assertThat(dto.getName()).isEqualTo(name);
assertThat(dto.getAmount()).isEqualTo(amount);
}
}
| [
"hgkimer@nara.co.kr"
] | hgkimer@nara.co.kr |
7c410a93dfeb1f70fc360236520cce4f97c14277 | 0035a313af0465df4c669e8835b561dcf297cb8b | /src/com/passport/controller/MemberSearchController.java | 00e62ee711f57e977eb7f39f4ae33559dfb7c7af | [] | no_license | md2eoseo/PassportJsp | 3d7027d9066894353446896757e3b57728524bd2 | dde12b5b9b9eb1275c273dca462ad408a7dff508 | refs/heads/master | 2020-09-06T10:07:10.357998 | 2019-12-17T09:02:05 | 2019-12-17T09:02:05 | 220,394,067 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,153 | java | package com.passport.controller;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import com.passport.service.MemberService;
import com.passport.vo.MemberVO;
public class MemberSearchController implements Controller {
public void execute(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
String id = req.getParameter("id");
String job = req.getParameter("job");
String path = null;
if(job.equals("search"))
path = "/memberSearch.jsp";
else if(job.equals("update"))
path = "/memberUpdate.jsp";
else if(job.equals("delete"))
path = "/memberDelete.jsp";
// error
if(id.isEmpty()) {
req.setAttribute("error", "Please, write down the ID!");
HttpUtil.forward(req, resp, path);
return;
}
MemberService service = MemberService.getInstance();
MemberVO member = service.memberSearch(id);
if (member == null) req.setAttribute("result", "no Member!!");
req.setAttribute("member", member);
if(job.equals("search")) path = "/result/memberSearchOutput.jsp";
HttpUtil.forward(req, resp, path);
}
}
| [
"md2eoseo@gmail.com"
] | md2eoseo@gmail.com |
b2582a7c125e51431229e480d3ab843adfdc41f0 | 339ee5fb201af82b620b3de6c177304aaa97daf9 | /SistemaReserva/src/sistemareserva/Rede.java | 48f7dd0a90ee2025818c42c99437f946475bc2df | [] | no_license | igorvtorres/SistemaReserva | 14f08fd28229704e3d08fce7a20eac8bd0a8ef2b | f81f3cf6d9ce2f4b420c1fecebecffeb574cd134 | refs/heads/master | 2020-03-30T19:01:17.228014 | 2014-04-24T01:36:22 | 2014-04-24T01:36:22 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 228 | java | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package sistemareserva;
/**
*
* @author 40906973
*/
public class Rede {
private String nomeRede;
}
| [
"40906973@09305-P31S405.macklabs.br"
] | 40906973@09305-P31S405.macklabs.br |
3974270f6b92d03889622d9200be948ca47c4bca | 7927db09a08e17761d5531426b358ef2fb274fc2 | /src/main/java/org/stsffap/cep/monitoring/events/PowerEvent.java | 5c238eb1158fe7256c60e3f94dc85f8db4a17fcc | [
"Apache-2.0"
] | permissive | ChangShuai1013/cep-monitoring | 4f09f95a71e686430e0d3fcb217e686240129321 | 75a90013da088265b53fdacc6ea552d79d04f54e | refs/heads/master | 2020-09-23T17:05:26.496073 | 2019-12-03T06:15:23 | 2019-12-03T06:15:23 | 225,545,674 | 0 | 0 | Apache-2.0 | 2019-12-03T06:18:22 | 2019-12-03T06:18:21 | null | UTF-8 | Java | false | false | 1,850 | java | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.stsffap.cep.monitoring.events;
public class PowerEvent extends MonitoringEvent {
private double voltage;
public PowerEvent(int rackID, double voltage) {
super(rackID);
this.voltage = voltage;
}
public void setVoltage(double voltage) {
this.voltage = voltage;
}
public double getVoltage() {
return voltage;
}
@Override
public boolean equals(Object obj) {
if (obj instanceof PowerEvent) {
PowerEvent powerEvent = (PowerEvent) obj;
return powerEvent.canEquals(this) && super.equals(powerEvent) && voltage == powerEvent.voltage;
} else {
return false;
}
}
@Override
public int hashCode() {
return 41 * super.hashCode() + Double.hashCode(voltage);
}
@Override
public boolean canEquals(Object obj) {
return obj instanceof PowerEvent;
}
@Override
public String toString() {
return "PowerEvent(" + getRackID() + ", " + voltage + ")";
}
}
| [
"trohrmann@apache.org"
] | trohrmann@apache.org |
c6123d5f8bde9b4c49ecccc40fd590f08e5e39ce | 0466ccedce68dbad991f940af3b40ab62c79a48b | /11727/src/Main.java | e9eff41e6763cdedd7d192861377358b33eabf45 | [] | no_license | vaudgnsv/study | 630fdc48d9d276d9b37e8f3b7bb19a3f1c811786 | 396ac53b26e356089af2cff39ac6f8e56d562ca3 | refs/heads/master | 2023-02-18T17:48:42.577341 | 2021-01-22T07:16:27 | 2021-01-22T07:16:27 | 240,913,760 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,035 | java | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
if(n == 1) { // 최소조건
System.out.println(1);
}
else if(n == 2) {
System.out.println(3);
}
else if(n == 3) {
System.out.println(5);
}
else {
long [] arr = new long[n];
arr[0] = 1;
arr[1] = 3;
arr[2] = 5;
for(int i = 3; i < n; i++) {
if(i % 2 == 0) { // 홀수일때 | 하나만 넣는건 왼쪽과 오른쪽 경우에서 중복 1 제거
arr[i] = ((arr[i - 1] * 2) - 1) % 10007;
}
else { // 짝수일때 이전경우 + (-와 ㅁ 경우 있으므로 2개 이전경우 * 2)
arr[i] = (arr[i - 1] + (arr[i - 2] * 2)) % 10007;
}
}
System.out.println(arr[n - 1]);
}
}
}
| [
"vaudgnsv@naver.com"
] | vaudgnsv@naver.com |
6aeb88733c908535b092de415288bf857279c70b | 222c56bda708da134203560d979fb90ba1a9da8d | /uapunit测试框架/engine/src/public/uap/workflow/engine/invocation/ActivityBehaviorInvocation.java | aaafd4184c75fcdd5d8cd4a14567b4651969a05c | [] | no_license | langpf1/uapunit | 7575b8a1da2ebed098d67a013c7342599ef10ced | c7f616bede32bdc1c667ea0744825e5b8b6a69da | refs/heads/master | 2020-04-15T00:51:38.937211 | 2013-09-13T04:58:27 | 2013-09-13T04:58:27 | 12,448,060 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,264 | java | /* 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 uap.workflow.engine.invocation;
import uap.workflow.engine.core.IActivityInstance;
import uap.workflow.engine.pvm.behavior.ActivityBehavior;
/**
*
* @author Daniel Meyer
*/
public class ActivityBehaviorInvocation extends DelegateInvocation {
protected final ActivityBehavior behaviorInstance;
protected final IActivityInstance execution;
public ActivityBehaviorInvocation(ActivityBehavior behaviorInstance, IActivityInstance execution) {
this.behaviorInstance = behaviorInstance;
this.execution = execution;
}
protected void invoke() throws Exception {
behaviorInstance.execute(execution);
}
public Object getTarget() {
return behaviorInstance;
}
}
| [
"langpf1@yonyou.com"
] | langpf1@yonyou.com |
68b979439b476aff991e4eb4060ded480a26bbca | 343cdf8da06f8729f01be3ddc1897496cb9ccbb3 | /FastShop/src/com/sea/controller/app/AppCompanyController.java | e54880d3a50a2153c9c455931807715edbb7fe11 | [] | no_license | hshloveyy/FastShop | 09e4538a748a82ff01433065e18ed1ff6bd14494 | c240031ec5323b54263f417282268ebfe7b7f65b | refs/heads/master | 2020-04-19T16:00:50.340471 | 2016-11-02T17:05:48 | 2016-11-02T17:05:48 | 67,880,801 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,216 | java | package com.sea.controller.app;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import com.sea.controller.BaseController;
import com.sea.entity.Company;
import com.sea.mybatis.mapper.CompanyMapper;
import com.sea.mybatis.param.CompanyParams;
import com.sea.result.Result;
@RestController
@RequestMapping("company")
public class AppCompanyController extends BaseController<Company>{
Logger logger = Logger.getLogger(AppCompanyController.class);
@Autowired
private CompanyMapper companyMapper;
@ResponseBody
@RequestMapping("queryCompany")
public Result queryCompany(CompanyParams companyParams){
logger.debug("######################## queryCompany start #############################");
logger.debug(companyParams);
// List<Product> list = queryPageList("com.sea.mybatis.mapper.CompanyMapper.queryCompany", companyParams);
Result result = new Result();
result.setData(companyMapper.queryCompany(companyParams));
// result.setData(list);
return result;
}
}
| [
"386184368@qq.com"
] | 386184368@qq.com |
901747161a53fc15e2b235d82e6ce79cc2870c35 | a893729a7f3b129e91137388965443a7330a76c7 | /app/src/main/java/com/joiaapp/joia/dto/request/InviteRequest.java | 32c00c6bdcb06978b5e2cfe86fec6f70618af9f0 | [] | no_license | JoiaApp/joia_android | 7aef83f8515f466bc36975cd99b83dae502c9889 | 96af48b0a6201a5373c1b771e182209a1f1f35ed | refs/heads/master | 2020-07-29T13:56:50.256240 | 2017-11-21T05:46:23 | 2017-11-21T05:46:23 | 73,664,726 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 575 | java | package com.joiaapp.joia.dto.request;
/**
* Created by arnell on 9/1/2017.
* Copyright 2017 Joia. All rights reserved.
*/
public class InviteRequest {
private String email;
private boolean isMention;
public InviteRequest(String email) {
this.email = email;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public boolean isMention() {
return isMention;
}
public void setMention(boolean mention) {
isMention = mention;
}
}
| [
"webplague@gmail.com"
] | webplague@gmail.com |
40d6657b2e8034834342baa1086215db9fcfc3fb | 05a5855da7d6043e419aa889a6df90124c0c6808 | /config-client/src/main/java/com/javaboy/configclient/ConfigClientApplication.java | fd5196acc0ef9bbea2f82f660eb51d5d94c9e5b5 | [] | no_license | lihaijian-java/spring-cloud-demo | 6f355f41899c292395c6f309da4008e1f2ca426d | 7f2271025575fbf1699921efda64dc29785cb884 | refs/heads/master | 2023-02-06T09:11:12.337621 | 2020-12-12T20:30:27 | 2020-12-12T20:30:27 | 288,381,943 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 341 | java | package com.javaboy.configclient;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class ConfigClientApplication {
public static void main(String[] args) {
SpringApplication.run(ConfigClientApplication.class, args);
}
}
| [
"1041357974@qq.com"
] | 1041357974@qq.com |
a4677a003135c737217976f54acbded59e095ad0 | f701336d7c6c973247e3710e606271c2322a9513 | /src/main/java/com/bahinskyi/advertisement/util/Guard.java | 3902ac0603a02c8835e690ec5021760ab08cb450 | [] | no_license | GrigoriyDidorenko/advertisement_board | 759727d97f6962ba63c95bb9dd19f829532b9522 | b6739ab3f47374ccd37ccf8d90c5c22deb4d3cb0 | refs/heads/master | 2021-01-22T22:27:58.897825 | 2017-06-06T19:19:02 | 2017-06-06T19:19:02 | 92,776,266 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 857 | java | package com.bahinskyi.advertisement.util;
import com.bahinskyi.advertisement.exception.AdvertisementBoardException;
import java.util.function.Supplier;
/**
* Created by quento on 06.06.17.
*/
public final class Guard {
private Guard() {
}
private static void assertTrue(boolean value, Supplier<String> message) {
if (!value) {
throw new AdvertisementBoardException(message.get());
}
}
public static void assertFalse(boolean value, Supplier<String> message) {
assertTrue(!value, message);
}
public static void assertNotNull(Object value, String name) {
assertFalse(value == null, () -> String.format("[%s] should be not null.", name));
}
public static void assertNotNull(Object value, Supplier<String> message) {
assertFalse(value == null, message);
}
}
| [
"grigoriy.didorenko@gmail.com"
] | grigoriy.didorenko@gmail.com |
b365c758bb5abca537bd9ce913a9493dbf897af9 | 46c85d2f6a53193e685af8d988e0eef69f9b9113 | /src/com/alysoft/completedsa/string/MultiplyTwoStrings.java | 3a91f619709caad547acc8c92f6bcfdb547cbd57 | [] | no_license | ymohammad/algorithms | 7a4613c50f89bc0cd89456e5d8a1a70a1bebf076 | 44ea66b0bd7ef7a9a49a9c759e60b260d20065e5 | refs/heads/master | 2021-08-07T19:34:03.579022 | 2021-07-28T07:42:03 | 2021-07-28T07:42:03 | 97,962,372 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,077 | java | package com.alysoft.completedsa.string;
import java.util.Scanner;
/**
* Given two numbers as stings s1 and s2 your task is to multiply them. You are required to complete the function
* multiplyStrings which takes two strings s1 and s2 as its only argument and returns their product as strings.
Input:
The first line of input contains an integer T denoting the no of test cases. Then T test cases follow .
Each test case contains two strings s1 and s2 .
Output:
For each test case in a new line the output will be a string denoting the product of the two strings s1 and s2.
* @author ymohammad
*
*/
public class MultiplyTwoStrings
{
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
int t=sc.nextInt();
while(t-->0){
String a=sc.next();
String b=sc.next();
System.out.println(multiply(a,b));
}
}
public static String multiply(String a,String b){
//return new java.math.BigInteger(a).multiply(new java.math.BigInteger(b)).toString();
if (a.length() == 0 || b.length() == 0) return "0";
a = (a.charAt(0) == '-') ? a.substring(1) : a;
b = (b.charAt(0) == '-') ? b.substring(1) : b;
a = new StringBuffer(a).reverse().toString();
b = new StringBuffer(b).reverse().toString();
System.out.println(a);
System.out.println(b);
int n = a.length();
int m = b.length();
int[] res = new int[n+m];
for (int i = 0; i<n; i++) {
for (int j = 0; j<m; j++) {
res[i+j] = res[i+j] + ((a.charAt(i)-'0')*(b.charAt(j)-'0'));
printtArray(res);
}
}
printtArray(res);
String product = new String();
// Multiply with current digit of first number
// and add result to previously stored product
// at current position.
for (int i = 0; i < res.length; i++)
{
int digit = res[i]%10;
int carry = res[i]/10;
if(i+1<res.length)
{
res[i+1] = res[i+1] + carry;
}
product = digit+product;
}
return product;
}
private static void printtArray(int[] res)
{
for (int a: res) {
System.out.print(a + " ");
}
System.out.println();
}
public static String multiply1(String a,String b){
//return new java.math.BigInteger(a).multiply(new java.math.BigInteger(b)).toString();
String shortStr = a.length() > b.length() ? b : a;
String longStr = a.length() > b.length() ? a : b;
int sN = shortStr.length();
for (int i = 0; i< sN; i++) {
longStr = addStrItself(longStr);
}
return longStr;
}
private static String addStrItself(String strVal)
{
StringBuffer finalStr = new StringBuffer();
int i = strVal.length()-1;
int carry = 0;
while (i>=0) {
int x = (Integer.parseInt(String.valueOf(strVal.charAt(i)))*2) + carry;
carry = x/10;
finalStr.append(x%10);
i--;
}
finalStr.reverse();
return finalStr.toString();
}
}
| [
"mdsufyan2005@gmail.com"
] | mdsufyan2005@gmail.com |
5c5ad645f1b184386ab3e71e779ba859b70b723b | b388564b255dce878846b680c998903cac9cde81 | /app/src/main/java/fb/android/measure/measure/MeasureFrictionActivity.java | 6da0d5b10d041128cf37bdb3bde68332f953a7f4 | [] | no_license | FBalazs/Measure | 12d57e9756e2faae169d58c7608159e114ce23fd | 1bdd286dd798aebbcd11c2945480f248a6595c46 | refs/heads/master | 2016-08-12T23:34:06.249367 | 2015-11-25T10:54:00 | 2015-11-25T10:54:00 | 45,051,458 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 631 | java | package fb.android.measure.measure;
import android.os.Bundle;
import android.view.WindowManager;
import fb.android.measure.BaseActivity;
import fb.android.measure.R;
public class MeasureFrictionActivity extends BaseActivity {
@Override
protected int getLayoutResource() {
return R.layout.activity_measure_friction;
}
@Override
protected int getMenuResource() {
return R.menu.menu_main;
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
}
}
| [
"fbalazs369@gmail.com"
] | fbalazs369@gmail.com |
aed903be160d64f926276d32e1201b240ddb1e2f | 07362fd45f045d0aec5674babfc2168589f3fd8f | /app/src/main/java/com/stabstudio/discussionapp/Adapters/DiscussionsAdapter.java | 5ebf35959396d6c613740fe94b178b34ebaaa968 | [] | no_license | SwetabjaGit/talkstalker | 5c27d74e647e613649c4bc101b1e981bdd490338 | bcd07364be66333755cbdf349cc664a8fd3be29b | refs/heads/master | 2022-12-01T00:30:19.955992 | 2020-08-09T09:49:58 | 2020-08-09T09:49:58 | 93,084,340 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,715 | java | package com.stabstudio.discussionapp.Adapters;
import android.content.Context;
import android.content.Intent;
import android.support.v7.widget.RecyclerView;
import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.ValueEventListener;
import com.stabstudio.discussionapp.Fragments.DiscussionFragment;
import com.stabstudio.discussionapp.Models.Discussion;
import com.stabstudio.discussionapp.Models.Places;
import com.stabstudio.discussionapp.Models.User;
import com.stabstudio.discussionapp.UI.DiscussionActivity;
import com.stabstudio.discussionapp.R;
import org.joda.time.DateTime;
import java.util.List;
public class DiscussionsAdapter extends RecyclerView.Adapter<DiscussionsAdapter.ViewHolder> {
private final TypedValue mTypedValue = new TypedValue();
private int mBackground;
private List<Discussion> discussionList;
private DatabaseReference usersRef;
private DatabaseReference placeRef;
public DiscussionsAdapter(Context context) {
context.getTheme().resolveAttribute(R.attr.selectableItemBackground, mTypedValue, true);
mBackground = mTypedValue.resourceId;
discussionList = DiscussionFragment.discussionList;
}
@Override
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_item, parent, false);
view.setBackgroundResource(mBackground);
return new ViewHolder(view);
}
public Discussion getValueAt(int position) {
return discussionList.get(position);
}
@Override
public void onBindViewHolder(final ViewHolder holder, final int position) {
final Discussion tempDiscussion = discussionList.get(position);
final String subject = tempDiscussion.getSubject();
int likes = tempDiscussion.getLikes();
int comments = tempDiscussion.getComments();
final String userId = tempDiscussion.getUser_id();
final String placeId = tempDiscussion.getPlace_id();
String timeStamp = tempDiscussion.getTimestamp();
holder.subjectText.setText(subject);
holder.likesNo.setText(String.valueOf(likes));
holder.commentsNo.setText(String.valueOf(comments));
getUsernameAndPlace(holder, userId, placeId);
calculateTimeAGO(holder, timeStamp);
holder.mView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Context context = v.getContext();
Intent intent = new Intent(context, DiscussionActivity.class);
intent.putExtra(DiscussionActivity.EXTRA_NAME, subject);
intent.putExtra("dissId", discussionList.get(position).getId());
context.startActivity(intent);
}
});
holder.likeIcon.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//String likes = holder.likesNo.getText().toString();
discussionList.get(position).incrementLike();
notifyDataSetChanged();
}
});
/*Glide.with(holder.mImageView.getContext())
.load(TestData.getRandomCheeseDrawable())
.fitCenter()
.into(holder.mImageView);*/
}
private void getUsernameAndPlace(final ViewHolder holder, final String userId, final String placeId){
usersRef = FirebaseDatabase.getInstance() .getReference().child("Users");
placeRef = FirebaseDatabase.getInstance().getReference().child("Places");
usersRef.addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
User user = dataSnapshot.child(userId).getValue(User.class);
holder.userName.setText(user.getFirst_name() + " " + user.getLast_name());
}
@Override
public void onCancelled(DatabaseError databaseError) {
}
});
placeRef.addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
Places place = dataSnapshot.child(placeId).getValue(Places.class);
holder.address.setText(place.getAddress());
}
@Override
public void onCancelled(DatabaseError databaseError) {
}
});
}
private void calculateTimeAGO(final ViewHolder holder, String timeStamp){
String[] chars = timeStamp.split("/");
int second = Integer.parseInt(chars[0]);
int minute = Integer.parseInt(chars[1]);
int hour = Integer.parseInt(chars[2]);
int day = Integer.parseInt(chars[3]);
int month = Integer.parseInt(chars[4]);
int year = Integer.parseInt(chars[5]);
int secondNow = DateTime.now().getSecondOfMinute();
int minuteNow = DateTime.now().getMinuteOfHour();
int hourNow = DateTime.now().getHourOfDay();
int dayNow = DateTime.now().getDayOfMonth();
int monthNow = DateTime.now().getMonthOfYear();
int yearNow = DateTime.now().getYear();
int displayTime;
if(yearNow - year != 0){
displayTime = yearNow - year;
holder.timeText.setText(displayTime + " years ago");
}else if(monthNow - month != 0){
displayTime = monthNow - month;
holder.timeText.setText(displayTime + " months ago");
}else if(dayNow - day != 0){
displayTime = dayNow - day;
holder.timeText.setText(displayTime + " days ago");
}else if(hourNow - hour != 0){
displayTime = hourNow - hour;
holder.timeText.setText(displayTime + " hours ago");
}else if(minuteNow - minute != 0){
displayTime = minuteNow - minute;
holder.timeText.setText(displayTime + " minutes ago");
}else{
displayTime = secondNow - second;
holder.timeText.setText(displayTime + " seconds ago");
}
}
@Override
public int getItemCount() {
return discussionList.size();
}
public static class ViewHolder extends RecyclerView.ViewHolder {
public View mView;
public TextView subjectText;
public TextView userName;
public TextView timeText;
public TextView address;
public TextView likesNo;
public TextView commentsNo;
public ImageView likeIcon;
public ViewHolder(View view) {
super(view);
mView = view;
subjectText = (TextView) view.findViewById(R.id.dis_subject);
userName = (TextView) view.findViewById(R.id.dis_author);
timeText = (TextView) view.findViewById(R.id.dis_timestamp);
address = (TextView) view.findViewById(R.id.dis_address);
likesNo = (TextView) view.findViewById(R.id.like_count);
commentsNo = (TextView) view.findViewById(R.id.comment_count);
likeIcon = (ImageView) view.findViewById(R.id.like_icon);
}
/*@Override
public String toString() {
return super.toString() + " '" + mTextView.getText();
}*/
}
}
| [
"Stabja Hazra"
] | Stabja Hazra |
fd72e8f70077d016753fbaa47db83e158cbce5c3 | 9a5c1ffaf3fee4111eaa62157f2cb1fe2ff2bc98 | /src/main/java/com/kayla/Activity/PostActivity.java | 2d7d7b2edc2a2aea81366f3a93877872686bb7e6 | [] | no_license | Uijess41/KaylaApp | 16e467345d375f3e79378570bd7238d3b5cdf2bc | 8b171c8d7fc313d654533e4a9de3a81b94f4551b | refs/heads/master | 2023-04-23T22:56:51.001953 | 2021-05-12T11:39:25 | 2021-05-12T11:39:25 | 366,694,662 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,068 | java | package com.kayla.Activity;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.ImageView;
import com.androidnetworking.AndroidNetworking;
import com.androidnetworking.common.Priority;
import com.androidnetworking.error.ANError;
import com.androidnetworking.interfaces.JSONObjectRequestListener;
import com.kayla.Adapter.DemoAdapter;
import com.kayla.Adapter.MyOrderAdapter;
import com.kayla.Adapter.PostAdapter;
import com.kayla.Model.DemoModel;
import com.kayla.Model.MyOrderModel;
import com.kayla.Model.PostModel;
import com.kayla.R;
import com.kayla.other.API_BaseUrl;
import com.kayla.other.AppConstats.AppConstats;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.ArrayList;
public class PostActivity extends AppCompatActivity {
ImageView imageback,imgadd;
String user_id ="";
PostAdapter postAdapter;
ArrayList<PostModel> postModelArrayList;
RecyclerView recycleview_post;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_post);
imageback = findViewById(R.id.imageback);
imgadd = findViewById(R.id.imgadd);
recycleview_post = findViewById(R.id.recycleview_post);
recycleview_post.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false));
AppConstats.sharedpreferences = getSharedPreferences(AppConstats.MY_PREF, MODE_PRIVATE);
user_id = AppConstats.sharedpreferences.getString(AppConstats.User_id, "");
Log.e("ghhfghfh", "onCreate: " + user_id);
imgadd.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(getApplicationContext(),NewPostActivity.class));
}
});
imageback.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
show_my_post();
}
public void show_my_post() {
Log.e("iijii", "seller_id: " + user_id);
AndroidNetworking.post(API_BaseUrl.show_my_post)
.addBodyParameter("seller_id", user_id)
.setPriority(Priority.HIGH)
.setTag("test")
.build()
.getAsJSONObject(new JSONObjectRequestListener() {
@Override
public void onResponse(JSONObject response) {
try {
if (response.getString("result").equals("successfully")) {
Log.e("jfghgh", "onResponse: "+response );
postModelArrayList=new ArrayList<>();
JSONArray jsonArray = new JSONArray(response.getString("data"));
for (int i = 0; i < jsonArray.length(); i++) {
JSONObject jsonObject = jsonArray.getJSONObject(i);
PostModel postModel = new PostModel();
String id = jsonObject.getString("id");
Log.e("sgfgdfshj", "onResponse: "+ (jsonObject.getString("seller_id")));
postModel.setSeller_id(jsonObject.getString("seller_id"));
postModel.setCategory_id(jsonObject.getString("category_id"));
postModel.setSub_category_id(jsonObject.getString("sub_category_id"));
postModel.setProduct_title(jsonObject.getString("product_title"));
postModel.setProduct_description(jsonObject.getString("product_description"));
postModel.setMrp(jsonObject.getString("MRP"));
postModel.setDiscount(jsonObject.getString("discount"));
postModel.setSelling_price(jsonObject.getString("selling_price"));
postModel.setStock(jsonObject.getString("stock"));
postModel.setImage(jsonObject.getString("image"));
postModel.setColor(jsonObject.getString("color"));
postModel.setSize(jsonObject.getString("size"));
postModel.setBrand(jsonObject.getString("brand"));
postModel.setVerify_status(jsonObject.getString("verify_status"));
Log.e("ggfg", "onResponse: "+jsonObject.getString("path") );
postModel.setPath(jsonObject.getString("path"));
postModelArrayList.add(postModel);
}
recycleview_post.setHasFixedSize(true);
postAdapter = new PostAdapter(postModelArrayList, PostActivity.this);
recycleview_post.setLayoutManager(new LinearLayoutManager(PostActivity.this, LinearLayoutManager.VERTICAL, false));
recycleview_post.setAdapter(postAdapter);
}
} catch (JSONException e) {
Log.e("jdsjsui", "onResponse: " + e.getMessage());
e.printStackTrace();
}
}
@Override
public void onError(ANError anError) {
Log.e("jhasfty", "onError: " + anError.getMessage());
}
});
}
} | [
"Uijess41@gmail.com"
] | Uijess41@gmail.com |
4bf25be69fdd52b2d373c4aa63d68bd076e198cb | 4e5de6f80fdf5fc050ba960e0d7178005b01ab06 | /src/com/lei/bookAlgorithm/demoStaticMethod.java | 6fbb8dc815a9ac9b5c9a0426f2624844350db060 | [] | no_license | lemon2ml/LearningDemo | 2afe1c1c914c0045baa059d642cd8dbc14a7ba3e | 1aef507a138ef5c6b8ecce58cf38446e5015edf8 | refs/heads/master | 2020-03-14T17:08:34.600005 | 2018-09-17T12:35:07 | 2018-09-17T12:35:07 | 131,713,040 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 296 | java | package com.lei.bookAlgorithm;
public class demoStaticMethod {
static boolean isPrime(int n) {
for (int i = 2; i * i < n; i++) {
if (n % i == 0)
return false;
}
return true;
}
public static void main(String[] args) {
System.out.println(isPrime(56));
}
}
| [
"lemon2ml@outlook.com"
] | lemon2ml@outlook.com |
1dabc83a0a008c907140858ffb1aefd7d68361f8 | dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9 | /data_defect4j/preprossed_method_corpus/Lang/41/org/apache/commons/lang/Validate_isTrue_128.java | eff718e16f55ba534be31876e6cd306cfe66a83b | [] | no_license | hvdthong/NetML | dca6cf4d34c5799b400d718e0a6cd2e0b167297d | 9bb103da21327912e5a29cbf9be9ff4d058731a5 | refs/heads/master | 2021-06-30T15:03:52.618255 | 2020-10-07T01:58:48 | 2020-10-07T01:58:48 | 150,383,588 | 1 | 1 | null | 2018-09-26T07:08:45 | 2018-09-26T07:08:44 | null | UTF-8 | Java | false | false | 1,340 | java |
org apach common lang
assist valid argument
base line unit junit argument
deem invalid illeg argument except illegalargumentexcept thrown
pre
valid true istru greater
valid null notnul surnam surnam
pre
author href mailto ola berg arkitema ola berg
author stephen colebourn
author gari gregori
author norm dean
version
valid
valid argument throw code illeg argument except illegalargumentexcept code
test result code code
valid arbitrari express
valid primit number custom valid
express
pre
valid true istru greater
pre
perform reason pass separ paramet
append messag string error
param express express
param messag except messag express
code code
param append messag error
illeg argument except illegalargumentexcept express code code
true istru express string messag
express
illeg argument except illegalargumentexcept messag
| [
"hvdthong@gmail.com"
] | hvdthong@gmail.com |
4c2a1ce809925017d7cf879c4a3e6403bc64e503 | 096e862f59cf0d2acf0ce05578f913a148cc653d | /code/apps/Messaging/MmsFolderView/src/com/android/mmsfolderview/data/binding/Binding.java | 9f8bca6377f334cea63c8f2c1cbf0e9d9633b586 | [] | no_license | Phenix-Collection/Android-6.0-packages | e2ba7f7950c5df258c86032f8fbdff42d2dfc26a | ac1a67c36f90013ac1de82309f84bd215d5fdca9 | refs/heads/master | 2021-10-10T20:52:24.087442 | 2017-05-27T05:52:42 | 2017-05-27T05:52:42 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,848 | java | /*
* Copyright (C) 2015 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.mmsfolderview.data.binding;
import java.util.concurrent.atomic.AtomicLong;
public class Binding<T extends BindableData> extends BindingBase<T> {
private static AtomicLong sBindingIdx = new AtomicLong(System.currentTimeMillis() * 1000);
private String mBindingId;
private T mData;
private final Object mOwner;
private boolean mWasBound;
/**
* Initialize a binding instance - the owner is typically the containing class
*/
Binding(final Object owner) {
mOwner = owner;
}
@Override
public T getData() {
ensureBound();
return mData;
}
@Override
public boolean isBound() {
return (mData != null && mData.isBound(mBindingId));
}
@Override
public boolean isBound(final T data) {
return (isBound() && data == mData);
}
@Override
public void ensureBound() {
if (!isBound()) {
throw new IllegalStateException("not bound; wasBound = " + mWasBound);
}
}
@Override
public void ensureBound(final T data) {
if (!isBound()) {
throw new IllegalStateException("not bound; wasBound = " + mWasBound);
} else if (data != mData) {
throw new IllegalStateException("not bound to correct data " + data + " vs " + mData);
}
}
@Override
public String getBindingId() {
return mBindingId;
}
public void bind(final T data) {
// Check both this binding and the data not already bound
if (mData != null || data.isBound()) {
throw new IllegalStateException("already bound when binding to " + data);
}
// Generate a unique identifier for this bind call
mBindingId = Long.toHexString(sBindingIdx.getAndIncrement());
data.bind(mBindingId);
mData = data;
mWasBound = true;
}
public void unbind() {
// Check this binding is bound and that data is bound to this binding
if (mData == null || !mData.isBound(mBindingId)) {
throw new IllegalStateException("not bound when unbind");
}
mData.unbind(mBindingId);
mData = null;
mBindingId = null;
}
}
| [
"wangjicong6403660@126.com"
] | wangjicong6403660@126.com |
c1395bf60cb113e2ce822fd41a04572b41cddc95 | 12421f933d8b30b92ab3fab8520339107fad4488 | /ntech-fsh-house-service/src/main/java/com/ntech/red/ntech/fsh/house/FshHouseServiceApplication.java | 6ffaa21296d71a96f3d7139fc9c31c17d7f75c96 | [] | no_license | Kam9208/spring-cloud | 89d3b3c064411d111c7f964264b4ce07198e6162 | e465ff165d087d797d2d4aa4a98da51680275605 | refs/heads/master | 2020-04-08T09:07:13.085525 | 2019-03-05T01:57:14 | 2019-03-05T01:57:14 | 159,192,146 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 499 | java | package com.ntech.red.ntech.fsh.house;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
/**
* Hello world!
*
*/
@SpringBootApplication
@EnableDiscoveryClient
public class FshHouseServiceApplication
{
public static void main( String[] args )
{
SpringApplication.run(FshHouseServiceApplication.class, args);
}
}
| [
"ntech9208@hotmail.com"
] | ntech9208@hotmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.