blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 4
410
| content_id
stringlengths 40
40
| detected_licenses
sequencelengths 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
689M
⌀ | 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 131
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 32
values | content
stringlengths 3
9.45M
| authors
sequencelengths 1
1
| author_id
stringlengths 0
313
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6a260d78da5a1612f0a0fb2e175134f242e2c9ea | 49b4cb79c910a17525b59d4b497a09fa28a9e3a8 | /parserValidCheck/src/main/java/com/ke/css/cimp/fwb/fwb12/Rule_ULD_TYPE.java | 7fac9be93873b94fa5d6b9c3826cea811b918d9b | [] | no_license | ganzijo/koreanair | a7d750b62cec2647bfb2bed4ca1bf8648d9a447d | e980fb11bc4b8defae62c9d88e5c70a659bef436 | refs/heads/master | 2021-04-26T22:04:17.478461 | 2018-03-06T05:59:32 | 2018-03-06T05:59:32 | 124,018,887 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,621 | java | package com.ke.css.cimp.fwb.fwb12;
/* -----------------------------------------------------------------------------
* Rule_ULD_TYPE.java
* -----------------------------------------------------------------------------
*
* Producer : com.parse2.aparse.Parser 2.5
* Produced : Tue Mar 06 10:36:09 KST 2018
*
* -----------------------------------------------------------------------------
*/
import java.util.ArrayList;
final public class Rule_ULD_TYPE extends Rule
{
public Rule_ULD_TYPE(String spelling, ArrayList<Rule> rules)
{
super(spelling, rules);
}
public Object accept(Visitor visitor)
{
return visitor.visit(this);
}
public static Rule_ULD_TYPE parse(ParserContext context)
{
context.push("ULD_TYPE");
boolean parsed = true;
int s0 = context.index;
ParserAlternative a0 = new ParserAlternative(s0);
ArrayList<ParserAlternative> as1 = new ArrayList<ParserAlternative>();
parsed = false;
{
int s1 = context.index;
ParserAlternative a1 = new ParserAlternative(s1);
parsed = true;
if (parsed)
{
boolean f1 = true;
int c1 = 0;
for (int i1 = 0; i1 < 1 && f1; i1++)
{
int g1 = context.index;
ArrayList<ParserAlternative> as2 = new ArrayList<ParserAlternative>();
parsed = false;
{
int s2 = context.index;
ParserAlternative a2 = new ParserAlternative(s2);
parsed = true;
if (parsed)
{
boolean f2 = true;
int c2 = 0;
for (int i2 = 0; i2 < 1 && f2; i2++)
{
Rule rule = Rule_Typ_Alpha.parse(context);
if ((f2 = rule != null))
{
a2.add(rule, context.index);
c2++;
}
}
parsed = c2 == 1;
}
if (parsed)
{
boolean f2 = true;
int c2 = 0;
for (int i2 = 0; i2 < 2 && f2; i2++)
{
Rule rule = Rule_Typ_Mixed.parse(context);
if ((f2 = rule != null))
{
a2.add(rule, context.index);
c2++;
}
}
parsed = c2 == 2;
}
if (parsed)
{
as2.add(a2);
}
context.index = s2;
}
ParserAlternative b = ParserAlternative.getBest(as2);
parsed = b != null;
if (parsed)
{
a1.add(b.rules, b.end);
context.index = b.end;
}
f1 = context.index > g1;
if (parsed) c1++;
}
parsed = c1 == 1;
}
if (parsed)
{
as1.add(a1);
}
context.index = s1;
}
ParserAlternative b = ParserAlternative.getBest(as1);
parsed = b != null;
if (parsed)
{
a0.add(b.rules, b.end);
context.index = b.end;
}
Rule rule = null;
if (parsed)
{
rule = new Rule_ULD_TYPE(context.text.substring(a0.start, a0.end), a0.rules);
}
else
{
context.index = s0;
}
context.pop("ULD_TYPE", parsed);
return (Rule_ULD_TYPE)rule;
}
}
/* -----------------------------------------------------------------------------
* eof
* -----------------------------------------------------------------------------
*/
| [
"wrjo@wrjo-PC"
] | wrjo@wrjo-PC |
a0ecb6cbf8cbde3e4b16d02804bbf711b58a0937 | ef954387d4dedf809dff0e92c4749ab12806d3cb | /spring-security-web/spring-security-web-csrf/src/main/java/com/ymmihw/springsecuritycsrf/dto/Foo.java | 62fba69361e172f867faa7bb2a8ae449af52e1ab | [] | no_license | ymmihw/spring-security | 86be48d78956f6f3ddcfc7b40d8a5feb865d5950 | ec3d600244569e710558855b7087f7ce5d51c2b7 | refs/heads/master | 2022-02-02T06:41:23.355866 | 2021-06-25T09:45:30 | 2021-06-25T09:45:30 | 135,403,726 | 0 | 0 | null | 2022-01-21T23:18:54 | 2018-05-30T07:17:03 | Java | UTF-8 | Java | false | false | 1,363 | java | package com.ymmihw.springsecuritycsrf.dto;
import java.io.Serializable;
public class Foo implements Serializable {
private static final long serialVersionUID = 1L;
private long id;
private String name;
public Foo() {
super();
}
public Foo(final String name) {
super();
this.name = name;
}
// API
public long getId() {
return id;
}
public void setId(final long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(final String name) {
this.name = name;
}
//
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((name == null) ? 0 : name.hashCode());
return result;
}
@Override
public boolean equals(final Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final Foo other = (Foo) obj;
if (name == null) {
if (other.name != null) {
return false;
}
} else if (!name.equals(other.name)) {
return false;
}
return true;
}
@Override
public String toString() {
final StringBuilder builder = new StringBuilder();
builder.append("Foo [name=").append(name).append("]");
return builder.toString();
}
}
| [
"[email protected]"
] | |
169352e70d669399bc400b6dbcc9ef82fd6fb7c4 | 5f50a055d20f4df26448191c16eb6efce8a3216d | /app/src/main/java/com/wangjing/androidwebview/JSBean.java | 8e5ac3c6c94f4f313a82564dab0e91dc045e32b8 | [
"Apache-2.0"
] | permissive | TokenYc/AndroidWebview | 59faf1510450d849ac0a536b5544b230dd15ee00 | bfe337a464e1219b512c3ccda48ff61ae6bf1d1a | refs/heads/master | 2020-11-23T18:42:48.560083 | 2019-12-13T07:24:01 | 2019-12-13T07:24:01 | 227,773,062 | 0 | 0 | Apache-2.0 | 2019-12-13T06:36:01 | 2019-12-13T06:36:00 | null | UTF-8 | Java | false | false | 470 | java | package com.wangjing.androidwebview;
/**
* addJavascriptInterface的存储集合
*/
public class JSBean {
private Object mapClazz;
private String objName;
public Object getMapClazz() {
return mapClazz;
}
public void setMapClazz(Object mapClazz) {
this.mapClazz = mapClazz;
}
public String getObjName() {
return objName;
}
public void setObjName(String objName) {
this.objName = objName;
}
}
| [
"[email protected]"
] | |
0da4912a77b038937f54fc3aa8b5fd0e19e0fcd2 | fe761a90c469b2b9902adb9fc85480909bb44301 | /src/com/practice/datastruc/MergePointTwoLL.java | c761f5e98fd571b3c7414030fdbf9b6f5bff7175 | [] | no_license | chait2605/Practice-Java | 2dbb54bc45bf6b0c1a1e4eb1885072dbf78e5137 | 96e88a5387b5cb286f86d90e745bea97b2808e47 | refs/heads/master | 2020-03-08T02:15:23.465057 | 2018-04-03T08:07:37 | 2018-04-03T08:07:37 | 127,854,003 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 602 | java | /**
*
* find the merge point of two lists
*
*
*/
package com.practice.datastruc;
public class MergePointTwoLL {
class Node{
int data;
Node next;
}
int findNodeAtMerge(Node headA, Node headB) {
Node currA = headA;
Node currB = headB;
while(currA!=currB) {
if(currA == null) {
currA = headB;
}else {
currA = currA.next;
}
if(currB == null) {
currB = headA;
}else {
currB = currB.next;
}
}
return currA.data;
}
}
| [
"[email protected]"
] | |
146594f77e0219724d279de5bde22dd1b343e7f5 | 5ffa6832193e74ca024fe28fa5339fefb4f4066e | /src/main/java/oop/assignment2/ex39/Application.java | a1231cc74424efdb9b20a54bccf6028222ebee7c | [] | no_license | Awesome-wolf-101/ashby-cop3330-assignment2 | 7a061dd97b554b58cdf4a94fef4146a7b3368de6 | 06b0a2f217b5f5a1a13c6dc7e518e60f090dcdea | refs/heads/master | 2023-05-20T16:01:31.726225 | 2021-06-14T03:01:47 | 2021-06-14T03:01:47 | 376,626,964 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 655 | java | /*
* UCF COP3330 Summer 2021 Assignment 2 Solution
* Copyright 2021 Joshua Ashby
*/
package oop.assignment2.ex39;
import java.util.List;
import java.util.Map;
import java.util.Scanner;
public class Application {
public static void main(String[] args)
{
EmployeeSorter employeesorter = new EmployeeSorter();
Employee[] EmployeeArray = employeesorter.EmployeeArrayMaker();
List<Map<String, String>> myList = employeesorter.ListMaker(EmployeeArray);
employeesorter.SortEmployeeMapList(myList);
String OutPutString = employeesorter.OutPutTime(myList);
System.out.println(OutPutString);
}
}
| [
"[email protected]"
] | |
4d27e3317c1924a709d79ec7b20f53774162ca22 | 8271d9b64896d2bba66dff17ce89ba1debcbb6ee | /src/main/java/mezz/jei/ingredients/IngredientBlacklistInternal.java | 2291454eedf549d9f788ed1eb4a9ee26e5498430 | [
"MIT"
] | permissive | IMarvinTPA/JustEnoughItems | e754dc26fd4476910d6e07dbd212554ab9d4f0e4 | 19236745fd58cecd9b044f289508e9749b0d0f68 | refs/heads/1.16 | 2022-06-01T15:52:45.262792 | 2022-02-17T23:52:36 | 2022-03-08T00:57:31 | 78,608,999 | 0 | 0 | MIT | 2022-05-21T06:37:49 | 2017-01-11T06:20:31 | Java | UTF-8 | Java | false | false | 1,128 | java | package mezz.jei.ingredients;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import mezz.jei.api.ingredients.IIngredientHelper;
import mezz.jei.api.ingredients.subtypes.UidContext;
public class IngredientBlacklistInternal {
private final Set<String> ingredientBlacklist = new HashSet<>();
public <V> void addIngredientToBlacklist(V ingredient, IIngredientHelper<V> ingredientHelper) {
String uniqueName = ingredientHelper.getUniqueId(ingredient, UidContext.Ingredient);
ingredientBlacklist.add(uniqueName);
}
public <V> void removeIngredientFromBlacklist(V ingredient, IIngredientHelper<V> ingredientHelper) {
String uniqueName = ingredientHelper.getUniqueId(ingredient, UidContext.Ingredient);
ingredientBlacklist.remove(uniqueName);
}
public <V> boolean isIngredientBlacklistedByApi(V ingredient, IIngredientHelper<V> ingredientHelper) {
List<String> uids = IngredientInformation.getUniqueIdsWithWildcard(ingredientHelper, ingredient, UidContext.Ingredient);
for (String uid : uids) {
if (ingredientBlacklist.contains(uid)) {
return true;
}
}
return false;
}
}
| [
"[email protected]"
] | |
fcbabc41367d545f9f9e4bb5e26ed463e4cd7551 | 31308c0dd1d8bfc074f10b1bf8b40fa26f45cf51 | /NonDecreasingArray.java | e6bfd735a145e161fbd53ed29ed42de1b2ed99c0 | [] | no_license | SunavaP/DataStructureAndAlgorithm | 6f81c35ee50d7fec1122c5f32906813dd0581423 | c69b57a5d1aadb2d894f7546973a78654883365f | refs/heads/master | 2022-01-09T19:49:34.903718 | 2019-05-14T04:38:05 | 2019-05-14T04:38:05 | 45,674,225 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,712 | java | public class NonDecreasingArray {
public static void main(String[] args) {
System.out.println(solution(new int[]{2, 3, 3, 2, 4})); //true
System.out.println(solution(new int[]{-1, 4, 2, 3})); //true
System.out.println(solution(new int[]{4, 2, 3})); //true
System.out.println(solution(new int[]{3, 4, 2, 3})); //false
System.out.println(solution(new int[]{1, 4, 2, 3})); //true
}
public static boolean solution(int[] nums) {
if (nums.length < 3)
return true;
boolean flag = false;
for (int i = 0; i < nums.length - 1; i++) {
if (nums[i] > nums[i + 1]) {
if (flag)
return false;
flag = true;
if (i > 0 && i < nums.length - 2) {
if (nums[i - 1] <= nums[i] && nums[i] <= nums[i + 2])
nums[i + 1] = nums[i];
else if (nums[i - 1] <= nums[i + 1] && nums[i + 1] <= nums[i + 2])
nums[i] = nums[i + 1];
else
return false;
}
}
}
return true;
}
/* public static boolean checkPossibility(int[] nums) {
if(nums.length < 3)
return true;
int prev = nums[0], count = 0, prev1 = Integer.MAX_VALUE;
for(int i=1;i<=nums.length-1;i++) {
if(prev <= nums[i] || prev1 <= nums[i] ) {
prev1 = Integer.MAX_VALUE;
prev = nums[i];
continue;
}else {
count++;
if(count >1)
return false;
//if(i>=2 && nums[i-2] > Math.min(nums[i-1],nums[i]))
prev1 = nums[i];
}
}
return true;
} */
public static boolean checkPossibility(int[] nums) {
if (nums.length < 3)
return true;
int prev = nums[0];
for (int i = 1; i <= nums.length - 1; i++) {
if (prev > nums[i]) {
int temp = nums[i];
nums[i] = prev;
if (!checkIncreasing(nums)) {
nums[i] = temp;
nums[i - 1] = temp;
if (!checkIncreasing(nums))
return false;
}
}
prev = nums[i];
}
return true;
}
public static boolean checkIncreasing(int[] nums) {
int pr = nums[0];
for (int i = 1; i <= nums.length - 1; i++) {
if (pr > nums[i]) {
return false;
}
pr = nums[i];
}
return true;
}
}
| [
"[email protected]"
] | |
b417233ef15fc339b52c48f60b3f3effeac2b2c0 | 26b347151f7bb66ab578d28372a97c48767f7365 | /lab4/Main.java | c2add3c06ad7610e2f481d1bf7b6d3659b2142a2 | [] | no_license | Gaspachonacho/InkapslingMultiplication | 21a88d882056c06b4f08f06cb4a46c639f2f3583 | 434960d9ac7366bf5ac8f7537f85dc02a832ac89 | refs/heads/master | 2020-09-13T08:31:31.346207 | 2019-11-19T14:16:13 | 2019-11-19T14:16:13 | 222,711,963 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,078 | java | package lab4;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
//////////////////////////////////////////////////////////////
Scanner scan = new Scanner(System.in);
// Skannar in x och y värdet
System.out.print("x: ");
int xAxis = scan.nextInt();
System.out.print("y: ");
int yAxis = scan.nextInt();
// Ber användaren vilket räknesätt de vill använda
System.out.print("Välj räknesätt: +-/*");
scan.nextLine();
String raknesatt = scan.nextLine();
// Beroende på vilket räknesätt användaren har valt, skall switchen printa ut den operatorns tabell
ArithmeticTable c = null;
switch (raknesatt) {
case "+":
c = new AdditionTable(xAxis, yAxis);
break;
case "-":
c = new SubtractionTable(xAxis, yAxis);
break;
case "*":
ArithmeticTable tableMultiply = new MultiplicationTable(xAxis, yAxis);
tableMultiply.print();
break;
case "/":
ArithmeticTable tableDivide = new DivisionTable(xAxis, yAxis);
tableDivide.print();
break;
}
c.print();
}
}
| [
"[email protected]"
] | |
902ebbf7ec12d0acecf49aa98caabd0626d57f6d | 5d0a4400151d75252618d41ea69c2f83604b2804 | /src/com/guhao/learn/chapter3/package-info.java | ce3111353d8a08845b2b679e1799236a37e3c277 | [] | no_license | ClearScenery/Java8-Learn | 07310f3e38f395e86ca2cd7cfad035579277414d | 9cdde534f73a8d59b4d8b35082b9990b85e2c8f8 | refs/heads/master | 2020-08-16T03:16:14.572990 | 2020-03-30T06:21:17 | 2020-03-30T06:21:17 | 215,448,084 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 33 | java | package com.guhao.learn.chapter3; | [
"[email protected]"
] | |
8c41dd10e27f79225a0405b094fe3b2ed88ca25f | 07711b6d6fcf4ae6a03e88fd50259c7acfcd99a8 | /assignments/week-6-assignment-5/W6-A5-ThreadedDownloads-StartedServices/src/edu/vuum/mocca/ThreadPoolDownloadService.java | cc7580607f6d2a67e792e956a322fb83e27f4587 | [] | no_license | micmarc/coursera-posa | afa06b431a786447a9c422f94d7234837cc48f60 | 8ff6276e90077c3793f3162ff3c3bcfd6244b351 | refs/heads/master | 2020-12-30T22:08:54.864831 | 2014-07-13T21:16:58 | 2014-07-13T21:16:58 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,063 | java | package edu.vuum.mocca;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.os.Handler;
import android.os.IBinder;
import android.os.Messenger;
import android.util.Log;
/**
* @class ThreadPoolDownloadService
*
* @brief This Service handles downloading several files concurrently
* within a pool of Threads. When it is created, it creates a
* ThreadPoolExecutor using the newFixedThreadPool() method of
* the Executors class.
*
* When this Service is started, it should be supplied with a
* URI for download and a Messenger. It downloads the URI
* supplied, stores it on the Android file system, then returns
* the pathname of the downloaded file using the supplied
* Messenger.
*
* This class implements the Synchronous Service layer of the
* Half-Sync/Half-Async pattern. It also implements a variant
* of the Factory Method pattern.
*/
public class ThreadPoolDownloadService extends Service {
/**
* A class constant that determines the maximum number of threads
* used to service download requests.
*/
static final int MAX_THREADS = 4;
/**
* The ExecutorService that references a ThreadPool.
*/
ExecutorService mExecutor;
/**
* Hook method called when the Service is created.
*/
@Override
public void onCreate() {
// TODO - You fill in here to replace null with a new
// FixedThreadPool Executor that's configured to use
// MAX_THREADS. Use a factory method in the Executors class.
mExecutor = Executors.newFixedThreadPool(MAX_THREADS);
}
/**
* Make an intent that will start this service if supplied to
* startService() as a parameter.
*
* @param context The context of the calling component.
* @param handler The handler that the service should
* use to respond with a result
* @param uri The web URL of a file to download
*
* This method utilizes the Factory Method makeMessengerIntent()
* from the DownloadUtils class. The returned intent is a Command
* in the Command Processor Pattern. The intent contains a
* messenger, which plays the role of Proxy in the Active Object
* Pattern.
*/
public static Intent makeIntent(Context context,
Handler handler,
String uri) {
// TODO - You fill in here, by replacing null with an
// invocation of the appropriate factory method in
// DownloadUtils that makes a MessengerIntent.
return DownloadUtils.makeMessengerIntent(context, ThreadPoolDownloadService.class,
handler, uri);
}
/**
* Hook method called when a component calls startService() with
* the proper Intent.
*/
@Override
public int onStartCommand(final Intent intent,
int flags,
int startId) {
// TODO - You fill in here to replace null with a new Runnable
// that the ThreadPoolExecutor will execute to download the
// image and respond to the client. The Runnable's run()
// method implementation should forward to the appropriate
// helper method from the DownloadUtils class that downloads
// the uri in the intent and returns the file's pathname using
// a Messenger who's Bundle key is defined by DownloadUtils.MESSENGER_KEY.
Runnable downloadRunnable = new Runnable() {
public void run() {
Messenger messenger = intent.getParcelableExtra(DownloadUtils.MESSENGER_KEY);
if (messenger == null) {
Log.e(DownloadUtils.TAG, "Messenger is null, aborting download!");
return;
}
DownloadUtils.downloadAndRespond(getApplicationContext(), intent.getData(),
messenger);
}
};
mExecutor.execute(downloadRunnable);
// Tell the Android framework how to behave if this service is
// interrupted. In our case, we want to restart the service
// then re-deliver the intent so that all files are eventually
// downloaded.
return START_REDELIVER_INTENT;
}
/**
* Called when the service is destroyed, which is the last call
* the Service receives informing it to clean up any resources it
* holds.
*/
@Override
public void onDestroy() {
// Ensure that the threads used by the ThreadPoolExecutor
// complete and are reclaimed by the system.
mExecutor.shutdown();
}
/**
* Return null since this class does not implement a Bound
* Service.
*/
@Override
public IBinder onBind (Intent intent) {
return null;
}
}
| [
"[email protected]"
] | |
0b27aaca9a34a02f933f6c667c71ea8a7a6d5a78 | 13ea5da0b7b8d4ba87d622a5f733dcf6b4c5f1e3 | /crash-reproduction-ws/results/XWIKI-13407-3-2-Single_Objective_GGA-WeightedSum/com/xpn/xwiki/store/XWikiCacheStore_ESTest.java | 0902a6041c510ed063917aa9ddbed7698bde84f4 | [
"MIT",
"CC-BY-4.0"
] | permissive | STAMP-project/Botsing-basic-block-coverage-application | 6c1095c6be945adc0be2b63bbec44f0014972793 | 80ea9e7a740bf4b1f9d2d06fe3dcc72323b848da | refs/heads/master | 2022-07-28T23:05:55.253779 | 2022-04-20T13:54:11 | 2022-04-20T13:54:11 | 285,771,370 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 556 | java | /*
* This file was automatically generated by EvoSuite
* Wed Apr 01 03:20:21 UTC 2020
*/
package com.xpn.xwiki.store;
import org.junit.Test;
import static org.junit.Assert.*;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.junit.runner.RunWith;
@RunWith(EvoRunner.class) @EvoRunnerParameters(useVFS = true, useJEE = true)
public class XWikiCacheStore_ESTest extends XWikiCacheStore_ESTest_scaffolding {
@Test
public void notGeneratedAnyTest() {
// EvoSuite did not generate any tests
}
}
| [
"[email protected]"
] | |
04db6339622b344fea4fcdc48c0480fb3ffa6713 | 6b7aac98c8612dd14c246f306e410f33319befca | /customermgt-jparepo/src/main/java/com/dxctraining/customermgt/util/CustomerUtil.java | 42065e3ffbcec0940b749dfa00d7c866945a7386 | [] | no_license | Pradeeparumugam/mongorepo-jparepo | 8c2bd381413e082a52e991a423a4ac6995bac05a | 169801acb4ba111a37a61cf67dadf8634ffba6ec | refs/heads/master | 2022-12-07T07:17:25.508957 | 2020-09-04T19:30:30 | 2020-09-04T19:30:30 | 292,474,399 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 383 | java | package com.dxctraining.customermgt.util;
import org.springframework.stereotype.Component;
import com.dxctraining.customermgt.dto.CustomerDto;
import com.dxctraining.customermgt.entities.Customer;
@Component
public class CustomerUtil {
public CustomerDto customerdto(Customer customer) {
CustomerDto dto=new CustomerDto(customer.getId(),customer.getName());
return dto;
}
}
| [
"[email protected]"
] | |
647b3c6871f5c5cdda9f7681e211f4d44b91f8c7 | 7e148f498cb76184a30bd44035f8cdb6a43ef71c | /app/src/main/java/dipesh/com/emergencyalertsystem/MyService.java | 2d7eb9a5dfc40f74c6f072ffe8d92c209d3c87a0 | [] | no_license | dipeshkoirala21/EmergencyAlertSystem | e5b48d1416b67c2042aa4474eab2b14084011e57 | 68edef97ac347734e033d0cbf8d091007d3813b3 | refs/heads/master | 2020-04-24T14:55:35.527400 | 2019-05-25T11:52:31 | 2019-05-25T11:52:31 | 172,044,044 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,304 | java | package dipesh.com.emergencyalertsystem.hk;
import android.Manifest;
import android.app.Service;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.location.Location;
import android.location.LocationManager;
import android.net.Uri;
import android.os.IBinder;
import android.os.Vibrator;
import android.support.v4.app.ActivityCompat;
import android.support.v4.content.ContextCompat;
import android.telephony.SmsManager;
import android.util.Log;
import java.util.ArrayList;
import java.util.List;
import java.util.Timer;
import java.util.TimerTask;
public class MyService extends Service {
static int count = 0;
private String msg;
private static BroadcastReceiver mybroadcast;
SettingsActivity settingsActivity;
SharedPreferences sharedPreferences;
public MyService() {
}
@Override
public IBinder onBind(Intent intent) {
return null;
}
@Override
public void onCreate() {
// registerReceiver(); /* Don't register the broadcast here */
}
@Override
public void onDestroy() {
unregisterReceiver(mybroadcast);
}
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
super.onStartCommand(intent, flags, startId);
registerReceiver();
return START_STICKY;
}
private void registerReceiver() {
mybroadcast = new BroadcastReceiver() {
//When Event is published, onReceive method is called
@Override
public void onReceive(Context context, Intent intent) {
if (intent.getAction() != null && intent.getAction().equals(Intent.ACTION_SCREEN_ON)) {
Log.i("[BroadcastReceiver]", "Screen ON");
count++;
} else if (intent.getAction().equals(Intent.ACTION_SCREEN_OFF)) {
Log.i("[BroadcastReceiver]", "Screen OFF");
count++;
}
Log.d("Count", Integer.toString(count));
if (count == 1) {
new Timer().schedule(new TimerTask() {
@Override
public void run() {
// Reset counter after 2.5 seconds so that it doesn't get false alarm
count = 0;
}
}, 2500);
}
if (count == 4) {
Log.i("[BroadcastReceiver]", "Power button clicked Four times");
Vibrator vibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);
if (vibrator != null && vibrator.hasVibrator()) {
vibrator.vibrate(400);
}
Location location = getLocation();
String stringLongitude, stringLatitude;
if (location != null) {
stringLongitude = Double.toString(location.getLongitude());
stringLatitude = Double.toString(location.getLatitude());
} else {
stringLatitude = "\'Not Available\'";
stringLongitude = "\'Not Available\'";
}
// AppDatabase db = AppDatabase.getAppDatabase(getApplicationContext());
String message = sharedPreferences.getString(settingsActivity.Messages, null);
String pContact = sharedPreferences.getString(settingsActivity.pContacts, null);
String sContact = sharedPreferences.getString(settingsActivity.sContacts, null);
List<String> mobNumber = new ArrayList<>();
mobNumber.add(pContact);
mobNumber.add(sContact);
SmsManager smsManager = SmsManager.getDefault();
// String gmapLink = "http://maps.google.com/maps?q=" + lati + ","+ longi;
//msg = "I am here at " + gmapLink + ". I need your help! Get to me Soon.";
String urlWithPrefix = " and I am at https://www.google.com/maps/search/?api=1&query=" + stringLatitude + "," + stringLongitude;
msg = message + urlWithPrefix;
for (String number : mobNumber) {
smsManager.sendTextMessage(number, null, msg, null, null);
Log.d("MSG", "sent message to " + number);
}
// Start a call to first contact
Intent call = new Intent(Intent.ACTION_CALL);
call.setData(Uri.parse("tel:" + mobNumber.get(0)));
call.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
if (ContextCompat.checkSelfPermission(getApplicationContext(), Manifest.permission.CALL_PHONE) != PackageManager.PERMISSION_GRANTED) {
//handle it
} else {
getApplicationContext().startActivity(call);
}
count = 0;
}
}
};
/// Register the broadcast receiver
registerReceiver(mybroadcast, new IntentFilter(Intent.ACTION_SCREEN_ON));
registerReceiver(mybroadcast, new IntentFilter(Intent.ACTION_SCREEN_OFF));
}
public Location getLocation() {
boolean gps_enabled = false;
boolean network_enabled = false;
LocationManager lm = (LocationManager) getApplicationContext()
.getSystemService(Context.LOCATION_SERVICE);
if (lm != null) {
gps_enabled = lm.isProviderEnabled(LocationManager.GPS_PROVIDER);
network_enabled = lm.isProviderEnabled(LocationManager.NETWORK_PROVIDER);
}
Location net_loc = null, gps_loc = null, finalLoc = null;
if (gps_enabled)
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
// TODO: Consider calling
// ActivityCompat#requestPermissions
// here to request the missing permissions, and then overriding
// public void onRequestPermissionsResult(int requestCode, String[] permissions,
// int[] grantResults)
// to handle the case where the user grants the permission. See the documentation
// for ActivityCompat#requestPermissions for more details.
return null;
}
assert lm != null;
gps_loc = lm.getLastKnownLocation(LocationManager.GPS_PROVIDER);
if (network_enabled)
net_loc = lm.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);
if (gps_loc != null) {
finalLoc = gps_loc;
} else if (net_loc != null) {
finalLoc = net_loc;
}
return finalLoc;
}
}
| [
"[email protected]"
] | |
9123650d001c517f784cbd98c425b4f0ff17db63 | ecddf6216f14cb6d87d8b8088097a8ea8bb9fd40 | /src/com/lele/algorithm/floyd/FloydAlgorithm.java | 0857636828652381da5dd5a956eed03a9532dd59 | [] | no_license | houwanle/datastructure | 0d92383368ee9483e08e7e1113409a7bd0150279 | 2a328e66e5f444614bcbe56a504c420626dff3d9 | refs/heads/master | 2023-01-30T14:35:20.569946 | 2020-12-20T02:16:05 | 2020-12-20T02:16:05 | 297,341,426 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,214 | java | package com.lele.algorithm.floyd;
import java.util.Arrays;
/**
* author: hwl
* date: 2020/12/17 21:45
* version: 1.0.0
* modified by:
* description: 弗洛伊德算法
*/
public class FloydAlgorithm {
public static void main(String[] args) {
// 测试
char[] vertex = {'A','B','C','D','E','F','G'};
// 创建邻接矩阵
int[][] matrix = new int[vertex.length][vertex.length];
final int N = 65535;
matrix[0] = new int[]{ 0, 5, 7, N, N, N, 2};
matrix[1] = new int[]{ 5, 0, N, 9, N, N, 3};
matrix[2] = new int[]{ 7, N, 0, N, 8, N, N};
matrix[3] = new int[]{ N, 9, N, 0, N, 4, N};
matrix[4] = new int[]{ N, N, 8, N, 0, 5, 4};
matrix[5] = new int[]{ N, N, N, 4, 5, 0, 6};
matrix[6] = new int[]{ 2, 3, N, N, 4, 6, 0};
// 创建Graph对象
Graph graph = new Graph(vertex.length, matrix, vertex);
graph.floyd();
graph.show();
}
}
// 创建图
class Graph {
private char[] vertex; // 存放顶点的数组
private int[][] dis; // 保存,从各个顶点出发到其他顶点的距离,最后的结果,也是保留在该数组
private int[][] pre; // 保存到达目标顶点的前驱顶点
/**
* 构造器
* @param length 大小
* @param matrix 领接矩阵
* @param vertex 顶点数组
*/
public Graph(int length, int[][] matrix, char[] vertex) {
this.vertex = vertex;
this.dis = matrix;
this.pre = new int[length][length];
// 对pre数组初始化, 存放的是前驱顶点的下标
for (int i = 0; i < length; i++) {
Arrays.fill(pre[i], i);
}
}
/**
* 显示pre数组和dis数组
*/
public void show() {
// 为了便于阅读
char[] vertex = {'A','B','C','D','E','F','G'};
for (int k = 0; k < dis.length; k++) {
// 先将pre数组输出一行
for (int i = 0; i < dis.length; i++) {
System.out.print(vertex[pre[k][i]] + " ");
}
System.out.println();
// 输出dis数组的一行数据
for (int i = 0; i < dis.length; i++) {
System.out.print("("+ vertex[k] + "到" + vertex[i] + "的最短路径是" + dis[k][i] + ") ");
}
System.out.println();
System.out.println();
}
}
public void floyd() {
int len = 0;// 变量保存距离
// 对中间结点遍历, k 就是中间顶点的下标
for (int k = 0; k < dis.length; k++) {
// 从i顶点开始出发 [A,B,C,D,E,F,G]
for (int i = 0; i < dis.length; i++) {
// 到达j顶点[A,B,C,D,E,F,G]
for (int j = 0; j < dis.length; j++) {
len = dis[i][k] + dis[k][j];//求出从i顶点出发,经过k中间顶点,到达j顶点距离
if (len < dis[i][j]) { // 如果len小于dis[i][j]
dis[i][j] = len;// 更新距离
pre[i][j] = pre[k][j];// 更新前驱顶点
}
}
}
}
}
}
| [
"[email protected]"
] | |
39b27e0a5bc2c9f3e41fcf2a63358cf7fad9cbc2 | 2cc15eeaaa10ea0460a2a4c74e3cc1cb6150c049 | /datasources/src/main/java/org/client/datasources/ResultSetResult.java | f3e53fe3a80ce103319dfb98c53b7431a7ffe5a9 | [] | no_license | lin848497337/mysql-client | cda7194aead70b3f1e3dfc327f095974ea40a2f9 | ff5a6d07307f469cf95792a5405e821fa533c3c4 | refs/heads/master | 2023-01-01T20:53:21.428199 | 2020-10-26T12:42:43 | 2020-10-26T12:42:43 | 306,822,292 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 667 | java | package org.client.datasources;
import java.util.ArrayList;
import java.util.List;
public class ResultSetResult extends ExecuteRsult{
private List<List<String>> resultList = new ArrayList<>();
private List<String> columnNameList = new ArrayList<>();
public void addRow(List<String> row){
resultList.add(row);
}
public void addColumn(String column){
columnNameList.add(column);
}
public List<List<String>> getResultList() {
return resultList;
}
public List<String> getColumnNameList() {
return columnNameList;
}
@Override
public boolean isQuery() {
return true;
}
}
| [
"[email protected]"
] | |
b2e0b1b818f4c66ab2379a5c319f093c124817f6 | fbf95d693ad5beddfb6ded0be170a9e810a10677 | /core-services/egov-data-uploader/src/main/java/org/egov/dataupload/property/models/Calculation.java | 12d584fa9aced8144a552d9944b3d5570ef018e5 | [
"MIT",
"LicenseRef-scancode-generic-cla"
] | permissive | egovernments/DIGIT-OSS | 330cc364af1b9b66db8914104f64a0aba666426f | bf02a2c7eb783bf9fdf4b173faa37f402e05e96e | refs/heads/master | 2023-08-15T21:26:39.992558 | 2023-08-08T10:14:31 | 2023-08-08T10:14:31 | 353,807,330 | 25 | 91 | MIT | 2023-09-10T13:23:31 | 2021-04-01T19:35:55 | Java | UTF-8 | Java | false | false | 950 | java | package org.egov.dataupload.property.models;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.*;
import java.math.BigDecimal;
import java.util.List;
/**
* Calculation
*/
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class Calculation {
@JsonProperty("serviceNumber")
private String serviceNumber;
@JsonProperty("totalAmount")
private BigDecimal totalAmount;
private BigDecimal taxAmount;
@JsonProperty("penalty")
private BigDecimal penalty;
@JsonProperty("exemption")
private BigDecimal exemption;
@JsonProperty("rebate")
private BigDecimal rebate;
@JsonProperty("fromDate")
private Long fromDate;
@JsonProperty("toDate")
private Long toDate;
@JsonProperty("tenantId")
private String tenantId;
List<TaxHeadEstimate> taxHeadEstimates;
}
| [
"[email protected]"
] | |
4c4704723db08382f64c69e8e9047567c16f31ca | d2cb1f4f186238ed3075c2748552e9325763a1cb | /methods_all/nonstatic_methods/javax_swing_text_html_parser_DTD_getClass.java | 255b2dcfd54e1ebbfa15e54b133f2ae9a18544a3 | [] | no_license | Adabot1/data | 9e5c64021261bf181b51b4141aab2e2877b9054a | 352b77eaebd8efdb4d343b642c71cdbfec35054e | refs/heads/master | 2020-05-16T14:22:19.491115 | 2019-05-25T04:35:00 | 2019-05-25T04:35:00 | 183,001,929 | 4 | 0 | null | null | null | null | UTF-8 | Java | false | false | 175 | java | class javax_swing_text_html_parser_DTD_getClass{ public static void function() {javax.swing.text.html.parser.DTD obj = new javax.swing.text.html.parser.DTD();obj.getClass();}} | [
"[email protected]"
] | |
6cd82292f183d87502f7d45e8c2ca3f66c276580 | 32653f6c95b48cad0d9ee75079575250f38040c0 | /app/src/main/java/com/example/brick/thezed/RecyclerViewAdapter.java | 5f6b6ea9feac49d7ea2c088d213414c04963923e | [] | no_license | BrickGoat/theZed | 0489c87d75b4a86ffe3b6fe0df0e8fd4806c3f97 | 6bb5c105169d43b9b4c613044da4e5741c20f85a | refs/heads/master | 2020-04-26T22:35:34.989369 | 2019-06-16T23:47:01 | 2019-06-16T23:47:01 | 173,876,978 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,565 | java | package com.example.brick.thezed;
import android.content.Context;
import android.content.Intent;
import android.support.annotation.NonNull;
import android.support.constraint.ConstraintLayout;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.bumptech.glide.Glide;
import java.util.ArrayList;
import de.hdodenhof.circleimageview.CircleImageView;
/**
*
*/
public class RecyclerViewAdapter extends RecyclerView.Adapter<RecyclerViewAdapter.ViewHolder> {
private static final String TAG = "RecyclerViewAdapter";
private ArrayList<ScheduleEntry> fullSchedule = new ArrayList<>();
private Context mContext;
private boolean typeOfList;
public class ViewHolder extends RecyclerView.ViewHolder {
CircleImageView image;
TextView title;
TextView dueDate;
ConstraintLayout parentLayout;
public ViewHolder(@NonNull View itemView) {
super(itemView);
this.image = itemView.findViewById(R.id.eventIcon);
this.title = itemView.findViewById(R.id.EntryTitle);
this.dueDate = itemView.findViewById(R.id.deadLine);
this.parentLayout = itemView.findViewById(R.id.parentLayout);
}
}
public RecyclerViewAdapter(Context mContext,
ArrayList<ScheduleEntry> fullSchedule, boolean typeOfList) {
this.mContext = mContext;
this.fullSchedule = fullSchedule;
this.typeOfList = typeOfList;
}
@NonNull
@Override
public ViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) {
View view = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.list_item, viewGroup, false);
ViewHolder holder = new ViewHolder(view);
return holder;
}
@Override
public void onBindViewHolder(@NonNull ViewHolder viewHolder, final int position) {
Log.d(TAG, "onBindViewHolder: called");
final ScheduleEntry entry = fullSchedule.get(position);
Glide.with(mContext)
.asBitmap()
.load(entry.getImageView())
.into(viewHolder.image);
viewHolder.title.setText(entry.getTitle());
viewHolder.dueDate.setText(entry.getStringFullDueDate());
viewHolder.parentLayout.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (typeOfList){
Intent details = new Intent(mContext, DetailedScheduleView.class);
details.putParcelableArrayListExtra("schedule", fullSchedule);
details.putExtra("entry", fullSchedule.get(position));
if (entry.getTitle() == null){
Log.d(TAG, "getIncomingIntent: ERROR NIGGA");
}
mContext.startActivity(details);}else {
Intent modify = new Intent(mContext, ModifyActivity.class);
modify.putParcelableArrayListExtra("schedule", fullSchedule);
modify.putExtra("entry", fullSchedule.get(position));
if (entry.getTitle() == null){
Log.d(TAG, "getIncomingIntent: ERROR NIGGA");
}
mContext.startActivity(modify);
}
}
});
}
@Override
public int getItemCount() {
return fullSchedule.size();
}
}
| [
"[email protected]"
] | |
23c4b86dca4e86055e349761b60c04adaea76ebe | b00f6a87525ad069359615ad2103cb9beb8109cb | /XinMa/app/src/main/java/com/mubly/xinma/base/BaseModel.java | f70cbc4e919da092f178bdf513315539292ca456 | [] | no_license | Mubly/XinMa | 26e0d3fb5869b3d3b55b49fc3b9f901592c09e30 | 1e5b576409c0d433b29f14d272a1a3087d5bf907 | refs/heads/master | 2022-11-15T20:54:50.661838 | 2020-07-15T14:03:22 | 2020-07-15T14:03:22 | 273,598,216 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 406 | java | package com.mubly.xinma.base;
import java.io.Serializable;
public class BaseModel implements Serializable {
private int code;
private String msg;
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
}
| [
"[email protected]"
] | |
446297cb77f8d916a0d7a3730138b5c8cbfa0cbe | 45ccf0c97d5d1c9fbdfd11474d018025704c8bdc | /CallBack/app/src/androidTest/java/com/pcs/callback/ApplicationTest.java | bcf47991840fd301cea02a8814f195449838c820 | [] | no_license | AvinashChowdary/Demos | 95b0103f930c11d64f663e911a336c2c3147d213 | 9b8b40fc105659d97e562b1e6096feec902c36d6 | refs/heads/master | 2020-06-14T16:44:43.162762 | 2016-11-30T06:22:44 | 2016-11-30T06:22:44 | 75,157,823 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 347 | java | package com.pcs.callback;
import android.app.Application;
import android.test.ApplicationTestCase;
/**
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
*/
public class ApplicationTest extends ApplicationTestCase<Application> {
public ApplicationTest() {
super(Application.class);
}
} | [
"[email protected]"
] | |
f606ab5ffb9836db78f8cc44dae1db27e04ad8f2 | 2e723cf1bb851d50b8c1905063775cf5d5bcf893 | /src/main/java/cn/hamster3/bot/service/WarFrameApiService.java | 9836161a4fec37c56dc7a161851c3b9691181df7 | [] | no_license | lumos-firefly/HamsterBot-IOTQQ | 0334efd006e6e40eb7a302fa01e16d6e1b108746 | ea690d719badd771feb37955ad5dff31e88851f5 | refs/heads/master | 2022-12-31T23:21:50.670054 | 2020-10-22T13:15:34 | 2020-10-22T13:15:34 | 263,797,819 | 0 | 0 | null | 2020-05-14T02:44:26 | 2020-05-14T02:44:25 | null | UTF-8 | Java | false | false | 153 | java | package cn.hamster3.bot.service;
/**
* @author wangjing <[email protected]>
* Created on 2020-05-22
*/
public interface WarFrameApiService {
}
| [
"[email protected]"
] | |
211bea9286ba9b1cc3b0920a4dc95b8417c3dc2c | e1d4f9e92d68cd9279ef05bd43ce6c439e23f9c8 | /workspace/MCFJavaTraining/src/classwork/datatypes/examplebythebestesttaNader.java | c3d72a1737c88031a147f0239eb5dd3bfce9b580 | [] | no_license | Vibertexs/MCFJava_June_2019 | b41df8b0d316481f772bf273cdde66525e539941 | 9ea32f5fbf12aec76eddf8d6c7083499650ea73a | refs/heads/master | 2022-10-05T14:40:59.917415 | 2022-10-03T02:39:19 | 2022-10-03T02:39:19 | 198,100,296 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 473 | java | package classwork.datatypes;
import java.util.Scanner;
public class examplebythebestesttaNader {
public static void main(String[] args) {
// TODO Auto-generated method stub
boolean yoG;
yoG = true;
while(true){
//callFunct();
System.out.println("Do you want to run again?input 0 ");
Scanner s = new Scanner(System.in);
int x = s.nextInt();
if(x ==1 ){
yoG = true;
}else if(x== 0 ){
yoG = false;
}
}
}
}
| [
"[email protected]"
] | |
7aa8046f2be9e4b4b09d993fa2ac4dee8f307c50 | 99c8c77649e75af50e40fcc55004c46f34a5934c | /src/p1/create/FilesE.java | 5b26a9867f4e1abdf6168a54a757297ea50209df | [] | no_license | xof96/Tarea1DAA | 5a987d9f5cb5186d0cd3f8289715cb176321d32c | 95a9a23289d428ce427563012ca9e4b05f45a0a8 | refs/heads/master | 2020-04-02T07:47:37.081884 | 2018-11-05T23:07:18 | 2018-11-05T23:07:18 | 154,215,338 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 253 | java | package p1.create;
import p1.test.FileTester;
public class FilesE {
public static void main(String[] args) {
String tPath = "times5.txt";
FileTester test = new FileTester();
test.insertionTestProducto(tPath, 5, 5);
}
}
| [
"[email protected]"
] | |
d0278783d35435edb75cc5e7a642d7bf8c29a983 | 728e846901e6490339df501b70fce32901d9837b | /src/main/java/com/dudu/itemselling/dto/SignInDTO.java | ef1606ea60c322358e36441a5c8a716895dc28f5 | [] | no_license | DuYeong0020/ItemSelling | 55733ca6d7122f525567396524b7e4f027da990b | f2e8b1fe830a1905357f62e57b7435fd91db308a | refs/heads/main | 2023-08-27T21:26:20.665484 | 2021-11-05T00:55:36 | 2021-11-05T00:55:36 | 412,981,031 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 407 | java | package com.dudu.itemselling.dto;
import lombok.Getter;
import lombok.Setter;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Size;
@Getter @Setter
public class SignInDTO { // 로그인
@NotEmpty
@Size(min = 10, max = 20)
private String userId; // 유저 아이디
@NotEmpty
@Size(min = 10, max = 20)
private String password; // 비밀번호
}
| [
"[email protected]"
] | |
68128bd3849e4baf14786ddccbb6ae2ec151767d | bdbfbde29897178bebc9069f1c934a932118c194 | /src/fif_core/exceptions/IllegalNumerOfValuesException.java | 8255074c2352fd41bbd09eeab8ddc30aedd9b5fe | [] | no_license | aleantonax/opennessMultiAtt | 0790a754f94ec3d3fbf1c6fe48627d410e0650bd | 0320f35890541069c922c7da5368851e787854e7 | refs/heads/master | 2021-01-10T14:27:20.594441 | 2016-02-23T11:02:56 | 2016-02-23T11:02:56 | 52,350,126 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 485 | java | package fif_core.exceptions;
/**This exception is launched when you try to aggregate a number of values not corresponding to number of weights.<br><br>
*
* @author Troiano Lorenzo
* @version 1.0
*/
public class IllegalNumerOfValuesException extends Exception {
private static final long serialVersionUID = 1L;
public IllegalNumerOfValuesException() {
super("The number of values of weights is not corresponding to the number of values you want aggregate.");
}
}
| [
"[email protected]"
] | |
ed069d7b5dcdd9e1ec4ccc31975088ac68849dec | 1ede954b8e31deb3d520557f2af4f809d294cc6d | /dynamic programming/rodcutting.java | 85e9485662017f04bd5d051c6e65e17c4b1bbb41 | [] | no_license | karanbangia/Data-structures-and-algorithms | 1facc4e007676de2ba9153cf8f6e35567bbcdaed | adc877d58ba4814bdadeb6cd4f2aea0ec7c88e7e | refs/heads/master | 2020-04-06T13:34:09.123782 | 2019-12-23T10:23:14 | 2019-12-23T10:23:14 | 157,505,683 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,090 | java | import java.util.*;
import java.lang.*;
import java.io.*;
class GFG {
static int rodcutting(int arr[],int n)
{
int dp[]=new int[n+1];
dp[0]=0;
int best;
for(int len=1;len<=n;len++)
{
for(int cut=1;cut<=len;cut++)
{
best=arr[cut]+dp[len-cut];
dp[len]=Math.max(dp[len],best);
}
}
return dp[n];
}
public static void main (String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
// taking input of number of testcase
int t = Integer.parseInt(br.readLine());
while(t-->0)
{
int n=Integer.parseInt(br.readLine());
int a[]=new int[n+1];
a[0]=0;
String line = br.readLine();
String[] strs = line.trim().split("\\s+");
int j=0;
for(int i=1;i<=n;i++)
{
a[i] = Integer.parseInt(strs[j]);
j++;
}
System.out.println(rodcutting(a,n));
}
br.close();
}
} | [
"[email protected]"
] | |
5e6f99197aaee0347c20e0348c6e28eee89c1ec5 | 47fb194fdd0dbe48fc411597ea58832d3336c5df | /Lec13_Class/src/com/lec/java/class03/Numeric.java | 87ff7816cc6dd3c0f08679ccae1d152461a4b972 | [] | no_license | djse2002/JavaWork.back | 80d33c1c9475a68262ab47b1d6452e560db8f979 | 4c960931566de1c9cf3887faf1b0c4375580ecca | refs/heads/master | 2022-06-09T12:11:03.592830 | 2020-05-06T14:23:15 | 2020-05-06T14:23:15 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 884 | java | package com.lec.java.class03;
public class Numeric {
// 멤버변수
private char ch;
private byte operator;
private int operand1;
private int opernad2;
public Numeric(char ch, byte operator, int operand1, int opernad2) {
super();
this.ch = ch;
this.operator = operator;
this.operand1 = operand1;
this.opernad2 = opernad2;
}
public Numeric() {
super();
}
public char getCh() {
return ch;
}
public void setCh(char ch) {
this.ch = ch;
}
public byte getOperator() {
return operator;
}
public void setOperator(byte operator) {
this.operator = operator;
}
public int getOperand1() {
return operand1;
}
public void setOperand1(int operand1) {
this.operand1 = operand1;
}
public int getOpernad2() {
return opernad2;
}
public void setOpernad2(int opernad2) {
this.opernad2 = opernad2;
}
}
| [
"[email protected]"
] | |
f42cd4976ed2763b29d7cc52e6f7426b65a77b3c | 1ec1773fd62e0a48f5c042ab0c5547decc9ac11b | /presto-redis/src/test/java/com/facebook/presto/redis/util/JsonEncoder.java | f2c6e9ddf6bef0019e084cd4fe95861dde055578 | [
"Apache-2.0"
] | permissive | zuoyebushiwo/weiwodb | 71c31a2c82c84eab959020aee9ce784ea43518cc | 6768496f0b6aa1e8d6f486e71e4711a1a3432c84 | refs/heads/master | 2021-09-06T09:56:34.499258 | 2018-02-05T07:41:20 | 2018-02-05T07:41:20 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,070 | 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 com.facebook.presto.redis.util;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.base.Throwables;
import java.io.IOException;
public class JsonEncoder
{
private final ObjectMapper objectMapper = new ObjectMapper();
public String toString(Object o)
{
try {
return objectMapper.writeValueAsString(o);
}
catch (IOException e) {
throw Throwables.propagate(e);
}
}
}
| [
"[email protected]"
] | |
3ccde72d83d9f69d7645a80f80f95a74d25ba9d5 | 83ed57c3e1774607e8cc0c54103157d9a8702a50 | /src/slim3/controller/tools/rese/customerManage/CustomerDetailController.java | b6f883902bf511c69c1937b7785e411056305295 | [] | no_license | daiki0929/dd | 5b4a1bfb0731ce6122f4397f4b94a32246c94bc9 | 3950cbd20520682b7a88e43dc4eda14467e39b67 | refs/heads/master | 2021-01-21T14:04:48.484073 | 2016-05-21T08:24:38 | 2016-05-21T08:24:38 | 47,277,432 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,310 | java | package slim3.controller.tools.rese.customerManage;
import java.util.List;
import org.slim3.controller.Navigation;
import org.slim3.datastore.Datastore;
import com.google.appengine.api.datastore.Key;
import slim3.controller.tools.rese.AbstractReseController;
import slim3.meta.reserve.ReserveMeta;
import slim3.model.customerManage.Customer;
import slim3.model.reserve.Reserve;
/**
* カスタマーの詳細を表示します。
* @author uedadaiki
*
*/
public class CustomerDetailController extends AbstractReseController {
@Override
public Navigation run() throws Exception {
//認証機能
if (!authService.isMsAuth(request, msUserDto, errors)) {
return super.showLoginPage();
}
Key customerKey = asKey("id");
Customer customer = customerService.get(customerKey);
ReserveMeta reserveMeta = ReserveMeta.get();
List<Reserve> reserveList = Datastore
.query(reserveMeta)
.filter(reserveMeta.customerRef.equal(customer.getKey()))
.asList();
request.setAttribute("customer", customer);
request.setAttribute("reserveList", reserveList);
return forward("/tools/rese/dashboard/customerManage/customerDetail.jsp");
}
}
| [
"[email protected]"
] | |
918226279d2ee051525fd4cdb7d0c22059e65bd5 | e5e026dde45754ef5e0c7e161d64f2630a256153 | /src/main/java/com/self/pojo/FriendsRequestExample.java | be9d7f29be32ab435a3d9f859e21af0d9b9fde92 | [] | no_license | gavin-xuwenb/mybatis-auto | 310592de50959e42ccaf24abe04032ae103e88f3 | 0084ac31e5038f4f93d8d273dc551eb7a58aa13f | refs/heads/master | 2022-12-07T12:10:55.136480 | 2020-08-21T07:30:44 | 2020-08-21T07:30:44 | 289,202,064 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 16,870 | java | package com.self.pojo;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class FriendsRequestExample {
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table friends_request
*
* @mbggenerated
*/
protected String orderByClause;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table friends_request
*
* @mbggenerated
*/
protected boolean distinct;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table friends_request
*
* @mbggenerated
*/
protected List<Criteria> oredCriteria;
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table friends_request
*
* @mbggenerated
*/
public FriendsRequestExample() {
oredCriteria = new ArrayList<Criteria>();
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table friends_request
*
* @mbggenerated
*/
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table friends_request
*
* @mbggenerated
*/
public String getOrderByClause() {
return orderByClause;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table friends_request
*
* @mbggenerated
*/
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table friends_request
*
* @mbggenerated
*/
public boolean isDistinct() {
return distinct;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table friends_request
*
* @mbggenerated
*/
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table friends_request
*
* @mbggenerated
*/
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table friends_request
*
* @mbggenerated
*/
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table friends_request
*
* @mbggenerated
*/
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table friends_request
*
* @mbggenerated
*/
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table friends_request
*
* @mbggenerated
*/
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table friends_request
*
* @mbggenerated
*/
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(String value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(String value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(String value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(String value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(String value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(String value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdLike(String value) {
addCriterion("id like", value, "id");
return (Criteria) this;
}
public Criteria andIdNotLike(String value) {
addCriterion("id not like", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<String> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<String> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(String value1, String value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(String value1, String value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andSendUserIdIsNull() {
addCriterion("send_user_id is null");
return (Criteria) this;
}
public Criteria andSendUserIdIsNotNull() {
addCriterion("send_user_id is not null");
return (Criteria) this;
}
public Criteria andSendUserIdEqualTo(String value) {
addCriterion("send_user_id =", value, "sendUserId");
return (Criteria) this;
}
public Criteria andSendUserIdNotEqualTo(String value) {
addCriterion("send_user_id <>", value, "sendUserId");
return (Criteria) this;
}
public Criteria andSendUserIdGreaterThan(String value) {
addCriterion("send_user_id >", value, "sendUserId");
return (Criteria) this;
}
public Criteria andSendUserIdGreaterThanOrEqualTo(String value) {
addCriterion("send_user_id >=", value, "sendUserId");
return (Criteria) this;
}
public Criteria andSendUserIdLessThan(String value) {
addCriterion("send_user_id <", value, "sendUserId");
return (Criteria) this;
}
public Criteria andSendUserIdLessThanOrEqualTo(String value) {
addCriterion("send_user_id <=", value, "sendUserId");
return (Criteria) this;
}
public Criteria andSendUserIdLike(String value) {
addCriterion("send_user_id like", value, "sendUserId");
return (Criteria) this;
}
public Criteria andSendUserIdNotLike(String value) {
addCriterion("send_user_id not like", value, "sendUserId");
return (Criteria) this;
}
public Criteria andSendUserIdIn(List<String> values) {
addCriterion("send_user_id in", values, "sendUserId");
return (Criteria) this;
}
public Criteria andSendUserIdNotIn(List<String> values) {
addCriterion("send_user_id not in", values, "sendUserId");
return (Criteria) this;
}
public Criteria andSendUserIdBetween(String value1, String value2) {
addCriterion("send_user_id between", value1, value2, "sendUserId");
return (Criteria) this;
}
public Criteria andSendUserIdNotBetween(String value1, String value2) {
addCriterion("send_user_id not between", value1, value2, "sendUserId");
return (Criteria) this;
}
public Criteria andAcceptUserIdIsNull() {
addCriterion("accept_user_id is null");
return (Criteria) this;
}
public Criteria andAcceptUserIdIsNotNull() {
addCriterion("accept_user_id is not null");
return (Criteria) this;
}
public Criteria andAcceptUserIdEqualTo(String value) {
addCriterion("accept_user_id =", value, "acceptUserId");
return (Criteria) this;
}
public Criteria andAcceptUserIdNotEqualTo(String value) {
addCriterion("accept_user_id <>", value, "acceptUserId");
return (Criteria) this;
}
public Criteria andAcceptUserIdGreaterThan(String value) {
addCriterion("accept_user_id >", value, "acceptUserId");
return (Criteria) this;
}
public Criteria andAcceptUserIdGreaterThanOrEqualTo(String value) {
addCriterion("accept_user_id >=", value, "acceptUserId");
return (Criteria) this;
}
public Criteria andAcceptUserIdLessThan(String value) {
addCriterion("accept_user_id <", value, "acceptUserId");
return (Criteria) this;
}
public Criteria andAcceptUserIdLessThanOrEqualTo(String value) {
addCriterion("accept_user_id <=", value, "acceptUserId");
return (Criteria) this;
}
public Criteria andAcceptUserIdLike(String value) {
addCriterion("accept_user_id like", value, "acceptUserId");
return (Criteria) this;
}
public Criteria andAcceptUserIdNotLike(String value) {
addCriterion("accept_user_id not like", value, "acceptUserId");
return (Criteria) this;
}
public Criteria andAcceptUserIdIn(List<String> values) {
addCriterion("accept_user_id in", values, "acceptUserId");
return (Criteria) this;
}
public Criteria andAcceptUserIdNotIn(List<String> values) {
addCriterion("accept_user_id not in", values, "acceptUserId");
return (Criteria) this;
}
public Criteria andAcceptUserIdBetween(String value1, String value2) {
addCriterion("accept_user_id between", value1, value2, "acceptUserId");
return (Criteria) this;
}
public Criteria andAcceptUserIdNotBetween(String value1, String value2) {
addCriterion("accept_user_id not between", value1, value2, "acceptUserId");
return (Criteria) this;
}
public Criteria andRequestDateTimeIsNull() {
addCriterion("request_date_time is null");
return (Criteria) this;
}
public Criteria andRequestDateTimeIsNotNull() {
addCriterion("request_date_time is not null");
return (Criteria) this;
}
public Criteria andRequestDateTimeEqualTo(Date value) {
addCriterion("request_date_time =", value, "requestDateTime");
return (Criteria) this;
}
public Criteria andRequestDateTimeNotEqualTo(Date value) {
addCriterion("request_date_time <>", value, "requestDateTime");
return (Criteria) this;
}
public Criteria andRequestDateTimeGreaterThan(Date value) {
addCriterion("request_date_time >", value, "requestDateTime");
return (Criteria) this;
}
public Criteria andRequestDateTimeGreaterThanOrEqualTo(Date value) {
addCriterion("request_date_time >=", value, "requestDateTime");
return (Criteria) this;
}
public Criteria andRequestDateTimeLessThan(Date value) {
addCriterion("request_date_time <", value, "requestDateTime");
return (Criteria) this;
}
public Criteria andRequestDateTimeLessThanOrEqualTo(Date value) {
addCriterion("request_date_time <=", value, "requestDateTime");
return (Criteria) this;
}
public Criteria andRequestDateTimeIn(List<Date> values) {
addCriterion("request_date_time in", values, "requestDateTime");
return (Criteria) this;
}
public Criteria andRequestDateTimeNotIn(List<Date> values) {
addCriterion("request_date_time not in", values, "requestDateTime");
return (Criteria) this;
}
public Criteria andRequestDateTimeBetween(Date value1, Date value2) {
addCriterion("request_date_time between", value1, value2, "requestDateTime");
return (Criteria) this;
}
public Criteria andRequestDateTimeNotBetween(Date value1, Date value2) {
addCriterion("request_date_time not between", value1, value2, "requestDateTime");
return (Criteria) this;
}
}
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table friends_request
*
* @mbggenerated do_not_delete_during_merge
*/
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table friends_request
*
* @mbggenerated
*/
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.noValue = true;
}
protected Criterion(String condition, Object value) {
super();
this.condition = condition;
this.value = value;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value, Object secondValue) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.betweenValue = true;
}
}
} | [
"[email protected]"
] | |
7ab353b7933275ad7eaabd72a7641b522d09256f | a01f61133ec57a943e4f2faf229598d3c4135967 | /PulseOximeter.java | 6b8584a4a554c6322024432600165dffb0a9fcbb | [] | no_license | KhadidzhaAgaeva/Capstone1236 | 40e329d6fc5eb094287206e722108c6a2f800d9a | 5088343ccbd565e3ecdf6361c06624119ac2414c | refs/heads/main | 2023-05-27T08:29:06.810011 | 2021-06-07T21:06:41 | 2021-06-07T21:06:41 | 350,071,731 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,488 | java | package com.example.capstone;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import com.github.mikephil.charting.data.Entry;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.ValueEventListener;
import java.util.ArrayList;
import java.util.Map;
public class PulseOximeter extends AppCompatActivity {
int outp;
TextView OxiSattxxt;
TextView condtxt;
EditText txtenter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_pulse_oximeter);
OxiSattxxt = (TextView)findViewById(R.id.OxiSattxxt);
condtxt = (TextView)findViewById(R.id.conttxt);
txtenter= (EditText)findViewById(R.id.txtenter);
Button btnAdd=(Button)findViewById(R.id.btnAdd);
btnAdd.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
outp=Integer.valueOf(txtenter.getText().toString());
OxiSattxxt.setText(" " +outp+ " %");
if (outp <92){
condtxt.setText(" CRITICAL");
}else if (outp > 92 && outp < 94){
condtxt.setText("Click to Enter Peak Flow Results");
condtxt.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(PulseOximeter.this, PeakFlow.class);
startActivity(intent);
}
});
}else {
condtxt.setText("GOOD");
}
}
});
Button button = (Button)findViewById(R.id.settbtn);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(PulseOximeter.this , Setting.class);
startActivity(intent);
}
});
}
}
| [
"[email protected]"
] | |
302bb7cad529c6f5e1c2c7ad7eec6c67c2dd7aeb | e8c380ee486374f52e588fb060055a8675939e76 | /src/main/java/myrpc/consumer/RpcConsumer.java | f72aa607bfe87c76ebc9c1195a98d09db99dae53 | [] | no_license | Xusheng94/myrpcframwork | f36d4ee4b4a5efb4315bf9790617706b7a5aa6a5 | fe1cd7eb915760a08761451db08511225e6cb756 | refs/heads/master | 2020-03-14T17:46:54.996096 | 2018-05-01T15:19:34 | 2018-05-01T15:19:34 | 131,728,065 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 584 | java | package myrpc.consumer;
import myrpc.framework.RpcFrameWork;
import myrpc.service.HelloService;
/**
* @Description RpcConsumer
* @Author xusheng
* @Create 2018-05-01 23:01
* @Version 1.0
**/
public class RpcConsumer {
public static void main(String[] args) throws Exception {
HelloService helloService = RpcFrameWork.refer(HelloService.class,"127.0.0.1",1234);
for (int i = 0; i <Integer.MAX_VALUE ; i++) {
String hello = helloService.hello("World "+i);
System.out.println(hello);
Thread.sleep(1000);
}
}
}
| [
"[email protected]"
] | |
75ac8dd1139609c7dedb6b1a3cd8233bc9dc89a4 | c3e873c60b2b9990cdf47c9b4e5fca9ba70a0557 | /core/src/main/java/de/danoeh/antennapod/core/asynctask/PicassoProvider.java | 1ed29c23a6a7f469ec766110005013ef00bd860b | [
"MIT"
] | permissive | geir54/AntennaPod | 3e51c7a647f05bc2bf46a8fc5947435ec4aeb422 | 9659c18d899349d9be1573fb9520defc7d3a19cd | refs/heads/master | 2020-12-25T11:41:59.180172 | 2014-12-08T18:18:34 | 2014-12-08T18:18:34 | 21,230,988 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,036 | java | package de.danoeh.antennapod.core.asynctask;
import android.content.ContentResolver;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.media.MediaMetadataRetriever;
import android.net.Uri;
import android.util.Log;
import com.squareup.picasso.Cache;
import com.squareup.picasso.LruCache;
import com.squareup.picasso.OkHttpDownloader;
import com.squareup.picasso.Picasso;
import com.squareup.picasso.Request;
import com.squareup.picasso.RequestHandler;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
/**
* Provides access to Picasso instances.
*/
public class PicassoProvider {
private static final String TAG = "PicassoProvider";
private static final boolean DEBUG = false;
private static ExecutorService executorService;
private static Cache memoryCache;
private static synchronized ExecutorService getExecutorService() {
if (executorService == null) {
executorService = Executors.newFixedThreadPool(3);
}
return executorService;
}
private static synchronized Cache getMemoryCache(Context context) {
if (memoryCache == null) {
memoryCache = new LruCache(context);
}
return memoryCache;
}
private static volatile boolean picassoSetup = false;
public static synchronized void setupPicassoInstance(Context appContext) {
if (picassoSetup) {
return;
}
Picasso picasso = new Picasso.Builder(appContext)
.indicatorsEnabled(DEBUG)
.loggingEnabled(DEBUG)
.downloader(new OkHttpDownloader(appContext))
.addRequestHandler(new MediaRequestHandler(appContext))
.executor(getExecutorService())
.memoryCache(getMemoryCache(appContext))
.listener(new Picasso.Listener() {
@Override
public void onImageLoadFailed(Picasso picasso, Uri uri, Exception e) {
Log.e(TAG, "Failed to load Uri:" + uri.toString());
e.printStackTrace();
}
})
.build();
Picasso.setSingletonInstance(picasso);
picassoSetup = true;
}
private static class MediaRequestHandler extends RequestHandler {
final Context context;
public MediaRequestHandler(Context context) {
super();
this.context = context;
}
@Override
public boolean canHandleRequest(Request data) {
return StringUtils.equals(data.uri.getScheme(), PicassoImageResource.SCHEME_MEDIA);
}
@Override
public Result load(Request data) throws IOException {
Bitmap bitmap = null;
MediaMetadataRetriever mmr = null;
try {
mmr = new MediaMetadataRetriever();
mmr.setDataSource(data.uri.getPath());
byte[] image = mmr.getEmbeddedPicture();
if (image != null) {
bitmap = decodeStreamFromByteArray(data, image);
}
} catch (RuntimeException e) {
Log.e(TAG, "Failed to decode image in media file", e);
} finally {
if (mmr != null) {
mmr.release();
}
}
if (bitmap == null) {
// check for fallback Uri
String fallbackParam = data.uri.getQueryParameter(PicassoImageResource.PARAM_FALLBACK);
if (fallbackParam != null) {
Uri fallback = Uri.parse(fallbackParam);
bitmap = decodeStreamFromFile(data, fallback);
}
}
return new Result(bitmap, Picasso.LoadedFrom.DISK);
}
/* Copied/Adapted from Picasso RequestHandler classes */
private Bitmap decodeStreamFromByteArray(Request data, byte[] bytes) throws IOException {
final BitmapFactory.Options options = createBitmapOptions(data);
final ByteArrayInputStream in = new ByteArrayInputStream(bytes);
in.mark(0);
if (requiresInSampleSize(options)) {
try {
BitmapFactory.decodeStream(in, null, options);
} finally {
in.reset();
}
calculateInSampleSize(data.targetWidth, data.targetHeight, options, data);
}
try {
return BitmapFactory.decodeStream(in, null, options);
} finally {
IOUtils.closeQuietly(in);
}
}
private Bitmap decodeStreamFromFile(Request data, Uri uri) throws IOException {
ContentResolver contentResolver = context.getContentResolver();
final BitmapFactory.Options options = createBitmapOptions(data);
if (requiresInSampleSize(options)) {
InputStream is = null;
try {
is = contentResolver.openInputStream(uri);
BitmapFactory.decodeStream(is, null, options);
} finally {
IOUtils.closeQuietly(is);
}
calculateInSampleSize(data.targetWidth, data.targetHeight, options, data);
}
InputStream is = contentResolver.openInputStream(uri);
try {
return BitmapFactory.decodeStream(is, null, options);
} finally {
IOUtils.closeQuietly(is);
}
}
private BitmapFactory.Options createBitmapOptions(Request data) {
final boolean justBounds = data.hasSize();
final boolean hasConfig = data.config != null;
BitmapFactory.Options options = null;
if (justBounds || hasConfig) {
options = new BitmapFactory.Options();
options.inJustDecodeBounds = justBounds;
if (hasConfig) {
options.inPreferredConfig = data.config;
}
}
return options;
}
private static boolean requiresInSampleSize(BitmapFactory.Options options) {
return options != null && options.inJustDecodeBounds;
}
private static void calculateInSampleSize(int reqWidth, int reqHeight, BitmapFactory.Options options,
Request request) {
calculateInSampleSize(reqWidth, reqHeight, options.outWidth, options.outHeight, options,
request);
}
private static void calculateInSampleSize(int reqWidth, int reqHeight, int width, int height,
BitmapFactory.Options options, Request request) {
int sampleSize = 1;
if (height > reqHeight || width > reqWidth) {
final int heightRatio;
final int widthRatio;
if (reqHeight == 0) {
sampleSize = (int) Math.floor((float) width / (float) reqWidth);
} else if (reqWidth == 0) {
sampleSize = (int) Math.floor((float) height / (float) reqHeight);
} else {
heightRatio = (int) Math.floor((float) height / (float) reqHeight);
widthRatio = (int) Math.floor((float) width / (float) reqWidth);
sampleSize = request.centerInside
? Math.max(heightRatio, widthRatio)
: Math.min(heightRatio, widthRatio);
}
}
options.inSampleSize = sampleSize;
options.inJustDecodeBounds = false;
}
}
}
| [
"[email protected]"
] | |
1449b9380e1bf3b3a79d3ae210dfd43907a75a64 | cb153ac2b98f76155612dfcc3473c9622dd74af4 | /src/main/java/com/cpunisher/server/HttpSessionConfigurator.java | 1cddfd796280b6336cb41bd25ba0c7fbf5679060 | [] | no_license | shakenetwork/ssm-KingOfWords | 4f56fe1053b92fdafd8721b81744c8b16ee0cad5 | bbf704c8c0b43e87939b6cd890009cf91da6e2a0 | refs/heads/master | 2023-05-08T22:18:04.020379 | 2020-01-09T03:33:31 | 2020-01-09T03:33:31 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 700 | java | package com.cpunisher.server;
import org.springframework.web.socket.server.standard.SpringConfigurator;
import javax.servlet.http.HttpSession;
import javax.websocket.HandshakeResponse;
import javax.websocket.server.HandshakeRequest;
import javax.websocket.server.ServerEndpointConfig;
public class HttpSessionConfigurator extends SpringConfigurator {
@Override
public void modifyHandshake(ServerEndpointConfig sec, HandshakeRequest request, HandshakeResponse response) {
super.modifyHandshake(sec, request, response);
HttpSession httpSession = (HttpSession) request.getHttpSession();
sec.getUserProperties().put(HttpSession.class.getName(), httpSession);
}
}
| [
"[email protected]"
] | |
5f0e8e94ddb2f983c76eadae8072bad52bc35419 | ff47efb7eed1226fbae06d2a91ebe30c1da7ca80 | /12308Ticket/app/src/main/java/com/wxws/myticket/train/entity/SelectBusEntity.java | fffa16c8e7f537f75983238001640c6639c7e847 | [] | no_license | Poney1/12308Ticket | 202048fd36c57ad41f6396452b09e377b1eefe22 | 37aef8feefe8922ff56d0deea1d725c04f28e0e6 | refs/heads/master | 2021-01-19T14:50:34.502865 | 2017-03-30T00:38:49 | 2017-03-30T00:38:49 | 86,642,027 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,865 | java | package com.wxws.myticket.train.entity;
import com.wxws.myticket.common.utils.StringUtils;
import java.io.Serializable;
/**
* desc: 上下车
* user: lixiangxiang
* date: 2016-03-31
* time: 09:08
*/
public class SelectBusEntity implements Serializable, Comparable {
private String station;//上下车点
private int isSelected; //是否选中 1 选中,0 未选中
private String ticketType;//车票类型
private String price;//价格排序
private int selectCondition;//选择条件
public final static int TICKET_UP = 0;//上车点
public final static int TICKET_DOWN = 1;//下车点
public final static int TICKET_PRICE = 2;//价格
public final static int TICKET_TYPE = 3;//车票类型筛选
public SelectBusEntity(String station, String price, String ticketType, int selectCondition, int isSelected) {
this.station = station;
this.isSelected = isSelected;
this.ticketType = ticketType;
this.price = price;
this.selectCondition = selectCondition;
}
public int getSelectCondition() {
return selectCondition;
}
public void setSelectCondition(int selectCondition) {
this.selectCondition = selectCondition;
}
public String getTicketType() {
return ticketType;
}
public void setTicketType(String ticketType) {
this.ticketType = ticketType;
}
public String getPrice() {
return price;
}
public void setPrice(String price) {
this.price = price;
}
public int getIsSelected() {
return isSelected;
}
public void setIsSelected(int isSelected) {
this.isSelected = isSelected;
}
public String getStation() {
return station;
}
public void setStation(String station) {
this.station = station;
}
public int hashCode() {
if (!StringUtils.isNullOrEmpty(this.station)) {
return station.hashCode();
} else if (!StringUtils.isNullOrEmpty(this.ticketType)) {
return ticketType.hashCode();
}
return 1000;
}
public int compareTo(Object another) {
SelectBusEntity slt = (SelectBusEntity) another;
if (!StringUtils.isNullOrEmpty(this.station)) {
return this.station.compareTo(slt.station);
} else if (!StringUtils.isNullOrEmpty(this.ticketType)) {
return this.ticketType.compareTo(slt.ticketType);
}
return 0;
}
public boolean equals(Object obj) {
SelectBusEntity s = (SelectBusEntity) obj;
if (!StringUtils.isNullOrEmpty(this.station)) {
return this.station.equals(s.station);
} else if (!StringUtils.isNullOrEmpty(this.ticketType)) {
return this.ticketType.equals(s.ticketType);
}
return false;
}
}
| [
"[email protected]"
] | |
f03611e6bbf5c6f6446fd5f487d9210c45ef76bd | 32f2c4645d46d9aa266a66c96cda1f7e70b06823 | /matthew-javaBase-practice/src/main/java/com/matthew/javabase/multiply/Interrupted.java | 672b9d47ee54193b792c772592ca4ba01c3d3b70 | [] | no_license | yezijiang/matthew-alpha | e3ebb7ee2576b8a3603469d9104c149dfc9e2b6c | 5b477aa292c86b45dbac04a14dbcc0ef99599bac | refs/heads/master | 2023-08-17T09:58:21.897726 | 2023-08-10T02:44:00 | 2023-08-10T02:44:00 | 70,868,183 | 0 | 0 | null | 2022-12-16T06:33:15 | 2016-10-14T02:52:26 | Java | UTF-8 | Java | false | false | 1,172 | java | package com.matthew.javabase.multiply;
/**
* Created with IntelliJ IDEA
* User: maxing
* TIME: 2016-08-08 10:18
*/
public class Interrupted {
public static void main(String[] args) {
Thread sleepThread = new Thread(new SleepRunner(),"SleepThread");
sleepThread.setDaemon(true);
Thread busyThread = new Thread(new BusyRunner(),"BusyThread");
busyThread.setDaemon(true);
sleepThread.start();
busyThread.start();
/**休息5秒,充分确保两个线程启动**/
SleepUtils.second(5);
sleepThread.interrupt();
busyThread.interrupt();
System.out.println("sleepThread isinterrupted is "+sleepThread.isInterrupted());
System.out.println("busyThread isinterrupted is" + busyThread.isInterrupted());
}
/**一直休眠**/
static class SleepRunner implements Runnable{
public void run() {
while(true){
SleepUtils.second(10);
}
}
}
/** 一直不停地工作 **/
static class BusyRunner implements Runnable{
public void run() {
while(true){
}
}
}
}
| [
"[email protected]"
] | |
c88e0be739b5c111eb2290315169220f7b46c63c | 327fe4f2f236429600b5aea57d4a494a2e9dcaa9 | /Step10/src/SubjectMain.java | 140246ac401745f1a9427964bd28832517f0c9af | [] | no_license | NamSangKyu/JAVA2109 | e62d957dd8987c76b79de905f871f1213889aa86 | 0f0436384a7cc289018c698589e5fa9bee41796f | refs/heads/main | 2023-08-28T06:13:25.298662 | 2021-11-08T12:44:20 | 2021-11-08T12:44:20 | 404,323,107 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 443 | java |
public class SubjectMain {
public static void main(String[] args) {
Subject s = new Subject("국어", 95);
s.printSubjectInfo();
// s.score = 110;
//set get 외부에서 데이터를 받거나 setting 하는것이 가능
s.setScore(84);
System.out.println(s.getScore());
s.printSubjectInfo();
//method도 접근제어자가 private 걸려있으면 외부에선 사용 불가
// System.out.println(s.getGrade());
}
}
| [
"[email protected]"
] | |
e233e50bf68da6d1add9020e45a816f1d0756d65 | cb8ed8110ecd06f51cd3d751f4ec1b06869a714a | /src/classExercise/TelcelSeleccionarArticulo.java | 6c4353cbf1dd042991d53aec1255a2a0e9fd1350 | [] | no_license | ArleneAviles/introWebDriver | ff8e6a54b7e303858635eab7b2f576d1afaea1ae | 0680176dabfb6fe24f7a3e9b779dd51a9fcd59c3 | refs/heads/master | 2022-10-23T01:17:25.291266 | 2020-06-12T23:24:04 | 2020-06-12T23:24:04 | 269,455,077 | 0 | 0 | null | 2020-06-04T20:08:52 | 2020-06-04T20:08:52 | null | UTF-8 | Java | false | false | 720 | java | package classExercise;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import java.util.List;
import java.util.concurrent.TimeUnit;
public class TelcelSeleccionarArticulo extends TelcelParent{
public static void main(String[] args) {
navegarSitio("https://www.telcel.com");
verificarLandingPage();
listarTelefonos();
seleccionarEstado("Jalisco");
verificarPaginaResultados();
Celular primerCelular;
primerCelular = capturarDatosCelular(1);
seleccionarCelular(1);
validarDatosCelular(primerCelular);
cerrarBrowser();
}
} | [
"[email protected]"
] | |
c0da35c0d753c49e3b037f1f044e14717a3c7e62 | 69794b14590c7049970c00377a18186894d45c6e | /app/src/main/java/bo/nuevo/lifeissweet/BakeryDetailsActivity.java | 6f47d75c466a7b1589760cb4799030fdfee4f9b0 | [] | no_license | griscellazo/LIFE_IS_SWEET | 41e41e2a97c8f259093ed8afaeac5eea0c1b8c16 | add470fe9aa29231c5bdc46e6e3bc141d0117f78 | refs/heads/master | 2020-05-17T12:43:14.408088 | 2019-04-27T02:18:52 | 2019-04-27T02:18:52 | 183,718,065 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,475 | java | package bo.nuevo.lifeissweet;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.widget.ImageView;
import android.widget.TextView;
import com.google.gson.Gson;
import bo.nuevo.lifeissweet.model.Bakery;
public class BakeryDetailsActivity extends AppCompatActivity {
private ImageView bakeryImage;
private TextView nameTextView;
private TextView idTextView;
private TextView typeTextView;
private Gson gson = new Gson();
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_bakery_details);
initViews();
Bakery bakery = this.gson.fromJson(getIntent().getStringExtra(Constants.BAKERY_SELECTED), Bakery.class);
fillBakeryData(bakery);
}
// Esto ya saben!
private void initViews() {
this.bakeryImage = findViewById(R.id.pokemonImage);
this.nameTextView = findViewById(R.id.nameTextView);
this.idTextView = findViewById(R.id.idTextView);
this.typeTextView = findViewById(R.id.typeTextView);
}
private void fillBakeryData(Bakery bakery) {
this.bakeryImage.setImageResource(bakery.getImage());
this.nameTextView.setText(bakery.getName());
this.idTextView.setText(String.valueOf(bakery.getId()));
this.typeTextView.setText(bakery.getType());
}
} | [
"[email protected]"
] | |
b55c71de4145cd5fdeafd5ac7feb15ebe3a29bf4 | 70a7c0a7ea54db341e29bd650585fbd2cc103be2 | /framework/FastImageProcessing/src/project/android/imageprocessing/filter/processing/DirectionalSobelEdgeDetectionFilter.java | a2619e9829c2f067ac61120c8d6adf8d1ec2ef5e | [] | no_license | bh1r1th/AndroidFastImageProcessing | 433948bea3fb4d3716d096a9b946566721b074a8 | 9aea7169676a4bbaf2822d52cf72800abf8d6832 | refs/heads/master | 2021-01-14T14:11:44.363487 | 2013-05-01T06:57:19 | 2013-05-01T06:57:19 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,821 | java | package project.android.imageprocessing.filter.processing;
/**
* Currently only used as part of the CannyEdgeDetectionFilter
* @author Chris Batt
*/
public class DirectionalSobelEdgeDetectionFilter extends SobelEdgeDetectionFilter {
@Override
protected String getFragmentShader() {
return
"precision mediump float;\n"
+"uniform sampler2D "+UNIFORM_TEXTURE0+";\n"
+"varying vec2 "+VARYING_TEXCOORD+";\n"
+"uniform float "+UNIFORM_TEXELWIDTH+";\n"
+"uniform float "+UNIFORM_TEXELHEIGHT+";\n"
+"void main(){\n"
+" vec2 up = vec2(0.0, "+UNIFORM_TEXELHEIGHT+");\n"
+" vec2 right = vec2("+UNIFORM_TEXELWIDTH+", 0.0);\n"
+" float bottomLeftIntensity = texture2D("+UNIFORM_TEXTURE0+", "+VARYING_TEXCOORD+" - up - right).r;\n"
+" float topRightIntensity = texture2D("+UNIFORM_TEXTURE0+", "+VARYING_TEXCOORD+" + up + right).r;\n"
+" float topLeftIntensity = texture2D("+UNIFORM_TEXTURE0+", "+VARYING_TEXCOORD+" + up - right).r;\n"
+" float bottomRightIntensity = texture2D("+UNIFORM_TEXTURE0+", "+VARYING_TEXCOORD+" - up + right).r;\n"
+" float leftIntensity = texture2D("+UNIFORM_TEXTURE0+", "+VARYING_TEXCOORD+" - right).r;\n"
+" float rightIntensity = texture2D("+UNIFORM_TEXTURE0+", "+VARYING_TEXCOORD+" + right).r;\n"
+" float bottomIntensity = texture2D("+UNIFORM_TEXTURE0+", "+VARYING_TEXCOORD+" - up).r;\n"
+" float topIntensity = texture2D("+UNIFORM_TEXTURE0+", "+VARYING_TEXCOORD+" + up).r;\n"
+" float h = -topLeftIntensity - 2.0 * topIntensity - topRightIntensity + bottomLeftIntensity + 2.0 * bottomIntensity + bottomRightIntensity;\n"
+" float v = -bottomLeftIntensity - 2.0 * leftIntensity - topLeftIntensity + bottomRightIntensity + 2.0 * rightIntensity + topRightIntensity;\n"
+" vec2 gradientDirection;\n"
+" gradientDirection.x = -bottomLeftIntensity - 2.0 * leftIntensity - topLeftIntensity + bottomRightIntensity + 2.0 * rightIntensity + topRightIntensity;\n"
+" gradientDirection.y = -topLeftIntensity - 2.0 * topIntensity - topRightIntensity + bottomLeftIntensity + 2.0 * bottomIntensity + bottomRightIntensity;\n"
+" float gradientMagnitude = length(gradientDirection);\n"
+" vec2 normalizedDirection = normalize(gradientDirection);\n"
+" normalizedDirection = sign(normalizedDirection) * floor(abs(normalizedDirection) + 0.617316);\n" // Offset by 1-sin(pi/8) to set to 0 if near axis, 1 if away
+" normalizedDirection = (normalizedDirection + 1.0) * 0.5;\n" // Place -1.0 - 1.0 within 0 - 1.0
+" gl_FragColor = vec4(gradientMagnitude, normalizedDirection.x, normalizedDirection.y, 1.0);\n"
+"}\n";
}
}
| [
"[email protected]"
] | |
f25a90a86a684f794e38370c7fbbdaa00ebcabf3 | 58c97fd4c80e1d69cc0205a8377b7e00fd74eb8f | /src/main/java/com/bruno/vendasapi/service/impl/ProdutoServiceImpl.java | 33cebb8ba63bd4a68287be5bfab748a4de7cb983 | [] | no_license | brunoavs91/vendas-api | fb5ac8d681a1c4414ae3a3c3a649aa3e148116ef | 25e61c605b5c4e201b2a9ba40dc62963d4c63db9 | refs/heads/master | 2023-04-07T13:03:57.709339 | 2021-03-30T15:39:11 | 2021-03-30T15:39:11 | 352,229,752 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,452 | java | package com.bruno.vendasapi.service.impl;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.HashSet;
import java.util.List;
import java.util.Objects;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import com.bruno.vendasapi.dto.ProdutoBuscaDTO;
import com.bruno.vendasapi.dto.ProdutoDTO;
import com.bruno.vendasapi.exception.BusinessException;
import com.bruno.vendasapi.exception.ObjectNotFoundException;
import com.bruno.vendasapi.model.AvaliacaoProduto;
import com.bruno.vendasapi.model.CategoriaProduto;
import com.bruno.vendasapi.model.Produto;
import com.bruno.vendasapi.repository.CategoriaProdutoRepository;
import com.bruno.vendasapi.repository.ProdutoRepository;
import com.bruno.vendasapi.service.ProdutoService;
@Service
public class ProdutoServiceImpl implements ProdutoService {
private static final Logger LOG = LoggerFactory.getLogger(ProdutoServiceImpl.class);
@Autowired
private ProdutoRepository repository;
@Autowired
private CategoriaProdutoRepository categoriaProdutoRepository;
@Override
@Transactional(readOnly = true)
public Produto buscar(Long id) {
return repository.findById(id)
.orElseThrow(() -> new BusinessException("Produto nao encontrado"));
}
@Override
@Transactional(readOnly = true)
public List<Produto> buscarTodos() {
return repository.findAll();
}
@Override
@Transactional
public Produto salvar(ProdutoDTO dto) {
Produto produto = converterToEntity(dto);
CategoriaProduto categoria = categoriaProdutoRepository.findById(dto.getCategoria())
.orElseThrow(() -> new ObjectNotFoundException("categoria nao encontrada"));
produto.setCategoria(categoria);
return repository.save(produto);
}
private Produto converterToEntity( ProdutoDTO dto) {
Produto produto = new Produto();
produto.setNome(dto.getNome());
produto.setDescricao(dto.getDescricao());
produto.setDataCriacao(Calendar.getInstance());
if(CollectionUtils.isEmpty(produto.getAvaliacoes())) {
produto.setAvaliacoes(new ArrayList<>());
}
if (dto.getAvaliacao() != null) {
AvaliacaoProduto avaliacao = new AvaliacaoProduto();
avaliacao.setNota(dto.getAvaliacao());
avaliacao.setProduto(produto);
produto.getAvaliacoes().add(avaliacao);
}
return produto;
}
@Override
@Transactional
public Produto atualizar(ProdutoDTO dto) {
Produto produto = repository.findById(dto.getId())
.orElseThrow(()-> new BusinessException("Nenhum produto encontrado"));
atualizarProduto(produto, dto);
return repository.save(produto);
}
private void atualizarProduto(Produto produto, ProdutoDTO dto) {
produto.setNome(dto.getNome());
produto.setDescricao(dto.getDescricao());
}
@Override
@Transactional
public void deletar(Long id) {
if(id == null) {
throw new BusinessException("Id para exclusao invalido");
}
repository.deleteById(id);
}
@Override
public List<ProdutoBuscaDTO> buscarScore(String produto) {
List<ProdutoBuscaDTO> listaBusca = repository.buscarScore(produto);
if(CollectionUtils.isEmpty(listaBusca)) {
throw new ObjectNotFoundException("Produto nao encontrado");
}
return listaBusca;
}
}
| [
"[email protected]"
] | |
49b859f074b9cd20c73572099460661f24fd4989 | a6b447db480d276c96657069a6c5fc4600f54fbb | /CopyConstructor/src/com/MethodOverLoading/Adition.java | 94da84bcff77656b1ac13ce48514ae0b7cca794a | [] | no_license | kiranbosco/JAVA_TPOINT | 7fcf6a8714636d9750ae575bd06a4a1d97e17636 | 89fa907f4380dec5bb5088c6e09f92efce37df5e | refs/heads/master | 2020-05-05T05:23:28.406250 | 2019-04-05T20:24:55 | 2019-04-05T20:24:55 | 179,749,464 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 649 | java | package com.MethodOverLoading;
public class Adition {
/* // this is the argments are changing
static int add(int a,int b) {
return a+b;
}
static int add(int a, int b, int c) {
return a+b+c;
}
public static void main(String[] args) {
System.out.println(Adition.add(10, 2));
System.out.println(Adition.add(10,2, 3));
}*/
//This is the data type are changing
static int add(int a , int b) {
return a+b;
}
static double add(double a, double b) {
return a+b;
}
public static void main(String[] args) {
System.out.println(Adition.add(10, 5));
System.out.println(Adition.add(10.d, 10.d));
}
}
| [
"[email protected]"
] | |
135cdb6caa68f7fbf7fa8357567df43985f2d0fc | 27b88147aab9e9a3ae5534ea36ebf4e64fb10153 | /lab09/src/hust/soict/hedspi/aims/media/DigitalVideoDisc.java | 63db8e5459522515e3b53952bc8e954bdb5c344c | [] | no_license | hungnv281/OOLT.20202.20184115.NguyenVanHung | a75f2a28990933f38a70d4ae232957106fc47d4e | ae75486146a5833a53729813a9e0eee70fcabc2d | refs/heads/main | 2023-05-02T09:27:11.480574 | 2021-05-18T06:44:19 | 2021-05-18T06:44:19 | 342,277,375 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,415 | java | package hust.soict.hedspi.aims.media;
public class DigitalVideoDisc extends Disc implements Playable {
public DigitalVideoDisc(String title, String category, float cost, int length,
String director) {
super(title, category, cost, length, director);
// TODO Auto-generated constructor stub
}
public DigitalVideoDisc() {
// TODO Auto-generated constructor stub
}
public String getDirector() {
return director;
}
public void setDirector(String director) {
this.director = director;
}
public int getLength() {
return length;
}
public void setLength(int length) {
this.length = length;
}
@Override
public void play() {
System.out.println("playing DVD : " + this.getTitle());
System.out.println("DVD length : " + this.getLength());
}
public int compareTo(Object obj) {
DigitalVideoDisc media = (DigitalVideoDisc)obj;
if (media == null ) {
System.out.println("Error !!!");
return -2;
}
if (this.cost > media.getCost()) {
return 1;
}
else if ( this.cost < media.getCost()) {
return -1;
}
else if ((this.cost == media.getCost()) && (this.length > media.getLength())) {
return 1;
}
else if ((this.cost == media.getCost()) && (this.length < media.getLength())) {
return -1;
}else
if (this.title.equals(media.getTitle())) {
return 0;
} else if (this.title.equals(media.getTitle()) ) {
return 1;
} else return -1;
// return 0;
}
}
| [
"="
] | = |
17b4bc51967a13ede6ab8846fa159472af3afbfa | 760b2dd25d0c42c8a755384052bbc515da3ae183 | /esb/org.wso2.developerstudio.eclipse.gmf.esb.diagram/src/org/wso2/developerstudio/eclipse/gmf/esb/diagram/edit/commands/MediatorFlow8CreateCommand.java | 728fe62e84f8641686315c45f77548e42f0fe064 | [
"Apache-2.0"
] | permissive | harshana05/developer-studio | 56ee93a9a61857f224c56d0044dfc64540861148 | 55c128e5ceb73ddd454c1521de856c3fd13e3dba | refs/heads/master | 2020-05-29T12:31:19.992369 | 2014-09-25T09:03:45 | 2014-09-25T09:03:45 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,834 | java | package org.wso2.developerstudio.eclipse.gmf.esb.diagram.edit.commands;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.common.core.command.CommandResult;
import org.eclipse.gmf.runtime.common.core.command.ICommand;
import org.eclipse.gmf.runtime.emf.type.core.IElementType;
import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
import org.eclipse.gmf.runtime.notation.View;
import org.wso2.developerstudio.eclipse.gmf.esb.EsbFactory;
import org.wso2.developerstudio.eclipse.gmf.esb.FilterFailContainer;
import org.wso2.developerstudio.eclipse.gmf.esb.MediatorFlow;
/**
* @generated
*/
public class MediatorFlow8CreateCommand extends EditElementCommand {
/**
* @generated
*/
public MediatorFlow8CreateCommand(CreateElementRequest req) {
super(req.getLabel(), null, req);
}
/**
* FIXME: replace with setElementToEdit()
* @generated
*/
protected EObject getElementToEdit() {
EObject container = ((CreateElementRequest) getRequest()).getContainer();
if (container instanceof View) {
container = ((View) container).getElement();
}
return container;
}
/**
* @generated
*/
public boolean canExecute() {
FilterFailContainer container = (FilterFailContainer) getElementToEdit();
if (container.getMediatorFlow() != null) {
return false;
}
return true;
}
/**
* @generated
*/
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info)
throws ExecutionException {
MediatorFlow newElement = EsbFactory.eINSTANCE.createMediatorFlow();
FilterFailContainer owner = (FilterFailContainer) getElementToEdit();
owner.setMediatorFlow(newElement);
doConfigure(newElement, monitor, info);
((CreateElementRequest) getRequest()).setNewElement(newElement);
return CommandResult.newOKCommandResult(newElement);
}
/**
* @generated
*/
protected void doConfigure(MediatorFlow newElement, IProgressMonitor monitor, IAdaptable info)
throws ExecutionException {
IElementType elementType = ((CreateElementRequest) getRequest()).getElementType();
ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement,
elementType);
configureRequest.setClientContext(((CreateElementRequest) getRequest()).getClientContext());
configureRequest.addParameters(getRequest().getParameters());
ICommand configureCommand = elementType.getEditCommand(configureRequest);
if (configureCommand != null && configureCommand.canExecute()) {
configureCommand.execute(monitor, info);
}
}
}
| [
"[email protected]"
] | |
368eb370559b68a508fe01bd4b37e9f88718b3bd | a2755d4e9edb44e977c12f3085ed65bfd8a17a0b | /src/main/java/in/sminfo/tool/mgmt/exception/GenericException.java | 23ac77bd33cd49dd6d12dff35afcbd7aced03e7a | [] | no_license | umesh936/AceMan | b6384b6dd8c8f665c20fbc66e35df06250bd6049 | 8ed9efb08519761cbf60b652146e1a8671e55b52 | refs/heads/master | 2022-12-23T04:19:25.561747 | 2022-12-01T10:00:57 | 2022-12-01T10:00:57 | 133,466,219 | 0 | 0 | null | 2022-12-14T20:58:56 | 2018-05-15T05:57:55 | Java | UTF-8 | Java | false | false | 255 | java | package in.sminfo.tool.mgmt.exception;
public class GenericException extends Exception {
/**
*
*/
private static final long serialVersionUID = 1L;
public GenericException() {
}
public GenericException(String reason) {
super(reason);
}
}
| [
"[email protected]"
] | |
973992381a5c410d51634e8ddb6d0095e4de3717 | 87e5b437fd8ab4b12f99fd28a5e8f97d8c125369 | /src/com/example/sugarmanagedemo/fragment/RecordMoodFragment.java | 357f6f8dfa922f39bc018d48115a1559f57c063c | [] | no_license | Amandaliu11/SugarManageDemo | 084e32a18ce35e6be93e5aef01731a80dba166ce | 3a28a47f01bae62d1c06785288339062533e522f | refs/heads/master | 2021-01-19T07:17:44.914640 | 2014-10-21T03:12:25 | 2014-10-21T03:12:25 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 561 | java | package com.example.sugarmanagedemo.fragment;
import org.kymjs.aframe.ui.fragment.BaseFragment;
import com.example.sugarmanagedemo.R;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
public class RecordMoodFragment extends BaseFragment {
private View mParent;
@Override
protected View inflaterView(LayoutInflater inflater, ViewGroup container,
Bundle bundle) {
mParent = inflater.inflate(R.layout.fragment_blank, null);
return mParent;
}
}
| [
"[email protected]"
] | |
d508d5ffeb61b2bd3652a3eb23ee210608690b18 | 119d6829187278bb204dc962804d25286ccab46c | /src/main/java/br/com/galgo/testes/recursos_comuns/pageObject/download/TelaDownloadPLCota.java | 363bbe42c1e541e3c9383841e48e2da4bf211462 | [] | no_license | JulianeManarinVasconcelos/recursos-comuns-teste | 77e5809e1807e6f0b4d82d0ac7913611258383f7 | a1dab6a7a7fe3d5be65e6171c1d6b0986d35c863 | refs/heads/master | 2020-12-24T16:26:02.442306 | 2015-11-27T22:41:10 | 2015-11-27T22:41:10 | 44,346,340 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 125 | java | package br.com.galgo.testes.recursos_comuns.pageObject.download;
public class TelaDownloadPLCota extends TelaDownload {
}
| [
"[email protected]"
] | |
85164fa46c6a141e1aefad3ec476629d8f6e8759 | a3cf3bec6ee75f12afeed925d439800a27a499f7 | /Settings/ext/src/com/mediatek/settings/ext/DefaultPermissionControlExt.java | 25867fb347176d7a59da1228c612e2a25a9cc259 | [
"Apache-2.0"
] | permissive | jxxiaoxi/ME_DEMO | d431584c86dfddbf558dae28152c880cb4961c17 | 73d450eaa3108121ef37e3cb50e1979754c4769f | refs/heads/master | 2020-05-18T02:57:21.098400 | 2015-07-14T07:33:10 | 2015-07-14T07:33:10 | 38,817,022 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 936 | java | package com.mediatek.settings.ext;
import android.content.Context;
import android.content.ContextWrapper;
import android.view.View;
import android.widget.LinearLayout;
import android.preference.PreferenceGroup;
import com.mediatek.xlog.Xlog;
public class DefaultPermissionControlExt extends ContextWrapper implements IPermissionControlExt {
private static final String TAG="DefaultPermissionControlExt";
public DefaultPermissionControlExt(Context context) {
super(context);
}
public void addPermSwitchPrf(PreferenceGroup prefGroup) {
Xlog.d(TAG,"will not add permission preference");
}
public void enablerResume() {
Xlog.d(TAG,"enablerResume() default");
}
public void enablerPause() {
Xlog.d(TAG,"enablerPause() default");
}
public void addAutoBootPrf(PreferenceGroup prefGroup) {
Xlog.d(TAG,"will not add auto boot entry preference");
}
}
| [
"[email protected]"
] | |
66bc6e75f0ad2f0e65f9025ca5e7edac039f6e3f | eb9f655206c43c12b497c667ba56a0d358b6bc3a | /java/java-tests/testData/compileServer/incremental/fieldProperties/constantChain1/src/B.java | a28d54950a5fd816dc5cd0c7cb62b13aa7aecd9f | [
"Apache-2.0"
] | permissive | JetBrains/intellij-community | 2ed226e200ecc17c037dcddd4a006de56cd43941 | 05dbd4575d01a213f3f4d69aa4968473f2536142 | refs/heads/master | 2023-09-03T17:06:37.560889 | 2023-09-03T11:51:00 | 2023-09-03T12:12:27 | 2,489,216 | 16,288 | 6,635 | Apache-2.0 | 2023-09-12T07:41:58 | 2011-09-30T13:33:05 | null | UTF-8 | Java | false | false | 98 | java | interface B extends A {
static final short var = A.last + 1;
static final short lastB = var;
} | [
"db@mobilis.(none)"
] | db@mobilis.(none) |
ec9cc9578e1a5625ecfc2b60710de3fea808d3e2 | 199d7f11bc6178a8ea240b5bf6e6e3092e50a214 | /itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/entity/cmp/BasicCmpBean.java | 11aba25455f77c0e7edf6aad65516b6f0163760b | [
"BSD-3-Clause",
"W3C-19980720",
"CDDL-1.0",
"Apache-2.0",
"W3C",
"MIT"
] | permissive | kdchamil/ASTomEE | 31fc4478cc58351d98a298e5849d3a5a72e7ab6e | eaad273b8def8836bb2e82aab04c067662d2f67b | refs/heads/master | 2023-01-13T07:31:53.989780 | 2014-08-07T06:52:32 | 2014-08-07T06:52:32 | 19,934,900 | 0 | 0 | Apache-2.0 | 2023-01-02T22:04:23 | 2014-05-19T08:49:01 | Java | UTF-8 | Java | false | false | 9,429 | 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.apache.openejb.test.entity.cmp;
import java.rmi.RemoteException;
import java.util.Properties;
import java.util.StringTokenizer;
import java.util.Map;
import java.util.HashMap;
import javax.ejb.EJBException;
import javax.ejb.EntityContext;
import javax.ejb.RemoveException;
import org.apache.openejb.test.ApplicationException;
import org.apache.openejb.test.object.OperationsPolicy;
public class BasicCmpBean implements javax.ejb.EntityBean{
private static int nextId;
public Integer primaryKey;
public String firstName;
public String lastName;
public EntityContext ejbContext;
public Map<String,OperationsPolicy> allowedOperationsTable = new HashMap<String,OperationsPolicy>();
//=============================
// Home interface methods
//
/**
* Maps to BasicCmpHome.sum
*
* Adds x and y and returns the result.
*
* @param x
* @param y
* @return x + y
* @see BasicCmpHome#sum
*/
public int ejbHomeSum(int x, int y) {
testAllowedOperations("ejbHome");
return x+y;
}
public void ejbHomeVoidSelect() {
}
/**
* Maps to BasicCmpHome.create
*
* @param name
* @return
* @exception javax.ejb.CreateException
* @see BasicCmpHome#createObject
*/
public Integer ejbCreateObject(String name)
throws javax.ejb.CreateException{
primaryKey = nextId++;
StringTokenizer st = new StringTokenizer(name, " ");
firstName = st.nextToken();
lastName = st.nextToken();
return null;
}
public void ejbPostCreateObject(String name)
throws javax.ejb.CreateException{
}
public int getPrimaryKey() {
return primaryKey;
}
public String getFirstName() {
return firstName;
}
public String getLastName() {
return lastName;
}
//
// Home interface methods
//=============================
//=============================
// Remote interface methods
//
/**
* Maps to BasicCmpObject.businessMethod
*
* @return
* @see BasicCmpObject#businessMethod
*/
public String businessMethod(String text){
testAllowedOperations("businessMethod");
StringBuffer b = new StringBuffer(text);
return b.reverse().toString();
}
/**
* Throws an ApplicationException when invoked
*
*/
public void throwApplicationException() throws ApplicationException{
throw new ApplicationException("Testing ability to throw Application Exceptions");
}
/**
* Throws a java.lang.NullPointerException when invoked
* This is a system exception and should result in the
* destruction of the instance and invalidation of the
* remote reference.
*
*/
public void throwSystemException_NullPointer() {
throw new NullPointerException("Testing ability to throw System Exceptions");
}
/**
* Maps to BasicCmpObject.getPermissionsReport
*
* Returns a report of the bean's
* runtime permissions
*
* @return
* @see BasicCmpObject#getPermissionsReport
*/
public Properties getPermissionsReport(){
/* TO DO: */
return null;
}
/**
* Maps to BasicCmpObject.getAllowedOperationsReport
*
* Returns a report of the allowed opperations
* for one of the bean's methods.
*
* @param methodName The method for which to get the allowed opperations report
* @return
* @see BasicCmpObject#getAllowedOperationsReport
*/
public OperationsPolicy getAllowedOperationsReport(String methodName){
return allowedOperationsTable.get(methodName);
}
//
// Remote interface methods
//=============================
//================================
// EntityBean interface methods
//
/**
* A container invokes this method to instruct the
* instance to synchronize its state by loading it state from the
* underlying database.
*/
public void ejbLoad() throws EJBException,RemoteException {
}
/**
* Set the associated entity context. The container invokes this method
* on an instance after the instance has been created.
*/
public void setEntityContext(EntityContext ctx) throws EJBException,RemoteException {
ejbContext = ctx;
testAllowedOperations("setEntityContext");
}
/**
* Unset the associated entity context. The container calls this method
* before removing the instance.
*/
public void unsetEntityContext() throws EJBException,RemoteException {
testAllowedOperations("unsetEntityContext");
}
/**
* A container invokes this method to instruct the
* instance to synchronize its state by storing it to the underlying
* database.
*/
public void ejbStore() throws EJBException,RemoteException {
}
/**
* A container invokes this method before it removes the EJB object
* that is currently associated with the instance. This method
* is invoked when a client invokes a remove operation on the
* enterprise Bean's home interface or the EJB object's remote interface.
* This method transitions the instance from the ready state to the pool
* of available instances.
*/
public void ejbRemove() throws RemoveException,EJBException,RemoteException {
}
/**
* A container invokes this method when the instance
* is taken out of the pool of available instances to become associated
* with a specific EJB object. This method transitions the instance to
* the ready state.
*/
public void ejbActivate() throws EJBException,RemoteException {
testAllowedOperations("ejbActivate");
}
/**
* A container invokes this method on an instance before the instance
* becomes disassociated with a specific EJB object. After this method
* completes, the container will place the instance into the pool of
* available instances.
*/
public void ejbPassivate() throws EJBException,RemoteException {
testAllowedOperations("ejbPassivate");
}
//
// EntityBean interface methods
//================================
protected void testAllowedOperations(String methodName){
OperationsPolicy policy = new OperationsPolicy();
/*[1] Test getEJBHome /////////////////*/
try{
ejbContext.getEJBHome();
policy.allow(OperationsPolicy.Context_getEJBHome);
}catch(IllegalStateException ise){}
/*[2] Test getCallerPrincipal /////////*/
try{
ejbContext.getCallerPrincipal();
policy.allow( OperationsPolicy.Context_getCallerPrincipal );
}catch(IllegalStateException ise){}
/*[3] Test isCallerInRole /////////////*/
try{
ejbContext.isCallerInRole("TheMan");
policy.allow( OperationsPolicy.Context_isCallerInRole );
}catch(IllegalStateException ise){}
/*[4] Test getRollbackOnly ////////////*/
try{
ejbContext.getRollbackOnly();
policy.allow( OperationsPolicy.Context_getRollbackOnly );
}catch(IllegalStateException ise){}
/*[5] Test setRollbackOnly ////////////*/
try{
ejbContext.setRollbackOnly();
policy.allow( OperationsPolicy.Context_setRollbackOnly );
}catch(IllegalStateException ise){}
/*[6] Test getUserTransaction /////////*/
try{
ejbContext.getUserTransaction();
policy.allow( OperationsPolicy.Context_getUserTransaction );
}catch(Exception e){}
/*[7] Test getEJBObject ///////////////*/
try{
ejbContext.getEJBObject();
policy.allow( OperationsPolicy.Context_getEJBObject );
}catch(IllegalStateException ise){}
/*[8] Test getPrimaryKey //////////////*/
try{
ejbContext.getPrimaryKey();
policy.allow( OperationsPolicy.Context_getPrimaryKey );
}catch(IllegalStateException ise){}
/* TO DO:
* Check for policy.Enterprise_bean_access
* Check for policy.JNDI_access_to_java_comp_env
* Check for policy.Resource_manager_access
*/
allowedOperationsTable.put(methodName, policy);
}
}
| [
"[email protected]"
] | |
b0f0fa197f5e0aa12a11cdedec5535fc722a6c6a | 91208df5ff900da7b208817c409b5a969d915d72 | /src/practice/Operators.java | 49a47433131286e37e7b3573931d93be126edae6 | [] | no_license | Aamir-Developer/Java-initial | b599dd91cf4cfb9a04fb57cf723871689238b5a8 | 5b6d585d71cd6c30dea2eb60ceba072cb6820839 | refs/heads/master | 2020-08-13T01:59:43.521812 | 2019-10-15T05:13:17 | 2019-10-15T05:13:17 | 214,886,265 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 194 | java | package practice;
public class Operators {
public static void main(String[] args)
{
int num1 = 2;
int num2 = 4;
int result;
public int add()
{
result = num1+num2;
}
}
}
| [
"[email protected]"
] | |
8ddb52919c18d428e29578d24e7626d3fa033453 | ad1ee3c7eb381fa3dd2bd1cb2c383a8bc4acb2e2 | /Foundationrestart/Graphs/gccPortal.java | 928659b80c4a1f8960833a04522f4af6eefe06bd | [] | no_license | GagandeepSingh02/Data-Structures | abf0f14cc7d6dd4bf21a974523092782e9e030be | b8b7afec0fe41d1e8c998f8dd5cdf0700d775d31 | refs/heads/master | 2023-06-28T00:09:42.923383 | 2021-08-03T04:13:47 | 2021-08-03T04:13:47 | 384,016,680 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 626 | java | public class gccPortal{
public static void dfs(ArrayList<Edge>[] graph, boolean[] vis, int src, ArrayList<Integer> comp ){
vis[src] = true;
comp.add(src);
for(Edge e : graph[src]){
if(!vis[e.nbr]){
dfs(graph,vis,e.nbr,comp);
}
}
}
public static void gcc(){
boolean[] vis = new boolean[vtces];
for(int i = 0; i < vtces; i++){
if(!vis[i]){
ArrayList<Integer> comp = new ArrayList<>();
dfs(graph,vis,i,comp);
comps.add(comp);
}
}
System.out.println(comps);
}
} | [
"[email protected]"
] | |
786b68b56ff49ff821c90cbff12a52886937342a | 1102d56bd5061f23ee2f3d65ee9422ae0f8873af | /service-reflection-system/src/main/java/me/philcali/service/reflection/system/CachingComponentProvider.java | 9843d1a9e5849a822bdffb35e0348fa3b04226d0 | [] | no_license | philcali/service-helper | f77a58ca8973365c2c7ef545c30a1ae78c0f1183 | 841c5be8c1f90fefcd435a7c01a0e4bd74041832 | refs/heads/master | 2021-05-03T22:24:13.772440 | 2018-12-12T00:32:52 | 2018-12-12T00:32:52 | 120,393,055 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 606 | java | package me.philcali.service.reflection.system;
import java.util.List;
import java.util.Objects;
public class CachingComponentProvider implements IComponentProvider {
private final IComponentProvider componentProvider;
private List<Object> components;
public CachingComponentProvider(final IComponentProvider componentProvider) {
this.componentProvider = componentProvider;
}
@Override
public List<Object> getComponents() {
if (Objects.isNull(components)) {
components = componentProvider.getComponents();
}
return components;
}
}
| [
"[email protected]"
] | |
ca7ba748e6dfcf7ba471bc5aff0f2cb502fcb111 | 5ef04be71dccc0fea09f0c24d5ac1175ae849b45 | /app/src/main/java/com/example/saravanamurali/farmersgen/retrofitclient/APIClientToGetCancelOrderList.java | 23823e6134da03bec0f07f04f0f5a8fe222084d3 | [] | no_license | kannan622/FarmersGen1.0-master_kannan | 376c21333079890b3630cf6c97a447a4c66ff27f | 6b06f52b3f3b3e75821d2dd975f772c52779b278 | refs/heads/master | 2020-05-29T15:27:14.723242 | 2019-05-29T12:28:08 | 2019-05-29T12:28:08 | 189,220,883 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 912 | java | package com.example.saravanamurali.farmersgen.retrofitclient;
import com.example.saravanamurali.farmersgen.apiInterfaces.ApiInterface;
import com.example.saravanamurali.farmersgen.baseurl.BaseUrl;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;
public class APIClientToGetCancelOrderList implements BaseUrl {
static Retrofit retrofit=null;
private static Retrofit getAPIClientToGetCancelOrderList(){
if(retrofit==null){
retrofit =new Retrofit.Builder().baseUrl(BaseUrl.ROOT_URL_TO_GET_CANCEL_ORDER_LIST).addConverterFactory(GsonConverterFactory.create()).build();
}
return retrofit;
}
public static ApiInterface getApiInterfaceToGetCancelOrderList(){
ApiInterface apiInterface=APIClientToGetCancelOrderList.getAPIClientToGetCancelOrderList().create(ApiInterface.class);
return apiInterface;
}
}
| [
"[email protected]"
] | |
4d26a5a75d2bc346970e03557c46cba5a5f45b8e | 75f4432cff52c29767a2fe10de5462e7eb458598 | /sepa-pain-lib/src/main/java/iso/std/iso/_20022/tech/xsd/pain_008_003_02/RestrictedPersonIdentificationSEPA.java | 1c22fabf92f2dfcbf8a6efbbdb356ac2be379aaa | [
"Apache-2.0"
] | permissive | germamix/sepa-pain-lib | 893d0a238cf6d2e843f95b80716f72382ed310fe | 1c5ea9edc0bbda8b00287611dd3e78e834357852 | refs/heads/master | 2016-09-06T15:03:25.832970 | 2015-03-22T09:04:01 | 2015-03-22T09:04:01 | 32,666,740 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,839 | java | //
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2013.12.03 at 08:07:19 AM CET
//
package iso.std.iso._20022.tech.xsd.pain_008_003_02;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for RestrictedPersonIdentificationSEPA complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="RestrictedPersonIdentificationSEPA">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="Id" type="{urn:iso:std:iso:20022:tech:xsd:pain.008.003.02}RestrictedPersonIdentifierSEPA"/>
* <element name="SchmeNm" type="{urn:iso:std:iso:20022:tech:xsd:pain.008.003.02}RestrictedPersonIdentificationSchemeNameSEPA"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "RestrictedPersonIdentificationSEPA", propOrder = {
"id",
"schmeNm"
})
public class RestrictedPersonIdentificationSEPA {
@XmlElement(name = "Id", required = true)
protected String id;
@XmlElement(name = "SchmeNm", required = true)
protected RestrictedPersonIdentificationSchemeNameSEPA schmeNm;
/**
* Gets the value of the id property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getId() {
return id;
}
/**
* Sets the value of the id property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setId(String value) {
this.id = value;
}
/**
* Gets the value of the schmeNm property.
*
* @return
* possible object is
* {@link RestrictedPersonIdentificationSchemeNameSEPA }
*
*/
public RestrictedPersonIdentificationSchemeNameSEPA getSchmeNm() {
return schmeNm;
}
/**
* Sets the value of the schmeNm property.
*
* @param value
* allowed object is
* {@link RestrictedPersonIdentificationSchemeNameSEPA }
*
*/
public void setSchmeNm(RestrictedPersonIdentificationSchemeNameSEPA value) {
this.schmeNm = value;
}
}
| [
"[email protected]"
] | |
f54cb13ae7fa675f4657cca46cd5613b5ff5e30e | f8ab18d5544578833ce4b410446e9991929950b8 | /src/main/java/com/jjstudio/controller/me/MyTrackController.java | 4c412879f9355c039c18980b8a583bbfbe95d214 | [
"MIT"
] | permissive | jj-web-design-studio/jjstudio-backend-java | b434767cb7759ea5adb64a5cca98d11ea3874cb9 | 5fcbe7a1811c43f74889e9e9e3a06d88e82fa096 | refs/heads/master | 2023-03-28T06:45:59.342260 | 2021-03-31T06:03:09 | 2021-03-31T06:03:09 | 315,487,792 | 0 | 0 | MIT | 2020-12-11T02:20:16 | 2020-11-24T01:42:12 | Java | UTF-8 | Java | false | false | 3,468 | java | package com.jjstudio.controller.me;
import com.jjstudio.model.Track;
import com.jjstudio.resource.TrackRepository;
import io.swagger.annotations.ApiOperation;
import org.bson.types.ObjectId;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.web.bind.annotation.*;
/**
* Rest controller for Track entity
*
* @author justinchung
* @version 1.0
* @since 1.0
*/
@RestController
@RequestMapping("/v1/me/tracks")
@CrossOrigin("http://localhost:3000")
public class MyTrackController {
private final Logger logger = LoggerFactory.getLogger(MyTrackController.class);
@Autowired
private TrackRepository trackRepository;
@ApiOperation(value = "Save a track for current user", notes = "${MyTrackController.createTrack.notes}")
@PostMapping
public ResponseEntity<String> createTrack(@RequestBody Track request,
Authentication authentication) {
if (!isValidSaveRequest(request)) {
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
}
UserDetails userDetails = (UserDetails) authentication.getPrincipal();
request.setUsername(userDetails.getUsername());
Track savedTracked = trackRepository.save(request);
return new ResponseEntity<>(savedTracked.getId().toHexString(), HttpStatus.CREATED);
}
@ApiOperation(value = "Get a track for current user", notes = "${MyTrackController.getTrackById.notes}")
@GetMapping("/{id}")
public ResponseEntity<Track> getTrackById(@PathVariable String id,
Authentication authentication) {
UserDetails userDetails = (UserDetails) authentication.getPrincipal();
return new ResponseEntity<>(trackRepository.findByIdAndUsername(new ObjectId(id), userDetails.getUsername()), HttpStatus.OK);
}
@ApiOperation(value = "Get all tracks for current user", notes = "${MyTrackController.getAllTracks.notes}")
@GetMapping
public ResponseEntity<Iterable<Track>> getAllTracks(Authentication authentication) {
UserDetails userDetails = (UserDetails) authentication.getPrincipal();
return new ResponseEntity<>(trackRepository.findByUsername(userDetails.getUsername()), HttpStatus.OK);
}
@ApiOperation(value = "Delete a track for current user", notes = "${MyTrackController.deleteTrackById.notes}")
@DeleteMapping("/{id}")
public ResponseEntity<String> deleteTrackById(@PathVariable String id,
Authentication authentication) {
UserDetails userDetails = (UserDetails) authentication.getPrincipal();
Track deletedTrack = trackRepository.deleteByIdAndUsername(new ObjectId(id), userDetails.getUsername());
return new ResponseEntity<>(deletedTrack.getId().toHexString(), HttpStatus.OK);
}
private boolean isValidSaveRequest(Track request) {
return request.getName() != null &&
request.getContents() != null &&
request.getContents().size() > 0 &&
request.getContents().get(0).size() > 0 &&
request.getTimeSignature() != null;
}
}
| [
"[email protected]"
] | |
d3855be8cb53fc38047551d8a298324737dffc86 | c186d142fdd160041317ef656537b1aae3102b12 | /SOLID/src/main/java/solid/OCP/problem/DescontoLivroInfantil.java | af8390854d543bcd272d668e0eec80ff5f84e5c3 | [] | no_license | AndreCin2802/TrainingJava | d74bfcffc9bcc7a42e4808cbb4d37f2e36327df9 | 16be3f2edcb0b35bc5986396975d71a739ec204b | refs/heads/main | 2023-03-27T06:21:51.648452 | 2021-03-23T12:32:03 | 2021-03-23T12:32:03 | 350,700,999 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 143 | java | package solid.OCP.problem;
public class DescontoLivroInfantil {
public double valorDescontoLivroInfantil() {
return 0.3;
}
}
| [
"[email protected]"
] | |
7f2e6002be3344465b31451a5567c09202e0df5a | 3bee6e4f4a48132b9e3b56872feae12f09db72fa | /TextTrade/app/src/main/java/com/squad/afro/texttrade/SellingFragment.java | d7c98a9d6cede2d1852c5ab7b9ce4673df8b271f | [] | no_license | BrukeM/LUApps17 | 71893fd6ba527ff5c33a49c43e8289fd84b1e8a8 | f5b8d8d9324d354cbfaf847fba3f7fd5d4877834 | refs/heads/master | 2021-08-24T05:18:55.927435 | 2017-12-06T22:01:04 | 2017-12-06T22:01:04 | 110,014,034 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 833 | java | package com.squad.afro.texttrade;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;
import java.util.ArrayList;
/**
* Created by romeo on 11/24/2017.
*/
public class SellingFragment extends Fragment {
private static final String TAG = "SellingFragment";
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.selling_fragment, container, false);
ListView listView = view.findViewById(R.id.listview);
ArrayList<Book> mBooks = new ArrayList<Book>();
return view;
}
}
| [
"[email protected]"
] | |
9d3a09a01b72aa0cb901a2f4b7ffdcb22754f938 | ed0a0bd25226bdea36b4eb179077becd24e581fd | /HW/hw3/RatTerm.java | 5f63f1d9ce14a55c7d7883346372fecc2bc8855e | [] | no_license | jakevo/CSE331 | def4338ce938e2e7080031a38bc2940563d69067 | 922fead23b9a18b20714143d401eea7e6b4dde13 | refs/heads/master | 2021-05-27T06:18:50.859947 | 2014-05-22T10:02:29 | 2014-05-22T10:02:29 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 14,333 | java | package hw3;
/**
* <b>RatTerm</b> is an immutable representation of a term in a single-variable
* polynomial expression. The term has the form C*x^E where C is a rational
* number and E is an integer.
* <p>
*
* A RatTerm, t, can be notated by the pair (C . E), where C is the coefficient
* of t, and E is the exponent of t.
* <p>
*
* The zero RatTerm, (0 . 0), is the only RatTerm that may have a zero
* coefficient. For example, (0 . 7) is an invalid RatTerm and an attempt to
* construct such a RatTerm (through the constructor or arithmetic operations on
* existing RatTerms) will return the semantically equivalent RatTerm (0 . 0).
* For example, (1 . 7) + (-1 . 7) = (0 . 0).
* <p>
*
* (0 . 0), (1 . 0), (1 . 1), (1 . 3), (3/4 . 17), (7/2 . -1), and (NaN . 74)
* are all valid RatTerms, corresponding to the polynomial terms "0", "1", "x",
* "x^3", "3/4*x^17", "7/2*x^-1" and "NaN*x^74", respectively.
*/
// See RatNum's documentation for a definition of "immutable".
public final class RatTerm {
/** Coefficient of this term. */
private final RatNum coeff;
/** Exponent of this term. */
private final int expt;
// Abstraction Function:
// For a given RatTerm t, "coefficient of t" is synonymous with
// t.coeff, and, likewise, "exponent of t" is synonymous with t.expt.
// All RatTerms with a zero coefficient are represented by the
// zero RatTerm, z, which has zero for its coefficient AND exponent.
//
// Representation Invariant:
// coeff != null
// coeff.equals(RatNum.ZERO) ==> expt == 0
/** A constant holding a Not-a-Number (NaN) value of type RatTerm */
public static final RatTerm NaN = new RatTerm(RatNum.NaN, 0);
/** A constant holding a zero value of type RatTerm */
public static final RatTerm ZERO = new RatTerm(RatNum.ZERO, 0);
/** A constant holding a one value of type RatTerm */
private static final RatNum ONE = new RatNum(1);
/**
* @param c the coefficient of the RatTerm to be constructed.
* @param e the exponent of the RatTerm to be constructed.
* @requires c != null
* @effects Constructs a new RatTerm t, with t.coeff = c, and if
* c.equals(RatNum.ZERO), then t.expt = 0, otherwise t.expt = e
*/
public RatTerm(RatNum c, int e) {
// special case for zero coefficient
if (c.equals(RatNum.ZERO)) {
coeff = c;
expt = 0;
} else {
coeff = c;
expt = e;
}
checkRep(); // check if representation invariant holds
}
/**
* Gets the coefficient of this RatTerm.
*
* @return the coefficient of this RatTerm.
*/
public RatNum getCoeff() {
return coeff;
}
/**
* Gets the exponent of this RatTerm.
*
* @return the exponent of this RatTerm.
*/
public int getExpt() {
return expt;
}
/**
* Returns true if this RatTerm is not-a-number.
*
* @return true if and only if this has NaN as a coefficient.
*/
public boolean isNaN() {
return coeff.isNaN();
}
/**
* Returns true if this RatTerm is equal to 0.
*
* @return true if and only if this has zero as a coefficient.
*/
public boolean isZero() {
return coeff.equals(RatNum.ZERO);
}
/**
* Returns the value of this RatTerm, evaluated at d.
*
* @param d The value at which to evaluate this term.
* @return the value of this polynomial when evaluated at 'd'. For example,
* "3*x^2" evaluated at 2 is 12. if (this.isNaN() == true), return
* Double.NaN
*/
public double eval(double d) {
if (isNaN())
return Double.NaN;
return coeff.doubleValue() * Math.pow(d, expt);
}
/**
* Negation operation.
*
* @return a RatTerm equals to (-this). If this is NaN, then returns NaN.
*/
public RatTerm negate() {
return new RatTerm(coeff.negate(), expt);
}
/**
* Addition operation.
*
* @param p The other value to be added.
* @requires arg != null
* @return a RatTerm equals to (this + arg). If either argument is NaN, then
* returns NaN.
* @throws IllegalArgumentException
* if (this.expt != arg.expt) and neither argument is zero or
* NaN.
*/
public RatTerm add(RatTerm p) {
if (this.isNaN() || p.isNaN())
return new RatTerm(RatNum.NaN, this.expt);
else if (this.isZero())
// 0 + a*x^b = a*x^b
return new RatTerm(p.coeff, p.expt);
else if (p.isZero())
// a*x^b + 0 = a*x^b
return new RatTerm(this.coeff, this.expt);
else if (this.expt != p.expt)
throw new IllegalArgumentException("Argument p must have the " +
"same exponent as this term.");
// (a*x^c) + (b*x^c) = (a+b)*x^c
return new RatTerm(this.coeff.add(p.coeff), this.expt);
}
/**
* Subtraction operation.
*
* @param p The value to be subtracted.
* @requires arg != null
* @return a RatTerm equals to (this - arg). If either argument is NaN, then
* returns NaN.
* @throws IllegalArgumentException
* if (this.expt != arg.expt) and neither argument is zero or
* NaN.
*/
public RatTerm sub(RatTerm p) {
if (this.isNaN() || p.isNaN())
return new RatTerm(RatNum.NaN, this.expt);
else if (this.isZero())
// 0 - a*x^b = -a*x^b
return new RatTerm(p.coeff.negate(), p.expt);
else if (p.isZero())
// a*x^b - 0 = a*x^b
return new RatTerm(this.coeff, this.expt);
else if (this.expt != p.expt)
throw new IllegalArgumentException("Argument p must have the " +
"same exponent as this term.");
// (a*x^c) - (b*x^c) = (a-b)*x^c
return new RatTerm(this.coeff.sub(p.coeff), this.expt);
}
/**
* Multiplication operation.
*
* @param p The other value to be multiplied.
* @requires arg != null
* @return a RatTerm equals to (this * arg). If either argument is NaN, then
* returns NaN.
*/
public RatTerm mul(RatTerm p) {
if (this.isNaN() || p.isNaN())
return new RatTerm(RatNum.NaN, this.expt);
// (a*x^b) * (c*x^d) = (a*c)*x^(b+d)
return new RatTerm(this.coeff.mul(p.coeff), this.expt + p.expt);
}
/**
* Division operation.
*
* @param p The divisor.
* @requires arg != null
* @return a RatTerm equals to (this / arg). If arg is zero, or if either
* argument is NaN, then returns NaN.
*/
public RatTerm div(RatTerm p) {
if (p.isZero() || (this.isNaN() || p.isNaN()))
return new RatTerm(RatNum.NaN, this.expt);
// (a*x^b) / (c*x^d) = (a/c)*x^(b-d)
return new RatTerm(this.coeff.div(p.coeff), this.expt - p.expt);
}
/**
* Return the derivative of this RatTerm.
*
* @return a RatTerm that, q, such that q = dy/dx, where this == y. In other
* words, q is the derivative of this. If this.isNaN(), then return
* some q such that q.isNaN()
* <p>
* Given a term, a*x^b, the derivative of the term is: (a*b)*x^(b-1)
* for b > 0 and 0 for b == 0 (Do not worry about the case when b <
* 0. The caller of this function, RatPoly, contains a rep.
* invariant stating that b is never less than 0.)
*/
public RatTerm differentiate() {
if (isNaN())
return new RatTerm(RatNum.NaN, 0);
else if (expt == 0)
// y = 0, dy/dx = 0
return new RatTerm(RatNum.ZERO, 0);
return new RatTerm(coeff.mul(new RatNum(expt)), expt - 1);
}
/**
* Returns the antiderivative of this RatTerm.
*
* @return a RatTerm, q, such that dq/dx = this where the constant of
* intergration is assumed to be 0. In other words, q is the
* antiderivative of this. If this.isNaN(), then return some q such
* that q.isNaN()
* <p>
* Given a term, a*x^b, (where b >= 0) the antiderivative of the
* term is: a/(b+1)*x^(b+1) (Do not worry about the case when b < 0.
* The caller of this function, RatPoly, contains a rep. invariant
* stating that b is never less than 0.)
*/
public RatTerm antiDifferentiate() {
if (isNaN())
return new RatTerm(RatNum.NaN, 0);
return new RatTerm(coeff.div(new RatNum(expt + 1)), expt + 1);
}
/**
* Returns a string representation of this RatTerm.
*
* @return A String representation of the expression represented by this.
* <p>
* There is no whitespace in the returned string.
* <p>
* If the term is itself zero, the returned string will just be "0".
* <p>
* If this.isNaN(), then the returned string will be just "NaN"
* <p>
*
* The string for a non-zero, non-NaN RatTerm is in the form "C*x^E" where C
* is a valid string representation of a RatNum (see {@link hw3.RatNum}'s
* toString method) and E is an integer. UNLESS: (1) the exponent E is zero,
* in which case T takes the form "C" (2) the exponent E is one, in which
* case T takes the form "C*x" (3) the coefficient C is one, in which case T
* takes the form "x^E" or "x" (if E is one) or "1" (if E is zero).
* <p>
* Valid example outputs include "3/2*x^2", "-1/2", "0", and "NaN".
*/
@Override
public String toString() {
if (this.isNaN()) {
return "NaN";
}
StringBuilder output = new StringBuilder();
RatNum c = coeff;
int e = expt;
if (c.isNegative()) {
output.append("-");
c = c.negate();
}
if (c.equals(ONE) && e == 1) {
output.append("x");
} else if (e == 0) {
output.append(c.toString());
} else if (c.equals(ONE)) {
output.append("x^" + e);
} else if (e == 1) {
output.append(c.toString() + "*x");
} else {
output.append(c.toString() + "*x^" + e);
}
return output.toString();
}
/**
* Builds a new RatTerm, given a descriptive String.
*
* @param ratStr A string of the format described in the @requires clause.
* @requires 'termStr' is an instance of a string with no spaces that
* expresses a RatTerm in the form defined in the toString()
* method.
* <p>
*
* Valid inputs include "0", "x", and "-5/3*x^3", and "NaN".
*
* @return a RatTerm t such that t.toString() = termStr
*/
public static RatTerm valueOf(String termStr) {
if (termStr.equals("NaN")) {
return NaN;
}
// Term is: "R" or "R*x" or "R*x^N" or "x^N" or "x",
// where R is a rational num and N is an integer.
// First we parse the coefficient
int multIndex = termStr.indexOf("*");
RatNum coeff = null;
if (multIndex == -1) {
// "R" or "x^N" or "x"
int xIndex = termStr.indexOf("x");
if (xIndex == -1) {
// "R"
coeff = RatNum.valueOf(termStr);
} else {
int negIndex = termStr.indexOf("-");
// "x^N" or "x" ==> coeff = 1
if (negIndex == -1) {
coeff = new RatNum(1);
}
// "-x^N" or "-x" ==> coeff = -1
else if (negIndex == 0) {
coeff = new RatNum(-1);
} else {
throw new RuntimeException(
"Minus sign, '-', not allowed in the middle of input string: "
+ termStr);
}
}
} else {
// "R*x" or "R*x^N"
coeff = RatNum.valueOf(termStr.substring(0, multIndex));
}
// Second we parse the exponent
int powIndex = termStr.indexOf("^");
int expt;
if (powIndex == -1) {
// "R" or "R*x" or "x"
int xIndex = termStr.indexOf("x");
if (xIndex == -1) {
// "R"
expt = 0;
} else {
// "R*x" or "x"
expt = 1;
}
} else {
// "R*x^N" or "x^N"
expt = Integer.parseInt(termStr.substring(powIndex + 1));
}
return new RatTerm(coeff, expt);
}
/**
* Standard hashCode function.
*
* @return an int that all objects equal to this will also.
*/
@Override
public int hashCode() {
if (this.isNaN()) {
return 0;
}
return coeff.hashCode() * 7 + expt * 43;
}
/**
* Standard equality operation.
*
* @param obj The object to be compared for equality.
* @return true iff 'obj' is an instance of a RatTerm and 'this' and 'obj'
* represent the same RatTerm. Note that all NaN RatTerms are equal.
*/
@Override
public boolean equals(/*@Nullable*/ Object obj) {
if (obj instanceof RatTerm) {
RatTerm rt = (RatTerm) obj;
if (this.isNaN() && rt.isNaN()) {
return true;
} else {
return this.expt == rt.expt && this.coeff.equals(rt.coeff);
}
} else {
return false;
}
}
/**
* Checks that the representation invariant holds (if any).
* Throws an exception if the rep invariant is violated.
*/
private void checkRep() throws RuntimeException {
// assert coeff != null: "coeff == null";
// assert !(coeff.equals(RatNum.ZERO) && expt != 0): "coeff is zero while expt == " + expt;
if (coeff == null) {
throw new RuntimeException("coeff == null");
}
if (coeff.equals(RatNum.ZERO) && expt != 0) {
throw new RuntimeException("coeff is zero while expt == " + expt);
}
}
}
| [
"[email protected]"
] | |
c7521c100d5fd3b4307e20e3bc8f563f1f2c2210 | 048a52df2b54a4e753e54ce828d9956a4e6e695e | /src/main/java/com/altynnikov/windowState/AuthorizationWindow.java | d0fe8285efd6dcba31fd84a786b0318941457a7c | [] | no_license | Infernum-altd/CinemaBooked | 9534ad4044feb0b43598d48efcedc2eabadd1b08 | 13cec700c0ebecfe3b4ee9854171a7668e397c08 | refs/heads/master | 2020-09-05T17:56:09.783254 | 2020-09-03T21:01:17 | 2020-09-03T21:01:17 | 220,174,393 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,201 | java | package com.altynnikov.windowState;
import com.altynnikov.service.Authorization;
import java.io.*;
import java.net.Socket;
public class AuthorizationWindow extends Window {
@Override
Window nextWindow() {
return new UserWindow(getClient(),getUserId());
}
@Override
Window previousMenu() {
return new MainWindow(getClient());
}
@Override
public Window interactWithWindow() throws IOException{
String login;
String password;
Authorization authorization = new Authorization();
login = loginRequest();
password = passwordRequest();
while (!authorization.isAuthorized(login,password)){
String answer = mistakeRequest();
int inputAction = 0;
if (answer.matches("\\d")){
inputAction = Integer.parseInt(answer);
}
switch (inputAction){
case 1:
return this;
case 2:
return new MainWindow(getClient());
case 0:
new DataOutputStream(getClient().getOutputStream()).writeUTF("illegalInput");
new DataOutputStream(getClient().getOutputStream()).writeUTF("Несуществующие действие");
return this;
}
login = loginRequest();
password = passwordRequest();
}
setUserId(authorization.getCurrentUser().getId());
return new UserWindow(getClient(), getUserId());
}
private String loginRequest(){
String answer = null;
try {
DataOutputStream out = new DataOutputStream(getClient().getOutputStream());
out.writeUTF("Введите логин");
out.flush();
DataInputStream in = new DataInputStream(getClient().getInputStream());
answer = in.readUTF();
} catch (IOException e){
e.printStackTrace();
}
return answer;
}
private String passwordRequest(){
String answer = null;
try {
DataOutputStream out = new DataOutputStream(getClient().getOutputStream());
out.writeUTF("Введите пароль");
out.flush();
DataInputStream in = new DataInputStream(getClient().getInputStream());
answer = in.readUTF();
} catch (IOException e){
e.printStackTrace();
}
return answer;
}
private String mistakeRequest(){
String answer = null;
try {
new DataOutputStream(getClient().getOutputStream()).writeUTF("Неверный пароль или логин\n" +
"1. Повторить попытку\n" +
"2. Вернуться в главное меню\n" +
"Введите число для перехода");
answer = new DataInputStream(getClient().getInputStream()).readUTF();
}catch (IOException e){
throw new RuntimeException(e);
}
return answer;
}
AuthorizationWindow(Socket client){
setClient(client);
}
}
| [
"[email protected]"
] | |
c2ceea182765620b5e3661b4d21314232e1ade1f | 71e3c95a8674e457bbe4668e26ce7ed000be135a | /src/shapes/Line_Object.java | 93bac2726bf22b1e7125c9e93e119e5d922ff611 | [] | no_license | harukip/UML-editor | 5f92a716a00817e64963349fff36f3bd7b9bd2c5 | 5700beeddab1fd8b1b9ceb03b3bdff26c27484d2 | refs/heads/master | 2022-10-23T03:31:01.500804 | 2020-06-15T10:43:41 | 2020-06-15T10:43:41 | 253,976,648 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,603 | java | package shapes;
import java.awt.Graphics;
import java.awt.Point;
public class Line_Object extends Shape{
private Port[] ports = new Port[2];
public Line_Object(Port s, Port d) {
ports[0] = s;
ports[1] = d;
}
@Override
public String gettype() {
return "Line";
}
public void draw(Graphics g) {}
public Port[] getport() {return ports;}
public Point rotate_shift(Point origin_point, Point alt_point, double angle){
Point output = new Point();
int x_diff = (int)(alt_point.getX() - origin_point.getX());
int y_diff = (int)(alt_point.getY() - origin_point.getY());
output.setLocation(
(int)(Math.cos(angle)*x_diff - Math.sin(angle)*y_diff)+alt_point.getX(),
(int)(Math.sin(angle)*x_diff + Math.cos(angle)*y_diff)+alt_point.getY()
);
return output;
}
public Point find_unit(Point source, Point dest){
Point output = new Point();
int x_diff = (int)(dest.getX() - source.getX());
int y_diff = (int)(dest.getY() - source.getY());
double times = (double)(Math.sqrt(400/(Math.pow(x_diff, 2)+Math.pow(y_diff, 2))));
output.setLocation(
dest.getX() - (int)(x_diff*times),
dest.getY() - (int)(y_diff*times)
);
return output;
}
public int[][] rotate_shape(int[][] input, double angle){
int[][] output = new int[input.length][input[0].length];
for(int i=0; i<input[0].length; i++) {
output[0][i] = (int)(Math.cos(angle)*input[0][i] - Math.sin(angle)*input[1][i]+ports[1].getposition().getX());
output[1][i] = (int)(Math.sin(angle)*input[0][i] + Math.cos(angle)*input[1][i]+ports[1].getposition().getY());
}
return output;
}
}
| [
"[email protected]"
] | |
2e994505a53634407a6c74a60b580cef371780c6 | bcfb7ef4972fea223c8313432a37a16529d6ef49 | /A.M.Spring.Bank/src/test/java/pl/air/hr/ApplicationTests.java | 06287ce20a106b22ad5ff3d2b89423954c193c28 | [] | no_license | AlMarcysiak/Human-Resources-System-Spring | 2d6801d4983fd0a108ca3c593a38e3d56787ee0b | 9c0212b1df534561947909a1eac7432fad41c6bc | refs/heads/master | 2020-06-04T01:20:04.999131 | 2019-09-23T13:10:59 | 2019-09-23T13:10:59 | 191,812,320 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 320 | java | package pl.air.hr;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest
public class ApplicationTests {
@Test
public void contextLoads() {
}
}
| [
"[email protected]"
] | |
a15e41c0720694b94be16e6817a4fec69f4d17ee | 07b10e4e8e0b1d95c43daece16faebd128b9a9a9 | /src/main/java/PagesElements/BlockReturnElements.java | c607d1261ece6fd233bbdf600d81c9808a3e9068 | [] | no_license | eugene-kurilenko-porsche/autotest-porshe | 30cdf06143ca55026a9b6264aae764a732c7daee | 7bc99c39fde94f940e85399c0d32365af0dafbeb | refs/heads/master | 2023-08-30T07:40:20.567202 | 2021-10-04T08:07:04 | 2021-10-04T08:07:04 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,497 | java | package PagesElements;
import com.codeborne.selenide.SelenideElement;
import static com.codeborne.selenide.Selenide.$x;
public class BlockReturnElements {
public SelenideElement pickupListItem = $x("//*[contains(@class, 'pickup-list-item pickup-status2')]");
public SelenideElement carKeyButton = $x("//*[contains(@class, 'return-btn-small return-btn-key')]");
public SelenideElement scanObjectButtonOnReturnBlock = $x("//*[contains(@class, 'btn-block return-btn')]");
public SelenideElement finalReturnButton = $x("//*[contains(@id, 'nextbutton')]");
public SelenideElement popupWithInfoParking = $x("//*[contains(text(), 'Ist der angezeigte Stellplatz korrekt?')]");
public SelenideElement confirmLocationButtonInPopup = $x("//*[@id=\"exampleModal3\"]/div/div/div[2]/button[2]");
public SelenideElement pickupDetailsBox = $x("//*[contains(@class, 'pickup-detail-box')]");
public SelenideElement returnDetailsBox = $x("//*[contains(@id, 'returndetails')]");
public SelenideElement saveButton = $x("//*[contains(@class, 'footer-block-right')]");
public SelenideElement disabledSaveButton = $x("//*[contains(@class, 'btn btn-primary btn-lg mb-4 disabled')]");
public SelenideElement enabledSaveButton = $x("//*[contains(@class, 'btn btn-primary btn-lg mb-4')]");
public SelenideElement fullstandButtonWithValue50 = $x("//*[contains(@id, '50')]");
public SelenideElement uniqueDepotAfterClickOnSaveButton = $x("//*[@id=\"depotMessage\"]/b");
}
| [
"[email protected]"
] | |
b74a084932d06e9786a34b75ff4b64f7551e643a | 04e2ab2298235c8b5ce7b6cdb8a2c6f872bc2d63 | /baseutils/src/main/java/com/personal/baseutils/widget/wheelview/WheelScroller.java | 1d17fcb6c137af98492118e48c811c534527dcfc | [] | no_license | mengmengxuan/YiShanGou | e2ff4e6da95144bc0db6d78cbd9abb4a00485737 | dc4857756933bdcc62623294b5fb6a2149172215 | refs/heads/main | 2023-03-14T08:15:13.088499 | 2021-03-02T12:26:16 | 2021-03-02T12:26:16 | 343,764,182 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,313 | java | /*
* Android Wheel Control.
* https://code.google.com/p/android-wheel/
*
* Copyright 2011 Yuri Kanivets
*
* 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.personal.baseutils.widget.wheelview;
import android.content.Context;
import android.os.Handler;
import android.os.Message;
import android.view.GestureDetector;
import android.view.GestureDetector.SimpleOnGestureListener;
import android.view.MotionEvent;
import android.view.animation.Interpolator;
import android.widget.Scroller;
/**
* Scroller class handles scrolling events and updates the
*/
public class WheelScroller {
/**
* Scrolling listener interface
*/
public interface ScrollingListener {
/**
* Scrolling callback called when scrolling is performed.
* @param distance the distance to scroll
*/
void onScroll(int distance);
/**
* Starting callback called when scrolling is started
*/
void onStarted();
/**
* Finishing callback called after justifying
*/
void onFinished();
/**
* Justifying callback called to justify a view when scrolling is ended
*/
void onJustify();
}
/** Scrolling duration */
private static final int SCROLLING_DURATION = 400;
/** Minimum delta for scrolling */
public static final int MIN_DELTA_FOR_SCROLLING = 1;
// Listener
private ScrollingListener listener;
// Context
private Context context;
// Scrolling
private GestureDetector gestureDetector;
private Scroller scroller;
private int lastScrollY;
private float lastTouchedY;
private boolean isScrollingPerformed;
/**
* Constructor
* @param context the current context
* @param listener the scrolling listener
*/
public WheelScroller(Context context, ScrollingListener listener) {
gestureDetector = new GestureDetector(context, gestureListener);
gestureDetector.setIsLongpressEnabled(false);
scroller = new Scroller(context);
this.listener = listener;
this.context = context;
}
/**
* Set the the specified scrolling interpolator
* @param interpolator the interpolator
*/
public void setInterpolator(Interpolator interpolator) {
scroller.forceFinished(true);
scroller = new Scroller(context, interpolator);
}
/**
* Scroll the wheel
* @param distance the scrolling distance
* @param time the scrolling duration
*/
public void scroll(int distance, int time) {
scroller.forceFinished(true);
lastScrollY = 0;
scroller.startScroll(0, 0, 0, distance, time != 0 ? time : SCROLLING_DURATION);
setNextMessage(MESSAGE_SCROLL);
startScrolling();
}
/**
* Stops scrolling
*/
public void stopScrolling() {
scroller.forceFinished(true);
}
/**
* Handles Touch event
* @param event the motion event
* @return
*/
public boolean onTouchEvent(MotionEvent event) {
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
lastTouchedY = event.getY();
scroller.forceFinished(true);
clearMessages();
break;
case MotionEvent.ACTION_MOVE:
// perform scrolling
int distanceY = (int)(event.getY() - lastTouchedY);
if (distanceY != 0) {
startScrolling();
listener.onScroll(distanceY);
lastTouchedY = event.getY();
}
break;
}
if (!gestureDetector.onTouchEvent(event) && event.getAction() == MotionEvent.ACTION_UP) {
justify();
}
return true;
}
// gesture listener
private SimpleOnGestureListener gestureListener = new SimpleOnGestureListener() {
public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) {
// Do scrolling in onTouchEvent() since onScroll() are not call immediately
// when user touch and move the wheel
return true;
}
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
lastScrollY = 0;
final int maxY = 0x7FFFFFFF;
final int minY = -maxY;
scroller.fling(0, lastScrollY, 0, (int) -velocityY, 0, 0, minY, maxY);
setNextMessage(MESSAGE_SCROLL);
return true;
}
};
// Messages
private final int MESSAGE_SCROLL = 0;
private final int MESSAGE_JUSTIFY = 1;
/**
* Set next message to queue. Clears queue before.
*
* @param message the message to set
*/
private void setNextMessage(int message) {
clearMessages();
animationHandler.sendEmptyMessage(message);
}
/**
* Clears messages from queue
*/
private void clearMessages() {
animationHandler.removeMessages(MESSAGE_SCROLL);
animationHandler.removeMessages(MESSAGE_JUSTIFY);
}
// animation handler
private Handler animationHandler = new Handler() {
public void handleMessage(Message msg) {
scroller.computeScrollOffset();
int currY = scroller.getCurrY();
int delta = lastScrollY - currY;
lastScrollY = currY;
if (delta != 0) {
listener.onScroll(delta);
}
// scrolling is not finished when it comes to final Y
// so, finish it manually
if (Math.abs(currY - scroller.getFinalY()) < MIN_DELTA_FOR_SCROLLING) {
currY = scroller.getFinalY();
scroller.forceFinished(true);
}
if (!scroller.isFinished()) {
animationHandler.sendEmptyMessage(msg.what);
} else if (msg.what == MESSAGE_SCROLL) {
justify();
} else {
finishScrolling();
}
}
};
/**
* Justifies wheel
*/
private void justify() {
listener.onJustify();
setNextMessage(MESSAGE_JUSTIFY);
}
/**
* Starts scrolling
*/
private void startScrolling() {
if (!isScrollingPerformed) {
isScrollingPerformed = true;
listener.onStarted();
}
}
/**
* Finishes scrolling
*/
void finishScrolling() {
if (isScrollingPerformed) {
listener.onFinished();
isScrollingPerformed = false;
}
}
}
| [
"[email protected]"
] | |
5d9816ef0c2607491a136617633a24977de8987d | 7498d21c11cf47f6ab6bb73b21385729839a7244 | /src/main/java/com/example/task/dao/GradeDao.java | 9b4d4bbdaf07c777d5d0f932f06730170f3e9278 | [] | no_license | eutaqwa/springbootjsonjpa | 419d6f51e8a0db439aaeb3a222601af1c8183cf1 | 4ae03ecc6c4d4bedc41118d011f2631afa156202 | refs/heads/master | 2020-06-03T07:16:15.716815 | 2019-06-12T03:40:03 | 2019-06-12T03:40:03 | 191,491,650 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 209 | java | package com.example.task.dao;
import org.springframework.data.repository.CrudRepository;
import com.example.task.model.GradeModel;
public interface GradeDao extends CrudRepository<GradeModel, Integer> {
}
| [
"[email protected]"
] | |
660a5d59a267bafed56358af3070fbf8b9a44eb3 | 8e13c338dec36021668e46798ff40c7ea9b6b065 | /Mage.Sets/src/mage/cards/p/PretendersClaim.java | 40bbfa3abd0ac93743303df7fe72740d4a087f8d | [
"MIT"
] | permissive | ninthworld/mage | c38aeeaa65a2a0afa908779b7c63ef2e1b1e413a | ba558f9a18032148a2936eedf874d90c97c7d46c | refs/heads/master | 2022-07-29T23:17:30.439762 | 2022-07-02T22:20:41 | 2022-07-02T22:20:41 | 140,520,040 | 1 | 0 | MIT | 2018-07-11T04:08:35 | 2018-07-11T04:08:35 | null | UTF-8 | Java | false | false | 2,892 | java | package mage.cards.p;
import java.util.List;
import java.util.UUID;
import mage.constants.SubType;
import mage.target.common.TargetCreaturePermanent;
import mage.abilities.Ability;
import mage.abilities.common.BecomesBlockedAttachedTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.AttachEffect;
import mage.constants.Outcome;
import mage.target.TargetPermanent;
import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
/**
*
* @author jeffwadsworth
*/
public final class PretendersClaim extends CardImpl {
public PretendersClaim(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{B}");
this.subtype.add(SubType.AURA);
// Enchant creature
TargetPermanent auraTarget = new TargetCreaturePermanent();
this.getSpellAbility().addTarget(auraTarget);
this.getSpellAbility().addEffect(new AttachEffect(Outcome.Benefit));
Ability ability = new EnchantAbility(auraTarget.getTargetName());
this.addAbility(ability);
// Whenever enchanted creature becomes blocked, tap all lands defending player controls.
this.addAbility(new BecomesBlockedAttachedTriggeredAbility(new TapDefendingPlayerLandEffect(), false));
}
private PretendersClaim(final PretendersClaim card) {
super(card);
}
@Override
public PretendersClaim copy() {
return new PretendersClaim(this);
}
}
class TapDefendingPlayerLandEffect extends OneShotEffect {
public TapDefendingPlayerLandEffect() {
super(Outcome.Tap);
staticText = "tap all lands defending player controls";
}
public TapDefendingPlayerLandEffect(final TapDefendingPlayerLandEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent aura = game.getPermanentOrLKIBattlefield(source.getSourceId());
if (aura != null
&& aura.getAttachedTo() != null) {
Player defendingPlayer = game.getPlayer(game.getCombat().getDefendingPlayerId(aura.getAttachedTo(), game));
if (defendingPlayer != null) {
List<Permanent> permanents = game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_CONTROLLED_PERMANENT_LAND, defendingPlayer.getId(), game);
for (Permanent land : permanents) {
land.tap(source, game);
}
return true;
}
}
return false;
}
@Override
public TapDefendingPlayerLandEffect copy() {
return new TapDefendingPlayerLandEffect(this);
}
}
| [
"[email protected]"
] | |
01991f40b42a52fd1c28217e667cc7f365e3ad23 | de3a3b121bb58900134eec13c702509109015843 | /src/main/java/com/xnjr/mall/api/impl/XN808265.java | 03151d2622fbd6c4a48a66945546697a3a6f3802 | [] | no_license | yiwocao2017/cswstdmall | 8d422afef6ba338fe5db34683c115b30c03336ff | ad2c10994e7d844429cd74131e903e7b326000e9 | refs/heads/master | 2022-06-27T13:59:26.488189 | 2019-07-01T06:30:05 | 2019-07-01T06:30:05 | 194,613,061 | 0 | 0 | null | 2022-06-17T02:17:53 | 2019-07-01T06:30:04 | Java | UTF-8 | Java | false | false | 2,047 | java | /**
* @Title XN808228.java
* @Package com.xnjr.mall.api.impl
* @Description
* @author haiqingzheng
* @date 2016年12月18日 下午11:28:37
* @version V1.0
*/
package com.xnjr.mall.api.impl;
import org.apache.commons.lang3.StringUtils;
import com.xnjr.mall.ao.IUserTicketAO;
import com.xnjr.mall.api.AProcessor;
import com.xnjr.mall.common.JsonUtil;
import com.xnjr.mall.core.StringValidater;
import com.xnjr.mall.domain.UserTicket;
import com.xnjr.mall.dto.req.XN808265Req;
import com.xnjr.mall.exception.BizException;
import com.xnjr.mall.exception.ParaException;
import com.xnjr.mall.spring.SpringContextHolder;
/**
* 我的折扣券分页查询
* @author: haiqingzheng
* @since: 2016年12月18日 下午11:28:37
* @history:
*/
public class XN808265 extends AProcessor {
private IUserTicketAO userTicketAO = SpringContextHolder
.getBean(IUserTicketAO.class);
private XN808265Req req = null;
/**
* @see com.xnjr.mall.api.IProcessor#doBusiness()
*/
@Override
public Object doBusiness() throws BizException {
UserTicket condition = new UserTicket();
condition.setUserId(req.getUserId());
condition.setStoreCode(req.getStoreCode());
condition.setStatus(req.getStatus());
String orderColumn = req.getOrderColumn();
if (StringUtils.isBlank(orderColumn)) {
orderColumn = IUserTicketAO.DEFAULT_ORDER_COLUMN;
}
condition.setOrder(orderColumn, req.getOrderDir());
int start = StringValidater.toInteger(req.getStart());
int limit = StringValidater.toInteger(req.getLimit());
return userTicketAO.queryUserTicketPage(start, limit, condition);
}
/**
* @see com.xnjr.mall.api.IProcessor#doCheck(java.lang.String)
*/
@Override
public void doCheck(String inputparams) throws ParaException {
req = JsonUtil.json2Bean(inputparams, XN808265Req.class);
StringValidater.validateBlank(req.getUserId(), req.getStart(),
req.getLimit());
}
}
| [
"[email protected]"
] | |
083d4f0e7fb8d1444bb4826b980838941c48df68 | 968a55a6da332de5868614d8be11175aff718ecb | /src/main/java/org/arhan/Main.java | a025085948b0efc3313ee2439a7f69842ec3f0b8 | [] | no_license | antonarhipov/attach-and-transform-with-mbeans | 55b719a7653dc7fbd4c34b464f40410d90ff7619 | ee8f0fa5433d993ee0cea81e712ae9f744526fb8 | refs/heads/master | 2021-01-10T13:49:54.228395 | 2015-11-05T10:02:26 | 2015-11-05T10:02:26 | 45,566,006 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,899 | java | package org.arhan;
import com.sun.tools.attach.VirtualMachine;
import javax.management.ObjectName;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.lang.management.ManagementFactory;
import java.util.concurrent.atomic.AtomicReference;
import java.util.jar.JarOutputStream;
import java.util.jar.Manifest;
import java.util.zip.ZipEntry;
public class Main {
/**
* The created agent jar file name
*/
protected static final AtomicReference<String> agentJar = new AtomicReference<String>(null);
/**
* Self installs the agent, then runs a person sayHello in a loop
*
* @param args None
*/
public static void main(String[] args) {
try {
// Get this JVM's PID
String pid = ManagementFactory.getRuntimeMXBean().getName().split("@")[0];
// Attach (to ourselves)
VirtualMachine vm = VirtualMachine.attach(pid);
// Create an agent jar (since we're in DEV mode)
String fileName = createAgent();
// Load the agent into this JVM
vm.loadAgent(fileName);
System.out.println("Agent Loaded");
ObjectName on = new ObjectName("transformer:service=DemoTransformer");
System.out.println("Instrumentation Deployed:" + ManagementFactory.getPlatformMBeanServer().isRegistered(on));
// Run sayHello in a loop
Bean person = new Bean();
for (int i = 0; i < 1000; i++) {
person.sayHello(i);
person.sayHello("String: " + (i * -1));
Thread.sleep(3000);
}
} catch (Exception ex) {
System.err.println("Agent Installation Failed. Stack trace follows...");
ex.printStackTrace(System.err);
}
}
/**
* Creates the temporary agent jar file if it has not been created
*
* @return The created agent file name
*/
public static String createAgent() {
if (agentJar.get() == null) {
synchronized (agentJar) {
if (agentJar.get() == null) {
FileOutputStream fos = null;
try {
File tmpFile = File.createTempFile(Agent.class.getName(), ".jar");
System.out.println("Temp File:" + tmpFile.getAbsolutePath());
tmpFile.deleteOnExit();
String manifest = ("Manifest-Version: 1.0\nAgent-Class: " + Agent.class.getName() + "\n") +
"Can-Redefine-Classes: true\n" +
"Can-Retransform-Classes: true\n" +
"Premain-Class: " + Agent.class.getName() + "\n";
ByteArrayInputStream bais = new ByteArrayInputStream(manifest.getBytes());
Manifest mf = new Manifest(bais);
fos = new FileOutputStream(tmpFile, false);
JarOutputStream jos = new JarOutputStream(fos, mf);
addClassesToJar(jos, Agent.class, DemoTransformer.class, ModifyMethodTest.class, TransformerService.class, TransformerServiceMBean.class);
jos.flush();
jos.close();
fos.flush();
fos.close();
agentJar.set(tmpFile.getAbsolutePath());
} catch (Exception e) {
throw new RuntimeException("Failed to write Agent installer Jar", e);
} finally {
if (fos != null) try {
fos.close();
} catch (Exception ignored) {
}
}
}
}
}
return agentJar.get();
}
/**
* Writes the passed classes to the passed JarOutputStream
*
* @param jos the JarOutputStream
* @param clazzes The classes to write
* @throws IOException on an IOException
*/
protected static void addClassesToJar(JarOutputStream jos, Class<?>... clazzes) throws IOException {
for (Class<?> clazz : clazzes) {
jos.putNextEntry(new ZipEntry(clazz.getName().replace('.', '/') + ".class"));
jos.write(getClassBytes(clazz));
jos.flush();
jos.closeEntry();
}
}
/**
* Returns the bytecode bytes for the passed class
*
* @param clazz The class to get the bytecode for
* @return a byte array of bytecode for the passed class
*/
public static byte[] getClassBytes(Class<?> clazz) {
InputStream is = null;
try {
is = clazz.getClassLoader().getResourceAsStream(clazz.getName().replace('.', '/') + ".class");
ByteArrayOutputStream baos = new ByteArrayOutputStream(is.available());
byte[] buffer = new byte[8092];
int bytesRead;
while ((bytesRead = is.read(buffer)) != -1) {
baos.write(buffer, 0, bytesRead);
}
baos.flush();
return baos.toByteArray();
} catch (Exception e) {
throw new RuntimeException("Failed to read class bytes for [" + clazz.getName() + "]", e);
} finally {
if (is != null) {
try {
is.close();
} catch (Exception ignored) {
}
}
}
}
}
| [
"[email protected]"
] | |
ab91c03b59ea022112d15c5663152bcde3771f9a | 66bb9a0dc88cef7f395f39d670576139022a2516 | /src/com/nfit/yaoliusan/myblog/web/CommentDelServlet.java | 0776b4cd9f165bc1cf92080745c7c50c887e955d | [] | no_license | yaoliuyao/14-posts-ajax | 8fbc54954f917bf854bdf6db9b352381ea8ce892 | 34cf025ba154ff8760469920143cb4e607f97b8d | refs/heads/master | 2022-12-26T19:10:02.168816 | 2020-10-09T03:18:51 | 2020-10-10T00:26:32 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 823 | java | package com.nfit.yaoliusan.myblog.web;
import com.nfit.yaoliusan.myblog.dao.CommentDAO;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@WebServlet("/comment/del")
public class CommentDelServlet extends HttpServlet {
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
String id = req.getParameter("id");
try {
new CommentDAO().delete(id);
resp.getWriter().print(id);
} catch (Exception exception) {
exception.printStackTrace();
resp.getWriter().print("-1");
}
}
}
| [
"[email protected]"
] | |
d0877c9e13725df0b0db0f94533056e77c94c1c6 | a422de59c29d077c512d66b538ff17d179cc077a | /hsxt/hsxt-common/src/main/java/com/gy/hsxt/common/exception/HsException.java | 58a24be99666ff69d2d3d48e844e4d81c3b57ee0 | [] | no_license | liveqmock/hsxt | c554e4ebfd891e4cc3d57e920d8a79ecc020b4dd | 40bb7a1fe5c22cb5b4f1d700e5d16371a3a74c04 | refs/heads/master | 2020-03-28T14:09:31.939168 | 2018-09-12T10:20:46 | 2018-09-12T10:20:46 | 148,461,898 | 0 | 0 | null | 2018-09-12T10:19:11 | 2018-09-12T10:19:10 | null | UTF-8 | Java | false | false | 3,783 | java | /***************************************************************************
* This document contains confidential and proprietary information
* subject to non-disclosure agreements with GUIYI Technology, Ltd.
* This information shall not be distributed or copied without written
* permission from GUIYI technology, Ltd.
***************************************************************************/
package com.gy.hsxt.common.exception;
import org.apache.commons.lang3.StringUtils;
import com.gy.hsxt.common.constant.IRespCode;
import com.gy.hsxt.common.constant.RespCode;
/***************************************************************************
* <PRE>
* Project Name : hsxt-common
* <p/>
* Package Name : com.gy.hsxt
* <p/>
* File Name : HsException.java
* <p/>
* Creation Date : 2015-7-8
* <p/>
* Author : yangjianguo
* <p/>
* Purpose : 通用异常类
* <p/>
* <p/>
* History : TODO
* <p/>
* </PRE>
***************************************************************************/
public class HsException extends RuntimeException {
private static final long serialVersionUID = -6465404826204357739L;
/**
* 错误代码
*/
private Integer errorCode;
/**
* 错误代码接口
*/
private IRespCode respCode;
public HsException() {
super();
errorCode = RespCode.UNKNOWN.getCode();
respCode = RespCode.UNKNOWN;
}
/**
* 该构造方法已经被遗弃
*
* @param errorCode
* 错误代码
* @deprecated Please use {@link HsException#HsException(IRespCode)}
* instead.
*/
@Deprecated
public HsException(int errorCode) {
super();
this.errorCode = errorCode;
}
/**
* 该构造方法已被遗弃
*
* @param errorCode
* 错误代码
* @param message
* 消息
*/
public HsException(int errorCode, String message) {
super(message);
this.errorCode = errorCode;
}
/**
* 添加构造方法
*
* @param respCode
* 错误代码枚举类型
* @author LiZhi Peter
* @see 2015-12-21
*/
public HsException(IRespCode respCode) {
super(respCode.getDesc());
this.errorCode = respCode.getCode();
this.respCode = respCode;
}
/**
* 构造方法
*
* @param respCode
* 错误代码
* @param message
* 默认消息
*/
public HsException(IRespCode respCode, String message) {
super(StringUtils.isNotBlank(message) ? message : respCode.getDesc());
this.respCode = respCode;
this.errorCode = respCode.getCode();
}
public Integer getErrorCode() {
if (respCode != null)
{
return respCode.getCode();
}
return errorCode;
}
public void setErrorCode(Integer errorCode) {
this.errorCode = errorCode;
}
public IRespCode getRespCode() {
return respCode;
}
public void setRespCode(IRespCode respCode) {
this.respCode = respCode;
}
@Override
public String toString() {
StringBuilder messageBuilder = new StringBuilder(getClass().getName());
messageBuilder.append(":");
if (respCode == null)
{
messageBuilder.append(this.errorCode);
}
else
{
messageBuilder.append(respCode.getCode()).append(":").append(respCode.name());
}
String message = getLocalizedMessage();
return StringUtils.isNotBlank(message) ? messageBuilder.append(":").append(message).toString() : messageBuilder
.toString();
}
}
| [
"[email protected]"
] | |
4fb748a7a2a2348ad8f93b12e922fe36eb9ccb40 | 927268625a21d96e0dd057568bc309e463d3b444 | /src/md/tekwill/demo/inheritance/Employee.java | 488c48ae995c078b7f19864e34ccd9b37c6af5db | [
"MIT"
] | permissive | theFaustus/demo-oca | 7975631f2f39d6900ed3b99b2449b51c732ac9de | 826801bfd9e234b17f728786003047279e8b7930 | refs/heads/master | 2020-06-30T03:24:44.559951 | 2019-10-11T17:27:48 | 2019-10-11T17:27:48 | 200,707,815 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 700 | java | package md.tekwill.demo.inheritance;
class Employee {
protected String name;
protected String address;
public Employee(String name, String address) {
this.name = name;
this.address = address;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
@Override
public String toString() {
return "Employee{" +
"name='" + name + '\'' +
", address='" + address + '\'' +
'}';
}
}
| [
"”[email protected]”"
] | |
d315610bb9840610e9ed9b610b3e367f20a59c22 | bd7f909b20535294d3c55dcc8b2397d63e01f5d4 | /miu-session-spring/src/main/java/com/example/miu/session/repository/MovieRepository.java | 2ccd9722e0e8ec22f85b9fa2522a426750d5e6a4 | [] | no_license | Oddadmix/miu-senior-session | f10720b70477de40354a2d5149d372643daff419 | 1cd52f811bdd8380e785f43529a87d42996a67fe | refs/heads/master | 2021-07-10T10:55:43.250246 | 2017-10-10T12:48:45 | 2017-10-10T12:48:45 | 105,296,637 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 225 | java | package com.example.miu.session.repository;
import org.springframework.data.repository.CrudRepository;
import com.example.miu.session.entity.Movie;
public interface MovieRepository extends CrudRepository<Movie, Long> {
}
| [
"oddadmix"
] | oddadmix |
620269536db52acddf276f1061bc40aa97b60a53 | cbd3ee6e3b947ac83521e34335a5ff3bc19cc255 | /src/main/java/com/ricardo/cursomc/repositories/ClienteRepository.java | 356958a7bef6ddeff2c29ace4839434d1e22dfa9 | [] | no_license | Ricardo2507/crusomc | 1918f823f1ca092d23575b3af5852bc04105b850 | 890b1afca0178b13d7045bb1dcdaffef545d19c1 | refs/heads/master | 2020-09-15T23:11:49.696447 | 2019-12-11T23:39:12 | 2019-12-11T23:39:12 | 223,579,229 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 427 | java | package com.ricardo.cursomc.repositories;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import com.ricardo.cursomc.domain.Cliente;
/** no Repository não será class, será interface extendendo JpaRepository **/
/** faz parte da camada de acesso a dados **/
@Repository
public interface ClienteRepository extends JpaRepository<Cliente, Integer> {
}
| [
"[email protected]"
] | |
668bebab4a92967f391f09581b90843eca95a89a | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/3/3_41f1b482e8e914054fc35db32c4ae8e4b7b8e6eb/ContainerShapeEditPart/3_41f1b482e8e914054fc35db32c4ae8e4b7b8e6eb_ContainerShapeEditPart_t.java | 6cf61c04d889fc1edd9644c645d1962ac66a9f35 | [] | 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 | 8,956 | java | /*******************************************************************************
* <copyright>
*
* Copyright (c) 2005, 2012 SAP AG.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* SAP AG - initial API, implementation and documentation
* mgorning - Bug 379836 - StackOverflow when parent GA is the root GA of an inactive shape
*
* </copyright>
*
*******************************************************************************/
package org.eclipse.graphiti.ui.internal.parts;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import org.eclipse.draw2d.ColorConstants;
import org.eclipse.draw2d.IFigure;
import org.eclipse.draw2d.LayoutManager;
import org.eclipse.draw2d.XYLayout;
import org.eclipse.gef.CompoundSnapToHelper;
import org.eclipse.gef.EditPart;
import org.eclipse.gef.EditPolicy;
import org.eclipse.gef.SnapToGeometry;
import org.eclipse.gef.SnapToGrid;
import org.eclipse.gef.SnapToGuides;
import org.eclipse.gef.SnapToHelper;
import org.eclipse.gef.rulers.RulerProvider;
import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
import org.eclipse.graphiti.mm.pictograms.ContainerShape;
import org.eclipse.graphiti.mm.pictograms.PictogramElement;
import org.eclipse.graphiti.mm.pictograms.Shape;
import org.eclipse.graphiti.platform.ga.IGraphicsAlgorithmRenderer;
import org.eclipse.graphiti.tb.IToolBehaviorProvider;
import org.eclipse.graphiti.ui.internal.config.IConfigurationProvider;
import org.eclipse.graphiti.ui.internal.util.ui.sfx.GFSnapFeedbackPolicy;
/**
* A GraphicalEditPart, which model is of the type ContainerShape.
*
* @noinstantiate This class is not intended to be instantiated by clients.
* @noextend This class is not intended to be subclassed by clients.
*/
public class ContainerShapeEditPart extends ShapeEditPart implements IContainerShapeEditPart {
private IFigure contentPaneFigureCache;
private Integer contentPaneChilds = 0;
/**
* Creates a new ContainerShapeEditPart.
*
* @param configurationProvider
* the configuration provider
* @param containerShape
* the container shape
*/
public ContainerShapeEditPart(IConfigurationProvider configurationProvider, ContainerShape containerShape) {
super(configurationProvider, containerShape);
}
// ======================= overwriteable behaviour ========================
/**
* Creates the EditPolicies of this EditPart. Subclasses often overwrite
* this method to change the behaviour of the editpart. This implementation
* adds the layout-specific EditPolicy to the super-implementation.
*
* @see ShapeEditPart
*/
@Override
protected void createEditPolicies() {
super.createEditPolicies();
installEditPolicy(EditPolicy.LAYOUT_ROLE, getConfigurationProvider().getEditPolicyFactory()
.createShapeXYLayoutEditPolicy());
// installEditPolicy(EditPolicy.CONTAINER_ROLE,
// getConfigurationProvider().getEditPolicyFactory().createShapeXYLayoutEditPolicy());
installEditPolicy("Snap Feedback", new GFSnapFeedbackPolicy()); //$NON-NLS-1$
}
/**
* Creates the Figure of this editpart. This determines how the editpart
* will be displayed. The actual data for this figure should be provided in
* refreshVisuals().
*
* @return the i figure
*
* @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#createFigure()
*/
@Override
protected IFigure createFigure() {
if (getPictogramElement().getGraphicsAlgorithm() == null) {
throw new IllegalStateException(
"The ContainerShape must have a valid GraphicsAlgorithm: " + getPictogramElement().toString()); //$NON-NLS-1$
}
resetContentPaneFigureCache();
IFigure figure = super.createFigure();
if (figure != null) {
if (figure.getBackgroundColor() == null && !(figure instanceof IGraphicsAlgorithmRenderer))
figure.setBackgroundColor(ColorConstants.lightGray);
figure.setOpaque(true);
}
setFigure(figure);
contentPaneChilds = getContentPane().getChildren().size(); // initialize
// contentPaneChilds
return figure;
}
// ========================= standard behaviour ===========================
/**
* Returns the children of this EditPart.
*
* @return the model children
*
* @see org.eclipse.gef.editparts.AbstractEditPart#getModelChildren()
*/
@Override
public List<PictogramElement> getModelChildren() {
List<PictogramElement> result = new ArrayList<PictogramElement>();
if (getPictogramElementDelegate().isValid()) {
ContainerShape containerShape = (ContainerShape) getPictogramElement();
List<PictogramElement> activeChildren = collectActiveChildrenRecursively(containerShape);
result.addAll(activeChildren);
result.addAll(super.getModelChildren());
}
return result;
}
/**
* @param containerShape
* @return
*/
private List<PictogramElement> collectActiveChildrenRecursively(ContainerShape containerShape) {
Collection<? extends Shape> coll = containerShape.getChildren();
List<PictogramElement> activeChildren = new ArrayList<PictogramElement>();
for (Iterator<? extends Shape> iter = coll.iterator(); iter.hasNext();) {
Object obj = iter.next();
if (obj != null && obj instanceof PictogramElement) {
PictogramElement pe = (PictogramElement) obj;
if (pe.isActive()) {
activeChildren.add(pe);
} else if (pe instanceof ContainerShape) {
activeChildren.addAll(collectActiveChildrenRecursively((ContainerShape) pe));
}
}
}
return activeChildren;
}
/*
* (non-Javadoc)
*
* @see
* org.eclipse.gef.editparts.AbstractGraphicalEditPart#addChildVisual(org
* .eclipse.gef.EditPart, int)
*/
@Override
protected void addChildVisual(EditPart childEditPart, int index) {
resetContentPaneFigureCache();
int realIndex = index + getContentPaneChildCount();
super.addChildVisual(childEditPart, realIndex);
}
private void resetContentPaneFigureCache() {
contentPaneFigureCache = null;
}
/*
* (non-Javadoc)
*
* @see
* org.eclipse.graphiti.ui.internal.parts.ShapeEditPart#getAdapter(java.
* lang.Class)
*/
@Override
public Object getAdapter(@SuppressWarnings("rawtypes") Class adapter) {
if (adapter == SnapToHelper.class) {
List<SnapToHelper> snapStrategies = new ArrayList<SnapToHelper>();
Boolean val = (Boolean) getViewer().getProperty(RulerProvider.PROPERTY_RULER_VISIBILITY);
if (val != null && val.booleanValue())
snapStrategies.add(new SnapToGuides(this));
val = (Boolean) getViewer().getProperty(SnapToGeometry.PROPERTY_SNAP_ENABLED);
if (val != null && val.booleanValue())
snapStrategies.add(new SnapToGeometry(this));
val = (Boolean) getViewer().getProperty(SnapToGrid.PROPERTY_GRID_ENABLED);
if (val != null && val.booleanValue())
snapStrategies.add(new SnapToGrid(this));
if (snapStrategies.size() == 0)
return null;
if (snapStrategies.size() == 1)
return snapStrategies.get(0);
SnapToHelper ss[] = new SnapToHelper[snapStrategies.size()];
for (int i = 0; i < snapStrategies.size(); i++)
ss[i] = snapStrategies.get(i);
return new CompoundSnapToHelper(ss);
}
return super.getAdapter(adapter);
}
/*
* (non-Javadoc)
*
* @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#getContentPane()
*/
@Override
public IFigure getContentPane() {
if (getContentPaneFigureCache() != null) {
return getContentPaneFigureCache();
}
IToolBehaviorProvider tbp = getConfigurationProvider().getDiagramTypeProvider()
.getCurrentToolBehaviorProvider();
PictogramElement pe = getPictogramElement();
if (pe instanceof ContainerShape && !(this instanceof DiagramEditPart)) {
ContainerShape cs = (ContainerShape) pe;
GraphicsAlgorithm contentGa = tbp.getContentArea(cs);
if (contentGa != null) {
setConentPaneFigureCache(getPictogramElementDelegate().getFigureForGraphicsAlgorithm(contentGa));
if (getContentPaneFigureCache() != null) {
LayoutManager lm = getContentPaneFigureCache().getLayoutManager();
if (!(lm instanceof XYLayout)) {
getContentPaneFigureCache().setLayoutManager(new XYLayout());
}
return getContentPaneFigureCache();
}
}
}
IFigure ret = super.getContentPane();
return ret;
}
private void setConentPaneFigureCache(IFigure figure) {
contentPaneFigureCache = figure;
}
private IFigure getContentPaneFigureCache() {
return contentPaneFigureCache;
}
private Integer getContentPaneChildCount() {
return contentPaneChilds;
}
}
| [
"[email protected]"
] | |
ee963e904043e836d8d19950692d44e8279b59dc | 9f1fb4f7d5d8939af74a015ab9a1c118ed7c15c7 | /mentoringsession/ReplaceB.java | 3e84c38a5ff0e4089f8b7909e8502633554477d0 | [] | no_license | kutmanai/add-day_9_conditionals3- | 814f0d872005928187541d064820aa280dc96a8c | c0ba1b40b7504ef86523475f98fcd42672cc44bd | refs/heads/master | 2020-04-09T03:54:32.951404 | 2018-12-02T00:59:01 | 2018-12-02T00:59:01 | 160,002,224 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 492 | java | package mentoringsession;
public class ReplaceB {
public static void main(String[] args) {
String words[]= { "Bananas","Blueberries", "Cherries",
"Brocolli", "Butternet", "Squash", "Green bean", "Peanut"
};
for (int i =0; i <words.length; i++) {
words[i]= words[i].replace("B", "V").replaceFirst("b", "v");
//words[i]= words[i].replace("b,","v");
}
for(String word: words){
System.out.print(word + " ,");
}
}
}
| [
"[email protected]"
] | |
cfee952c8d6944b0f1c2c4594e79e0b1523e629c | 2918eeaa8de3e0d4a1178da42b06fd8b20378a7f | /app/src/main/java/com/zanrite/groomme/HistoryData/Tabs_past_future_ride.java | f163fd2a95e4c54d2637fb65bd2f55c1a49ced52 | [] | no_license | Bbox12/groomme | 0564a0bf65144b9cc201165ce79a8f47e4c4cc72 | 11befa5d8aa992dd0cf75e2cf586d9f2f05909d9 | refs/heads/master | 2023-06-17T18:54:02.559055 | 2021-07-11T14:26:38 | 2021-07-11T14:26:38 | 339,601,213 | 0 | 0 | null | 2021-07-11T14:26:38 | 2021-02-17T03:31:09 | Java | UTF-8 | Java | false | false | 5,517 | java | package com.zanrite.groomme.HistoryData;
import android.content.Intent;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;
import androidx.viewpager.widget.ViewPager;
import com.google.android.material.tabs.TabLayout;
import com.zanrite.groomme.Activities.SalonHomePage;
import com.zanrite.groomme.R;
import com.zanrite.groomme.UserPart.UserHomeScreen;
import com.zanrite.groomme.helpers.PrefManager;
import java.util.ArrayList;
import java.util.List;
public class Tabs_past_future_ride extends AppCompatActivity {
private Toolbar toolbar;
private TabLayout tabLayout;
private ViewPager viewPager;
private double My_lat=0,My_long=0;
private Bundle bundle;
private int Pager=0;
private PrefManager pref;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.ride_later_tab);
pref = new PrefManager(getApplicationContext());
toolbar = findViewById(R.id.toolbar_later_tabs);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setDisplayShowTitleEnabled(false);
viewPager = findViewById(R.id.viewpager_tabs);
tabLayout = findViewById(R.id.tabs);
tabLayout.setupWithViewPager(viewPager);
setupViewPager(viewPager,bundle);
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(pref.getResposibility()==1) {
Intent i = new Intent(Tabs_past_future_ride.this, UserHomeScreen.class);
i.putExtra("my_lat", My_lat);
i.putExtra("my_long", My_long);
startActivity(i);
finish();
overridePendingTransition(R.anim.slide_up1, R.anim.rbounce);
}else if(pref.getResposibility()==2) {
Intent i = new Intent(Tabs_past_future_ride.this, SalonHomePage.class);
i.putExtra("my_lat", My_lat);
i.putExtra("my_long", My_long);
startActivity(i);
finish();
overridePendingTransition(R.anim.slide_up1, R.anim.rbounce);
}
}
});
}
private void setupViewPager(ViewPager viewPager, Bundle bundle) {
ViewPagerAdapter adapter = new ViewPagerAdapter(getSupportFragmentManager());
Present_fragment fragObj2 = new Present_fragment();
fragObj2.setArguments(bundle);
adapter.addFragment(fragObj2,"Accepted");
Future_fragment fragObj1 = new Future_fragment();
fragObj1.setArguments(bundle);
adapter.addFragment(fragObj1,"Requested");
PastFragment fragobj = new PastFragment();
fragobj.setArguments(bundle);
adapter.addFragment(fragobj, "History");
adapter.notifyDataSetChanged();
viewPager.setAdapter(adapter);
}
class ViewPagerAdapter extends FragmentPagerAdapter {
private final List<Fragment> mFragmentList = new ArrayList<>();
private final List<String> mFragmentTitleList = new ArrayList<>();
public ViewPagerAdapter(FragmentManager manager) {
super(manager);
}
@Override
public Fragment getItem(int position) {
return mFragmentList.get(position);
}
@Override
public int getCount() {
return mFragmentList.size();
}
public void addFragment(Fragment fragment, String title) {
mFragmentList.add(fragment);
mFragmentTitleList.add(title);
}
@Override
public CharSequence getPageTitle(int position) {
return mFragmentTitleList.get(position);
}
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event)
{
//replaces the default 'Back' button action
if(keyCode== KeyEvent.KEYCODE_BACK) {
if(pref.getResposibility()==1) {
Intent i = new Intent(Tabs_past_future_ride.this, UserHomeScreen.class);
i.putExtra("my_lat", My_lat);
i.putExtra("my_long", My_long);
startActivity(i);
finish();
overridePendingTransition(R.anim.slide_up1, R.anim.rbounce);
}else if(pref.getResposibility()==2) {
Intent i = new Intent(Tabs_past_future_ride.this, SalonHomePage.class);
i.putExtra("my_lat", My_lat);
i.putExtra("my_long", My_long);
startActivity(i);
finish();
overridePendingTransition(R.anim.slide_up1, R.anim.rbounce);
}
}
return true;
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.menu_black, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
return super.onOptionsItemSelected(item);
}
}
| [
"[email protected]"
] | |
4650102acb7300228e4e4af7dbc47fa4d99ad7d0 | 4b6c1a2ae07e374d34a526fa11d765622ab8769d | /app/src/main/java/br/com/bandtec/saude/Models/Temperatura.java | a51435265d4518e3b8c81be0f9b0a3f6c33f0989 | [] | no_license | enzotiezzi/Saude | 9aa8a9cfab64315d8b2300a0eb6d916aec440eb7 | 02696208af02bfb451203451d29954fa692e7ce6 | refs/heads/master | 2021-01-15T15:31:03.186685 | 2016-08-09T18:40:46 | 2016-08-09T18:40:46 | 43,250,452 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 281 | java | package br.com.bandtec.saude.Models;
/**
* Created by enzo on 26/09/2015.
*/
public class Temperatura extends Entidade
{
private float Grau;
public float getGrau()
{
return Grau;
}
public void setGrau(float grau)
{
Grau = grau;
}
}
| [
"[email protected]"
] | |
7935bf064478a074a1b5da9c1fad2c7db5812e30 | 6ed7822b278ff2c5d3b566409a985fcc3ddf6ba7 | /src/Matango.java | a78569f6817bd43c0f2fa8f281156dac316728ff | [] | no_license | monqcq/JavaIntroduction | a1848642f23b3fe0ee9f0d1ad2c8eef3c586c33e | a007603cdadb5f7fc9e834966658383ef46c528d | refs/heads/master | 2023-07-20T21:05:33.541208 | 2021-09-08T12:26:30 | 2021-09-08T12:26:30 | 382,824,573 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 180 | java |
public class Matango {
int hp;
final int LEVEL = 10;
char suffix;
public void run() {
System.out.println("お化けキノコ" + this.suffix + "は逃げ出した!");
}
}
| [
"[email protected]"
] | |
36bdf8133c2c2661fdccb672667ada2e8f307ac3 | 16a4c6df8a5e7af4bb6218ee5fc23e6a692196dd | /Test/src/test/java/Pages/DefaultPages.java | 08c7df19f9d9a27e16c98e1e6e8180ed14136386 | [] | no_license | KateSurta/AutomationTesting | 4163dd6b645810ffa2d2963ed8a33801a3159178 | 8d29e32714abac5bda2fdffe84b3b6cef4d54722 | refs/heads/master | 2021-08-24T07:21:20.393602 | 2017-12-08T16:03:57 | 2017-12-08T16:03:57 | 113,552,063 | 0 | 0 | null | 2017-12-08T16:03:58 | 2017-12-08T08:41:13 | HTML | UTF-8 | Java | false | false | 2,806 | java | package Pages;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxOptions;
import org.openqa.selenium.support.FindBy;
import java.util.logging.Level;
import static org.openqa.selenium.firefox.FirefoxOptions.FIREFOX_OPTIONS;
public class DefaultPages extends FactoryPages {
@FindBy (css= "input[test-id ='login-input']")
private WebElement loginField;
@FindBy (css= "input[test-id ='pass-input']")
private WebElement passwordField;
@FindBy (css= "button.btn.btn-lg.btn-default.center-block")
public WebElement singInButton;
@FindBy(css = "div[test-id ='login-validation']")
private WebElement errorLoginMessage;
@FindBy(css = "div[test-id ='pass-validation']")
private WebElement errorPasswordMessage;
@FindBy(css = "div[test-id ='custom-auth-message']")
public WebElement errorCustomMessage;
public DefaultPages(WebDriver driver) {
super(driver);
}
public void Refresh() {
driver.navigate().refresh();
}
/*----------------------------------------------------------------------------*/
// methods for login field
public boolean isLoginFieldDisplayed(){
return loginField.isDisplayed();
}
public String getLoginMessage() {
String messageLoginTitle = errorLoginMessage.getText();
return messageLoginTitle;
}
public void inputLogin(String login){
loginField.sendKeys(login);
}
public void clickLoginField(){
loginField.click();
}
/*----------------------------------------------------------------------------*/
// methods for password field
public boolean isPasswordFieldDisplayed(){
return passwordField.isDisplayed();
}
public void inputPassword(String pass){
passwordField.sendKeys(pass);
}
public String getPasswordMessage() {
String messagePasswordTitle = errorPasswordMessage.getText();
return messagePasswordTitle;
}
public void clearPasswordField(){
loginField.sendKeys(Keys.BACK_SPACE);
}
public void clickPasswordField(){
passwordField.click();
}
/*----------------------------------------------------------------------------*/
// methods for Sing In button
public boolean isButtonSingInDisplayed(){
return singInButton.isDisplayed();
}
public void clickButtonSingIn() {
singInButton.click();
}
public boolean isAuthCustomMessageDisplayed(){
return errorCustomMessage.isDisplayed();
}
public String getAuthCustomMessage() {
String messageCustomAuthTitle = errorCustomMessage.getText();
return messageCustomAuthTitle;
}
}
| [
"[email protected]"
] | |
b01971d199e70c003b11d608bca3908698b749a5 | da0efa8ffd08b86713aad007f10794c4b04d8267 | /com/telkom/mwallet/coupon/C1462e.java | 7e4b55b8725bafa975e26bb02969bf5895a05cb6 | [] | no_license | ibeae/tcash | e200c209c63fdfe63928b94846824d7091533f8a | 4bd25deb63ea7605202514f6a405961a14ef2553 | refs/heads/master | 2020-05-05T13:09:34.582260 | 2017-09-07T06:19:19 | 2017-09-07T06:19:19 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,601 | java | package com.telkom.mwallet.coupon;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;
import com.telkom.mwallet.R;
import com.telkom.mwallet.dialog.p063a.C1326f;
import com.telkom.mwallet.tcash.fragment.C1386e;
public class C1462e extends C1386e {
private static final String f3435a = C1462e.class.getSimpleName();
private Button f3436b;
private String f3437c = null;
private CouponRedeemNFCActivity f3438j;
private OnClickListener f3439k = new C14601(this);
private C1326f f3440l = new C14612(this);
class C14601 implements OnClickListener {
final /* synthetic */ C1462e f3433a;
C14601(C1462e c1462e) {
this.f3433a = c1462e;
}
public void onClick(View view) {
switch (view.getId()) {
case R.id.coupon_redeem_topin_button:
this.f3433a.f3438j.startActivityForResult(new Intent(this.f3433a.f3438j, CouponRedeemPINActivity.class), 3);
return;
default:
return;
}
}
}
class C14612 implements C1326f {
final /* synthetic */ C1462e f3434a;
C14612(C1462e c1462e) {
this.f3434a = c1462e;
}
public void mo1485a() {
if (this.f3434a.f != null) {
this.f3434a.f.dismiss();
}
}
public void mo1486b() {
}
}
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
View inflate = layoutInflater.inflate(R.layout.activity_coupon_redeem_nfc, null);
m5208c(R.string.title_couponlist);
this.f3438j = (CouponRedeemNFCActivity) getActivity();
String stringExtra = this.f3438j.getIntent().getStringExtra("PIN_REDEEM");
this.f3436b = (Button) inflate.findViewById(R.id.coupon_redeem_topin_button);
View view = (TextView) inflate.findViewById(R.id.coupon_redeem_topin_text);
if ("N".equalsIgnoreCase(stringExtra)) {
this.f3436b.setVisibility(8);
view.setVisibility(8);
} else {
this.f3436b.setOnClickListener(this.f3439k);
}
this.h.m4932a(this.f3438j, (TextView) inflate.findViewById(R.id.coupon_code_text), 2);
this.h.m4932a(this.f3438j, this.f3436b, 2);
this.h.m4932a(this.f3438j, view, 2);
return inflate;
}
}
| [
"[email protected]"
] | |
54f7aee845daf0719e7473442989d86a31a7ba85 | 4763e7c6e12c03dc9ddd538dc9d2fc17c80af762 | /src/main/java/com/ggkttd/kolmakov/testSystem/controllers/ResourceController.java | d2c8b2aa5e82684f2834b8100eff85479e341c5f | [] | no_license | NKolmakov/TestSystem | 858b59bd78ea794ea7a6c86eb70e608ab59f5774 | c5c5b7298e96eb47031c2516d2bdd7fc86733e81 | refs/heads/master | 2020-06-25T00:47:04.762722 | 2019-10-02T18:11:03 | 2019-10-02T18:11:03 | 199,144,401 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,962 | java | package com.ggkttd.kolmakov.testSystem.controllers;
import com.ggkttd.kolmakov.testSystem.domain.Resource;
import com.ggkttd.kolmakov.testSystem.services.ResourceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@Controller
@RequestMapping(value = "/resources")
public class ResourceController {
@Autowired
private ResourceService resourceService;
@Value("${chunk.length:1048576}")
private int chunkLength;
@GetMapping(value = "{id}")
@ResponseBody
public byte[] getResourceStream(@PathVariable("id") Long id, HttpServletRequest request, HttpServletResponse response) {
String strRange = request.getHeader("Range");
Resource resource = resourceService.getOne(id);
byte[] chunk = null;
int startPosition = 0;
int status = 200;
if (strRange != null) {
strRange = strRange.replaceAll(".*bytes.*=\\s*", "");
//range looks like Range: 0-1024
if (strRange.matches("\\d+-\\d+")) {
String[] ranges = strRange.split("-");
startPosition = Integer.parseInt(ranges[0]);
int endPosition = Integer.parseInt(ranges[1]);
chunk = resourceService.getVideoStream(resource, endPosition, startPosition);
//range looks like Range: 0-
} else if (strRange.matches("\\d+-")) {
startPosition = Integer.parseInt(strRange.replaceAll("-", ""));
chunk = resourceService.getVideoStream(resource, startPosition);
//range looks like Range: -152
} else if (strRange.matches("-\\d+")) {
startPosition = Integer.parseInt(strRange.replaceAll("-", ""));
chunk = resourceService.getVideoStream(resource, -startPosition);
}
status = 206;
} else {
//give all file
chunk = resourceService.getVideoStream(resource);
}
response.setStatus(status);
response.setHeader("Content-Type", resource.getType());
response.setContentLength(chunk.length);
response.setHeader("Accept-Range", "bytes");
response.setHeader("Content-Range", "bytes " + startPosition + "-" + (startPosition + chunk.length - 1) + "/" + resource.getFileLength());
response.setHeader("Content-Transfer-Encoding", "binary");
response.setHeader("Cache-Control", "");
response.setHeader("Connection", "close");
return chunk;
}
}
| [
"[email protected]"
] | |
0c4fe9abfa4d588ac771d11fc0adf14222b03368 | cf18c1d3e78706b95120a37f5c30a802e39efde7 | /syh_mall/src/main/java/com/visionet/syh_mall/repository/cart/ShopCartRepository.java | c6e4628e99cb725c9e80e937eee06bc43f996fc5 | [] | no_license | JavaLeeLi/shscce_syh | c31447ebc4aa5b1a555a7e99567ffe8459664e87 | 2ccc815aabfe23051a305964170310a1e8a9f4c1 | refs/heads/master | 2021-04-15T09:47:24.389650 | 2018-03-27T03:07:08 | 2018-03-27T03:07:08 | 126,915,503 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 925 | java | package com.visionet.syh_mall.repository.cart;
import java.util.List;
import org.springframework.data.jpa.repository.Query;
import com.visionet.syh_mall.entity.cart.ShopCart;
import com.visionet.syh_mall.repository.BaseRepository;
/**
* 购物车Dao层
* @author mulongfei
* @date 2017年8月31日上午10:16:50
*/
public interface ShopCartRepository extends BaseRepository<ShopCart, String> {
@Query(value="FROM ShopCart s WHERE s.userId=?1 AND s.goodsId=?2 AND s.isDeleted=0")
List<ShopCart> findOne(String UserId,String GoodId);
@Query(value="FROM ShopCart s WHERE s.userId=?1 AND s.isDeleted=0")
List<ShopCart> findAll(String UserId);
@Query(value="FROM ShopCart s WHERE s.userId=?1 AND s.goodsId=?2 AND s.isDeleted=0")
ShopCart findByUserIdAndGoodId(String userId,String goodId);
@Query(value="SELECT COUNT(1) FROM ShopCart s WHERE s.userId=?1 AND s.isDeleted=0")
int findByUserId(String userId);
}
| [
"[email protected]"
] | |
50f1be69dd8f09e6d9ff8c032183dd492f3dad53 | 3baad985f6c1a5322e325ea679bda0a45711c6ff | /list2xml/dao/EmployeeImplementation.java | 8f7a4d10c375bc96a9ad66214ea3997d25722dcc | [] | no_license | MichkaDaCoder/list2xml | c2e452eaca0e16bc27f180d1cd8578db2268a6c6 | 96b1b3d5af1f44396b98907f6ab57a92d51b5421 | refs/heads/master | 2021-06-30T19:23:29.096140 | 2019-02-11T22:25:34 | 2019-02-11T22:25:34 | 170,211,873 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 916 | java | package list2xml.dao;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import list2xml.model.Employee;
/**
* EmployeeImplementation.java: implements <b>IEmployeeDAO</b> to initialize a List of employee
*
* @author MichkaDaCoder
*/
public class EmployeeImplementation implements Serializable, IEmployeeDAO{
/**
* This method initialize an Employee List
* @return List of Employees
*/
@Override
public List<Employee> InitEmployees() {
List<Employee> l=new ArrayList<>();
l.add(new Employee("EMP-022019", "Jane", "ADAMS", "[email protected]"));
l.add(new Employee("EMP-072016", "John", "ADAMS", "[email protected]"));
l.add(new Employee("EMP-112011", "Alex", "DANIELS", "[email protected]"));
l.add(new Employee("EMP-122009", "Alexandra", "GOMEZ", "[email protected]"));
return l;
}
}
| [
"[email protected]"
] | |
ccbe42968f6348bdbc909012312ea815516d3d62 | 2dcb93edebdf2d5c45539f4ed794b1116f30f8f9 | /app/src/main/java/com/bw/movie/bean/syBean/HotBean.java | d276f1142a82acfbb928334392eebba5a9f5de74 | [] | no_license | JK823/movie | 2a2634836676e0172799e43cb02907280b21db27 | c8bd9425d5434b9b87a36f8d3b63c7dc3c997156 | refs/heads/master | 2022-07-14T16:27:16.151622 | 2020-05-19T04:15:16 | 2020-05-19T04:15:16 | 265,142,144 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,048 | java | package com.bw.movie.bean.syBean;
import java.util.List;
public class HotBean {
/**
* result : [{"director":"\r\n刘伟强","horizontalImage":"http://mobile.bwstudent.com/images/movie/stills/zgjz/zgjz1_h.jpg","imageUrl":"http://mobile.bwstudent.com/images/movie/stills/zgjz/zgjz1.jpg","movieId":24,"name":"中国机长","score":9.4,"starring":"张涵予,欧豪,袁泉,张天爱,李沁"},{"director":"曾国祥","horizontalImage":"http://mobile.bwstudent.com/images/movie/stills/sndn/sndn1_h.jpg","imageUrl":"http://mobile.bwstudent.com/images/movie/stills/sndn/sndn1.jpg","movieId":22,"name":"少年的你","score":9.5,"starring":"周冬雨,易烊千玺,张耀,周也,尹昉"},{"director":"陈凯歌","horizontalImage":"http://mobile.bwstudent.com/images/movie/stills/whwdzg/whwdzg1_h.jpg","imageUrl":"http://mobile.bwstudent.com/images/movie/stills/whwdzg/whwdzg1.jpg","movieId":23,"name":"我和我的祖国","score":9.7,"starring":"黄渤,张译,杜江,葛优,刘昊然,吴京"},{"director":"吕乐","horizontalImage":"http://mobile.bwstudent.com/images/movie/stills/zdn/zdn1_h.jpg","imageUrl":"http://mobile.bwstudent.com/images/movie/stills/zdn/zdn1.jpg","movieId":21,"name":"找到你","score":8.5,"starring":"姚晨,马伊琍,袁文康,吴昊宸"},{"director":"庄文强","horizontalImage":"http://mobile.bwstudent.com/images/movie/stills/ws/ws1_h.jpg","imageUrl":"http://mobile.bwstudent.com/images/movie/stills/ws/ws1.jpg","movieId":20,"name":"无双","score":8.6,"starring":"周润发,郭富城,张静初,冯文娟,廖启智"}]
* message : 查询成功
* status : 0000
*/
private String message;
private String status;
private List<ResultBean> result;
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public List<ResultBean> getResult() {
return result;
}
public void setResult(List<ResultBean> result) {
this.result = result;
}
public static class ResultBean {
/**
* director :
刘伟强
* horizontalImage : http://mobile.bwstudent.com/images/movie/stills/zgjz/zgjz1_h.jpg
* imageUrl : http://mobile.bwstudent.com/images/movie/stills/zgjz/zgjz1.jpg
* movieId : 24
* name : 中国机长
* score : 9.4
* starring : 张涵予,欧豪,袁泉,张天爱,李沁
*/
private String director;
private String horizontalImage;
private String imageUrl;
private int movieId;
private String name;
private double score;
private String starring;
public String getDirector() {
return director;
}
public void setDirector(String director) {
this.director = director;
}
public String getHorizontalImage() {
return horizontalImage;
}
public void setHorizontalImage(String horizontalImage) {
this.horizontalImage = horizontalImage;
}
public String getImageUrl() {
return imageUrl;
}
public void setImageUrl(String imageUrl) {
this.imageUrl = imageUrl;
}
public int getMovieId() {
return movieId;
}
public void setMovieId(int movieId) {
this.movieId = movieId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public double getScore() {
return score;
}
public void setScore(double score) {
this.score = score;
}
public String getStarring() {
return starring;
}
public void setStarring(String starring) {
this.starring = starring;
}
}
}
| [
"[email protected]"
] | |
6dd2530da5a2d3e3b44708590bfca74d52e612d6 | d9b19cf58d8c4c7ab1dc934fa4d73d17411a04cd | /src/main/java/org/omg/IOP/TAG_POLICIES.java | 0efc783cb9ffe483dec73f891b387b00e7e727a5 | [] | no_license | wttch96/jdk | 2548da98a4dca59ccc205ca1c0e51084bd9de31c | 9be728e4d278bff3b4c8f45b4a0f2529ea807e16 | refs/heads/master | 2023-03-27T04:24:52.098700 | 2019-05-31T08:59:14 | 2019-05-31T08:59:14 | 286,370,165 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 517 | java | package org.omg.IOP;
/**
* org/omg/IOP/TAG_POLICIES.java .
* Generated by the IDL-to-Java compiler (portable), version "3.2"
* from /build/openjdk-8-gyaYyR/openjdk-8-8u212-b03/src/corba/src/share/classes/org/omg/PortableInterceptor/IOP.idl
* Friday, April 26, 2019 2:05:49 AM UTC
*/
public interface TAG_POLICIES
{
/**
* A profile component containing the sequence of QoS policies exported
* with the object reference by an object adapter.
*/
public static final int value = (int)(2L);
}
| [
"[email protected]"
] | |
2f628d7bdfda63bd731acf47c00816712db70d6e | 5949bbdf00032a259444067fc68aa2256cd4e131 | /src/main/java/com/caglarb/issuemanagement/entity/User.java | fb54cbae2c98f99efe4d9a652d321cb379d6a3be | [] | no_license | caglarbilgin/issue-management-java-spring-boot-and-angular | e9b92fa0031532c12e4735106b6dc4b6f913f5e0 | 5c1922e4c9950cc455dec5b4f6c94888cd228fba | refs/heads/master | 2020-04-29T03:40:30.150702 | 2019-04-08T12:11:06 | 2019-04-08T12:11:06 | 175,819,253 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,039 | java | package com.caglarb.issuemanagement.entity;
import lombok.*;
import javax.persistence.*;
import javax.print.attribute.standard.MediaSize;
import java.util.List;
@Entity //jpa'den gelen bir database tablosu olduğunu belirtiyoruz.
@Table(name = "users") // burada tablo özelliklerini veriyoruz tabloya bir isim veriyoruz.
// (kullanmak zorunlu değil kullanmadığımız zaman tablonun ismi class ismiyle aynı olur)
@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString
@EqualsAndHashCode
public class User extends BaseEntity {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
@Column(name = "uname",length = 100, unique = true)
private String username;
@Column(name = "pwd",length = 200)
private String password;
@Column(name = "name_surname", length = 100)
private String nameSurname;
@Column(name = "email", length = 100)
private String email;
@JoinColumn(name = "assignee_user_id")
@OneToMany(fetch = FetchType.LAZY)
private List<Issue> issues;
}
| [
"[email protected]"
] | |
443c01c13d3774f1559aecbd6a857e3b06e3e441 | f0a134641ee5ac0a6a5a52d78aabd6eb9a818760 | /chapter05/S_03.java | 378032a2d143c98dd1c5a6ec35346381b875556b | [] | no_license | kubrafelek/Introduction_Java_Programming | 05c4ebb195be4b676ff3f4e47beefe2f56dde557 | 55101637f98f6c138f8605c3f4cf4c8f037be6bc | refs/heads/master | 2020-06-27T21:16:28.284704 | 2020-01-23T09:20:34 | 2020-01-23T09:20:34 | 200,051,910 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 321 | java | package bolum05;
public class S_03 {
public static void main(String[] args) {
final double POUNDS_PER_kg = 2.2;
System.out.print("Kilograms\tPounds\n");
for (int kg = 1; kg < 200; kg += 2) {
double pounds = POUNDS_PER_kg * kg;
System.out.printf("%3d\t\t%5.1f\n", kg, pounds);
}
}
}
| [
"[email protected]"
] | |
eb1d71c9d5fae5be1cfa01e6b9d213b95f3d87b6 | 2e05a9bc728f488a210056653988492f02457f66 | /src/main/java/com/tabrizguliyev/app/ws/MobileAppWsApplication.java | 51970db35584a83a81dea5b5faba0759357cbea6 | [] | no_license | TabrizGuliyev/mobile-app-ws | 6d67043aafad5e448761a2bd8e7655609d2e40a1 | ee32be11260b47d58524184f3a1a877268e97485 | refs/heads/master | 2020-12-28T09:36:25.134492 | 2020-02-04T18:28:23 | 2020-02-04T18:28:28 | 238,270,945 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 339 | java | package com.tabrizguliyev.app.ws;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class MobileAppWsApplication {
public static void main(String[] args) {
SpringApplication.run(MobileAppWsApplication.class, args);
}
}
| [
"[email protected]"
] | |
ba2ba0e59e3c575d9a0ed01552898aeac8236c24 | ec98872943c0a6a791668d6dc432ae7937905673 | /designer/src/com/android/tools/idea/uibuilder/handlers/constraint/targets/BaseLineActionTarget.java | fb142adb8a7dc9ef5df41e54e5e6469ec35a7148 | [] | no_license | zjw-swun/android | cabd8c172346467494af4fba4c17062161570ded | 3761afcc07ebbd4f86c1e7469c2c828f8b0eab5f | refs/heads/master | 2020-05-15T22:09:43.221694 | 2019-04-18T21:58:51 | 2019-04-18T22:01:08 | 182,518,753 | 1 | 0 | null | 2019-04-21T10:19:22 | 2019-04-21T10:19:21 | null | UTF-8 | Java | false | false | 2,517 | java | /*
* Copyright (C) 2018 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.tools.idea.uibuilder.handlers.constraint.targets;
import static com.android.tools.idea.uibuilder.handlers.constraint.ConstraintLayoutHandler.EDIT_BASELINE_ACTION_TOOLTIP;
import com.android.tools.idea.common.model.AndroidDpCoordinate;
import com.android.tools.idea.common.scene.SceneComponent;
import com.android.tools.idea.common.scene.target.ActionTarget;
import com.android.tools.idea.common.scene.target.AnchorTarget;
import com.android.tools.idea.common.scene.target.Target;
import com.android.tools.idea.uibuilder.graphics.NlIcon;
import com.google.common.collect.ImmutableList;
import icons.StudioIcons;
public class BaseLineActionTarget extends ActionTarget {
private static final NlIcon BASELINE_ICON =
new NlIcon(StudioIcons.LayoutEditor.Toolbar.BASELINE_ALIGNED, StudioIcons.LayoutEditor.Toolbar.BASELINE_ALIGNED_CONSTRAINT);
public BaseLineActionTarget() {
super(BASELINE_ICON, (SceneComponent c) -> c.setShowBaseline(!c.canShowBaseline()));
}
@Override
public void mouseDown(@AndroidDpCoordinate int x, @AndroidDpCoordinate int y) {
SceneComponent c = this.getComponent();
boolean baseline = !myComponent.canShowBaseline();
myComponent.setShowBaseline(baseline);
if (baseline) {
ImmutableList<Target> targets = myComponent.getTargets();
for (Target t : targets) {
if (t instanceof AnchorTarget) {
AnchorTarget at = (AnchorTarget)t;
if (at.getType() == AnchorTarget.Type.BASELINE) {
myComponent.getScene().setHitTarget(at);
at.mouseDown((int)at.getCenterX(), (int)at.getCenterY());
at.mouseDrag(x, y, myComponent.getTargets());
}
}
}
}
myComponent.getScene().needsRebuildList();
myComponent.getScene().repaint();
}
@Override
public String getToolTipText() {
return EDIT_BASELINE_ACTION_TOOLTIP;
}
}
| [
"[email protected]"
] | |
1277e25bd1b6e37eec158601f6519de4b6aa48c0 | bfeb6ec0d47bf64bd95a2922b07d7ca192b9ad1f | /app/src/main/java/vn/com/canhtoan/Database/Entity/User_CauDocEntity.java | 1ebefa4144e26417a6fa9678ed5e8b29c5f09385 | [] | no_license | hntxuanit15spkt/PhanXa | a88bbc68cfe4d56c8ecafbe814b1639f1ddd65f5 | 77f07aac947fda72874dc64f34acf89046735b7d | refs/heads/master | 2020-03-12T11:07:09.078124 | 2018-05-27T05:02:33 | 2018-05-27T05:02:33 | 130,589,131 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 698 | java | package vn.com.canhtoan.Database.Entity;
import android.arch.persistence.room.Entity;
import android.arch.persistence.room.ForeignKey;
import android.arch.persistence.room.PrimaryKey;
import android.support.annotation.NonNull;
@Entity(foreignKeys = {@ForeignKey(entity = UserEntity.class, parentColumns = "id", childColumns = "id_user"),
@ForeignKey(entity = CauDocEntity.class, parentColumns = "id", childColumns = "id_caudoc")})
public class User_CauDocEntity {
@PrimaryKey
@NonNull
public int id;
@NonNull
public int id_user;
@NonNull
public int id_caudoc;
public double read_time_user;
public int sound_user;
public Boolean is_restudy;
}
| [
"[email protected]"
] | |
d3e0337dcdbf549150149b272b90161aa31bc498 | 8f8541fc7b4ad1aef261ba12483545a9fcf27ed8 | /src/main/java/com/backend/shop/config/SwaggerConfig.java | b15b52038e6c3ae0733d105a7abec6fcfb56be1b | [] | no_license | Azphire/parking | a68db453677cb8b784fa1629214d7372405689a7 | 4549a60c4d2bc89bdd92e595647bc38078602edc | refs/heads/main | 2023-02-16T12:59:12.149054 | 2021-01-10T10:53:13 | 2021-01-10T10:53:13 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,233 | java | package com.backend.shop.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
import springfox.bean.validators.configuration.BeanValidatorPluginsConfiguration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
import static springfox.documentation.builders.PathSelectors.regex;
@Configuration
@EnableSwagger2
@Import(BeanValidatorPluginsConfiguration.class)
public class SwaggerConfig extends WebMvcConfigurationSupport {
private ApiInfo metaData() {
return new ApiInfoBuilder()
.title("Spring Boot REST API")
.version("1.0.0")
.build();
}
@Bean
public Docket productApi() {
return new Docket(DocumentationType.SWAGGER_2)
.select()
.apis(RequestHandlerSelectors.basePackage("com.backend.shop.controller"))
.paths(regex("/.*"))
.build()
.apiInfo(metaData());
}
@Override
protected void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("swagger-ui.html")
.addResourceLocations("classpath:/META-INF/resources/");
registry.addResourceHandler("/webjars/**")
.addResourceLocations("classpath:/META-INF/resources/webjars/");
}
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**").allowedOrigins("*").allowedMethods("GET", "POST", "PUT", "DELETE").allowedOrigins("*")
.allowedHeaders("*");
}
} | [
"[email protected]"
] | |
b703df0a9bc492a8ebb6841e258d59d9489b5025 | a3fe8d989e8d0fb37e4661f7613da42d8ea90381 | /src/main/java/com/schoolofnet/RestAPI/services/ProductService.java | 2da982fd0f019ff2c3635a9d5e00308d292a7799 | [] | no_license | snifferchess/spring-boot-intermediario-rev-2 | b04429bc8cef1d3e1773c77d0318d3935cf20240 | 5fe67b0f3dda92df4aa158c57a63797e00daf7bf | refs/heads/master | 2021-10-09T01:30:53.766741 | 2018-12-19T22:13:56 | 2018-12-19T22:13:56 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 349 | java | package com.schoolofnet.RestAPI.services;
import java.util.List;
import com.schoolofnet.RestAPI.models.Product;
public interface ProductService {
public List<Product> findAll();
public Product find(Long id);
public Product create(Product product);
public Product update(Long id, Product product);
public void delete(Long id);
}
| [
"[email protected]"
] | |
66c6cfc001c718a503ba6551453f99a56b9d8484 | b0e572ebc3cb93145b57ca7f272ee8bb32effedc | /android/app/src/main/java/com/rnapp/MainActivity.java | baf23a8113663202e1c65b737c9f48963974f6ca | [] | no_license | RookieDouby/RNapp | 0a1d832c447dcf4e4893f262aacf7b101456473a | 5571d59a6581029994d7be82bc079e98d3e42839 | refs/heads/master | 2020-03-19T09:32:02.922739 | 2018-06-06T08:32:02 | 2018-06-06T08:32:02 | 136,297,071 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 406 | java | package com.rnapp;
import com.facebook.react.ReactActivity;
import com.oblador.vectoricons.VectorIconsPackage;
public class MainActivity extends ReactActivity {
/**
* Returns the name of the main component registered from JavaScript.
* This is used to schedule rendering of the component.
*/
@Override
protected String getMainComponentName() {
return "RNapp";
}
}
| [
"[email protected]"
] | |
39ea80e29b071fd6cd5acf36b1de2e68660569c9 | a05d991577c44d2878fca9ae300c84076c26f76b | /semi_eclips14/src/model/Dao/DiaryDao.java | 5e36110129545c85bc92fd424ff60e24f7d499ab | [] | no_license | kimo9561/ATOPIDIA | ec704645289fd5d342971f40dca561b74aeaba4d | cded3e74b414e1c25e00fc9e85727e88c38a752f | refs/heads/master | 2023-02-13T14:39:37.003174 | 2021-01-17T05:43:27 | 2021-01-17T05:43:27 | 330,321,318 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,184 | java | package model.Dao;
import java.sql.Connection;
import java.util.List;
import model.Dto.DiaryDto;
public interface DiaryDao {
String InsertDiarySql = " INSERT INTO DIARY VALUES(DIARY_SEQ.NEXTVAL,?, ?, ?, ?, ?, ?,SYSDATE, ?, ?, ?) ";
String DeleteDiarySql = "DELETE FROM DIARY WHERE DIARY_NO=?";
String SelectAllSql = "SELECT * FROM DIARY WHERE MEMBER_NO=?";
String SelectOneSql = "SELECT * FROM DIARY WHERE DIARY_NO=?";
String UpdateSql = " UPDATE DIARY SET DIARY_TITLE=?, DIARY_CONTENT_MORNING=?, DIARY_CONTENT_LUNCH=?, DIARY_CONTENT_DINNER=?, DIARY_CONTENT_RECIPE=?, DIARY_IMAGE_FILENAME=?, DIARY_IMAGE_FILEREALNAME=?, DIARY_IMAGE_UPLOADPATH=? WHERE DIARY_NO=? ";
String diaryno = "SELECT * FROM USER_SEQUENCES WHERE SEQUENCE_NAME= UPPER('DIARY_SEQ')";
public List<DiaryDto> selectAllDiary(Connection con, int member_No);
public DiaryDto selectOneDiary(Connection con, int diary_No);
public int deleteAllDiary(Connection con, String[] chksdiary);
public int deleteOneDiary(Connection con, int diary_No);
public int insertDiary(Connection con, DiaryDto dto);
public int updateDiary(Connection con, DiaryDto dto);
public int selectdiaryno(Connection con);
}
| [
"[email protected]"
] | |
c67c02815ce54fccaf0deb3bd54cbb99d5c0f93b | 338b25b3acd02a28679bb5e4d924860a6b179f9d | /src/benho/fragmentproblem/FragmentRightC.java | 3f91428d3f0af561c9dbe7ab66c302f2d3b706d1 | [] | no_license | Ben-Ho/fragmentProblem | b25ab2ae177ec1ccca0893a0e923ff69065cd869 | f08192098be7187d5f4bf08e8119ce58e60fbecc | refs/heads/master | 2020-05-20T11:14:02.896433 | 2014-07-07T07:49:58 | 2014-07-07T07:49:58 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 503 | java | package benho.fragmentproblem;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
public class FragmentRightC extends Fragment {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
TextView textView = new TextView(getActivity());
textView.setText("This is Fragment C");
return textView;
}
}
| [
"[email protected]"
] | |
5643520bafc68cdeb6c684bb4845f8cb1d9913d6 | 465769250c8aebae663a78d3ce88c097ec7ca57d | /src/main/java/com/ajax/brain/utils/sorts/BubbleSort.java | 9943cf94254764862827c5764fdec3ff56063e6d | [] | no_license | Xerogeiger/Brain | a018323e70d682227025a9085a0ca45834ad7734 | 8e325ce9132d080cd6265f176e375e97003363d1 | refs/heads/master | 2022-12-16T01:03:28.536547 | 2020-09-16T21:02:44 | 2020-09-16T21:02:44 | 294,256,510 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,011 | java | package com.ajax.brain.utils.sorts;
/**
* Implementation of a BubbleSort algorithm
*
* Code <del>stolen</del> borrowed from <a href="https://www.geeksforgeeks.org/">https://www.geeksforgeeks.org/</a>
* The page it was borrowed form is <a href="https://www.geeksforgeeks.org/bubble-sort/">https://www.geeksforgeeks.org/bubble-sort/</a>
*
*/
public final class BubbleSort<T> extends Sort<T>{
/**
* Creates a new {@code BubbleSort} with the {@code Representor}
*
* @param representor the {@code Representor} for converting objects to integers
* @throws NullPointerException if the representor is null
*/
private BubbleSort(Representor<T> representor) {
super(representor);
}
/**
* Sorts the provided array with a BubbleSort
*
* @param arr the array to sort
*/
@Override
public void sort(T[] arr) {
int n = arr.length;
for (int i = 0; i < n-1; i++) {
for (int j = 0; j < n - i - 1; j++) {
if (representor.convert(arr[j]) > representor.convert(arr[j + 1])) {
T temp = arr[j];
arr[j] = arr[j + 1];
arr[j + 1] = temp;
}
}
}
}
/**
* Sorts the provided array by constructing a new {@code BubbleSort} object then using it
*
* @param arr the array to sort
* @param representor the {@code Representor} the the provided object type
* @param <T> the object type of the array
*/
public static <T> void sort(T[] arr, Representor<T> representor) {
new BubbleSort<T>(representor).sort(arr);
}
/**
* Returns a new {@code BubbleSort} object to be used multiple times
*
* @param representor the {@code Representor} for the provided object type
* @param <T> the object type of the array
*/
public static <T> BubbleSort<T> getInstance(Representor<T> representor) {
return new BubbleSort<>(representor);
}
}
| [
"[email protected]"
] | |
1192a1d82884fe94f4891a484e6a8e363a2547eb | 979bfc766cf2b73db2fc714667b8652a2d6dcacf | /Projects/Timbergrove/Petro-link/timbergrove_petrolink-tree_cep_engine_hg-700cbb5333f4/PetrolinkStructures/src/main/java/Energistics/Datatypes/ErrorCodes.java | 7b22f66c091b95648004cd9ef9f6a07543c3d046 | [
"MIT"
] | permissive | messaoudi-mounir/AvanticaPC | 936536c00fd287638fb43bdce9a67c039aa8e68c | 1c1ab806d63ecca0ce898676a273d4f951608239 | refs/heads/master | 2020-06-17T07:45:46.092223 | 2017-07-27T19:46:22 | 2017-07-27T19:46:22 | 195,850,038 | 1 | 0 | null | 2019-07-08T16:32:45 | 2019-07-08T16:32:44 | null | UTF-8 | Java | false | false | 697 | java | /**
* Autogenerated by Avro
*
* DO NOT EDIT DIRECTLY
*/
package Energistics.Datatypes;
@SuppressWarnings("all")
@org.apache.avro.specific.AvroGenerated
public enum ErrorCodes {
ENOROLE, ENOSUPPORTEDPROTOCOLS, EINVALID_MESSAGETYPE, EUNSUPPORTED_PROTOCOL ;
public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"enum\",\"name\":\"ErrorCodes\",\"namespace\":\"Energistics.Datatypes\",\"symbols\":[\"ENOROLE\",\"ENOSUPPORTEDPROTOCOLS\",\"EINVALID_MESSAGETYPE\",\"EUNSUPPORTED_PROTOCOL\"],\"fullName\":\"Energistics.Datatypes.ErrorCodes\",\"depends\":[]}");
public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
}
| [
"[email protected]"
] | |
f4db956958c8838edb115e26fdbaa0d03634d779 | 3ac1ef18c3224da928f46dff33076d91291b0377 | /source/exoneon/concurrency/safe/locking/Counter.java | 5fa38379b605d2b003e967187cbb1069c0b21b8b | [] | no_license | aeonviper/exoneon | 09c6b8828de02b330019a6dc90720e4c8a41f0af | 13d0cd0ebdcdcd632e2e6ee93e80ab419d559791 | refs/heads/main | 2023-09-02T00:17:50.675917 | 2021-11-17T18:58:32 | 2021-11-17T18:58:32 | 374,353,249 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 122 | java | package exoneon.concurrency.safe.locking;
public interface Counter {
public int incrementGet();
public int get();
}
| [
"[email protected]"
] | |
ada9208709667e286188713e8b9e5bcf50a1acd5 | 447520f40e82a060368a0802a391697bc00be96f | /apks/malware/app98/source/com/a/a/a/e/c/a.java | eca45f44e6fda98029550a22d5d08131d72515ff | [
"Apache-2.0"
] | permissive | iantal/AndroidPermissions | 7f3343a9c29d82dbcd4ecd98b3a50ddf8d179465 | d623b732734243590b5f004d167e542e2e2ae249 | refs/heads/master | 2023-07-19T01:29:26.689186 | 2019-09-30T19:01:42 | 2019-09-30T19:01:42 | 107,239,248 | 0 | 0 | Apache-2.0 | 2023-07-16T07:41:38 | 2017-10-17T08:22:57 | null | UTF-8 | Java | false | false | 10,454 | java | package com.a.a.a.e.c;
import com.a.a.a.b.i;
import com.a.a.a.d.d;
import com.a.a.a.e.n.b;
import com.a.a.a.e.p;
public class a
extends p
{
private static int D = 1;
private static int E = 2;
private static int F = 3;
private static int G = 4;
private static int H = 1;
private static int I = 2;
private static int J = 3;
private static int K = 4;
protected static int L = 6;
protected static int M = 103;
protected static int N = 104;
protected static int O = 105;
protected static int P = 101;
protected static int Q = 100;
protected static int R = 99;
protected static int S = 98;
protected static int T = 102;
protected static int U = 4096;
protected static int V = 4097;
protected static int[] W = { E, H, D, K, D, I };
protected static int[] X = { E, H, D, I, D, K };
protected static int[] Y = { E, H, D, I, F, I };
protected static int[] Z = { E, J, F, H, D, H, E };
protected static int[][] ab;
public static boolean bb;
static
{
int[] arrayOfInt1 = { E, H, E, I, E, I };
int[] arrayOfInt2 = { E, I, E, H, E, I };
int[] arrayOfInt3 = { E, I, E, I, E, H };
int[] arrayOfInt4 = { D, I, D, I, E, J };
int[] arrayOfInt5 = { D, I, D, J, E, I };
int[] arrayOfInt6 = { D, J, D, I, E, I };
int[] arrayOfInt7 = { D, I, E, I, D, J };
int[] arrayOfInt8 = { D, I, E, J, D, I };
int[] arrayOfInt9 = { D, J, E, I, D, I };
int[] arrayOfInt10 = { E, I, D, I, D, J };
int[] arrayOfInt11 = { E, I, D, J, D, I };
int[] arrayOfInt12 = { E, J, D, I, D, I };
int[] arrayOfInt13 = { D, H, E, I, F, I };
int[] arrayOfInt14 = { D, I, E, H, F, I };
int i = D;
int j = I;
int k = E;
int m = I;
int n = F;
int i1 = H;
int[] arrayOfInt15 = { D, H, F, I, E, I };
int[] arrayOfInt16 = { D, I, F, H, E, I };
int[] arrayOfInt17 = { D, I, F, I, E, H };
int[] arrayOfInt18 = { E, I, F, I, D, H };
int[] arrayOfInt19 = { E, I, D, H, F, I };
int[] arrayOfInt20 = { E, I, D, I, F, H };
int[] arrayOfInt21 = { E, H, F, I, D, I };
int[] arrayOfInt22 = { E, I, F, H, D, I };
int[] arrayOfInt23 = { F, H, E, H, F, H };
int[] arrayOfInt24 = { F, H, D, I, E, I };
int[] arrayOfInt25 = { F, I, D, H, E, I };
int[] arrayOfInt26 = { F, I, D, I, E, H };
int[] arrayOfInt27 = { F, H, E, I, D, I };
int[] arrayOfInt28 = { F, I, E, H, D, I };
int[] arrayOfInt29 = { F, I, E, I, D, H };
int[] arrayOfInt30 = { E, H, E, H, E, J };
int i2 = E;
int i3 = H;
int i4 = E;
int i5 = J;
int i6 = E;
int i7 = H;
int[] arrayOfInt31 = { E, J, E, H, E, H };
int[] arrayOfInt32 = { D, H, D, J, E, J };
int[] arrayOfInt33 = { D, J, D, H, E, J };
int[] arrayOfInt34 = { D, J, D, J, E, H };
int[] arrayOfInt35 = { D, H, E, J, D, J };
int[] arrayOfInt36 = { D, J, E, H, D, J };
int[] arrayOfInt37 = { D, J, E, J, D, H };
int[] arrayOfInt38 = { E, H, D, J, D, J };
int[] arrayOfInt39 = { E, J, D, H, D, J };
int[] arrayOfInt40 = { E, J, D, J, D, H };
int[] arrayOfInt41 = { D, H, E, H, F, J };
int[] arrayOfInt42 = { D, H, E, J, F, H };
int[] arrayOfInt43 = { D, J, E, H, F, H };
int[] arrayOfInt44 = { D, H, F, H, E, J };
int[] arrayOfInt45 = { D, H, F, J, E, H };
int[] arrayOfInt46 = { D, J, F, H, E, H };
int[] arrayOfInt47 = { F, H, F, H, E, H };
int[] arrayOfInt48 = { E, H, D, J, F, H };
int[] arrayOfInt49 = { E, J, D, H, F, H };
int[] arrayOfInt50 = { E, H, F, H, D, J };
int[] arrayOfInt51 = { E, H, F, J, D, H };
int[] arrayOfInt52 = { E, H, F, H, F, H };
int[] arrayOfInt53 = { F, H, D, H, E, J };
int[] arrayOfInt54 = { F, H, D, J, E, H };
int[] arrayOfInt55 = { F, J, D, H, E, H };
int[] arrayOfInt56 = { F, H, E, H, D, J };
int[] arrayOfInt57 = { F, H, E, J, D, H };
int[] arrayOfInt58 = { F, J, E, H, D, H };
int[] arrayOfInt59 = { F, H, G, H, D, H };
int[] arrayOfInt60 = { E, I, D, K, D, H };
int[] arrayOfInt61 = { G, J, D, H, D, H };
int[] arrayOfInt62 = { D, H, D, I, E, K };
int[] arrayOfInt63 = { D, H, D, K, E, I };
int[] arrayOfInt64 = { D, I, D, H, E, K };
int[] arrayOfInt65 = { D, I, D, K, E, H };
int[] arrayOfInt66 = { D, K, D, H, E, I };
int[] arrayOfInt67 = { D, K, D, I, E, H };
int[] arrayOfInt68 = { D, H, E, I, D, K };
int[] arrayOfInt69 = { D, H, E, K, D, I };
int[] arrayOfInt70 = { D, I, E, H, D, K };
int i8 = D;
int i9 = I;
int i10 = E;
int i11 = K;
int i12 = D;
int i13 = H;
int[] arrayOfInt71 = { D, K, E, H, D, I };
int[] arrayOfInt72 = { D, K, E, I, D, H };
int[] arrayOfInt73 = { E, K, D, I, D, H };
int[] arrayOfInt74 = { E, I, D, H, D, K };
int[] arrayOfInt75 = { G, H, F, H, D, H };
int[] arrayOfInt76 = { E, K, D, H, D, I };
int[] arrayOfInt77 = { D, J, G, H, D, H };
int i14 = D;
int i15 = H;
int i16 = D;
int i17 = I;
int i18 = G;
int i19 = I;
int i20 = D;
int i21 = I;
int i22 = D;
int i23 = H;
int i24 = G;
int i25 = I;
int[] arrayOfInt78 = { D, I, D, I, G, H };
int[] arrayOfInt79 = { D, H, G, I, D, I };
int[] arrayOfInt80 = { D, I, G, H, D, I };
int[] arrayOfInt81 = { D, I, G, I, D, H };
int[] arrayOfInt82 = { G, H, D, I, D, I };
int[] arrayOfInt83 = { G, I, D, H, D, I };
int[] arrayOfInt84 = { G, I, D, I, D, H };
int[] arrayOfInt85 = { E, H, E, H, G, H };
int[] arrayOfInt86 = { E, H, G, H, E, H };
int[] arrayOfInt87 = { G, H, E, H, E, H };
int i26 = D;
int i27 = H;
int i28 = D;
int i29 = H;
int i30 = G;
int i31 = J;
int[] arrayOfInt88 = { D, H, D, J, G, H };
int[] arrayOfInt89 = { D, J, D, H, G, H };
int[] arrayOfInt90 = { D, H, G, H, D, J };
int[] arrayOfInt91 = { D, H, G, J, D, H };
int[] arrayOfInt92 = { G, H, D, H, D, J };
int[] arrayOfInt93 = { G, H, D, J, D, H };
int[] arrayOfInt94 = { D, H, F, H, G, H };
int[] arrayOfInt95 = { D, H, G, H, F, H };
int[] arrayOfInt96 = { F, H, D, H, G, H };
int[] arrayOfInt97 = { G, H, D, H, F, H };
ab = new int[][] { arrayOfInt1, arrayOfInt2, arrayOfInt3, arrayOfInt4, arrayOfInt5, arrayOfInt6, arrayOfInt7, arrayOfInt8, arrayOfInt9, arrayOfInt10, arrayOfInt11, arrayOfInt12, arrayOfInt13, arrayOfInt14, { i, j, k, m, n, i1 }, arrayOfInt15, arrayOfInt16, arrayOfInt17, arrayOfInt18, arrayOfInt19, arrayOfInt20, arrayOfInt21, arrayOfInt22, arrayOfInt23, arrayOfInt24, arrayOfInt25, arrayOfInt26, arrayOfInt27, arrayOfInt28, arrayOfInt29, arrayOfInt30, { i2, i3, i4, i5, i6, i7 }, arrayOfInt31, arrayOfInt32, arrayOfInt33, arrayOfInt34, arrayOfInt35, arrayOfInt36, arrayOfInt37, arrayOfInt38, arrayOfInt39, arrayOfInt40, arrayOfInt41, arrayOfInt42, arrayOfInt43, arrayOfInt44, arrayOfInt45, arrayOfInt46, arrayOfInt47, arrayOfInt48, arrayOfInt49, arrayOfInt50, arrayOfInt51, arrayOfInt52, arrayOfInt53, arrayOfInt54, arrayOfInt55, arrayOfInt56, arrayOfInt57, arrayOfInt58, arrayOfInt59, arrayOfInt60, arrayOfInt61, arrayOfInt62, arrayOfInt63, arrayOfInt64, arrayOfInt65, arrayOfInt66, arrayOfInt67, arrayOfInt68, arrayOfInt69, arrayOfInt70, { i8, i9, i10, i11, i12, i13 }, arrayOfInt71, arrayOfInt72, arrayOfInt73, arrayOfInt74, arrayOfInt75, arrayOfInt76, arrayOfInt77, { i14, i15, i16, i17, i18, i19 }, { i20, i21, i22, i23, i24, i25 }, arrayOfInt78, arrayOfInt79, arrayOfInt80, arrayOfInt81, arrayOfInt82, arrayOfInt83, arrayOfInt84, arrayOfInt85, arrayOfInt86, arrayOfInt87, { i26, i27, i28, i29, i30, i31 }, arrayOfInt88, arrayOfInt89, arrayOfInt90, arrayOfInt91, arrayOfInt92, arrayOfInt93, arrayOfInt94, arrayOfInt95, arrayOfInt96, arrayOfInt97 };
}
public a()
{
this.e = 22;
this.m = false;
this.u = d;
this.v = c;
this.w = c;
this.x = c;
this.y = 2;
this.z = 0;
}
private int a(int[] paramArrayOfInt)
{
return paramArrayOfInt.length * L + Z.length;
}
protected int a(com.a.a.a.b.a[] paramArrayOfA, int paramInt, int[] paramArrayOfInt, boolean paramBoolean)
{
paramBoolean = bb;
int i = 0;
int j;
do
{
j = paramInt;
if (i >= paramArrayOfInt.length) {
break;
}
if (i % 2 == 0)
{
paramArrayOfA[paramInt].a(0);
if (!paramBoolean) {}
}
else
{
paramArrayOfA[paramInt].a(1);
}
paramArrayOfA[paramInt].d(paramArrayOfInt[i]);
paramArrayOfA[paramInt].a(false);
j = paramInt + 1;
i += 1;
paramInt = j;
} while (!paramBoolean);
return j;
}
protected boolean a(int paramInt)
{
return (paramInt >= 0) && (paramInt <= 127);
}
public int[] a(int[] paramArrayOfInt)
{
return d.a(paramArrayOfInt);
}
public i[] a(int[] paramArrayOfInt, boolean paramBoolean)
{
i[] arrayOfI = new i[1];
arrayOfI[0] = new i();
arrayOfI[0].q = b.a(paramArrayOfInt);
arrayOfI[0].w = this.s;
return arrayOfI;
}
public int[] b(int[] paramArrayOfInt)
{
boolean bool = bb;
int i = paramArrayOfInt[0];
int j = 1;
int k;
do
{
k = i;
if (j >= paramArrayOfInt.length) {
break;
}
k = i + paramArrayOfInt[j] * j;
j += 1;
i = k;
} while (!bool);
return b.a(paramArrayOfInt, k % 103);
}
public int[] c(d paramD)
{
return f.a(paramD.a(true));
}
public com.a.a.a.b.a[] c(int[] paramArrayOfInt)
{
boolean bool = bb;
com.a.a.a.b.a[] arrayOfA = new com.a.a.a.b.a[a(paramArrayOfInt)];
int i = 0;
do
{
if (i >= arrayOfA.length) {
break;
}
arrayOfA[i] = new com.a.a.a.b.a();
i += 1;
} while (!bool);
int j;
if (paramArrayOfInt[0] == M)
{
j = a(arrayOfA, 0, W, false);
i = j;
if (!bool) {}
}
for (i = j;; i = 0)
{
j = i;
if (paramArrayOfInt[0] == N)
{
j = a(arrayOfA, i, X, false);
i = j;
if (!bool) {}
}
else
{
i = j;
if (paramArrayOfInt[0] == O) {
i = a(arrayOfA, j, Y, false);
}
}
j = 1;
int k;
do
{
k = i;
if (j >= paramArrayOfInt.length) {
break;
}
k = a(arrayOfA, i, ab[paramArrayOfInt[j]], false);
j += 1;
i = k;
} while (!bool);
a(arrayOfA, k, Z, true);
return arrayOfA;
}
}
}
| [
"[email protected]"
] | |
6077a14790e59100ebcc747d5755dd64a153ee4b | 76bf98f9ca19979db01b624a5edc7ca9f6e3fa57 | /src/main/java/com/example/demo/application/port/in/model/ResponseFindAllPersonajes.java | c2652443987412835e889955548414ecad867e25 | [] | no_license | srkapi/test1 | ca00120a72f3ce3d057fc8bb1cbea76156a3f9e3 | ebbc4be31a0e032458f34ad546a70dd7b046d064 | refs/heads/master | 2022-10-20T17:35:37.113135 | 2020-05-22T09:59:03 | 2020-05-22T09:59:03 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 339 | java | package com.example.demo.application.port.in.model;
import com.example.demo.application.domain.Personaje;
import lombok.Builder;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
@Builder
@Data
public class ResponseFindAllPersonajes implements Serializable {
private List<Personaje> responsePersonajeList;
}
| [
"[email protected]"
] |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.