blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 332 | content_id stringlengths 40 40 | detected_licenses listlengths 0 50 | license_type stringclasses 2 values | repo_name stringlengths 7 115 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 557 values | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 684M ⌀ | star_events_count int64 0 77.7k | fork_events_count int64 0 48k | gha_license_id stringclasses 17 values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 82 values | src_encoding stringclasses 28 values | language stringclasses 1 value | is_vendor bool 1 class | is_generated bool 2 classes | length_bytes int64 7 5.41M | extension stringclasses 11 values | content stringlengths 7 5.41M | authors listlengths 1 1 | author stringlengths 0 161 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
978baed4076ae05dc9128a74b96f51076b1ce062 | f789692e74479cf650000dbc98d440e4ffaa4065 | /app/src/main/java/com/canhdinh/mylib/model/BaseResponseModel.java | 4917fae0d84810ad6e8e8a6bd6daaf660ffd0df3 | [] | no_license | dinhdeveloper/MyLib | 963fb0434361621adad3510ff7f5ea69b1229779 | de458b10c5b899ca42916a3e116a4eabcfab91c0 | refs/heads/master | 2023-01-20T23:43:31.804305 | 2020-12-03T17:17:37 | 2020-12-03T17:17:37 | 282,491,618 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 774 | java | package com.canhdinh.mylib.model;
import androidx.annotation.Nullable;
import java.io.Serializable;
public class BaseResponseModel <T> implements Serializable {
@Nullable
private String success;
@Nullable
private String message;
@Nullable
private String total_page;
@Nullable
private String error_code;
@Nullable
private T[] data;
@Nullable
public String getSuccess() {
return success;
}
@Nullable
public String getMessage() {
return message;
}
@Nullable
public T[] getData() {
return data;
}
@Nullable
public String getTotal_page() {
return total_page;
}
@Nullable
public String getError_code() {
return error_code;
}
} | [
"dinhtrancntt@gmail.com"
] | dinhtrancntt@gmail.com |
107a87b12b205ef9cf1ab89a1093e1a30a29ca19 | 43ac33d7f1cc7bc5a5c7b61cac94d479ebba38af | /src/test/java/com/nexttech/pageobjectmodel/SignIn.java | a76cdf2e56f95636e1948674e7a3736c8c30deaf | [] | no_license | nahar20/Rose | 102fef633753aeafa864a118ff25066ab85793ef | 3aff689fa43f6fd1353c0c2bf6f6f1dec004f7a0 | refs/heads/master | 2022-12-17T14:48:15.365476 | 2020-09-13T03:50:38 | 2020-09-13T03:50:38 | 295,071,795 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,092 | java | package com.nexttech.pageobjectmodel;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.PageFactory;
public class SignIn {
WebDriver driver;
public SignIn(WebDriver driver) {
this.driver=driver;
PageFactory.initElements(driver, this);
/* constructor is not method but a special type of method
* constructor name and class name will be same
* there is no return type
*/
}
@FindBy(xpath="//*[@id=\"tdb3\"]/span[2]")
WebElement Click_MyAccount;
public WebElement MyAccount() {
return Click_MyAccount;
}
@FindBy(name="email_address")
WebElement Type_EmailAddress;
public WebElement EmailAddress() {
return Type_EmailAddress;
}
@FindBy(name="password")
WebElement Type_Password;
public WebElement Password() {
return Type_Password;
}
@FindBy(xpath="//*[@id=\"tdb1\"]/span[2]")
WebElement Click_signin;
public WebElement signin() {
return Click_signin;
}
@FindBy(xpath="")
WebElement Click_logout;
public WebElement logout() {
return Click_logout;
}
}
| [
"nahartx2109@gmail.com"
] | nahartx2109@gmail.com |
052244452b1fb82bee42feb94893ac04011c05a0 | 09d147a0fe758416a7f90c8e8f711d38dcd4bcf1 | /Project Part A/cw5/src/graph/Node.java | e15d3a1a3cafad25a39b4f5207baac3cac98cecc | [] | no_license | estaisameme/panda2 | 48ce7787fc233cb0d651b4aeec5cf60872ca18f8 | bfb4e647813e843719b4b717ba5a8f53ce0b682b | refs/heads/master | 2016-08-11T07:09:13.394827 | 2016-05-03T11:30:57 | 2016-05-03T11:30:57 | 51,323,801 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 936 | java | package graph;
import java.util.List;
import java.util.ArrayList;
/**
* A class which represents a node in a graph.
*/
public class Node<X> {
private X index;
/**
* Constructs a new node with the specified index.
*
* @param index the index of the node in the graph.
*/
public Node(X index) {
this.index = index;
}
/**
* Sets the index of the node in the graph.
*
* @param index the new index of the node in the graph.
*/
public void setIndex(X index) {
this.index = index;
}
/**
* Returns the index of this node.
*
* @return the index of this node.
*/
public X getIndex() {
return index;
}
/**
* Returns a representation of this node as a string.
*
* @return a representation of this node as a string.
*/
public String toString() {
return index.toString();
}
}
| [
"aidanhball@btinternet.com"
] | aidanhball@btinternet.com |
143a0126b2efcf5286965a07a5e399a846db7001 | dc05f3dc090363db01a1a59664974266abecb689 | /part01-Part01_19.AdditionFormula/src/main/java/AdditionFormula.java | bd74d9c00894af8df88a2c8a16ac9dbc7bda663f | [] | no_license | cassumacher/University-of-Helsinki-s-MOOC | 6624d6ab9f7dcfb25a54682178ae83beece3e161 | 7193d6895448158dd09f074cb6a158c8c2a4e739 | refs/heads/master | 2023-01-04T13:03:13.229874 | 2020-07-13T20:06:54 | 2020-07-13T20:06:54 | 279,397,683 | 0 | 0 | null | 2020-10-13T23:32:45 | 2020-07-13T19:49:55 | Java | UTF-8 | Java | false | false | 498 | java |
import java.util.Scanner;
public class AdditionFormula {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.println("Give the first number:");
int first = Integer.valueOf(scanner.nextInt());
System.out.println("Give the second number:");
int second = Integer.valueOf(scanner.nextInt());
int sum = first + second;
System.out.println(first + " + " + second + " = " + sum );
}
}
| [
"noreply@github.com"
] | noreply@github.com |
a90b7b605a112d302ce66178460f917959ae1a28 | 0b0ca7e59ce96554e7cf4b2fa35b18d6e781984e | /src/test/java/ru/appium/lesson/lib/ui/MainPageObject.java | 6ec333cd39910d6305fdf10779979187febe386d | [] | no_license | rrudakov/JavaAppiumAutomation | 56aeb7bfa4bff5574b7359d515a0a650ae258668 | 2c28160d6fb1fe4dc54e30d961b0b9ffded27f81 | refs/heads/master | 2023-06-21T18:36:51.678106 | 2021-04-01T08:28:48 | 2021-04-01T08:28:48 | 141,014,625 | 0 | 0 | null | 2023-06-14T22:29:00 | 2018-07-15T09:32:13 | JavaScript | UTF-8 | Java | false | false | 8,355 | java | package ru.appium.lesson.lib.ui;
import java.util.List;
import org.junit.Assert;
import org.openqa.selenium.By;
import org.openqa.selenium.Dimension;
import org.openqa.selenium.TimeoutException;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
import io.appium.java_client.AppiumDriver;
import io.appium.java_client.MobileElement;
import io.appium.java_client.TouchAction;
import ru.appium.lesson.lib.Platform;
public class MainPageObject {
private static final int DEFAULT_TIMEOUT = 10;
protected AppiumDriver<WebElement> driver;
public MainPageObject(AppiumDriver<WebElement> driver) {
this.driver = driver;
}
protected void assertElementPresent(By locator, String errorMessage) {
int amountOfElements = this.getAmountOfElements(locator);
if (amountOfElements == 0) {
throw new AssertionError(
String.format(
"An element %s should not be present. %s", locator.toString(), errorMessage));
}
}
// Этот метод я изначально написал для задания, testAssertElementPresent всего лишь тест, который
// использует этот метод
protected boolean isElementCurrentlyVisible(By locator) {
try {
WebElement element = waitForElementPresent(locator, "Ignore error", 0);
return element.isDisplayed();
} catch (TimeoutException e) {
return false;
}
}
protected WebElement waitForElementPresent(
By locator, String errorMessage, long timeOutInSeconds) {
WebDriverWait wait = new WebDriverWait(driver, timeOutInSeconds);
wait.withMessage(errorMessage + "\n");
return wait.until(ExpectedConditions.presenceOfElementLocated(locator));
}
protected WebElement waitForElementPresent(By locator, String errorMessage) {
return waitForElementPresent(locator, errorMessage, DEFAULT_TIMEOUT);
}
protected void waitForWebView() {
this.waitForElementsPresent(By.className("XCUIElementTypeWebView"), "Can't find webview");
while (true) if (this.driver.getContextHandles().size() > 1) break;
}
protected List<WebElement> waitForElementsPresent(
By locator, String errorMessage, long timeOutInSeconds) {
WebDriverWait wait = new WebDriverWait(driver, timeOutInSeconds);
wait.withMessage(errorMessage + "\n");
return wait.until(ExpectedConditions.presenceOfAllElementsLocatedBy(locator));
}
protected List<WebElement> waitForElementsPresent(By locator, String errorMessage) {
return this.waitForElementsPresent(locator, errorMessage, DEFAULT_TIMEOUT);
}
protected WebElement waitForElementAndClick(
By locator, String errorMessage, long timeOutInSeconds) {
WebElement element = waitForElementPresent(locator, errorMessage, timeOutInSeconds);
element.click();
return element;
}
protected WebElement waitForElementAndClick(By locator, String errorMessage) {
return this.waitForElementAndClick(locator, errorMessage, DEFAULT_TIMEOUT);
}
protected WebElement waitForElementAndSendKeys(
By locator, String value, String errorMessage, long timeOutInSedonds) {
WebElement element = waitForElementPresent(locator, errorMessage, timeOutInSedonds);
((MobileElement) element).setValue(value);
return element;
}
protected WebElement waitForElementAndSendKeys(By locator, String value, String errorMessage) {
return this.waitForElementAndSendKeys(locator, value, errorMessage, DEFAULT_TIMEOUT);
}
protected boolean waitForElementNotPresent(
By locator, String errorMessage, long timeOutInSeconds) {
WebDriverWait wait = new WebDriverWait(driver, timeOutInSeconds);
wait.withMessage(errorMessage + "\n");
return wait.until(ExpectedConditions.invisibilityOfElementLocated(locator));
}
protected boolean waitForElementNotPresent(By locator, String errorMessage) {
return this.waitForElementNotPresent(locator, errorMessage, DEFAULT_TIMEOUT);
}
protected WebElement waitForElementAndClear(
By locator, String errorMessage, long timeOutInSeconds) {
WebElement element = waitForElementPresent(locator, errorMessage);
element.clear();
return element;
}
protected WebElement waitForElementAndClear(By locator, String errorMessage) {
return this.waitForElementAndClear(locator, errorMessage, DEFAULT_TIMEOUT);
}
protected void swipeUp(int timeOfSwipe) {
TouchAction action = new TouchAction(driver);
Dimension size = driver.manage().window().getSize();
int x = size.getWidth() / 2;
int y_start = (int) (size.getHeight() * 0.8);
int y_end = (int) (size.getHeight() * 0.2);
action.press(x, y_start).waitAction(timeOfSwipe).moveTo(x, y_end).release().perform();
}
protected void swipeUpQuick() {
this.swipeUp(200);
}
protected void swipeUpToFindElement(By locator, String errorMessage, int maxSwipes) {
int alreadySwiped = 0;
while (driver.findElements(locator).size() == 0) {
if (alreadySwiped > maxSwipes) {
this.waitForElementsPresent(
locator, String.format("Can't find element by swiping up.\n%s", errorMessage), 0);
return;
}
this.swipeUpQuick();
alreadySwiped++;
}
}
protected void swipeTillElementAppear(By locator, String errorMessage, int maxSwipes) {
int alreadySwiped = 0;
while (!this.isElementLocatedOnTheScreen(locator)) {
if (alreadySwiped > maxSwipes) {
Assert.assertTrue(errorMessage, this.isElementLocatedOnTheScreen(locator));
}
swipeUpQuick();
alreadySwiped++;
}
}
protected void swipeElementToLeft(By locator, String errorMessage) {
WebElement element = this.waitForElementPresent(locator, errorMessage);
int middleY = element.getLocation().getY() + element.getSize().getHeight() / 2;
int leftX = element.getLocation().getX();
int rightX = leftX + element.getSize().getWidth();
System.out.printf("MIddleY: %d, RightX: %d, LeftX: %d\n", middleY, rightX, leftX);
TouchAction action = new TouchAction(driver);
action.press(rightX, middleY);
action.waitAction(800);
if (Platform.getInstance().isAndroid()) {
action.moveTo(leftX, middleY);
} else {
int offsetX = (-1 * element.getSize().getWidth());
action.moveTo(offsetX, 0);
}
action.release();
action.perform();
}
protected void clickElementToTheRightUpperCorner(By locator, String errorMessage) {
WebElement element = this.waitForElementPresent(locator, errorMessage);
int middleY = element.getLocation().getY() + element.getSize().getHeight() / 2;
int leftX = element.getLocation().getX();
int pointToClickX = leftX + element.getSize().getWidth() - 3;
TouchAction action = new TouchAction(this.driver);
action.tap(pointToClickX, middleY).perform();
}
protected int getAmountOfElements(By locator) {
List<WebElement> elements = driver.findElements(locator);
return elements.size();
}
protected void assertElementNotPresent(By locator, String errorMessage) {
int amountOfElements = this.getAmountOfElements(locator);
if (amountOfElements > 0) {
throw new AssertionError(
String.format(
"An element %s supposed to be present. %s", locator.toString(), errorMessage));
}
}
protected String waitForElementAndGetAttribure(
By locator, String attribureName, String errorMessage, long timeOutInSecond) {
WebElement element = this.waitForElementPresent(locator, errorMessage, timeOutInSecond);
return element.getAttribute(attribureName);
}
protected String waitForElementAndGetAttribure(
By locator, String attribureName, String errorMessage) {
return this.waitForElementAndGetAttribure(
locator, attribureName, errorMessage, DEFAULT_TIMEOUT);
}
protected boolean isElementLocatedOnTheScreen(By locator) {
int locationByY =
this.waitForElementPresent(locator, "Can't find element by locator", 1)
.getLocation()
.getY();
int screenSizeByY = this.driver.manage().window().getSize().getHeight();
return locationByY < screenSizeByY;
}
protected By byText(String elementText) {
return By.xpath(String.format("//*[@text='%s']", elementText));
}
}
| [
"rrudakov@protonmail.com"
] | rrudakov@protonmail.com |
58af18fb392ab13649019637144f3c11e6dd41e4 | cc7a75b159568e3edb59df4436a6ae8b50b974de | /oauth-legacy/oauth-microservices/2x/resource-server-mvc-2/src/main/java/com/baeldung/web/HelloController.java | f7b3b3de8716360d3b1c1b0110f9ba22dfb9101b | [
"MIT"
] | permissive | Baeldung/spring-security-oauth | 204391c208c721e8e36ee44c10295a3bea450b0b | bb6132ba0e5265a4037ebc3706fa16bba7349ac4 | refs/heads/master | 2023-09-01T15:08:42.179453 | 2023-08-24T09:05:33 | 2023-08-24T09:05:33 | 52,948,965 | 2,022 | 2,179 | MIT | 2023-09-14T20:53:18 | 2016-03-02T09:04:07 | Java | UTF-8 | Java | false | false | 956 | java | package com.baeldung.web;
import java.security.Principal;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
@Controller
@RequestMapping("/")
public class HelloController {
@RequestMapping(method = RequestMethod.GET)
@ResponseBody
public String helloWorld(Principal principal) {
return principal == null ? "Hello anonymous" : "Hello " + principal.getName();
}
@PreAuthorize("#oauth2.hasScope('fooScope') and hasRole('ROLE_ADMIN')")
@RequestMapping(value = "secret", method = RequestMethod.GET)
@ResponseBody
public String helloSecret(Principal principal) {
return principal == null ? "Hello anonymous" : "S3CR3T - Hello " + principal.getName();
}
} | [
"anuragkumawat7@gmail.com"
] | anuragkumawat7@gmail.com |
82704b4eaff8bb2b26e3b07a38dc9e65e4e620fa | 91948dc2fba5f13358c0f9ae67aa986b5e12e811 | /src/main/java/com/model/ActIdInfo.java | a796c1fffed3aa6e030fa78582f79840975529b1 | [] | no_license | lifeifeixz/FileClient | 42d1ddb72ea07d6c65cb98846d3e106e00cae5a3 | 8f94853a92d1be425c4760b6cf9eb0d0aa7870b9 | refs/heads/master | 2021-01-23T21:12:48.049432 | 2017-12-20T05:59:04 | 2017-12-20T05:59:04 | 102,884,976 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,304 | java | // Decompiled by Jad v1.5.8e2. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://kpdus.tripod.com/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi space
// Source File Name: ActIdInfo.java
package com.model;
public class ActIdInfo
{
private String id_;
private int rev_;
private String userId;
private String type_;
private String key_;
private String value_;
private Object password_;
private String parentId;
public String setId_()
{
return id_;
}
public void setId_(String s)
{
id_ = s;
}
public int setRev_()
{
return rev_;
}
public void setRev_(int i)
{
rev_ = i;
}
public String setUserId()
{
return userId;
}
public void setUserId(String s)
{
userId = s;
}
public String setType_()
{
return type_;
}
public void setType_(String s)
{
type_ = s;
}
public String setKey_()
{
return key_;
}
public void setKey_(String s)
{
key_ = s;
}
public String setValue_()
{
return value_;
}
public void setValue_(String s)
{
value_ = s;
}
public Object setPassword_()
{
return password_;
}
public void setPassword_(Object obj)
{
password_ = obj;
}
public String setParentId()
{
return parentId;
}
public void setParentId(String s)
{
parentId = s;
}
public ActIdInfo()
{
}
}
| [
"lifeifeixz@sina.cn"
] | lifeifeixz@sina.cn |
57f4a68452118b4cd575d4b8fb27082a2a5d2805 | 33a5cf15d349a2153e011fbb792dd8b106b41c80 | /Example/Important.java | cff7369f0c109734cc46a8a9c0df2e1b92273650 | [] | no_license | 4aka/Examples___Java | 87fb13af6f51593aec2f055a4027a990bf6100a7 | 6bf19880f7c848f944fbbda45b4144749318af26 | refs/heads/main | 2023-04-26T23:02:06.947105 | 2021-05-18T17:42:20 | 2021-05-18T17:42:20 | 348,849,269 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,044 | java | package Example;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.Base64;
import java.util.Iterator;
import java.util.List;
import org.json.JSONArray;
import org.json.JSONObject;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
public class Important {
public void encodeToBase64() {
String path = System.getProperty("user.dir");
// data to Base64.
byte[] bytes = path.getBytes();
String dataInBase64 = Base64.getEncoder().encodeToString(bytes);
}
// ****************************************************************
public void getDataFromJson() {
// Get value from JSONObject.
WebDriver driver = null;
assert false;
WebElement element = driver.findElement(By.id("result"));
JSONObject encrData = new JSONObject(element.getAttribute("value"));
String result = encrData.getString("envelopedData");
}
// ****************************************************************
// Return array[]
public String[] returnArray() {
WebDriver driver = null;
assert false;
WebElement element = driver.findElement(By.id("result"));
String value = element.getAttribute("value");
System.out.println("Split: " + value);
JSONArray cmsSplit = new JSONArray(value);
// The first way use list
List<Object> signs = cmsSplit.toList();
Iterator<Object> iter = signs.iterator();
String[] signArray = null;
while (iter.hasNext()) {
signArray[signArray.length + 1] = iter.next().toString();
}
return signArray;
}
// ****************************************************************
// Read data to Base64
public String readBase64Cert(String name) throws IOException {
File myFile = new File(".......");
FileInputStream fileIn = new FileInputStream(name);
byte[] bytes = new byte[fileIn.available()];
fileIn.read(bytes);
fileIn.close();
String cert = Base64.getEncoder().encodeToString(bytes);
return cert;
}
}
| [
"noreply@github.com"
] | noreply@github.com |
88473f92ac18168236efcc92d2aac38cac24df9f | 66d90b3a4483b8da0035012b7342a5d42af08d0c | /src/main/java/com/example/demo/controller/CustomerController.java | b8514ccfc66b164259e7c8322c19d44c1485a1fb | [] | no_license | duyhai97/md4-demo-springboot | 170861bfbb582d4bd4245d0d4c22bbcd1f8c841b | 088cd844f4c712d8fb7cf9a71764bda08bc2454a | refs/heads/master | 2023-06-05T06:59:13.011954 | 2021-06-30T13:03:12 | 2021-06-30T13:03:12 | 381,274,492 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,015 | java | package com.example.demo.controller;
import com.example.demo.model.Customer;
import com.example.demo.service.CustomerService;
import com.example.demo.service.ICustomerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
@RestController
public class CustomerController {
@Autowired
private ICustomerService customerService;
@GetMapping("")
public ModelAndView showList(){
return new ModelAndView("/customer/list","list",customerService.findAll());
}
@GetMapping("/create")
public ModelAndView showFormCreate(){
return new ModelAndView("/customer/create", "customer", new Customer());
}
@PostMapping("/create")
public ModelAndView create(Customer customer){
customerService.save(customer);
return new ModelAndView("redirect:");
}
@GetMapping("/{id}/edit")
public ModelAndView showFormEdit(@PathVariable Long id){
return new ModelAndView("/customer/edit", "customer", customerService.findById(id));
}
@PostMapping("/edit")
public ModelAndView edit(Customer customer){
customerService.save(customer);
return new ModelAndView("redirect:");
}
@GetMapping("/{id}/delete")
public ModelAndView showFormDelete(@PathVariable Long id){
return new ModelAndView("/customer/delete", "customer",customerService.findById(id));
}
@DeleteMapping("/{id}")
public ResponseEntity<Customer> deleteBlog(@PathVariable Long id) {
customerService.remove(id);
return new ResponseEntity<>(HttpStatus.OK);
}
@GetMapping("/{id}/view")
public ModelAndView view(@PathVariable Long id){
return new ModelAndView("/customer/view", "customer", customerService.findById(id));
}
}
| [
"79962575+duyhai97@users.noreply.github.com"
] | 79962575+duyhai97@users.noreply.github.com |
2258ab446d64dc8f839258e7af96e333c3676376 | 3a9217d01f578bcc83e1788c12221d489e9df58c | /admin/src/main/java/com/yzz/blog/controller/RestRoleController.java | cdb83327bf3afdd6974a987caa9af1a54275607b | [] | no_license | yangzhenze/YZBlog | c099567babe3eb98ded54fe08749115beae63a3b | 3fbdad5ccf35bcdbf8d928fd152c266f7a29f019 | refs/heads/master | 2023-07-01T05:10:32.989233 | 2020-05-21T14:25:31 | 2020-05-21T14:25:31 | 188,535,250 | 0 | 0 | null | 2023-06-14T16:39:06 | 2019-05-25T07:32:22 | Java | UTF-8 | Java | false | false | 3,945 | java | package com.yzz.blog.controller;
import com.github.pagehelper.PageInfo;
import com.yzz.blog.business.annotation.BussinessLog;
import com.yzz.blog.business.entity.Role;
import com.yzz.blog.business.enums.ResponseStatus;
import com.yzz.blog.business.service.SysRoleResourcesService;
import com.yzz.blog.business.service.SysRoleService;
import com.yzz.blog.business.vo.RoleConditionVO;
import com.yzz.blog.core.shiro.ShiroService;
import com.yzz.blog.framework.object.PageResult;
import com.yzz.blog.framework.object.ResponseVO;
import com.yzz.blog.util.ResultUtil;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* 系统角色管理
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.0
* @website https://www.zhyd.me
* @date 2018/4/24 14:37
* @since 1.0
*/
@RestController
@RequestMapping("/roles")
public class RestRoleController {
@Autowired
private SysRoleService roleService;
@Autowired
private SysRoleResourcesService roleResourcesService;
@Autowired
private ShiroService shiroService;
@RequiresPermissions("roles")
@PostMapping("/list")
public PageResult getAll(RoleConditionVO vo) {
PageInfo<Role> pageInfo = roleService.findPageBreakByCondition(vo);
return ResultUtil.tablePage(pageInfo);
}
@RequiresPermissions("user:allotRole")
@PostMapping("/rolesWithSelected")
public ResponseVO<List<Role>> rolesWithSelected(Integer uid) {
return ResultUtil.success(null, roleService.queryRoleListWithSelected(uid));
}
@RequiresPermissions("role:allotResource")
@PostMapping("/saveRoleResources")
@BussinessLog("分配角色拥有的资源")
public ResponseVO saveRoleResources(Long roleId, String resourcesId) {
if (StringUtils.isEmpty(roleId)) {
return ResultUtil.error("error");
}
roleResourcesService.addRoleResources(roleId, resourcesId);
// 重新加载所有拥有roleId的用户的权限信息
shiroService.reloadAuthorizingByRoleId(roleId);
return ResultUtil.success("成功");
}
@RequiresPermissions("role:add")
@PostMapping(value = "/add")
@BussinessLog("添加角色")
public ResponseVO add(Role role) {
roleService.insert(role);
return ResultUtil.success("成功");
}
@RequiresPermissions(value = {"role:batchDelete", "role:delete"}, logical = Logical.OR)
@PostMapping(value = "/remove")
@BussinessLog("删除角色")
public ResponseVO remove(Long[] ids) {
if (null == ids) {
return ResultUtil.error(500, "请至少选择一条记录");
}
for (Long id : ids) {
roleService.removeByPrimaryKey(id);
roleResourcesService.removeByRoleId(id);
}
return ResultUtil.success("成功删除 [" + ids.length + "] 个角色");
}
@RequiresPermissions("role:get")
@PostMapping("/get/{id}")
@BussinessLog("获取角色详情")
public ResponseVO get(@PathVariable Long id) {
return ResultUtil.success(null, this.roleService.getByPrimaryKey(id));
}
@RequiresPermissions("role:edit")
@PostMapping("/edit")
@BussinessLog("编辑角色")
public ResponseVO edit(Role role) {
try {
roleService.updateSelective(role);
} catch (Exception e) {
e.printStackTrace();
return ResultUtil.error("角色修改失败!");
}
return ResultUtil.success(ResponseStatus.SUCCESS);
}
}
| [
"466636298@qq.com"
] | 466636298@qq.com |
f546c6388a5b7e6710d20b329a3cb17eb83c0a8d | 16cd44f60037ff460870be9c70546a7bfce4c0c2 | /src/main/java/com/uday/java8/joda/LeapYearUsage_44.java | 56c53c6927546bbcde86589588bcdd36f99362e2 | [] | no_license | udaykumar1113/java-8 | 7870221ed0aa6d56ec666231faed51bec7f90367 | d21b3b6495b141aba3c75b805b88cca568363820 | refs/heads/master | 2020-04-13T02:23:05.668327 | 2018-12-29T17:24:19 | 2018-12-29T17:24:19 | 162,900,942 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 243 | java | package com.uday.java8.joda;
import java.time.Year;
public class LeapYearUsage_44 {
public static void main(String args[]){
boolean leapYear= Year.isLeap(1994);
System.out.println("Is 1994 leap year? "+leapYear);
}
}
| [
"udaykumar1113@gmail.com"
] | udaykumar1113@gmail.com |
f78d40a2abe45dc5178d07875911b2dff1b351f7 | a309105e78e8ab70d9df99957819babd8cbcab07 | /src/client/Client.java | 5e494c59117e1a6d9d679054fd7150e4ddb79b72 | [] | no_license | mrayanealves/airfare-rmi | dc1f85907c5ebfedaf7f5fc927040179ae84e3a0 | 7330891d25257463444fd297e3900334e709ea15 | refs/heads/master | 2022-12-25T04:19:09.920408 | 2020-10-01T16:29:07 | 2020-10-01T16:29:07 | 247,853,876 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 197 | java | package client;
import java.rmi.Remote;
import java.rmi.RemoteException;
public interface Client extends Remote {
public void search(String origin, String destination) throws RemoteException;
}
| [
"mrayalves05@gmail.com"
] | mrayalves05@gmail.com |
2c9e87cfdc062e7a6117422d0cc02916cc640200 | 8524b1f573821140ccf3408d00c83dd737341eff | /App_note/app/src/main/java/com/example/truonghoa/MainActivity.java | d4094f90118031aa8ef1e03f154ef905bdd49cd9 | [] | no_license | HoaBlue/git-android | 4ba80716d3248febb27ab2b8ee47c69ac6d20e55 | 3cd6aa9ad23e3822192966d5b31483ce94afc2fd | refs/heads/master | 2020-04-13T09:46:33.780323 | 2018-12-26T00:51:17 | 2018-12-26T00:51:17 | 163,120,459 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,443 | java | package com.example.truonghoa;
import android.content.Intent;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import com.example.truonghoa.app_note.R;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.IOException;
import java.text.Normalizer;
import java.util.ArrayList;
import java.util.List;
import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.FormBody;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
public class MainActivity extends AppCompatActivity implements ContactAdapter.OnCallBack {
private String url_listcontact = DB.url + "listcontact";
private String url_searchcontact = DB.url + "searchname";
private RecyclerView rwContacts;
private ContactAdapter adapter;
private TextView tvUserName;
private TextView tvPhoneNumber;
private List<Contact> listContact;
private EditText txtSearch;
private Button btnSearch;
private Button btnAdd;
private Button btnEdit;
private User currentUser;
private AlertDialog.Builder m_MsgDlg;
public static Contact selectedContact;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
tvUserName = findViewById(R.id.tvUserName);
tvPhoneNumber = findViewById(R.id.tvPhoneNumber);
txtSearch = findViewById(R.id.txtSearch);
rwContacts = findViewById(R.id.rwContacts);
rwContacts.setHasFixedSize(true);
rwContacts.setLayoutManager(new LinearLayoutManager(this));
btnAdd = findViewById(R.id.btnAdd);
btnEdit = findViewById(R.id.btnEdit);
btnSearch = findViewById(R.id.btnSearch);
// for(int i = 0;i < 10 ; i++){
// listContact.add(new Contact("","Contact " + i,"0000"+i,"","",String.valueOf(R.drawable.user)));
// }
currentUser = SignIn.owner_User;
doGetList();
tvUserName.setText(currentUser.fullname);
tvPhoneNumber.setText(currentUser.phonenumber);
m_MsgDlg = new AlertDialog.Builder(this);
btnAdd.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
changeViewAdd();
}
});
btnEdit.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
changeViewEdit();
}
});
btnSearch.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
doSearch();
}
});
}
@Override
public void onItemClick(int position) {
selectedContact = listContact.get(position);
changeViewEditContact();
}
private void doGetList(){
try {
apiGetListContact(currentUser.email);
} catch (IOException e) {
e.printStackTrace();
}
}
private void doSearch(){
try {
apiSearchContact(currentUser.email, txtSearch.getText().toString());
} catch (IOException e) {
e.printStackTrace();
}
}
private void apiSearchContact(String email,String name) throws IOException{
OkHttpClient client = new OkHttpClient();
FormBody.Builder formBodyBuilder = new FormBody.Builder();
formBodyBuilder.add("owner_email", email);
formBodyBuilder.add("contact_fullname", name);
FormBody formBody = formBodyBuilder.build();
Request request = new Request.Builder().url(url_searchcontact).post(formBody).build();
client.newCall(request).enqueue(new Callback() {
@Override
public void onFailure(Call call, IOException e) {
Log.d("onFailure called", e.toString());
call.cancel();
}
@Override
public void onResponse(Call call, Response response) throws IOException {
final String myResponse = response.body().string();
final int respCode = response.code();
Log.d("MY RESPONSE: ",myResponse);
MainActivity.this.runOnUiThread(new Runnable() {
@Override
public void run() {
if(respCode == 201){
try {
InitList(myResponse);
} catch (JSONException e) {
e.printStackTrace();
}
}
if(respCode == 200){
Toast.makeText(MainActivity.this,"Không tìm thấy kết quả nào",Toast.LENGTH_LONG).show();
}
}
});
}
});
}
private void apiGetListContact(String email) throws IOException{
OkHttpClient client = new OkHttpClient();
FormBody.Builder formBodyBuilder = new FormBody.Builder();
formBodyBuilder.add("owner_email",email);
FormBody formBody = formBodyBuilder.build();
Request request = new Request.Builder().url(url_listcontact).post(formBody).build();
client.newCall(request).enqueue(new Callback() {
@Override
public void onFailure(Call call, IOException e) {
Log.d("onFailure called",e.toString());
call.cancel();
}
@Override
public void onResponse(Call call, Response response) throws IOException {
final String myResponse = response.body().string();
final int respCode = response.code();
Log.d(" RESPONSE: ", myResponse);
MainActivity.this.runOnUiThread(new Runnable() {
@Override
public void run() {
if(respCode == 201){
try {
InitList(myResponse);
} catch (JSONException e) {
e.printStackTrace();
Log.d("loi parse json",e.toString());
}
}else{
if(respCode == 200){
int code = Integer.parseInt(myResponse);
if(code == -1){
m_MsgDlg.setTitle("Lỗi không mong muốn");
m_MsgDlg.setMessage("code: " + myResponse);
m_MsgDlg.show();
}
}
}
}
});
}
});
}
private void InitList(String input) throws JSONException {
listContact = new ArrayList<>();
JSONArray jsonArray = new JSONArray(input);
for(int i = 0; i<jsonArray.length();i++){
JSONObject jObject = jsonArray.getJSONObject(i);
Contact contact = new Contact(jObject.getString("_id"),jObject.getString("owner_email"),
jObject.getString("contact_fullname"),
jObject.getString("contact_phonenumber"),
jObject.getString("contact_address"),
jObject.getString("contact_email"),
String.valueOf(R.drawable.user));
listContact.add(contact);
}
adapter = new ContactAdapter(this,listContact);
rwContacts.setAdapter(adapter);
}
private void changeViewAdd(){
Intent intent = new Intent(this, AddContact.class);
startActivity(intent);
}
private void changeViewEdit(){
Intent intent = new Intent(this, EditUser.class);
startActivity(intent);
}
private void changeViewEditContact(){
Intent intent = new Intent(this, EditContact.class);
startActivity(intent);
}
}
| [
"hoatruongdev09@gmail.com"
] | hoatruongdev09@gmail.com |
fc4514fc3c6e33a3274a9c6aee1d4eefbbb968cd | 2f2f379f05dd54a52c6595647d56ec3af99785bf | /learn-framework/learn-grpc/src/main/java/io/emqx/exhook/SessionDiscardedRequestOrBuilder.java | 7d173acc6179fb9e076c0158f7059696dbdccbde | [] | no_license | DIscord010/my-learning | 0bc0fa912af024e961dad6482d39d72ce3e520de | 126180034dcac3cc1ce594033aa162ba03a525f9 | refs/heads/master | 2023-04-30T16:20:07.686728 | 2023-04-12T03:57:36 | 2023-04-12T03:57:36 | 204,897,476 | 3 | 0 | null | 2019-10-29T12:22:31 | 2019-08-28T09:37:55 | Java | UTF-8 | Java | false | true | 1,128 | java | // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: exhook.proto
package io.emqx.exhook;
public interface SessionDiscardedRequestOrBuilder extends
// @@protoc_insertion_point(interface_extends:emqx.exhook.v2.SessionDiscardedRequest)
com.google.protobuf.MessageOrBuilder {
/**
* <code>.emqx.exhook.v2.ClientInfo clientinfo = 1;</code>
* @return Whether the clientinfo field is set.
*/
boolean hasClientinfo();
/**
* <code>.emqx.exhook.v2.ClientInfo clientinfo = 1;</code>
* @return The clientinfo.
*/
io.emqx.exhook.ClientInfo getClientinfo();
/**
* <code>.emqx.exhook.v2.ClientInfo clientinfo = 1;</code>
*/
io.emqx.exhook.ClientInfoOrBuilder getClientinfoOrBuilder();
/**
* <code>.emqx.exhook.v2.RequestMeta meta = 2;</code>
* @return Whether the meta field is set.
*/
boolean hasMeta();
/**
* <code>.emqx.exhook.v2.RequestMeta meta = 2;</code>
* @return The meta.
*/
io.emqx.exhook.RequestMeta getMeta();
/**
* <code>.emqx.exhook.v2.RequestMeta meta = 2;</code>
*/
io.emqx.exhook.RequestMetaOrBuilder getMetaOrBuilder();
}
| [
"chensiqu@leelen.cn"
] | chensiqu@leelen.cn |
acc5b05546421d191162b42f8744f80dcaab7797 | ec579efd6f4428fba46ce242ab35574f40204f3b | /src/main/java/com/ai/amc/core/service/impl/Trends_uintSvImpl.java | f865f4595d4dc1602634bddab1143e5972703531 | [] | no_license | yyzz1987431/platform-amc-service | 8a6613a253e4a3dae99d7be07f795602ac32377a | df96c8906372611b7fba3b0fb5925d433a39e59d | refs/heads/master | 2021-01-16T21:01:38.250354 | 2016-03-08T08:50:22 | 2016-03-08T08:50:22 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 704 | java | package com.ai.amc.core.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
import com.ai.amc.core.dao.mapper.Trends_uintMapper;
import com.ai.amc.core.po.Trends_uint;
import com.ai.amc.core.po.Trends_uintKey;
import com.ai.amc.core.service.ITrends_uintSv;
@Repository
@Transactional
public class Trends_uintSvImpl implements ITrends_uintSv {
@Autowired
private Trends_uintMapper trends_uintMapper;
@Override
public List<Trends_uint> getTrendsByKey(Trends_uintKey key) {
return trends_uintMapper.selectByPrimaryKey(key);
}
}
| [
"675660796@qq.com"
] | 675660796@qq.com |
c5f73b69e07e8d0ec93d7005ab7eb10cf6988e87 | 7566f468c27c9077dd7bed9da7e213124f32f26c | /Solution/app/src/main/java/ro/pub/cs/systems/eim/practicaltest02/network/ClientThread.java | 23493f3f5f97189e218dd73ecc338c5a15d267f4 | [
"Apache-2.0"
] | permissive | catalinmares/PracticalTest02 | 1488c5276811285d35895dcc276591d6af2c5c77 | f2d353e0d2646ed7f1f663306eb10680541035af | refs/heads/main | 2023-05-07T06:27:22.420847 | 2021-06-03T08:56:50 | 2021-06-03T08:56:50 | 373,413,075 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,495 | java | package ro.pub.cs.systems.eim.practicaltest02.network;
import android.util.Log;
import android.widget.TextView;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.net.Socket;
import ro.pub.cs.systems.eim.practicaltest02.general.Constants;
import ro.pub.cs.systems.eim.practicaltest02.general.Utilities;
public class ClientThread extends Thread {
private final String address;
private final int port;
private final String command;
private final TextView resultTextView;
private Socket socket;
public ClientThread(String address, int port, String command, TextView resultTextView) {
this.address = address;
this.port = port;
this.command = command;
this.resultTextView = resultTextView;
}
@Override
public void run() {
try {
socket = new Socket(address, port);
if (socket == null) {
Log.e(Constants.TAG, "[CLIENT THREAD] Could not create socket!");
return;
}
BufferedReader bufferedReader = Utilities.getReader(socket);
PrintWriter printWriter = Utilities.getWriter(socket);
if (bufferedReader == null || printWriter == null) {
Log.e(Constants.TAG, "[CLIENT THREAD] Buffered Reader / Print Writer are null!");
return;
}
printWriter.println(command);
printWriter.flush();
String result;
while ((result = bufferedReader.readLine()) != null) {
final String finalizedResult = result;
resultTextView.post(() -> resultTextView.setText(finalizedResult));
}
} catch (IOException ioException) {
Log.e(Constants.TAG, "[CLIENT THREAD] An exception has occurred: " + ioException.getMessage());
if (Constants.DEBUG) {
ioException.printStackTrace();
}
} finally {
if (socket != null) {
try {
socket.close();
} catch (IOException ioException) {
Log.e(Constants.TAG, "[CLIENT THREAD] An exception has occurred: " + ioException.getMessage());
if (Constants.DEBUG) {
ioException.printStackTrace();
}
}
}
}
}
}
| [
"catalin.mares@stud.acs.upb.ro"
] | catalin.mares@stud.acs.upb.ro |
6f741f0d1fc66bc7c3981a228d79fbfdad4fd175 | 45400c0790809812bb58711457ec4cd4d2f1f766 | /src/test/java/com/unimoni/selenium/DragAndDrops.java | dfcc7e9392e5016bca2f667e9fca6dfa69f98801 | [] | no_license | vvseshuk/Batch4-SeliniumSession | df1022fbdcebfd3acde281681ed4a8775d080648 | 37887c3da2c986b68d8b29138a937e29d261bdfa | refs/heads/master | 2020-12-22T07:11:13.769152 | 2020-01-28T10:19:06 | 2020-01-28T10:19:06 | 236,707,207 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 986 | java | package com.unimoni.selenium;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.interactions.Actions;
public class DragAndDrops {
public static void main(String[] args) throws InterruptedException {
System.setProperty("webdriver.chrome.driver", "C:\\browsers\\chromedriver.exe");
WebDriver driver = new ChromeDriver();
driver.manage().window().maximize();
driver.get("https://jqueryui.com/resources/demos/droppable/default.html");
driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);
WebElement draggable = driver.findElement(By.id("draggable"));
WebElement droppable = driver.findElement(By.id("droppable"));
Thread.sleep(5000);
Actions actions = new Actions(driver);
actions.dragAndDrop(draggable, droppable).build().perform();
Thread.sleep(5000);
driver.close();
}
}
| [
"seshavataramk@wavalabs.ai"
] | seshavataramk@wavalabs.ai |
3c2b5737b6ec26074cda7f33e22fd397bfe3c040 | 07f45187b2bd5e119114453ec239d07519f3b402 | /Sample/app/src/main/java/com/androidHexa/sample/ui/home/HomeViewModel.java | 2d9d5917c9223f9d3511eb90fdc1f6bd6f19a25c | [] | no_license | hexaspace/android_studio_tutorial | 6aca4541208fd4a672d1b46365e0806f48b4346f | d8532176de680349862764805d7006fda461acd4 | refs/heads/main | 2023-04-18T23:44:25.612106 | 2021-05-05T15:10:42 | 2021-05-05T15:10:42 | 362,723,228 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 445 | java | package com.androidHexa.sample.ui.home;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;
public class HomeViewModel extends ViewModel {
private MutableLiveData<String> mText;
public HomeViewModel() {
mText = new MutableLiveData<>();
mText.setValue("This is home fragment");
}
public LiveData<String> getText() {
return mText;
}
} | [
"hexa6do@hanyang.ac.kr"
] | hexa6do@hanyang.ac.kr |
dadc6c916ede1e25ef374317fa550771e84fc45c | 828ef94a14d593fbda1a12b68be6252d2e4355a3 | /StreamTest/src/fpij/StaticTest.java | 25b5d0751c14e529ff750f32655d2947b6ada37c | [] | no_license | bartekJava/workspace | ad0b09dcec55408de0b401e4cd816b4a2a601b8a | db9c24aa0cee9035d8b47869f8d08726cc345ba3 | refs/heads/master | 2021-01-25T05:57:35.527993 | 2017-10-09T15:53:09 | 2017-10-09T15:53:09 | 80,713,130 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 264 | java | package fpij;
public class StaticTest
{
public static int silnia(int number){
if(number == 1)
{
return number;
}
else
{
return number * silnia(number-1);
}
}
public static void main(String[] args)
{
System.out.println(silnia(50));
}
}
| [
"bartosz_wojtulewicz@o2.pl"
] | bartosz_wojtulewicz@o2.pl |
7132c2ce103e2d347223c6e13e9ae7ebe14aa7d6 | 42eb2dd49b8530c23648c5d4a6314c84a6dea677 | /src/main/java/br/com/lemontech/triprequestmanager/selfbooking/wsselfbooking/services/request/PesquisarSolicitacaoRequest.java | 0b008bd0e62c42102143f4e3c232cd3bd9cc97b3 | [] | no_license | jacyzin/fullstack-java-teste | 87c0e4e5698296d51b140607c49906cb98b9ae76 | f9bfeecccccbdf46c9a4eebde9cc5a01889a1ebe | refs/heads/master | 2020-03-07T22:54:15.225374 | 2018-04-02T14:40:47 | 2018-04-02T14:40:47 | 127,757,211 | 0 | 0 | null | 2018-04-02T13:04:36 | 2018-04-02T13:04:36 | null | UTF-8 | Java | false | false | 8,521 | java |
package br.com.lemontech.triprequestmanager.selfbooking.wsselfbooking.services.request;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.datatype.XMLGregorianCalendar;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlSchemaType;
/**
* <p>Java class for pesquisarSolicitacaoRequest complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="pesquisarSolicitacaoRequest">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <choice>
* <sequence>
* <element name="idSolicitacaoRef" type="{http://www.w3.org/2001/XMLSchema}int"/>
* <element name="exibirCancelados" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
* <element name="exibirPendentesAprovacao" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
* </sequence>
* <sequence>
* <element name="dataInicial" type="{http://www.w3.org/2001/XMLSchema}dateTime"/>
* <element name="dataFinal" type="{http://www.w3.org/2001/XMLSchema}dateTime"/>
* <element name="registroInicial">
* <simpleType>
* <restriction base="{http://www.w3.org/2001/XMLSchema}int">
* <minInclusive value="1"/>
* </restriction>
* </simpleType>
* </element>
* <element name="quantidadeRegistros" minOccurs="0">
* <simpleType>
* <restriction base="{http://www.w3.org/2001/XMLSchema}int">
* <maxInclusive value="50"/>
* <minInclusive value="1"/>
* </restriction>
* </simpleType>
* </element>
* <element name="sincronizado" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
* </sequence>
* </choice>
* <element name="exibirRemarks" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "pesquisarSolicitacaoRequest", propOrder = {
"idSolicitacaoRef",
"exibirCancelados",
"exibirPendentesAprovacao",
"dataInicial",
"dataFinal",
"registroInicial",
"quantidadeRegistros",
"sincronizado",
"exibirRemarks",
"exibirAprovadas"
})
public class PesquisarSolicitacaoRequest {
protected Integer idSolicitacaoRef;
@XmlElement(defaultValue = "false")
protected Boolean exibirCancelados;
@XmlElement(defaultValue = "false")
protected Boolean exibirPendentesAprovacao;
@XmlSchemaType(name = "dateTime")
protected XMLGregorianCalendar dataInicial;
@XmlSchemaType(name = "dateTime")
protected XMLGregorianCalendar dataFinal;
protected Integer registroInicial;
@XmlElement(defaultValue = "50")
protected Integer quantidadeRegistros;
@XmlElement(defaultValue = "false")
protected Boolean sincronizado;
@XmlElement(defaultValue = "true")
protected Boolean exibirRemarks;
@XmlElement(defaultValue = "true")
protected Boolean exibirAprovadas;
/**
* Gets the value of the idSolicitacaoRef property.
*
* @return
* possible object is
* {@link Integer }
*
*/
public Integer getIdSolicitacaoRef() {
return idSolicitacaoRef;
}
/**
* Sets the value of the idSolicitacaoRef property.
*
* @param value
* allowed object is
* {@link Integer }
*
*/
public void setIdSolicitacaoRef(Integer value) {
this.idSolicitacaoRef = value;
}
/**
* Gets the value of the exibirCancelados property.
*
* @return
* possible object is
* {@link Boolean }
*
*/
public Boolean isExibirCancelados() {
return exibirCancelados;
}
/**
* Sets the value of the exibirCancelados property.
*
* @param value
* allowed object is
* {@link Boolean }
*
*/
public void setExibirCancelados(Boolean value) {
this.exibirCancelados = value;
}
/**
* Gets the value of the exibirPendentesAprovacao property.
*
* @return
* possible object is
* {@link Boolean }
*
*/
public Boolean isExibirPendentesAprovacao() {
return exibirPendentesAprovacao;
}
/**
* Sets the value of the exibirPendentesAprovacao property.
*
* @param value
* allowed object is
* {@link Boolean }
*
*/
public void setExibirPendentesAprovacao(Boolean value) {
this.exibirPendentesAprovacao = value;
}
/**
* Gets the value of the dataInicial property.
*
* @return
* possible object is
* {@link XMLGregorianCalendar }
*
*/
public XMLGregorianCalendar getDataInicial() {
return dataInicial;
}
/**
* Sets the value of the dataInicial property.
*
* @param value
* allowed object is
* {@link XMLGregorianCalendar }
*
*/
public void setDataInicial(XMLGregorianCalendar value) {
this.dataInicial = value;
}
/**
* Gets the value of the dataFinal property.
*
* @return
* possible object is
* {@link XMLGregorianCalendar }
*
*/
public XMLGregorianCalendar getDataFinal() {
return dataFinal;
}
/**
* Sets the value of the dataFinal property.
*
* @param value
* allowed object is
* {@link XMLGregorianCalendar }
*
*/
public void setDataFinal(XMLGregorianCalendar value) {
this.dataFinal = value;
}
/**
* Gets the value of the registroInicial property.
*
* @return
* possible object is
* {@link Integer }
*
*/
public Integer getRegistroInicial() {
return registroInicial;
}
/**
* Sets the value of the registroInicial property.
*
* @param value
* allowed object is
* {@link Integer }
*
*/
public void setRegistroInicial(Integer value) {
this.registroInicial = value;
}
/**
* Gets the value of the quantidadeRegistros property.
*
* @return
* possible object is
* {@link Integer }
*
*/
public Integer getQuantidadeRegistros() {
return quantidadeRegistros;
}
/**
* Sets the value of the quantidadeRegistros property.
*
* @param value
* allowed object is
* {@link Integer }
*
*/
public void setQuantidadeRegistros(Integer value) {
this.quantidadeRegistros = value;
}
/**
* Gets the value of the sincronizado property.
*
* @return
* possible object is
* {@link Boolean }
*
*/
public Boolean isSincronizado() {
return sincronizado;
}
/**
* Sets the value of the sincronizado property.
*
* @param value
* allowed object is
* {@link Boolean }
*
*/
public void setSincronizado(Boolean value) {
this.sincronizado = value;
}
/**
* Gets the value of the exibirRemarks property.
*
* @return
* possible object is
* {@link Boolean }
*
*/
public Boolean isExibirRemarks() {
return exibirRemarks;
}
/**
* Sets the value of the exibirRemarks property.
*
* @param value
* allowed object is
* {@link Boolean }
*
*/
public void setExibirRemarks(Boolean value) {
this.exibirRemarks = value;
}
/**
* Sets the value of the exibirAprovadas property.
*
* @param value
* allowed object is
* {@link Boolean }
*
*/
public void setExibirAprovadas(Boolean value) {
this.exibirAprovadas = value;
}
} | [
"henryjacyzin@gmail.com"
] | henryjacyzin@gmail.com |
7b05cccd3394d4eb32aca1b8036a273df3d4b921 | 3d8ebd2e40c761747bb6938628f65478ca9348b1 | /src/com/catalyst/android/birdapp/utilities/AlertDialogFragment.java | 3b4ce9f062ac8596a9f3a83703cd3758fc67e979 | [] | no_license | maroon5five/BirdApp | bdaaf9f44273f5eb73b49639c1ebf1e3bfec8e7e | ef136c3e68aad321f5b9d57fb20d13793430f5c1 | refs/heads/master | 2021-01-18T01:51:05.636238 | 2013-11-04T22:39:12 | 2013-11-04T22:39:12 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,134 | java | package com.catalyst.android.birdapp.utilities;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.DialogFragment;
import android.content.DialogInterface;
import android.os.Bundle;
import android.util.Log;
import com.catalyst.android.birdapp.BirdFormActivity;
public class AlertDialogFragment extends DialogFragment implements
DialogInterface.OnClickListener {
public static AlertDialogFragment newInstance(String message) {
AlertDialogFragment adf = new AlertDialogFragment();
Bundle bundle = new Bundle();
bundle.putString("alert-message", message);
adf.setArguments(bundle);
return adf;
}
@Override
public void onAttach(Activity act) {
// If the activity we're being attached to has
// not implemented the OnDialogDoneListener
// interface, the following line will throw a
// ClassCastException. This is the earliest we
// can test if we have a well-behaved activity.
try {
@SuppressWarnings("unused")
OnDialogDoneListener test = (OnDialogDoneListener) act;
} catch (ClassCastException cce) {
// Here is where we fail gracefully.
Log.e(BirdFormActivity.LOGTAG, "Activity is not listening");
}
super.onAttach(act);
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.setCancelable(true);
int style = DialogFragment.STYLE_NORMAL, theme = 0;
setStyle(style, theme);
}
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
AlertDialog.Builder b = new AlertDialog.Builder(getActivity())
.setTitle("Alert!!!").setPositiveButton("Yes", this)
.setNegativeButton("No", this)
.setMessage(this.getArguments().getString("alert-message"));
return b.create();
}
public void onClick(DialogInterface dialog, int which) {
OnDialogDoneListener act = (OnDialogDoneListener) getActivity();
boolean cancelled = false;
if (which == AlertDialog.BUTTON_NEGATIVE) {
cancelled = true;
act.onDialogDone(getTag(), cancelled, "Alert dismissed");
} else {
act.onDialogDone(getTag(), cancelled, "Sighting will be submitted");
}
}
}
| [
"mhowell@catalystitservices.com"
] | mhowell@catalystitservices.com |
3e485b6d1f7449767e000e1eae8e3882903203a1 | d142c8b8a3aa73b52c3e02c6af9ac3016898cbdb | /DemoConstructor3.java | a2515505093f730c0f69095b0c83554db2b42938 | [] | no_license | zepedak1/Java-Works | 1768b4c5c8672667365f96c4d065068eb8765edd | 0bf871e5444482d756b34ad48b74300379d01739 | refs/heads/master | 2020-08-29T16:55:53.300543 | 2019-10-30T17:41:20 | 2019-10-30T17:41:20 | 218,101,499 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 582 | java | public class DemoConstructor3
{
public static void main(String[] args)
{
EventSite aSite = new EventSite(678);
EventSite anotherSite = new EventSite();
EventSite aThirdSite = new EventSite("Robin");
System.out.println("Site number is " + aSite.getSiteNumber() + " Manager is " + aSite.getManager());
System.out.println("Another site number is " + anotherSite.getSiteNumber() + " Manager is " + anotherSite.getManager());
System.out.println("A third site number is " + aThirdSite.getSiteNumber() + " Manager is " + aThirdSite.getManager());
}
} | [
"noreply@github.com"
] | noreply@github.com |
2ee5e97bc58ac342b437d760adb5bde6e29ad64a | 3646032e5d7deafc668e89d734e9eb5f7ef673ec | /RuoYi/ruoyi-common/src/main/java/com/ruoyi/common/utils/ExcelUtil.java | 86fe6ae90769fe77c7b788935db92d9c832a6502 | [
"MIT"
] | permissive | zhonglin728/JavaProject | 1604e582525de96ab5ccde1d1184b48d1958902b | 956282eaff851064d5e327e9816b143891b05e8a | refs/heads/master | 2022-09-19T09:38:48.363152 | 2021-12-18T12:38:37 | 2021-12-18T12:38:37 | 90,464,741 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 19,705 | java | package com.ruoyi.common.utils;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import org.apache.poi.hssf.usermodel.DVConstraint;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
import org.apache.poi.hssf.usermodel.HSSFDataValidation;
import org.apache.poi.hssf.usermodel.HSSFFont;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.hssf.util.HSSFColor.HSSFColorPredefined;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.CellType;
import org.apache.poi.ss.usermodel.FillPatternType;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.VerticalAlignment;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.usermodel.WorkbookFactory;
import org.apache.poi.ss.util.CellRangeAddressList;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.base.AjaxResult;
import com.ruoyi.common.config.Global;
import com.ruoyi.common.exception.BusinessException;
/**
* Excel相关处理
*
* @author ruoyi
*/
public class ExcelUtil<T> {
private static final Logger log = LoggerFactory.getLogger(ExcelUtil.class);
public Class<T> clazz;
public ExcelUtil(Class<T> clazz) {
this.clazz = clazz;
}
/**
* 对excel表单默认第一个索引名转换成list
*
* @param input 输入流
* @return 转换后集合
*/
public List<T> importExcel(InputStream input) throws Exception {
return importExcel(StringUtils.EMPTY, input);
}
/**
* 对excel表单指定表格索引名转换成list
*
* @param sheetName 表格索引名
* @param input 输入流
* @return 转换后集合
*/
public List<T> importExcel(String sheetName, InputStream input) throws Exception {
List<T> list = new ArrayList<T>();
Workbook workbook = WorkbookFactory.create(input);
Sheet sheet = null;
if (StringUtils.isNotEmpty(sheetName)) {
// 如果指定sheet名,则取指定sheet中的内容.
sheet = workbook.getSheet(sheetName);
} else {
// 如果传入的sheet名不存在则默认指向第1个sheet.
sheet = workbook.getSheetAt(0);
}
if (sheet == null) {
throw new IOException("文件sheet不存在");
}
int rows = sheet.getPhysicalNumberOfRows();
if (rows > 0) {
// 默认序号
int serialNum = 0;
// 有数据时才处理 得到类的所有field.
Field[] allFields = clazz.getDeclaredFields();
// 定义一个map用于存放列的序号和field.
Map<Integer, Field> fieldsMap = new HashMap<Integer, Field>();
for (int col = 0; col < allFields.length; col++) {
Field field = allFields[col];
// 将有注解的field存放到map中.
if (field.isAnnotationPresent(Excel.class)) {
// 设置类的私有字段属性可访问.
field.setAccessible(true);
fieldsMap.put(++serialNum, field);
}
}
for (int i = 1; i < rows; i++) {
// 从第2行开始取数据,默认第一行是表头.
Row row = sheet.getRow(i);
int cellNum = serialNum;
T entity = null;
for (int j = 0; j < cellNum; j++) {
Cell cell = row.getCell(j);
if (cell == null) {
continue;
} else {
// 先设置Cell的类型,然后就可以把纯数字作为String类型读进来了
row.getCell(j).setCellType(CellType.STRING);
cell = row.getCell(j);
}
String c = cell.getStringCellValue();
if (StringUtils.isEmpty(c)) {
continue;
}
// 如果不存在实例则新建.
entity = (entity == null ? clazz.newInstance() : entity);
// 从map中得到对应列的field.
Field field = fieldsMap.get(j + 1);
// 取得类型,并根据对象类型设置值.
Class<?> fieldType = field.getType();
if (String.class == fieldType) {
field.set(entity, String.valueOf(c));
} else if ((Integer.TYPE == fieldType) || (Integer.class == fieldType)) {
field.set(entity, Integer.parseInt(c));
} else if ((Long.TYPE == fieldType) || (Long.class == fieldType)) {
field.set(entity, Long.valueOf(c));
} else if ((Float.TYPE == fieldType) || (Float.class == fieldType)) {
field.set(entity, Float.valueOf(c));
} else if ((Short.TYPE == fieldType) || (Short.class == fieldType)) {
field.set(entity, Short.valueOf(c));
} else if ((Double.TYPE == fieldType) || (Double.class == fieldType)) {
field.set(entity, Double.valueOf(c));
} else if (Character.TYPE == fieldType) {
if ((c != null) && (c.length() > 0)) {
field.set(entity, Character.valueOf(c.charAt(0)));
}
} else if (java.util.Date.class == fieldType) {
if (cell.getCellTypeEnum() == CellType.NUMERIC) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
cell.setCellValue(sdf.format(cell.getNumericCellValue()));
c = sdf.format(cell.getNumericCellValue());
} else {
c = cell.getStringCellValue();
}
} else if (java.math.BigDecimal.class == fieldType) {
c = cell.getStringCellValue();
}
}
if (entity != null) {
list.add(entity);
}
}
}
return list;
}
/**
* 对list数据源将其里面的数据导入到excel表单
*
* @param list 导出数据集合
* @param sheetName 工作表的名称
* @return 结果
*/
public AjaxResult exportExcel(List<T> list, String sheetName) {
OutputStream out = null;
HSSFWorkbook workbook = null;
try {
// 得到所有定义字段
Field[] allFields = clazz.getDeclaredFields();
List<Field> fields = new ArrayList<Field>();
// 得到所有field并存放到一个list中.
for (Field field : allFields) {
if (field.isAnnotationPresent(Excel.class)) {
fields.add(field);
}
}
// 产生工作薄对象
workbook = new HSSFWorkbook();
// excel2003中每个sheet中最多有65536行
int sheetSize = 65536;
// 取出一共有多少个sheet.
double sheetNo = Math.ceil(list.size() / sheetSize);
for (int index = 0; index <= sheetNo; index++) {
// 产生工作表对象
HSSFSheet sheet = workbook.createSheet();
if (sheetNo == 0) {
workbook.setSheetName(index, sheetName);
} else {
// 设置工作表的名称.
workbook.setSheetName(index, sheetName + index);
}
HSSFRow row;
HSSFCell cell; // 产生单元格
// 产生一行
row = sheet.createRow(0);
// 写入各个字段的列头名称
for (int i = 0; i < fields.size(); i++) {
Field field = fields.get(i);
Excel attr = field.getAnnotation(Excel.class);
// 创建列
cell = row.createCell(i);
// 设置列中写入内容为String类型
cell.setCellType(CellType.STRING);
HSSFCellStyle cellStyle = workbook.createCellStyle();
cellStyle.setAlignment(HorizontalAlignment.CENTER);
cellStyle.setVerticalAlignment(VerticalAlignment.CENTER);
if (attr.name().indexOf("注:") >= 0) {
HSSFFont font = workbook.createFont();
font.setColor(HSSFFont.COLOR_RED);
cellStyle.setFont(font);
cellStyle.setFillForegroundColor(HSSFColorPredefined.YELLOW.getIndex());
sheet.setColumnWidth(i, 6000);
} else {
HSSFFont font = workbook.createFont();
// 粗体显示
font.setBold(true);
// 选择需要用到的字体格式
cellStyle.setFont(font);
cellStyle.setFillForegroundColor(HSSFColorPredefined.LIGHT_YELLOW.getIndex());
// 设置列宽
sheet.setColumnWidth(i, (int) ((attr.width() + 0.72) * 256));
row.setHeight((short) (attr.height() * 20));
}
cellStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND);
cellStyle.setWrapText(true);
cell.setCellStyle(cellStyle);
// 写入列名
cell.setCellValue(attr.name());
// 如果设置了提示信息则鼠标放上去提示.
if (StringUtils.isNotEmpty(attr.prompt())) {
// 这里默认设了2-101列提示.
setHSSFPrompt(sheet, "" , attr.prompt(), 1, 100, i, i);
}
// 如果设置了combo属性则本列只能选择不能输入
if (attr.combo().length > 0) {
// 这里默认设了2-101列只能选择不能输入.
setHSSFValidation(sheet, attr.combo(), 1, 100, i, i);
}
}
int startNo = index * sheetSize;
int endNo = Math.min(startNo + sheetSize, list.size());
// 写入各条记录,每条记录对应excel表中的一行
HSSFCellStyle cs = workbook.createCellStyle();
cs.setAlignment(HorizontalAlignment.CENTER);
cs.setVerticalAlignment(VerticalAlignment.CENTER);
for (int i = startNo; i < endNo; i++) {
row = sheet.createRow(i + 1 - startNo);
// 得到导出对象.
T vo = (T) list.get(i);
for (int j = 0; j < fields.size(); j++) {
// 获得field.
Field field = fields.get(j);
// 设置实体类私有属性可访问
field.setAccessible(true);
Excel attr = field.getAnnotation(Excel.class);
try {
// 设置行高
row.setHeight((short) (attr.height() * 20));
// 根据Excel中设置情况决定是否导出,有些情况需要保持为空,希望用户填写这一列.
if (attr.isExport()) {
// 创建cell
cell = row.createCell(j);
cell.setCellStyle(cs);
if (vo == null) {
// 如果数据存在就填入,不存在填入空格.
cell.setCellValue("");
continue;
}
// 用于读取对象中的属性
Object value = getTargetValue(vo, field, attr);
String dateFormat = attr.dateFormat();
String readConverterExp = attr.readConverterExp();
if (StringUtils.isNotEmpty(dateFormat)) {
cell.setCellValue(DateUtils.parseDateToStr(dateFormat, (Date) value));
} else if (StringUtils.isNotEmpty(readConverterExp)) {
cell.setCellValue(convertByExp(String.valueOf(value), readConverterExp));
} else {
cell.setCellType(CellType.STRING);
// 如果数据存在就填入,不存在填入空格.
cell.setCellValue(StringUtils.isNull(value) ? attr.defaultValue() : value + attr.suffix());
}
}
} catch (Exception e) {
log.error("导出Excel失败{}" , e.getMessage());
}
}
}
}
String filename = encodingFilename(sheetName);
out = new FileOutputStream(getAbsoluteFile(filename));
workbook.write(out);
return AjaxResult.success(filename);
} catch (Exception e) {
log.error("导出Excel异常{}" , e.getMessage());
throw new BusinessException("导出Excel失败,请联系网站管理员!");
} finally {
if (workbook != null) {
try {
workbook.close();
} catch (IOException e1) {
e1.printStackTrace();
}
}
if (out != null) {
try {
out.close();
} catch (IOException e1) {
e1.printStackTrace();
}
}
}
}
/**
* 设置单元格上提示
*
* @param sheet 要设置的sheet.
* @param promptTitle 标题
* @param promptContent 内容
* @param firstRow 开始行
* @param endRow 结束行
* @param firstCol 开始列
* @param endCol 结束列
* @return 设置好的sheet.
*/
public static HSSFSheet setHSSFPrompt(HSSFSheet sheet, String promptTitle, String promptContent, int firstRow,
int endRow, int firstCol, int endCol) {
// 构造constraint对象
DVConstraint constraint = DVConstraint.createCustomFormulaConstraint("DD1");
// 四个参数分别是:起始行、终止行、起始列、终止列
CellRangeAddressList regions = new CellRangeAddressList(firstRow, endRow, firstCol, endCol);
// 数据有效性对象
HSSFDataValidation dataValidationView = new HSSFDataValidation(regions, constraint);
dataValidationView.createPromptBox(promptTitle, promptContent);
sheet.addValidationData(dataValidationView);
return sheet;
}
/**
* 设置某些列的值只能输入预制的数据,显示下拉框.
*
* @param sheet 要设置的sheet.
* @param textlist 下拉框显示的内容
* @param firstRow 开始行
* @param endRow 结束行
* @param firstCol 开始列
* @param endCol 结束列
* @return 设置好的sheet.
*/
public static HSSFSheet setHSSFValidation(HSSFSheet sheet, String[] textlist, int firstRow, int endRow,
int firstCol, int endCol) {
// 加载下拉列表内容
DVConstraint constraint = DVConstraint.createExplicitListConstraint(textlist);
// 设置数据有效性加载在哪个单元格上,四个参数分别是:起始行、终止行、起始列、终止列
CellRangeAddressList regions = new CellRangeAddressList(firstRow, endRow, firstCol, endCol);
// 数据有效性对象
HSSFDataValidation dataValidationList = new HSSFDataValidation(regions, constraint);
sheet.addValidationData(dataValidationList);
return sheet;
}
/**
* 解析导出值 0=男,1=女,2=未知
*
* @param propertyValue 参数值
* @param converterExp 翻译注解
* @return 解析后值
* @throws Exception
*/
public static String convertByExp(String propertyValue, String converterExp) throws Exception {
try {
String[] convertSource = converterExp.split(",");
for (String item : convertSource) {
String[] itemArray = item.split("=");
if (itemArray[0].equals(propertyValue)) {
return itemArray[1];
}
}
} catch (Exception e) {
throw e;
}
return propertyValue;
}
/**
* 编码文件名
*/
public String encodingFilename(String filename) {
filename = UUID.randomUUID().toString() + "_" + filename + ".xls";
return filename;
}
/**
* 获取下载路径
*
* @param filename 文件名称
*/
public String getAbsoluteFile(String filename) {
String downloadPath = Global.getDownloadPath() + filename;
File desc = new File(downloadPath);
if (!desc.getParentFile().exists()) {
desc.getParentFile().mkdirs();
}
return downloadPath;
}
/**
* 获取bean中的属性值
*
* @param vo 实体对象
* @param field 字段
* @param excel 注解
* @return 最终的属性值
* @throws Exception
*/
private Object getTargetValue(T vo, Field field, Excel excel) throws Exception {
Object o = field.get(vo);
if (StringUtils.isNotEmpty(excel.targetAttr())) {
String target = excel.targetAttr();
if (target.indexOf(".") > -1) {
String[] targets = target.split("[.]");
for (String name : targets) {
o = getValue(o, name);
}
} else {
o = getValue(o, target);
}
}
return o;
}
/**
* 以类的属性的get方法方法形式获取值
*
* @param o
* @param name
* @return value
* @throws Exception
*/
private Object getValue(Object o, String name) throws Exception {
if (StringUtils.isNotEmpty(name)) {
Class<?> clazz = o.getClass();
String methodName = "get" + name.substring(0, 1).toUpperCase() + name.substring(1);
Method method = clazz.getMethod(methodName);
o = method.invoke(o);
}
return o;
}
} | [
"717543275@qq.com"
] | 717543275@qq.com |
5f57753781700919ad8d9727f5fe63ad3325e6f9 | 9e676e744baa12840464dfdf6716741e870dbf96 | /src/main/java/com/taxtelecom/chelnyedu/dropwizardclient/guiform/PhonebookGUI.java | f60bd66895c80e8c8a41a0c862326aa9c1571d4f | [] | no_license | chelnyedu/rest-gui-client | 506b3c24c47e033b889276bcc4b7647649b37e8b | a34e6b71bab22d918ea69dce8ca5ef7b96d062f9 | refs/heads/master | 2021-01-01T12:51:06.432537 | 2017-08-01T14:59:51 | 2017-08-01T14:59:51 | 97,578,987 | 0 | 1 | null | 2017-07-28T08:32:22 | 2017-07-18T09:19:28 | Java | UTF-8 | Java | false | false | 9,030 | java | package com.taxtelecom.chelnyedu.dropwizardclient.guiform;
import com.taxtelecom.chelnyedu.dropwizardclient.factory.InterfaceClient;
import com.taxtelecom.chelnyedu.dropwizardclient.factory.Factory;
import com.taxtelecom.chelnyedu.dropwizardclient.resources.Contact;
import javafx.application.Application;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.Scene;
import javafx.scene.control.*;
import javafx.scene.control.cell.PropertyValueFactory;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.GridPane;
import javafx.stage.Stage;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.List;
import java.util.Locale;
import java.util.ResourceBundle;
public class PhonebookGUI extends Application {
static Factory factory = new Factory();
static InterfaceClient client ;
private TextField firstNameTextField;
private TextField lastNameTextField;
private TextField phoneTextField;
private TextField mailTextField;
private TextField commentTextField;
ResourceBundle bundle;
ObservableList<Contact> list;
public static void main(String[] args) {
args = new String[1];
args[0] = "jersey";
//args[0] = "retrofit";
client = factory.getClienttype(args[0]);
launch(args);
}
@Override
public void start(Stage primaryStage) throws Exception {
//localization
bundle = ResourceBundle.getBundle("Locale",new Locale("en"));
primaryStage.setTitle(bundle.getString("PhoneBook"));
AnchorPane root = new AnchorPane();
//LeftSide
AnchorPane paneLeft = new AnchorPane();
paneLeft.setPrefSize(300, 300);
//Table
final TableView table = new TableView();
table.setPrefSize(300, 250);
TableColumn<Contact, String> firstName = new TableColumn(bundle.getString("firstName"));
firstName.setPrefWidth(150);
TableColumn<Contact, String> lastName = new TableColumn(bundle.getString("lastName"));
lastName.setPrefWidth(150);
table.getColumns().addAll(firstName, lastName);
//add contacts in table
firstName.setCellValueFactory(new PropertyValueFactory<Contact, String>("firstName"));
lastName.setCellValueFactory(new PropertyValueFactory<Contact, String>("lastName"));
table.setItems(getContactList());
//cell click action
table.getSelectionModel().selectedItemProperty().addListener(new ChangeListener() {
@Override
public void changed(ObservableValue observableValue, Object oldValue, Object newValue) {
if (newValue != null) {
Contact selectedUser = (Contact) newValue;
firstNameTextField.setText(selectedUser.getFirstName());
lastNameTextField.setText(selectedUser.getLastName());
phoneTextField.setText(selectedUser.getPhone());
mailTextField.setText(selectedUser.getMail());
commentTextField.setText(selectedUser.getComment());
} else {
firstNameTextField.clear();
lastNameTextField.clear();
phoneTextField.clear();
mailTextField.clear();
commentTextField.clear();
}
}
});
paneLeft.getChildren().add(table);
//Left Buttons
Button newContact = new Button(bundle.getString("Add"));
Button deleteContact = new Button(bundle.getString("Delete"));
AnchorPane.setBottomAnchor(newContact, 5.0);
AnchorPane.setBottomAnchor(deleteContact, 5.0);
AnchorPane.setLeftAnchor(newContact, 5.0);
AnchorPane.setRightAnchor(deleteContact, 5.0);
paneLeft.getChildren().addAll(newContact, deleteContact);
newContact.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent actionEvent) {
try {
alertNoValidPerson();
Contact contact = new Contact(0,firstNameTextField.getText(), lastNameTextField.getText(),
phoneTextField.getText(), mailTextField.getText(), commentTextField.getText());
client.createContact(contact);
table.setItems(getContactList());
} catch (IOException e) {
e.printStackTrace();
}
}
});
deleteContact.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent actionEvent) {
try {
Contact delContact = (Contact) table.getSelectionModel().getSelectedItem();
client.deleteContact(delContact.getId());
table.setItems(getContactList());
}catch (NullPointerException | IOException e){
alertNoSelectContact(e);
}
}
});
//RightSide
AnchorPane paneRigth = new AnchorPane();
paneRigth.setPrefSize(300, 300);
GridPane grid = new GridPane();
grid.setHgap(10);
grid.setVgap(20);
Label firstNameLabel = new Label(bundle.getString("firstName"));
firstNameTextField = new TextField();
Label lastNameLabel = new Label(bundle.getString("lastName"));
lastNameTextField = new TextField();
Label phoneLabel = new Label(bundle.getString("phone"));
phoneTextField = new TextField();
Label mailLabel = new Label(bundle.getString("mail"));
mailTextField = new TextField();
Label commentLabel = new Label(bundle.getString("Comment"));
commentTextField = new TextField();
grid.add(firstNameLabel, 1, 1);
grid.add(firstNameTextField, 2, 1);
grid.add(lastNameLabel, 1, 2);
grid.add(lastNameTextField, 2, 2);
grid.add(phoneLabel, 1, 3);
grid.add(phoneTextField, 2, 3);
grid.add(mailLabel, 1, 4);
grid.add(mailTextField, 2, 4);
grid.add(commentLabel, 1, 5);
grid.add(commentTextField, 2, 5);
paneRigth.getChildren().add(grid);
//Right button
Button editButton = new Button(bundle.getString("Update"));
AnchorPane.setBottomAnchor(editButton, 5.0);
AnchorPane.setLeftAnchor(editButton, 75.0);
paneRigth.getChildren().add(editButton);
editButton.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent actionEvent) {
try {
Contact updateContact = (Contact) table.getSelectionModel().getSelectedItem();
alertNoValidPerson();
Contact contact = new Contact(updateContact.getId(), firstNameTextField.getText(), lastNameTextField.getText(),
phoneTextField.getText(), mailTextField.getText(), commentTextField.getText());
client.updateContact(contact);
table.setItems(getContactList());
} catch (IOException | NullPointerException e) {
alertNoSelectContact(e);
}
}
});
//SplitPanel
SplitPane pane = new SplitPane();
pane.setLayoutX(5.0);
pane.setLayoutY(5.0);
pane.setPrefSize(600, 300);
pane.getItems().addAll(paneLeft, paneRigth);
root.getChildren().add(pane);
primaryStage.setScene(new Scene(root, 610, 310));
primaryStage.setResizable(false);
primaryStage.show();
}
private ObservableList<Contact> getContactList() throws IOException{
List<Contact> arrayList = client.getListContact();
list = FXCollections.observableArrayList(arrayList);
return list;
}
private void alertNoSelectContact(Exception ex){
Alert alert = new Alert(Alert.AlertType.ERROR);
alert.getDialogPane().setPrefSize(400,250);
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
ex.printStackTrace(pw);
String exceptionText = sw.toString();
TextArea textArea = new TextArea(exceptionText);
alert.setContentText("error.NoSelect");
alert.getDialogPane().setExpandableContent(textArea);
alert.showAndWait();
}
private void alertNoValidPerson(){
Alert alert = new Alert(Alert.AlertType.INFORMATION);
if(firstNameTextField.getLength() < 2 || lastNameTextField.getLength() < 2 ||
phoneTextField.getLength() < 2 || mailTextField.getLength() < 2){
alert.setContentText("error.NoValid");
alert.showAndWait();
}
}
} | [
"git_rabota2017"
] | git_rabota2017 |
8712f152c67b98bfd3af1f8f2dc6c492bcdac8b8 | fad523c7c0db7839b91fd9f0a6dc1762432dff64 | /StepStoneCrawler/src/project/ListLinks.java | 985fbd9dff3c51658bb842ec32430cdc69b64d20 | [] | no_license | DaFunkl/SSCrawler | 638d7a4167c57d239abdbec657f512ed1d99cceb | d6b246eede1d2e2bc9e3d9ed4930e0e94baccadc | refs/heads/master | 2021-01-01T16:36:39.754356 | 2017-07-20T19:07:39 | 2017-07-20T19:07:39 | 97,869,516 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,743 | java | package project;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.Writer;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
/**
* Example program to list links from a URL.
*/
public class ListLinks {
public static void main(String[] args) {
createWriter("./Wassabi.txt");
try {
jsoupMagic();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
closeWriter();
}
public static void jsoupMagic() throws IOException {
String url = "https://www.stepstone.de/5/resultlistpage?fu=1000000&of=&suid=2065338d-5bdb-4f99-9ff9-0a536581c303&an=paging_next";
print("Fetching %s...", url);
Document doc = Jsoup.connect(url).get();
Elements links = doc.select("a[href]");
Elements media = doc.select("[src]");
Elements imports = doc.select("link[href]");
print("\nMedia: (%d)", media.size());
for (Element src : media) {
if (src.tagName().equals("img"))
print(" * %s: <%s> %sx%s (%s)", src.tagName(), src.attr("abs:src"), src.attr("width"),
src.attr("height"), trim(src.attr("alt"), 20));
else
print(" * %s: <%s>", src.tagName(), src.attr("abs:src"));
}
print("\nImports: (%d)", imports.size());
for (Element link : imports) {
print(" * %s <%s> (%s)", link.tagName(), link.attr("abs:href"), link.attr("rel"));
}
print("\nLinks: (%d)", links.size());
for (Element link : links) {
print(" * a: <%s> (%s)", link.attr("abs:href"), trim(link.text(), 35));
}
}
private static void print(String msg, Object... args) {
String s = String.format(msg, args);
System.out.println(s);
write(s);
}
private static String trim(String s, int width) {
if (s.length() > width)
return s.substring(0, width - 1) + ".";
else
return s;
}
static Writer w;
public static void createWriter(String path) {
File statText = new File(path);
FileOutputStream is;
try {
is = new FileOutputStream(statText);
OutputStreamWriter osw = new OutputStreamWriter(is);
w = new BufferedWriter(osw);
} catch (FileNotFoundException e) {
e.printStackTrace();
}
}
public static void closeWriter() {
try {
w.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public static void write(String s) {
try {
w.write(s+"\n");
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
} | [
"noreply@github.com"
] | noreply@github.com |
3b31b515cf3e90e84282869ae796bfdf7483dd23 | 5e7fa165db779ce24aa03a562d651c768a05012b | /src/main/java/dynamicore/tools/SVMModel.java | a13953b7cec5323594627e08a4056813f9aea551 | [] | no_license | arafeh94/jsf | 21e8e82ce210cfa6f081fd7ad605284f20b1fa8e | 301036ff26ec88f0857400b4dc75da60e6e0f3fe | refs/heads/master | 2022-07-08T23:56:52.723698 | 2020-03-02T15:41:04 | 2020-03-02T15:41:05 | 181,476,805 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 705 | java | package dynamicore.tools;
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class SVMModel {
public static String predictRole(String msg) {
try {
ProcessBuilder pb = new ProcessBuilder("C:\\Users\\Arafeh\\Documents\\Projects\\svm\\venv\\Scripts\\python.exe", "C:\\Users\\Arafeh\\Documents\\Projects\\svm\\predict_prof.py", msg);
Process p = pb.start();
p.waitFor();
BufferedReader bri = new BufferedReader(new InputStreamReader(p.getInputStream()));
String result = bri.readLine();
p.destroy();
return result;
} catch (Exception e) {
return null;
}
}
}
| [
"pmdudmp123"
] | pmdudmp123 |
c982566dabebfe83ec2ed1cbbbed147ac9fb702c | b5c674ed487691bc59a443868896292ae5b3aa45 | /src/main/java/com/liferay/log4j/experiment/Log4J2Util.java | b5ff86fccd3d391900567559932c4c85c221fab8 | [] | no_license | yuhai/log4jexperiment | 44bc1e081c3aa1fb1953f4507e60e00e7fd06c4c | 65f649593f9aa1e75b52cb651fd249f7814940e8 | refs/heads/master | 2023-02-23T03:08:25.168510 | 2021-01-25T14:01:53 | 2021-01-25T14:01:53 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,322 | java | package com.liferay.log4j.experiment;
import com.liferay.log4j.experiment.log4j2.CentralizedConfiguration;
import com.liferay.log4j.experiment.log4j2.CentralizedConfigurator;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.core.LoggerContext;
import org.apache.logging.log4j.core.config.AbstractConfiguration;
import org.apache.logging.log4j.core.config.ConfigurationSource;
import org.apache.logging.log4j.core.config.Configurator;
import org.apache.logging.log4j.core.config.xml.XmlConfiguration;
import org.apache.logging.log4j.core.config.xml.XmlConfigurationFactory;
import org.apache.logging.log4j.core.impl.Log4jContextFactory;
import org.apache.logging.log4j.core.selector.BasicContextSelector;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
public class Log4J2Util {
public static void printTestLogs(String message) {
Logger logger = LogManager.getLogger(Log4J2Util.class);
logger.warn(message);
}
public static void configLog4J2(URL url) {
try (InputStream inputStream = url.openStream()) {
XmlConfiguration xmlConfiguration = new XmlConfiguration(
_loggerContext, new ConfigurationSource(inputStream, url));
_centralizedConfigurator.addConfiguration(xmlConfiguration);
}
catch (IOException ioException) {
ioException.printStackTrace();
}
}
private static final LoggerContext _loggerContext;
private static final CentralizedConfigurator _centralizedConfigurator;
static {
LogManager.setFactory(
new Log4jContextFactory(new BasicContextSelector()));
ClassLoader classLoader = Log4J2Util.class.getClassLoader();
URL url = classLoader.getResource("portal-log4j2.xml");
try (InputStream inputStream = url.openStream()) {
_loggerContext = Configurator.initialize(
classLoader, new ConfigurationSource(inputStream, url));
AbstractConfiguration configuration =
(AbstractConfiguration)_loggerContext.getConfiguration();
CentralizedConfigurator centralizedConfigurator =
new CentralizedConfigurator(_loggerContext, configuration);
_loggerContext.onChange(centralizedConfigurator);
_centralizedConfigurator = centralizedConfigurator;
}
catch (IOException ioException) {
throw new ExceptionInInitializerError(ioException);
}
}
} | [
"dante.wang@liferay.com"
] | dante.wang@liferay.com |
c8e354c6752eb0bf46b9c3ccca4b7131c6e7cb7c | 08e7464e6c5160d706d49f93e1e842aea0346b6e | /src/test/java/ru/urfu/MessageStorageTest.java | 864f4d2081441a761815a3a5d624e37e3681968c | [] | no_license | apetryashov/twitter | 22c33a160cdd02ae618950c10bd6957d30ae48a6 | 2f620df65e18604f2227029b38a004b80cc470c5 | refs/heads/master | 2021-06-03T00:28:04.796685 | 2016-10-17T15:04:15 | 2016-10-17T15:04:15 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 438 | java | package ru.urfu;
import org.junit.AfterClass;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Created by andrey on 16.10.16.
*/
public class MessageStorageTest {
private MessageStorage storage = new MessageStorage();
@Test
public void renderAllMessages() throws Exception {
storage.addMessage("hello World");
assertTrue(storage.renderAllMessages().contains("<li>hello World</li>"));
}
} | [
"567m249"
] | 567m249 |
a3161d8bf41d2dfccc98a7b1232fff36acd48a96 | 84abf44f04e7e19cc07eb4b8c8fe14db1ccb9b22 | /trunk/src/main/java/healthmanager/modelo/dao/Revision_sistemaDao.java | 113bd12c75eccc6386e7233a75a80d7ccabcd04d | [] | no_license | BGCX261/zkmhealthmanager-svn-to-git | 3183263172355b7ac0884b793c1ca3143a950411 | bb626589f101034137a2afa62d8e8bfe32bf7d47 | refs/heads/master | 2021-01-22T02:57:49.394471 | 2015-08-25T15:32:48 | 2015-08-25T15:32:48 | 42,323,197 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 646 | java | /*
* Revision_sistemaDao.java
*
* Generado Automaticamente .
* Tecnologo Luis Miguel Hernandez
*/
package healthmanager.modelo.dao;
import java.util.List;
import java.util.Map;
import healthmanager.modelo.bean.Revision_sistema;
public interface Revision_sistemaDao {
void crear(Revision_sistema revision_sistema);
int actualizar(Revision_sistema revision_sistema);
Revision_sistema consultar(Revision_sistema revision_sistema);
int eliminar(Revision_sistema revision_sistema);
List<Revision_sistema> listar(Map<String, Object> parameters);
void setLimit(String limit);
boolean existe(Map<String, Object> param);
} | [
"you@example.com"
] | you@example.com |
9cf8ce93214dd2b5d46fedcb20e7bb5e6f32026e | bd914f1ff80bb2e798469e0fcffa05438b4ea54a | /LectureManagementServer/src/lecturemanagement/Server/Main/Control/LogoutStudent.java | 61516ae559f0378b0785b3bd17880e068d7bc09d | [] | no_license | saadalenany/LectureManagementSystem | ea3313caa4f9d6b4a8e5cce946fe4402779543ff | 7031f8f9d39ad11890254f096c9eb98a6dd4d4a4 | refs/heads/master | 2021-01-22T22:49:46.727016 | 2017-03-20T14:03:57 | 2017-03-20T14:03:57 | 85,583,689 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,924 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package lecturemanagement.Server.Main.Control;
import java.net.Socket;
import static lecturemanagement.Server.Login.Control.ReceiveClientLogin.OnlineSocketList;
import static lecturemanagement.Server.Main.Control.SendLeactureToStudent.LectureClientSocket;
import lecturemanagement.ref;
import static lecturemanagement.Server.Main.Control.SendQuizSlideNumberEndLecture.SendQuizSlideNumberEndLectureSocket;
/**
*
* @author Amr
*/
public class LogoutStudent {
public void removeLogoutStudent(Socket socket) {
// from this socket from list
for (int i = 0; i < OnlineSocketList.size(); i++) {
if (OnlineSocketList.get(i).getInetAddress().toString().equals(socket.getInetAddress().toString())) {
// remove from online list
new RefreshOnlineList().remove(OnlineSocketList.get(i));
// remove from this list
OnlineSocketList.remove(i);
// refresh online counter
i--;
}
}
for (int i = 0; i < LectureClientSocket.size(); i++) {
if (LectureClientSocket.get(i).getInetAddress().toString().equals(socket.getInetAddress().toString())) {
LectureClientSocket.remove(i);
i--;
}
}
for (int i = 0; i < SendQuizSlideNumberEndLectureSocket.size(); i++) {
if (SendQuizSlideNumberEndLectureSocket.get(i).getInetAddress().toString().equals(socket.getInetAddress().toString())) {
SendQuizSlideNumberEndLectureSocket.remove(i);
i--;
}
}
ref.OnlineCounterText.setText(ref.OnlineNumberString + " (" + ref.onlineStudentVBox.getChildren().size() + ")");
}
}
| [
"saad.alenany@yahoo.com"
] | saad.alenany@yahoo.com |
9f976ef7b7167140dc8994471233ecf44da04dd0 | 7b7bb4b673a09b7786eceefb9af9b45fb4660d5f | /app/src/main/java/in/edu/firebasephoneotp/internationalflightreg.java | 983c62c5a66e6d2ff90210ac7c8c88b573890a5d | [] | no_license | samuelshan123/OTP | cad9a936fdd67c3880c5b2f400a30c7711a0457f | 8a00a22ea80f8212ec46045e68226b87c62f78a9 | refs/heads/master | 2022-11-07T15:23:38.252969 | 2020-06-12T10:58:04 | 2020-06-12T10:58:04 | 271,776,904 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 364 | java | package in.edu.firebasephoneotp;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
public class internationalflightreg extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_internationalflightreg);
}
} | [
"samuelshan123@gmail.com"
] | samuelshan123@gmail.com |
4ee76a7a273905e9cd992070df60950654ced6dd | 2626d42706cbe0402565a836e5457a2b11976bed | /scholarship/src/com/scholarship/service/scholarship/impl/ScholarshipServiceImpl.java | 2d09031d46ad53e5715da330b7a541b5233e43d3 | [] | no_license | nocater/scholarship | 3c4c541f2d617c27e620533221bd24c6865be13a | e8226cf2da9d391a0ce7073f0ce25df320f230fc | refs/heads/master | 2023-08-31T02:37:17.008777 | 2023-08-21T09:11:40 | 2023-08-21T09:11:40 | 55,274,336 | 23 | 11 | null | null | null | null | UTF-8 | Java | false | false | 1,683 | java | package com.scholarship.service.scholarship.impl;
import java.util.List;
import com.scholarship.dao.scholarship.ScholarshipDao;
import com.scholarship.module.scholarship.Scholarship;
import com.scholarship.service.impl.BaseServiceImpl;
import com.scholarship.service.scholarship.ScholarshipService;
/***
* 奖学金ServiceImpl
* Copyright (c) ${2016.4.1} write by 咖啡里安眠
*
* @author chenshuai
* @version 1.0
*/
public class ScholarshipServiceImpl extends BaseServiceImpl implements ScholarshipService{
public ScholarshipDao scholarshipDao;
@Override
public List<Scholarship> queryAll() {
// TODO Auto-generated method stub
return scholarshipDao.queryAll();
}
@Override
public Scholarship queryById(int id) {
// TODO Auto-generated method stub
return scholarshipDao.querybyId(id);
}
@Override
public List<String> queryCategories() {
// TODO Auto-generated method stub
return scholarshipDao.queryCategories();
}
@Override
public int insert(Scholarship scholarship) {
// TODO Auto-generated method stub
return scholarshipDao.insert(scholarship);
}
@Override
public int update(Scholarship scholarship) {
// TODO Auto-generated method stub
return scholarshipDao.update(scholarship);
}
@Override
public void delete(Scholarship scholarship) {
// TODO Auto-generated method stub
scholarshipDao.delete(scholarship);
}
@Override
public void deleteById(int id) {
// TODO Auto-generated method stub
scholarshipDao.deleteById(id);
}
public ScholarshipDao getScholarshipDao() {
return scholarshipDao;
}
public void setScholarshipDao(ScholarshipDao scholarshipDao) {
this.scholarshipDao = scholarshipDao;
}
}
| [
"cs781503542@qq.com"
] | cs781503542@qq.com |
ebd9a211f9aeda52f588ae13226080822f4ddf4f | a4f94f4701a59cafc7407aed2d525b2dff985c95 | /core/debug/languages/customViewers/source_gen/jetbrains/mps/debug/customViewers/behavior/FieldOperation_BehaviorDescriptor.java | 316815e566334b928d574d6ac57f696a8f8be362 | [] | no_license | jamice/code-orchestra-core | ffda62860f5b117386aa6455f4fdf61661abbe9e | b2bbf8362be2e2173864c294c635badb2e27ecc6 | refs/heads/master | 2021-01-15T13:24:53.517854 | 2013-05-09T21:39:28 | 2013-05-09T21:39:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,308 | java | package jetbrains.mps.debug.customViewers.behavior;
/*Generated by MPS */
import jetbrains.mps.lang.core.behavior.BaseConcept_BehaviorDescriptor;
import jetbrains.mps.baseLanguage.behavior.IOperation_BehaviorDescriptor;
import jetbrains.mps.smodel.SNode;
import jetbrains.mps.baseLanguage.behavior.IOperation_Behavior;
public class FieldOperation_BehaviorDescriptor extends BaseConcept_BehaviorDescriptor implements IOperation_BehaviorDescriptor {
public FieldOperation_BehaviorDescriptor() {
}
public boolean virtual_operandCanBeNull_323410281720656291(SNode thisNode) {
return IOperation_Behavior.virtual_operandCanBeNull_323410281720656291(thisNode);
}
public boolean virtual_isDotExpressionLegalAsStatement_1239212437413(SNode thisNode) {
return IOperation_Behavior.virtual_isDotExpressionLegalAsStatement_1239212437413(thisNode);
}
public String virtual_getVariableExpectedName_1213877410087(SNode thisNode) {
return IOperation_Behavior.virtual_getVariableExpectedName_1213877410087(thisNode);
}
public boolean virtual_isLValue_1213877410080(SNode thisNode) {
return IOperation_Behavior.virtual_isLValue_1213877410080(thisNode);
}
@Override
public String getConceptFqName() {
return "jetbrains.mps.debug.customViewers.structure.FieldOperation";
}
}
| [
"a.a.eliseyev@gmail.com"
] | a.a.eliseyev@gmail.com |
98d24fbf103eacde80ef8a96d123810cb911d967 | 87847d3efa7d3725a71d2b838af1484a0a946ddc | /src/main/java/com/mycompany/jee_jpa/Constants.java | ae2caef37f1bd54394fff31d8bb0d878451ada03 | [] | no_license | BenAzlay/jee-project-Version2 | 7c9592ad4ea95846dbe7889637b164c873af5eb7 | c00c805b95d0e832b290a38dea618fcb8d51c177 | refs/heads/master | 2022-07-15T06:29:35.627155 | 2020-01-02T12:54:25 | 2020-01-02T12:54:25 | 221,196,678 | 0 | 0 | null | 2022-06-21T02:33:02 | 2019-11-12T10:59:56 | Java | UTF-8 | Java | false | false | 976 | java | package com.mycompany.jee_jpa;
public class Constants {
public static final String QUERY_SEL_CREDENTIALS = "SELECT * from CREDENTIALS";
public static final String QUERY_SEL_EMPLOYEES = "SELECT * from JEEPRJ";
public static final String ERR_MISSING_FIELD = "You must enter values in both fields";
public static final String ERR_CONNECTION_FAILED = "Connection failed! Verify your login/password and try again";
public static final String JSP_HOME_PAGE = "WEB-INF/home.jsp";
public static final String JSP_WELCOME_PAGE = "WEB-INF/welcome.jsp";
public static final String JSP_DETAILS_PAGE = "WEB-INF/details.jsp";
public static final String JSP_ADD_PAGE = "WEB-INF/add.jsp";
public static final String JSP_GOODBYE_PAGE = "WEB-INF/goodbye.jsp";
public static final String FRM_LOGIN_FIELD = "loginField";
public static final String FRM_PWD_FIELD = "pwdField";
public static final String PROP_FILE_PATH = "/WEB-INF/db.properties";
} | [
"benjamin.azoulay@efrei.net"
] | benjamin.azoulay@efrei.net |
cdb4b5902bf118afd74149d5f99609f9973c7e8c | 3b708274620b8ce89b51568b9c6879a5de05c312 | /leetcode-part/双指针/快慢指针/[148]排序链表.java | 0e8066091072be62018007ac070aed447b63e1dc | [] | no_license | Zgxh/Algorithms-Ex. | 3ba91a24fd590888c23a0f95a92d218364343ea4 | 53499d76582d815ac3a208d0d04c1c1605138de7 | refs/heads/master | 2021-06-22T21:19:44.906170 | 2021-04-05T11:32:46 | 2021-04-05T11:32:46 | 212,730,913 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,392 | java | //在 O(n log n) 时间复杂度和常数级空间复杂度下,对链表进行排序。
//
// 示例 1:
//
// 输入: 4->2->1->3
//输出: 1->2->3->4
//
//
// 示例 2:
//
// 输入: -1->5->3->4->0
//输出: -1->0->3->4->5
// Related Topics 排序 链表
// 👍 712 👎 0
//leetcode submit region begin(Prohibit modification and deletion)
/**
* Definition for singly-linked list.
* public class ListNode {
* int val;
* ListNode next;
* ListNode(int x) { val = x; }
* }
*/
class Solution {
/**
* 递归的归并排序。
*
*/
public ListNode sortList(ListNode head) {
if (head == null || head.next == null) { // 子链表的长度小于等于 1
return head;
}
ListNode midNode = segmentList(head);
ListNode secondHead = midNode.next;
midNode.next = null; // 分割两个子链表
// 分别对两个子链表进行排序
ListNode first = sortList(head);
ListNode second = sortList(secondHead);
// 合并两个排序后的子链表
return merge(first, second);
}
// 利用快慢指针找到链表的中间结点
private ListNode segmentList(ListNode head) {
if (head == null || head.next == null) {
return head;
}
// ListNode dummy = new ListNode(-1);
// dummy.next = head;
// ListNode fast = dummy;
// ListNode slow = dummy;
ListNode slow = head, fast = head.next;
while (fast != null && fast.next != null) {
slow = slow.next;
fast = fast.next.next;
}
return slow;
}
// 合并两个排序后的子链表
private ListNode merge(ListNode head1, ListNode head2) {
ListNode result = new ListNode(-1);
ListNode pointer = result;
while (head1 != null && head2 != null) {
if (head1.val < head2.val) {
pointer.next = head1;
head1 = head1.next;
} else {
pointer.next = head2;
head2 = head2.next;
}
pointer = pointer.next;
}
if (head1 != null) {
pointer.next = head1;
} else if (head2 != null) {
pointer.next = head2;
}
return result.next;
}
}
//leetcode submit region end(Prohibit modification and deletion)
| [
"1227814546@qq.com"
] | 1227814546@qq.com |
e7e87c041b87578d229a80377009423f8e7cb5bd | 75484aeed789b170359575a3082b95c06c35c095 | /logon/src/main/java/com/aliyun/ayland/data/ATDeviceTslOutputDataType.java | 3fac7966590098ce99a1e7c895149af452cce411 | [] | no_license | 584393321/aite_longguang | abc1ed64bfd0d33c3638fb31c3777af054c2d8f5 | 97aade9d29a903a648c2cc4993a94d60d7b05820 | refs/heads/main | 2023-04-07T02:32:24.649736 | 2021-04-09T09:44:38 | 2021-04-09T09:44:38 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,949 | java | package com.aliyun.ayland.data;
import android.os.Parcel;
import android.os.Parcelable;
import com.alibaba.fastjson.JSONObject;
/**
* @author guikong on 18/4/12.
*/
public class ATDeviceTslOutputDataType implements Parcelable {
private JSONObject dataType;
private String identifier;
private String name;
public JSONObject getDataType() {
return dataType;
}
public void setDataType(JSONObject dataType) {
this.dataType = dataType;
}
public String getIdentifier() {
return identifier;
}
public void setIdentifier(String identifier) {
this.identifier = identifier;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Override
public String toString() {
return "ATDeviceTslOutputDataType{" +
"dataType=" + dataType +
", identifier='" + identifier + '\'' +
", name='" + name + '\'' +
'}';
}
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel out, int i) {
out.writeSerializable(dataType);
out.writeString(name);
out.writeString(identifier);
}
public static final Creator<ATDeviceTslOutputDataType> CREATOR = new Creator<ATDeviceTslOutputDataType>() {
@Override
public ATDeviceTslOutputDataType[] newArray(int size) {
return new ATDeviceTslOutputDataType[size];
}
@Override
public ATDeviceTslOutputDataType createFromParcel(Parcel in) {
return new ATDeviceTslOutputDataType(in);
}
};
public ATDeviceTslOutputDataType() {
}
public ATDeviceTslOutputDataType(Parcel in) {
dataType = (JSONObject) in.readSerializable();
name = in.readString();
identifier = in.readString();
}
}
| [
"584393321@qq.com"
] | 584393321@qq.com |
60b2ba9ca07571ad92ec1cbf3bd0a3d8220c5904 | 4b8f953f59124a82a4856a0a65ebec864a6f1df6 | /src/cn/dato/controller/LoginController.java | c70ed324b379294a0f9a51ef5e43284d6bc5757d | [] | no_license | visioncui/ssm | 32083f6b9aa630eca477c301fb3ec8ba8fc7647a | eb61a6d5bd304a9ccc33291dbd8004e3f6f560c5 | refs/heads/master | 2020-03-16T14:06:48.902402 | 2018-05-09T02:20:00 | 2018-05-09T05:52:45 | 132,707,899 | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 969 | java | package cn.dato.controller;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
@RequestMapping("/login")
public class LoginController {
//跳转到登录页面:
@RequestMapping("/login")
public String login() throws Exception{
return "login";
}
@RequestMapping("/submit")
public String submit(String username,String password,HttpServletRequest request) throws Exception {
HttpSession session = request.getSession();
//判断用户名密码的正确性,如果正确则将登录信息放入session中,这里简写,真正项目中需要去数据库中校验用户名及密码
if(username != null){
session.setAttribute("username", username);
}
//跳转到列表页
return "redirect:/items/list.action";
}
}
| [
"1048021678@qq.com"
] | 1048021678@qq.com |
11ac13454cd2b36ec96837c525ff682c48b387ca | 95b04aa8628883558f9612e32dddf7219d9809de | /apps/yms/app/src/main/java/org/onosproject/yms/app/ych/defaultcodecs/CodecHandlerFactory.java | b734239b157ccffe0fa00721de4b6846b09f4e1d | [
"Apache-2.0"
] | permissive | lsinfo3/nms-aware-onos | fb27413064dfc748e1c526e6c057805d0d5575d1 | bae0eeb10d6ae7559e0996535308039e9f0bc3c1 | refs/heads/master | 2021-09-04T03:28:29.001190 | 2016-11-30T06:29:48 | 2016-12-02T09:45:13 | 104,461,102 | 0 | 2 | Apache-2.0 | 2017-12-12T08:09:49 | 2017-09-22T10:10:55 | Java | UTF-8 | Java | false | false | 4,028 | java | /*
* Copyright 2016-present Open Networking Laboratory
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.yms.app.ych.defaultcodecs;
import org.onosproject.yms.app.ych.YchException;
import org.onosproject.yms.app.ych.defaultcodecs.xml.XmlCodecHandler;
import org.onosproject.yms.app.ych.defaultcodecs.xml.XmlCodecMultiInstanceHandler;
import org.onosproject.yms.app.ych.defaultcodecs.xml.XmlCodecMultiInstanceLeafHandler;
import org.onosproject.yms.app.ych.defaultcodecs.xml.XmlCodecSingleInstanceHandler;
import org.onosproject.yms.app.ych.defaultcodecs.xml.XmlCodecSingleInstanceLeafHandler;
import org.onosproject.yms.ych.YangProtocolEncodingFormat;
import org.onosproject.yms.ydt.YdtContext;
import org.onosproject.yms.ydt.YdtType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.HashMap;
import java.util.Map;
import static org.onosproject.yms.ych.YangProtocolEncodingFormat.XML;
import static org.onosproject.yms.ydt.YdtType.MULTI_INSTANCE_LEAF_VALUE_NODE;
import static org.onosproject.yms.ydt.YdtType.MULTI_INSTANCE_NODE;
import static org.onosproject.yms.ydt.YdtType.SINGLE_INSTANCE_LEAF_VALUE_NODE;
import static org.onosproject.yms.ydt.YdtType.SINGLE_INSTANCE_NODE;
/**
* Represents an YCH handle factory to create different types of YANG data tree
* node.
*/
public final class CodecHandlerFactory {
private static final Logger log =
LoggerFactory.getLogger(CodecHandlerFactory.class);
private static final String YDT_TYPE_ERROR = "YDT type is not supported.";
/**
* Map of xml codec handler.
*/
private final Map<YdtType, XmlCodecHandler> handlerMap;
/**
* Creates a new codec handler factory.
*/
private CodecHandlerFactory() {
handlerMap = new HashMap<>();
handlerMap.put(SINGLE_INSTANCE_NODE,
new XmlCodecSingleInstanceHandler());
handlerMap.put(MULTI_INSTANCE_NODE,
new XmlCodecMultiInstanceHandler());
handlerMap.put(SINGLE_INSTANCE_LEAF_VALUE_NODE,
new XmlCodecSingleInstanceLeafHandler());
handlerMap.put(MULTI_INSTANCE_LEAF_VALUE_NODE,
new XmlCodecMultiInstanceLeafHandler());
}
/**
* Returns YCH instance handler node instance.
*
* @param node YDT context node
* @param format data format type expected from driver
* @return returns YCH handler node instance
*/
public XmlCodecHandler getCodecHandlerForContext(
YdtContext node,
YangProtocolEncodingFormat format) {
if (format == XML) {
XmlCodecHandler handler = handlerMap.get(node.getYdtType());
if (handler == null) {
throw new YchException(YDT_TYPE_ERROR + node.getYdtType());
}
return handler;
}
log.error("{} data format is not supported.", format);
return null;
}
/*
* Bill Pugh Singleton pattern. INSTANCE won't be instantiated until the
* LazyHolder class is loaded via a call to the instance() method below.
*/
private static class LazyHolder {
private static final CodecHandlerFactory INSTANCE =
new CodecHandlerFactory();
}
/**
* Returns a reference to the Singleton Codec Handler factory.
*
* @return the singleton codec handler factory
*/
public static CodecHandlerFactory instance() {
return LazyHolder.INSTANCE;
}
}
| [
"gerrit@onlab.us"
] | gerrit@onlab.us |
562df7ce15aceebd37e89ef98f59d9cedd7de564 | 5c421819c71d44520e51bbd648c2ca89ff4295b8 | /src/main/java/com/acarasiov/vmsoft/dao/VendingMachineDaoInMemImpl.java | 5dc6b15bf9c2339111cc68c00a56bf3590f70f4c | [] | no_license | 020010898/Vending-Machine-Software | cad057a678328472bbbf85634a923d3463f54451 | ca6001ed24b1b1673d4298565c6bdd841bc9f41f | refs/heads/master | 2023-05-30T05:09:40.371797 | 2021-06-14T22:19:49 | 2021-06-14T22:19:49 | 375,477,471 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,207 | java | package com.acarasiov.vmsoft.dao;
import com.acarasiov.vmsoft.model.Item;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class VendingMachineDaoInMemImpl implements VendingMachineDao {
Map<Integer, Item> items;
public VendingMachineDaoInMemImpl() throws IOException {
ObjectMapper mapper = new ObjectMapper();
Item item = mapper.readValue(new File("D:\\projects\\input.json"), Item.class);
items = new HashMap<>();
for (int i = 0; i < item.getItems().size(); i++) {
item.getItems().get(i).setItemId(i);
items.put(item.getItems().get(i).getItemId(), item.getItems().get(i));
}
}
@Override
public void vendItem(Item item) {
int inventoryChange = item.getAmount();
inventoryChange--;
item.setAmount(inventoryChange);
}
@Override
public List<Item> getAllItems() {
return new ArrayList<Item>(items.values());
}
@Override
public Item getItemById(int itemId) {
return items.get(itemId);
}
}
| [
"a.carasiov19@gmail.com"
] | a.carasiov19@gmail.com |
cf74177b7a050a54949c685fe53805d0822ec4af | 673006389a2216555fc0f03fd3b3757f78a02454 | /Web_Cat-master/Bootstrap/src/net/sf/webcat/WCUpdater.java | 357884cf74d822a69946f6ffa2c31f034a7bc665 | [] | no_license | manasigore/my-projects | d2be7576ab4ccd1697dfaada577b90703704babf | e2add29036388a9d7ffc2e4519d8e85ffb5386cb | refs/heads/master | 2020-03-19T03:47:49.472749 | 2018-06-08T20:24:09 | 2018-06-08T20:24:09 | 135,763,670 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 26,705 | java | /*==========================================================================*\
| $Id: WCUpdater.java,v 1.2 2011/05/27 15:30:56 stedwar2 Exp $
|*-------------------------------------------------------------------------*|
| Copyright (C) 2006-2011 Virginia Tech
|
| This file is part of Web-CAT.
|
| Web-CAT is free software; you can redistribute it and/or modify
| it under the terms of the GNU Affero General Public License as published
| by the Free Software Foundation; either version 3 of the License, or
| (at your option) any later version.
|
| Web-CAT is distributed in the hope that it will be useful,
| but WITHOUT ANY WARRANTY; without even the implied warranty of
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
| GNU General Public License for more details.
|
| You should have received a copy of the GNU Affero General Public License
| along with Web-CAT; if not, see <http://www.gnu.org/licenses/>.
\*==========================================================================*/
package net.sf.webcat;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import java.util.Timer;
import java.util.TimerTask;
//-------------------------------------------------------------------------
/**
* This class runs and handles the update creation for webcat. It runs
* a background process which will continually check for updates.
*
* @author Travis Bale
* @author Last changed by $Author: stedwar2 $
* @version $Revision: 1.2 $, $Date: 2011/05/27 15:30:56 $
*/
public class WCUpdater
{
//~ Instance/static variables .............................................
private static WCUpdater instance = null;
private File downloadDir;
private File stagingDir;
private File updateDir;
private File frameworkDir;
private File mainBundle;
private Map<File, SubsystemUpdater> subsystems =
new HashMap<File, SubsystemUpdater>();
private Map<String, SubsystemUpdater> subsystemsByName =
new HashMap<String, SubsystemUpdater>();
private Map<String, Condition> updateFileConditions =
new HashMap<String, Condition>();
private static final String FRAMEWORK_SUBDIR1 =
"/Contents/Frameworks/Library/Frameworks";
private static final String FRAMEWORK_SUBDIR2 =
"/Contents/Library/Frameworks";
private static final String DOWNLOAD_SUBDIR = "pending-downloads";
private static final String STAGING_SUBDIR = "complete-downloads";
private static final String UPDATE_SUBDIR = "pending-updates";
//~ Public Constants ......................................................
/**
* The possible states for an update that is to be downloaded.
*/
public enum Condition {
DOWNLOAD_PENDING,
DOWNLOAD_COMPLETE,
UPDATE_PENDING,
UP_TO_DATE,
UPDATE_IS_AVAILABLE,
UNAVAILABLE
}
//~ Constructors ..........................................................
// ----------------------------------------------------------
/**
* Constructor.
*
* Cannot be called directly. Must use getInstance().
*/
private WCUpdater()
{
//Exists to prevent instantiation
}
// ----------------------------------------------------------
/**
* Gets an instance of this updater.
* @return An instance of the updater
*/
public static WCUpdater getInstance()
{
if(instance == null)
{
instance = new WCUpdater();
}
return instance;
}
//~ Public Methods ........................................................
// ----------------------------------------------------------
/**
* Accessor for the download directory
* @return the download directory
*/
public File getDownloadDir()
{
return downloadDir;
}
// ----------------------------------------------------------
/**
* Accessor for the staging directory
* @return the staging directory
*/
public File getStagingDir()
{
return stagingDir;
}
// ----------------------------------------------------------
/**
* Accessor for the update directory
* @return the update directory
*/
public File getUpdateDir()
{
return updateDir;
}
// ----------------------------------------------------------
/**
* Accessor for the framework directory
* @return the framework directory
*/
public File getFrameworkDir()
{
return frameworkDir;
}
// ----------------------------------------------------------
/**
* Accessor for the main bundle
* @return the main bundle
*/
public File getMainBundle()
{
return mainBundle;
}
// ----------------------------------------------------------
/**
* Schedules and starts the update.
*/
public void startBackgroundUpdaterThread(long delay, long period)
{
TimerTask updateTask = new TimerTask()
{
public void run()
{
getInstance().createUpdate();
FeatureProvider.refreshProviderRegistry();
getInstance().refreshSubsystemUpdaters();
}
};
Timer timer = new Timer();
timer.schedule(updateTask, delay, period);
}
// ----------------------------------------------------------
/**
* Sets up the update directories and sets the current file conditions.
* @param webInfDir The WEB-INF directory file
*/
public void setup(File webInfDir)
{
//Create the Directories needed for the Updater
downloadDir = new File(webInfDir, DOWNLOAD_SUBDIR);
stagingDir = new File(webInfDir, STAGING_SUBDIR);
updateDir = new File(webInfDir, UPDATE_SUBDIR);
if (webInfDir.isDirectory())
{
for (File bundleSearchDir : webInfDir.listFiles())
{
if (bundleSearchDir.isDirectory()
&& bundleSearchDir.getName().endsWith(".woa"))
{
mainBundle = new File(bundleSearchDir, "Contents");
frameworkDir = new File(
bundleSearchDir.getAbsolutePath()
+ FRAMEWORK_SUBDIR1);
if (!frameworkDir.exists())
{
frameworkDir = new File(
bundleSearchDir.getAbsolutePath()
+ FRAMEWORK_SUBDIR2);
}
break;
}
}
}
if (!downloadDir.exists())
{
downloadDir.mkdirs();
}
if(!stagingDir.exists())
{
stagingDir.mkdirs();
}
if (!updateDir.exists())
{
updateDir.mkdirs();
}
//Load the Conditions
for(File jar : downloadDir.listFiles())
{
updateFileConditions.put(
jar.getName(), Condition.DOWNLOAD_PENDING);
}
for(File jar : stagingDir.listFiles())
{
updateFileConditions.put(
jar.getName(), Condition.DOWNLOAD_COMPLETE);
}
for(File jar : updateDir.listFiles())
{
updateFileConditions.put(
jar.getName(), Condition.UPDATE_PENDING);
}
}
// ----------------------------------------------------------
/**
* Access the collection of subsystems in this application.
* @return a collection of {@link SubsystemUpdater} objects representing
* the available subsystems
*/
public Collection<SubsystemUpdater> subsystems()
{
return subsystems.values();
}
// ----------------------------------------------------------
/**
* Get the {@link SubsystemUpdater} for the specified subsystem location.
* Creates a new updater on demand, if necessary.
* @param dir the subsystem location to look up
* @return the corresponding updater
*/
public SubsystemUpdater getUpdaterFor(File dir)
{
SubsystemUpdater updater = null;
if (dir != null)
{
updater = subsystems.get(dir);
if (updater == null)
{
updater = new SubsystemUpdater(dir);
subsystems.put(dir, updater);
if (updater.name() != null)
{
subsystemsByName.put(updater.name(), updater);
}
}
}
return updater;
}
// ----------------------------------------------------------
/**
* Returns the condition of the specified filename.
*
* @param filename The update file's name
* @return The condition of the specified file.
*/
public Condition getFileConditionFor(String filename)
{
return updateFileConditions.get(filename);
}
// ----------------------------------------------------------
/**
* Log an informational message. This implementation sends output
* to {@link System#out}.
* @param msg the message to log.
*/
public static void logInfo(String msg)
{
System.out.println( msg );
}
// ----------------------------------------------------------
/**
* Log an error message. This implementation sends output
* to {@link System#out}, but provides a hook so that subclasses
* can use Log4J (we don't use that here, so that the Log4J library
* can be dynamically updatable through subsystems).
* @param msg the message to log
*/
public static void logError(Class<?> reference, String msg)
{
String className = reference.getName();
int pos = className.lastIndexOf('.');
if (pos >= 0)
{
className = className.substring(pos + 1);
}
System.out.println(className + ": ERROR: " + msg);
}
// ----------------------------------------------------------
/**
* Log an error message. This implementation sends output
* to {@link System#out}, but provides a hook so that subclasses
* can use Log4J (we don't use that here, so that the Log4J library
* can be dynamically updatable through subsystems).
* @param msg the message to log
* @param exception an optional exception that goes with the message
*/
public static void logError(
Class<?> reference, String msg, Throwable exception)
{
logError(reference, msg);
System.out.println(exception);
}
//~ Private Methods .......................................................
// ----------------------------------------------------------
/**
* Creates an update by downloading the newest versions of the
* subsystems and preparing the update directory with an update
* that can be applied.
*/
private void createUpdate()
{
logInfo("Download all updates");
// Download the updates
boolean downloadSuccessful = downloadNewUpdates();
FileUtilities.deleteOlderFiles(stagingDir);
logInfo("\nMoving updates that can be applied to pending-updates "
+ "directory.");
// Prepare the update
if(downloadSuccessful)
{
prepareFullUpdate();
}
else
{
preparePartialUpdate();
}
FileUtilities.deleteOlderFiles(updateDir);
}
// ----------------------------------------------------------
/**
* If automatic updates are turned on, scan all current subsystems and
* download any new versions of update files that are available.
* @param aFrameworkDir The directory where all subsystems are located
* @param mainBundle The main bundle location
* @return true if no errors occurred while downloading
*/
private boolean downloadNewUpdates()
{
boolean successfulDownload = true;
for (File subdir : frameworkDir.listFiles())
{
if(!downloadUpdateIfNecessary(getUpdaterFor(subdir)))
{
successfulDownload = false;
}
}
// Now handle the application update, if available
if(!downloadUpdateIfNecessary( getUpdaterFor(mainBundle) ))
{
successfulDownload = false;
}
// Now check through existing subsystems and check for any required
// subsystems that are not yet installed
for (SubsystemUpdater thisUpdater : subsystems.values())
{
String requires = thisUpdater.getProperty("requires");
if (thisUpdater.providerVersion() != null)
{
requires =
thisUpdater.providerVersion().getProperty("requires");
}
else
{
logError(getClass(), "Unable to read from provider.");
}
if (requires != null)
{
for (String requiredSubsystem : requires.split( ",\\s*" ))
{
if (!subsystemsByName.containsKey(requiredSubsystem))
{
// A required subsystem is not present, so find it
// and download it
logInfo( "Installed subsystem "
+ thisUpdater.name() + " requires subsystem "
+ requiredSubsystem
+ ", which is not installed.");
// First, look in the subsystem's provider
FeatureDescriptor newSubsystem;
try
{
newSubsystem = thisUpdater.provider()
.subsystemDescriptor(requiredSubsystem);
}
catch (IOException e)
{
newSubsystem = null;
}
if (newSubsystem == null)
{
// OK, look in all providers for it
for (FeatureProvider fp :
FeatureProvider.providers())
{
newSubsystem = fp.subsystemDescriptor(
requiredSubsystem);
if (newSubsystem != null)
{
break;
}
}
}
if (newSubsystem == null)
{
logInfo("Cannot identify provider for subsystem "
+ requiredSubsystem);
successfulDownload = false;
}
else
{
try
{
String filename = newSubsystem.name + "_"
+ newSubsystem.currentVersion() + ".jar";
Condition fileCondition =
updateFileConditions.get(filename);
if (fileCondition !=
Condition.DOWNLOAD_COMPLETE
&& fileCondition !=
Condition.UPDATE_PENDING)
{
updateFileConditions.put(
filename, Condition.DOWNLOAD_PENDING);
newSubsystem.downloadTo(
downloadDir, stagingDir);
updateFileConditions.put(
filename, Condition.DOWNLOAD_COMPLETE);
}
else
{
logInfo(newSubsystem.name
+ " is already downloaded.");
}
}
catch (IOException c)
{
successfulDownload = false;
}
}
}
}
}
}
return successfulDownload;
}
// ----------------------------------------------------------
/**
* Check for any updates for the given subsystem, and download them.
* @param updater The {@link SubsystemUpdater} to download for
* @return true if download is successful
*/
private boolean downloadUpdateIfNecessary(SubsystemUpdater updater)
{
try
{
FeatureDescriptor latest = updater.providerVersion();
if (latest != null)
{
String filename =
latest.name + "_" + latest.currentVersion() + ".jar";
Condition fileCondition = updateFileConditions.get(filename);
if (fileCondition != Condition.DOWNLOAD_COMPLETE
&& fileCondition != Condition.UPDATE_PENDING)
{
updateFileConditions.put(
filename, Condition.DOWNLOAD_PENDING);
if (updater.downloadUpdateIfNecessary(
downloadDir, stagingDir))
{
updateFileConditions.put(
filename, Condition.DOWNLOAD_COMPLETE);
}
else
{
updateFileConditions.put(
filename, Condition.UP_TO_DATE);
}
}
else
{
logInfo(latest.name + " is already downloaded.");
}
}
}
catch (IOException e)
{
logError(getClass(), "Error occured during download." , e);
return false;
}
return true;
}
// ----------------------------------------------------------
/**
* Prepares for the update by moving all files from the staging
* directory to the update directory.
*/
private void prepareFullUpdate()
{
if (stagingDir.exists() && stagingDir.isDirectory())
{
for (File jar : stagingDir.listFiles())
{
for (String extension :
SubsystemUpdater.JAVA_ARCHIVE_EXTENSIONS)
{
if (jar.getName().endsWith(extension))
{
if(!jar.renameTo(new File(updateDir, jar.getName())))
{
logError(getClass(), "Unable to move "
+ jar.getName()
+ " from "
+ stagingDir.getAbsolutePath()
+ " to "
+ updateDir.getAbsolutePath());
}
else
{
updateFileConditions.put(
jar.getName(), Condition.UPDATE_PENDING);
logInfo("Moving "
+ jar.getName()
+ " from "
+ stagingDir.getAbsolutePath()
+ " to "
+ updateDir.getAbsolutePath());
}
}
}
}
}
}
// ----------------------------------------------------------
/**
* Prepares for the update by moving all files from the staging
* directory to the update directory. It only moves files that do
* not have requirements that have not been downloaded.
*/
private void preparePartialUpdate()
{
if (stagingDir.exists() && stagingDir.isDirectory())
{
File[] stagingFiles = stagingDir.listFiles();
for (int i = 0; i < stagingFiles.length; i++)
{
File jar = stagingFiles[i];
if (jar != null)
{
for (String extension :
SubsystemUpdater.JAVA_ARCHIVE_EXTENSIONS)
{
if (jar.getName().endsWith(extension))
{
String subsystemName = jar.getName();
subsystemName = subsystemName.substring(
0, subsystemName.indexOf("_"));
ArrayList<String> requires =
getRequirements(subsystemName);
ArrayList<Integer> positions =
new ArrayList<Integer>();
if (requires == null)
{
continue;
}
boolean canAddUpdate = true;
for (String requirement : requires)
{
Condition fileCondition =
updateFileConditions.get(requirement);
if (fileCondition ==
Condition.DOWNLOAD_COMPLETE)
{
for(int j = i + 1; j < stagingFiles.length;
j++)
{
String filename =
stagingFiles[j].getName();
if (requirement.equals(filename))
{
positions.add(j);
}
}
}
else if (
fileCondition != Condition.UPDATE_PENDING
&& fileCondition != Condition.UP_TO_DATE)
{
canAddUpdate = false;
break;
}
}
//Move file and requirements to updateDir
if (canAddUpdate)
{
if (!jar.renameTo(new File(
updateDir, jar.getName())))
{
logError(getClass(), "Unable to move "
+ jar.getName()
+ " from "
+ stagingDir.getAbsolutePath()
+ " to "
+ updateDir.getAbsolutePath());
}
else
{
updateFileConditions.put(
jar.getName(),
Condition.UPDATE_PENDING);
logInfo("Moving "
+ jar.getName()
+ " from "
+ stagingDir.getAbsolutePath()
+ " to "
+ updateDir.getAbsolutePath());
}
stagingFiles[i] = null;
for (int pos : positions)
{
if (stagingFiles[pos].renameTo(
new File(updateDir,
stagingFiles[pos].getName())))
{
logError(getClass(), "Unable to move "
+ stagingFiles[pos].getName()
+ " from "
+ stagingDir.getAbsolutePath()
+ " to "
+ updateDir.getAbsolutePath());
}
else
{
updateFileConditions.put(
stagingFiles[pos].getName(),
Condition.UPDATE_PENDING);
logInfo("Moving "
+ stagingFiles[pos].getName()
+ " from "
+ stagingDir.getAbsolutePath()
+ " to "
+ updateDir.getAbsolutePath());
}
stagingFiles[pos] = null;
}
}
}
}
}
}
}
}
// ----------------------------------------------------------
/**
* Refresh the subsystems collection so that it reflects the new
* updates (intended to be called after downloading/applying pending
* updates).
* @param aFrameworkDir The directory where all subsystems are located
* @param mainBundle The main bundle location
*/
private void refreshSubsystemUpdaters()
{
// Clear out old values
subsystems = new HashMap<File, SubsystemUpdater>();
subsystemsByName = new HashMap<String, SubsystemUpdater>();
updateFileConditions = new HashMap<String, Condition>();
// Look up the updater for each framework
for (File dir : frameworkDir.listFiles())
{
getUpdaterFor(dir);
}
// Now create the updater for the main bundle
getUpdaterFor(mainBundle);
// Load file conditions
for (File jar : downloadDir.listFiles())
{
updateFileConditions.put(
jar.getName(), Condition.DOWNLOAD_PENDING);
}
for (File jar : stagingDir.listFiles())
{
updateFileConditions.put(
jar.getName(), Condition.DOWNLOAD_COMPLETE);
}
for (File jar : updateDir.listFiles())
{
updateFileConditions.put(jar.getName(), Condition.UPDATE_PENDING);
}
}
// ----------------------------------------------------------
/**
* Gets a list of all required subsystems need by the specified subsystem.
*
* @param subsystem The name of the subsystem who's requirements we
* are checking.
* @return A list of a required subsystems. Returns null if no
* connection can be made with the provider.
*/
private ArrayList<String> getRequirements(String subsystem)
{
SubsystemUpdater updater = subsystemsByName.get(subsystem);
ArrayList<String> requires = new ArrayList<String>();
if (updater != null)
{
String required;
if (updater.providerVersion() != null)
{
required = updater.providerVersion().getProperty("requires");
}
else
{
return null;
}
if (required != null)
{
for (String requiredSubsystem : required.split( ",\\s*" ))
{
ArrayList<String> temp =
getRequirements(requiredSubsystem);
if (temp == null)
{
return null;
}
SubsystemUpdater requiredUpdater =
subsystemsByName.get(requiredSubsystem);
if (requiredUpdater == null)
{
return null;
}
requiredSubsystem +=
"_" + requiredUpdater.currentVersion() + ".jar";
requires.addAll(temp);
if (!requires.contains(requiredSubsystem))
{
requires.add(requiredSubsystem);
}
}
}
}
else
{
return null;
}
return requires;
}
}
| [
"manasi.gore490@gmail.com"
] | manasi.gore490@gmail.com |
30c63f59ad389af030baf27295974c3e822c9ce7 | 28bee3beb9632b8f344957caae6490e71ba85d64 | /CSVM-Modelling-and-Validation/src/org.activiti.designer.model.edit/src/org/eclipse/bpmn2/provider/SignalEventDefinitionItemProvider.java | 3219b2e898ade3869b2c2df652837b97ca32697a | [
"Apache-2.0"
] | permissive | AniketosEU/Security-Service-Validation-and-Verification | c37672458719b83a405f436d233997cf25491f28 | d5381915e183788c09af6d69035409f9424527bc | refs/heads/master | 2021-03-12T20:18:16.363883 | 2015-06-15T07:25:54 | 2015-06-15T07:25:54 | 15,805,871 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,573 | java | /**
* <copyright>
*
* Copyright (c) 2010 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:
* Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation
*
* </copyright>
*/
package org.eclipse.bpmn2.provider;
import java.util.Collection;
import java.util.List;
import org.eclipse.bpmn2.Bpmn2Package;
import org.eclipse.bpmn2.SignalEventDefinition;
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
import org.eclipse.emf.edit.provider.IItemLabelProvider;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.IItemPropertySource;
import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
/**
* This is the item provider adapter for a {@link org.eclipse.bpmn2.SignalEventDefinition} object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public class SignalEventDefinitionItemProvider extends
EventDefinitionItemProvider implements IEditingDomainItemProvider,
IStructuredItemContentProvider, ITreeItemContentProvider,
IItemLabelProvider, IItemPropertySource {
/**
* This constructs an instance from a factory and a notifier.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public SignalEventDefinitionItemProvider(AdapterFactory adapterFactory) {
super(adapterFactory);
}
/**
* This returns the property descriptors for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
if (itemPropertyDescriptors == null) {
super.getPropertyDescriptors(object);
addSignalRefPropertyDescriptor(object);
}
return itemPropertyDescriptors;
}
/**
* This adds a property descriptor for the Signal Ref feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addSignalRefPropertyDescriptor(Object object) {
itemPropertyDescriptors.add(createItemPropertyDescriptor(
((ComposeableAdapterFactory) adapterFactory)
.getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_SignalEventDefinition_signalRef_feature"),
getString("_UI_PropertyDescriptor_description",
"_UI_SignalEventDefinition_signalRef_feature",
"_UI_SignalEventDefinition_type"),
Bpmn2Package.Literals.SIGNAL_EVENT_DEFINITION__SIGNAL_REF,
true, false, true, null, null, null));
}
/**
* This returns SignalEventDefinition.gif.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object getImage(Object object) {
return overlayImage(
object,
getResourceLocator().getImage(
"full/obj16/SignalEventDefinition"));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected boolean shouldComposeCreationImage() {
return true;
}
/**
* This returns the label text for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String getText(Object object) {
String label = ((SignalEventDefinition) object).getId();
return label == null || label.length() == 0 ? getString("_UI_SignalEventDefinition_type")
: getString("_UI_SignalEventDefinition_type") + " " + label;
}
/**
* This handles model notifications by calling {@link #updateChildren} to update any cached
* children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void notifyChanged(Notification notification) {
updateChildren(notification);
super.notifyChanged(notification);
}
/**
* This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
* that can be created under this object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected void collectNewChildDescriptors(
Collection<Object> newChildDescriptors, Object object) {
super.collectNewChildDescriptors(newChildDescriptors, object);
}
}
| [
"adbrucker@0x5f.org"
] | adbrucker@0x5f.org |
95e16d9c4a64729f6f20287b131a5a17ce3e5ed5 | 61d998c89d696127c977d2cf18a8542327b1903a | /Lab7/app/src/main/java/edu/temple/bookshelf/Book.java | 3f4e06f148e78b1e292d096ead9a8ca0e47ea1e0 | [] | no_license | elyordan/CIS3515 | b18afd44e6f6867ebccc84f4822abc833253bd72 | 22b18ac4981631034a9a6cbc39467224cca1df3b | refs/heads/main | 2023-04-26T20:24:20.029486 | 2021-05-12T18:49:13 | 2021-05-12T18:49:13 | 337,929,785 | 0 | 0 | null | 2021-05-12T18:49:13 | 2021-02-11T04:33:57 | Java | UTF-8 | Java | false | false | 324 | java | package edu.temple.bookshelf;
public class Book {
String title;
String author;
public Book(String title, String author) {
this.title = title;
this.author = author;
}
public String getTitle() {
return title;
}
public String getAuthor() {
return author;
}
}
| [
"elyordan_21@hotmail.com"
] | elyordan_21@hotmail.com |
fc20d9b5d11f537057ad35cc931ca244dbca957c | cf3a1e6683b9677c266e174d8d9edd06ee2f2065 | /src/test/java/com/zl/swaggerdemo/SwaggerDemoApplicationTests.java | 8d9502db2700696e1eecc739521e31727671a5e9 | [] | no_license | Toooooy/swaggerDemo | 36322050e12f9d1b97157efe39f8d248db49e490 | 7bf54674d3c8f880b20ebbbd01eeb2a68b97b4d6 | refs/heads/master | 2023-04-14T13:58:48.781731 | 2021-04-29T14:22:34 | 2021-04-29T14:22:34 | 362,837,385 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 224 | java | package com.zl.swaggerdemo;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class SwaggerDemoApplicationTests {
@Test
void contextLoads() {
}
}
| [
"958786642@qq.com"
] | 958786642@qq.com |
928673aa5399a1049a9a6778ce549a3bdd1068a3 | c8b1fc3b92efa7408f53cd512d0391fee06a893b | /Lessons/examples/ch32/EquationGeneratorJSON/src/java/com/deitel/equationgeneratorjson/Equation.java | 45e0fbe127130e6db6b1cb0cab9bf4eadbc90174 | [
"LicenseRef-scancode-warranty-disclaimer"
] | no_license | jonathanDase007/CTY-AP_CompSci | ca7602efeffc134d22fa9ed7c73512fa3806510f | 3b9741332578afe33090f12927eae7c9bd3ce984 | refs/heads/main | 2023-06-05T03:47:41.998909 | 2021-06-20T15:42:31 | 2021-06-20T15:42:31 | 378,681,706 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,342 | java | // Fig. 31.23: Equation.java
// Equation class that contains information about an equation.
package com.deitel.equationgeneratorjson;
public class Equation
{
private int leftOperand;
private int rightOperand;
private int result;
private String operationType;
// required no-argument constructor
public Equation()
{
this(0, 0, "add");
}
// constructor that receives the operands and operation type
public Equation(int leftValue, int rightValue, String type)
{
leftOperand = leftValue;
rightOperand = rightValue;
// determine result
if (type.equals("add")) // addition
{
result = leftOperand + rightOperand;
operationType = "+";
}
else if (type.equals("subtract")) // subtraction
{
result = leftOperand - rightOperand;
operationType = "-";
}
else
{
result = leftOperand * rightOperand;
operationType = "*";
}
}
// gets the leftOperand
public int getLeftOperand()
{
return leftOperand;
}
// required setter
public void setLeftOperand(int value)
{
leftOperand = value;
}
// gets the rightOperand
public int getRightOperand()
{
return rightOperand;
}
// required setter
public void setRightOperand(int value)
{
rightOperand = value;
}
// gets the resultValue
public int getResult()
{
return result;
}
// required setter
public void setResult(int value)
{
result = value;
}
// gets the operationType
public String getOperationType()
{
return operationType;
}
// required setter
public void setOperationType(String value)
{
operationType = value;
}
// returns the left hand side of the equation as a String
public String getLeftHandSide()
{
return leftOperand + " " + operationType + " " + rightOperand;
}
// returns the right hand side of the equation as a String
public String getRightHandSide()
{
return "" + result;
}
// returns a String representation of an Equation
public String toString()
{
return getLeftHandSide() + " = " + getRightHandSide();
}
}
/**************************************************************************
* (C) Copyright 1992-2018 by Deitel & Associates, Inc. and *
* Pearson Education, Inc. All Rights Reserved. *
* *
* DISCLAIMER: The authors and publisher of this book have used their *
* best efforts in preparing the book. These efforts include the *
* development, research, and testing of the theories and programs *
* to determine their effectiveness. The authors and publisher make *
* no warranty of any kind, expressed or implied, with regard to these *
* programs or to the documentation contained in these books. The authors *
* and publisher shall not be liable in any event for incidental or *
* consequential damages in connection with, or arising out of, the *
* furnishing, performance, or use of these programs. *
*************************************************************************/
| [
"76699669+jonathanDase007@users.noreply.github.com"
] | 76699669+jonathanDase007@users.noreply.github.com |
1fa28963baaf86fff2328078aedb7eee758204f0 | 97ebeefdb8a6dcde87dca115ae20679033d16eed | /src/arrays/No54.java | 38f9191824c1b9bf0a01e5da531ce889f2a79c6c | [] | no_license | rayyu999/LeetCode | 3bd2457b4f72b09e051100cd2da7bd0a8685b793 | d905aac77bc0939ff978e5492c4dceaf88a82ddf | refs/heads/master | 2023-06-16T18:51:20.709088 | 2021-07-14T15:42:24 | 2021-07-14T15:42:24 | 314,477,389 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,714 | java | package arrays;
import java.util.ArrayList;
import java.util.List;
public class No54 {
public List<Integer> spiralOrder(int[][] matrix) {
int r = matrix.length, c = matrix[0].length;
int[][] visited = new int[r][c];
int i = 0, j = 0, cnt = 0;
List<Integer> res = new ArrayList<>();
// 遍历整个矩阵
while (cnt < r * c) {
// 往右走
while (j < c && visited[i][j] == 0) {
res.add(matrix[i][j]);
++cnt;
visited[i][j] = 1;
++j;
}
// 扫描完一整行后指向上次访问元素下面的一个元素
--j;
++i;
// 往下走
while (i < r && visited[i][j] == 0) {
res.add(matrix[i][j]);
++cnt;
visited[i][j] = 1;
++i;
}
// 扫描完一整列后指向上次访问元素左边的一个元素
--i;
--j;
// 往左走
while (j >= 0 && visited[i][j] == 0) {
res.add(matrix[i][j]);
++cnt;
visited[i][j] = 1;
--j;
}
// 扫描完一整行后指向上次访问元素上面的一个元素
++j;
--i;
// 往上走
while (i >= 0 && visited[i][j] == 0) {
res.add(matrix[i][j]);
++cnt;
visited[i][j] = 1;
--i;
}
// 扫描完一整行后指向上次访问元素左边的一个元素
++i;
++j;
}
return res;
}
}
| [
"411205547@qq.com"
] | 411205547@qq.com |
71214468f5b9421bc1fae4d6e940f02a166f461d | 47686bbdcf8be3ee0cda1442d32fd61465a917d3 | /ppl-schema/src/main/java/eu/primelife/ppl/policy/credential/impl/ConditionType.java | 5047104873ebbd6b782dc96f1d299e1fc6800172 | [] | no_license | jjsendor/fiware-ppl | f08e8cb2e7336eaae39389936cab58cfc931a09a | 841b01e89b929c1104b5689a23bb826337183646 | refs/heads/master | 2021-01-09T07:03:00.610271 | 2014-04-30T14:09:06 | 2014-04-30T14:09:06 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 11,053 | java | /*******************************************************************************
* Copyright (c) 2013, SAP AG
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* - Neither the name of the SAP AG nor the names of its contributors may
* be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
******************************************************************************/
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v3.0-03/04/2009 09:20 AM(valikov)-fcs
// 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: 2010.11.03 at 09:58:45 AM CET
//
package eu.primelife.ppl.policy.credential.impl;
import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.xml.bind.JAXBElement;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElementRef;
import javax.xml.bind.annotation.XmlType;
import eu.primelife.ppl.policy.xacml.impl.ActionAttributeDesignatorType;
import eu.primelife.ppl.policy.xacml.impl.ApplyType;
import eu.primelife.ppl.policy.xacml.impl.AttributeSelectorType;
import eu.primelife.ppl.policy.xacml.impl.AttributeValueType;
import eu.primelife.ppl.policy.xacml.impl.EnvironmentAttributeDesignatorType;
import eu.primelife.ppl.policy.xacml.impl.ExpressionType;
import eu.primelife.ppl.policy.xacml.impl.FunctionType;
import eu.primelife.ppl.policy.xacml.impl.ResourceAttributeDesignatorType;
import eu.primelife.ppl.policy.xacml.impl.SubjectAttributeDesignatorType;
import eu.primelife.ppl.policy.xacml.impl.VariableReferenceType;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.jvnet.hyperjaxb3.xml.bind.JAXBElementUtils;
import org.jvnet.jaxb2_commons.lang.Equals;
import org.jvnet.jaxb2_commons.lang.HashCode;
import org.jvnet.jaxb2_commons.lang.ToString;
import org.jvnet.jaxb2_commons.lang.builder.JAXBEqualsBuilder;
import org.jvnet.jaxb2_commons.lang.builder.JAXBHashCodeBuilder;
import org.jvnet.jaxb2_commons.lang.builder.JAXBToStringBuilder;
/**
* <p>Java class for ConditionType complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="ConditionType">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element ref="{urn:oasis:names:tc:xacml:2.0:policy:schema:os}Expression"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "ConditionType", propOrder = {
"expression"
})
@Entity(name = "eu.primelife.ppl.policy.credential.impl.ConditionType")
@Table(name = "CONDITIONTYPE")
@Inheritance(strategy = InheritanceType.JOINED)
public class ConditionType
implements Serializable, Equals, HashCode, ToString
{
@XmlElementRef(name = "Expression", namespace = "urn:oasis:names:tc:xacml:2.0:policy:schema:os", type = JAXBElement.class)
protected JAXBElement<?> expression;
@XmlAttribute(name = "Hjid")
protected Long hjid;
/**
* Gets the value of the expression property.
*
* @return
* possible object is
* {@link JAXBElement }{@code <}{@link SubjectAttributeDesignatorType }{@code >}
* {@link JAXBElement }{@code <}{@link AttributeSelectorType }{@code >}
* {@link JAXBElement }{@code <}{@link ResourceAttributeDesignatorType }{@code >}
* {@link JAXBElement }{@code <}{@link ExpressionType }{@code >}
* {@link JAXBElement }{@code <}{@link FunctionType }{@code >}
* {@link JAXBElement }{@code <}{@link ApplyType }{@code >}
* {@link JAXBElement }{@code <}{@link PrimelifeApplyType }{@code >}
* {@link JAXBElement }{@code <}{@link AttributeValueType }{@code >}
* {@link JAXBElement }{@code <}{@link CredentialAttributeDesignatorType }{@code >}
* {@link JAXBElement }{@code <}{@link ActionAttributeDesignatorType }{@code >}
* {@link JAXBElement }{@code <}{@link VariableReferenceType }{@code >}
* {@link JAXBElement }{@code <}{@link UndisclosedExpressionType }{@code >}
* {@link JAXBElement }{@code <}{@link EnvironmentAttributeDesignatorType }{@code >}
*
*/
@Transient
public JAXBElement<?> getExpression() {
return expression;
}
/**
* Sets the value of the expression property.
*
* @param value
* allowed object is
* {@link JAXBElement }{@code <}{@link SubjectAttributeDesignatorType }{@code >}
* {@link JAXBElement }{@code <}{@link AttributeSelectorType }{@code >}
* {@link JAXBElement }{@code <}{@link ResourceAttributeDesignatorType }{@code >}
* {@link JAXBElement }{@code <}{@link ExpressionType }{@code >}
* {@link JAXBElement }{@code <}{@link FunctionType }{@code >}
* {@link JAXBElement }{@code <}{@link ApplyType }{@code >}
* {@link JAXBElement }{@code <}{@link PrimelifeApplyType }{@code >}
* {@link JAXBElement }{@code <}{@link AttributeValueType }{@code >}
* {@link JAXBElement }{@code <}{@link CredentialAttributeDesignatorType }{@code >}
* {@link JAXBElement }{@code <}{@link ActionAttributeDesignatorType }{@code >}
* {@link JAXBElement }{@code <}{@link VariableReferenceType }{@code >}
* {@link JAXBElement }{@code <}{@link UndisclosedExpressionType }{@code >}
* {@link JAXBElement }{@code <}{@link EnvironmentAttributeDesignatorType }{@code >}
*
*/
public void setExpression(JAXBElement<?> value) {
this.expression = ((JAXBElement<?> ) value);
}
/**
* Gets the value of the hjid property.
*
* @return
* possible object is
* {@link Long }
*
*/
@Id
@Column(name = "HJID")
@GeneratedValue(strategy = GenerationType.AUTO)
public Long getHjid() {
return hjid;
}
/**
* Sets the value of the hjid property.
*
* @param value
* allowed object is
* {@link Long }
*
*/
public void setHjid(Long value) {
this.hjid = value;
}
@SuppressWarnings("unchecked")
@Basic
@Column(name = "EXPRESSIONNAME")
public String getExpressionName() {
if (this.getExpression() instanceof JAXBElement) {
return JAXBElementUtils.getName(((JAXBElement<ExpressionType> ) this.getExpression()));
} else {
return null;
}
}
public void setExpressionName(String target) {
if (target!= null) {
setExpression(JAXBElementUtils.wrap(this.getExpression(), target, ExpressionType.class));
}
}
@SuppressWarnings("unchecked")
@ManyToOne(targetEntity = ExpressionType.class, cascade = {
CascadeType.ALL
})
@JoinColumn(name = "EXPRESSIONVALUE_CONDITIONTYP_0")
public ExpressionType getExpressionValue() {
if (this.getExpression() instanceof JAXBElement) {
return JAXBElementUtils.getValue(((JAXBElement<ExpressionType> ) this.getExpression()));
} else {
return null;
}
}
public void setExpressionValue(ExpressionType target) {
if (target!= null) {
setExpression(JAXBElementUtils.wrap(this.getExpression(), target));
}
}
public void equals(Object object, EqualsBuilder equalsBuilder) {
if (!(object instanceof ConditionType)) {
equalsBuilder.appendSuper(false);
return ;
}
if (this == object) {
return ;
}
final ConditionType that = ((ConditionType) object);
equalsBuilder.append(this.getExpression(), that.getExpression());
}
public boolean equals(Object object) {
if (!(object instanceof ConditionType)) {
return false;
}
if (this == object) {
return true;
}
final EqualsBuilder equalsBuilder = new JAXBEqualsBuilder();
equals(object, equalsBuilder);
return equalsBuilder.isEquals();
}
public void hashCode(HashCodeBuilder hashCodeBuilder) {
hashCodeBuilder.append(this.getExpression());
}
public int hashCode() {
final HashCodeBuilder hashCodeBuilder = new JAXBHashCodeBuilder();
hashCode(hashCodeBuilder);
return hashCodeBuilder.toHashCode();
}
public void toString(ToStringBuilder toStringBuilder) {
{
JAXBElement<?> theExpression;
theExpression = this.getExpression();
toStringBuilder.append("expression", theExpression);
}
}
public String toString() {
final ToStringBuilder toStringBuilder = new JAXBToStringBuilder(this);
toString(toStringBuilder);
return toStringBuilder.toString();
}
}
| [
"francesco.di.cerbo@sap.com"
] | francesco.di.cerbo@sap.com |
6d46bbfe19b32f7c8f64977b92195ba98b4176ad | 2e74c0d8a9b4b594f111008adb1abe3bfa023e4c | /src/diagramasUML/clase/Clase.java | 209342d7b85a460844df64e20b0e80225618c9a0 | [] | no_license | josearielpereyra/UMLTool | 64a9fc2d34979299ad80b6e3dcd3d5df10a0e635 | e51aaf71cf58e94d276137f262be8d17178619d7 | refs/heads/master | 2020-09-04T18:52:15.099058 | 2019-12-23T05:11:28 | 2019-12-23T05:11:28 | 219,856,476 | 0 | 0 | null | 2019-12-23T05:11:29 | 2019-11-05T21:46:03 | Java | UTF-8 | Java | false | false | 1,039 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package diagramasUML.clase;
import java.util.ArrayList;
/**
*
* @author josearielpereyra
*/
public class Clase {
private String nombre;
private ArrayList<Atributo> atributos;
private ArrayList<Metodo> metodos;
public Clase(String nombre, ArrayList<Atributo> atributos, ArrayList<Metodo> metodos) {
this.nombre = nombre;
this.atributos = atributos;
this.metodos = metodos;
}
public ArrayList<Metodo> getMetodos() {
return metodos;
}
public void setMetodos(ArrayList<Metodo> metodos) {
this.metodos = metodos;
}
public String getNombre() {
return nombre;
}
public void setNombre(String nombre) {
this.nombre = nombre;
}
public ArrayList<Atributo> getAtributos() {
return atributos;
}
public void setAtributos(ArrayList<Atributo> atributos) {
this.atributos = atributos;
}
}
| [
"josearielpereyra@gmail.com"
] | josearielpereyra@gmail.com |
0d8090e670abc357bc8e586bf77d96ab5a81b372 | da513aaebb4b6885fefda859948c886584dd9ef0 | /src/main/java/com/idus/backend/filter/JwtRequestFilter.java | 2a85d6d8257c033910f3bfa2d8840cc52e7bd1a5 | [] | no_license | tlsgud216/idus | 4fda6c81dc7c1927e9886b79a4c56236719da885 | c54ea7899daf25c1053431a3c0c39ad900f3c2a5 | refs/heads/main | 2023-08-05T18:31:16.424734 | 2021-09-23T01:49:37 | 2021-09-23T01:49:37 | 407,568,937 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,155 | java | package com.idus.backend.filter;
import com.idus.backend.config.JwtProperties;
import io.jsonwebtoken.Claims;
import io.jsonwebtoken.Jws;
import io.jsonwebtoken.Jwts;
import io.jsonwebtoken.security.Keys;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.web.authentication.www.BasicAuthenticationFilter;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
public class JwtRequestFilter extends BasicAuthenticationFilter {
private final JwtProperties jwtProperties;
public JwtRequestFilter(
AuthenticationManager authenticationManager,
JwtProperties jwtProperties
) {
super(authenticationManager);
this.jwtProperties = jwtProperties;
}
@Override
public void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain chain)
throws IOException, ServletException {
String header = request.getHeader("Authorization");
SecurityContextHolder.getContext().setAuthentication(getAuthentication(header));
chain.doFilter(request, response);
}
private UsernamePasswordAuthenticationToken getAuthentication(String token) {
try {
Jws<Claims> claims = Jwts.parserBuilder()
.setSigningKey(Keys.hmacShaKeyFor(jwtProperties.secret.getBytes(StandardCharsets.UTF_8)))
.build()
.parseClaimsJws(token);
ArrayList<GrantedAuthority> authorities = new ArrayList<>();
return new UsernamePasswordAuthenticationToken(claims.getBody().get("member_id"), null, authorities);
} catch (Exception e) {
return null;
}
}
}
| [
"tlsgud216@gmail.com"
] | tlsgud216@gmail.com |
c4ffd25982208a9249e988bf7820d36eeb7bc137 | 93d7a00c72d529d2c7c3f59a488254e015e2c8be | /src/main/java/com/abbachurch/app/service/package-info.java | cdb20d6198ee6732ab86b0fe3c5467845e164b77 | [] | no_license | BulkSecurityGeneratorProject/abba-church-web-app | 70f3ebbecaa0984cd648355a032fc4dc21fb97ba | cfb99fae77540c4becbb3d08c6aec95c6d3c7293 | refs/heads/master | 2022-12-16T22:57:56.989079 | 2020-03-18T00:29:30 | 2020-03-18T00:29:30 | 296,508,556 | 0 | 0 | null | 2020-09-18T03:57:03 | 2020-09-18T03:57:02 | null | UTF-8 | Java | false | false | 68 | java | /**
* Service layer beans.
*/
package com.abbachurch.app.service;
| [
"cghar1030@brandeis.edu"
] | cghar1030@brandeis.edu |
2fc700ac83a983c9a8b13f363c16ef2805b84896 | b0827517e55892db61bec2faa1d8e40eec7c3ea0 | /src/com/reactive/stream/flow/one/EmployeeSubscriber.java | 1703dea00c1804193928f3b6575a9ce589f34180 | [] | no_license | pranitkokne/Reactive-Stream | e5e8a57d733993fde81d873cbd7432768ee500de | 418c2b7a6f1c25281ed08dfac536b8ffdc264a60 | refs/heads/master | 2020-04-02T01:50:55.255075 | 2018-10-20T06:49:21 | 2018-10-20T06:49:21 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 912 | java | package com.reactive.stream.flow.one;
import java.util.concurrent.Flow.Subscriber;
import java.util.concurrent.Flow.Subscription;
public class EmployeeSubscriber implements Subscriber<Employee> {
private Subscription subscription;
private int counter = 0;
@Override
public void onSubscribe(Subscription subscription) {
System.out.println("Subscribed");
this.subscription = subscription;
this.subscription.request(3);
System.out.println("onSubscribe requested 3 item");
}
@Override
public void onNext(Employee item) {
System.out.println("Processing data : " + item);
counter++;
this.subscription.request(1);
}
@Override
public void onError(Throwable throwable) {
System.out.println("Some error occurred");
throwable.printStackTrace();
}
@Override
public void onComplete() {
System.out.println("All processing done");
}
public int getCounter() {
return counter;
}
}
| [
"pranitkokne2018@gmail.com"
] | pranitkokne2018@gmail.com |
dc0f6db085d5b38ba9ea42926cb727e945b641f2 | bacf8583a1ec75c7152c4c0efd8d18e5295a3dab | /src/main/java/br/ufc/quixada/publisher/PublisherRepository.java | b92f6436aba61e7a62d439b32650714f0e4a196a | [] | no_license | sergiorodriguesml/ifactory-springboot | 602fb5f58331c9e09f753d9d5cf93d88dcb8d4d5 | c14e5bfbf06dd8b61b20b2f2dd566df9e8f637b6 | refs/heads/master | 2021-01-01T15:20:44.086884 | 2017-07-19T19:35:25 | 2017-07-19T19:35:25 | 97,594,252 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 180 | java | package br.ufc.quixada.publisher;
import org.springframework.data.repository.CrudRepository;
public interface PublisherRepository extends CrudRepository<Publisher, Integer> {
}
| [
"sergiojuniorlimma@gmail.com"
] | sergiojuniorlimma@gmail.com |
db3e90779cef2a88d9ffcddb6c32314e445e436d | 4ea314add6fd97fd8132138fcd3d81c82d42e36d | /Gender.java | 0cbd42dad832ec98daacc66613949e5db76fd7e4 | [] | no_license | Denzil0991/NILSUH- | 2909593cc0f2f68b9a8b71444b60f7da6ad1ec8e | 265f926fbd17b28c527a76e10f4a043edaebcfb4 | refs/heads/main | 2023-03-25T23:47:26.974533 | 2020-12-03T14:32:28 | 2020-12-03T14:32:28 | 350,887,902 | 0 | 0 | null | 2021-03-23T23:38:02 | 2021-03-23T23:38:01 | null | UTF-8 | Java | false | false | 40 | java | public enum Gender {
MALE, FEMALE
}
| [
"noreply@github.com"
] | noreply@github.com |
c788165cd1aefe8907af32113a5ccd339b1e4e96 | d2d293e50ed9468e9071e32c7517bc924feef3d1 | /src/main/java/Polynom.java | 3e9b9c4408c61b1f1ac0df28164d6bc2e75a41bb | [] | no_license | tucaEmanuel18/IC-RC4-LFSR | 116d52d5d0e84d79c8088f563a63985c9a272f32 | 082c63a25633c73c8ca35616e452204b6bb53bc9 | refs/heads/master | 2023-04-09T01:57:39.145883 | 2021-04-19T13:50:14 | 2021-04-19T13:50:14 | 358,238,405 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,325 | java | import java.util.ArrayList;
import java.util.List;
public class Polynom {
private List<Integer> notNullPositions;
public Polynom(List<Integer> notNullPositions){
if(notNullPositions == null){
throw new NullPointerException();
}
if(notNullPositions.size() < 2){
throw new IllegalArgumentException("Polinomul trebuie sa aiba macar doua pozitii nenule!");
}
this.notNullPositions = new ArrayList<>();
boolean firstPosition = true;
for(Integer i : notNullPositions){
if(firstPosition){
firstPosition = false;
}else{
if(this.notNullPositions.get(this.notNullPositions.size() - 1) <= i){
throw new IllegalArgumentException("Pozitiile polinomului trebuie sa fie descrescatoare!");
}
}
this.notNullPositions.add(i);
}
}
public List<Integer> getNotNullPositions() {
return notNullPositions;
}
public int apply(List<Integer> input){
int result = input.get(notNullPositions.get(0)) ^ input.get(notNullPositions.get(1));
for(int i = 2; i < notNullPositions.size(); ++i){
result = result ^ input.get(notNullPositions.get(i));
}
return result;
}
}
| [
"emanuel.tuca@info.uaic.ro"
] | emanuel.tuca@info.uaic.ro |
18165563693f80d33a52c6583722bd8ed6df44e8 | 8c1dadb139b518cbe01c28e75299dd75a17845ee | /AI_BFS_15Puzzle/src/ai_bfs_15puzzle/SearchHandler.java | 212410ba153fd1cad8b1aaba812c3997391555c9 | [] | no_license | saikrishnakk/Artificial-Intelligence-Coursework-Assignments | 43daf41f4dfc46987416e9b797c642be75797b81 | 34d087b8dae1f45282aa73c15bc05cc3a29bcd62 | refs/heads/master | 2020-05-01T01:20:47.549121 | 2019-03-22T18:48:02 | 2019-03-22T18:48:02 | 177,193,240 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,892 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package ai_bfs_15puzzle;
import java.util.*;
import java.text.NumberFormat;
/**
*
* @author kksaikrishna
*/
public class SearchHandler {
public static final String GOAL_STATE = "123456789ABCDEFS";
ArrayList<String> visitedStates; //A structure that mainitains list of Visited States for convenience
ArrayList<NodeHandler> stateTree; //A structure that maintains list of visited states with their parent's index and depth level
Queue<NodeHandler> queue; //A queue to maintain the next states to be visited
//An object to class that finds next states
public SearchHandler()
{
visitedStates = new ArrayList<String>();
stateTree = new ArrayList<NodeHandler>();
queue = new LinkedList<>();
}
private int getDepthByNode(String node)
{
for(int i=0;i<stateTree.size();i++)
{
if(stateTree.get(i).getNode().equals(node))
{
return stateTree.get(i).getDepthLevel();
}
}
return -1;
}
private int getParentNodeIndexByNode(String node)
{
for(int i=0;i<stateTree.size();i++)
{
if(stateTree.get(i).getNode().equals(node))
{
return i;
}
}
return -1;
}
private boolean isGoalState(String state)
{
if(state.compareTo(GOAL_STATE)==0)
{
return true;
}
else
{
return false;
}
}
private void markVisited(String state, int parentNodeIndex, int depthLevel)
{
if(!state.isEmpty())
{
NodeHandler objNodeHandler = new NodeHandler(state,parentNodeIndex,depthLevel);
stateTree.add(objNodeHandler);
visitedStates.add(state);
queue.remove();
}
}
private void markVisited(NodeHandler state)
{
if(state!=null)
{
stateTree.add(state);
visitedStates.add(state.getNode());
queue.remove();
}
}
private void addToQueue(String state, int parentNodeIndex, int depthLevel)
{
NodeHandler obj = new NodeHandler(state,parentNodeIndex,depthLevel);
queue.add(obj);
}
public ArrayList<NodeHandler> search(String initialState)
{
ArrayList<String> nextStates = new ArrayList<String>();
StateHandler objStateHandler = new StateHandler();
String parentState = initialState;
int i = 0,parentNodeIndex=0,depthLevel=0;
addToQueue(initialState,parentNodeIndex,depthLevel);
markVisited(initialState,parentNodeIndex,depthLevel);
if(isGoalState(initialState))
{
return stateTree;
}
else
{
do
{
parentNodeIndex = getParentNodeIndexByNode(parentState);
depthLevel = getDepthByNode(parentState)+1;
nextStates = objStateHandler.computeNextStates(parentState, visitedStates);
for(i=0;i<nextStates.size();i++)
{
addToQueue(nextStates.get(i),parentNodeIndex,depthLevel);
if(isGoalState(nextStates.get(i)))
{
markVisited(nextStates.get(i),parentNodeIndex,depthLevel);
return stateTree;
}
}
parentState = queue.peek().getNode();
markVisited(queue.peek());
}while(!queue.isEmpty());
}
return null;
}
}
| [
"kksaikrishna@KKs-MacBook-Air.local"
] | kksaikrishna@KKs-MacBook-Air.local |
1f647b3b2523c6dfb8d7ed49d5d6d58c651184ed | 5c84e0cbd0104f14b258a7dc29634fd1e232aa55 | /FileIOExceptionHandling/copy file form one dir to another.java | 8cf9bfb360e6bd5f029c50e1dcdb5273ccbf824b | [] | no_license | srujanvesh/MS-AU-19 | a1f50ea5c4af81afc3a2382d7f62460199176d0a | 61dc89bb63dc5466eea5502a0474e8a6dd057702 | refs/heads/master | 2023-01-07T14:01:15.018466 | 2019-06-23T14:33:07 | 2019-06-23T14:33:07 | 192,156,651 | 0 | 0 | null | 2023-01-07T06:38:49 | 2019-06-16T06:10:25 | Java | UTF-8 | Java | false | false | 600 | java |
//day2 que4
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
public class que4 {
public static void main(String args[])
throws FileNotFoundException,IOException
{
FileInputStream fis = new FileInputStream("C:\\Users\\kotha.srujanvesh\\Desktop\\abc.txt");
FileOutputStream fos = new FileOutputStream("C:\\Users\\kotha.srujanvesh\\Desktop\\xyz\\def.txt");
int b;
while ((b=fis.read()) != -1)
fos.write(b);
fis.close();
fos.close();
}
}
| [
"kotha.srujanvesh@accolite.com"
] | kotha.srujanvesh@accolite.com |
13f4a7c8aab71a3cb25af365d2f68411770f569b | 6f0c3d8042b12ef8927fbe37b6121ffbdcd545ad | /src/Drone/src/DronePk/CommandsRecorder.java | f31e6045341081230b6e73004066f6a110dc1cbc | [] | no_license | giannigrasso/Drone | c4f2bacf22cde6150591e736324061c2d3ef1d6e | 95851c7016dd693a0721cadba909b5cc8896dd42 | refs/heads/main | 2023-02-13T00:48:12.547183 | 2022-11-01T23:01:17 | 2022-11-01T23:01:17 | 329,614,565 | 0 | 1 | null | 2021-01-14T12:51:55 | 2021-01-14T12:51:55 | null | UTF-8 | Java | false | false | 1,381 | java | package DronePk;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.StandardOpenOption;
/**
* Classe che registra in dei file le sequenze dei comandi. In questo modo e'
* possibile riprenderle piu' tardi per farle rieseguire al drone.
*
* @author Samuele Ganci
* @version 25 marzo 2021
*/
public class CommandsRecorder {
/**
* Costante per il percorso del file.
*/
public static final String root = "SequencesRecorded";
/**
* Variabile per la Path file.
*/
private Path file;
/**
* Metodo che si occupa di registrare la sequenza di comandi.
*
* @param fileName Il nome del file.
*/
public CommandsRecorder(String fileName) {
file = Paths.get(root + "/" + fileName + ".txt");
try {
Files.write(file, "".getBytes());
} catch (IOException e) {
System.out.println("Error:" + e);
}
}
/**
* Metodo che si occuopa di scrivere la sequenza.
*
* @param sequence sequenza da scrivere nel file.
*/
public void sequenceWriter(String sequence) {
try {
Files.write(file, ((sequence + "\r\n")).getBytes(), StandardOpenOption.APPEND);
} catch (IOException e) {
System.out.println("Error:" + e);
}
}
}
| [
"gianni.grasso@samtrevano.ch"
] | gianni.grasso@samtrevano.ch |
e20881a10221682e2c677b68a2c2d3df1c15574a | 1b225268153d753fdc98cbdd528526096b730a80 | /app/src/main/java/com/teacore/teascript/team/fragment/TeamActiveListFragment.java | 75bd031b955076459b08763f0b88f1f23f2637cb | [] | no_license | leonchen891029/TeaScript-Android-App | 6b1b0ac0d5baf0b4c9e9382cf0d06b6c6f036db8 | e982777d5da338af8fa25038bb702b96ab442a45 | refs/heads/master | 2020-03-15T04:33:41.303163 | 2018-05-04T05:45:24 | 2018-05-04T05:45:24 | 131,968,487 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,783 | java | package com.teacore.teascript.team.fragment;
import android.app.Activity;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import com.teacore.teascript.base.BaseListFragment;
import com.teacore.teascript.network.remote.TeaScriptApi;
import com.teacore.teascript.team.activity.TeamMainActivity;
import com.teacore.teascript.team.adapter.TeamActiveAdapter;
import com.teacore.teascript.team.bean.Team;
import com.teacore.teascript.team.bean.TeamActive;
import com.teacore.teascript.team.bean.TeamActiveList;
import com.teacore.teascript.util.UiUtils;
import com.teacore.teascript.util.TLog;
import com.teacore.teascript.util.XmlUtils;
import java.io.InputStream;
import java.io.Serializable;
import java.util.ArrayList;
/**Team动态界面
* @author 陈晓帆
* @version 1.0
* Created 2017-4-11
*/
public class TeamActiveListFragment extends BaseListFragment<TeamActive>{
public static final String BUNDLE_KEY_UID="UID";
public static final String ACTIVE_FRAGMENT_KEY="DynamicFragment";
public static final String ACTIVE_FRAGMENT_TEAM_KEY="DynamicFragmentTeam";
protected static final String TAG=TeamActiveListFragment.class.getSimpleName();
private static final String CACHE_KEY_PREFIX="DynamicFragment_list";
private Activity activity;
private Team team;
@Override
public void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
Bundle args=getArguments();
if(args!=null){
team=(Team) args.getSerializable(TeamMainActivity.BUNDLE_KEY_TEAM);
}
if(team==null){
team=new Team();
TLog.log(getClass().getSimpleName(),"team对象初始化异常");
}
}
@Override
public View onCreateView(LayoutInflater inflater,
@Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = super.onCreateView(inflater, container, savedInstanceState);
activity = getActivity();
return view;
}
@Override
public void initView(View view){
super.initView(view);
mListView.setDivider(new ColorDrawable(0x00000000));
mListView.setSelector(new ColorDrawable(0x00000000));
}
@Override
protected TeamActiveAdapter getListAdapter() {
return new TeamActiveAdapter(activity);
}
@Override
protected String getCacheKeyPrefix() {
return CACHE_KEY_PREFIX + "_" + team.getId() + "_" + mCurrentPage;
}
@Override
protected TeamActiveList parseList(InputStream inputStream) throws Exception{
TeamActiveList list= XmlUtils.toBean(TeamActiveList.class,inputStream);
if(list.getList()==null){
list.setActives(new ArrayList<TeamActive>());
}
return list;
}
@Override
protected TeamActiveList readList(Serializable seri){
return (TeamActiveList) seri;
}
@Override
protected void sendRequestData(){
TeaScriptApi.teamDynamic(team,mCurrentPage,mHandler);
}
@Override
public void onItemClick(AdapterView<?> parent, View view, int position,
long id) {
try {
TeamActive active = mAdapter.getItem(position);
if (active != null) {
UiUtils.showTeamActiveDetail(activity, team.getId(), active);
}
} catch (IndexOutOfBoundsException e) {
}
}
@Override
protected long getAutoRefreshTime() {
// 1小时间距,主动刷新列表
return 1 * 60 * 60;
}
}
| [
"331760621@qq.com"
] | 331760621@qq.com |
6da6c0c0c80bd259db1a19cf769272c8a019750a | 34cdc536778a9d90b07ba9438bc8204a107df9e1 | /Easy/MergeSortedArray/solution.java | 3b3131db6af0821a07b158a033e18060b387e87c | [] | no_license | devanshTandon00/LeetCode | 74e558bf7f320c052b5cc600fe14617aa005d46e | 9e35fceb6bd09846144d5379b906d395f3b6a6ef | refs/heads/master | 2023-03-31T06:06:31.460174 | 2021-04-14T17:02:34 | 2021-04-14T17:02:34 | 277,147,073 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 673 | java | class Solution {
public void merge(int[] nums1, int m, int[] nums2, int n) {
m--;
n--;
int k = nums1.length - 1;
while(k >= 0) {
if(m < 0) {
nums1[k] = nums2[n--];
}
else if(n< 0) {
nums1[k] = nums1[m--];
}
else{
if(nums1[m] > nums2[n]) {
nums1[k] = nums1[m--];
}
else{
nums1[k] = nums2[n--];
}
}
k--;
}
}
}
| [
"dtdansh@gmail.com"
] | dtdansh@gmail.com |
4ef78c7ec6564d34487977f4f8cd4abb97895ba3 | 5d1cd1c399ccf35a95aef9a3b33eb2ac33ccd81e | /excilys-bank-model/src/main/java/com/excilys/ebi/bank/model/entity/User.java | b5815aa067d926e4b6d734641cf2a7e42bca5cfb | [] | no_license | anote2011/excilys-bank | 0785625e638b2837f8787c9e3e808f559715409c | 22ba9a968a7e3f47485b06b0e7f4c58d59f65f8b | refs/heads/master | 2021-09-04T09:45:53.604607 | 2018-01-17T19:18:43 | 2018-01-17T19:18:43 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,460 | java | /**
* Copyright 2011-2012 eBusiness Information, Groupe Excilys (www.excilys.com)
*
* 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.excilys.ebi.bank.model.entity;
import static com.google.common.collect.Lists.newArrayList;
import java.io.Serializable;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.Table;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import com.excilys.ebi.bank.model.entity.ref.RoleRef;
@SuppressWarnings("serial")
@Entity
@Table(name = "USR")
@Getter
@Setter
@EqualsAndHashCode(of = "login", doNotUseGetters = true)
public class User implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "ID")
private Integer id;
@Column(name = "LOGIN", nullable = false, unique = true, length = 30)
private String login;
@Column(name = "FIRSTNAME", nullable = false, length = 30)
private String firstName;
@Column(name = "LASTNAME", nullable = false, length = 30)
private String lastName;
@Column(name = "PASSWORD", nullable = false, length = 30)
private String password;
@Column(name = "EMAIL", nullable = false, length = 30)
private String email;
@ManyToMany(cascade = CascadeType.ALL)
@JoinTable(name = "USR_ACCOUNT", joinColumns = { @JoinColumn(name = "USR_ID") }, inverseJoinColumns = { @JoinColumn(name = "ACCOUNT_ID") })
private List<Account> accounts = newArrayList();
@ManyToMany(cascade = CascadeType.ALL)
@JoinTable(name = "USR_ROLE", joinColumns = { @JoinColumn(name = "USR_ID") }, inverseJoinColumns = { @JoinColumn(name = "ROLE_ID") })
private List<RoleRef> roles = newArrayList();
}
| [
"slandelle+github@excilys.com"
] | slandelle+github@excilys.com |
44ecb91afc568d4216b7a2826bab0e3f37199de3 | 787ddbf84e401551f3022089c84e05833f81ac25 | /enforcer-parent/enforcer/src/main/gen/org/wso2/choreo/connect/discovery/api/SecuritySchemeProto.java | 29e82422e504904f36d247deff5c0065de35fa5a | [
"Apache-2.0",
"BSD-3-Clause",
"GPL-3.0-only",
"CDDL-1.0",
"MIT",
"LGPL-2.1-or-later",
"GPL-1.0-or-later",
"LGPL-3.0-only",
"GPL-1.0-only"
] | permissive | fazlan-nazeem/product-microgateway | 88c3a8c5405aa860c346310c5e7376f2941831a1 | cfa3e38e9be1cb504eac667222111f733cec2167 | refs/heads/main | 2023-06-25T10:09:17.896464 | 2021-10-26T03:34:29 | 2021-10-26T03:34:29 | 139,669,896 | 0 | 0 | Apache-2.0 | 2018-07-04T04:54:32 | 2018-07-04T04:54:32 | null | UTF-8 | Java | false | true | 2,185 | java | // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: wso2/discovery/api/security_scheme.proto
package org.wso2.choreo.connect.discovery.api;
public final class SecuritySchemeProto {
private SecuritySchemeProto() {}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistryLite registry) {
}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistry registry) {
registerAllExtensions(
(com.google.protobuf.ExtensionRegistryLite) registry);
}
static final com.google.protobuf.Descriptors.Descriptor
internal_static_wso2_discovery_api_SecurityScheme_descriptor;
static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_wso2_discovery_api_SecurityScheme_fieldAccessorTable;
public static com.google.protobuf.Descriptors.FileDescriptor
getDescriptor() {
return descriptor;
}
private static com.google.protobuf.Descriptors.FileDescriptor
descriptor;
static {
java.lang.String[] descriptorData = {
"\n(wso2/discovery/api/security_scheme.pro" +
"to\022\022wso2.discovery.api\"P\n\016SecurityScheme" +
"\022\026\n\016definitionName\030\001 \001(\t\022\014\n\004type\030\002 \001(\t\022\014" +
"\n\004name\030\003 \001(\t\022\n\n\002in\030\004 \001(\tB}\n%org.wso2.cho" +
"reo.connect.discovery.apiB\023SecuritySchem" +
"eProtoP\001Z=github.com/envoyproxy/go-contr" +
"ol-plane/wso2/discovery/api;apib\006proto3"
};
descriptor = com.google.protobuf.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
new com.google.protobuf.Descriptors.FileDescriptor[] {
});
internal_static_wso2_discovery_api_SecurityScheme_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_wso2_discovery_api_SecurityScheme_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_wso2_discovery_api_SecurityScheme_descriptor,
new java.lang.String[] { "DefinitionName", "Type", "Name", "In", });
}
// @@protoc_insertion_point(outer_class_scope)
}
| [
"slahiruc007@gmail.com"
] | slahiruc007@gmail.com |
e0dbe9eb7a0b632610ca719baf7c546df4271754 | 64e1ca4a84680c36346dd5678be4eb310cda15fe | /sort/BubbleSort.java | f2f68499ea33b224c5d5fc9545505d70b8365957 | [
"BSD-3-Clause"
] | permissive | 1305926470/algorithm | 94be7d9a61e662a17ee68dda540d818a45bac54d | dee8a5c39e6f7f8d9eff7aa6b17a887f40b398e5 | refs/heads/main | 2023-01-13T22:53:39.787531 | 2020-11-16T14:32:45 | 2020-11-16T14:32:45 | 313,307,117 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 835 | java | package sort;
//冒泡排序
public class BubbleSort extends BaseSort {
public static void main(String[] args) {
int [] a = {5,4,1,2,3,6,9,8,7};
printAll(a);
sort(a);
printAll(a);
}
//冒泡排序,从前往后依次比较相邻的,后面的大就交换(大的往后移)。
//提前退出条件,当某次遍历没有交换时,结束(说明都满足递增的顺序了)。
public static void sort(int[] a) {
int n = a.length;
int tmp;
boolean exitFlag = false; //用于提前结束循环
for (int i = 0; i < n; i++) {
exitFlag = true;
for (int j = 0; j < n - i - 1; j++) {
if (a[j] > a[j+1]) {
tmp = a[j+1];
a[j+1] = a[j];
a[j] = tmp;
exitFlag = false;
}
}
if (exitFlag == true) {
break;
}
}
}
}
| [
"hxx001er@163.com"
] | hxx001er@163.com |
b5de35da6439ea7effa1d6f3a0aa5d4955bbe431 | 65e7f886552b67f1326d822354de53e93127ed8a | /src/main/java/com/zct/door_ai/config/KaptchaConfig.java | 5063eb0fdca57ef4417a3007916e6ed5e27903c3 | [] | no_license | zct1115/door_ai | 9fcf3c1b4548c1a86bc504d6f9f5e9edd28c5897 | a32df11df8e63c9364bd17fcb74a8ba7bf51c434 | refs/heads/master | 2021-05-11T05:10:49.965950 | 2018-01-18T08:37:03 | 2018-01-18T08:37:03 | 117,850,166 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,401 | java | package com.zct.door_ai.config;
import com.google.code.kaptcha.impl.DefaultKaptcha;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;
import com.google.code.kaptcha.util.Config;
import java.util.Properties;
/**
* @author zct
* 验证码配置 用法查看http://blog.csdn.net/u014104286/article/details/70515004
*/
@Component
public class KaptchaConfig {
@Bean
public DefaultKaptcha getDefaultKaptcha(){
com.google.code.kaptcha.impl.DefaultKaptcha defaultKaptcha = new com.google.code.kaptcha.impl.DefaultKaptcha();
Properties properties = new Properties();
properties.setProperty("kaptcha.border", "yes");
properties.setProperty("kaptcha.border.color", "105,179,90");
properties.setProperty("kaptcha.textproducer.font.color", "blue");
properties.setProperty("kaptcha.image.width", "110");
properties.setProperty("kaptcha.image.height", "40");
properties.setProperty("kaptcha.textproducer.font.size", "30");
properties.setProperty("kaptcha.session.key", "code");
properties.setProperty("kaptcha.textproducer.char.length", "4");
properties.setProperty("kaptcha.textproducer.font.names", "宋体,楷体,微软雅黑");
Config config = new Config(properties);
defaultKaptcha.setConfig(config);
return defaultKaptcha;
}
}
| [
"1278719957@qq.com"
] | 1278719957@qq.com |
3d6cb1823d0b99d6ce098bb369a0387eeef200d9 | b7073e49c82952ca2ac07e6725f80cd4db423ed0 | /Lab3/src/Validator/ValidationException.java | 17688b6af2da3172be13f039f5c97ba35e247eab | [] | no_license | liviu25/Projects | ddf8a46e2a4ba98164f95451a14221929d7e0400 | a54ee9f56cf72f3172648cab7d8ab04162a335c9 | refs/heads/master | 2022-07-17T23:09:22.710099 | 2019-07-25T17:39:27 | 2019-07-25T17:39:27 | 198,864,889 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 315 | java | package Validator;
public class ValidationException extends RuntimeException{
/**
*
* @param message mesajul exceptiei
*/
public ValidationException(String message) {
super(message);
}
/**
* contructor fara parametrii
*/
public ValidationException() {
}
}
| [
"liviu.bud@nexttech.ro"
] | liviu.bud@nexttech.ro |
3477636a08323d623fa29901e8bcf4d9c9eded96 | 737c6e161c2004387a7eaceed2bd3ed3806e5a30 | /app/src/main/java/com/app/external/GPSTracker.java | f827d839af38e1d2245a098e7cd82935f10aa69a | [] | no_license | einwoko96/TextbookTakeover | 85b879b8bca4468ff6f4504d2c1f5f8bc12978cd | 210cff06785e3e4d7cf3f750488362ea27905bc2 | refs/heads/master | 2021-03-29T22:43:54.964254 | 2017-08-11T22:04:31 | 2017-08-11T22:04:31 | 86,260,517 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 6,821 | java | package com.app.external;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Service;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.os.Bundle;
import android.os.IBinder;
import android.provider.Settings;
import android.support.v4.app.ActivityCompat;
import android.util.Log;
import com.app.textbooktakeover.R;
import static android.Manifest.permission.ACCESS_COARSE_LOCATION;
import static android.Manifest.permission.ACCESS_FINE_LOCATION;
public class GPSTracker extends Service implements LocationListener {
private final Context mContext;
// flag for GPS status
boolean isGPSEnabled = false;
// flag for network status
boolean isNetworkEnabled = false;
// flag for GPS status
boolean canGetLocation = false;
//new
Location location; // location
double latitude; // latitude
double longitude; // longitude
// The minimum distance to change Updates in meters
private static final long MIN_DISTANCE_CHANGE_FOR_UPDATES = 10; // 10 meters
// The minimum time between updates in milliseconds
private static final long MIN_TIME_BW_UPDATES = 1000 * 60 * 1; // 1 minute
// Declaring a Location Manager
protected LocationManager locationManager;
public GPSTracker(Context context) {
this.mContext = context;
getLocation();
}
public Location getLocation() {
try {
locationManager = (LocationManager) mContext
.getSystemService(LOCATION_SERVICE);
// getting GPS status
isGPSEnabled = locationManager
.isProviderEnabled(LocationManager.GPS_PROVIDER);
// getting network status
isNetworkEnabled = locationManager
.isProviderEnabled(LocationManager.NETWORK_PROVIDER);
if (!isGPSEnabled && !isNetworkEnabled) {
// no network provider is enabled
Log.v("no *","no *");
} else {
if (ActivityCompat.checkSelfPermission(mContext, ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions((Activity)mContext, new String[]{ ACCESS_FINE_LOCATION, ACCESS_COARSE_LOCATION}, 102);
} else {
this.canGetLocation = true;
if (isNetworkEnabled) {
locationManager.requestLocationUpdates(
LocationManager.NETWORK_PROVIDER,
MIN_TIME_BW_UPDATES,
MIN_DISTANCE_CHANGE_FOR_UPDATES, this);
Log.d("Network", "Network");
if (locationManager != null) {
location = locationManager
.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);
if (location != null) {
latitude = location.getLatitude();
longitude = location.getLongitude();
Log.v("network","latitude"+latitude+"longitude"+longitude);
}
}
}
// if GPS Enabled get lat/long using GPS Services
if (isGPSEnabled) {
if (location == null) {
locationManager.requestLocationUpdates(
LocationManager.GPS_PROVIDER,
MIN_TIME_BW_UPDATES,
MIN_DISTANCE_CHANGE_FOR_UPDATES, this);
Log.d("GPS Enabled", "GPS Enabled");
if (locationManager != null) {
location = locationManager
.getLastKnownLocation(LocationManager.GPS_PROVIDER);
if (location != null) {
latitude = location.getLatitude();
longitude = location.getLongitude();
Log.v("gps","latitude"+latitude+"longitude"+longitude);
}
}
}
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
return location;
}
/**
* Stop using GPS listener
* Calling this function will stop using GPS in your app
* */
public void stopUsingGPS(){
if(locationManager != null){
locationManager.removeUpdates(GPSTracker.this);
}
}
/**
* Function to get latitude
* */
public double getLatitude(){
if(location != null){
latitude = location.getLatitude();
}
// return latitude
return latitude;
}
/**
* Function to get longitude
* */
public double getLongitude(){
if(location != null){
longitude = location.getLongitude();
}
// return longitude
return longitude;
}
/**
* Function to check GPS/wifi enabled
* @return boolean
* */
public boolean canGetLocation() {
return this.canGetLocation;
}
/**
* Function to show settings alert dialog
* On pressing Settings button will lauch Settings Options
* */
public void showSettingsAlert(){
AlertDialog.Builder alertDialog = new AlertDialog.Builder(mContext);
// Setting Dialog Title
alertDialog.setTitle(getResources().getString(R.string.gps_settings));
// Setting Dialog Message
alertDialog.setMessage(getResources().getString(R.string.gps_notenabled));
// On pressing Settings button
alertDialog.setPositiveButton(getResources().getString(R.string.settings), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
mContext.startActivity(intent);
}
});
// on pressing cancel button
alertDialog.setNegativeButton(getResources().getString(R.string.cancel), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
dialog.cancel();
}
});
// Showing Alert Message
alertDialog.show();
}
@Override
public void onLocationChanged(Location location) {
// TODO Auto-generated method stub
}
@Override
public void onProviderDisabled(String provider) {
// TODO Auto-generated method stub
}
@Override
public void onProviderEnabled(String provider) {
// TODO Auto-generated method stub
}
@Override
public void onStatusChanged(String provider, int status, Bundle extras) {
// TODO Auto-generated method stub
}
@Override
public IBinder onBind(Intent intent) {
// TODO Auto-generated method stub
return null;
}
}
| [
"einwoko96@yahoo.com"
] | einwoko96@yahoo.com |
f6ac464f7a0db8f38e4a4d1fedd5967ef39032b9 | bc75f38499fe272e26670405c5762a22d6797245 | /src/main/java/com/tyh/i/lo/ve/yo/u/springboot/gridControll/hiControll.java | 11838d660da6116630f5d03e0d5e5f9c92306f5f | [] | no_license | lhjlovetyhforever/springboot | 0b22a18aa7478721330a426e1dffbf1fb7528435 | 01c49733f4f33dc1930728a7646039ec47857c4b | refs/heads/master | 2020-03-25T06:10:45.960567 | 2018-08-04T01:25:01 | 2018-08-04T01:25:02 | 143,400,696 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,983 | java | package com.tyh.i.lo.ve.yo.u.springboot.gridControll;
import com.tyh.i.lo.ve.yo.u.springboot.Dao.gridDao;
import com.tyh.i.lo.ve.yo.u.springboot.Server.gridServer;
import com.tyh.i.lo.ve.yo.u.springboot.entity.gridCup;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.web.bind.annotation.*;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.List;
@RestController(value = "/")
public class hiControll {
@Autowired
private gridServer gridServer;
@GetMapping(value = "/gridAll")
public List<gridCup> selAll(){
String a= System.getProperty("os.name");
System.out.print(a);
return gridServer.selAll();
}
@PostMapping(value = "/gridAdd")
public gridCup addGrid( @RequestParam(value = "age") int age,@RequestParam(value = "cupSize") String cupSize){
gridCup g=new gridCup();
g.setAge(age);
g.setCutSize(cupSize);
return gridServer.Addone(g);
}
@DeleteMapping(value = "/delgrid/{Id}")
public List<gridCup> delGrid(@PathVariable int Id){
gridCup g=new gridCup();
g.setGid(Id);
return gridServer.delgrid(g);
}
@PutMapping(value = "/update")
public List<gridCup> updateGrid(@RequestParam(value = "Id") int Id,@RequestParam(value = "age") int age,@RequestParam(value = "cupSize") String cupSize){
gridCup g=new gridCup();
g.setGid(Id);
g.setCutSize(cupSize);
g.setAge(age);
return gridServer.updateGrid(g);
}
// @Scheduled(cron = "0/2 * * * * *")
// public void timer() throws InterruptedException {
// //获取当前时间
//
// LocalDateTime localDateTime =LocalDateTime.now();
// System.out.println("当前时间为:" + localDateTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
//
// }
}
| [
"17823347822@163.com"
] | 17823347822@163.com |
12e325c89077716d01cf96592dfadbc8f1f5edca | f15889af407de46a94fd05f6226c66182c6085d0 | /cerebrum/src/main/java/com/oreon/cerebrum/employee/Specialization.java | 91183a4e2be770b648e435e72c40942d499d5430 | [] | no_license | oreon/sfcode-full | 231149f07c5b0b9b77982d26096fc88116759e5b | bea6dba23b7824de871d2b45d2a51036b88d4720 | refs/heads/master | 2021-01-10T06:03:27.674236 | 2015-04-27T10:23:10 | 2015-04-27T10:23:10 | 55,370,912 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,585 | java | package com.oreon.cerebrum.employee;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.Date;
import javax.ws.rs.core.Response;
import javax.persistence.*;
import org.hibernate.validator.*;
import org.apache.commons.lang.builder.ReflectionToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import org.apache.solr.analysis.LowerCaseFilterFactory;
import org.apache.solr.analysis.SnowballPorterFilterFactory;
import org.apache.solr.analysis.StandardTokenizerFactory;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.Formula;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.Filter;
import org.hibernate.annotations.Filters;
import org.hibernate.annotations.Cascade;
import org.hibernate.search.annotations.AnalyzerDef;
import org.hibernate.search.annotations.Analyzer;
import org.hibernate.search.annotations.Field;
import org.hibernate.search.annotations.Boost;
import org.hibernate.search.annotations.Index;
import org.hibernate.search.annotations.Indexed;
import org.hibernate.search.annotations.Parameter;
import org.hibernate.search.annotations.TokenFilterDef;
import org.hibernate.search.annotations.TokenizerDef;
import org.hibernate.search.annotations.ContainedIn;
import org.hibernate.search.annotations.IndexedEmbedded;
import org.hibernate.annotations.Filter;
import org.hibernate.validator.Length;
import org.hibernate.validator.NotNull;
import java.math.BigDecimal;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
import org.jboss.seam.annotations.Name;
import org.witchcraft.model.support.audit.Auditable;
import org.witchcraft.utils.*;
import org.witchcraft.base.entity.FileAttachment;
import org.witchcraft.base.entity.BaseEntity;
import com.oreon.cerebrum.ProjectUtils;
@Entity
@Table(name = "specialization")
@Filters({@Filter(name = "archiveFilterDef"), @Filter(name = "tenantFilterDef")})
//@Name("specialization")
@Cache(usage = CacheConcurrencyStrategy.NONE)
@XmlRootElement
public class Specialization extends BaseEntity implements java.io.Serializable {
private static final long serialVersionUID = 1474550929L;
@NotNull
@Length(min = 1, max = 250)
@Column(unique = true)
@Field(index = Index.TOKENIZED)
@Analyzer(definition = "entityAnalyzer")
protected String name
;
public void setName(String name) {
this.name = name;
}
public String getName() {
return name;
}
@Transient
public String getDisplayName() {
try {
return name;
} catch (Exception e) {
return "Exception - " + e.getMessage();
}
}
//Empty setter , needed for richfaces autocomplete to work
public void setDisplayName(String name) {
}
/** This method is used by hibernate full text search - override to add additional fields
* @see org.witchcraft.model.support.BaseEntity#retrieveSearchableFieldsArray()
*/
@Override
public List<String> listSearchableFields() {
List<String> listSearchableFields = new ArrayList<String>();
listSearchableFields.addAll(super.listSearchableFields());
listSearchableFields.add("name");
return listSearchableFields;
}
@Field(index = Index.TOKENIZED, name = "searchData")
@Analyzer(definition = "entityAnalyzer")
public String getSearchData() {
StringBuilder builder = new StringBuilder();
builder.append(getName() + " ");
return builder.toString();
}
}
| [
"singhj@38423737-2f20-0410-893e-9c0ab9ae497d"
] | singhj@38423737-2f20-0410-893e-9c0ab9ae497d |
13c27999a852fe8ba25c80d9dc096cb166fe05f7 | 87544a15aca5d61ed8138274a96525826e4140be | /src/main/java/lv/javaguru/java2/businesslogic/contract/removecontract/RemoveContractResponse.java | cdee1a45534a586986525278ac87fc1dc678a241 | [] | no_license | OlegMiroshnikov/eAccounts1 | 4f7664326666f23b3a6939d8dadec64fb40ec1b1 | fa7c00739cefc8c329ae0b38c8243fb1c835d227 | refs/heads/master | 2020-03-18T21:48:14.474404 | 2018-05-29T13:52:34 | 2018-05-29T13:52:36 | 135,304,313 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 678 | java | package lv.javaguru.java2.businesslogic.contract.removecontract;
import lv.javaguru.java2.validators.Error;
import java.util.List;
public class RemoveContractResponse {
private boolean success;
private List<Error> errors;
public RemoveContractResponse(boolean success, List<Error> errors) {
this.success = success;
this.errors = errors;
}
public boolean isSuccess() {
return success;
}
public void setSuccess(boolean success) {
this.success = success;
}
public List<Error> getErrors() {
return errors;
}
public void setErrors(List<Error> errors) {
this.errors = errors;
}
}
| [
"oleg.psoft@gmail.com"
] | oleg.psoft@gmail.com |
9e93b74a098c64d7797078a32c3aab92dea11920 | 74a7b04bd20abda94bd5180a0ab970cb91670573 | /src/main/java/org/enhydra/jxpdl/elements/PartnerLinkType.java | 45414f14ad1916f386cd6378468b2a6bed496d91 | [] | no_license | si294r/sourceforge-jxpdl | 3ed16b53aa6203c09c19653c83cc1e1a5bd6454d | 8f9506d163f4e48021e8316b97080a3d91855a07 | refs/heads/master | 2022-02-10T18:12:29.132548 | 2019-06-20T05:07:57 | 2019-06-20T05:07:57 | 192,850,022 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,795 | java | /**
* Together XPDL Model
* Copyright (C) 2011 Together Teamsolutions Co., Ltd.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see http://www.gnu.org/licenses
*/
package org.enhydra.jxpdl.elements;
import org.enhydra.jxpdl.XMLAttribute;
import org.enhydra.jxpdl.XMLCollectionElement;
/**
* Represents corresponding element from XPDL schema.
*
* @author Sasa Bojanic
*/
public class PartnerLinkType extends XMLCollectionElement {
/**
* Constructs a new object with the given PartnerLinkTypes as a parent.
*/
public PartnerLinkType(PartnerLinkTypes parent) {
super(parent, true);
}
protected void fillStructure() {
XMLAttribute attrName = new XMLAttribute(this, "name", true);
Roles refRoles = new Roles(this);
super.fillStructure();
add(attrName);
add(refRoles);
}
/** Returns the Name attribute value of this object. */
public String getName() {
return get("Name").toValue();
}
/** Sets the Name attribute value of this object. */
public void setName(String name) {
set("Name", name);
}
/** Returns the Roles sub-element of this object. */
public Roles getRoles() {
return (Roles) get("Roles");
}
}
| [
""
] | |
3ed907ee1ac818e7e25beac7a5e3e4b2d0159f14 | 0bff2461c2aad72050b4a356778c558db5c3ac3b | /Widgets/TabHost/src/main/java/studio/sinya/jp/demo_tabhost/MainActivity.java | 23890a51a721010798b406ed9065781c9e64e7ec | [
"Apache-2.0"
] | permissive | KoizumiSinya/DemoProject | e189de2a80b2fde7702c51fa715d072053fe3169 | 01aae447bdc02b38b73b2af085e3e28e662764be | refs/heads/master | 2021-06-08T05:03:22.975363 | 2021-06-01T09:39:08 | 2021-06-01T09:39:08 | 168,299,197 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,731 | java | package studio.sinya.jp.demo_tabhost;
import android.content.Context;
import android.support.v4.app.FragmentTabHost;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.LinearLayout;
import studio.sinya.jp.demo_tabhost.fragment.FragmentFour;
import studio.sinya.jp.demo_tabhost.fragment.FragmentOne;
import studio.sinya.jp.demo_tabhost.fragment.FragmentThree;
import studio.sinya.jp.demo_tabhost.fragment.FragmentTwo;
public class MainActivity extends ActionBarActivity {
private Context context;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
context = this;
FragmentTabHost tabHost = (FragmentTabHost) findViewById(android.R.id.tabhost);
tabHost.setup(context, getSupportFragmentManager(), android.R.id.tabcontent);
//取消每个导航的按钮bar之间的分割线
tabHost.getTabWidget().setDividerDrawable(null);
LinearLayout layout;
layout = (LinearLayout) LayoutInflater.from(context).inflate(R.layout.tab_one, null, false);
tabHost.addTab(tabHost.newTabSpec("one").setIndicator(layout), FragmentOne.class, null);
layout = (LinearLayout) LayoutInflater.from(context).inflate(R.layout.tab_two, null, false);
tabHost.addTab(tabHost.newTabSpec("two").setIndicator(layout), FragmentTwo.class, null);
layout = (LinearLayout) LayoutInflater.from(context).inflate(R.layout.tab_three, null, false);
tabHost.addTab(tabHost.newTabSpec("three").setIndicator(layout), FragmentThree.class, null);
layout = (LinearLayout) LayoutInflater.from(context).inflate(R.layout.tab_four, null, false);
tabHost.addTab(tabHost.newTabSpec("four").setIndicator(layout), FragmentFour.class, null);
tabHost.setCurrentTab(0);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
}
| [
"haoqqjy@163.com"
] | haoqqjy@163.com |
5b7e77d960d74386d343e0f2e8f75637f02882f7 | c909a55610dfcea60ef9594e85c6d6cf3a5a582f | /app/src/main/java/com/indo/app/mygcmnetworkmanagement/SchedulerTask.java | 46bd3fda63a46c0278c3d9800ac497eb352b6db6 | [] | no_license | indogusmas/MyGcmNetworkManagement | 79d036ec3fbc14278f3a0d6b7f16c447dcd27680 | 1da4bcfb4f8d1c4c235b70a2d8ca1cc6877af7e2 | refs/heads/master | 2021-05-14T00:53:32.489279 | 2018-01-07T09:04:36 | 2018-01-07T09:04:36 | 116,551,850 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,054 | java | package com.indo.app.mygcmnetworkmanagement;
import android.content.Context;
import com.google.android.gms.gcm.GcmNetworkManager;
import com.google.android.gms.gcm.PeriodicTask;
import com.google.android.gms.gcm.Task;
/**
* Created by indo on 07/01/18.
*/
public class SchedulerTask {
private GcmNetworkManager mGcmNetworkManager;
public SchedulerTask(Context context) {
mGcmNetworkManager = GcmNetworkManager.getInstance(context);
}
public void createPeriodicTask(){
Task periodicTask = new PeriodicTask.Builder()
.setService(SchedulerService.class)
.setPeriod(60)
.setFlex(10)
.setTag(SchedulerService.TAG_TASK_WHEATHER_LOG)
.setPersisted(true)
.build();
mGcmNetworkManager.schedule(periodicTask);
}
public void cancelPeriodicTask(){
if (mGcmNetworkManager != null){
mGcmNetworkManager.cancelTask(SchedulerService.TAG_TASK_WHEATHER_LOG, SchedulerService.class);
}
}
}
| [
"indogusmasarungsamudra@gmail.com"
] | indogusmasarungsamudra@gmail.com |
6dc92d566c027c4921620ee2e2ea82e6c2048f8c | fc1bf26252525f1dca780f0c26cea165c3b3f531 | /com/planet_ink/coffee_mud/Items/BasicTech/GenElecItem.java | 0b48b5ab153c832971bbe12d5d3129e246e64f01 | [
"Apache-2.0"
] | permissive | mikael2/CoffeeMud | 8ade6ff60022dbe01f55172ba3f86be0de752124 | a70112b6c67e712df398c940b2ce00b589596de0 | refs/heads/master | 2020-03-07T14:13:04.765442 | 2018-03-28T03:59:22 | 2018-03-28T03:59:22 | 127,521,360 | 1 | 0 | null | 2018-03-31T10:11:54 | 2018-03-31T10:11:53 | null | UTF-8 | Java | false | false | 4,765 | java | package com.planet_ink.coffee_mud.Items.BasicTech;
import com.planet_ink.coffee_mud.core.interfaces.*;
import com.planet_ink.coffee_mud.core.*;
import com.planet_ink.coffee_mud.core.collections.*;
import com.planet_ink.coffee_mud.Abilities.interfaces.*;
import com.planet_ink.coffee_mud.Areas.interfaces.*;
import com.planet_ink.coffee_mud.Behaviors.interfaces.*;
import com.planet_ink.coffee_mud.CharClasses.interfaces.*;
import com.planet_ink.coffee_mud.Commands.interfaces.*;
import com.planet_ink.coffee_mud.Common.interfaces.*;
import com.planet_ink.coffee_mud.Exits.interfaces.*;
import com.planet_ink.coffee_mud.Items.interfaces.*;
import com.planet_ink.coffee_mud.Locales.interfaces.*;
import com.planet_ink.coffee_mud.MOBS.interfaces.*;
import com.planet_ink.coffee_mud.Races.interfaces.*;
import java.util.*;
import com.planet_ink.coffee_mud.Libraries.interfaces.*;
/*
Copyright 2004-2018 Bo Zimmerman
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.
*/
public class GenElecItem extends StdElecItem
{
@Override
public String ID()
{
return "GenElecItem";
}
protected String readableText = "";
public GenElecItem()
{
super();
setName("a generic electric item");
basePhyStats.setWeight(2);
setDisplayText("a generic electric item sits here.");
setDescription("");
baseGoldValue=5;
basePhyStats().setLevel(1);
recoverPhyStats();
setMaterial(RawMaterial.RESOURCE_STEEL);
}
@Override
public boolean isGeneric()
{
return true;
}
@Override
public String text()
{
return CMLib.coffeeMaker().getPropertiesStr(this, false);
}
@Override
public String readableText()
{
return readableText;
}
@Override
public void setReadableText(String text)
{
readableText = text;
}
@Override
public void setMiscText(String newText)
{
miscText = "";
CMLib.coffeeMaker().setPropertiesStr(this, newText, false);
recoverPhyStats();
}
private final static String[] MYCODES={"TECHLEVEL","POWERCAP","ACTIVATED","POWERREM","MANUFACTURER"};
@Override
public String getStat(String code)
{
if(CMLib.coffeeMaker().getGenItemCodeNum(code)>=0)
return CMLib.coffeeMaker().getGenItemStat(this,code);
switch(getCodeNum(code))
{
case 0:
return "" + this.techLevel();
case 1:
return "" + powerCapacity();
case 2:
return "" + activated();
case 3:
return "" + powerRemaining();
case 4:
return "" + getManufacturerName();
default:
return CMProps.getStatCodeExtensionValue(getStatCodes(), xtraValues, code);
}
}
@Override
public void setStat(String code, String val)
{
if(CMLib.coffeeMaker().getGenItemCodeNum(code)>=0)
CMLib.coffeeMaker().setGenItemStat(this,code,val);
else
switch(getCodeNum(code))
{
case 0:
setTechLevel(CMath.s_parseIntExpression(val));
break;
case 1:
setPowerCapacity(CMath.s_parseLongExpression(val));
break;
case 2:
activate(CMath.s_bool(val));
break;
case 3:
setPowerRemaining(CMath.s_parseLongExpression(val));
break;
case 4:
setManufacturerName(val);
break;
default:
CMProps.setStatCodeExtensionValue(getStatCodes(), xtraValues, code, val);
break;
}
}
@Override
protected int getCodeNum(String code)
{
for(int i=0;i<MYCODES.length;i++)
{
if(code.equalsIgnoreCase(MYCODES[i]))
return i;
}
return -1;
}
private static String[] codes=null;
@Override
public String[] getStatCodes()
{
if(codes!=null)
return codes;
final String[] MYCODES=CMProps.getStatCodesList(GenElecItem.MYCODES,this);
final String[] superCodes=CMParms.toStringArray(GenericBuilder.GenItemCode.values());
codes=new String[superCodes.length+MYCODES.length];
int i=0;
for(;i<superCodes.length;i++)
codes[i]=superCodes[i];
for(int x=0;x<MYCODES.length;i++,x++)
codes[i]=MYCODES[x];
return codes;
}
@Override
public boolean sameAs(Environmental E)
{
if(!(E instanceof GenElecItem))
return false;
final String[] theCodes=getStatCodes();
for(int i=0;i<theCodes.length;i++)
{
if(!E.getStat(theCodes[i]).equals(getStat(theCodes[i])))
return false;
}
return true;
}
}
| [
"bo@zimmers.net"
] | bo@zimmers.net |
ae9a92cbe77d54268141458751255a9eef6a00b8 | b5fc8069a2ca6c08730f4f70d30741988f6a9f68 | /src/main/java/execution/state/symbolic/SymbolicForEachState.java | 5bf873fb8521ec01f28338a09bbfbfe18a4854a8 | [] | no_license | alk-language/java-semantics | 45721d8dba5f480e53f0121a48e91aeae1065330 | 6894cbe52cbaaab4e538d2f65a4e2b3b4d5fee74 | refs/heads/master | 2023-08-03T21:10:12.907888 | 2023-07-18T11:49:50 | 2023-07-18T11:49:50 | 162,150,623 | 22 | 23 | null | 2022-10-26T08:35:37 | 2018-12-17T15:23:38 | Java | UTF-8 | Java | false | false | 7,172 | java | package execution.state.symbolic;
import ast.AST;
import ast.attr.*;
import ast.enums.BuiltInFunction;
import ast.enums.BuiltInMethod;
import ast.enums.Operator;
import ast.expr.*;
import ast.stmt.ChooseAST;
import ast.stmt.ExprStmtAST;
import ast.stmt.StmtSeqAST;
import ast.stmt.WhileAST;
import ast.type.ArrayDataTypeAST;
import ast.type.DataTypeAST;
import ast.type.ListDataTypeAST;
import ast.type.SetDataTypeAST;
import execution.ExecutionPayload;
import execution.ExecutionResult;
import execution.exhaustive.SplitMapper;
import execution.parser.exceptions.AlkException;
import execution.state.ExecutionState;
import execution.state.statement.ForEachState;
import execution.types.AlkIterableValue;
import execution.types.alkInt.AlkInt;
import symbolic.SymbolicValue;
import util.types.Storable;
import visitor.BuiltInMethodHelper;
import java.util.ArrayList;
import java.util.List;
import static execution.parser.exceptions.AlkException.ERR_FORALL_ITERABLE_REQUIRED;
public class SymbolicForEachState
extends ForEachState
{
public static final String idxName = "\\idx";
public static final String sourceName = "\\source";
private SymbolicValue symSource;
private boolean isConcrete = false;
private boolean simulate = false;
public SymbolicForEachState(AST tree, ExecutionPayload executionPayload)
{
super(tree, executionPayload);
}
@Override
public ExecutionState makeStep()
{
if (simulate)
{
return null;
}
if (isConcrete)
{
return super.makeStep();
}
if (symSource == null)
{
return request(tree.getChild(0));
}
DataTypeAST dataTypeAST = ((ExpressionAST) symSource.toAST()).getDataType(getExec().getPathCondition());
if (dataTypeAST instanceof ArrayDataTypeAST || dataTypeAST instanceof ListDataTypeAST)
{
simulate = true;
getEnv().define(idxName).setValue(new AlkInt(0));
getEnv().define(sourceName).setValue(symSource);
WhileAST whileAst = new WhileAST(tree.getCtx(), false);
List<AST> children = new ArrayList<>();
children.add(new RefIDAST(idxName));
FactorPointMethodAST sizeAST = new FactorPointMethodAST(tree.getCtx());
sizeAST.addChild(new RefIDAST(sourceName));
sizeAST.addAttribute(BuiltInMethodASTAttr.class, new BuiltInMethodASTAttr(BuiltInMethod.SIZE));
children.add(sizeAST);
whileAst.addChild(RelationalAST.createBinary(Operator.LOWER, children));
StmtSeqAST body = new StmtSeqAST(tree.getCtx());
AssignmentAST assignAST = new AssignmentAST(tree.getCtx());
assignAST.addChild(new RefIDAST(tree.getAttribute(IdASTAttr.class).getId()));
children.clear();
children.add(new RefIDAST(sourceName));
children.add(new RefIDAST(idxName));
assignAST.addChild(BracketAST.createBinary(Operator.BRACKET, children));
OpsASTAttr attr = new OpsASTAttr();
attr.add(Operator.ASSIGN);
assignAST.addAttribute(OpsASTAttr.class, attr);
body.addChild(assignAST);
body.addChild(tree.getChild(1));
ExprStmtAST incAST = new ExprStmtAST(tree.getCtx());
children.clear();
children.add(new RefIDAST(idxName));
incAST.addChild(PostfixAST.createUnary(Operator.PLUSPLUSRIGHT, children));
body.addChild(incAST);
whileAst.addChild(body);
return request(whileAst);
}
else if (dataTypeAST instanceof SetDataTypeAST)
{
getEnv().define(sourceName).setValue(symSource);
WhileAST whileAst = new WhileAST(tree.getCtx(), false);
List<AST> children = new ArrayList<>();
FactorPointMethodAST sizeAST = new FactorPointMethodAST(tree.getCtx());
sizeAST.addChild(new RefIDAST(sourceName));
sizeAST.addAttribute(BuiltInMethodASTAttr.class, new BuiltInMethodASTAttr(BuiltInMethod.SIZE));
children.add(sizeAST);
children.add(new IntAST("0"));
AST condition = RelationalAST.createBinary(Operator.GREATER, children);
whileAst.addChild(condition);
StmtSeqAST body = new StmtSeqAST(tree.getCtx());
ChooseAST chooseAST = new ChooseAST(tree.getCtx());
chooseAST.addChild(new RefIDAST(tree.getAttribute(IdASTAttr.class).getId()));
chooseAST.addChild(new RefIDAST(sourceName));
ExprStmtAST removeAst = new ExprStmtAST(tree.getCtx());
AssignmentAST assignAST = new AssignmentAST(tree.getCtx());
OpsASTAttr attr = new OpsASTAttr();
attr.add(Operator.ASSIGN);
assignAST.addAttribute(OpsASTAttr.class, attr);
assignAST.addChild(new RefIDAST(sourceName));
List<AST> children2 = new ArrayList<>();
children2.add(new RefIDAST(sourceName));
AST singleton = new BuiltinFunctionAST(tree.getCtx());
singleton.addAttribute(BuiltInFunctionASTAttr.class, new BuiltInFunctionASTAttr(BuiltInFunction.SINGLETONSET));
singleton.addChild(new RefIDAST(tree.getAttribute(IdASTAttr.class).getId()));
children2.add(singleton);
AST setdiff = SetExprAST.createBinary(Operator.SETSUBTRACT, children2);
assignAST.addChild(setdiff);
removeAst.addChild(assignAST);
body.addChild(chooseAST);
body.addChild(removeAst);
body.addChild(tree.getChild(1));
whileAst.addChild(body);
return request(whileAst);
}
else
{
super.handle(new AlkException(ERR_FORALL_ITERABLE_REQUIRED));
}
return null;
}
@Override
public void assign(ExecutionResult executionResult)
{
if (simulate)
{
return;
}
if (isConcrete)
{
assign(executionResult);
return;
}
if (symSource == null)
{
Storable value = executionResult.getValue().toRValue();
checkNotNull(value, false);
if (value instanceof AlkIterableValue)
{
isConcrete = true;
super.assign(executionResult);
}
else if (value instanceof SymbolicValue)
{
isConcrete = false;
symSource = (SymbolicValue) value;
}
else
{
super.handle(new AlkException(ERR_FORALL_ITERABLE_REQUIRED));
}
}
}
@Override
public ExecutionState clone(SplitMapper sm)
{
SymbolicForEachState copy = new SymbolicForEachState(tree, payload.clone(sm));
copy.isConcrete = isConcrete;
copy.simulate = simulate;
if (this.symSource != null)
{
copy.symSource = (SymbolicValue) this.symSource.weakClone(sm.getLocationMapper());
}
return this.decorate(copy, sm);
}
}
| [
"alex@edility.ro"
] | alex@edility.ro |
0556bd62e0ae64ae7937f22cf71ac5e404624f8f | d4a66db8dc5b1683a5d8b815fdc9f9b96133f4a8 | /Face/src/main/java/com/cauc/face/FaceInterface.java | c9e36c140cc2fc505384ad7bc9f03ab97cffd8a0 | [] | no_license | JasonZhangCauc/Face | 928aee0e574f0d57755bdb7b8b557e7670b0087e | bd154057e927abad4085b724cfb01010f479738c | refs/heads/master | 2020-03-29T18:54:59.613922 | 2018-10-14T07:13:51 | 2018-10-14T07:13:51 | 150,237,704 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,807 | java | package com.cauc.face;
import java.io.File;
import java.util.HashMap;
/**
*
* 人脸识别接口
* FaceInterface
* 创建人:JasonZhang
* 时间:2018-9-22-上午11:19:55
* @version 1.0.0
*
*/
public interface FaceInterface {
/**
*
* 根据文件地址和api_url获取人脸信息
* 方法名:faceimg
* 创建人:JasonZhang
* 时间:2018-9-22-上午11:20:10
* 邮件:hasp_Jason@163.com
* @param fileString
* @param urlString
* @return String
* @exception
* @since 1.0.0
*/
String faceimg(String fileString,String urlString);
/**
*
*
* 方法名:post
* 创建人:JasonZhang
* 时间:2018-9-22-上午11:21:08
* 邮件:hasp_Jason@163.com
* @param url
* @param map
* @param fileMap
* @return
* @throws Exception byte[]
* @exception
* @since 1.0.0
*/
byte[] post(String url, HashMap<String, String> map, HashMap<String, byte[]> fileMap) throws Exception;
/**
*
*
* 方法名:getBoundary
* 创建人:JasonZhang
* 时间:2018-9-22-上午11:21:13
* 邮件:hasp_Jason@163.com
* @return String
* @exception
* @since 1.0.0
*/
String getBoundary();
/**
*
*
* 方法名:encode
* 创建人:JasonZhang
* 时间:2018-9-22-上午11:21:17
* 邮件:hasp_Jason@163.com
* @param value
* @return
* @throws Exception String
* @exception
* @since 1.0.0
*/
String encode(String value)throws Exception;
/**
*
*
* 方法名:getBytesFromFile
* 创建人:JasonZhang
* 时间:2018-9-22-上午11:21:23
* 邮件:hasp_Jason@163.com
* @param f
* @return byte[]
* @exception
* @since 1.0.0
*/
byte[] getBytesFromFile(File f);
}
| [
"hasp_Jason@163.com"
] | hasp_Jason@163.com |
69958026a4983d38f0abfdd52351d2376c1ab0d2 | 7d516051c88244a408032a37f57e48f600e2ea58 | /edusoho_v3/src/main/java/com/edusoho/kuozhi/v3/view/webview/ESWebChromeClient.java | dfa765f747291becd86e0fb115cd46b9eea77e89 | [] | no_license | sdmengchen12580/tanggang | 58b69cf7a413fb06595f4691951a2f0d742f704c | 3bb7ab608c2485f41335bc667bce34ca7929135a | refs/heads/main | 2023-06-03T21:00:44.834731 | 2021-06-18T03:19:41 | 2021-06-18T03:19:41 | 370,194,843 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,240 | java | package com.edusoho.kuozhi.v3.view.webview;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.net.Uri;
import android.text.TextUtils;
import com.edusoho.kuozhi.v3.EdusohoApp;
import com.edusoho.kuozhi.v3.util.AppUtil;
import com.edusoho.kuozhi.v3.view.dialog.PopupDialog;
import com.edusoho.kuozhi.v3.view.webview.bridgeadapter.AbstractJsBridgeAdapterWebView;
import com.edusoho.kuozhi.v3.view.webview.bridgeadapter.BridgeWebChromeClient;
import com.edusoho.kuozhi.v3.view.webview.bridgeadapter.bridge.BridgePluginContext;
import com.tencent.smtt.export.external.interfaces.JsResult;
import com.tencent.smtt.sdk.ValueCallback;
import com.tencent.smtt.sdk.WebView;
import java.io.File;
/**
* Created by howzhi on 15/8/10.
*/
public class ESWebChromeClient extends BridgeWebChromeClient {
public static final int FILECHOOSER_RESULTCODE = 0x10;
public ESWebChromeClient(AbstractJsBridgeAdapterWebView webView) {
super(webView);
}
public void openFileChooser(ValueCallback<Uri> uploadMsg) {
this.openFileChooser(uploadMsg, "*/*");
}
public void openFileChooser( ValueCallback<Uri> uploadMsg, String acceptType ) {
this.openFileChooser(uploadMsg, acceptType, null);
}
public void openFileChooser(final ValueCallback<Uri> uploadMsg, String acceptType, String capture)
{
Intent i = new Intent(Intent.ACTION_GET_CONTENT);
i.addCategory(Intent.CATEGORY_OPENABLE);
i.setType(acceptType);
mWebview.getActitiy().startActivityForResult(i, 0);
mWebview.getBridgePluginContext().startActivityForResult(
new BridgePluginContext.Callback() {
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
Uri result = data == null || resultCode != Activity.RESULT_OK ? null : data.getData();
uploadMsg.onReceiveValue(compressImage(mActivity.getApplicationContext(), result));
}
},
Intent.createChooser(i, "File Browser"),
0
);
}
public static Uri compressImage(Context context, Uri uri) {
if (uri == null || TextUtils.isEmpty(uri.getPath())) {
return null;
}
String path = AppUtil.getPath(context, uri);
Bitmap bitmap = AppUtil.getBitmapFromFile(new File(path));
if (bitmap == null) {
return uri;
}
bitmap = AppUtil.scaleImage(bitmap, EdusohoApp.screenW, 0);
File cacheDir = AppUtil.getAppCacheDir();
File newUriFile = new File(cacheDir, "uploadAvatarTemp.png");
AppUtil.saveBitmap2FileWithQuality(bitmap, newUriFile.getAbsolutePath(), 80);
return Uri.fromFile(newUriFile);
}
@Override
public boolean onJsAlert(WebView view, String url, String message, JsResult result) {
PopupDialog.createNormal(mActivity, "提示:", message).show();
result.cancel();
return true;
}
@Override
public void onReceivedTitle(WebView view, String title) {
mActivity.setTitle(title);
}
}
| [
"1055199957@qq.com"
] | 1055199957@qq.com |
3707c96471de9790b843c8552199b3c3d891f517 | 9b0208acfd2d331c8a2dfdc8162c17c8834d9972 | /src/main/java/com/github/bartimaeusnek/ASM/BWCore.java | 578b7686529a4c7f82b2da9baba96ede486eee21 | [
"MIT"
] | permissive | Technus/bartworks | 01fc7d6126eec86df755647233bca1704881391e | 3d2d3b7ed5889a129fbd89e090f1a5c27486d7ba | refs/heads/master | 2022-06-21T22:33:37.202275 | 2020-04-23T17:17:47 | 2020-04-23T17:17:47 | 261,281,674 | 0 | 0 | MIT | 2020-05-04T19:54:11 | 2020-05-04T19:54:11 | null | UTF-8 | Java | false | false | 4,203 | java | /*
* Copyright (c) 2018-2019 bartimaeusnek
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.github.bartimaeusnek.ASM;
import com.github.bartimaeusnek.bartworks.MainMod;
import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler;
import com.github.bartimaeusnek.crossmod.BartWorksCrossmod;
import com.google.common.eventbus.EventBus;
import com.google.common.eventbus.Subscribe;
import cpw.mods.fml.common.DummyModContainer;
import cpw.mods.fml.common.LoadController;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.ModMetadata;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.versioning.ArtifactVersion;
import cpw.mods.fml.common.versioning.DefaultArtifactVersion;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.util.ArrayList;
import java.util.List;
import static com.github.bartimaeusnek.ASM.BWCoreTransformer.shouldTransform;
@SuppressWarnings("ALL")
public class BWCore extends DummyModContainer {
public static final String BWCORE_NAME = "BartWorks ASM Core";
public static final Logger BWCORE_LOG = LogManager.getLogger(BWCore.BWCORE_NAME);
public BWCore() {
super(new ModMetadata());
ModMetadata metadata = this.getMetadata();
metadata.modId = "BWCore";
metadata.name = BWCore.BWCORE_NAME;
metadata.version = "0.0.1";
metadata.authorList.add("bartimaeusnek");
metadata.dependants = this.getDependants();
}
@Subscribe
public void preInit(FMLPreInitializationEvent event) {
shouldTransform[0] = Loader.isModLoaded("ExtraUtilities") && ConfigHandler.enabledPatches[0];
shouldTransform[1] = Loader.isModLoaded("ExtraUtilities") && ConfigHandler.enabledPatches[1];
shouldTransform[3] = Loader.isModLoaded("Thaumcraft") && ConfigHandler.enabledPatches[3];
shouldTransform[4] = true;
shouldTransform[5] = Loader.isModLoaded("RWG") && ConfigHandler.enabledPatches[5];
shouldTransform[6] = ConfigHandler.enabledPatches[6];
//shouldTransform[6] = true;
BWCore.BWCORE_LOG.info("Extra Utilities found and ASM Patch enabled? " + shouldTransform[0]);
BWCore.BWCORE_LOG.info("Thaumcraft found and ASM Patch enabled? " + shouldTransform[3]);
BWCore.BWCORE_LOG.info("RWG found and ASM Patch enabled? " + shouldTransform[5]);
}
@Override
public List<ArtifactVersion> getDependants() {
List<ArtifactVersion> ret = new ArrayList<>();
ret.add(new DefaultArtifactVersion("ExtraUtilities", true));
ret.add(new DefaultArtifactVersion("Thaumcraft", true));
ret.add(new DefaultArtifactVersion("miscutils", true));
ret.add(new DefaultArtifactVersion("RWG", true));
ret.add(new DefaultArtifactVersion("gregtech", true));
ret.add(new DefaultArtifactVersion(MainMod.MOD_ID, true));
ret.add(new DefaultArtifactVersion(BartWorksCrossmod.MOD_ID, true));
return ret;
}
@Override
public boolean registerBus(EventBus bus, LoadController controller) {
bus.register(this);
return true;
}
}
| [
"33183715+bartimaeusnek@users.noreply.github.com"
] | 33183715+bartimaeusnek@users.noreply.github.com |
ed7c5675c1c3111efa77392e0a5bc921b5c50f72 | 251e2b0d4416ce13cde630b95d27a5a0d5c0c67d | /src/main/java/demo/UserDaoDemo.java | a623e661742ebef238ae513e7aede3af17b2288c | [] | no_license | lou1997/learn-Spring | ff13f047a0cf56bd98b4349b250916f28f98b94e | b8b835d4e0012eb434d77653000cb68b7221ea7a | refs/heads/master | 2023-08-29T21:39:41.916879 | 2021-09-23T05:23:35 | 2021-09-23T05:27:53 | 409,455,673 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 435 | java | package demo;
import com.learnSpring.UserDao;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
public class UserDaoDemo {
public static void main(String[] args) {
ApplicationContext app =new ClassPathXmlApplicationContext("applicationContext.xml");
UserDao userDao =(UserDao) app.getBean("userDao");
userDao.save();
}
}
| [
"lyd19970314@qq.com"
] | lyd19970314@qq.com |
7c4b5c175313702093fc196a3b65263a83c8d0f0 | 03e0aaf8e7a9b7ff6dffa698d452f42b5cdc9ae0 | /code/qingqingshare/src/main/java/com/blockChain/service/EthService.java | cc275203e430a5e131792ccfc5d4f9930868bdb5 | [] | no_license | Four5Fire/BlockChain | fe059e205a003089e8504318c0ef08610fe3803d | 5191152bcc4915a36ed3c48b8c3797c4bc56d746 | refs/heads/master | 2022-12-24T10:11:39.805591 | 2019-09-14T09:07:12 | 2019-09-14T09:07:12 | 204,397,047 | 3 | 0 | null | 2022-12-06T22:24:46 | 2019-08-26T04:40:50 | Java | UTF-8 | Java | false | false | 1,103 | java | package com.blockChain.service;
import org.web3j.protocol.Web3j;
import org.web3j.protocol.admin.Admin;
import org.web3j.protocol.core.methods.response.EthBlock;
import org.web3j.protocol.core.methods.response.EthTransaction;
import org.web3j.protocol.core.methods.response.Transaction;
import org.web3j.protocol.http.HttpService;
import java.io.IOException;
import java.math.BigInteger;
public interface EthService {
Web3j initWeb3j();
Geth initGeth();
Admin initAdmin();
HttpService getService();
String newAccount(String password) throws IOException;
BigInteger getCurrentBlockNumber() throws IOException;
Boolean unlockAccount(String address, String password, BigInteger duration) throws IOException;
Boolean lockAccount(String address) throws IOException;
EthTransaction getTransactionByHash(String hash) throws IOException;
EthBlock getBlockEthBlock(Integer blockNumber) throws IOException;
String sendTransaction(Transaction transaction, String password) throws IOException;
BigInteger getNonce(String address) throws IOException;
}
| [
"942558046@qq.com"
] | 942558046@qq.com |
b2945fb118aca35f9df83d3f4623cfbba7a0a97f | 3356aee4f0f93ab739f178235aef877c3e1249cf | /examples/relational/mutants/br/ufal/ic/masg/operations/4-LessThan-function(int_int)-9/5/br/ufal/ic/masg/operations/LessThan.java | 03a146a275566e6260cbb4e590468b6cc2862dc1 | [
"MIT"
] | permissive | marcioaug/genosha | 4823a85b3eaeb9f2915707cc4427e218ad0ba924 | 756e70c835b82c70201ebd2aa458bc95a39e9c69 | refs/heads/master | 2020-03-28T21:45:32.984816 | 2018-09-17T19:53:02 | 2018-09-17T19:53:02 | 149,179,862 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 206 | java | package br.ufal.ic.masg.operations;
import br.ufal.ic.masg.Operation;
public class LessThan implements Operation {
public boolean function(int var1, int var2) {
return var1 >= var2;
}
} | [
"masg@ic.ufal.br"
] | masg@ic.ufal.br |
41ebc1ad76c212f3fa9eda2f255c2d564ada77f4 | b9574932a9cd2127976e4b5fcadef4c74e943b66 | /app/src/main/java/com/example/gorg/monny/ButtonExtendedGestureListener.java | dc09c6c4f80e66df86b40ea535cc3701c1a82564 | [] | no_license | mechos3d/monny_client | fcd7f3ba67ccc3b18caa4ed51f76dc8a681192e6 | e960a583cffcd1abb1f0efdf79eb420acf67e7a3 | refs/heads/master | 2021-02-13T22:52:50.664189 | 2018-01-14T21:42:35 | 2018-01-14T21:42:35 | 244,742,116 | 0 | 0 | null | 2020-10-13T20:02:48 | 2020-03-03T21:08:05 | Java | UTF-8 | Java | false | false | 1,898 | java | package com.example.gorg.monny;
import android.content.Context;
import android.content.Intent;
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.widget.Button;
public class ButtonExtendedGestureListener implements
GestureDetector.OnGestureListener, GestureDetector.OnDoubleTapListener {
protected Button button;
public ButtonExtendedGestureListener(Button b){
super();
button = b;
}
@Override
public boolean onDown(MotionEvent event) {
return true;
}
@Override
public boolean onFling(MotionEvent event1, MotionEvent event2,
float velocityX, float velocityY) {
Context activity = button.getContext();
Intent intent = new Intent(activity, ThirdActivity.class);
activity.startActivity(intent);
return true;
}
@Override
public void onLongPress(MotionEvent event) {
}
@Override
public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX,
float distanceY) {
return true;
}
@Override
public void onShowPress(MotionEvent event) {
}
@Override
public boolean onSingleTapUp(MotionEvent event) {
return true;
}
@Override
public boolean onDoubleTap(MotionEvent event) {
VarStorage.current_sum = 0;
changeCounterOnScreen();
return true;
}
@Override
public boolean onDoubleTapEvent(MotionEvent event) {
return true;
}
@Override
public boolean onSingleTapConfirmed(MotionEvent event) {
VarStorage.change_current_sign();
changeCounterOnScreen();
return true;
}
private void changeCounterOnScreen(){
int sum = VarStorage.current_sum;
String sign = VarStorage.current_sign;
button.setText(sign + " " + sum);
}
}
| [
"gorgolevsky@gmail.com"
] | gorgolevsky@gmail.com |
1e6f8f5250450103465c8836581b1bdfe9300a13 | f5c39c07d9f4f16afdc7440cdba57b04b5897013 | /src/Named_Queries/UserClass.java | c29e0576ea38644500768f62b06909ad13d3a830 | [] | no_license | rajpatel29/Hibernate | b7196a9f917667a097acfe72e9dc3b2f934ff3ae | 26656ad9c01f466cc1b2630b7065300c4c5a0adb | refs/heads/master | 2021-05-30T13:07:39.206691 | 2016-01-21T04:56:40 | 2016-01-21T04:56:40 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 834 | java | package Named_Queries;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedNativeQuery;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
@Entity
@NamedQuery(name = "UserClass.byId", query = "From UserClass where userId > ?")
@NamedNativeQuery(name = "UserClass.byName", query = "select * from USER_CLASS where User_Name = ? " , resultClass = UserClass.class )
@Table(name = "USER_CLASS")
public class UserClass
{
@Id
private int userId;
@Column(name = "User_Name")
private String userName;
public int getUserId() {
return userId;
}
public void setUserId(int userId) {
this.userId = userId;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
}
| [
"rutvikpatel29@gmail.com"
] | rutvikpatel29@gmail.com |
c99b17168949cca80b9f5c30759061a51b140ab3 | d555d24053f8a1ec14ca3035f779efdd69c4f633 | /src/main/java/com/javaee/jefferson/restswagger/config/SwaggerConfig.java | 8ce27e921170f87082e6832b61734c004e9733c9 | [] | no_license | jefferson/rest-swagger | b6230b5d4b3a04367f1a5170b589f7004c8bfce3 | 8377eed5abf9be70582af24a324df57a12da0d71 | refs/heads/master | 2020-03-23T18:59:35.804202 | 2018-07-23T01:42:43 | 2018-07-23T01:42:43 | 141,947,028 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,458 | java | package com.javaee.jefferson.restswagger.config;
import java.util.ArrayList;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.PathSelectors;
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;
@EnableSwagger2
@Configuration
public class SwaggerConfig {
@Bean
public Docket api(){
return new Docket(DocumentationType.SWAGGER_2)
.select()
.apis(RequestHandlerSelectors.any())
.paths(PathSelectors.any())
.build()
.pathMapping("/")
.apiInfo(metaData());
}
private ApiInfo metaData(){
Contact contact = new Contact("Your Name", "https://website.com",
"youremail@gmail.com");
return new ApiInfo(
"Spring Project",
"Spring Rest With Swagger",
"1.0",
"Terms of Service: N/A",
contact,
"Apache License Version 2.0",
"https://www.apache.org/licenses/LICENSE-2.0",
new ArrayList<>());
}
} | [
"jefferson_alvespereira@yahoo.com.br"
] | jefferson_alvespereira@yahoo.com.br |
10ec946de2f1fd06bdbe857f4788e165e37bb62e | da028aa8c2c2bb8aa7ccd1e0bf17cb1d14af8294 | /JspCustTagLibApp/src/com/nt/tags/LabelTag.java | c54a214ea7d27973a6e7b07ace0790745611b39d | [] | no_license | KalyanMaddala/JSP | ad5ec1f35eaff68ecd528b1344e57ac1a5e902ef | 4b452ebe2d4c077cded62a4621e50ea741bc7e41 | refs/heads/master | 2022-06-05T00:19:24.384123 | 2020-04-26T13:44:16 | 2020-04-26T13:44:16 | 258,808,303 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 867 | java | package com.nt.tags;
import java.io.IOException;
import java.util.jar.JarException;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.tagext.TagSupport;
public class LabelTag extends TagSupport {
@Override
public int doStartTag() {
System.out.println("LabelTag:: doStartTag()");
JspWriter out=null;
//get Out object
out=pageContext.getOut();
try{
//print label
out.println("<b> The prime numbers are ");
}
catch(IOException ioe){
ioe.printStackTrace();
}
return SKIP_BODY;
}
@Override
public int doEndTag() {
JspWriter out=null;
System.out.println("LabelTag:: doEndTag()");
//get Out object
out=pageContext.getOut();
try{
out.println("</b>");
}
catch(IOException ioe){
ioe.printStackTrace();
}
return EVAL_PAGE;
}//method
}//class
| [
"kalyanmaddala24@gmail.com"
] | kalyanmaddala24@gmail.com |
8133fe682f496bd548b7a2a8a296c8e22bf14010 | f490fe0929d503502010e18e965999155088fc43 | /credit/credit-core/src/main/java/com/hiveview/credit/api/package-info.java | 744483748f87f94b61409d07884a6ba3d0891d8e | [] | no_license | merlinxqh/scrm | bc1baecf5fb2429e45dc6dd48a31686dee5bc9c2 | 31b5b1b75f5d49e49fbb75e73dbc882f27daf845 | refs/heads/master | 2021-05-05T03:44:01.779039 | 2018-02-07T04:17:02 | 2018-02-07T04:17:02 | 119,787,886 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 111 | java | /**
* Created by leo on 2017/10/20.
* icp对外rpc服务接口实现 包
*/
package com.hiveview.credit.api; | [
"merlinkael@gmail.com"
] | merlinkael@gmail.com |
8a2537cf5c2351f5ee21b123dced26d3b5f37908 | 3d2ef76426323b2a95ec817965f4dd2ad10b5eba | /app/src/main/java/com/martin/filme/persistencia/DbConexao.java | 5035cb42304da3f644e3beea924eb42bb39f1ce3 | [] | no_license | brunorodrigus/AppFilmes | 38691dcaadf68ac354c1da64ff2c9e7b758a9dda | e95cc7de3f337a0545b97e84085997cdd6748dcf | refs/heads/master | 2020-03-22T01:17:57.785532 | 2018-07-01T03:19:45 | 2018-07-01T03:19:45 | 139,296,067 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,793 | java | package com.martin.filme.persistencia;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import com.martin.filme.entidade.Filme;
import java.util.ArrayList;
public class DbConexao extends SQLiteOpenHelper {
private static final String NOME_BASE = "db.martin";
private static final int VARSAO_BASE = 1;
public DbConexao(Context context) {
super(context, NOME_BASE, null, VARSAO_BASE);
}
public long inserir(Filme filme){
ContentValues values = new ContentValues();
values.put("title", filme.getTitulo());
if(filme.getImagem() == null || filme.getImagem().isEmpty())
values.put("image", "https://api.androidhive.info/json/movies/15.jpg");
else
values.put("image", filme.getImagem());
values.put("genre", filme.getGenresSTR());
values.put("rating", filme.getAvaliacao());
values.put("releaseYear", filme.getLancamento());
SQLiteDatabase db = getWritableDatabase();
long id = db.insert("tb_filme", null, values);
db.close();
return id;
}
public void alterar(Filme filme) {
ContentValues values = new ContentValues();
values.put("title", filme.getTitulo());
values.put("image", filme.getImagem());
values.put("genre", filme.getGenresSTR());
values.put("rating", filme.getAvaliacao());
values.put("releaseYear", filme.getLancamento());
String whare = "id = ?";
SQLiteDatabase db = getWritableDatabase();
int id = db.update("tb_filme", values, whare,
new String[]{String.valueOf(filme.getId())});
db.close();
}
public void excluir(long id) {
String whare = "id = ?";
SQLiteDatabase db = getWritableDatabase();
int ret = db.delete("tb_filme", whare,
new String[]{String.valueOf(id)});
db.close();
}
public int getQuantidade(){
SQLiteDatabase db = getReadableDatabase();
String selectQuery = "SELECT * FROM tb_filme";
Cursor cursor = db.rawQuery(selectQuery, null);
return cursor.getCount();
}
public Filme getItem(int posicao){
SQLiteDatabase db = getReadableDatabase();
String selectQuery = "SELECT * FROM tb_filme";
Cursor cursor = db.rawQuery(selectQuery, null);
ArrayList<Filme> filmeLista = new ArrayList<>();
if (cursor.moveToFirst()) {
do {
Filme filme = new Filme();
filme.setId(cursor.getLong(0));
filme.setTitulo(cursor.getString(1));
filme.setImagem(cursor.getString(2));
filme.setGenresSTR(cursor.getString(3));
filme.setAvaliacao(cursor.getString(4));
filme.setLancamento(cursor.getString(5));
filmeLista.add(filme);
} while (cursor.moveToNext());
db.close();
}
return filmeLista.get(posicao);
}
@Override
public void onCreate(SQLiteDatabase sqLiteDatabase) {
String CRIA_TABELA_filme = "CREATE TABLE tb_filme("
+ "id INTEGER PRIMARY KEY AUTOINCREMENT ,"
+ "title text, "
+ "image text, "
+ "genre text, "
+ "rating text, "
+ "releaseYear text )";
sqLiteDatabase.execSQL(CRIA_TABELA_filme);
}
@Override
public void onUpgrade(SQLiteDatabase sqLiteDatabase, int i, int i1) {
String Delete = "DROP TABLE IF EXISTS tb_filmes";
sqLiteDatabase.execSQL(Delete);
onCreate(sqLiteDatabase);
}
}
| [
"rodrigues_bruno96@hotmail.com"
] | rodrigues_bruno96@hotmail.com |
9efb4ed166d91f90a50b76593a8be1ab64afd3a1 | 8fd70b0b2605ba7fd95c42d304740097e5d84cdf | /src/main/java/japsa/bio/tr/ReadAllele.java | a300018a9852dd49479d6bd7ba77de362a7c5d29 | [
"BSD-2-Clause",
"LicenseRef-scancode-other-permissive"
] | permissive | lachlancoin/japsa | 312e6f2778139276ed6feea6f74b6a0246247a69 | 80fddf6d3ce47120d24d65572a14dea2dd570f85 | refs/heads/master | 2022-06-03T18:04:53.317842 | 2021-04-07T12:14:36 | 2021-04-07T12:14:36 | 360,778,111 | 0 | 0 | NOASSERTION | 2021-04-23T05:56:40 | 2021-04-23T05:56:40 | null | UTF-8 | Java | false | false | 1,250 | java | package japsa.bio.tr;
import java.util.Collection;
import java.util.List;
import org.apache.commons.math3.stat.clustering.Cluster;
import org.apache.commons.math3.stat.clustering.Clusterable;
public class ReadAllele implements Clusterable<ReadAllele> {
String readName = "";
public double copy_number;
public ReadAllele(String name, double cn){
readName = name + "";//copy
copy_number = cn;
}
public ReadAllele(double cn){
copy_number = cn;
}
public double distanceFrom(ReadAllele p) {
return Math.abs(copy_number - p.copy_number);
}
public ReadAllele centroidOf(Collection<ReadAllele> pp) {
double sum = 0.0;
for (ReadAllele p:pp){
sum += p.copy_number;
}
return new ReadAllele(sum/pp.size());
}
@Override
public boolean equals(Object o) {
if (!(o instanceof ReadAllele)) {
return false;
}
ReadAllele p = (ReadAllele) o;
return copy_number == p.copy_number;
}
public static double inertia(List<Cluster<ReadAllele>> clusters){
double sum = 0.0;
int count = 0;
for (Cluster<ReadAllele> cluster: clusters){
ReadAllele cenroid = cluster.getCenter();
for (ReadAllele allele:cluster.getPoints()){
sum += allele.distanceFrom(cenroid);
count ++;
}
}
return sum / count;
}
} | [
"ljmcoinwork@gmail.com"
] | ljmcoinwork@gmail.com |
d2c243daa8e16bcec6eae96477013ac4f9c2e346 | 8e2aab27a2ceab9689d56b3cdfa360b4282ebd36 | /core/src/main/java/de/javakaffee/web/msm/SessionValidityInfo.java | 23199edde867bacc070903d4253c26e9b518f86e | [
"Apache-2.0"
] | permissive | eswen/memcached-session-manager | 7f7c9e1bf6d6cbd5f8a270f553696b051a527055 | 99a8b1b0f822bcace8a21599fe9f3323d460730c | refs/heads/master | 2021-01-17T23:26:07.294433 | 2011-12-12T21:26:36 | 2011-12-12T21:26:36 | 2,737,489 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,943 | java | /*
* Copyright 2011 Martin Grotzke
*
* 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 de.javakaffee.web.msm;
import static de.javakaffee.web.msm.TranscoderService.decodeNum;
import static de.javakaffee.web.msm.TranscoderService.encodeNum;
import javax.annotation.Nonnull;
import org.apache.juli.logging.Log;
import org.apache.juli.logging.LogFactory;
/**
* This class defines the format for session validity information stored in memcached for
* non-sticky sessions. This information is used when the container (CoyoteAdapter) tries to
* determine if a provided sessionId is valid when parsing the request.
* <p>
* The stored information contains the maxInactiveInterval (might be session specific),
* lastAccessedTime (used by tomcat7 with STRICT_SERVLET_COMPLIANCE/LAST_ACCESS_AT_START) and
* thisAccessedTime.
* </p>
*
* @author <a href="mailto:martin.grotzke@javakaffee.de">Martin Grotzke</a>
*/
public class SessionValidityInfo {
@SuppressWarnings( "unused" )
private static final Log LOG = LogFactory.getLog( SessionValidityInfo.class );
private final int _maxInactiveInterval;
private final long _lastAccessedTime;
private final long _thisAccessedTime;
public SessionValidityInfo( final int maxInactiveInterval, final long lastAccessedTime, final long thisAccessedTime ) {
_maxInactiveInterval = maxInactiveInterval;
_lastAccessedTime = lastAccessedTime;
_thisAccessedTime = thisAccessedTime;
}
/**
* Creates the name/key that can be used for storing the encoded session validity information.
*/
@Nonnull
public static String createValidityInfoKeyName( @Nonnull final String sessionId ) {
if ( sessionId == null ) {
throw new IllegalArgumentException( "The sessionId must not be null." );
}
return "validity:" + sessionId;
}
/**
* Encode the given information to a byte[], that can be decoded later via {@link #decode(byte[])}.
*/
@Nonnull
public static byte[] encode( final long maxInactiveInterval, final long lastAccessedTime, final long thisAccessedTime ) {
int idx = 0;
final byte[] data = new byte[ 4 + 2 * 8 ];
encodeNum( maxInactiveInterval, data, idx, 4 );
encodeNum( lastAccessedTime, data, idx += 4, 8 );
encodeNum( thisAccessedTime, data, idx += 8, 8 );
return data;
}
/**
* Decode the given byte[] that previously was created via {@link #encode(long, long, long)}.
*/
@Nonnull
public static SessionValidityInfo decode( @Nonnull final byte[] data ) {
int idx = 0;
final int maxInactiveInterval = (int) decodeNum( data, idx, 4 );
final long lastAccessedTime = decodeNum( data, idx += 4, 8 );
final long thisAccessedTime = decodeNum( data, idx += 8, 8 );
return new SessionValidityInfo( maxInactiveInterval, lastAccessedTime, thisAccessedTime );
}
public int getMaxInactiveInterval() {
return _maxInactiveInterval;
}
public long getLastAccessedTime() {
return _lastAccessedTime;
}
public long getThisAccessedTime() {
return _thisAccessedTime;
}
public boolean isValid() {
final long timeNow = System.currentTimeMillis();
final int timeIdle = (int) ((timeNow - _thisAccessedTime) / 1000L);
return timeIdle < _maxInactiveInterval;
}
} | [
"martin.grotzke@javakaffee.de"
] | martin.grotzke@javakaffee.de |
103e295fd8eb1c38831cf78ee6133b917f667602 | 39405dd1bea5f6a03283eb3c79d80f1675f0f18b | /src/test/java/br/com/samarino/security/jwt/TokenProviderTest.java | ab5b6f4df665111ba5dd64436e7040c993687031 | [] | no_license | arturrenann/samarino | a431722b177c94d30b8d4b39a45d830e4fdfb54e | 7fce4b026495d8b576cac8c1ec98bd1998b2eae2 | refs/heads/master | 2021-06-30T05:32:20.657388 | 2018-11-19T23:32:16 | 2018-11-19T23:32:16 | 158,303,526 | 0 | 1 | null | 2020-09-18T06:48:33 | 2018-11-19T23:30:40 | Java | UTF-8 | Java | false | false | 4,030 | java | package br.com.samarino.security.jwt;
import br.com.samarino.security.AuthoritiesConstants;
import java.security.Key;
import java.util.*;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mockito;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.test.util.ReflectionTestUtils;
import io.github.jhipster.config.JHipsterProperties;
import io.jsonwebtoken.Jwts;
import io.jsonwebtoken.SignatureAlgorithm;
import io.jsonwebtoken.io.Decoders;
import io.jsonwebtoken.security.Keys;
import static org.assertj.core.api.Assertions.assertThat;
public class TokenProviderTest {
private final Base64.Encoder encoder = Base64.getEncoder();
private final long ONE_MINUTE = 60000;
private Key key;
private JHipsterProperties jHipsterProperties;
private TokenProvider tokenProvider;
@Before
public void setup() {
jHipsterProperties = Mockito.mock(JHipsterProperties.class);
tokenProvider = new TokenProvider(jHipsterProperties);
key = Keys.hmacShaKeyFor(Decoders.BASE64
.decode("fd54a45s65fds737b9aafcb3412e07ed99b267f33413274720ddbb7f6c5e64e9f14075f2d7ed041592f0b7657baf8"));
ReflectionTestUtils.setField(tokenProvider, "key", key);
ReflectionTestUtils.setField(tokenProvider, "tokenValidityInMilliseconds", ONE_MINUTE);
}
@Test
public void testReturnFalseWhenJWThasInvalidSignature() {
boolean isTokenValid = tokenProvider.validateToken(createTokenWithDifferentSignature());
assertThat(isTokenValid).isEqualTo(false);
}
@Test
public void testReturnFalseWhenJWTisMalformed() {
Authentication authentication = createAuthentication();
String token = tokenProvider.createToken(authentication, false);
String invalidToken = token.substring(1);
boolean isTokenValid = tokenProvider.validateToken(invalidToken);
assertThat(isTokenValid).isEqualTo(false);
}
@Test
public void testReturnFalseWhenJWTisExpired() {
ReflectionTestUtils.setField(tokenProvider, "tokenValidityInMilliseconds", -ONE_MINUTE);
Authentication authentication = createAuthentication();
String token = tokenProvider.createToken(authentication, false);
boolean isTokenValid = tokenProvider.validateToken(token);
assertThat(isTokenValid).isEqualTo(false);
}
@Test
public void testReturnFalseWhenJWTisUnsupported() {
String unsupportedToken = createUnsupportedToken();
boolean isTokenValid = tokenProvider.validateToken(unsupportedToken);
assertThat(isTokenValid).isEqualTo(false);
}
@Test
public void testReturnFalseWhenJWTisInvalid() {
boolean isTokenValid = tokenProvider.validateToken("");
assertThat(isTokenValid).isEqualTo(false);
}
private Authentication createAuthentication() {
Collection<GrantedAuthority> authorities = new ArrayList<>();
authorities.add(new SimpleGrantedAuthority(AuthoritiesConstants.ANONYMOUS));
return new UsernamePasswordAuthenticationToken("anonymous", "anonymous", authorities);
}
private String createUnsupportedToken() {
return Jwts.builder()
.setPayload("payload")
.signWith(key, SignatureAlgorithm.HS512)
.compact();
}
private String createTokenWithDifferentSignature() {
Key otherKey = Keys.hmacShaKeyFor(Decoders.BASE64
.decode("Xfd54a45s65fds737b9aafcb3412e07ed99b267f33413274720ddbb7f6c5e64e9f14075f2d7ed041592f0b7657baf8"));
return Jwts.builder()
.setSubject("anonymous")
.signWith(otherKey, SignatureAlgorithm.HS512)
.setExpiration(new Date(new Date().getTime() + ONE_MINUTE))
.compact();
}
}
| [
"artur.barbosa@basis.com.br"
] | artur.barbosa@basis.com.br |
374c19a989d35af6393092450577b3f91e5e526f | 689cdf772da9f871beee7099ab21cd244005bfb2 | /classes/com/android/dazhihui/ui/delegate/screen/hi.java | 80101a2400a138a3f34e1570dc5232f3fe4e7e8f | [] | no_license | waterwitness/dazhihui | 9353fd5e22821cb5026921ce22d02ca53af381dc | ad1f5a966ddd92bc2ac8c886eb2060d20cf610b3 | refs/heads/master | 2020-05-29T08:54:50.751842 | 2016-10-08T08:09:46 | 2016-10-08T08:09:46 | 70,314,359 | 2 | 4 | null | null | null | null | UTF-8 | Java | false | false | 515 | java | package com.android.dazhihui.ui.delegate.screen;
import android.app.Dialog;
import android.view.View;
import android.view.View.OnClickListener;
class hi
implements View.OnClickListener
{
hi(TransferMenuNew paramTransferMenuNew, Dialog paramDialog) {}
public void onClick(View paramView)
{
this.a.dismiss();
}
}
/* Location: E:\apk\dazhihui2\classes-dex2jar.jar!\com\android\dazhihui\ui\delegate\screen\hi.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | [
"1776098770@qq.com"
] | 1776098770@qq.com |
11bc4a9bf75541b9d3cd59f97b0beab972895ffe | 719577b9fa0c0882557d377a8c8feec2ecb7652a | /src/java/com/hzih/sslvpn/jsonrpc/client/RawResponse.java | c2be576352fefc25621f03005a98bec7e365f818 | [] | no_license | huanghengmin/sslvpn_strategy_check | 6161035902477ac05a438162dd9b4b6cccd5d168 | 34c88ef76b32d57003896cdd6ab9d9b9bcb494e1 | refs/heads/master | 2021-01-01T05:43:31.260765 | 2016-04-16T03:16:29 | 2016-04-16T03:16:29 | 56,363,148 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 4,998 | java | package com.hzih.sslvpn.jsonrpc.client;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.util.List;
import java.util.Map;
import java.util.zip.GZIPInputStream;
import java.util.zip.Inflater;
import java.util.zip.InflaterInputStream;
/**
* Represents the raw HTTP response to a JSON-RPC 2.0 request or notification.
* Can be used to retrieve the unparsed response content and headers.
*
* @since 1.6
* @author Vladimir Dzhuvinov
*/
public class RawResponse {
/**
* The HTTP response headers.
*/
private Map<String,List<String>> headers;
/**
* The HTTP response code.
*/
private int statusCode;
/**
* The HTTP response message.
*/
private String statusMessage;
/**
* The content length.
*/
private int contentLength;
/**
* The content type.
*/
private String contentType;
/**
* The content encoding.
*/
private String contentEncoding;
/**
* The raw HTTP response content.
*/
private String content;
/**
* No public instantiation.
*/
private RawResponse() {}
/**
* Parses the raw HTTP response from the specified URL connection.
*
* @param connection The URL connection, must be in state completed and
* not {@code null}.
*
* @throws java.io.IOException If the response content couldn't be read.
*/
protected static RawResponse parse(final HttpURLConnection connection)
throws IOException {
// Check for HTTP compression
String encoding = connection.getContentEncoding();
InputStream is;
if (encoding != null && encoding.equalsIgnoreCase("gzip"))
is = new GZIPInputStream(connection.getInputStream());
else if (encoding != null && encoding.equalsIgnoreCase("deflate"))
is = new InflaterInputStream(connection.getInputStream(), new Inflater(true));
else
is = connection.getInputStream();
// Read the response content
StringBuilder responseText = new StringBuilder();
BufferedReader input = new BufferedReader(new InputStreamReader(is, "UTF-8"));
String line;
while ((line = input.readLine()) != null) {
responseText.append(line);
responseText.append(System.getProperty("line.separator"));
}
input.close();
RawResponse response = new RawResponse();
response.content = responseText.toString();
// Save HTTP code + message
response.statusCode = connection.getResponseCode();
response.statusMessage = connection.getResponseMessage();
// Save headers
response.headers = connection.getHeaderFields();
response.contentLength = connection.getContentLength();
response.contentType = connection.getContentType();
response.contentEncoding = encoding;
return response;
}
/**
* Gets the status code from the HTTP response message, e.g. 200 on
* success.
*
* @return The HTTP status code, or -1.
*/
public int getStatusCode() {
return statusCode;
}
/**
* Gets the HTTP response status message, if any, returned along with
* the status code from a server.
*
* @return The HTTP status message, or {@code null}.
*/
public String getStatusMessage() {
return statusMessage;
}
/**
* Returns the raw response content.
*
* @return The raw content.
*/
public String getContent() {
return content;
}
/**
* Returns an unmodifiable Map of the header fields. The Map keys are
* Strings that represent the response header field names. Each Map
* value is an unmodifiable List of Strings that represents the
* corresponding field values.
*
* @return A Map of the header fields.
*/
public Map<String,List<String>> getHeaderFields() {
return headers;
}
/**
* Returns the value of the named header field. If called on a
* connection that sets the same header multiple times with possibly
* different values, only the last value is returned.
*
* @param name The name of the header.
*
* @return The value of the named header field, {@code null} if there
* is no such field in the header.
*/
public String getHeaderField(final String name) {
List <String> values = headers.get(name);
if (values == null | values.size() <= 0)
return null;
return values.get(0);
}
/**
* Returns the value of the "Content-Length" header field.
*
* @return The content length of the response, or -1 if the content
* length is not known.
*/
public int getContentLength() {
return contentLength;
}
/**
* Returns the value of the "Content-Type" header field.
*
* @return The content type of the response, or {@code null} if not
* known.
*/
public String getContentType() {
return contentType;
}
/**
* Returns the value of the "Content-Encoding" header field.
*
* @return The content encoding of the response, or {@code null} if not
* known.
*/
public String getContentEncoding() {
return contentEncoding;
}
}
| [
"465805947@QQ.com"
] | 465805947@QQ.com |
9761fe38a22181bd88b1b677c3f7a7af5b98580b | 65bf0c31af6f666148ff2968953d2e11610c1691 | /app/src/main/java/com/example/android/musicapp/DiscoverActivity.java | c06e40df9e9306ba627d95b9ae0e0cee7b728597 | [] | no_license | adrialwal/Music_App | b09e5b320f40537b478da1db6f2bb4d3b9c29097 | d403fc8ec2b4b83a1167bb179ab60d33e15c2b9c | refs/heads/master | 2020-03-25T19:52:02.750861 | 2018-08-09T05:21:13 | 2018-08-09T05:21:13 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 349 | java | package com.example.android.musicapp;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
public class DiscoverActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_discover);
}
}
| [
"adrialhome@adrials-air.lan"
] | adrialhome@adrials-air.lan |
317d8bf04631fe4311892e7de28d0231de164234 | 89cc3936651a2275862376b9fd9d9f46ee6ae7a7 | /Challenge/src/main/java/com/challenge/resolvit/model/ChallengeResponse.java | e9c0ac22655ae708f355a579d08e37318c9b584c | [] | no_license | leandrocohn/CountWords | 07d5b7b087e71ddac648699b3fffb3aebd9e30d9 | c5f20de4b18eb770f5b9e97096d41076d7aebff7 | refs/heads/master | 2021-05-08T01:23:18.789220 | 2017-10-23T14:40:36 | 2017-10-23T14:40:36 | 107,912,804 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,217 | java | package com.challenge.resolvit.model;
import java.util.ArrayList;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonProperty;
public class ChallengeResponse {
private List<WordDTO> results = new ArrayList<WordDTO>();
public List<WordDTO> getResults() {
return results;
}
public void setResults(List<WordDTO> results) {
this.results = results;
}
public void addResult(WordDTO word) {
results.add(word);
}
public static class WordDTO {
private String word;
@JsonProperty("total-occurances")
private Long totalOccurrances;
@JsonProperty("sentence-indexes")
private List<Long> sentenceIndexes = new ArrayList<Long>();
public String getWord() {
return word;
}
public void setWord(String word) {
this.word = word;
}
public Long getTotalOccurrances() {
return totalOccurrances;
}
public void setTotalOccurrances(Long totalOccurrances) {
this.totalOccurrances = totalOccurrances;
}
public List<Long> getSentenceIndexes() {
return sentenceIndexes;
}
public void setSentenceIndexes(List<Long> sentenceIndexes) {
this.sentenceIndexes = sentenceIndexes;
}
public void addSentenceIndex(Long index) {
sentenceIndexes.add(index);
}
}
}
| [
"leandrocohn@gmail.com"
] | leandrocohn@gmail.com |
841404731476b19649410c213dd7e57641f3e954 | 8174b2f881a43612a34773309f20e281244316aa | /configRepo-dao/src/main/java/com/framework/demo/dto/jqgrid/JqGridRow.java | 4fdc0959968fec09ac9fd08f25e80822f0e7cd52 | [] | no_license | wyzhangjie/configRepo | 0154a86078ac7e613abb63844162e42b3b476002 | 953e815e6e0d0cc036ca41cb7f57c594996f2906 | refs/heads/master | 2020-05-29T15:11:12.224623 | 2019-04-17T11:09:42 | 2019-04-17T11:09:42 | 67,579,091 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,200 | java | package com.framework.demo.dto.jqgrid;
/**
Represents a jqGrid row in the data send back as a response to jqGrid AJAX data request.
*/
public class JqGridRow
{
/**
The unique ID of the jqGrid row represented by this instance of <code>JSONGridRow</code>
*/
public String id;
/**
An array of objects representing the cell values of the jqGrid row represented by this instance of <code>JSONGridRow</code>.
The number of elements in this array should equal the number of columns defined in jqGrid colModel.
*/
public Object[] cell;
/**
Initializes a new instance of <code>JSONGridRow</code>.
@param ID The unique ID of the jqGrid row represented by this instance of <code>JSONGridRow</code>
@param cells An array of objects representing the cell values of the jqGrid row represented by this instance of <code>JSONGridRow</code>. The number of elements in this array should equal the number of columns defined in jqGrid colModel.
*/
public JqGridRow(String ID, Object[] cells)
{
id = ID;
cell = cells;
}
}
| [
"dezhanjie@163.com"
] | dezhanjie@163.com |
b24aab6644ad0c408b90fa3e6689b1cd8e7fe55a | 686bac877101fdfbea92c28396399969a0c72df2 | /src/test/java/com/udaan/parkingLot/ParkingLotApplicationTests.java | 5dc16dc2e4e580988b2d17fe35ecb39e79647e36 | [] | no_license | rujhanArora/ParkingLotUdaanSolution | 818310f4ad44236e46ba81c24c62ca14359eecd4 | 70860627b812b640cdfd450edbeaf04334d7976f | refs/heads/main | 2023-07-17T03:45:48.203436 | 2021-08-31T09:08:16 | 2021-08-31T09:08:16 | 401,638,529 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,089 | java | package com.udaan.parkingLot;
import com.udaan.parkingLot.DTOs.CustomerDTO;
import com.udaan.parkingLot.models.*;
import com.udaan.parkingLot.models.parkingSpot.ParkingSpot;
import com.udaan.parkingLot.models.parkingSpot.ParkingSpotType;
import com.udaan.parkingLot.models.parkingSpot.SpotFindStrategy;
import com.udaan.parkingLot.models.parkingSpot.SpotStatus;
import com.udaan.parkingLot.models.vehicle.Vehicle;
import com.udaan.parkingLot.models.vehicle.VehicleType;
import com.udaan.parkingLot.services.*;
import lombok.extern.slf4j.Slf4j;
import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
@SpringBootTest
@Slf4j
class ParkingLotApplicationTests {
@Autowired
CustomerService customerService;
@Autowired
ParkingLotService parkingLotService;
@Autowired
SpotService spotService;
@Autowired
BookingService bookingService;
@Autowired
VehicleService vehicleService;
@Autowired
FloorService floorService;
@Test
void contextLoads() {
ParkingLot parkingLot = parkingLotService.createParkingLot("Udaan Parking");
Assertions.assertThat(parkingLot.getName().equals("Udaan Parking"));
Map<ParkingSpotType, Integer> spotTypeToCapacityForFirstFloor = new HashMap<>();
spotTypeToCapacityForFirstFloor.put(ParkingSpotType.FOUR_WHEELER, 1);
spotTypeToCapacityForFirstFloor.put(ParkingSpotType.TWO_WHEELER, 1);
ParkingLotFloor firstFloor = parkingLotService.addFloor(parkingLot.getId(), "Ground Floor", spotTypeToCapacityForFirstFloor);
Assertions.assertThat(parkingLotService.getParkingLotById(parkingLot.getId()).getFloors().size() == 1);
ParkingSpot carSpot1 = floorService.addSpot(ParkingSpotType.FOUR_WHEELER, firstFloor.getId());
try {
floorService.addSpot(ParkingSpotType.FOUR_WHEELER, firstFloor.getId());
} catch (Exception e) {
log.info(e.getMessage());
}
Assertions.assertThat(carSpot1.getId().equals(spotService.getSpotById(carSpot1.getId())));
ParkingSpot firstBookingCarSlot = spotService.getSpot(VehicleType.FOUR_WHEELER, SpotFindStrategy.RANDOM_EMPTY).get();
Assertions.assertThat(carSpot1.getId().equals(firstBookingCarSlot.getId()));
// ParkingSpot secondBookingCarSlot = spotService.getSpot(VehicleType.FOUR_WHEELER, SpotFindStrategy.RANDOM_EMPTY).get();
// Assertions.assertThat(secondBookingCarSlot == null);
Customer customer = customerService.addCustomer(CustomerDTO.builder().email("rj").name("Rj Arora").build());
Vehicle carVehicle = vehicleService.addVehicle(Vehicle.builder().vehicleNo("HR15G5772").vehicleType(VehicleType.FOUR_WHEELER).customerId(customer.getId()).build());
Assertions.assertThat(carVehicle.getId().equals(vehicleService.filterVehicles(VehicleFilter.builder().vehicleNo(carVehicle.getVehicleNo()).build()).get(0).getId()));
Booking carBooking = bookingService.checkIn(customer.getId(), carVehicle.getId(), firstBookingCarSlot.getId());
Assertions.assertThat(spotService.getSpotById(firstBookingCarSlot.getId()).getSpotStatus().equals(SpotStatus.BOOKED));
Optional<ParkingSpot> secondEmptyCarSpot = spotService.getSpot(VehicleType.FOUR_WHEELER, SpotFindStrategy.RANDOM_EMPTY);
Assertions.assertThat(!secondEmptyCarSpot.isPresent());
try {
bookingService.checkOut(carBooking.getId());
} catch (Exception e) {
log.info("e: " + e.getMessage());
}
bookingService.payForBooking(carBooking.getId());
bookingService.checkOut(carBooking.getId());
Assertions.assertThat(bookingService.getBookingById(carBooking.getId()).getStatus().equals(BookingStatus.CHECKED_OUT));
Optional<ParkingSpot> emptiedSpot = spotService.getSpot(VehicleType.FOUR_WHEELER, SpotFindStrategy.RANDOM_EMPTY);
Assertions.assertThat(emptiedSpot.isPresent());
bookingService.checkIn(customer.getId(), carVehicle.getId(), emptiedSpot.get().getId());
log.info("Bookings for {} => {}", carVehicle.getId(), bookingService.getBookingsByVehicleId(carVehicle.getId()));
}
}
| [
"rujhanarora.96@gmail.com"
] | rujhanarora.96@gmail.com |
dca90d2a90936c9151470660d4315d7203f66662 | f8fd14dbad2acdeba3cd259813bbc20d6824c0ea | /app/src/main/java/com/example/json/Adapter/LaundryListAdapter.java | 4c8768aa4c59064a418a5e04a5817d2b84c23f00 | [] | no_license | adjie123/JSONMobile | fa99d720f5810e1a43862d83c363584be757f1b0 | ca9dd85da934f473f0c91cbb1e407f50d190c2ca | refs/heads/master | 2020-08-03T13:15:45.087082 | 2019-10-14T22:38:11 | 2019-10-14T22:38:11 | 211,764,916 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,663 | java | package com.example.json.Adapter;
import android.content.Context;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.example.json.Model.LaundryModel;
import com.example.json.R;
import java.util.ArrayList;
import java.util.List;
public class LaundryListAdapter extends RecyclerView.Adapter<LaundryListAdapter.MyViewHolder> {
List<LaundryModel> laundryModels;
public LaundryListAdapter(List <LaundryModel> laundryModelList) {
laundryModels = laundryModelList;
}
@NonNull
@Override
public MyViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View mView = LayoutInflater.from(parent.getContext()).inflate(R.layout.row_list_laundry, parent, false);
MyViewHolder mViewHolder = new MyViewHolder(mView);
return mViewHolder;
}
@Override
public void onBindViewHolder(@NonNull MyViewHolder holder, int position) {
holder.tvNama.setText(laundryModels.get(position).getNamaToko());
holder.tvAddress.setText(laundryModels.get(position).getAlamatToko());
}
@Override
public int getItemCount() {
return laundryModels.size();
}
public class MyViewHolder extends RecyclerView.ViewHolder {
public TextView tvNama, tvAddress;
public MyViewHolder(View itemView) {
super(itemView);
tvNama = itemView.findViewById(R.id.tv_name_laundry);
tvAddress = itemView.findViewById(R.id.tv_address_laundry);
}
}
}
| [
"adjiedwi6@gmail.com"
] | adjiedwi6@gmail.com |
709febe55020ce03ec7491de30e593bbd823840a | 341ed102cd8c2e7ab9e07af58daed3c28253c1c9 | /SistemaFat/SistemaFaturamento/src/gcom/cadastro/imovel/FiltroImovelPerfilCapacidadeHidrometro.java | 699158b3910ce076ca742d3d66a94805e5c8eee9 | [] | no_license | Relesi/Stream | a2a6772c4775a66a753d5cc830c92f1098329270 | 15710d5a2bfb5e32ff8563b6f2e318079bcf99d5 | refs/heads/master | 2021-01-01T17:40:52.530660 | 2017-08-21T22:57:02 | 2017-08-21T22:57:02 | 98,132,060 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 383 | java | package gcom.cadastro.imovel;
import java.io.Serializable;
import gcom.util.filtro.Filtro;
public class FiltroImovelPerfilCapacidadeHidrometro extends Filtro implements Serializable {
private static final long serialVersionUID = 1L;
public static final String IMOVEL_PERFIL_ID = "imovelPerfil";
public static final String HIDROMETRO_CAPACIDADE_ID = "hidrometroCapacidade";
}
| [
"renatolessa.2011@hotmail.com"
] | renatolessa.2011@hotmail.com |
698fd07c0e2b38775c5f2bfe0c9e3792ef48eb8d | 3796c118b0f5ae0a28b669c07f78d5974f76cc9a | /src/main/java/inheritance/abstracts/GraphicObject.java | e6271c2ccf2732140d4163b8ab4a5ebd9cbdf4a6 | [] | no_license | murtala/JAVA_CORE | ec598c34362c787360e0b6161b3583f39b12d83e | 305c63c197601f8b2efb9bb6f1149188b3aa531e | refs/heads/master | 2021-01-20T19:56:55.387920 | 2016-07-17T00:15:24 | 2016-07-17T00:15:24 | 62,185,443 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 287 | java | package inheritance.abstracts;
public abstract class GraphicObject {
int x, y;
final int p = 99;
void moveTo(int newX, int newY) {
System.out.println("Moving to "+ "X:"+newX + " Y:"+newY);
}
abstract void draw( int p);
abstract void resize();
}
| [
"moortala@gmail.com"
] | moortala@gmail.com |
275f69e13c83ff5acde5977927c075f976a0f7e4 | 507726bb8a7d373a8f2d22755c448e01e418d54f | /springboot-jpa-mapstruct/src/main/java/me/lukegs7/springboot/mapstruct/dto/mapper/IEntityMapper.java | 76499fe1f9007427223a0876f80fc013f10136a7 | [
"MIT"
] | permissive | lukegs7/java_project | 3de32028352fd3522acef30bb45fc426e093ad20 | c5595d6d3c1c743360bd564d660653847b3ee6d5 | refs/heads/master | 2023-03-01T15:07:05.259021 | 2021-02-02T13:33:03 | 2021-02-02T13:33:03 | 298,026,977 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 229 | java | package me.lukegs7.springboot.mapstruct.dto.mapper;
import java.util.List;
public interface IEntityMapper<D, E> {
D toDto(E e);
E toEntity(D d);
List<D> toDto(List<E> eList);
List<E> toEntity(List<D> dList);
}
| [
"geshuai1992@gmail.com"
] | geshuai1992@gmail.com |
6b2241b6add762064d0ac36c885dc546475481f6 | 7cf2d77f6cdd02d315c62c776b4ba0570d20af33 | /Client.java | 80a1e146bb0c8f622a5e6e4ea88f37c6b7f468b4 | [] | no_license | samibentebbiche/Poo_Project | 26bee264d42affccd75eb637c0ae5f9fcb113983 | beef1dbf2ac6c8b102ee9d7dc3523aff5df694f1 | refs/heads/master | 2020-06-13T17:48:49.110292 | 2019-07-03T23:29:58 | 2019-07-03T23:29:58 | 194,738,616 | 1 | 1 | null | 2019-07-06T10:10:26 | 2019-07-01T20:29:09 | Java | UTF-8 | Java | false | false | 128 | java |
public class Client {
private int numeroCliet;
private String numeroTelephone;
private Adresse adresse;
}
| [
"noreply@github.com"
] | noreply@github.com |
12ca8201afda78e51af47583782fa7ccab2a5412 | dcb64d4a551470dc077b6502a2fe583e78275abc | /Fathom_com.brynk.fathom-dex2jar.src/android/support/v4/internal/view/SupportMenu.java | 29c0851b5dbf49a28e8bd7de68596d9c21893905 | [] | no_license | lenjonemcse/Fathom-Drone-Android-App | d82799ee3743404dd5d7103152964a2f741b88d3 | f3e3f0225680323fa9beb05c54c98377f38c1499 | refs/heads/master | 2022-01-13T02:10:31.014898 | 2019-07-10T19:42:02 | 2019-07-10T19:42:02 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 538 | java | package android.support.v4.internal.view;
import android.view.Menu;
public abstract interface SupportMenu extends Menu
{
public static final int CATEGORY_MASK = -65536;
public static final int CATEGORY_SHIFT = 16;
public static final int USER_MASK = 65535;
public static final int USER_SHIFT = 0;
}
/* Location: C:\Users\c_jealom1\Documents\Scripts\Android\Fathom_com.brynk.fathom\Fathom_com.brynk.fathom-dex2jar.jar
* Qualified Name: android.support.v4.internal.view.SupportMenu
* JD-Core Version: 0.6.0
*/ | [
"jean-francois.lombardo@exfo.com"
] | jean-francois.lombardo@exfo.com |
0f1bc3bc370788646f266db2837bec85dbacfc13 | c54de0cfd01561a4bdb904e8e1d138bb3c13b55c | /app/src/main/java/geek/galaxy/cookieclicker/ExtraCookieMonster.java | 74bf9c61f0112cc6b0c0c5b77004bd97f0d446da | [] | no_license | bbrozyna/cookiecliker | 894430dfef696a092d76b6aacc2adf6d9b9b2807 | 4a13380f0f9376fd16f2f13abe243bb32225ffc7 | refs/heads/master | 2020-04-02T15:35:22.979682 | 2018-10-23T21:38:34 | 2018-10-23T21:38:34 | 154,574,351 | 0 | 0 | null | 2018-10-24T21:57:06 | 2018-10-24T21:57:06 | null | UTF-8 | Java | false | false | 318 | java | package geek.galaxy.cookieclicker;
import android.widget.ImageView;
import android.widget.TextView;
public class ExtraCookieMonster extends Eater {
public ExtraCookieMonster(ImageView _icon, TextView _multiply) {
super(_icon, _multiply);
this.basicScore = 100;
this.cost = 1000;
}
}
| [
"callowiec@gmail.com"
] | callowiec@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.