blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 410 | content_id stringlengths 40 40 | detected_licenses listlengths 0 51 | license_type stringclasses 2 values | repo_name stringlengths 5 132 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringlengths 4 80 | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 684M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 22 values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 132 values | src_encoding stringclasses 34 values | language stringclasses 1 value | is_vendor bool 1 class | is_generated bool 2 classes | length_bytes int64 3 9.45M | extension stringclasses 28 values | content stringlengths 3 9.45M | authors listlengths 1 1 | author_id stringlengths 0 352 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4f773f4de4c5030e8c961e0952c1e96f39a7d040 | e9c64a66abf589b9acab3023888e1e1d7b42b9fa | /app/src/androidTest/java/app/gh/obbang/ExampleInstrumentedTest.java | d80ea99d4b9796347fbc76e1af8a3a4c67cd4135 | [] | no_license | ByeonWoojeong/OBbang | e958b880b8becd17049eac42a2a2111df993c442 | b3605ec6ae37f7bc5eae8979e8658b4aaf4d6bc0 | refs/heads/master | 2020-08-30T17:19:52.737726 | 2019-10-30T04:34:45 | 2019-10-30T04:34:45 | 218,442,448 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 736 | java | package app.gh.obbang;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("app.gh.obbang", appContext.getPackageName());
}
}
| [
"qusdnwjd1009@gmail.com"
] | qusdnwjd1009@gmail.com |
506f8067e1afc8fe87d10a111dc18e596673228a | 465852337e5875dd1034e0078bb843ddebade3c2 | /src/model/Truck.java | 77008d1e94d3a016cad5a446b96df8722727fe45 | [] | no_license | suchithrakuttiyat/java_project | ce4349b846b6d7b3a25934cb42ed151d6e249394 | 7a586d6603ee4bba2cdd2ecbab51868d8c157873 | refs/heads/master | 2023-01-18T23:29:54.788925 | 2020-12-05T23:07:19 | 2020-12-05T23:07:19 | 317,508,381 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,498 | java | package model;
import java.awt.Point;
/**
* Implements a Truck that can move around
* */
public class Truck extends Car {
/**
* constructs a Truck having initial position and initial direction
* @param position initial position of the Truck
* @param direction initial direction of the Truck((East,North,West,South))
*/
public Truck(Point position, String direction) {
super(position, direction);
}
/**
* stores drivers current position's coordinate(front-left point ),
* back-left, front-right ,back-right of the truck
* and returns all the points
* @return the current four points of the car according to the angle
*/
@Override
public Point[] getCoordinates() {
Point[] coordinateArray = new Point[4];
int alpha = getAlpha() % 360;
switch (alpha) {
case 0: {
coordinateArray[0] = getPosition();
coordinateArray[1] = new Point(getPosition().x, getPosition().y-1);
coordinateArray[2] = new Point(getPosition().x+1, getPosition().y);
coordinateArray[3] = new Point(getPosition().x+1, getPosition().y-1);
break;
}
case 90: {
coordinateArray[0] = getPosition();
coordinateArray[1] = new Point(getPosition().x+1, getPosition().y);
coordinateArray[2] = new Point(getPosition().x, getPosition().y+1);
coordinateArray[3] = new Point(getPosition().x+1, getPosition().y+1);
break;
}
case 180: {
coordinateArray[0] = getPosition();
coordinateArray[1] = new Point(getPosition().x, getPosition().y+1);
coordinateArray[2] = new Point(getPosition().x-1, getPosition().y);
coordinateArray[3] = new Point(getPosition().x-1, getPosition().y+1);
break;
}
case 270: {
coordinateArray[0] = getPosition();
coordinateArray[1] = new Point(getPosition().x-1, getPosition().y);
coordinateArray[2] = new Point(getPosition().x, getPosition().y-1);
coordinateArray[3] = new Point(getPosition().x-1, getPosition().y-1);
break;
}
default:
System.out.println("The angle is not 0, 90, 180 or 270.");
break;
}
return coordinateArray;
}
/**
* turns the truck to 90 degree left
* and sets the driver's position according the angle
*/
@Override
public void turnLeft() {
int alpha = getAlpha() % 360;
switch (alpha) {
case 0: {
setPosition(new Point(getPosition().x , getPosition().y-1));
break;
}
case 90: {
setPosition(new Point(getPosition().x+1 , getPosition().y));
break;
}
case 180: {
setPosition(new Point(getPosition().x , getPosition().y+1));
break;
}
case 270: {
setPosition(new Point(getPosition().x-1 , getPosition().y));
break;
}
default:
System.out.println("The angle is not 0, 90, 180 or 270.");
break;
}
setAlpha(alpha+90);
}
/**
* turns the truck to the 90 degree right
* and sets the driver's position according the angle
*/
@Override
public void turnRight() {
int alpha = getAlpha() % 360;
switch (alpha) {
case 0: {
setPosition(new Point(getPosition().x+1 , getPosition().y));
break;
}
case 90: {
setPosition(new Point(getPosition().x , getPosition().y+1));
break;
}
case 180: {
setPosition(new Point(getPosition().x-1 , getPosition().y));
break;
}
case 270: {
setPosition(new Point(getPosition().x , getPosition().y-1));
break;
}
}
int newAlpha = alpha-90;
if (newAlpha < 0) {
newAlpha = 270;
}
setAlpha(newAlpha);
}
/**
* Check if all parts of the the Truck is inside the room.
* @param room_width is the width of the room.
* @param room_length is the length of the room.
*/
@Override
public boolean carInside(int room_width,int room_length) {
Point[] coordinates = getCoordinates();
return !(crashed(coordinates[0], room_width, room_length) || crashed(coordinates[1], room_width, room_length) ||
crashed(coordinates[2], room_width, room_length) || crashed(coordinates[3], room_width, room_length));
}
/**
* checks if all the parts(front-left,back-left,front-right,back-right)
* of the Truck are inside the room
* @param position the position of each part of the truck
* @param room_width is the width of the room.
* @param room_length is the length of the room.
*/
private boolean crashed(Point position, int room_width,int room_length) {
return (position.getX() <0) || (position.getX() >= room_length) ||(position.getY() < 0) || (position.getY() >= room_width );
}
}
| [
"suchithrakuttiyat@gmail.com"
] | suchithrakuttiyat@gmail.com |
844bcbb48fec73a2cbf09ecde6d2a6f607007284 | 1da41bd52eaa6716c2da664f5af3f8e8f3c2007a | /src/de/timherbst/wau/view/lookup/SelectAuswertungDialog.java | d785f815dad2240f60fb83d1ce4c8982c2a5d174 | [
"MIT"
] | permissive | rellit/wekaflott | 519699d3a7133cfbc1cb7eadd67b9c2d7a4e9aa4 | 0efa6d39771a1519b31f99cbe03ae6533e0c3f8b | refs/heads/master | 2023-01-21T09:31:16.053646 | 2023-01-16T07:56:53 | 2023-01-16T07:56:53 | 12,952,276 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,231 | java | package de.timherbst.wau.view.lookup;
import java.awt.Component;
import java.awt.Point;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
import java.io.StringWriter;
import java.io.Writer;
import java.util.Arrays;
import java.util.ResourceBundle;
import java.util.Vector;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JComboBox;
import javax.swing.JDialog;
import org.javabuilders.swing.SwingJavaBuilder;
import de.axtres.logging.main.AxtresLogger;
import de.timherbst.wau.application.Application;
import de.timherbst.wau.domain.Mannschaft;
import de.timherbst.wau.domain.WettkampfTag;
@SuppressWarnings("serial")
public class SelectAuswertungDialog extends JDialog {
private JComboBox<String> typ;
private JComboBox<?> auswahl;
public SelectAuswertungDialog() {
SwingJavaBuilder.build(this, loadYaml(), new ResourceBundle[0]);
setTitle("Bitte auswählen");
setModal(true);
typ.setModel(new DefaultComboBoxModel<String>(new Vector<String>(Arrays.asList("Riegen", "Wettkämpfe", "Mannschaften"))));
fillAuswahl();
typ.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
if (ItemEvent.SELECTED == e.getStateChange()) {
fillAuswahl();
pack();
}
}
});
pack();
setLocationRelativeTo(Application.getMainFrame());
}
private String loadYaml() {
try {
InputStream is = getClass().getResourceAsStream("/de/timherbst/wau/view/lookup/SelectAuswertungDialog.yml");
if (is != null) {
Writer writer = new StringWriter();
char[] buffer = new char[1024];
try {
Reader reader = new BufferedReader(new InputStreamReader(is, "UTF-8"));
int n;
while ((n = reader.read(buffer)) != -1) {
writer.write(buffer, 0, n);
}
} finally {
is.close();
}
return writer.toString();
} else {
return "";
}
} catch (Exception e) {
AxtresLogger.error("SelectAuswertungDialog", e);
return "";
}
}
private void fillAuswahl() {
if (typ.getSelectedItem() != null) {
if ("Mannschaften".equals(typ.getSelectedItem()))
auswahl.setModel(new DefaultComboBoxModel(WettkampfTag.get().getMannschaften()));
if ("Wettkämpfe".equals(typ.getSelectedItem()))
auswahl.setModel(new DefaultComboBoxModel(WettkampfTag.get().getWettkaempfe()));
if ("Riegen".equals(typ.getSelectedItem()))
auswahl.setModel(new DefaultComboBoxModel(WettkampfTag.get().getRiegen()));
} else {
auswahl.setModel(new DefaultComboBoxModel());
}
}
public void show(Component relativeTo) {
setLocationRelativeTo(relativeTo);
setVisible(true);
}
public void show(Point at) {
setLocation(at);
setVisible(true);
}
public void show(int x, int y) {
setLocation(x, y);
setVisible(true);
}
public void onSelect(Object o) {
}
public void onCancel() {
}
public void cancel() {
onCancel();
setVisible(false);
}
public void ok() {
onSelect(auswahl.getSelectedItem());
setVisible(false);
}
}
| [
"mail@timherbst.de"
] | mail@timherbst.de |
66f14558c2a04e7ba01ba609a90d4dfe10089c38 | 7f21482fdcab9c425fc1ef396c2aa60beb65eed3 | /src/main/java/com/privaterestaurant/domain/Module.java | faab9aa9f748a611928dd1eecb625a7e423140d0 | [] | no_license | StoBrothers/privaterestaurant | a42586bff5c7e77f8bbd91e47ddfc64db1b0d536 | bf7c5bfa8543f1e385c3b21f0bf2afd219cde3af | refs/heads/master | 2021-01-18T21:30:49.942180 | 2016-05-24T07:58:56 | 2016-05-24T07:58:56 | 55,802,774 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 656 | java | package com.privaterestaurant.domain;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
/**
* Module entity.
*
* @author Sergey Stotskiy
*
*/
@SuppressWarnings("serial")
@Entity
public class Module implements Serializable {
@Id
@GeneratedValue
private Long id;
@Column(nullable = false, length = 255)
private String name;
public Long getId() {
return this.id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
} | [
"storikshutski@mail.ru"
] | storikshutski@mail.ru |
07078aedbe530f9764698416fa253a1fdaa11438 | dc7550511a160c50db981981751830d752f342ac | /src/main/java/com/xingying/shopping/master/service/Impl/MessageServiceImpl.java | 07a532fd10308360f66a377d1083998a9754703e | [] | no_license | SilentFlower/xingYing-master | 392636597e9a42c1f1ba5e3685d6a541557b4c1a | 3997207468e0eb9c60e3bc4a8929692c3622b1e0 | refs/heads/main | 2023-06-03T00:57:03.816104 | 2021-06-16T10:53:05 | 2021-06-16T10:53:05 | 351,686,291 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,160 | java | package com.xingying.shopping.master.service.Impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.xingying.shopping.master.common.entitys.page.PageQueryEntity;
import com.xingying.shopping.master.entity.Message;
import com.xingying.shopping.master.dao.MessageMapper;
import com.xingying.shopping.master.service.MessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* <p>
* 服务实现类
* </p>
*
* @author zhaoweihao
* @since 2021-05-18
*/
@Service
public class MessageServiceImpl extends ServiceImpl<MessageMapper, Message> implements MessageService {
@Autowired
private MessageMapper messageMapper;
@Override
public PageInfo<Message> getListByPage(PageQueryEntity<Message> pageQueryEntity) {
PageHelper.startPage(pageQueryEntity.getPageNumber(), pageQueryEntity.getPageSize());
List<Message> list = messageMapper.getListByPage(pageQueryEntity.getData());
return new PageInfo<>(list);
}
}
| [
"747671555@qq.com"
] | 747671555@qq.com |
e2b4a5e18cd6eb3d3172727e3502baba10556d28 | 11ba08b55c2f57337bb4bea427e9b73965177ac8 | /wwweqwe/src/application/Main.java | 741cb96948a0f7d581a009d0b36120a86fbe1f81 | [] | no_license | quadzero4/soundMagic | 845b18971c1580123d111070338b43e12f7f907c | 76e9d83307199d11d4f144d5e6d79ee5fa44580a | refs/heads/master | 2022-03-31T20:22:07.168591 | 2020-01-21T00:04:41 | 2020-01-21T00:04:41 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 711 | java | package application;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
public class Main extends Application {
@Override
public void start(Stage primaryStage) {
try {
Parent root = (Parent)FXMLLoader.load(getClass().getResource("TVM.fxml"));
Scene scene = new Scene(root);
primaryStage.setTitle("The Voice");
primaryStage.setScene(scene);
primaryStage.setWidth(1000);
primaryStage.setHeight(1000);
primaryStage.setResizable(false);
primaryStage.show();
} catch(Exception e) {
e.printStackTrace();
}
}
public static void main(String[] args) {
launch(args);
}
}
| [
"59907838+qurdzero@users.noreply.github.com"
] | 59907838+qurdzero@users.noreply.github.com |
8243f87533583951378c97d3b521e381f7a2f248 | 52d44d9f7d9f85e2e5ffdc392e696a6e2bf311a1 | /web/src/main/java/pl/ap/web/controller/IndexController.java | 461bbf3b7ed146d6601667db87979daeda8f36c1 | [] | no_license | p4welo/active-portal | 8723c4e7c788439ddb920f3251267691d703367e | 1301f8477043dd7cf0721990752fd49931b7fc08 | refs/heads/master | 2021-01-17T07:51:16.202489 | 2018-03-05T23:28:22 | 2018-03-05T23:28:22 | 19,733,389 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 517 | java | package pl.ap.web.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
/**
* Created by PARADOMS on 15-07-22.
*/
@Controller
public class IndexController {
@RequestMapping(value = "/")
public String index() {
return "index";
}
@RequestMapping(value = "/login")
public String login() {
return "login";
}
@RequestMapping(value = "/home")
public String home() {
return "home";
}
}
| [
"radomskip@ryanair.com"
] | radomskip@ryanair.com |
37011281d4cd2886e584fef47111048ad0131dc0 | e48985fdf73f191445798e79ae2813e987cb150c | /src/ch14/_04_Outter2.java | 713fff100c32c409e93ba4abc4b28d0dca426b1a | [] | no_license | behappyleee/JavaTutorial | 755212831fb2a79f614dbac3449118ab0b326633 | 83519e877fd8f236165ae0d672a0d5cbcce99366 | refs/heads/master | 2023-03-06T08:00:41.856955 | 2021-02-17T13:28:47 | 2021-02-17T13:28:47 | 339,708,368 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 97 | java | package ch14;
//익명 내부 클래스 - 458page
public class _04_Outter2 {
}
| [
"dhfhfkwhdk@naver.com"
] | dhfhfkwhdk@naver.com |
88e71de02e6f7e7a94771543e012c2dc1b5876e1 | 610e5ee6a422b37408ef27ba3e23aa12ee4c46b4 | /MbusClient/src/main/java/me/aegorov/smarthome/mbusclient/app/ConfigureDB.java | f5b57098192a62f0076965c4b5ffcd75a77286cc | [] | no_license | egorovantony/smartHome | a7edf18e618825341c8d7a53145ff2cb3b1c8d5f | 48c5a8181e4b858f26af23016ad6d81c6a8517a9 | refs/heads/master | 2021-01-23T14:47:30.787131 | 2017-06-03T17:15:52 | 2017-06-03T17:15:52 | 93,260,720 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,511 | java | package me.aegorov.smarthome.mbusclient.app;
import java.io.*;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.*;
/**
* Created by anton on 2/14/17.
*/
public class ConfigureDB {
private static final String DB_DRIVER = "com.mysql.jdbc.Driver";
private String workDir = "";
private String dbUrl = "";
private String dbUser = "";
private String dbPass = "";
private String ddlCreate = "";
private List<String> sqlFiles = new ArrayList<>();
public ConfigureDB(String workDir, String Url, String User, String Pass){
this.dbUrl = Url;
this.dbUser = User;
this.dbPass = Pass;
this.workDir = workDir;
this.ddlCreate =
this.workDir + "/" +
ConfigureEnvironment.DIR_SQL + "/" +
ConfigureEnvironment.FILE_DDL_CREATE;
}
public void exec() throws MBClientException{
typeConnParams();
List<String> stmts = new ArrayList<>();
List<String> stmtsTmp = new ArrayList<>();
for (String sqlFile : sqlFiles) {
stmtsTmp.clear();
stmtsTmp = parseToStatements(readFile(sqlFile));
if (!stmtsTmp.isEmpty()){
stmts.addAll(stmtsTmp);
}
}
execQueries(stmts);
}
private void typeConnParams() throws MBClientException{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
Scanner scanner = new Scanner(System.in);
String pathDdlFile = "";
System.out.print("SQL instruction files (or type Enter for default setting):");
try{
pathDdlFile = br.readLine();
}catch (IOException ex){
throw new MBClientException(ex);
}
if (pathDdlFile.equals("")){
this.sqlFiles.add(this.ddlCreate);
}else{
String[] split = pathDdlFile.split(",");
this.sqlFiles = Arrays.asList(split);
}
}
private void execQueries(List<String> strStmts) throws MBClientException{
Connection conn = null;
Statement stmt = null;
try {
Class.forName(DB_DRIVER);
System.out.println("Connection to database...");
conn = DriverManager.getConnection(dbUrl, dbUser, dbPass);
System.out.println("OK");
stmt = conn.createStatement();
for (String strStmt : strStmts) {
System.out.println("Call: " + strStmt);
stmt.execute(strStmt);
System.out.println("OK");
}
System.out.println("All queries was execute OK");
}catch (Exception ex){
throw new MBClientException(ex);
}
finally {
try{
if (stmt != null) {
stmt.close();
}
}catch(SQLException ex){
// nothing
}
try{
if (conn != null){
conn.close();
}
}catch (SQLException ex){
// nothing
}
}
}
private String readFile(String fileName) throws MBClientException{
File file = new File(fileName);
StringBuilder sb = new StringBuilder();
try(FileInputStream fInput = new FileInputStream(file)){
int i = 0;
do{
i = fInput.read();
if (i != -1) {
sb.append((char) i);
}
}while(i != -1);
}catch (IOException ex){
throw new MBClientException(ex);
}
return sb.toString();
}
private List<String> parseToStatements(String resource){
List<String> sts = new ArrayList<>();
List<String> rows = Arrays.asList(resource.split("\\n"));
String st = "";
Iterator<String> resIter = rows.iterator();
while (resIter.hasNext()) {
String currRow = resIter.next();
if (currRow.length() < 3){
continue;
}
if (currRow.substring(0,2).equals("<<")){
if (st != null){
sts.addAll(Arrays.asList(st.split(";")));
}
st = "";
}else if (currRow.substring(0,2).equals(">>")){
}else{
st += currRow;
}
}
return sts;
}
}
| [
"egorovanton@hotmail.com"
] | egorovanton@hotmail.com |
49be0daf577eb3e393e449295d4312efc6ce1aca | 2117d2b52810a640f801113d5d1d1119ea9a684c | /src/com/yufan/operation/Sub.java | d1e8a64c226e45303bf4212114601f9cd52294c6 | [] | no_license | yufanq/SSMDome | bc7da2569a9f57432f4b20d983c9d48521ff3193 | ff25aa02a0ccf7e9bcc08451c79171a95693d124 | refs/heads/master | 2020-03-17T22:52:35.750487 | 2018-05-19T02:10:18 | 2018-05-19T02:10:18 | 134,021,554 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 288 | java | package com.yufan.operation;
/**
*
* @ClassName: Sub
* @Description:
* @author 雨ゆこ
* @date 2018年3月7日
*
*
*/
public class Sub extends Operator{
@Override
public double getResult(double n1, double n2) {
// TODO Auto-generated method stub
return n1 + n2;
}
}
| [
"yufan"
] | yufan |
39fa5284248589f44c8db60457caa7151b225d84 | 7a36046b9d2a91c14cf440f48a4498ef86d80d4d | /src/picoyplacapredictor/dto/DayRestrictionsDto.java | fb9f11fa6e8c7d65764b5978fd1cc69bda91498f | [] | no_license | ibarrae/Pico-y-Placa-Validator | 67a6593d6fcabe2888b7a92cc9ddc48f27d0230a | ee1e874985ac164c1d1e1326450aeabdcc8406c2 | refs/heads/master | 2020-03-18T12:18:53.869537 | 2018-05-24T16:46:08 | 2018-05-24T16:46:08 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 989 | 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 picoyplacapredictor.dto;
import java.util.List;
/**
*
* @author Esteban Ibarra
*/
public class DayRestrictionsDto {
private final Integer dayOftheWeek;
private final List<Integer> digits;
private final List<HourRestrictionDto> hourRestrictions;
public DayRestrictionsDto(Integer dayOftheWeek, List<Integer> digits, List<HourRestrictionDto> hourRestrictions) {
this.dayOftheWeek = dayOftheWeek;
this.digits = digits;
this.hourRestrictions = hourRestrictions;
}
public Integer getDayOftheWeek() {
return dayOftheWeek;
}
public List<Integer> getDigits() {
return digits;
}
public List<HourRestrictionDto> getHourRestrictions() {
return hourRestrictions;
}
}
| [
""
] | |
5cf7a4249985d6c6654db58302e6a6251671e3e3 | 6576917a4b29207d7b0778ba8bf45d1081a45a66 | /order/src/main/java/com/yami/order/dto/Order.java | fe01914e37b09d21e76786a8a776415734778eb1 | [] | no_license | yami007/distributedTx | e86a6873e64f6acd865f331f3506752f2321be50 | 526743c9b61706f7f3a9cd61c0ae772ff333d4ce | refs/heads/master | 2022-06-23T02:14:23.240147 | 2019-07-06T16:06:29 | 2019-07-06T16:06:29 | 195,547,351 | 0 | 0 | null | 2022-06-17T02:16:05 | 2019-07-06T14:17:39 | Java | UTF-8 | Java | false | false | 1,634 | java | package com.yami.order.dto;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import java.io.Serializable;
import java.time.ZonedDateTime;
/**
* 实体类
* @author Administrator
*
*/
@Entity(name="tb_order")
public class Order implements Serializable{
@Id
@GeneratedValue
private Long id;//ID
private String uuid;
private Long customerId;
private String title;
private Long ticketNum;
private int amount;
private String status;
private String reason;
private ZonedDateTime creatDate;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getUuid() {
return uuid;
}
public void setUuid(String uuid) {
this.uuid = uuid;
}
public Long getCustomerId() {
return customerId;
}
public void setCustomerId(Long customerId) {
this.customerId = customerId;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public Long getTicketNum() {
return ticketNum;
}
public void setTicketNum(Long ticketNum) {
this.ticketNum = ticketNum;
}
public int getAmount() {
return amount;
}
public void setAmount(int amount) {
this.amount = amount;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getReason() {
return reason;
}
public void setReason(String reason) {
this.reason = reason;
}
public ZonedDateTime getCreatDate() {
return creatDate;
}
public void setCreatDate(ZonedDateTime creatDate) {
this.creatDate = creatDate;
}
}
| [
"yami19931023@163.com"
] | yami19931023@163.com |
a263ec1f5fa7d7117a5385b079a9b79c36d0c054 | 880aea3d7667a20e2b41c2bf3e130125a40c01f0 | /app/jobs/EPSGAdder.java | 2c568c1387f99f56e7e5f73be157071c02cfc49e | [] | no_license | dunaway87/automated-shapefile-importer | 8ec6bef7ae5d5480c0eb05beb4f934bd6612a9e5 | d5e6023ada52b9522109e706e9c086410c9b464e | refs/heads/master | 2021-01-01T18:34:11.862723 | 2014-04-29T07:02:26 | 2014-04-29T07:02:26 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,282 | java | package jobs;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.util.List;
import javax.persistence.Query;
import play.Logger;
import play.Play;
import play.db.jpa.JPA;
import play.jobs.Job;
import play.vfs.VirtualFile;
public class EPSGAdder extends Job{
public void doJob(){
try {
addEPSGs();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public static void addEPSGs() throws IOException{
JPA.em().createNativeQuery("Delete from epsg_lookup").executeUpdate();
File file = VirtualFile.fromRelativePath("conf/epsgs").getRealFile();
FileReader reader;
reader = new FileReader(file);
BufferedReader br = new BufferedReader(reader);
String line;
while((line = br.readLine()) != null){
if(line.contains("INSERT")){
JPA.em().createNativeQuery(line).executeUpdate();
}
}
br.close();
List<Object[]> list = JPA.em().createNativeQuery("Select * from epsg_lookup").getResultList();
int count = 0;
Logger.info("number of rows in looup table ? %s", list.size());
String URL = "jdbc:postgresql://"+Play.configuration.getProperty("ipaddress")+"/"+Play.configuration.getProperty("database")+"?user="+Play.configuration.getProperty("username")+"&password="+Play.configuration.getProperty("password");
Connection conn = null;
try {
conn = DriverManager.getConnection(URL);
} catch (Exception e){
}
JPA.em().flush();
JPA.em().getTransaction().commit();
JPA.em().getTransaction().begin();
for(int i = 0; i< list.size(); i++){
try{
String authName = (String)list.get(i)[1];
if(authName.contains("RI")){
String qur = "insert into spatial_ref_sys values ("+list.get(i)[0]+",'"+list.get(i)[1]+"',"+list.get(i)[2]+",'"+list.get(i)[3]+"','"+list.get(i)[4]+"')";
Logger.info(qur);
PreparedStatement pstmt = conn.prepareStatement(qur);
Logger.info("worked? %s",pstmt.executeUpdate());
}
} catch(Exception e){
Logger.error("%s", e);
count++;
}
}
Logger.info("worked %s didn't work %s", list.size()-count, count);
}
}
| [
"johnmarc@axiomalaska.com"
] | johnmarc@axiomalaska.com |
fde81ff3207ca9268ec99e94ab148ef9082a8c36 | ba103fd368ec59c0c07428f2b39607e4eb5ef5ed | /src/main/java/br/hotelEveris/app/request/ClienteRequest.java | 7116efad3c5cc42c25fe4148632d41d950d733b5 | [] | no_license | gbuglian/becajava.hoteleveris | de46e1c5821db9fc2409ec7171c337a48a91779a | 93ebb48aca50d00a8077c26ca2d1a0f6425fa22b | refs/heads/master | 2023-01-13T06:26:32.046333 | 2020-11-20T04:23:38 | 2020-11-20T04:23:38 | 312,364,270 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 622 | java | package br.hotelEveris.app.request;
public class ClienteRequest {
private String nome;
private String cpf;
private String hash;
public ClienteRequest(String nome, String cpf, String hash) {
super();
this.nome = nome;
this.cpf = cpf;
this.hash = hash;
}
public ClienteRequest() {
super();
}
public String getNome() {
return nome;
}
public void setNome(String nome) {
this.nome = nome;
}
public String getCpf() {
return cpf;
}
public void setCpf(String cpf) {
this.cpf = cpf;
}
public String getHash() {
return hash;
}
public void setHash(String hash) {
this.hash = hash;
}
}
| [
"gbuglian@everis.com"
] | gbuglian@everis.com |
24d7e9903fdec8f32745fa87eb1febdfe10b5d55 | f21345d46c46c8bb39fda37ca37c3bf0d3989c09 | /src/main/java/com/example/vertx/starter/worker/WorkerExample.java | e377a72a711e0db85b67be17935304511954b4db | [] | no_license | senaevciguler/vertx-core-examples | 8cd3ebb7ce9bd17aa4215e42942a2ad353d4433c | d77b0d43966cf440e532b7ac4238bb02861ddf21 | refs/heads/master | 2023-06-27T09:08:12.595748 | 2021-07-29T20:08:40 | 2021-07-29T20:08:40 | 390,838,853 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,268 | java | package com.example.vertx.starter.worker;
import io.vertx.core.AbstractVerticle;
import io.vertx.core.DeploymentOptions;
import io.vertx.core.Promise;
import io.vertx.core.Vertx;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class WorkerExample extends AbstractVerticle {
private static final Logger log = LoggerFactory.getLogger(WorkerExample.class);
public static void main(String[] args) {
var vertx= Vertx.vertx();
vertx.deployVerticle(new WorkerExample());
}
@Override
public void start(Promise<Void> startPromise) throws Exception {
vertx.deployVerticle(new WorkerVerticle(),
new DeploymentOptions()
.setWorker(true)
.setWorkerPoolSize(1)
.setWorkerPoolName("my-worker-verticle"));
startPromise.complete();
executed();
}
private void executed() {
vertx.executeBlocking(event -> {
log.debug("executing blocking code");
try{
Thread.sleep(5000);
event.complete();
}catch (InterruptedException e){
log.error("failed:",e);
event.fail(e);
}
}, result ->{
if(result.succeeded()){
log.debug("blocking call done");
}else{
log.debug("blocking call failed due to:", result.cause());
}
});
}
}
| [
"senaevci@gmail.com"
] | senaevci@gmail.com |
ae5a09c947e53e2e95427cc911d665eb5bc3174c | c96c44955a44881e97e8ac43170b65a31ade7736 | /src/main/java/com/daychen/entity/ResultStatus.java | bcf61114ffdea82d2fbc42efdf496bcea8a5b559 | [] | no_license | dayjazz/continueup | 6140aa54b8bef4d87f0cf231b5e4289f1b2dcbeb | e7900de7926233f1364c60eb770b13dbf9c82ebd | refs/heads/master | 2020-04-26T01:45:28.887167 | 2019-03-01T01:26:36 | 2019-03-01T01:26:36 | 173,213,813 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 775 | java | package com.daychen.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
/**
* 结果类型枚举
* Created by 超文 on 2017/5/2.
* version 1.0
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum ResultStatus {
/**
* 1 开头为判断文件在系统的状态
*/
IS_HAVE(100, "文件已存在!"),
NO_HAVE(101, "该文件没有上传过。"),
ING_HAVE(102, "该文件上传了一部分。");
private final int value;
private final String reasonPhrase;
ResultStatus(int value, String reasonPhrase) {
this.value = value;
this.reasonPhrase = reasonPhrase;
}
public int getValue() {
return value;
}
public String getReasonPhrase() {
return reasonPhrase;
}
}
| [
"846566240@qq.com"
] | 846566240@qq.com |
ba12c2faad7898a655e164f20b40cfd271a9e7ed | 197cbc562d79bbf4b1e624587d5891ac374c7458 | /course4/src/main/java/com/tora/benchmarks/states/RepoState.java | a158890b5b8a77306fc9718ed3895ba59e5fd578 | [
"Apache-2.0"
] | permissive | yohlulz/MLE5109-Course-samples | 5b1c3e607112b2a05d43586d4e8d47173cd27201 | dc61be510bcb5d9f2bf12575027ae03030fdd333 | refs/heads/master | 2021-08-30T16:48:03.576238 | 2017-12-18T18:36:05 | 2017-12-18T18:36:05 | 106,093,784 | 2 | 3 | null | null | null | null | UTF-8 | Java | false | false | 1,010 | java | package com.tora.benchmarks.states;
import com.tora.benchmarks.repository.InMemoryRepository;
import com.tora.benchmarks.repository.Order;
import org.openjdk.jmh.annotations.*;
import java.util.stream.IntStream;
/**
* @author Ovidiu Maja<ovi.dan89@gmail.com>
* @version Oct 18, 2017
*/
@State(Scope.Benchmark)
public class RepoState {
@Param
private RepositorySupplier repositorySupplier;
public InMemoryRepository<Order> orders;
/* run before each benchmark */
@Setup
public void setUp(SizeState sizeState) {
System.out.println(getClass().getSimpleName() + " > setup > populate");
orders = repositorySupplier.get();
IntStream.rangeClosed(1, sizeState.size)
.mapToObj(Order::new)
.forEach(orders::add);
}
/* run after each benchmark */
@TearDown
public void tearDown() {
System.out.println(getClass().getSimpleName() + " > teardown > clear");
orders.clear();
System.gc();
}
}
| [
"ovi.dan89@gmail.com"
] | ovi.dan89@gmail.com |
b8eec32e106d2b6f30ffca60a399238a330e3113 | f431e39eb2c1ce4eaa9732a3c88470fcc20b8ded | /carroll-monitor-application/src/main/java/com/carroll/monitor/analyzer/config/WebSocketConfig.java | dcf851e83ba848110fe706f1556c81c9ee50393e | [] | no_license | carroll0911/carroll-monitor | 138a50fd70fb0746d22ad57fb676668cf89bd4fa | 8584d2927bf03b6095003dd090676a55dc0d3eba | refs/heads/master | 2023-07-28T09:18:52.880665 | 2020-03-27T05:34:35 | 2020-03-27T05:34:35 | 246,769,649 | 1 | 0 | null | 2023-07-07T21:15:41 | 2020-03-12T07:26:02 | Java | UTF-8 | Java | false | false | 1,021 | java | package com.carroll.monitor.analyzer.config;
import org.springframework.context.annotation.Configuration;
import org.springframework.messaging.simp.config.MessageBrokerRegistry;
import org.springframework.web.socket.config.annotation.AbstractWebSocketMessageBrokerConfigurer;
import org.springframework.web.socket.config.annotation.EnableWebSocket;
import org.springframework.web.socket.config.annotation.EnableWebSocketMessageBroker;
import org.springframework.web.socket.config.annotation.StompEndpointRegistry;
/**
* WebSocket 配置
* @author: carroll
* @date 2019/9/9
*/
@Configuration
@EnableWebSocketMessageBroker
@EnableWebSocket
public class WebSocketConfig extends AbstractWebSocketMessageBrokerConfigurer {
@Override
public void registerStompEndpoints(StompEndpointRegistry registry) {
registry.addEndpoint("/endpointWisely").withSockJS();
}
@Override
public void configureMessageBroker(MessageBrokerRegistry registry) {
registry.enableSimpleBroker("/topic");
}
}
| [
"hongbo.he@timanetworks.com"
] | hongbo.he@timanetworks.com |
da0892c0be82f32aa8efd8c4c32312061bed0a38 | 96c0bc11740e0d574513f9941d5fe0f4fe29c70d | /ssm-crud/src/main/java/com/bingo/crud/dao/DepartmentMapper.java | e94a03c49c6e3a5c7b41e2bb48d5f4adac3af455 | [] | no_license | 10bingo/SSM_CURD | 53a79f0cbae0157b5c944e111cd56d9bbcb3a6e0 | c62d4552234e4bdec2b7f76ddf72a8d1f9970b65 | refs/heads/master | 2020-04-14T23:07:41.845608 | 2019-01-05T07:12:25 | 2019-01-05T07:12:25 | 164,190,875 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 896 | java | package com.bingo.crud.dao;
import com.bingo.crud.bean.Department;
import com.bingo.crud.bean.DepartmentExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface DepartmentMapper {
long countByExample(DepartmentExample example);
int deleteByExample(DepartmentExample example);
int deleteByPrimaryKey(Integer deptId);
int insert(Department record);
int insertSelective(Department record);
List<Department> selectByExample(DepartmentExample example);
Department selectByPrimaryKey(Integer deptId);
int updateByExampleSelective(@Param("record") Department record, @Param("example") DepartmentExample example);
int updateByExample(@Param("record") Department record, @Param("example") DepartmentExample example);
int updateByPrimaryKeySelective(Department record);
int updateByPrimaryKey(Department record);
} | [
"bingo@bingo.com"
] | bingo@bingo.com |
0860ceb24c9816f8d7efd918954eedf7592b48cd | 3abd77888f87b9a874ee9964593e60e01a9e20fb | /sim/EJS/OSP_core/src/org/opensourcephysics/media/gif/GifVideoRecorder.java | e4620ba46c3511ccda4f7f40419806170d341a2e | [
"MIT"
] | permissive | joakimbits/Quflow-and-Perfeco-tools | 7149dec3226c939cff10e8dbb6603fd4e936add0 | 70af4320ead955d22183cd78616c129a730a9d9c | refs/heads/master | 2021-01-17T14:02:08.396445 | 2019-07-12T10:08:07 | 2019-07-12T10:08:07 | 1,663,824 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 4,823 | java | /*
* Open Source Physics software is free software as described near the bottom of this code file.
*
* For additional information and documentation on Open Source Physics please see:
* <http://www.opensourcephysics.org/>
*/
/*
* The org.opensourcephysics.media.gif package provides GIF services
* including implementations of the Video and VideoRecorder interfaces.
*
* Copyright (c) 2004 Douglas Brown and Wolfgang Christian.
*
* This 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 2 of the License, or
* (at your option) any later version.
*
* This software 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; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston MA 02111-1307 USA
* or view the license online at http://www.gnu.org/copyleft/gpl.html
*
* For additional information and documentation on Open Source Physics,
* please see <http://www.opensourcephysics.org/>.
*/
package org.opensourcephysics.media.gif;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.image.BufferedImage;
import org.opensourcephysics.media.core.ScratchVideoRecorder;
/**
* This is a gif video recorder that uses scratch files.
*
* @author Douglas Brown
* @version 1.0
*/
public class GifVideoRecorder extends ScratchVideoRecorder {
// instance fields
private AnimatedGifEncoder encoder = new AnimatedGifEncoder();
/**
* Constructs a GifVideoRecorder object.
*/
public GifVideoRecorder() {
super(new GifVideoType());
}
/**
* Sets the time duration per frame.
*
* @param millis the duration per frame in milliseconds
*/
public void setFrameDuration(double millis) {
super.setFrameDuration(millis);
encoder.setDelay((int) frameDuration);
}
/**
* Gets the encoder used by this recorder. The encoder has methods for
* setting a transparent color, setting a repeat count (0 for continuous play),
* and setting a quality factor.
*
* @return the gif encoder
*/
public AnimatedGifEncoder getGifEncoder() {
return encoder;
}
//________________________________ protected methods _________________________________
/**
* Saves the video to the current scratchFile.
*/
protected void saveScratch() {
encoder.finish();
}
/**
* Starts the video recording process.
*
* @return true if video recording successfully started
*/
protected boolean startRecording() {
if((dim==null)&&(frameImage!=null)) {
dim = new Dimension(frameImage.getWidth(null), frameImage.getHeight(null));
}
if(dim!=null) {
encoder.setSize(dim.width, dim.height);
}
encoder.setRepeat(0);
return encoder.start(scratchFile.getAbsolutePath());
}
/**
* Appends a frame to the current video.
*
* @param image the image to append
* @return true if image successfully appended
*/
protected boolean append(Image image) {
BufferedImage bi;
if(image instanceof BufferedImage) {
bi = (BufferedImage) image;
}
else {
if(dim==null) {
return false;
}
bi = new BufferedImage(dim.width, dim.height, BufferedImage.TYPE_INT_RGB);
Graphics2D g = bi.createGraphics();
g.drawImage(image, 0, 0, null);
}
encoder.addFrame(bi);
return true;
}
}
/*
* Open Source Physics software is free software; you can redistribute
* it and/or modify it under the terms of the GNU General Public License (GPL) as
* published by the Free Software Foundation; either version 2 of the License,
* or(at your option) any later version.
* Code that uses any portion of the code in the org.opensourcephysics package
* or any subpackage (subdirectory) of this package must must also be be released
* under the GNU GPL license.
*
* This software 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; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston MA 02111-1307 USA
* or view the license online at http://www.gnu.org/copyleft/gpl.html
*
* Copyright (c) 2007 The Open Source Physics project
* http://www.opensourcephysics.org
*/
| [
"joakimbits@gmail.com"
] | joakimbits@gmail.com |
cee3aa90ebf775a1c0bf172dc11c68b883435c6a | 0b998348fa1edabb38a7de1d78a60f03e56604bf | /PLProject7/mathy.java | 927824a1f897e60e0e9ce72cbd3a4c727a11acbf | [] | no_license | kdk745/PLFinalProject | 475c0e0255b0cb3fba3edc7b6eafe30462c6dbba | 9b73ce72eea7f9a5ff8f48c6f89f1c7b51ed9af3 | refs/heads/master | 2020-02-26T14:17:58.525380 | 2016-05-12T19:00:53 | 2016-05-12T19:00:53 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 528 | java | public class mathy
{
public static int add(int i, int j) { return i + j; }
public static double add_doub(double i, double j ){return i+j;}
public static int sub(int i, int j) { return i - j; }
public static double sub_doub(double i, double j ){return i-j;}
public static int mult(int i, int j) { return i * j; }
public static double mult_doub(double i, double j ){return i*j;}
public static int div(int i, int j) { return i / j; }
public static double div_doub(double i, double j ){return i/j;}
} | [
"germanmtz93@gmail.com"
] | germanmtz93@gmail.com |
c9b52319190368bcd64f1905a0973ba225323e31 | 76db0645c38ef0f5470ac91d6f1c4f20aab4663e | /src/main/java/sensimet/dataTypes/Sentence.java | 3eeec77e22e7dbdfc6bc74de7085546e4aa178ca | [] | no_license | Yagouus/SenSiMet_Backend | 31e82d329b1fe24e7758dc5dcd4d822e611db904 | f115f6b1742d17a85a6f9a3f15a7a6480903a18c | refs/heads/master | 2021-01-20T10:32:50.456768 | 2017-07-19T07:58:09 | 2017-07-19T07:58:09 | 82,395,429 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,027 | java | package sensimet.dataTypes;
import it.uniroma1.lcl.jlt.util.Language;
import sensimet.RESTController;
import it.uniroma1.lcl.babelfy.commons.BabelfyParameters;
import it.uniroma1.lcl.babelfy.core.Babelfy;
import it.uniroma1.lcl.babelfy.commons.annotation.SemanticAnnotation;
import it.uniroma1.lcl.babelnet.*;
import it.uniroma1.lcl.babelnet.data.BabelPointer;
import java.io.IOException;
import java.util.*;
import static it.uniroma1.lcl.jlt.util.Language.*;
/**
* Author: Yago Fontenla Seco
**/
public class Sentence {
//Attributes
private String string; //Plain text string of sentence
private HashMap<String, Term> terms = new HashMap<>(); //Terms composing the sentence
//Constructors
public Sentence(String string) {
setString(string);
System.out.println("SENTENCE SETTED: " + string);
}
//Setters
public void setString(String string) {
this.string = string;
}
//Getters
public String getString() {
return string;
}
public ArrayList<Term> getTerms() {
//Result Array
ArrayList<Term> result = new ArrayList<>();
Iterator it = terms.entrySet().iterator();
while (it.hasNext()) {
Map.Entry pair = (Map.Entry) it.next();
result.add((Term) pair.getValue());
}
return result;
}
//Custom methods
public void Disambiguate() throws InvalidBabelSynsetIDException, IOException {
String sentence = this.getString();
//Babelfy settings
BabelfyParameters bp = new BabelfyParameters();
//bp.setMCS(BabelfyParameters.MCS.OFF);
bp.setScoredCandidates(BabelfyParameters.ScoredCandidates.TOP);
bp.setMatchingType(BabelfyParameters.MatchingType.EXACT_MATCHING);
bp.setAnnotationType(BabelfyParameters.SemanticAnnotationType.NAMED_ENTITIES);
//Babelfy instance
Babelfy bfy = new Babelfy(bp);
ArrayList<String> w = new ArrayList<>();
ArrayList<String> ids = new ArrayList<>();
//Call bfy API
ArrayList<SemanticAnnotation> bfyEntities = (ArrayList<SemanticAnnotation>) bfy.babelfy(string, EN);
//SOUT
System.out.println("\nDISAMBIGUATE SENTENCE: " + string);
System.out.println("ANNOTATIONS OBTAINED: ");
//Iterate over list
//bfyAnnotations is the result of Babelfy.babelfy() call
for (SemanticAnnotation annotation : bfyEntities) {
//splitting the input text using the CharOffsetFragment start and end anchors
String frag = sentence.substring(annotation.getCharOffsetFragment().getStart(), annotation.getCharOffsetFragment().getEnd() + 1);
w.add(frag);
if (!ids.contains(annotation.getBabelSynsetID())) {
//Set Term and BFY info
this.terms.put(frag, new Term(frag));
terms.get(frag).setBfy(annotation);
ids.add(annotation.getBabelSynsetID());
System.out.print(frag + "\t" + annotation.getBabelSynsetID());
System.out.print("\t" + annotation.getBabelNetURL() + "\n");
BabelSynset synset = RESTController.bn.getSynset(new BabelSynsetID(annotation.getBabelSynsetID()));
System.out.println("MAIN SENSE: " + synset.getMainSense(EN));
terms.get(frag).setSense(synset.getMainSense(EN).toString());
terms.get(frag).setGloss(synset.getMainGloss(EN).toString());
terms.get(frag).setBnt(synset);
terms.get(frag).setPOS(synset.getPOS().toString());
System.out.println("POS: " + terms.get(frag).getPOS());
getEdges(terms.get(frag));
}
}
//Remove concepts from the string
for (String word : w) {
sentence = sentence.replace(word, "");
}
bp.setAnnotationType(BabelfyParameters.SemanticAnnotationType.CONCEPTS);
bp.setMultiTokenExpression(false);
ArrayList<SemanticAnnotation> bfyConcepts = (ArrayList<SemanticAnnotation>) bfy.babelfy(sentence, EN);
for (SemanticAnnotation annotation : bfyConcepts) {
//splitting the input text using the CharOffsetFragment start and end anchors
String frag = sentence.substring(annotation.getCharOffsetFragment().getStart(), annotation.getCharOffsetFragment().getEnd() + 1);
w.add(frag);
if (!ids.contains(annotation.getBabelSynsetID())) {
//Set Term and BFY info
this.terms.put(frag, new Term(frag));
terms.get(frag).setBfy(annotation);
ids.add(annotation.getBabelSynsetID());
System.out.print(frag + "\t" + annotation.getBabelSynsetID());
System.out.print("\t" + annotation.getBabelNetURL() + "\n");
BabelSynset synset = RESTController.bn.getSynset(new BabelSynsetID(annotation.getBabelSynsetID()));
System.out.println("MAIN SENSE: " + synset.getMainSense(EN));
terms.get(frag).setSense(synset.getMainSense(EN).toString());
terms.get(frag).setGloss(synset.getMainGloss(EN).toString());
terms.get(frag).setBnt(synset);
terms.get(frag).setPOS(synset.getPOS().toString());
System.out.println("POS: " + terms.get(frag).getPOS());
getEdges(terms.get(frag));
}
}
for (String word : w) {
sentence = sentence.replace(word, "");
}
//Tokenize the rest of the sentence
String[] rest = sentence.split(" ");
for (String word : rest) {
if (!word.isEmpty())
terms.put(word, new Term(word));
}
//Create term
}
private void getEdges(Term t) throws InvalidBabelSynsetIDException, IOException {
BabelSynset synset = null;
synset = RESTController.bn.getSynset(new BabelSynsetID(t.getBfy().getBabelSynsetID()));
ArrayList<BabelSynsetIDRelation> added = new ArrayList<>();
//Set first level relations
//t.setBow((ArrayList<BabelSynsetIDRelation>) synset.getEdges(BabelPointer.REGION_MEMBER));
//t.addBow((ArrayList<BabelSynsetIDRelation>) synset.getEdges(BabelPointer.HYPERNYM));
//t.addBow((ArrayList<BabelSynsetIDRelation>) synset.getEdges(BabelPointer.HYPONYM));
//t.addBow((ArrayList<BabelSynsetIDRelation>) synset.getEdges(BabelPointer.REGION_MEMBER));
//t.addBow((ArrayList<BabelSynsetIDRelation>) synset.getEdges(BabelPointer.HOLONYM_MEMBER));
ArrayList<BabelSynsetIDRelation> edges = (ArrayList<BabelSynsetIDRelation>) synset.getEdges(BabelPointer.HYPERNYM);
ArrayList<BabelSynsetIDRelation> cedges = new ArrayList<>();
BabelSynsetIDRelation cH = null;
if (edges.size() > 0) {
cH = edges.get(0);
}
String entity = "bn:00031027n";
Integer i = 0;
//Add hypernyms
if (cH != null) {
do {
i++;
System.out.println(cH.getBabelSynsetIDTarget().toString());
cedges = (ArrayList<BabelSynsetIDRelation>) RESTController.bn.getSynset(cH.getBabelSynsetIDTarget()).getEdges(BabelPointer.HYPERNYM);
if (cedges.size() > 0) {
cH = cedges.get(0);
} else {
break;
}
t.returnHypers().add(cH);
} while (!cH.getBabelSynsetIDTarget().toString().equals(entity));
}
//Add everything to bow
edges = (ArrayList<BabelSynsetIDRelation>) synset.getEdges();
for (BabelSynsetIDRelation r : edges) {
if (r.getLanguage().equals(Language.EN) && r.getWeight() > 0) {
t.returnBow().add(r);
}
}
//t.setBow((ArrayList<BabelSynsetIDRelation>) synset.getEdges());
}
}
| [
"yagofontenla95@gmail.com"
] | yagofontenla95@gmail.com |
a6da2ff5607f3715ffb8c91fc861def53381ad51 | 65cae66d5f4ce96b3fef4104eaacf41ba9fc7303 | /app/src/main/java/com/example/cs492final/data/ChampionsRepository.java | 7e3fa7a3d1788c8abdd070551c2599732ff51a43 | [] | no_license | xuq2/final-project-lol-final | a0ea2b67e80e883cd6e62a2b336d640c30289894 | 182f8af823b89a499ca016ce1ea731687742b075 | refs/heads/main | 2023-03-18T17:14:07.947885 | 2021-03-17T20:06:40 | 2021-03-17T20:06:40 | 472,247,567 | 2 | 0 | null | 2022-03-21T08:28:06 | 2022-03-21T08:28:06 | null | UTF-8 | Java | false | false | 2,355 | java | package com.example.cs492final.data;
import android.util.Log;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;
public class ChampionsRepository {
private static final String TAG = ChampionsRepository.class.getSimpleName();
private static final String BASE_URL = "https://ddragon.leagueoflegends.com/";
private LeagueService leagueService;
private MutableLiveData<ChampionsData> championsData;
public ChampionsRepository() {
championsData = new MutableLiveData<>();
championsData.setValue(null);
Gson gson = new GsonBuilder()
.registerTypeAdapter(Champions.class, new Champions.JsonDeserializer())
.create();
Retrofit retrofit = new Retrofit.Builder()
.baseUrl(BASE_URL)
.addConverterFactory(GsonConverterFactory.create(gson))
.build();
this.leagueService = retrofit.create(LeagueService.class);
}
public LiveData<ChampionsData> getChampionsData() {
return this.championsData;
}
public void loadChampions(String version) {
Call<ChampionsData> req = this.leagueService.fetchChampions(version);
req.enqueue(new Callback<ChampionsData>() {
@Override
public void onResponse(Call<ChampionsData> call, Response<ChampionsData> response) {
if(response.code() == 200) {
championsData.setValue(response.body());
Log.d(TAG, "Success " + response.body().getData().getChampions().get(153).getName());
} else {
Log.d(TAG, "unsuccessful API request: " + call.request().url());
Log.d(TAG, " -- response status code: " + response.code());
Log.d(TAG, " -- response: " + response.toString());
}
}
@Override
public void onFailure(Call<ChampionsData> call, Throwable t) {
Log.d(TAG, "unsuccessful API request: " + call.request().url());
t.printStackTrace();
}
});
}
}
| [
"yonge@oregonstate.edu"
] | yonge@oregonstate.edu |
e8db9af530608f9887c2cdb8bb975c18b5012d54 | a0e1fd7e951fc7df1f8d51698a7c23ec33824a24 | /src-gen/org/openbravo/model/project/ProjectPhase.java | db79cc5678024f2c259f8417207742fc600883ea | [] | no_license | HAWAIHAWAI/openz | b7b4bdfb289c52a24edcae6be8c2212220fe0dec | 49d51f3c1303f7c3f51ce9042a91a713bc59d4c4 | refs/heads/master | 2016-09-05T12:23:48.718671 | 2014-10-27T10:14:36 | 2014-10-27T10:14:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 13,674 | java | /*
*************************************************************************
* The contents of this file are subject to the Openbravo Public License
* Version 1.0 (the "License"), being the Mozilla Public License
* Version 1.1 with a permitted attribution clause; you may not use this
* file except in compliance with the License. You may obtain a copy of
* the License at http://www.openbravo.com/legal/license.html
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
* The Original Code is Openbravo ERP.
* The Initial Developer of the Original Code is Openbravo SL
* All portions are Copyright (C) 2008-2009 Openbravo SL
* All Rights Reserved.
* Contributor(s): ______________________________________.
************************************************************************
*/
package org.openbravo.model.project;
import org.openbravo.base.structure.BaseOBObject;
import org.openbravo.base.structure.ClientEnabled;
import org.openbravo.model.ad.access.User;
import org.openbravo.model.ad.system.Client;
import org.openbravo.model.common.enterprise.Organization;
import org.openbravo.model.common.order.Order;
import org.openbravo.model.common.plm.Product;
import org.openbravo.zsoft.projects.Zspm_projectphasedep;
import java.lang.Boolean;
import java.lang.Long;
import java.lang.String;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* Entity class for entity ProjectPhase (stored in table C_ProjectPhase).
*
* NOTE: This class should not be instantiated directly. To instantiate this
* class the {@link org.openbravo.base.provider.OBProvider} should be used.
*/
public class ProjectPhase extends BaseOBObject implements ClientEnabled {
private static final long serialVersionUID = 1L;
public static final String TABLE_NAME = "C_ProjectPhase";
public static final String ENTITY_NAME = "ProjectPhase";
public static final String PROPERTY_PROJECT = "project";
public static final String PROPERTY_CLIENT = "client";
public static final String PROPERTY_ORG = "org";
public static final String PROPERTY_ISACTIVE = "isActive";
public static final String PROPERTY_CREATED = "created";
public static final String PROPERTY_CREATEDBY = "createdBy";
public static final String PROPERTY_UPDATED = "updated";
public static final String PROPERTY_UPDATEDBY = "updatedBy";
public static final String PROPERTY_DESCRIPTION = "description";
public static final String PROPERTY_STARTDATE = "startDate";
public static final String PROPERTY_ENDDATE = "endDate";
public static final String PROPERTY_ISCOMPLETE = "isComplete";
public static final String PROPERTY_PRODUCT = "product";
public static final String PROPERTY_PRICEACTUAL = "priceActual";
public static final String PROPERTY_GENERATEORDER = "generateOrder";
public static final String PROPERTY_ORDER = "order";
public static final String PROPERTY_PHASE = "phase";
public static final String PROPERTY_ID = "id";
public static final String PROPERTY_HELP = "help";
public static final String PROPERTY_NAME = "name";
public static final String PROPERTY_QTY = "qty";
public static final String PROPERTY_SEQNO = "seqNo";
public static final String PROPERTY_COMMITTEDAMT = "committedAmt";
public static final String PROPERTY_ISCOMMITCEILING = "isCommitCeiling";
public static final String PROPERTY_DATECONTRACT = "datecontract";
public static final String PROPERTY_SCHEDULESTATUS = "schedulestatus";
public static final String PROPERTY_ACTUALCOST = "actualcost";
public static final String PROPERTY_PLANNEDCOST = "plannedcost";
public static final String PROPERTY_PERCENTDONE = "percentdone";
public static final String PROPERTY_OUTSOURCING = "outsourcing";
public static final String PROPERTY_PHASEBEGUN = "phasebegun";
public static final String PROPERTY_BEGINPHASE = "beginphase";
public static final String PROPERTY_ENDPHASE = "endphase";
public static final String PROPERTY_MATERIALCOST = "materialcost";
public static final String PROPERTY_MACHINECOST = "machinecost";
public static final String PROPERTY_INVOICEDAMT = "invoicedamt";
public static final String PROPERTY_EXPENSES = "expenses";
public static final String PROPERTY_SERVCOST = "servcost";
public static final String PROPERTY_INDIRECTCOST = "indirectcost";
public static final String PROPERTY_ZSPMPROJECTPHASEDEPLIST =
"zspmProjectphasedepList";
public ProjectPhase() {
setDefaultValue(PROPERTY_ISACTIVE, true);
setDefaultValue(PROPERTY_ISCOMPLETE, false);
setDefaultValue(PROPERTY_GENERATEORDER, false);
setDefaultValue(PROPERTY_ISCOMMITCEILING, false);
setDefaultValue(PROPERTY_OUTSOURCING, false);
setDefaultValue(PROPERTY_PHASEBEGUN, false);
setDefaultValue(PROPERTY_BEGINPHASE, false);
setDefaultValue(PROPERTY_ENDPHASE, false);
setDefaultValue(PROPERTY_ZSPMPROJECTPHASEDEPLIST,
new ArrayList<Object>());
}
@Override
public String getEntityName() {
return ENTITY_NAME;
}
public Project getProject() {
return (Project) get(PROPERTY_PROJECT);
}
public void setProject(Project project) {
set(PROPERTY_PROJECT, project);
}
public Client getClient() {
return (Client) get(PROPERTY_CLIENT);
}
public void setClient(Client client) {
set(PROPERTY_CLIENT, client);
}
public Organization getOrg() {
return (Organization) get(PROPERTY_ORG);
}
public void setOrg(Organization org) {
set(PROPERTY_ORG, org);
}
public Boolean isActive() {
return (Boolean) get(PROPERTY_ISACTIVE);
}
public void setActive(Boolean isActive) {
set(PROPERTY_ISACTIVE, isActive);
}
public Date getCreated() {
return (Date) get(PROPERTY_CREATED);
}
public void setCreated(Date created) {
set(PROPERTY_CREATED, created);
}
public User getCreatedBy() {
return (User) get(PROPERTY_CREATEDBY);
}
public void setCreatedBy(User createdBy) {
set(PROPERTY_CREATEDBY, createdBy);
}
public Date getUpdated() {
return (Date) get(PROPERTY_UPDATED);
}
public void setUpdated(Date updated) {
set(PROPERTY_UPDATED, updated);
}
public User getUpdatedBy() {
return (User) get(PROPERTY_UPDATEDBY);
}
public void setUpdatedBy(User updatedBy) {
set(PROPERTY_UPDATEDBY, updatedBy);
}
public String getDescription() {
return (String) get(PROPERTY_DESCRIPTION);
}
public void setDescription(String description) {
set(PROPERTY_DESCRIPTION, description);
}
public Date getStartDate() {
return (Date) get(PROPERTY_STARTDATE);
}
public void setStartDate(Date startDate) {
set(PROPERTY_STARTDATE, startDate);
}
public Date getEndDate() {
return (Date) get(PROPERTY_ENDDATE);
}
public void setEndDate(Date endDate) {
set(PROPERTY_ENDDATE, endDate);
}
public Boolean isComplete() {
return (Boolean) get(PROPERTY_ISCOMPLETE);
}
public void setComplete(Boolean isComplete) {
set(PROPERTY_ISCOMPLETE, isComplete);
}
public Product getProduct() {
return (Product) get(PROPERTY_PRODUCT);
}
public void setProduct(Product product) {
set(PROPERTY_PRODUCT, product);
}
public BigDecimal getPriceActual() {
return (BigDecimal) get(PROPERTY_PRICEACTUAL);
}
public void setPriceActual(BigDecimal priceActual) {
set(PROPERTY_PRICEACTUAL, priceActual);
}
public Boolean isGenerateOrder() {
return (Boolean) get(PROPERTY_GENERATEORDER);
}
public void setGenerateOrder(Boolean generateOrder) {
set(PROPERTY_GENERATEORDER, generateOrder);
}
public Order getOrder() {
return (Order) get(PROPERTY_ORDER);
}
public void setOrder(Order order) {
set(PROPERTY_ORDER, order);
}
public StandardPhase getPhase() {
return (StandardPhase) get(PROPERTY_PHASE);
}
public void setPhase(StandardPhase phase) {
set(PROPERTY_PHASE, phase);
}
public String getId() {
return (String) get(PROPERTY_ID);
}
public void setId(String id) {
set(PROPERTY_ID, id);
}
public String getHelp() {
return (String) get(PROPERTY_HELP);
}
public void setHelp(String help) {
set(PROPERTY_HELP, help);
}
public String getName() {
return (String) get(PROPERTY_NAME);
}
public void setName(String name) {
set(PROPERTY_NAME, name);
}
public BigDecimal getQty() {
return (BigDecimal) get(PROPERTY_QTY);
}
public void setQty(BigDecimal qty) {
set(PROPERTY_QTY, qty);
}
public Long getSeqNo() {
return (Long) get(PROPERTY_SEQNO);
}
public void setSeqNo(Long seqNo) {
set(PROPERTY_SEQNO, seqNo);
}
public BigDecimal getCommittedAmt() {
return (BigDecimal) get(PROPERTY_COMMITTEDAMT);
}
public void setCommittedAmt(BigDecimal committedAmt) {
set(PROPERTY_COMMITTEDAMT, committedAmt);
}
public Boolean isCommitCeiling() {
return (Boolean) get(PROPERTY_ISCOMMITCEILING);
}
public void setCommitCeiling(Boolean isCommitCeiling) {
set(PROPERTY_ISCOMMITCEILING, isCommitCeiling);
}
public Date getDatecontract() {
return (Date) get(PROPERTY_DATECONTRACT);
}
public void setDatecontract(Date datecontract) {
set(PROPERTY_DATECONTRACT, datecontract);
}
public String getSchedulestatus() {
return (String) get(PROPERTY_SCHEDULESTATUS);
}
public void setSchedulestatus(String schedulestatus) {
set(PROPERTY_SCHEDULESTATUS, schedulestatus);
}
public BigDecimal getActualcost() {
return (BigDecimal) get(PROPERTY_ACTUALCOST);
}
public void setActualcost(BigDecimal actualcost) {
set(PROPERTY_ACTUALCOST, actualcost);
}
public BigDecimal getPlannedcost() {
return (BigDecimal) get(PROPERTY_PLANNEDCOST);
}
public void setPlannedcost(BigDecimal plannedcost) {
set(PROPERTY_PLANNEDCOST, plannedcost);
}
public Long getPercentdone() {
return (Long) get(PROPERTY_PERCENTDONE);
}
public void setPercentdone(Long percentdone) {
set(PROPERTY_PERCENTDONE, percentdone);
}
public Boolean isOutsourcing() {
return (Boolean) get(PROPERTY_OUTSOURCING);
}
public void setOutsourcing(Boolean outsourcing) {
set(PROPERTY_OUTSOURCING, outsourcing);
}
public Boolean isPhasebegun() {
return (Boolean) get(PROPERTY_PHASEBEGUN);
}
public void setPhasebegun(Boolean phasebegun) {
set(PROPERTY_PHASEBEGUN, phasebegun);
}
public Boolean isBeginphase() {
return (Boolean) get(PROPERTY_BEGINPHASE);
}
public void setBeginphase(Boolean beginphase) {
set(PROPERTY_BEGINPHASE, beginphase);
}
public Boolean isEndphase() {
return (Boolean) get(PROPERTY_ENDPHASE);
}
public void setEndphase(Boolean endphase) {
set(PROPERTY_ENDPHASE, endphase);
}
public BigDecimal getMaterialcost() {
return (BigDecimal) get(PROPERTY_MATERIALCOST);
}
public void setMaterialcost(BigDecimal materialcost) {
set(PROPERTY_MATERIALCOST, materialcost);
}
public BigDecimal getMachinecost() {
return (BigDecimal) get(PROPERTY_MACHINECOST);
}
public void setMachinecost(BigDecimal machinecost) {
set(PROPERTY_MACHINECOST, machinecost);
}
public BigDecimal getInvoicedamt() {
return (BigDecimal) get(PROPERTY_INVOICEDAMT);
}
public void setInvoicedamt(BigDecimal invoicedamt) {
set(PROPERTY_INVOICEDAMT, invoicedamt);
}
public BigDecimal getExpenses() {
return (BigDecimal) get(PROPERTY_EXPENSES);
}
public void setExpenses(BigDecimal expenses) {
set(PROPERTY_EXPENSES, expenses);
}
public BigDecimal getServcost() {
return (BigDecimal) get(PROPERTY_SERVCOST);
}
public void setServcost(BigDecimal servcost) {
set(PROPERTY_SERVCOST, servcost);
}
public BigDecimal getIndirectcost() {
return (BigDecimal) get(PROPERTY_INDIRECTCOST);
}
public void setIndirectcost(BigDecimal indirectcost) {
set(PROPERTY_INDIRECTCOST, indirectcost);
}
@SuppressWarnings("unchecked")
public List<Zspm_projectphasedep> getZspmProjectphasedepList() {
return (List<Zspm_projectphasedep>) get(PROPERTY_ZSPMPROJECTPHASEDEPLIST);
}
public void setZspmProjectphasedepList(
List<Zspm_projectphasedep> zspmProjectphasedepList) {
set(PROPERTY_ZSPMPROJECTPHASEDEPLIST, zspmProjectphasedepList);
}
}
| [
"florian.arfert@haw-hamburg.de"
] | florian.arfert@haw-hamburg.de |
bc59a91d55efd68cbd2028b34cfef41c7a0345e8 | a8a52fe8b9f3b09fbf0d070c44a000fbb307be95 | /tree/src/pers/UnivalTree.java | e2fd7dfcaddf695f2b2fb9053f790c0eb75aa77b | [] | no_license | luolanmeet/algorithm | bc9573cd929f07afabd3b5a5370cb5b65222694f | 051b25544c07e48837919c2919c7efa44eb9d76b | refs/heads/master | 2023-09-01T11:40:42.979878 | 2023-08-31T02:53:48 | 2023-08-31T02:53:48 | 169,018,777 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,376 | java | package pers;
/**
* 965. 单值二叉树
* https://leetcode-cn.com/problems/univalued-binary-tree/
* @author cck
*/
public class UnivalTree {
// 就是一个二叉树的遍历
public boolean isUnivalTree(TreeNode root) {
if (root == null) {
return true;
}
int val = root.val;
return jundge(root, val);
}
private boolean jundge(TreeNode root, int val) {
if (root == null) {
return true;
}
if (root.val != val) {
return false;
}
if (!jundge(root.left, val)) {
return false;
}
return jundge(root.right, val);
}
public static void main(String[] args) {
TreeNode t1 = new TreeNode(1);
TreeNode t2 = new TreeNode(1);
TreeNode t3 = new TreeNode(1);
TreeNode t4 = new TreeNode(1);
TreeNode t5 = new TreeNode(1);
TreeNode t6 = new TreeNode(1);
t1.left = t2; t1.right = t3;
t2.left = t4;
t3.right = t5;
t5.left = t6;
UnivalTree obj = new UnivalTree();
System.out.println(obj.isUnivalTree(t1));
t6.val = 2;
System.out.println(obj.isUnivalTree(t1));
}
}
| [
"ryan.chen@impressivecn.com"
] | ryan.chen@impressivecn.com |
e1dd207eea93692ba75847049e18ce29a48a4077 | 756525baa58ddafab9fe92003f8a17a489bd7538 | /app/src/main/java/com/uae/emiratescar/ui/activities/ForgotPassActivity.java | 3c4faf25bc5327d42dad86f9d981e8d404dcdf28 | [] | no_license | AdrianaMusic/EmiratesCar | 76c15969d442582d74ae584f29d00ec74d081bd8 | 5d33e638365b6a2f7b36232f1fb865e52b666d8f | refs/heads/master | 2023-03-17T12:03:28.832439 | 2020-08-25T18:48:53 | 2020-08-25T18:48:53 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 337 | java | package com.uae.emiratescar.ui.activities;
import android.os.Bundle;
import com.uae.emiratescar.R;
public class ForgotPassActivity extends BaseActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_forgot_pass);
}
}
| [
"anas.khan176@gmail.com"
] | anas.khan176@gmail.com |
0ed80cfc2febfd3119e2522dca592aad06fdb32c | 4581669c5f8959f07eec03351a0d8f9aace0890b | /rdpay-mgr/src/main/java/com/rdpay/mgr/modules/sys/service/impl/SysDataDictServiceImpl.java | 5c58d610a0316dc382641ee03139d3b3a1050363 | [] | no_license | wtiehu/rdpay | 5e3db5580bf1947cdd9ae54b6528d4bde0b79699 | 5de7432a2225e97a222bd4dcf094d786d305a50b | refs/heads/master | 2021-10-07T21:36:31.013367 | 2018-12-05T14:36:07 | 2018-12-05T14:36:07 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,000 | java | package com.rdpay.mgr.modules.sys.service.impl;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.rdpay.mgr.common.utils.PageUtils;
import com.rdpay.mgr.common.utils.Query;
import com.rdpay.mgr.modules.sys.dao.SysDataDictDao;
import com.rdpay.mgr.modules.sys.entity.SysDataDictEntity;
import com.rdpay.mgr.modules.sys.service.SysDataDictService;
import org.springframework.stereotype.Service;
import java.util.Map;
@Service("sysDataDictService")
public class SysDataDictServiceImpl extends ServiceImpl<SysDataDictDao, SysDataDictEntity> implements SysDataDictService {
@Override
public PageUtils queryPage(Map<String, Object> params) {
Page<SysDataDictEntity> page = this.selectPage(
new Query<SysDataDictEntity>(params).getPage(),
new EntityWrapper<SysDataDictEntity>()
);
return new PageUtils(page);
}
}
| [
"tiehu"
] | tiehu |
dc9b9f17c8e56736385f6d7dad57150381e7ad10 | 2db4b0e3dcac84ae7d804ce9d7e02caaf192889a | /app/src/main/java/com/example/student/campingimerir/SplachScreen.java | 11aca5087fb048f674a3632740740bf46cbf9654 | [] | no_license | Spurz/AuCamping-Android | 0b0b0e924c1893023521ef42d8afba677e4fbffc | b0199b06a515cbd6ed1dc0f5e57d984e24db53cd | refs/heads/master | 2020-03-08T20:03:29.873924 | 2018-05-29T09:45:31 | 2018-05-29T09:45:31 | 128,371,561 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 355 | java | package com.example.student.campingimerir;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
public class SplachScreen extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splach_screen);
}
}
| [
"samy.harle@imerir.com"
] | samy.harle@imerir.com |
428e18046cefeac546f8a4f6ec6baf76c9b84785 | 5b7b57c14b91d3d578855abebae59549048b1fd9 | /AppCommon/src/main/java/com/trade/eight/mpush/util/ByteBuf.java | 06f9bc17e0ca465a5aa079df1edce6c4920a645c | [] | no_license | xanhf/8yuan | 8c4f50fa7c95ae5f0dfb282f67a7b1c39b0b4711 | a8b7f351066f479b3bc8a6037036458008e1624c | refs/heads/master | 2021-05-14T19:58:44.462393 | 2017-11-16T10:31:29 | 2017-11-16T10:31:55 | 114,601,135 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,570 | java | /*
* (C) Copyright 2015-2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* 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.
*
* Contributors:
* ohun@live.cn (夜色)
*/
package com.trade.eight.mpush.util;
import java.nio.*;
/**
* Created by ohun on 2016/1/21.
*
* @author ohun@live.cn (夜色)
*/
public final class ByteBuf {
private ByteBuffer tmpNioBuf;
public static ByteBuf allocate(int capacity) {
ByteBuf buffer = new ByteBuf();
buffer.tmpNioBuf = ByteBuffer.allocate(capacity);
return buffer;
}
public static ByteBuf allocateDirect(int capacity) {
ByteBuf buffer = new ByteBuf();
buffer.tmpNioBuf = ByteBuffer.allocateDirect(capacity);
return buffer;
}
public static ByteBuf wrap(byte[] array) {
ByteBuf buffer = new ByteBuf();
buffer.tmpNioBuf = ByteBuffer.wrap(array);
return buffer;
}
public byte[] getArray() {
tmpNioBuf.flip();
byte[] array = new byte[tmpNioBuf.remaining()];
tmpNioBuf.get(array);
tmpNioBuf.compact();
return array;
}
public ByteBuf get(byte[] array) {
tmpNioBuf.get(array);
return this;
}
public byte get() {
return tmpNioBuf.get();
}
public ByteBuf put(byte b) {
checkCapacity(1);
tmpNioBuf.put(b);
return this;
}
public short getShort() {
return tmpNioBuf.getShort();
}
public ByteBuf putShort(int value) {
checkCapacity(2);
tmpNioBuf.putShort((short) value);
return this;
}
public int getInt() {
return tmpNioBuf.getInt();
}
public ByteBuf putInt(int value) {
checkCapacity(4);
tmpNioBuf.putInt(value);
return this;
}
public long getLong() {
return tmpNioBuf.getLong();
}
public ByteBuf putLong(long value) {
checkCapacity(8);
tmpNioBuf.putLong(value);
return this;
}
public ByteBuf put(byte[] value) {
checkCapacity(value.length);
tmpNioBuf.put(value);
return this;
}
public ByteBuf checkCapacity(int minWritableBytes) {
int remaining = tmpNioBuf.remaining();
if (remaining < minWritableBytes) {
int newCapacity = newCapacity(tmpNioBuf.capacity() + minWritableBytes);
ByteBuffer newBuffer = tmpNioBuf.isDirect() ? ByteBuffer.allocateDirect(newCapacity) : ByteBuffer.allocate(newCapacity);
tmpNioBuf.flip();
newBuffer.put(tmpNioBuf);
tmpNioBuf = newBuffer;
}
return this;
}
private int newCapacity(int minNewCapacity) {
int newCapacity = 64;
while (newCapacity < minNewCapacity) {
newCapacity <<= 1;
}
return newCapacity;
}
public ByteBuffer nioBuffer() {
return tmpNioBuf;
}
public ByteBuf clear() {
tmpNioBuf.clear();
return this;
}
public ByteBuf flip() {
tmpNioBuf.flip();
return this;
}
}
| [
"enricozhang@126.com"
] | enricozhang@126.com |
3a86246dbbf77928390deba87af3c07fe99efd66 | 8c63b60613c0fa64c2b044d1d9c06353b3d2d354 | /src/main/java/com/eumji/zblog/mapper/UserMapper.java | 9648fe762dee5838877b6250a1793882ad16f6f8 | [
"Apache-2.0"
] | permissive | CrazyZhao/zblog | cf61319c83f9c3648542ce01a4feb95a64b4649a | 68d9b55586993415a441ff8a508347c93c4ac808 | refs/heads/master | 2020-05-16T09:44:50.053034 | 2019-05-09T01:21:56 | 2019-05-09T01:21:56 | 182,958,545 | 9 | 1 | null | null | null | null | UTF-8 | Java | false | false | 853 | java | package com.eumji.zblog.mapper;
import com.eumji.zblog.vo.User;
import com.eumji.zblog.vo.UserInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* FILE: com.eumji.zblog.mapper.UserMapper.java
* MOTTO: 不积跬步无以至千里,不积小流无以至千里
* AUTHOR: EumJi
* DATE: 2017/4/9
* TIME: 10:20
*/
@Mapper
public interface UserMapper {
/**
* 获取用户凭证
* @param username 账号
* @return
*/
User getUser(@Param("username") String username);
/**
* 获取所有的用户
* @return
*/
List<User> allUser();
UserInfo getUserInfo();
void updateAvatar(@Param("url") String url, @Param("username") String username);
void updatePassword(User user);
void updateUserInfo(UserInfo userInfo);
}
| [
"zhaobaoliang@mofangge.com"
] | zhaobaoliang@mofangge.com |
4ee3fd672b056d308a2286d63c48611bf6ad678a | dd721f5a2230221f0a6a3e858fcd2ec7a04ad2c7 | /leetcode/30-Day_LeetCoding_Challenge/2020/0518/Solution.java | fa248c533e2eae29e44fdac2859b12e9dc310c0c | [] | no_license | glorypulse/quiz | ef95d780b6c074193ee461e73f227f3d47300c37 | b50b5b656f71d99cf845ff4bbb1741ad53bfeaa2 | refs/heads/master | 2021-11-27T02:21:01.003192 | 2021-08-14T14:38:47 | 2021-08-14T14:38:47 | 57,134,244 | 0 | 0 | null | 2019-06-08T13:40:13 | 2016-04-26T14:18:46 | Scala | UTF-8 | Java | false | false | 968 | java | class Solution {
public boolean checkInclusion(String s1, String s2) {
int s1Len = s1.length();
int s2Len = s2.length();
if (s1Len > s2Len) return false;
int[] s1Count = new int[26];
for (char c1: s1.toCharArray()) {
s1Count[c1 - 'a'] ++;
}
int falseCount = 0;
for (int i = 0; i < s2Len; i ++) {
if (i >= s1Len) {
char oldC2 = s2.charAt(i - s1Len);
int oldIndex = oldC2 - 'a';
s1Count[oldIndex] ++;
if (s1Count[oldIndex] <= 0) {
falseCount --;
}
}
char c2 = s2.charAt(i);
int index = c2 - 'a';
s1Count[index] --;
if (s1Count[index] < 0) {
falseCount ++;
}
if (i < s1Len - 1) continue;
if (falseCount == 0) return true;
}
return false;
}
}
| [
"glorypulse@gmail.com"
] | glorypulse@gmail.com |
c5ba379de0172a57fb13def3fb2297d31bd85050 | 5f0125557316e2293e5c79e3518d6772b25d200e | /CatController/src/tests/TestCommandCreator.java | 072f9a54013aa7fe11874a3e916638fdb4875e0e | [
"MIT"
] | permissive | Sytten/Cat | a7c61c7e788ebe9399a35c0ee3185e9dd710008f | 610841b44bb5c3bf02b1d4fa0b432f88f122c217 | refs/heads/master | 2021-01-17T15:10:32.522845 | 2017-12-11T16:24:28 | 2017-12-11T16:24:28 | 69,309,491 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,549 | java | package tests;
import static org.junit.Assert.*;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.HashMap;
import java.util.Map;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import communication.JSONMessage;
import execution.Command;
import main.CommandCreator;
public class TestCommandCreator {
@Rule
public ExpectedException thrown = ExpectedException.none();
@Test
public void testCommandWrong() {
String type = "ACK";
Map<String, String> params = new HashMap<String, String>();
params.put("MOTOR", "FOOD");
JSONMessage json = new JSONMessage(type, params);
Command testCommand;
CommandCreator testCreator = new CommandCreator();
testCommand = testCreator.createCommand(json);
assertEquals(testCommand, null);
}
@Test
public void testCommand() {
String type = "COMMAND";
Map<String, String> params = new HashMap<String, String>();
params.put("MOTOR", "FOOD");
params.put("QTY", "2");
JSONMessage json = new JSONMessage(type, params);
Command testCommand = null;
CommandCreator testCreator = new CommandCreator();
testCommand = testCreator.createCommand(json);
assertNotNull(testCommand);
}
@Test
public void testMotorWrong() {
String type = "COMMAND";
Map<String, String> params = new HashMap<String, String>();
params.put("MOTOR", "ACK");
params.put("QTY", "5");
JSONMessage json = new JSONMessage(type, params);
Command testCommand;
CommandCreator testCreator = new CommandCreator();
testCommand = testCreator.createCommand(json);
assertEquals(testCommand,null);
}
@Test
public void testMotorNull() {
String type = "COMMAND";
Map<String, String> params = new HashMap<String, String>();
params.put("MOTOR", null);
JSONMessage json = new JSONMessage(type, params);
Command testCommand;
CommandCreator testCreator = new CommandCreator();
testCommand = testCreator.createCommand(json);
assertEquals(testCommand, null);
}
@Test
public void testAudioCommand() {
String audioData = "";
Path currentRelativePath = Paths.get("");
String path = currentRelativePath.toAbsolutePath().toString();
File audioFile = new File(path + File.separator + "ExternalFiles" + File.separator + "AudioBase64.txt");
try (BufferedReader br = new BufferedReader(new FileReader(audioFile))) {
String line;
while ((line = br.readLine()) != null) {
audioData += line;
}
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
String type = "COMMAND";
Map<String, String> params = new HashMap<String, String>();
params.put("AUDIO", "audio");
params.put("DATA", audioData);
JSONMessage json = new JSONMessage(type, params);
Command testCommand;
CommandCreator testCreator = new CommandCreator();
testCommand = testCreator.createCommand(json);
assertNotNull(testCommand);
try {
File file = new File(System.getProperty("user.home") + File.separator + "VoiceData.ogg");
if (file.delete()) {
System.out.println(file.getName() + " is deleted!");
} else {
System.out.println("Delete operation is failed.");
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
| [
"emilefugulin@hotmail.com"
] | emilefugulin@hotmail.com |
59d27fdda39d054043621027583c5d148659c220 | 3b36c61372ac08a16148839664ac8395e94cfea5 | /app/src/main/java/core/GemsterApp.java | ff85b33c6d6d2715aa7aa47197928b903166667e | [] | no_license | Pollination699498/Gemster | 9bdcd1ad4eb51dc5f5a6fd9263febff1a7624429 | bdfd0e4ea9413f77e019dc92e66492fcf4bd482d | refs/heads/master | 2021-01-13T13:40:11.611029 | 2016-12-20T13:49:03 | 2016-12-20T13:49:03 | 76,367,817 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 600 | java | package core;
import android.app.Application;
/**
* Created by WONSEOK OH on 2016-12-17.
*/
public class GemsterApp extends Application {
private GoogleApiHelper mGoogleApiHelper;
private static GemsterApp mInstance;
@Override
public void onCreate() {
super.onCreate();
mInstance = this;
}
public static synchronized GemsterApp getInstance() {
return mInstance;
}
public void setClient(GoogleApiHelper client) {
mGoogleApiHelper = client;
}
public GoogleApiHelper getClient() {
return mGoogleApiHelper;
}
} | [
"pollination699498@gmail.com"
] | pollination699498@gmail.com |
ad5b1a218183b3e7b0edf8333cab54ad6823247f | 2a3dcc4be05fdc83813b6a152b80974cfda49867 | /src/main/java/com/github/coolcooldee/sloth/generate/Generator.java | 09b8847a73f8bd671cd846a4a033cca3ae265aca | [
"Apache-2.0"
] | permissive | seixion/sloth | 8ebb5bc19c2c719ae6d0821c1bf2b1e900869b65 | 2dc5195cfdb7baceb11543d34518dfad2fb9d9ab | refs/heads/master | 2021-01-22T15:10:53.219686 | 2017-08-31T10:53:06 | 2017-08-31T10:53:06 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,330 | java | package com.github.coolcooldee.sloth.generate;
import com.github.coolcooldee.sloth.parameter.*;
import com.github.coolcooldee.sloth.utils.DirectoryUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class Generator {
static Logger logger = LoggerFactory.getLogger(Generator.class);
public static void execute(String[] args) throws Exception{
// Step 1
UserInputParamters.init(args);
// Step 1.1
DBSourceParameters.inti();
// Step 1.2
TargetProjectParameters.init();
// Step 1.3
TemplateParameters.init();
// Step 1.4
GeneratorSteategyParameters.init();
// Step 2
GeneratorSteategyParameters.getGeneratorStrategy().execute();
// Step 3
printlnResult();
}
private static void printlnResult(){
logger.info("\nTarget project directory is : " + TargetProjectParameters.getTargetProjectStorePath());
DirectoryUtil.readFile(TargetProjectParameters.getTargetProjectStorePath());
logger.info("\n\n");
logger.info("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@");
logger.info("@ Genarate Successfully ! @");
logger.info("@ Thank you for using Sloth 1.1 @");
logger.info("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@");
}
}
| [
"qiusidi@kingsoft.com"
] | qiusidi@kingsoft.com |
8b3c694fbd0d37b1c3dc6a60293d0230915aa64d | a873978aa8093b1c0197e52176d768bb8360bac4 | /src/main/java/com/kode/ts/service/dto/EstatusAcademicoCriteria.java | 88c87a34e5dae7f1ddcccccf497427e4aa3a41e1 | [] | no_license | BenjaminCarrera/4TS | ef01f98ecb559c437397d599b87c9fed0c1d0883 | b4cd5979cedee3c2a2590951f3a27f95ad8eeae6 | refs/heads/master | 2022-12-22T11:49:18.472812 | 2019-09-10T19:27:48 | 2019-09-10T19:27:48 | 207,645,936 | 0 | 0 | null | 2022-12-16T05:03:59 | 2019-09-10T19:28:18 | Java | UTF-8 | Java | false | false | 3,140 | java | package com.kode.ts.service.dto;
import java.io.Serializable;
import java.util.Objects;
import io.github.jhipster.service.Criteria;
import io.github.jhipster.service.filter.BooleanFilter;
import io.github.jhipster.service.filter.DoubleFilter;
import io.github.jhipster.service.filter.Filter;
import io.github.jhipster.service.filter.FloatFilter;
import io.github.jhipster.service.filter.IntegerFilter;
import io.github.jhipster.service.filter.LongFilter;
import io.github.jhipster.service.filter.StringFilter;
/**
* Criteria class for the {@link com.kode.ts.domain.EstatusAcademico} entity. This class is used
* in {@link com.kode.ts.web.rest.EstatusAcademicoResource} to receive all the possible filtering options from
* the Http GET request parameters.
* For example the following could be a valid request:
* {@code /estatus-academicos?id.greaterThan=5&attr1.contains=something&attr2.specified=false}
* As Spring is unable to properly convert the types, unless specific {@link Filter} class are used, we need to use
* fix type specific filters.
*/
public class EstatusAcademicoCriteria implements Serializable, Criteria {
private static final long serialVersionUID = 1L;
private LongFilter id;
private StringFilter estatus;
private LongFilter candidatoId;
public EstatusAcademicoCriteria(){
}
public EstatusAcademicoCriteria(EstatusAcademicoCriteria other){
this.id = other.id == null ? null : other.id.copy();
this.estatus = other.estatus == null ? null : other.estatus.copy();
this.candidatoId = other.candidatoId == null ? null : other.candidatoId.copy();
}
@Override
public EstatusAcademicoCriteria copy() {
return new EstatusAcademicoCriteria(this);
}
public LongFilter getId() {
return id;
}
public void setId(LongFilter id) {
this.id = id;
}
public StringFilter getEstatus() {
return estatus;
}
public void setEstatus(StringFilter estatus) {
this.estatus = estatus;
}
public LongFilter getCandidatoId() {
return candidatoId;
}
public void setCandidatoId(LongFilter candidatoId) {
this.candidatoId = candidatoId;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
final EstatusAcademicoCriteria that = (EstatusAcademicoCriteria) o;
return
Objects.equals(id, that.id) &&
Objects.equals(estatus, that.estatus) &&
Objects.equals(candidatoId, that.candidatoId);
}
@Override
public int hashCode() {
return Objects.hash(
id,
estatus,
candidatoId
);
}
@Override
public String toString() {
return "EstatusAcademicoCriteria{" +
(id != null ? "id=" + id + ", " : "") +
(estatus != null ? "estatus=" + estatus + ", " : "") +
(candidatoId != null ? "candidatoId=" + candidatoId + ", " : "") +
"}";
}
}
| [
"andres.alvarez@kode.com.mx"
] | andres.alvarez@kode.com.mx |
a39e5a70142f5f9fa4da4815f085bfc3afd2bdb0 | 296cdd8a3ef1d7436c1957e403b47f6a62ba5efb | /src/main/java/com/sds/acube/luxor/webservice/jaxws/GetContentList.java | 9c500b923a3ace50b854a502b01d7b34062039ab | [] | no_license | seoyoungrag/byucksan_luxor | 6611276e871c13cbb5ea013d49ac79be678f03e5 | 7ecb824ec8e78e95bd2a962ce4d6c54e3c51b6b3 | refs/heads/master | 2021-03-16T05:17:42.571476 | 2017-07-24T08:28:47 | 2017-07-24T08:28:47 | 83,280,413 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,013 | java |
package com.sds.acube.luxor.webservice.jaxws;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* This class was generated by Apache CXF 2.3.0
* Thu Jul 04 09:36:34 KST 2013
* Generated source version: 2.3.0
*/
@XmlRootElement(name = "getContentList", namespace = "http://webservice.luxor.acube.sds.com/")
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "getContentList", namespace = "http://webservice.luxor.acube.sds.com/")
public class GetContentList {
@XmlElement(name = "arg0")
private com.sds.acube.luxor.portal.vo.PortalContentVO arg0;
public com.sds.acube.luxor.portal.vo.PortalContentVO getArg0() {
return this.arg0;
}
public void setArg0(com.sds.acube.luxor.portal.vo.PortalContentVO newArg0) {
this.arg0 = newArg0;
}
}
| [
"truezure@gmail.com"
] | truezure@gmail.com |
3ef1eaf25d03fae280e2de9e4aafd505fbcc0ad6 | 907e384b4c931345a2f9ad4219142b98a69990cc | /src/zx/leetcode/dog/feb/Minimum_Path_Sum_64.java | 96ae9857f2598847d198bf721e452c615f518c35 | [] | no_license | zxiang179/LeetCode | 602dc7569608a6a3b3b03a8888bbf176d5cdfa8f | c399f44cfae963bab5e0ae4c3b0523e7888c3784 | refs/heads/master | 2021-01-19T04:24:58.384604 | 2018-07-27T02:49:16 | 2018-07-27T02:49:16 | 87,368,683 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 918 | java | package zx.leetcode.dog.feb;
public class Minimum_Path_Sum_64 {
/**
* dp[i][j]表示走到该位置最短的路径之和
* 状态转移方程
* dp[i][j]=min(dp[i-1][j],dp[i][j-1])+grid[i-1][j-1]
* 边界
* dp[0][i]=sum(grid[0][j]) for(j=0;j<grid[0].length;j++)
* dp[i][0]=sum(grid[i][0]) for(i=0;i<grid.length;i++)
* @param grid
* @return
*/
public int minPathSum(int[][] grid) {
int m = grid.length;
int n = grid[0].length;
int[][] dp = new int[m][n];
dp[0][0] = grid[0][0];
for(int i=1;i<m;i++){
dp[i][0] = dp[i-1][0]+grid[i][0];
}
for(int j=1;j<n;j++){
dp[0][j] = dp[0][j-1]+grid[0][j];
}
for(int i=1;i<m;i++){
for(int j=1;j<n;j++){
dp[i][j] = Math.min(dp[i-1][j], dp[i][j-1])+grid[i][j];
}
}
return dp[m-1][n-1];
}
public static void main(String[] args) {
new Minimum_Path_Sum_64().minPathSum(new int[][]{{1,3,1},{1,5,1},{4,2,1}});
}
}
| [
"zxiang248@gmail.com"
] | zxiang248@gmail.com |
8fc49c3ad1ba6e3c69f4ba0c0c8ba819e76e8d5e | 7ae82f1727f44df4dad3028e5ac3732f8af579f5 | /milestone1prblms/src/com/wipro/numberprblms/LoopBasedEx3.java | aaaffdf3b1eb9da504444817bf0c971ff8c22444 | [] | no_license | 170040791/milestoneprblems | 0718d7d6983cfbf2f5ffecc3e46d12c826b60af2 | adedacf051923c167df1e533c40437f025677c6e | refs/heads/master | 2022-11-14T20:58:26.949431 | 2020-07-06T08:19:20 | 2020-07-06T08:19:20 | 273,382,474 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 681 | java | package com.wipro.numberprblms;
public class LoopBasedEx3 {
int Divisors(int n) {
int i,c=1;
if(n==0) {
System.out.println("every integer");
}else {
for(i=1;i<=n/2;i++)
{
if(n%i==0) {
c++;
}
}
}return c;
}
public static void main(String args[]) {
int n=Integer.parseInt(args[0]);
LoopBasedEx3 l=new LoopBasedEx3();
int c=l.Divisors(n);
if(c==2) {
System.out.println("prime");}
else {
System.out.println("not prime");
}
}
}
| [
"Pandu@DESKTOP-U24VG2S"
] | Pandu@DESKTOP-U24VG2S |
be474f5f72bc195ff90a7395353d0d7cb05d5507 | 988c4d65c384ae6956562f3601f841fd94283346 | /src/test/java/com/dotty/dottyapp/security/jwt/JWTFilterTest.java | 33bbfb8c1051b2f397bd8a53833f4ebb06aca7a1 | [] | no_license | dalalsunil1986/dotty | 506d9c1c7fb6238566ba74a6a05de4273f5414f8 | 8b026575216e67d6111ad4cee8bde5331c3f7a33 | refs/heads/master | 2021-08-22T23:37:12.769713 | 2017-12-01T17:51:59 | 2017-12-01T17:51:59 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,924 | java | package com.dotty.dottyapp.security.jwt;
import com.dotty.dottyapp.security.AuthoritiesConstants;
import io.github.jhipster.config.JHipsterProperties;
import org.junit.Before;
import org.junit.Test;
import org.springframework.http.HttpStatus;
import org.springframework.mock.web.MockFilterChain;
import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.mock.web.MockHttpServletResponse;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.test.util.ReflectionTestUtils;
import java.util.Collections;
import static org.assertj.core.api.Assertions.assertThat;
public class JWTFilterTest {
private TokenProvider tokenProvider;
private JWTFilter jwtFilter;
@Before
public void setup() {
JHipsterProperties jHipsterProperties = new JHipsterProperties();
tokenProvider = new TokenProvider(jHipsterProperties);
ReflectionTestUtils.setField(tokenProvider, "secretKey", "test secret");
ReflectionTestUtils.setField(tokenProvider, "tokenValidityInMilliseconds", 60000);
jwtFilter = new JWTFilter(tokenProvider);
SecurityContextHolder.getContext().setAuthentication(null);
}
@Test
public void testJWTFilter() throws Exception {
UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken(
"test-user",
"test-password",
Collections.singletonList(new SimpleGrantedAuthority(AuthoritiesConstants.USER))
);
String jwt = tokenProvider.createToken(authentication, false);
MockHttpServletRequest request = new MockHttpServletRequest();
request.addHeader(JWTConfigurer.AUTHORIZATION_HEADER, "Bearer " + jwt);
request.setRequestURI("/api/test");
MockHttpServletResponse response = new MockHttpServletResponse();
MockFilterChain filterChain = new MockFilterChain();
jwtFilter.doFilter(request, response, filterChain);
assertThat(response.getStatus()).isEqualTo(HttpStatus.OK.value());
assertThat(SecurityContextHolder.getContext().getAuthentication().getName()).isEqualTo("test-user");
assertThat(SecurityContextHolder.getContext().getAuthentication().getCredentials().toString()).isEqualTo(jwt);
}
@Test
public void testJWTFilterInvalidToken() throws Exception {
String jwt = "wrong_jwt";
MockHttpServletRequest request = new MockHttpServletRequest();
request.addHeader(JWTConfigurer.AUTHORIZATION_HEADER, "Bearer " + jwt);
request.setRequestURI("/api/test");
MockHttpServletResponse response = new MockHttpServletResponse();
MockFilterChain filterChain = new MockFilterChain();
jwtFilter.doFilter(request, response, filterChain);
assertThat(response.getStatus()).isEqualTo(HttpStatus.OK.value());
assertThat(SecurityContextHolder.getContext().getAuthentication()).isNull();
}
@Test
public void testJWTFilterMissingAuthorization() throws Exception {
MockHttpServletRequest request = new MockHttpServletRequest();
request.setRequestURI("/api/test");
MockHttpServletResponse response = new MockHttpServletResponse();
MockFilterChain filterChain = new MockFilterChain();
jwtFilter.doFilter(request, response, filterChain);
assertThat(response.getStatus()).isEqualTo(HttpStatus.OK.value());
assertThat(SecurityContextHolder.getContext().getAuthentication()).isNull();
}
@Test
public void testJWTFilterMissingToken() throws Exception {
MockHttpServletRequest request = new MockHttpServletRequest();
request.addHeader(JWTConfigurer.AUTHORIZATION_HEADER, "Bearer ");
request.setRequestURI("/api/test");
MockHttpServletResponse response = new MockHttpServletResponse();
MockFilterChain filterChain = new MockFilterChain();
jwtFilter.doFilter(request, response, filterChain);
assertThat(response.getStatus()).isEqualTo(HttpStatus.OK.value());
assertThat(SecurityContextHolder.getContext().getAuthentication()).isNull();
}
@Test
public void testJWTFilterWrongScheme() throws Exception {
UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken(
"test-user",
"test-password",
Collections.singletonList(new SimpleGrantedAuthority(AuthoritiesConstants.USER))
);
String jwt = tokenProvider.createToken(authentication, false);
MockHttpServletRequest request = new MockHttpServletRequest();
request.addHeader(JWTConfigurer.AUTHORIZATION_HEADER, "Basic " + jwt);
request.setRequestURI("/api/test");
}
}
| [
"geordan62@gmail.com"
] | geordan62@gmail.com |
6d5d717ace5feea068b6cd535d055770ed893071 | 251e4c5aaafe1a6b8c9dd43b26ff9c8a3cd42f06 | /Source Code/TestSomething/src/Nam_Test/MainControlInterface.java | dc1546f546e3d5528a8dd01a230848d86fc6d14e | [] | no_license | lety20391/ePrj-Sem2 | e433b57e4dd834fcc1c19c58446df71646c76007 | 29c2de35097f399e46ad3f9dd1c7ad2f10a26712 | refs/heads/master | 2020-03-15T21:29:48.779698 | 2018-06-20T08:32:42 | 2018-06-20T08:32:42 | 132,356,048 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 21,408 | 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 Nam_Test;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
/**
*
* @author Namcham
*/
public class MainControlInterface extends javax.swing.JFrame implements ActionListener {
/**
* Creates new form MainControlInterface
*/
public MainControlInterface() {
initComponents();
setLocationRelativeTo(null);
}
public MainControlInterface(String account) {
initComponents();
setLocationRelativeTo(null);
}
public String gettxtAccount() {
return txtAccount.getText();
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jPanel1 = new javax.swing.JPanel();
lbRegister = new javax.swing.JLabel();
lbMin = new javax.swing.JLabel();
lbClose = new javax.swing.JLabel();
jPanel2 = new javax.swing.JPanel();
btnAnounce = new javax.swing.JButton();
txtAccount = new javax.swing.JTextField();
btnBooking = new javax.swing.JButton();
btnSearch = new javax.swing.JButton();
btnDiscount = new javax.swing.JButton();
btnCreateNewAccount = new javax.swing.JButton();
btnStaff = new javax.swing.JButton();
btnCustomer = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jPanel1.setBackground(new java.awt.Color(255, 153, 51));
jPanel1.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jPanel1MouseClicked(evt);
}
});
lbRegister.setBackground(new java.awt.Color(255, 153, 0));
lbRegister.setFont(new java.awt.Font("Tahoma", 1, 36)); // NOI18N
lbRegister.setForeground(new java.awt.Color(255, 255, 255));
lbRegister.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
lbRegister.setText("Main Control System");
lbMin.setBackground(new java.awt.Color(255, 153, 0));
lbMin.setFont(new java.awt.Font("Tahoma", 1, 36)); // NOI18N
lbMin.setForeground(new java.awt.Color(255, 51, 51));
lbMin.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
lbMin.setText("_");
lbMin.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
lbMin.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
lbMinMouseClicked(evt);
}
});
lbClose.setBackground(new java.awt.Color(255, 153, 0));
lbClose.setFont(new java.awt.Font("Tahoma", 1, 36)); // NOI18N
lbClose.setForeground(new java.awt.Color(255, 51, 51));
lbClose.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
lbClose.setText("x");
lbClose.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
lbClose.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
lbCloseMouseClicked(evt);
}
});
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addComponent(lbRegister, javax.swing.GroupLayout.DEFAULT_SIZE, 609, Short.MAX_VALUE)
.addGap(46, 46, 46)
.addComponent(lbMin, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(lbClose, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(lbRegister, javax.swing.GroupLayout.PREFERRED_SIZE, 66, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(lbMin, javax.swing.GroupLayout.PREFERRED_SIZE, 66, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(lbClose, javax.swing.GroupLayout.PREFERRED_SIZE, 66, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel2.setBackground(new java.awt.Color(102, 102, 102));
jPanel2.setForeground(new java.awt.Color(255, 255, 255));
jPanel2.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jPanel2MouseClicked(evt);
}
});
btnAnounce.setBackground(new java.awt.Color(255, 0, 255));
btnAnounce.setFont(new java.awt.Font("Tahoma", 1, 40)); // NOI18N
btnAnounce.setForeground(new java.awt.Color(255, 255, 255));
btnAnounce.setText("Anounce");
btnAnounce.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
btnAnounce.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
btnAnounceMouseClicked(evt);
}
});
txtAccount.setEditable(false);
txtAccount.setBackground(new java.awt.Color(102, 102, 102));
txtAccount.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N
txtAccount.setForeground(new java.awt.Color(255, 255, 255));
txtAccount.setSelectionColor(new java.awt.Color(102, 102, 102));
txtAccount.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
txtAccountMouseClicked(evt);
}
});
btnBooking.setBackground(new java.awt.Color(255, 0, 51));
btnBooking.setFont(new java.awt.Font("Tahoma", 1, 34)); // NOI18N
btnBooking.setForeground(new java.awt.Color(255, 255, 255));
btnBooking.setText("Booking");
btnBooking.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
btnBooking.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
btnBookingMouseClicked(evt);
}
});
btnSearch.setBackground(new java.awt.Color(0, 153, 153));
btnSearch.setFont(new java.awt.Font("Tahoma", 1, 34)); // NOI18N
btnSearch.setForeground(new java.awt.Color(255, 255, 255));
btnSearch.setText("Search");
btnSearch.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
btnSearch.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
btnSearchMouseClicked(evt);
}
});
btnDiscount.setBackground(new java.awt.Color(255, 255, 0));
btnDiscount.setFont(new java.awt.Font("Tahoma", 1, 34)); // NOI18N
btnDiscount.setForeground(new java.awt.Color(255, 255, 255));
btnDiscount.setText("Discount");
btnDiscount.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
btnDiscount.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
btnDiscountMouseClicked(evt);
}
});
btnCreateNewAccount.setBackground(new java.awt.Color(102, 0, 102));
btnCreateNewAccount.setFont(new java.awt.Font("Tahoma", 1, 45)); // NOI18N
btnCreateNewAccount.setForeground(new java.awt.Color(255, 255, 255));
btnCreateNewAccount.setText("Create new account");
btnCreateNewAccount.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
btnCreateNewAccount.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
btnCreateNewAccountMouseClicked(evt);
}
});
btnCreateNewAccount.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnCreateNewAccountActionPerformed(evt);
}
});
btnStaff.setBackground(new java.awt.Color(51, 255, 51));
btnStaff.setFont(new java.awt.Font("Tahoma", 1, 34)); // NOI18N
btnStaff.setForeground(new java.awt.Color(255, 255, 255));
btnStaff.setText("Staff ");
btnStaff.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
btnStaff.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
btnStaffMouseClicked(evt);
}
});
btnCustomer.setBackground(new java.awt.Color(255, 51, 0));
btnCustomer.setFont(new java.awt.Font("Tahoma", 1, 34)); // NOI18N
btnCustomer.setForeground(new java.awt.Color(255, 255, 255));
btnCustomer.setText("Customer");
btnCustomer.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
btnCustomer.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
btnCustomerMouseClicked(evt);
}
});
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(btnCreateNewAccount, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jPanel2Layout.createSequentialGroup()
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel2Layout.createSequentialGroup()
.addComponent(btnAnounce, javax.swing.GroupLayout.PREFERRED_SIZE, 249, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(btnBooking, javax.swing.GroupLayout.PREFERRED_SIZE, 229, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel2Layout.createSequentialGroup()
.addComponent(btnDiscount, javax.swing.GroupLayout.PREFERRED_SIZE, 249, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(btnStaff, javax.swing.GroupLayout.PREFERRED_SIZE, 229, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 18, Short.MAX_VALUE)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(btnSearch, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 205, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(btnCustomer, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 205, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(txtAccount, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 205, javax.swing.GroupLayout.PREFERRED_SIZE))))
.addContainerGap())
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addGroup(jPanel2Layout.createSequentialGroup()
.addComponent(txtAccount, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btnSearch, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(jPanel2Layout.createSequentialGroup()
.addGap(9, 9, 9)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(btnAnounce, javax.swing.GroupLayout.PREFERRED_SIZE, 125, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(btnBooking, javax.swing.GroupLayout.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE))))
.addGap(7, 7, 7)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(btnStaff, javax.swing.GroupLayout.PREFERRED_SIZE, 121, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(btnDiscount, javax.swing.GroupLayout.PREFERRED_SIZE, 126, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(btnCustomer, javax.swing.GroupLayout.PREFERRED_SIZE, 122, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(btnCreateNewAccount, javax.swing.GroupLayout.PREFERRED_SIZE, 164, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(9, 9, 9))
);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, 0)
.addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void lbMinMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbMinMouseClicked
this.setState(JFrame.ICONIFIED);
}//GEN-LAST:event_lbMinMouseClicked
private void lbCloseMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbCloseMouseClicked
if (JOptionPane.showConfirmDialog(new JFrame(),
"Do you want to quit this application ?", "",
JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {
System.exit(0);
}
}//GEN-LAST:event_lbCloseMouseClicked
private void jPanel1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jPanel1MouseClicked
}//GEN-LAST:event_jPanel1MouseClicked
private void btnAnounceMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btnAnounceMouseClicked
}//GEN-LAST:event_btnAnounceMouseClicked
private void txtAccountMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_txtAccountMouseClicked
}//GEN-LAST:event_txtAccountMouseClicked
private void btnBookingMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btnBookingMouseClicked
}//GEN-LAST:event_btnBookingMouseClicked
private void btnSearchMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btnSearchMouseClicked
}//GEN-LAST:event_btnSearchMouseClicked
private void btnDiscountMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btnDiscountMouseClicked
}//GEN-LAST:event_btnDiscountMouseClicked
private void btnCreateNewAccountMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btnCreateNewAccountMouseClicked
}//GEN-LAST:event_btnCreateNewAccountMouseClicked
private void btnStaffMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btnStaffMouseClicked
// TODO add your handling code here:
}//GEN-LAST:event_btnStaffMouseClicked
private void btnCustomerMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btnCustomerMouseClicked
// TODO add your handling code here:
}//GEN-LAST:event_btnCustomerMouseClicked
private void jPanel2MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jPanel2MouseClicked
}//GEN-LAST:event_jPanel2MouseClicked
private void btnCreateNewAccountActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCreateNewAccountActionPerformed
setVisible(false);
RegisterForm rgf = new RegisterForm();
rgf.setVisible(true);
rgf.setLocationRelativeTo(null);
}//GEN-LAST:event_btnCreateNewAccountActionPerformed
/**
* @param args the command line arguments
*/
// public static void main(String args[]) {
// /* Set the Nimbus look and feel */
// //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
// /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
// * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
// */
// try {
// for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
// if ("Nimbus".equals(info.getName())) {
// javax.swing.UIManager.setLookAndFeel(info.getClassName());
// break;
// }
// }
// } catch (ClassNotFoundException ex) {
// java.util.logging.Logger.getLogger(MainControlInterface.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
// } catch (InstantiationException ex) {
// java.util.logging.Logger.getLogger(MainControlInterface.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
// } catch (IllegalAccessException ex) {
// java.util.logging.Logger.getLogger(MainControlInterface.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
// } catch (javax.swing.UnsupportedLookAndFeelException ex) {
// java.util.logging.Logger.getLogger(MainControlInterface.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
// }
// //</editor-fold>
//
// /* Create and display the form */
// java.awt.EventQueue.invokeLater(new Runnable() {
// public void run() {
// new MainControlInterface().setVisible(true);
// }
// });
// }
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton btnAnounce;
private javax.swing.JButton btnBooking;
private javax.swing.JButton btnCreateNewAccount;
private javax.swing.JButton btnCustomer;
private javax.swing.JButton btnDiscount;
private javax.swing.JButton btnSearch;
private javax.swing.JButton btnStaff;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JLabel lbClose;
private javax.swing.JLabel lbMin;
private javax.swing.JLabel lbRegister;
private javax.swing.JTextField txtAccount;
// End of variables declaration//GEN-END:variables
void setTxtAccount(String text) {
txtAccount.setText(text);
}
@Override
public void actionPerformed(ActionEvent ae) {
if (this.isVisible()) {
setVisible(false);
} else {
setVisible(true);
}
}
}
| [
"nguyenthanhnam1004@gmail.com"
] | nguyenthanhnam1004@gmail.com |
fb2fcf259ab3fc5fdf57ae39487d1f1c130527b2 | 8eeeb4535cdf7c32c47880e05412cec513ed8ce8 | /core/src/com/pukekogames/airportdesigner/Helper/ScreenState.java | 35ff761fa5eef5d59cbecc18fefbc2104f87f3ec | [] | no_license | imperiobadgo/AirportDesigner | 850c3d87a3fb3db4aca83468dc98d5a54f105fb0 | 48da49b9d80238b9f4bc5a934c154d6cecda857f | refs/heads/master | 2021-01-18T16:16:31.641734 | 2017-10-06T15:12:09 | 2017-10-06T15:12:09 | 86,731,797 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 170 | java | package com.pukekogames.airportdesigner.Helper;
/**
* Created by Marko Rapka on 05.12.2015.
*/
public enum ScreenState {
Game(),
TimeWindow(),
Airline()
}
| [
"wllokmarko@yahoo.de"
] | wllokmarko@yahoo.de |
132dfc075e6ebc3082f0c5260e559ada6f8a0a97 | eefef840c23558ed067c9bcd57b46b2ce6f63819 | /android/src/com/ygk/gcodecamera/MainActivity.java | 700a02eda3af0936c1bd4e5cc33d2c47d982c5c5 | [] | no_license | scsonic/GCodeCamera | 8d30460467344c8a1b753692c16ca945e375ebbd | 08d659c35912451c7f55aa5e2e22e54e1d4735de | refs/heads/master | 2021-01-20T17:54:20.875257 | 2016-08-05T01:43:09 | 2016-08-05T01:43:09 | 64,931,366 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,249 | java | package com.ygk.gcodecamera;
import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
public class MainActivity extends Activity {
static public String TAG = "MainActivity" ;
public CameraFragment cameraFragment ;
@Override
protected void onCreate(Bundle savedInstanceState) {
Common.init(this) ;
super.onCreate(savedInstanceState);
cameraFragment = new CameraFragment();
Common.cameraFragment = cameraFragment;
setContentView(R.layout.activity_main);
if (savedInstanceState == null) {
getFragmentManager().beginTransaction().add(R.id.container, cameraFragment).commit();
}
String raw = Common.readSharePerf(Common.SETTING) ;
Common.set = Setting.fromJSON(raw) ;
if (Common.set == null)
{
Common.set = Setting.getDefaultSetting() ;
}
// init color
Setting.colorMap.put("White" , "#FFFFFF");
Setting.colorMap.put("Silver" , "#C0C0C0");
Setting.colorMap.put("Gray" , "#808080");
Setting.colorMap.put("Black" , "#000000");
Setting.colorMap.put("Red" , "#FF0000");
Setting.colorMap.put("Maroon" , "#800000");
Setting.colorMap.put("Yellow" , "#FFFF00");
Setting.colorMap.put("Olive" , "#808000");
Setting.colorMap.put("Lime" , "#00FF00" );
Setting.colorMap.put("Green" , "#008000");
Setting.colorMap.put("Aqua" , "#00FFFF" );
Setting.colorMap.put("Teal" , "#008080" );
Setting.colorMap.put("Blue" , "#0000FF" );
Setting.colorMap.put("Navy" , "#000080" );
Setting.colorMap.put("Fuchsia" , "#FF00FF" );
Setting.colorMap.put("Purple" , "#800080");
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.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();
return super.onOptionsItemSelected(item);
}
@Override
protected void onStop() {
Common.writeSharePerf(Common.SETTING, Common.set.toJSON());
super.onStop();
}
}
| [
"scsonic@gmail.com"
] | scsonic@gmail.com |
150788add3d35ce040d89aec44b340bcaf6027f3 | f556655da952ff6e11b1023851b1c6149a1ac54d | /LocalFileHandling/app/src/main/java/com/junjunguo/localfilehandling/model/LocationReport.java | eb2f7f0cc70df4c29a66d87e4c62754e4f817545 | [] | no_license | salahpepsi/android | 1becf74e36d344dc755a8139d29b88796579da55 | 0834a990b3ef7e8354df1c36a1c2c9b10ef28310 | refs/heads/master | 2020-04-27T21:59:06.002794 | 2019-03-30T15:47:59 | 2019-03-30T15:47:59 | 174,719,009 | 0 | 0 | null | 2019-03-09T16:36:28 | 2019-03-09T16:36:28 | null | UTF-8 | Java | false | false | 2,604 | java | package com.junjunguo.localfilehandling.model;
import java.text.SimpleDateFormat;
import java.util.Calendar;
/**
* This file is part of LocalFileHandling
* <p/>
* Created by GuoJunjun <junjunguo.com> on 08/03/15.
* <p/>
* Responsible for this file: GuoJunjun
*/
public class LocationReport {
private String userid;
private boolean isreported;
private Calendar datetime;
private double latitude, longitude;
private SimpleDateFormat df = new SimpleDateFormat("EEEE, MMMM d, yyyy 'at' h:mm a");
/**
* Sets new longitude.
*
* @param longitude New value of longitude.
*/
public void setLongitude(double longitude) { this.longitude = longitude; }
/**
* Gets latitude.
*
* @return Value of latitude.
*/
public double getLatitude() { return latitude; }
/**
* Gets isreported.
*
* @return Value of isreported.
*/
public boolean isIsreported() { return isreported; }
/**
* Gets longitude.
*
* @return Value of longitude.
*/
public double getLongitude() { return longitude; }
/**
* Sets new datetime.
*
* @param datetime New value of datetime.
*/
public void setDatetime(Calendar datetime) { this.datetime = datetime; }
/**
* Sets new datetime.
*
* @param datetime New value of datetime.
*/
public void setDatetime(long datetime) {
Calendar cal = Calendar.getInstance();
cal.setTimeInMillis(datetime);
this.datetime = cal;
}
/**
* Sets new latitude.
*
* @param latitude New value of latitude.
*/
public void setLatitude(double latitude) { this.latitude = latitude; }
/**
* Sets new userid.
*
* @param userid New value of userid.
*/
public void setUserid(String userid) { this.userid = userid; }
/**
* Gets datetime.
*
* @return Value of datetime.
*/
public Calendar getDatetime() { return datetime; }
/**
* Gets userid.
*
* @return Value of userid.
*/
public String getUserid() { return userid; }
/**
* Sets new isreported.
*
* @param isreported New value of isreported.
*/
public void setIsreported(boolean isreported) { this.isreported = isreported; }
@Override public String toString() {
return "userid='" + userid +
", isreported=" + isreported +
"\ndatetime=" + df.format(datetime.getTime()) +
"\nlatitude=" + latitude +
", longitude=" + longitude;
}
}
| [
"guojunjun@gmail.com"
] | guojunjun@gmail.com |
b95817042a5afb81ee6f33232ac64e48dd797bba | 2bc551f9c2ecb57ec0cb93ad18d3ce0bafbddb34 | /Spring/Source/springmvc5/src/main/java/example/WebConfig.java | 19609668f37ed062d33e9dade1cf844852cc3994 | [] | no_license | YiboXu/JavaLearning | c42091d6ca115826c00aad2565d9d0f29b1f5f68 | 97b4769ebbe096e0ab07acb6889fb177e2ca5abe | refs/heads/master | 2022-10-27T23:47:54.637565 | 2020-06-16T09:12:09 | 2020-06-16T09:12:09 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,132 | java | package example;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.ViewResolver;
import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import org.springframework.web.servlet.view.InternalResourceViewResolver;
@Configuration
@EnableWebMvc
@ComponentScan("example.web") //all controller will be put in package example.web
public class WebConfig extends WebMvcConfigurerAdapter{
@Bean
public ViewResolver viewResolver() {
InternalResourceViewResolver resolver =new InternalResourceViewResolver();
resolver.setPrefix("/WEB-INF/views/");
resolver.setSuffix(".jsp");
resolver.setExposeContextBeansAsAttributes(true);
return resolver;
}
@Override
public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) {
configurer.enable();
}
}
| [
"billtt@163.com"
] | billtt@163.com |
d3919128a683ee86189cc1d66a27af39f0808ba5 | 35369ef2fb3ee636e1ac332993554015a24d2169 | /ActivosFijos/src/main/java/asd/prueba/dao/AuthUserDaoJdbc.java | 08ca25380a6f1da885db8e65813b3068bf43e9ef | [] | no_license | jacadenac/ActivosFijos | 97ac3e5f5d8853e2c7d1b5805f754177c7992c13 | d2cd2b34c2514b334cc2cded69dcbbc991fbdf15 | refs/heads/master | 2020-03-19T21:45:48.486016 | 2018-06-13T10:30:52 | 2018-06-13T10:30:52 | 136,949,246 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,516 | java | package asd.prueba.dao;
import asd.prueba.model.AuthUser;
import asd.prueba.utils.Page;
import asd.prueba.utils.PaginationHelper;
import java.sql.SQLException;
import java.util.Date;
import java.util.List;
import javax.sql.DataSource;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.EmptyResultDataAccessException;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.namedparam.MapSqlParameterSource;
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
import org.springframework.stereotype.Repository;
/**
* AuthUser Dao Class
*
* @author Alejandro Cadena
* @version 1.0
*/
@Repository("authUserDao")
public class AuthUserDaoJdbc implements AuthUserDao {
/**
* Template para consultas jdbc
*/
protected NamedParameterJdbcTemplate npJdbcTemplate;
private static final String SQL_COUNT_ALL = "SELECT count(*) FROM auth_user";
private static final String SQL_FIND_ALL = "SELECT * FROM auth_user";
private static final String SQL_FIND_BY_PK = "SELECT * FROM auth_user WHERE username = :username";
private static final String SQL_INSERT = "INSERT INTO auth_user "
+ "(username, password, fullname, email, enabled) "
+ "VALUES (:username, :password, :fullname, :email, :enabled)";
private static final String SQL_UPDATE = "UPDATE auth_user SET "
+ "fullname = :fullname, email = :email, enabled = :enabled, "
+ "updated_date = :updated_date WHERE username = :username";
private static final String SQL_DELETE = "DELETE FROM auth_user "
+ "WHERE username = :username";
private static final Logger LOGGER = LogManager.getLogger(AuthUserDaoJdbc.class);
/**
* Se inyecta dataSource configurado en applicationContext.xml
* @param dataSource fuente de datos
*/
@Autowired
public void setDataSource(DataSource dataSource) {
this.npJdbcTemplate = new NamedParameterJdbcTemplate(dataSource);
}
/**
* Busca elemento por llave primaria
* @param pk llave primaria
* @return elemento encontrado, nulo si no se encontró el elemento
*/
@Override
public AuthUser findById(Object pk) {
MapSqlParameterSource mapParams = new MapSqlParameterSource();
mapParams.addValue("username", pk);
try{
return (AuthUser)this.npJdbcTemplate.queryForObject(
SQL_FIND_BY_PK,
mapParams,
new BeanPropertyRowMapper(AuthUser.class)
);
} catch (EmptyResultDataAccessException e) {
return null;
}
}
/**
* Busca todos los elementos registrados
* @return lista con todos los elementos encontrados
*/
@Override
public List<AuthUser> findAll() {
return this.npJdbcTemplate.query(SQL_FIND_ALL, new BeanPropertyRowMapper(AuthUser.class));
}
/**
* Busca todos los elementos registrados y los retorna paginados
* @param pageNo Número de página a ser consultada
* @param pageSize Máximo número de elementos por página
* @return Lista de elementos paginados
* @throws SQLException en caso de error durante la consulta
*/
@Override
public Page<AuthUser> findAllWithPagination(int pageNo, int pageSize) throws SQLException {
PaginationHelper<AuthUser> ph = new PaginationHelper();
return ph.fetchPage(
npJdbcTemplate,
SQL_COUNT_ALL,
SQL_FIND_ALL,
pageNo,
pageSize,
new BeanPropertyRowMapper(AuthUser.class)
);
}
/**
* Inserta un elemento nuevo en la base de datos
* @param modelObject elemento que será insertado
* @throws SQLException en caso de error durante la inserción
*/
@Override
public void insert(AuthUser modelObject) throws SQLException {
MapSqlParameterSource mapParams = new MapSqlParameterSource();
mapParams.addValue("username", modelObject.getUsername());
mapParams.addValue("password", modelObject.getPassword());
mapParams.addValue("fullname", modelObject.getFullname());
mapParams.addValue("email", modelObject.getEmail());
mapParams.addValue("enabled", modelObject.isEnabled());
mapParams.addValue("updated_date", new Date());
this.npJdbcTemplate.update(SQL_INSERT, mapParams);
}
/**
* Actualiza el elemento en la base de datos
* @param modelObject elemento que será actualizado
* @throws SQLException en caso de error durante la actualización
*/
@Override
public void update(AuthUser modelObject) throws SQLException {
MapSqlParameterSource mapParams = new MapSqlParameterSource();
mapParams.addValue("fullname", modelObject.getFullname());
mapParams.addValue("email", modelObject.getEmail());
mapParams.addValue("enabled", modelObject.isEnabled());
mapParams.addValue("username", modelObject.getUsername());
mapParams.addValue("updated_date", new Date());
int numRowsAffected = this.npJdbcTemplate.update(SQL_UPDATE, mapParams);
if(numRowsAffected == 0){
this.throwNotFoundByPK(modelObject.getUsername());
}
}
/**
* Elimina el elemento de la base de datos
* @param modelObject elemento que será eliminado
* @throws SQLException en caso de error durante la eliminación
*/
@Override
public void delete(AuthUser modelObject) throws SQLException {
MapSqlParameterSource mapParams = new MapSqlParameterSource();
mapParams.addValue("username", modelObject.getUsername());
String sentenceSQL = SQL_DELETE;
int numRowsAffected = this.npJdbcTemplate.update(sentenceSQL, mapParams);
if(numRowsAffected == 0){
this.throwNotFoundByPK(modelObject.getUsername());
}
}
/**
* Arroja error indicando que el elemento no fue encontrado
* @param pk llave primaria
*/
private void throwNotFoundByPK(Object pk){
String message = "No "+AuthUser.class.getSimpleName()+" found with PK " + pk;
EmptyResultDataAccessException erdae = new EmptyResultDataAccessException(message, 1);
LOGGER.error(message);
throw erdae;
}
}
| [
""
] | |
a329ef082fbedb11794dae8264630f7b19d33182 | 418e3600ebe5e2b2ec2cca790408ecca0882fbe5 | /src/main/java/com/beimi/config/web/GameServerConfiguration.java | deec1e52bf27f2ffb7dd7dbae9038ca472d284e1 | [
"Apache-2.0"
] | permissive | beijixiongzzj/shouerGame | c756fb2c24dd18f57c7515b0f32afcf0deea9ce7 | b35c3e36d26722eb93e0ab14b721042187ebe985 | refs/heads/master | 2020-03-13T10:54:46.955667 | 2018-04-26T03:13:33 | 2018-04-26T03:13:33 | 131,092,233 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,176 | java | package com.beimi.config.web;
import java.io.IOException;
import java.security.NoSuchAlgorithmException;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import com.beimi.core.BMDataContext;
import com.beimi.util.server.handler.GameEventHandler;
/**
* 加载game server的相关配置,初始化进程。
*/
@org.springframework.context.annotation.Configuration
public class GameServerConfiguration
{
@Value("${uk.im.server.host}")
private String host;
@Value("${uk.im.server.port}")
private Integer port;
@Value("${web.upload-path}")
private String path;
@Value("${uk.im.server.threads}")
private String threads;
private GameEventHandler handler = new GameEventHandler();
@Bean(name="webimport")
public Integer getWebIMPort() {
BMDataContext.setWebIMPort(port);
return port;
}
@Bean
public GameServer socketIOServer() throws NoSuchAlgorithmException, IOException{
GameServer server = new GameServer(port , handler) ;
handler.setServer(server);
return server;
}
} | [
"ZHANGZHENJIAN@kingsoft.com"
] | ZHANGZHENJIAN@kingsoft.com |
85690e2fb2183954a8b26e4a3ad0910f30d8a930 | 2da82703b3fd5bfad2f4b451fc80e61a41e09996 | /src/_07_fortune_cookie/FortuneCookie.java | 40eea2d35dcd6f9d4b874e2038e80b2c4bd52f92 | [] | no_license | League-Level1-Student/level1-module0-AkselAannestad | 42e7bcddfc0b8472767b7eb423d466d2956d3eb0 | a9f9db442f913f9b69d7039382d96bb0149391e9 | refs/heads/master | 2022-11-23T22:15:31.565992 | 2020-07-30T03:17:26 | 2020-07-30T03:17:26 | 276,523,952 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,175 | java | package _07_fortune_cookie;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Random;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
public class FortuneCookie implements ActionListener {
public void showButton() {
JFrame frame =new JFrame();
frame.setVisible(true);
JButton button = new JButton("Open your fortune");
frame.add(button);
frame.pack();
button.addActionListener(this);
}
@Override
public void actionPerformed(ActionEvent e) {
int rand = new Random().nextInt(5);
if(rand==0) {
JOptionPane.showMessageDialog(null, "You will live a long and properous life as a uber driver");
}
else if(rand==1) {
JOptionPane.showMessageDialog(null, "You will spend too much time gaming");
}
else if(rand==2) {
JOptionPane.showMessageDialog(null, "Something is coming");
}
else if(rand==3) {
JOptionPane.showMessageDialog(null, "You will have a big surprise");
}
else if(rand==4) {
JOptionPane.showMessageDialog(null, "If you don't change your path, you will end up where you're headed");
}
}
}
| [
"48100535+AkselAannestad@users.noreply.github.com"
] | 48100535+AkselAannestad@users.noreply.github.com |
0e7c43c4bdf2eeb1c1a3ff72a80fdeb6e52409a5 | c60c4eab8026801155183d39e56dbf6d72589185 | /src/main/java/com/library/domain/Admin.java | 907f806312febccf1690aff14a5ce089e6bf22c1 | [] | no_license | Panda0129/BookManagementSystem | 92927cba498247b3b65ce2a5dce0f0d5365f1da1 | 39f06114ebb9c45bc2adb6980906eec8c1e6c85a | refs/heads/master | 2021-09-01T02:03:32.407613 | 2017-12-24T09:34:33 | 2017-12-24T09:34:33 | 113,749,210 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 426 | java | package com.library.domain;
public class Admin {
private String admin_id;
private String admin_pwd;
public String getAdmin_id() {
return admin_id;
}
public void setAdmin_id(String admin_id) {
this.admin_id = admin_id;
}
public String getAdmin_pwd() {
return admin_pwd;
}
public void setAdmin_pwd(String admin_pwd) {
this.admin_pwd = admin_pwd;
}
}
| [
"boj01291127@gmail.com"
] | boj01291127@gmail.com |
6ed4565aa0daf9dffa26d0a6455c0d5f871b232f | 7f20b1bddf9f48108a43a9922433b141fac66a6d | /csplugins/trunk/toronto/jm/cy3-stateless-taskfactory-alt1/impl/core-task-impl/src/main/java/org/cytoscape/task/internal/export/network/ExportNetworkViewTaskFactory.java | 5ceb5735aaeeeb7496581a35513c6d004727aa7d | [] | no_license | ahdahddl/cytoscape | bf783d44cddda313a5b3563ea746b07f38173022 | a3df8f63dba4ec49942027c91ecac6efa920c195 | refs/heads/master | 2020-06-26T16:48:19.791722 | 2013-08-28T04:08:31 | 2013-08-28T04:08:31 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 671 | java | package org.cytoscape.task.internal.export.network;
import org.cytoscape.io.write.CyNetworkViewWriterManager;
import org.cytoscape.task.AbstractNetworkViewTaskFactory;
import org.cytoscape.view.model.CyNetworkView;
import org.cytoscape.work.TaskIterator;
public class ExportNetworkViewTaskFactory extends AbstractNetworkViewTaskFactory {
private CyNetworkViewWriterManager writerManager;
public ExportNetworkViewTaskFactory(CyNetworkViewWriterManager writerManager) {
this.writerManager = writerManager;
}
@Override
public TaskIterator createTaskIterator(CyNetworkView view) {
return new TaskIterator(2,new CyNetworkViewWriter(writerManager, view));
}
}
| [
"jm@0ecc0d97-ab19-0410-9704-bfe1a75892f5"
] | jm@0ecc0d97-ab19-0410-9704-bfe1a75892f5 |
9f806657a74c3febb5cbab44546a3548a10b1c83 | 529ffd6d52afbb459e0e5ad248257d58412c40e6 | /src/com/aut/BaseCryptography.java | 238afe96e69f609b56efbc76467fc22588890ea2 | [] | no_license | KimiyaZargari/APMidProject | 4ca3c8f92eab3a41174c12405c939e3e4145b768 | 04eaa4e4c8fd6e114b055c731d4407c558af00a4 | refs/heads/master | 2021-01-05T21:49:07.229558 | 2020-02-17T15:55:28 | 2020-02-17T15:55:28 | 241,147,047 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 234 | java | package com.aut;
/**
* this class is an abstract class for cryptography.
*/
public abstract class BaseCryptography {
public abstract String encrypt(String plainText);
public abstract String decrypt(String cipherText);
}
| [
"kimiyazargari13@gmail.com"
] | kimiyazargari13@gmail.com |
bb50b509ae0fd0eff8651f5aa7afedad748189e7 | b5a82a83c4d2b3db2982713252682dd07524ba7f | /src/java112/project3/MLJServlet.java | 6c1ca50c92f6bcdd466a4203015737657dd5a21f | [] | no_license | MadJavaAdvFall2017/mvc-team-challenge-m-l-j | 5d5184e19d1299865c1d02dac6b103fc8fe4535b | 95090766c88bf68603f5189551c9454d7cc96121 | refs/heads/master | 2021-05-07T20:04:38.742639 | 2017-11-07T01:04:49 | 2017-11-07T01:04:49 | 108,920,138 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,244 | java | package java112.project3;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
/**
* @author Eric Knapp
* class MvcDemo
*
*/
@WebServlet(
name = "MLJServlet",
urlPatterns = { "/mlj-servlet" }
)
public class MLJServlet extends HttpServlet {
/**
* Handles HTTP GET requests.
*
*@param request the HttpServletRequest object
*@param response the HttpServletResponse object
*@exception ServletException if there is a Servlet failure
*@exception IOException if there is an IO failure
*/
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String answer1 = request.getParameter("answer1");
String answer2 = request.getParameter("answer2");
BeanMLJ myBean = new BeanMLJ();
myBean.setAnswer1(answer1);
myBean.setAnswer2(answer2);
request.setAttribute("myCoolBean", myBean);
String url = "/mlj.jsp";
RequestDispatcher dispatcher
= getServletContext().getRequestDispatcher(url);
dispatcher.forward(request, response);
}
} | [
"jhemmila@madisoncollege.edu"
] | jhemmila@madisoncollege.edu |
80d0ea018c43dbadb8375a73a0d22df867ed31ca | 2e46539de5923a90e4217b4bc1331f6dd198ca72 | /SpringBootWebApp/src/main/java/com/demo/ServletInitializer.java | d57b37b1af4beac3a1ec438a54fbda570b9a8b6b | [] | no_license | SusantJava/ExcpetionHanlding | df2054e9c15fa88482bb81a8838cb5a1e2540843 | ab38ca308893212aca096c894f0e2e9b59175c3c | refs/heads/master | 2020-09-07T11:58:57.294192 | 2019-11-10T10:23:08 | 2019-11-10T10:23:08 | 220,773,186 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 408 | java | package com.demo;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
public class ServletInitializer extends SpringBootServletInitializer {
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(SpringBootWebAppApplication.class);
}
}
| [
"PRASANT@192.168.1.7"
] | PRASANT@192.168.1.7 |
a804d58f8c0be08135b87198e2cfb4e9396e19cf | c01ce54fdfef3950fe30760116d8017dafcf5374 | /app/src/main/java/course/leedev/cn/pubgassistant/ui/fragment/home/child/tabs/RegisterFragment.java | 721620de36696c3341b35aa7f093734c28fafe2b | [] | no_license | ThomasLeedev/PUBGAssistant | 1921fdf2cf714a2daf0f25ad45d073004fd7ac2c | 818f4d2222ffa824f774d661a2c29d410e83b555 | refs/heads/master | 2021-09-05T14:13:36.158101 | 2018-01-28T17:19:08 | 2018-01-28T17:19:08 | 119,280,301 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 3,655 | java | package course.leedev.cn.pubgassistant.ui.fragment.home.child.tabs;
import android.os.Bundle;
import android.os.Handler;
import android.support.v4.widget.SwipeRefreshLayout;
import android.view.View;
import android.widget.Button;
import com.jakewharton.rxbinding2.view.RxView;
import com.tencent.smtt.sdk.WebChromeClient;
import com.tencent.smtt.sdk.WebSettings;
import com.tencent.smtt.sdk.WebView;
import com.tencent.smtt.sdk.WebViewClient;
import java.util.concurrent.TimeUnit;
import butterknife.BindView;
import course.leedev.cn.pubgassistant.R;
import course.leedev.cn.pubgassistant.base.fragment.BaseCompatFragment;
import io.reactivex.Scheduler;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.functions.Consumer;
import io.reactivex.schedulers.Schedulers;
/**
* Created by lt on 2018/1/8.
*/
public class RegisterFragment extends BaseCompatFragment {
@BindView(R.id.wv_register)
WebView wvRegister;
@BindView(R.id.btn_back_register)
Button btnRegister;
// @BindView(R.id.btn_back_login)
// Button btnLogin;
// @BindView(R.id.btn_back_bind)
// Button btnBind;
private WebSettings webSettings;
private Handler handler = new Handler();
public static RegisterFragment newInstance() {
return new RegisterFragment();
}
@Override
protected void initUI(View view, Bundle savedInstanceState) {
wvRegister.loadUrl("http://www.jixunjsq.com/user/index/register.html");
webSettings = wvRegister.getSettings();
webSettings.setJavaScriptEnabled(true);
webSettings.setSupportZoom(true);
webSettings.setBuiltInZoomControls(true);
webSettings.setUseWideViewPort(true);
webSettings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.SINGLE_COLUMN);
webSettings.setDisplayZoomControls(false);
// wvRegister.setWebViewClient(new WebViewClient() {
// @Override
// public boolean shouldOverrideUrlLoading(WebView webView, String s) {
// webView.loadUrl(s);
// return super.shouldOverrideUrlLoading(webView, s);
// }
// });
btnClick();
}
private void btnClick() {
RxView.clicks(btnRegister).debounce(300, TimeUnit.MILLISECONDS)
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Consumer<Object>() {
@Override
public void accept(Object o) throws Exception {
reloadUrl("http://www.jixunjsq.com/user/index/register.html");
}
});
//
// RxView.clicks(btnLogin).debounce(300, TimeUnit.MILLISECONDS)
// .observeOn(AndroidSchedulers.mainThread())
// .subscribe(new Consumer<Object>() {
// @Override
// public void accept(Object o) throws Exception {
// reloadUrl("http://www.jixunjsq.com/user/index/login.html");
// }
// });
//
// RxView.clicks(btnBind).debounce(300, TimeUnit.MILLISECONDS)
// .observeOn(AndroidSchedulers.mainThread())
// .subscribe(new Consumer<Object>() {
// @Override
// public void accept(Object o) throws Exception {
// reloadUrl("http://www.jixunjsq.com/user/manage/phone.html");
// }
// });
}
@Override
public int getLayoutId() {
return R.layout.fragment_home_register;
}
public void reloadUrl(String url) {
wvRegister.loadUrl(url);
}
}
| [
"thomaslee.dev@gmail.com"
] | thomaslee.dev@gmail.com |
8bbeed11585e22a418db821f2f59633364988a3b | 02e3ae050bf69373effa262a8a8230dea20c484c | /src/main/java/com/company/test/interceptor/DSKey.java | 760c81a7193f9d5ad30f807d274d0e37719d4e45 | [] | no_license | FayeGitHub/test | 5dc3c752956c4fa3ae0bdd61f39f0e47df96deaa | ec1b3220bc9fadcaaa5d96e9a98cde8dee03ceb1 | refs/heads/master | 2022-12-21T20:45:05.185005 | 2021-11-14T15:06:07 | 2021-11-14T15:06:07 | 193,888,819 | 0 | 0 | null | 2022-12-16T05:06:12 | 2019-06-26T11:10:03 | HTML | UTF-8 | Java | false | false | 453 | java | package com.company.test.interceptor;
import java.lang.annotation.Target;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
/**
*
* 数据源选择 注解
* 用在参数上,表示使用对应字段的hashcode来选择数据库
*/
@Target(ElementType.PARAMETER)
@Retention(RetentionPolicy.RUNTIME)
public @interface DSKey {
String value() default "";
}
| [
"flyfo@DESKTOP-4PO01IH"
] | flyfo@DESKTOP-4PO01IH |
a303eede61ee15cf976b8bb0df3358ce592b598f | af626ade966544b91fbfe0ea81fc887f1b8a2821 | /src/secp256k1/src/java/org/bitcoinrtx/NativeSecp256k1.java | b2b0bede0ec7faee28f3ba119c6aa26ee386169f | [
"MIT",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | kunalbarchha/bitcoinrtx-old | 91f2b36a50e009151c61d36e77a563d0c17ab632 | 42c61d652288f183c4607462e2921bb33ba9ec1f | refs/heads/master | 2023-03-13T22:46:36.993580 | 2021-03-04T13:01:00 | 2021-03-04T13:01:00 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,103 | java | package org.bitcoinrtx;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import com.google.common.base.Preconditions;
/**
* This class holds native methods to handle ECDSA verification.
* You can find an example library that can be used for this at
* https://github.com/sipa/secp256k1
*/
public class NativeSecp256k1 {
public static final boolean enabled;
static {
boolean isEnabled = true;
try {
System.loadLibrary("javasecp256k1");
} catch (UnsatisfiedLinkError e) {
isEnabled = false;
}
enabled = isEnabled;
}
private static ThreadLocal<ByteBuffer> nativeECDSABuffer = new ThreadLocal<ByteBuffer>();
/**
* Verifies the given secp256k1 signature in native code.
* Calling when enabled == false is undefined (probably library not loaded)
*
* @param data The data which was signed, must be exactly 32 bytes
* @param signature The signature
* @param pub The public key which did the signing
*/
public static boolean verify(byte[] data, byte[] signature, byte[] pub) {
Preconditions.checkArgument(data.length == 32 && signature.length <= 520 && pub.length <= 520);
ByteBuffer byteBuff = nativeECDSABuffer.get();
if (byteBuff == null) {
byteBuff = ByteBuffer.allocateDirect(32 + 8 + 520 + 520);
byteBuff.order(ByteOrder.nativeOrder());
nativeECDSABuffer.set(byteBuff);
}
byteBuff.rewind();
byteBuff.put(data);
byteBuff.putInt(signature.length);
byteBuff.putInt(pub.length);
byteBuff.put(signature);
byteBuff.put(pub);
return secp256k1_ecdsa_verify(byteBuff) == 1;
}
/**
* @param byteBuff signature format is byte[32] data,
* native-endian int signatureLength, native-endian int pubkeyLength,
* byte[signatureLength] signature, byte[pubkeyLength] pub
* @returns 1 for valid signature, anything else for invalid
*/
private static native int secp256k1_ecdsa_verify(ByteBuffer byteBuff);
}
| [
"kunal@coinrecoil.com"
] | kunal@coinrecoil.com |
27e0870ea0de41f987687a9d1ccf3ab1efb4f380 | 60d47cd1795ec1030d2bc829a5857ee8486579c2 | /src/main/java/com/rest/webservices/restfulwebservices/versioning/Name.java | abfc95e970067bcfbc78bc92d8fca7271ea577a3 | [] | no_license | ananjarusarunchai/restful-springboot | 96b346bb97dbfdaaab77af7395ef39e13dc196cf | 24cb075fa43c41168adaab3ec98ecd6490605f86 | refs/heads/master | 2020-05-01T04:12:44.506524 | 2019-03-23T09:14:25 | 2019-03-23T09:14:25 | 177,267,495 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 560 | java | package com.rest.webservices.restfulwebservices.versioning;
public class Name {
private String name;
private String lastName;
public Name(){}
public Name(String name, String lastName) {
this.name = name;
this.lastName = lastName;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
}
| [
"anan.answer@gmail.com"
] | anan.answer@gmail.com |
6c806569316298ffbc7ffe5002ed28c03bd99b11 | 7db0db28538330106923ff3290dc309f42a80c8e | /West2MilkteaShop/src/Main.java | 05dd044dea1cfe3f2568aa4c9af103afcb026b55 | [] | no_license | smsbQAQ/West2work-vol.2 | 8015e1110e53958d58de172710b40c5ec586028b | 8930b44920bb3ad380a11bbd349af6055a971130 | refs/heads/master | 2020-09-26T20:29:54.363369 | 2019-12-06T14:40:38 | 2019-12-06T14:40:38 | 226,337,631 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 804 | java | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
TeaShop ts=new TeaShop();
System.out.println("欢迎光临西二奶茶店");
while(true){
System.out.println("输入");
System.out.println("1->珍珠奶茶");
System.out.println("2->椰果奶茶");
System.out.println("3->溜了");
Scanner sc =new Scanner(System.in);
int n=sc.nextInt();
if(n==3)
break;
if(n==1){
MilkTea mt=new MilkTea("珍珠奶茶!",new Bubble());
ts.sell(mt);
}
else{
MilkTea mt=new MilkTea("椰果奶茶!",new Coconut());
ts.sell(mt);
}
}
}
}
| [
"625672754@qq.com"
] | 625672754@qq.com |
a575bd4ff615f6aed2e2d9956e44c879daa3b488 | 449cc92656d1f55bd7e58692657cd24792847353 | /st-service/src/main/java/com/lj/business/st/dto/wxPmFollow/FindWxPmFollowReportGmPage.java | 7f238f7bc387064d189977480a018075e727bc28 | [] | no_license | cansou/HLM | f80ae1c71d0ce8ead95c00044a318796820a8c1e | 69d859700bfc074b5948b6f2c11734ea2e030327 | refs/heads/master | 2022-08-27T16:40:17.206566 | 2019-12-18T06:48:10 | 2019-12-18T06:48:10 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,346 | java | package com.lj.business.st.dto.wxPmFollow;
import java.util.Date;
import com.lj.base.core.pagination.PageParamEntity;
public class FindWxPmFollowReportGmPage extends PageParamEntity {
/**
*
*/
private static final long serialVersionUID = -5906336118089412730L;
/**
* 商户编号
*/
private String merchantNo;
/**
* 日报日期
*/
private Date reportDate;
/**
* 经销商代码
*/
private String dealerCode;
/**
* 经销商名称
*/
private String companyName;
/**
* 门店代码
*/
private String shopCode;
/**
* 门店名称
*/
private String shopName;
public String getMerchantNo() {
return merchantNo;
}
public void setMerchantNo(String merchantNo) {
this.merchantNo = merchantNo;
}
public Date getReportDate() {
return reportDate;
}
public void setReportDate(Date reportDate) {
this.reportDate = reportDate;
}
public String getDealerCode() {
return dealerCode;
}
public void setDealerCode(String dealerCode) {
this.dealerCode = dealerCode;
}
public String getCompanyName() {
return companyName;
}
public void setCompanyName(String companyName) {
this.companyName = companyName;
}
public String getShopCode() {
return shopCode;
}
public void setShopCode(String shopCode) {
this.shopCode = shopCode;
}
public String getShopName() {
return shopName;
}
public void setShopName(String shopName) {
this.shopName = shopName;
}
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("FindWxPmFollowReportGmPage [merchantNo=");
builder.append(merchantNo);
builder.append(", reportDate=");
builder.append(reportDate);
builder.append(", dealerCode=");
builder.append(dealerCode);
builder.append(", companyName=");
builder.append(companyName);
builder.append(", shopCode=");
builder.append(shopCode);
builder.append(", shopName=");
builder.append(shopName);
builder.append("]");
return builder.toString();
}
}
| [
"37724558+wo510751575@users.noreply.github.com"
] | 37724558+wo510751575@users.noreply.github.com |
afb11781d9204c1f6a74f95e22614ed988afcd77 | 4301558203f98a3c0c64b24cce1324a602acc770 | /src/model/DirectorDTO.java | b5a5bfaa3809b764d542cc6a5f95d0b960c7a596 | [] | no_license | pooya98/knuMovieDB | a9bb6e87010b206d3cb6cc038793f47f479d1a57 | 8fbee34f515985d45785aa5e86b2928d016057cd | refs/heads/master | 2023-02-01T03:57:40.426447 | 2020-12-14T13:58:47 | 2020-12-14T13:58:47 | 320,591,570 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 530 | java | package model;
public class DirectorDTO {
private int id;
private String name;
private String birth;
private String sex;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getBirth() {
return birth;
}
public void setBirth(String birth) {
this.birth = birth;
}
public String getSex() {
return sex;
}
public void setSex(String sex) {
this.sex = sex;
}
}
| [
"pooya98@naver.com"
] | pooya98@naver.com |
2ae459d39eac191dceba9d016f38623bd9b7ed22 | 96ca02a85d3702729076cb59ff15d069dfa8232b | /advert/src/com/avit/dtmb/type/PloyType.java | 5070f1fca3b29204f971835ea164e86e8d5e4754 | [] | no_license | Hurson/mysql | 4a1600d9f580ac086ff9472095ed6fa58fb11830 | 3db53442376485a310c76ad09d6cf71143f38274 | refs/heads/master | 2021-01-10T17:55:50.003989 | 2016-03-11T11:36:15 | 2016-03-11T11:36:15 | 54,877,514 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 673 | java | package com.avit.dtmb.type;
public enum PloyType {
Area("1","区域"),
Time("2","时段"),
ChanGroup("3","频道组"),
AudGronp("4","广播频道组"),
UserIndustry("5","行业"),
UserLevel("6","级别"),
UserTVNNO("7","TVN号");
private String key;
private String value;
private PloyType(String key, String value){
this.key = key;
this.value = value;
}
public static String getValue(String key){
for(PloyType type : PloyType.values()){
if(type.key.equals(key)){
return type.value;
}
}
return null;
}
public String getKey() {
return key;
}
public String getValue() {
return value;
}
}
| [
"fushangsheng@d881c268-5c81-4d69-b6ac-ed4e9099e0f2"
] | fushangsheng@d881c268-5c81-4d69-b6ac-ed4e9099e0f2 |
5ba4b1fec95d17681a3aff4d5b7d5a9b44ebb249 | e8d44fe32e1b36ef4c396684b147344095500bbb | /app/src/main/java/com/example/androidtask/ViewReportApi.java | 6a19c4d488a1344673c5f57ddfa021d519cc78c9 | [] | no_license | gowri2071996/shlok | 5b9f56a538bd4d16370f22eb89c22f57b5743977 | de63e692633b0a7b6acc8c5e2b52f8be04a125fe | refs/heads/master | 2022-12-17T08:39:05.278025 | 2020-08-01T08:23:47 | 2020-08-01T08:23:47 | 284,218,649 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,096 | java | package com.example.androidtask;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import java.util.List;
import retrofit2.Call;
import retrofit2.http.GET;
public interface ViewReportApi {
@GET("get/cqRrpIGVVe?indent=2")
Call<viewReport> viewReport();
public class viewReport {
private String recordCount;
private String GetInspectionsResult;
public String getRecordCount ()
{
return recordCount;
}
public void setRecordCount (String recordCount)
{
this.recordCount = recordCount;
}
public String getGetInspectionsResult ()
{
return GetInspectionsResult;
}
public void setGetInspectionsResult (String GetInspectionsResult)
{
this.GetInspectionsResult = GetInspectionsResult;
}
@Override
public String toString()
{
return "ClassPojo [recordCount = "+recordCount+", GetInspectionsResult = "+GetInspectionsResult+"]";
}
}
}
| [
"68987388+gowri2071996@users.noreply.github.com"
] | 68987388+gowri2071996@users.noreply.github.com |
b1e80e5c53b5955fa6c5e47c6d85048b75292e1f | 975945cf2c76b20d5d4448b89f7057e33d1a9ebc | /zxing/src/main/java/com/baozi/baoziszxing/MainActivity.java | 569e5f177bb5392d0898dbed6fe0911e6bf23353 | [] | no_license | gy121681/Share | aa64f67746f88d55e884e5ae48b3789422175f8f | 031286dc1d2ce4ebe7fe2665ebd525d1946ad163 | refs/heads/master | 2021-01-15T12:02:34.908825 | 2017-08-08T03:01:07 | 2017-08-08T03:01:07 | 99,643,530 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,428 | java | //package com.baozi.baoziszxing;
//
//import android.app.Activity;
//import android.content.Intent;
//import android.os.Bundle;
//import android.support.v4.app.Fragment;
//import android.view.LayoutInflater;
//import android.view.View;
//import android.view.View.OnClickListener;
//import android.view.ViewGroup;
//import android.widget.TextView;
//
//import com.baozi.Zxing.CaptureActivity;
//import com.example.baoziszxing.R;
//
///**
// *
// * @author Baozi
// * @联系方式: 2221673069@qq.com
// *
// * @描述: 1 project能扫描二维码和普通一维码 ;
// *
// * 2 能从相册拿到二维码照片然后进行解析 --->注意 照片中的二维码 在拍摄的时候需要正对齐 否则会解析不出
// *
// * 3 针对大部分中文解决乱码问题 , 但依旧会有部分编码格式会出现中文乱码 如解决请联系我 QQ:2221673069
// *
// * 4 Zxing在使用过程中发现了新问题 :如果扫描的时候手机与二维码的角度超过30度左右的时候就解析不了 如解决请联系我
// * QQ:2221673069
// *
// * 谢谢大家 希望对大家有用
// */
//public class MainActivity extends Activity {
//
// @Override
// protected void onCreate(Bundle savedInstanceState) {
// super.onCreate(savedInstanceState);
// setContentView(R.layout.activity_main);
//
// findViewById(R.id.button1).setOnClickListener(new OnClickListener() {
//
// @Override
// public void onClick(View v) {
// // TODO Auto-generated method stub
// Intent intent = new Intent(MainActivity.this,
// CaptureActivity.class);
//
// startActivityForResult(intent, 100);
//
// }
// });
// }
//
// @Override
// protected void onActivityResult(int arg0, int arg1, Intent data) {
// super.onActivityResult(arg0, arg1, data);
//
// /**
// * 拿到解析完成的字符串
// */
// if (data != null) {
// TextView text = (TextView) findViewById(R.id.textView1);
// text.setText(data.getStringExtra("result"));
// }
// }
//
// /**
// * A placeholder fragment containing a simple view.
// */
// public static class PlaceholderFragment extends Fragment {
//
// public PlaceholderFragment() {
// }
//
// @Override
// public View onCreateView(LayoutInflater inflater, ViewGroup container,
// Bundle savedInstanceState) {
// View rootView = inflater.inflate(R.layout.fragment_main, container,
// false);
// return rootView;
// }
// }
//
//}
| [
"295306443@qq.com"
] | 295306443@qq.com |
8c06109bf57de293d3e41615ba09f8ecc30cd0b3 | c2ba646cb476ae4c177bed4642eebb2c7a29c0f3 | /src/IBit/DuplicatesInArray.java | 76c36cd72ba496cfa097b608d8a709cd8ce5d330 | [] | no_license | khowal2502/PractCodes | 7cbdd588303b7ed1283f090e7b56a9d0991c6f2c | eda40650dd42cc734b86e5263b6bc88552111355 | refs/heads/master | 2021-01-20T07:32:04.951638 | 2017-05-02T09:21:01 | 2017-05-02T09:21:01 | 90,010,409 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 741 | java | package IBit;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;
public class DuplicatesInArray {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
ArrayList<Integer> ret = new ArrayList<Integer>();
for(int j=0;j<n;j++){
ret.add(scan.nextInt());
}
System.out.println(repeatedNumber(ret));
scan.close();
}
public static int repeatedNumber(final List<Integer> a) {
int rep = -1;
int n = a.size();
boolean arr[] = new boolean[n];
Arrays.fill(arr, false);
for(int i=0;i<n;++i){
if(!arr[a.get(i)-1]){
arr[a.get(i)-1] = true;
}else{
rep = a.get(i);
break;
}
}
return rep;
}
}
| [
"krishna.khowal@outlook.com"
] | krishna.khowal@outlook.com |
822d1c712c85024b81fbce3bd6e416401e76f8c6 | b57e2c7d2a586581ae2e87ed7b69f80200e1cfa8 | /tuikit/src/main/java/com/tencent/qcloud/uikit/common/component/datepicker/configure/PickerOptions.java | 24934b8cf139288b9a424233077aaa0d0c62d46a | [] | no_license | q57690633/SCommunication | 7e90c244434666345067b8bf154d5f8289fdced9 | 345163e39fb85dcb5e99099a99c60d354fc923a3 | refs/heads/master | 2020-04-23T15:52:54.559082 | 2019-03-18T18:46:58 | 2019-03-18T18:46:58 | 171,279,419 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,536 | java | package com.tencent.qcloud.uikit.common.component.datepicker.configure;
import android.content.Context;
import android.graphics.Typeface;
import android.view.Gravity;
import android.view.ViewGroup;
import com.tencent.qcloud.uikit.R;
import com.tencent.qcloud.uikit.common.component.datepicker.listener.CustomListener;
import com.tencent.qcloud.uikit.common.component.datepicker.listener.OnOptionsSelectChangeListener;
import com.tencent.qcloud.uikit.common.component.datepicker.listener.OnOptionsSelectListener;
import com.tencent.qcloud.uikit.common.component.datepicker.listener.OnTimeSelectChangeListener;
import com.tencent.qcloud.uikit.common.component.datepicker.listener.OnTimeSelectListener;
import com.tencent.qcloud.uikit.common.component.datepicker.view.WheelView;
import java.util.Calendar;
public class PickerOptions {
//常量
private static final int PICKER_VIEW_BTN_COLOR_NORMAL = 0xFF057dff;
private static final int PICKER_VIEW_BG_COLOR_TITLE = 0xFFf5f5f5;
private static final int PICKER_VIEW_COLOR_TITLE = 0xFF000000;
private static final int PICKER_VIEW_BG_COLOR_DEFAULT = 0xFFFFFFFF;
public static final int TYPE_PICKER_OPTIONS = 1;
public static final int TYPE_PICKER_TIME = 2;
public OnOptionsSelectListener optionsSelectListener;
public OnTimeSelectListener timeSelectListener;
public OnTimeSelectChangeListener timeSelectChangeListener;
public OnOptionsSelectChangeListener optionsSelectChangeListener;
public CustomListener customListener;
//options picker
public String label1, label2, label3;//单位字符
public int option1, option2, option3;//默认选中项
public int x_offset_one, x_offset_two, x_offset_three;//x轴偏移量
public boolean cyclic1 = false;//是否循环,默认否
public boolean cyclic2 = false;
public boolean cyclic3 = false;
public boolean isRestoreItem = false; //切换时,还原第一项
//time picker
public boolean[] type = new boolean[]{true, true, true, false, false, false};//显示类型,默认显示: 年月日
public Calendar date;//当前选中时间
public Calendar startDate;//开始时间
public Calendar endDate;//终止时间
public int startYear;//开始年份
public int endYear;//结尾年份
public boolean cyclic = false;//是否循环
public boolean isLunarCalendar = false;//是否显示农历
public String label_year, label_month, label_day, label_hours, label_minutes, label_seconds;//单位
public int x_offset_year, x_offset_month, x_offset_day, x_offset_hours, x_offset_minutes, x_offset_seconds;//单位
public PickerOptions(int buildType) {
if (buildType == TYPE_PICKER_OPTIONS) {
layoutRes = R.layout.pickerview_options;
} else {
layoutRes = R.layout.pickerview_time;
}
}
//******* 公有字段 ******//
public int layoutRes;
public ViewGroup decorView;
public int textGravity = Gravity.CENTER;
public Context context;
public String textContentConfirm;//确定按钮文字
public String textContentCancel;//取消按钮文字
public String textContentTitle;//标题文字
public int textColorConfirm = PICKER_VIEW_BTN_COLOR_NORMAL;//确定按钮颜色
public int textColorCancel = PICKER_VIEW_BTN_COLOR_NORMAL;//取消按钮颜色
public int textColorTitle = PICKER_VIEW_COLOR_TITLE;//标题颜色
public int bgColorWheel = PICKER_VIEW_BG_COLOR_DEFAULT;//滚轮背景颜色
public int bgColorTitle = PICKER_VIEW_BG_COLOR_TITLE;//标题背景颜色
public int textSizeSubmitCancel = 17;//确定取消按钮大小
public int textSizeTitle = 18;//标题文字大小
public int textSizeContent = 18;//内容文字大小
public int textColorOut = 0xFFa8a8a8; //分割线以外的文字颜色
public int textColorCenter = 0xFF2a2a2a; //分割线之间的文字颜色
public int dividerColor = 0xFFd5d5d5; //分割线的颜色
public int backgroundId = -1; //显示时的外部背景色颜色,默认是灰色
public float lineSpacingMultiplier = 1.6f; // 条目间距倍数 默认1.6
public boolean isDialog;//是否是对话框模式
public boolean cancelable = true;//是否能取消
public boolean isCenterLabel = false;//是否只显示中间的label,默认每个item都显示
public Typeface font = Typeface.MONOSPACE;//字体样式
public WheelView.DividerType dividerType = WheelView.DividerType.FILL;//分隔线类型
}
| [
"3216071@163.com"
] | 3216071@163.com |
6e7eb169b5b8c3d6321a7364f4b5d1f7b7067389 | 992f46b5e47be95428ff673cfe63e23e2d895006 | /core-java/src/main/java/oop/composition/Book.java | ce84fe28d0be02745011658b9ba97fed4363fd44 | [] | no_license | berksoyyilmaz/tutorials | 5d237cb2342738a961a6e60516e15f1ed83b4796 | ab6e31d7a0663adbc36185760e5bd935cc1994c9 | refs/heads/main | 2023-03-16T13:19:02.725972 | 2023-02-05T15:50:22 | 2023-02-05T15:50:22 | 524,767,563 | 4 | 0 | null | null | null | null | UTF-8 | Java | false | false | 291 | java | package oop.composition;
class Book {
// Attributes of book
public String title;
public String author;
// Constructor of Book class
Book(String title, String author) {
// This keyword refers to current instance itself
this.title = title;
this.author = author;
}
} | [
"berksoy.yilmaz@etiya.com"
] | berksoy.yilmaz@etiya.com |
41f6730e132180e0daf28910035b1e32d1a86287 | b3d9e98f353eaba1cf92e3f1fc1ccd56e7cecbc5 | /xy-games/game-logic/trunk/src/main/java/com/cai/game/mj/henan/zhengzhou/MJHandlerGang_ZhengZhou.java | da26e6c7f54550633f0d76e0abc597ddd51bde26 | [] | no_license | konser/repository | 9e83dd89a8ec9de75d536992f97fb63c33a1a026 | f5fef053d2f60c7e27d22fee888f46095fb19408 | refs/heads/master | 2020-09-29T09:17:22.286107 | 2018-10-12T03:52:12 | 2018-10-12T03:52:12 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 15,802 | java | package com.cai.game.mj.henan.zhengzhou;
import java.util.concurrent.TimeUnit;
import com.cai.common.constant.GameConstants;
import com.cai.common.constant.MsgConstants;
import com.cai.common.domain.PlayerStatus;
import com.cai.common.domain.WeaveItem;
import com.cai.future.GameSchedule;
import com.cai.future.runnable.GameFinishRunnable;
import com.cai.game.mj.handler.MJHandlerGang;
import protobuf.clazz.Protocol.Int32ArrayResponse;
import protobuf.clazz.Protocol.RoomResponse;
import protobuf.clazz.Protocol.TableResponse;
import protobuf.clazz.Protocol.WeaveItemResponse;
import protobuf.clazz.Protocol.WeaveItemResponseArrayResponse;
public class MJHandlerGang_ZhengZhou extends MJHandlerGang<MJTable_ZhengZhou> {
@Override
public void exe(MJTable_ZhengZhou table) {
for (int i = 0; i < table.getTablePlayerNumber(); i++) {
if (table._playerStatus[i].has_action()) {
table.operate_player_action(i, true);
}
table._playerStatus[i].clean_action();
table.change_player_status(i, GameConstants.INVALID_VALUE);
}
table._playerStatus[_seat_index].chi_hu_round_valid();
table.operate_effect_action(_seat_index, GameConstants.EFFECT_ACTION_TYPE_ACTION, 1, new long[] { _action }, 1, GameConstants.INVALID_SEAT);
if ((GameConstants.GANG_TYPE_AN_GANG == _type) || (GameConstants.GANG_TYPE_JIE_GANG == _type)) {
exe_gang(table);
return;
}
boolean bAroseAction = false;
if (table.has_rule(GameConstants.GAME_RULE_HENAN_HENAN_PAO_HU)) {
bAroseAction = table.estimate_gang_respond_henan(_seat_index, _center_card);
}
if (bAroseAction == false) {
exe_gang(table);
} else {
PlayerStatus playerStatus = null;
for (int i = 0; i < table.getTablePlayerNumber(); i++) {
playerStatus = table._playerStatus[i];
if (playerStatus.has_chi_hu()) {
table.change_player_status(i, GameConstants.Player_Status_OPR_CARD);
table.operate_player_action(i, false);
}
}
}
}
@Override
public boolean handler_operate_card(MJTable_ZhengZhou table, int seat_index, int operate_code, int operate_card) {
PlayerStatus playerStatus = table._playerStatus[seat_index];
if (playerStatus.has_action() == false) {
table.log_player_error(seat_index, "出牌,玩家操作已失效");
return false;
}
if (playerStatus.is_respone()) {
table.log_player_error(seat_index, "出牌,玩家已操作");
return false;
}
if ((operate_code != GameConstants.WIK_NULL) && (operate_code != GameConstants.WIK_CHI_HU)) {
table.log_player_error(seat_index, "出牌操作,没有动作");
return false;
}
if ((operate_code != GameConstants.WIK_NULL) && (operate_card != _center_card)) {
table.log_player_error(seat_index, "出牌操作,操作牌对象出错");
return false;
}
playerStatus.operate(operate_code, operate_card);
if (operate_code == GameConstants.WIK_NULL) {
table.record_effect_action(seat_index, GameConstants.EFFECT_ACTION_TYPE_ACTION, 1, new long[] { GameConstants.WIK_NULL }, 1);
table.GRR._chi_hu_rights[seat_index].set_valid(false);
table._playerStatus[seat_index].chi_hu_round_invalid();
} else if (operate_code == GameConstants.WIK_CHI_HU) {
table.GRR._chi_hu_rights[seat_index].set_valid(true);
} else {
table.log_player_error(seat_index, "出牌操作,没有动作");
return false;
}
table.operate_player_action(seat_index, true);
// 变量定义 优先级最高操作的玩家和操作
int target_player = seat_index;
int target_action = operate_code;
int target_p = 0;
for (int p = 0; p < table.getTablePlayerNumber(); p++) {
int i = (_seat_index + p) % table.getTablePlayerNumber();
if (i == target_player) {
target_p = table.getTablePlayerNumber() - p;
}
}
for (int p = 0; p < table.getTablePlayerNumber(); p++) {
int i = (_seat_index + p) % table.getTablePlayerNumber();
int cbUserActionRank = 0;
int cbTargetActionRank = 0;
if (table._playerStatus[i].has_action()) {
if (table._playerStatus[i].is_respone()) {
cbUserActionRank = table._logic.get_action_rank(table._playerStatus[i].get_perform()) + table.getTablePlayerNumber() - p;
} else {
cbUserActionRank = table._logic.get_action_list_rank(table._playerStatus[i]._action_count, table._playerStatus[i]._action)
+ table.getTablePlayerNumber() - p;
}
if (table._playerStatus[target_player].is_respone()) {
cbTargetActionRank = table._logic.get_action_rank(table._playerStatus[target_player].get_perform()) + target_p;
} else {
cbTargetActionRank = table._logic.get_action_list_rank(table._playerStatus[target_player]._action_count,
table._playerStatus[target_player]._action) + target_p;
}
if (cbUserActionRank > cbTargetActionRank) {
target_player = i;
target_action = table._playerStatus[i].get_perform();
target_p = table.getTablePlayerNumber() - p;
}
}
}
if (table._playerStatus[target_player].is_respone() == false)
return true;
operate_card = _center_card;
if (target_action == GameConstants.WIK_NULL) {
for (int i = 0; i < table.getTablePlayerNumber(); i++) {
table.GRR._chi_hu_rights[i].set_valid(false);
}
exe_gang(table);
return true;
}
for (int i = 0; i < table.getTablePlayerNumber(); i++) {
if (i == target_player) {
table.GRR._chi_hu_rights[i].set_valid(true);
} else {
table.GRR._chi_hu_rights[i].set_valid(false);
}
}
table.process_chi_hu_player_operate(target_player, _center_card, false);
for (int i = 0; i < table.getTablePlayerNumber(); i++) {
table._playerStatus[i].clean_action();
table.change_player_status(i, GameConstants.INVALID_VALUE);
table.operate_player_action(i, true);
}
int jie_pao_count = 0;
for (int i = 0; i < table.getTablePlayerNumber(); i++) {
if ((table.GRR._chi_hu_rights[i].is_valid() == false)) {
continue;
}
jie_pao_count++;
}
if (jie_pao_count > 0) {
table._cur_banker = target_player;
table.GRR._chi_hu_card[target_player][0] = _center_card;
table.process_chi_hu_player_score_henan(target_player, _seat_index, _center_card, false);
table._player_result.jie_pao_count[target_player]++;
table._player_result.dian_pao_count[_seat_index]++;
GameSchedule.put(new GameFinishRunnable(table.getRoom_id(), table._cur_banker, GameConstants.Game_End_NORMAL),
GameConstants.GAME_FINISH_DELAY, TimeUnit.SECONDS);
}
return true;
}
@Override
protected boolean exe_gang(MJTable_ZhengZhou table) {
int cbCardIndex = table._logic.switch_to_card_index(_center_card);
int cbWeaveIndex = -1;
if (GameConstants.GANG_TYPE_AN_GANG == _type) {
cbWeaveIndex = table.GRR._weave_count[_seat_index];
table.GRR._weave_count[_seat_index]++;
} else if (GameConstants.GANG_TYPE_JIE_GANG == _type) {
cbWeaveIndex = table.GRR._weave_count[_seat_index];
table.GRR._weave_count[_seat_index]++;
table.operate_remove_discard(_provide_player, table.GRR._discard_count[_provide_player]);
} else if (GameConstants.GANG_TYPE_ADD_GANG == _type) {
for (int i = 0; i < table.GRR._weave_count[_seat_index]; i++) {
int cbWeaveKind = table.GRR._weave_items[_seat_index][i].weave_kind;
int cbCenterCard = table.GRR._weave_items[_seat_index][i].center_card;
if ((cbCenterCard == _center_card) && (cbWeaveKind == GameConstants.WIK_PENG)) {
cbWeaveIndex = i;
_provide_player = table.GRR._weave_items[_seat_index][i].provide_player;
break;
}
}
if (cbWeaveIndex == -1) {
table.log_player_error(_seat_index, "杠牌出错");
return false;
}
}
table.GRR._weave_items[_seat_index][cbWeaveIndex].public_card = _p == true ? 1 : 0;
table.GRR._weave_items[_seat_index][cbWeaveIndex].center_card = _center_card;
table.GRR._weave_items[_seat_index][cbWeaveIndex].weave_kind = _action;
table.GRR._weave_items[_seat_index][cbWeaveIndex].provide_player = _provide_player;
table._current_player = _seat_index;
table.GRR._cards_index[_seat_index][cbCardIndex] = 0;
table.GRR._card_count[_seat_index] = table._logic.get_card_count_by_index(table.GRR._cards_index[_seat_index]);
int cards[] = new int[GameConstants.MAX_COUNT];
int hand_card_count = table._logic.switch_to_cards_data(table.GRR._cards_index[_seat_index], cards);
for (int j = 0; j < hand_card_count; j++) {
if (table._logic.is_magic_card(cards[j])) {
cards[j] += GameConstants.CARD_ESPECIAL_TYPE_HUN;
}
}
WeaveItem weaves[] = new WeaveItem[GameConstants.MAX_WEAVE];
int weave_count = table.GRR._weave_count[_seat_index];
for (int i = 0; i < weave_count; i++) {
weaves[i] = new WeaveItem();
weaves[i].weave_kind = table.GRR._weave_items[_seat_index][i].weave_kind;
weaves[i].center_card = table.GRR._weave_items[_seat_index][i].center_card;
weaves[i].public_card = table.GRR._weave_items[_seat_index][i].public_card;
weaves[i].provide_player = table.GRR._weave_items[_seat_index][i].provide_player + GameConstants.WEAVE_SHOW_DIRECT;
}
table.operate_player_cards(_seat_index, hand_card_count, cards, weave_count, weaves);
table._playerStatus[_seat_index]._hu_card_count = table.get_henan_ting_card(table._playerStatus[_seat_index]._hu_cards,
table.GRR._cards_index[_seat_index], table.GRR._weave_items[_seat_index], table.GRR._weave_count[_seat_index]);
int ting_cards[] = table._playerStatus[_seat_index]._hu_cards;
int ting_count = table._playerStatus[_seat_index]._hu_card_count;
if (ting_count > 0) {
table.operate_chi_hu_cards(_seat_index, ting_count, ting_cards);
} else {
ting_cards[0] = 0;
table.operate_chi_hu_cards(_seat_index, 1, ting_cards);
}
boolean zhuang_gang = (table.GRR._banker_player == _seat_index ? true : false);
boolean zhuang_fang_gang = (table.GRR._banker_player == _provide_player ? true : false);
boolean jia_di = table.has_rule(GameConstants.GAME_RULE_HENAN_JIA_DI);
boolean gang_pao = table.has_rule(GameConstants.GAME_RULE_HENAN_GANG_PAO);
int cbGangIndex = table.GRR._gang_score[_seat_index].gang_count++;
if (GameConstants.GANG_TYPE_AN_GANG == _type) {
for (int i = 0; i < table.getTablePlayerNumber(); i++) {
if (i == _seat_index)
continue;
int score = GameConstants.CELL_SCORE;
if (jia_di) {
if (zhuang_gang) {
score += 1;
} else if (table.GRR._banker_player == i) {
score += 1;
}
}
if (gang_pao) {
score += table._player_result.pao[i] + table._player_result.pao[_seat_index];
}
table.GRR._gang_score[_seat_index].scores[cbGangIndex][i] = -score;
table.GRR._gang_score[_seat_index].scores[cbGangIndex][_seat_index] += score;
}
table._player_result.an_gang_count[_seat_index]++;
} else if (GameConstants.GANG_TYPE_JIE_GANG == _type) {
int score = GameConstants.CELL_SCORE;
if (jia_di) {
if (zhuang_gang) {
score += 1;
} else if (zhuang_fang_gang) {
score += 1;
}
}
if (gang_pao) {
score += table._player_result.pao[_provide_player] + table._player_result.pao[_seat_index];
}
table.GRR._gang_score[_seat_index].scores[cbGangIndex][_seat_index] = score;
table.GRR._gang_score[_seat_index].scores[cbGangIndex][_provide_player] = -score;
table._player_result.ming_gang_count[_seat_index]++;
} else if (GameConstants.GANG_TYPE_ADD_GANG == _type) {
int score = GameConstants.CELL_SCORE;
if (jia_di) {
if (zhuang_gang) {
score += 1;
} else if (zhuang_fang_gang) {
score += 1;
}
}
if (gang_pao) {
score += table._player_result.pao[_provide_player] + table._player_result.pao[_seat_index];
}
table.GRR._gang_score[_seat_index].scores[cbGangIndex][_seat_index] = score;
table.GRR._gang_score[_seat_index].scores[cbGangIndex][table.GRR._weave_items[_seat_index][cbWeaveIndex].provide_player] = -score;
table._player_result.ming_gang_count[_seat_index]++;
}
table.exe_dispatch_card_gang(_seat_index, _type, 0, _provide_player);
return true;
}
@Override
public boolean handler_player_be_in_room(MJTable_ZhengZhou table, int seat_index) {
RoomResponse.Builder roomResponse = RoomResponse.newBuilder();
roomResponse.setType(MsgConstants.RESPONSE_RECONNECT_DATA);
TableResponse.Builder tableResponse = TableResponse.newBuilder();
table.load_room_info_data(roomResponse);
table.load_player_info_data(roomResponse);
table.load_common_status(roomResponse);
tableResponse.setBankerPlayer(table.GRR._banker_player);
tableResponse.setCurrentPlayer(_seat_index);
tableResponse.setCellScore(0);
tableResponse.setActionCard(0);
tableResponse.setOutCardData(0);
tableResponse.setOutCardPlayer(0);
for (int i = 0; i < table.getTablePlayerNumber(); i++) {
tableResponse.addTrustee(false);
tableResponse.addDiscardCount(table.GRR._discard_count[i]);
Int32ArrayResponse.Builder int_array = Int32ArrayResponse.newBuilder();
for (int j = 0; j < 55; j++) {
if (table._logic.is_magic_card(table.GRR._discard_cards[i][j])) {
int_array.addItem(table.GRR._discard_cards[i][j] + GameConstants.CARD_ESPECIAL_TYPE_HUN);
} else {
int_array.addItem(table.GRR._discard_cards[i][j]);
}
}
tableResponse.addDiscardCards(int_array);
tableResponse.addWeaveCount(table.GRR._weave_count[i]);
WeaveItemResponseArrayResponse.Builder weaveItem_array = WeaveItemResponseArrayResponse.newBuilder();
for (int j = 0; j < GameConstants.MAX_WEAVE; j++) {
WeaveItemResponse.Builder weaveItem_item = WeaveItemResponse.newBuilder();
if (table._logic.is_magic_card(table.GRR._weave_items[i][j].center_card)) {
weaveItem_item.setCenterCard(table.GRR._weave_items[i][j].center_card + GameConstants.CARD_ESPECIAL_TYPE_HUN);
} else {
weaveItem_item.setCenterCard(table.GRR._weave_items[i][j].center_card);
}
weaveItem_item.setProvidePlayer(table.GRR._weave_items[i][j].provide_player + GameConstants.WEAVE_SHOW_DIRECT);
weaveItem_item.setPublicCard(table.GRR._weave_items[i][j].public_card);
weaveItem_item.setWeaveKind(table.GRR._weave_items[i][j].weave_kind);
weaveItem_array.addWeaveItem(weaveItem_item);
}
tableResponse.addWeaveItemArray(weaveItem_array);
tableResponse.addWinnerOrder(0);
tableResponse.addCardCount(table._logic.get_card_count_by_index(table.GRR._cards_index[i]));
}
tableResponse.setSendCardData(0);
int cards[] = new int[GameConstants.MAX_COUNT];
int hand_card_count = table._logic.switch_to_cards_data(table.GRR._cards_index[seat_index], cards);
for (int j = 0; j < hand_card_count; j++) {
if (table._logic.is_magic_card(cards[j])) {
cards[j] += GameConstants.CARD_ESPECIAL_TYPE_HUN;
}
}
for (int i = 0; i < GameConstants.MAX_COUNT; i++) {
tableResponse.addCardsData(cards[i]);
}
roomResponse.setTable(tableResponse);
table.send_response_to_player(seat_index, roomResponse);
table.operate_effect_action(_seat_index, GameConstants.EFFECT_ACTION_TYPE_ACTION, 1, new long[] { _action }, 1, seat_index);
if (table._playerStatus[seat_index].has_action() && table._playerStatus[seat_index].is_respone() == false) {
table.operate_player_action(seat_index, false);
}
int ting_cards[] = table._playerStatus[seat_index]._hu_cards;
int ting_count = table._playerStatus[seat_index]._hu_card_count;
if (ting_count > 0) {
table.operate_chi_hu_cards(seat_index, ting_count, ting_cards);
}
return true;
}
}
| [
"905202059@qq.com"
] | 905202059@qq.com |
eb1cf23c20b482c704a4f64f9742235b8c506855 | 9d4f40389879aba12180fa4be0cf34b36865cf47 | /build/app/generated/not_namespaced_r_class_sources/debug/r/androidx/legacy/coreui/R.java | f744f0130a4206f761cdc9b19d0f2daa1a9efea0 | [] | no_license | Hash-IQ/PetApp | d3ebaac99b184899feb7df417c7cbbf09da35bc2 | 37475fe6de1cbe62de955e340925bce38e60ccb2 | refs/heads/main | 2023-03-08T17:11:39.288806 | 2021-02-09T15:50:57 | 2021-02-09T15:50:57 | 332,448,636 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 12,452 | java | /* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* gradle plugin from the resource data it found. It
* should not be modified by hand.
*/
package androidx.legacy.coreui;
public final class R {
private R() {}
public static final class attr {
private attr() {}
public static final int alpha = 0x7f010002;
public static final int coordinatorLayoutStyle = 0x7f01000a;
public static final int font = 0x7f01000d;
public static final int fontProviderAuthority = 0x7f01000e;
public static final int fontProviderCerts = 0x7f01000f;
public static final int fontProviderFetchStrategy = 0x7f010010;
public static final int fontProviderFetchTimeout = 0x7f010011;
public static final int fontProviderPackage = 0x7f010012;
public static final int fontProviderQuery = 0x7f010013;
public static final int fontStyle = 0x7f010014;
public static final int fontVariationSettings = 0x7f010015;
public static final int fontWeight = 0x7f010016;
public static final int keylines = 0x7f01001c;
public static final int layout_anchor = 0x7f01001d;
public static final int layout_anchorGravity = 0x7f01001e;
public static final int layout_behavior = 0x7f01001f;
public static final int layout_dodgeInsetEdges = 0x7f010020;
public static final int layout_insetEdge = 0x7f010021;
public static final int layout_keyline = 0x7f010022;
public static final int statusBarBackground = 0x7f010033;
public static final int ttcIndex = 0x7f010036;
}
public static final class color {
private color() {}
public static final int notification_action_color_filter = 0x7f02000f;
public static final int notification_icon_bg_color = 0x7f020010;
}
public static final class dimen {
private dimen() {}
public static final int compat_button_inset_horizontal_material = 0x7f030000;
public static final int compat_button_inset_vertical_material = 0x7f030001;
public static final int compat_button_padding_horizontal_material = 0x7f030002;
public static final int compat_button_padding_vertical_material = 0x7f030003;
public static final int compat_control_corner_material = 0x7f030004;
public static final int compat_notification_large_icon_max_height = 0x7f030005;
public static final int compat_notification_large_icon_max_width = 0x7f030006;
public static final int notification_action_icon_size = 0x7f030009;
public static final int notification_action_text_size = 0x7f03000a;
public static final int notification_big_circle_margin = 0x7f03000b;
public static final int notification_content_margin_start = 0x7f03000c;
public static final int notification_large_icon_height = 0x7f03000d;
public static final int notification_large_icon_width = 0x7f03000e;
public static final int notification_main_column_padding_top = 0x7f03000f;
public static final int notification_media_narrow_margin = 0x7f030010;
public static final int notification_right_icon_size = 0x7f030011;
public static final int notification_right_side_padding_top = 0x7f030012;
public static final int notification_small_icon_background_padding = 0x7f030013;
public static final int notification_small_icon_size_as_large = 0x7f030014;
public static final int notification_subtext_size = 0x7f030015;
public static final int notification_top_pad = 0x7f030016;
public static final int notification_top_pad_large_text = 0x7f030017;
}
public static final class drawable {
private drawable() {}
public static final int notification_action_background = 0x7f040034;
public static final int notification_bg = 0x7f040035;
public static final int notification_bg_low = 0x7f040036;
public static final int notification_bg_low_normal = 0x7f040037;
public static final int notification_bg_low_pressed = 0x7f040038;
public static final int notification_bg_normal = 0x7f040039;
public static final int notification_bg_normal_pressed = 0x7f04003a;
public static final int notification_icon_background = 0x7f04003b;
public static final int notification_template_icon_bg = 0x7f04003c;
public static final int notification_template_icon_low_bg = 0x7f04003d;
public static final int notification_tile_bg = 0x7f04003e;
public static final int notify_panel_notification_icon_bg = 0x7f04003f;
}
public static final class id {
private id() {}
public static final int action_container = 0x7f050022;
public static final int action_divider = 0x7f050023;
public static final int action_image = 0x7f050024;
public static final int action_text = 0x7f050025;
public static final int actions = 0x7f050026;
public static final int async = 0x7f05002b;
public static final int blocking = 0x7f05002d;
public static final int bottom = 0x7f05002e;
public static final int chronometer = 0x7f050033;
public static final int end = 0x7f050038;
public static final int forever = 0x7f050056;
public static final int icon = 0x7f050057;
public static final int icon_group = 0x7f050058;
public static final int info = 0x7f05005a;
public static final int italic = 0x7f05005b;
public static final int left = 0x7f05005c;
public static final int line1 = 0x7f05005e;
public static final int line3 = 0x7f05005f;
public static final int none = 0x7f050062;
public static final int normal = 0x7f050063;
public static final int notification_background = 0x7f050064;
public static final int notification_main_column = 0x7f050065;
public static final int notification_main_column_container = 0x7f050066;
public static final int right = 0x7f050068;
public static final int right_icon = 0x7f050069;
public static final int right_side = 0x7f05006a;
public static final int start = 0x7f05006d;
public static final int tag_transition_group = 0x7f050075;
public static final int tag_unhandled_key_event_manager = 0x7f050076;
public static final int tag_unhandled_key_listeners = 0x7f050077;
public static final int text = 0x7f050078;
public static final int text2 = 0x7f050079;
public static final int time = 0x7f05007b;
public static final int title = 0x7f05007c;
public static final int top = 0x7f05007d;
}
public static final class integer {
private integer() {}
public static final int status_bar_notification_info_maxnum = 0x7f060002;
}
public static final class layout {
private layout() {}
public static final int notification_action = 0x7f070007;
public static final int notification_action_tombstone = 0x7f070008;
public static final int notification_template_custom_big = 0x7f07000f;
public static final int notification_template_icon_group = 0x7f070010;
public static final int notification_template_part_chronometer = 0x7f070014;
public static final int notification_template_part_time = 0x7f070015;
}
public static final class string {
private string() {}
public static final int status_bar_notification_info_overflow = 0x7f09003b;
}
public static final class style {
private style() {}
public static final int TextAppearance_Compat_Notification = 0x7f0a000a;
public static final int TextAppearance_Compat_Notification_Info = 0x7f0a000b;
public static final int TextAppearance_Compat_Notification_Line2 = 0x7f0a000d;
public static final int TextAppearance_Compat_Notification_Time = 0x7f0a0010;
public static final int TextAppearance_Compat_Notification_Title = 0x7f0a0012;
public static final int Widget_Compat_NotificationActionContainer = 0x7f0a0014;
public static final int Widget_Compat_NotificationActionText = 0x7f0a0015;
public static final int Widget_Support_CoordinatorLayout = 0x7f0a0016;
}
public static final class styleable {
private styleable() {}
public static final int[] ColorStateListItem = { 0x10101a5, 0x101031f, 0x7f010002 };
public static final int ColorStateListItem_android_color = 0;
public static final int ColorStateListItem_android_alpha = 1;
public static final int ColorStateListItem_alpha = 2;
public static final int[] CoordinatorLayout = { 0x7f01001c, 0x7f010033 };
public static final int CoordinatorLayout_keylines = 0;
public static final int CoordinatorLayout_statusBarBackground = 1;
public static final int[] CoordinatorLayout_Layout = { 0x10100b3, 0x7f01001d, 0x7f01001e, 0x7f01001f, 0x7f010020, 0x7f010021, 0x7f010022 };
public static final int CoordinatorLayout_Layout_android_layout_gravity = 0;
public static final int CoordinatorLayout_Layout_layout_anchor = 1;
public static final int CoordinatorLayout_Layout_layout_anchorGravity = 2;
public static final int CoordinatorLayout_Layout_layout_behavior = 3;
public static final int CoordinatorLayout_Layout_layout_dodgeInsetEdges = 4;
public static final int CoordinatorLayout_Layout_layout_insetEdge = 5;
public static final int CoordinatorLayout_Layout_layout_keyline = 6;
public static final int[] FontFamily = { 0x7f01000e, 0x7f01000f, 0x7f010010, 0x7f010011, 0x7f010012, 0x7f010013 };
public static final int FontFamily_fontProviderAuthority = 0;
public static final int FontFamily_fontProviderCerts = 1;
public static final int FontFamily_fontProviderFetchStrategy = 2;
public static final int FontFamily_fontProviderFetchTimeout = 3;
public static final int FontFamily_fontProviderPackage = 4;
public static final int FontFamily_fontProviderQuery = 5;
public static final int[] FontFamilyFont = { 0x1010532, 0x1010533, 0x101053f, 0x101056f, 0x1010570, 0x7f01000d, 0x7f010014, 0x7f010015, 0x7f010016, 0x7f010036 };
public static final int FontFamilyFont_android_font = 0;
public static final int FontFamilyFont_android_fontWeight = 1;
public static final int FontFamilyFont_android_fontStyle = 2;
public static final int FontFamilyFont_android_ttcIndex = 3;
public static final int FontFamilyFont_android_fontVariationSettings = 4;
public static final int FontFamilyFont_font = 5;
public static final int FontFamilyFont_fontStyle = 6;
public static final int FontFamilyFont_fontVariationSettings = 7;
public static final int FontFamilyFont_fontWeight = 8;
public static final int FontFamilyFont_ttcIndex = 9;
public static final int[] GradientColor = { 0x101019d, 0x101019e, 0x10101a1, 0x10101a2, 0x10101a3, 0x10101a4, 0x1010201, 0x101020b, 0x1010510, 0x1010511, 0x1010512, 0x1010513 };
public static final int GradientColor_android_startColor = 0;
public static final int GradientColor_android_endColor = 1;
public static final int GradientColor_android_type = 2;
public static final int GradientColor_android_centerX = 3;
public static final int GradientColor_android_centerY = 4;
public static final int GradientColor_android_gradientRadius = 5;
public static final int GradientColor_android_tileMode = 6;
public static final int GradientColor_android_centerColor = 7;
public static final int GradientColor_android_startX = 8;
public static final int GradientColor_android_startY = 9;
public static final int GradientColor_android_endX = 10;
public static final int GradientColor_android_endY = 11;
public static final int[] GradientColorItem = { 0x10101a5, 0x1010514 };
public static final int GradientColorItem_android_color = 0;
public static final int GradientColorItem_android_offset = 1;
}
}
| [
"hashiq7559@gmail.com"
] | hashiq7559@gmail.com |
e49f79de236cd5ad518052e12f33b96d2edb2fca | cc57a45b57ec4ee55c240b9e4ff64765718d75f4 | /Swea/src/P9999광고/Solution.java | 43f66a716b1b131c4817bda6e423dea7ecfc77d4 | [] | no_license | saintbeller96/Algorithm-Practice | d30bc35086561d5676c72c99ec557d9ab95de762 | ad7e6cb5e3c8d9840f55ab927cb13dde6ed706dc | refs/heads/master | 2023-07-09T14:30:54.909082 | 2021-08-16T14:52:35 | 2021-08-16T14:52:35 | 350,347,032 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 785 | java | package P9999광고;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class Solution {
private static int T, N;
private static long L;
private static int[] ad;
public static void main(String[] args) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer stk = null;
T = Integer.parseInt(br.readLine());
for (int t = 1; t <= T; t++) {
stk = new StringTokenizer(br.readLine());
L = Long.parseLong(stk.nextToken());
N = Integer.parseInt(stk.nextToken());
for(int i = 0; i<N; i++) {
stk = new StringTokenizer(br.readLine());
int s = Integer.parseInt(stk.nextToken());
int e = Integer.parseInt(stk.nextToken());
}
}
}
}
| [
"rlawhdtjd9@naver.com"
] | rlawhdtjd9@naver.com |
10531d7764af9653d43c01cbdfc09b94eba01760 | f6d0787b6794373ae8bbf0f8b5e5765717170309 | /Unidad_5/5.2/app/src/main/java/mx/edu/ittepic/u5_acelerometro/MainActivity.java | 57c1aafa6eb67963509832b38c6bc207bf6bf643 | [] | no_license | nathanaepalomera/moviles_repositorio | e98d0e27c4f52936495659e1dd6439874f68efed | 680fe594747d28191fb58c2c35e886c15e1f5b61 | refs/heads/master | 2020-05-31T13:39:09.565855 | 2019-06-05T03:07:50 | 2019-06-05T03:07:50 | 190,310,746 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,547 | java | package mx.edu.ittepic.u5_acelerometro;
import android.hardware.Sensor;
import android.hardware.SensorEvent;
import android.hardware.SensorEventListener;
import android.hardware.SensorManager;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.TextView;
public class MainActivity extends AppCompatActivity implements SensorEventListener {
TextView ejex;
private Sensor mysensor;
private SensorManager senman;
public MainActivity() {
super();
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
senman = (SensorManager) getSystemService(SENSOR_SERVICE);
mysensor=senman.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);
ejex = findViewById(R.id.ejex);
}
@Override
public void onSensorChanged(SensorEvent event) {
float x,y,z;
x = event.values[0];
y= event.values[1];
z = event.values[2];
ejex.setText(" ");
ejex.append("\n"+"VALOR DE x: "+ x +"\n"+ "VALOR DE Y: "+ y +"\n"+"VALOR DE Z: "+ z);
}
@Override
public void onAccuracyChanged(Sensor sensor, int accuracy) {
}
@Override
protected void onResume (){
super.onResume();
senman.registerListener(this,mysensor, SensorManager.SENSOR_DELAY_NORMAL );
}
@Override
protected void onPause (){
super.onPause();
senman.unregisterListener(this);
}
}
| [
"jonapalomeraro@ittepic.edu.mx"
] | jonapalomeraro@ittepic.edu.mx |
590e51f9377bc8391d0c99d0f759fd75583a96e8 | 3334bee9484db954c4508ad507f6de0d154a939f | /d3n/java-src/tombola-service-api/src/main/java/de/ascendro/f4m/service/tombola/TombolaMessageTypes.java | 251ab54cf4bbc26e4399ffd5eac47de1eac74b9e | [] | no_license | VUAN86/d3n | c2fc46fc1f188d08fa6862e33cac56762e006f71 | e5d6ac654821f89b7f4f653e2aaef3de7c621f8b | refs/heads/master | 2020-05-07T19:25:43.926090 | 2019-04-12T07:25:55 | 2019-04-12T07:25:55 | 180,806,736 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,073 | java | package de.ascendro.f4m.service.tombola;
import de.ascendro.f4m.service.json.model.type.MessageType;
public enum TombolaMessageTypes implements MessageType {
TOMBOLA_GET, TOMBOLA_GET_RESPONSE,
TOMBOLA_LIST, TOMBOLA_LIST_RESPONSE,
TOMBOLA_BUY, TOMBOLA_BUY_RESPONSE,
TOMBOLA_DRAWING_GET, TOMBOLA_DRAWING_GET_RESPONSE,
TOMBOLA_DRAWING_LIST, TOMBOLA_DRAWING_LIST_RESPONSE,
USER_TOMBOLA_LIST, USER_TOMBOLA_LIST_RESPONSE,
USER_TOMBOLA_GET, USER_TOMBOLA_GET_RESPONSE,
TOMBOLA_WINNER_LIST, TOMBOLA_WINNER_LIST_RESPONSE,
MOVE_TOMBOLAS, MOVE_TOMBOLAS_RESPONSE,
TOMBOLA_BUYER_LIST, TOMBOLA_BUYER_LIST_RESPONSE,
TOMBOLA_OPEN_CHECKOUT, TOMBOLA_OPEN_CHECKOUT_RESPONSE,
TOMBOLA_CLOSE_CHECKOUT, TOMBOLA_CLOSE_CHECKOUT_RESPONSE,
TOMBOLA_DRAW, TOMBOLA_DRAW_RESPONSE;
public static final String SERVICE_NAME = "tombola";
@Override
public String getShortName() {
return convertEnumNameToMessageShortName(name());
}
@Override
public String getNamespace() {
return SERVICE_NAME;
}
}
| [
"vuan86@ya.ru"
] | vuan86@ya.ru |
3bb1b080b3fed1cb78013f0e5e342d10c319068a | 83d802faadccecb716e51039d71a144f49db74ae | /app/src/main/java/com/sabaysongs/music/App.java | 2f80e5a171c20e305cb96d6c4504cfcb8edfc376 | [] | no_license | phuongphally/music-client | 76687206190430e5b105144bf5e56397c784dad2 | e7d8f6811554ee6e5b77fe0c1214a4292cd40da6 | refs/heads/master | 2021-01-22T08:58:56.455701 | 2017-02-27T16:01:16 | 2017-02-27T16:01:16 | 81,924,562 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 968 | java | package com.sabaysongs.music;
import android.app.Application;
import com.sabaysongs.music.model.FavoriteSongs;
import com.sabaysongs.music.model.PlayList;
import com.bumptech.glide.Glide;
import static nl.qbusict.cupboard.CupboardFactory.cupboard;
/**
* Created by phuon on 17-Jan-17.
*/
public class App extends Application {
static {
cupboard().register(FavoriteSongs.class);
cupboard().register(PlayList.class);
}
private static App sInstance;
public App() {
sInstance = this;
}
public static synchronized App getInstance() {
return sInstance;
}
@Override
public void onCreate() {
super.onCreate();
}
@Override
public void onLowMemory() {
super.onLowMemory();
Glide.get(this).clearMemory();
}
@Override
public void onTrimMemory(int level) {
super.onTrimMemory(level);
Glide.get(this).trimMemory(level);
}
}
| [
"phuongphally@gmail.com"
] | phuongphally@gmail.com |
c0bb7ba4a3b5078a5a7d994dd37cd932ab72d123 | 73017c737d59acdb62b0dbf6e177ddf38518cf9b | /common/src/main/java/io/github/aquerr/eaglefactions/common/commands/DisbandCommand.java | ddf4ec5f494d153453d613601f352ec82ddb2625 | [
"MIT"
] | permissive | michalzielinski913/EagleFactions | 88ce90bef37f9d3a951fe645ba73a1547a59c845 | a5c2ac3aa71f7bc39a710b7f7b25247cef3a0a68 | refs/heads/master | 2022-04-12T06:38:25.743986 | 2020-03-08T13:28:05 | 2020-03-08T13:28:05 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,019 | java | package io.github.aquerr.eaglefactions.common.commands;
import io.github.aquerr.eaglefactions.api.EagleFactions;
import io.github.aquerr.eaglefactions.api.entities.Faction;
import io.github.aquerr.eaglefactions.common.EagleFactionsPlugin;
import io.github.aquerr.eaglefactions.common.PluginInfo;
import io.github.aquerr.eaglefactions.common.messaging.MessageLoader;
import io.github.aquerr.eaglefactions.common.messaging.Messages;
import io.github.aquerr.eaglefactions.common.messaging.Placeholders;
import org.spongepowered.api.command.CommandException;
import org.spongepowered.api.command.CommandResult;
import org.spongepowered.api.command.CommandSource;
import org.spongepowered.api.command.args.CommandContext;
import org.spongepowered.api.entity.living.player.Player;
import org.spongepowered.api.text.Text;
import org.spongepowered.api.text.format.TextColors;
import java.util.Collections;
import java.util.Optional;
public class DisbandCommand extends AbstractCommand
{
public DisbandCommand(EagleFactions plugin)
{
super(plugin);
}
@Override
public CommandResult execute(CommandSource source, CommandContext context) throws CommandException
{
if(!(source instanceof Player))
throw new CommandException(Text.of(PluginInfo.ERROR_PREFIX, TextColors.RED, Messages.ONLY_IN_GAME_PLAYERS_CAN_USE_THIS_COMMAND));
final Player player = (Player) source;
// There's a bit of code duplicating, but...
Optional<String> optionalFactionName = context.<String>getOne("faction name");
if (optionalFactionName.isPresent()) {
if (!EagleFactionsPlugin.ADMIN_MODE_PLAYERS.contains(player.getUniqueId()))
throw new CommandException(Text.of(PluginInfo.ERROR_PREFIX, TextColors.RED, Messages.YOU_NEED_TO_TOGGLE_FACTION_ADMIN_MODE_TO_DO_THIS));
Faction faction = super.getPlugin().getFactionLogic().getFactionByName(optionalFactionName.get());
if (faction == null)
throw new CommandException(Text.of(PluginInfo.ERROR_PREFIX, TextColors.RED, MessageLoader.parseMessage(Messages.THERE_IS_NO_FACTION_CALLED_FACTION_NAME, Collections.singletonMap(Placeholders.FACTION_NAME, Text.of(TextColors.GOLD, optionalFactionName.get())))));
boolean didSecceed = super.getPlugin().getFactionLogic().disbandFaction(faction.getName());
if (didSecceed) {
player.sendMessage(Text.of(PluginInfo.PLUGIN_PREFIX, TextColors.GREEN, Messages.FACTION_HAS_BEEN_DISBANDED));
} else {
player.sendMessage(Text.of(PluginInfo.PLUGIN_PREFIX, TextColors.RED, Messages.SOMETHING_WENT_WRONG));
}
return CommandResult.success();
}
Optional<Faction> optionalPlayerFaction = super.getPlugin().getFactionLogic().getFactionByPlayerUUID(player.getUniqueId());
if(!optionalPlayerFaction.isPresent())
throw new CommandException(Text.of(PluginInfo.ERROR_PREFIX, TextColors.RED, Messages.YOU_MUST_BE_IN_FACTION_IN_ORDER_TO_USE_THIS_COMMAND));
Faction playerFaction = optionalPlayerFaction.get();
if(playerFaction.getName().equalsIgnoreCase("SafeZone") || playerFaction.getName().equalsIgnoreCase("WarZone"))
throw new CommandException(Text.of(PluginInfo.ERROR_PREFIX, TextColors.RED, "This faction cannot be disbanded!"));
//If player has adminmode
if(EagleFactionsPlugin.ADMIN_MODE_PLAYERS.contains(player.getUniqueId()))
{
boolean didSucceed = super.getPlugin().getFactionLogic().disbandFaction(playerFaction.getName());
if(didSucceed)
{
player.sendMessage(Text.of(PluginInfo.PLUGIN_PREFIX, TextColors.GREEN, Messages.FACTION_HAS_BEEN_DISBANDED));
EagleFactionsPlugin.AUTO_CLAIM_LIST.remove(player.getUniqueId());
EagleFactionsPlugin.CHAT_LIST.remove(player.getUniqueId());
}
else
{
player.sendMessage(Text.of(PluginInfo.PLUGIN_PREFIX, TextColors.RED, Messages.SOMETHING_WENT_WRONG));
}
return CommandResult.success();
}
//If player is leader
if(!playerFaction.getLeader().equals(player.getUniqueId()))
throw new CommandException(Text.of(PluginInfo.ERROR_PREFIX, Messages.YOU_MUST_BE_THE_FACTIONS_LEADER_TO_DO_THIS));
boolean didSucceed = super.getPlugin().getFactionLogic().disbandFaction(playerFaction.getName());
if(didSucceed)
{
player.sendMessage(Text.of(PluginInfo.PLUGIN_PREFIX, TextColors.GREEN, Messages.FACTION_HAS_BEEN_DISBANDED));
EagleFactionsPlugin.AUTO_CLAIM_LIST.remove(player.getUniqueId());
EagleFactionsPlugin.CHAT_LIST.remove(player.getUniqueId());
}
else
{
player.sendMessage(Text.of(PluginInfo.PLUGIN_PREFIX, TextColors.RED, Messages.SOMETHING_WENT_WRONG));
}
return CommandResult.success();
}
}
| [
"nerdianin@gmail.com"
] | nerdianin@gmail.com |
c19f228f2046fd81228e14c6755edb01a8e0db83 | 4be43f5bdd7da067e2277a92ae7a8487073cd5f5 | /src/com/amaze/graphs/SL.java | 8a45c50380093bfdb9c2b1437d791cc0e21714c8 | [] | no_license | vidhya2121/data-structure | eec8edc36f6780050bd8849574c39c1536a69371 | 581af0e64bcf9bc6d0827ef1ab4ccea289d93356 | refs/heads/master | 2023-04-04T23:32:33.117849 | 2021-04-11T03:27:27 | 2021-04-11T03:27:27 | 277,040,259 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,290 | java | package com.amaze.graphs;
import java.util.LinkedList;
import java.util.Queue;
import java.util.Scanner;
public class SL {
/*
* Given a snake and ladder board of order 5x6, find the minimum number of dice throws required
* to reach the destination or last cell (30th cell) from source (1st cell) .
*/
/*
* Input:
2
6
11 26 3 22 5 8 20 29 27 1 21 9
1
2 30
Output:
3
1
Explanation:
Testcase 1:
For 1st throw get a 2, which contains ladder to reach 22
For 2nd throw get a 6, which will lead to 28
Finally get a 2, to reach at the end 30. Thus 3 dice throws required to reach 30.
*/
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
while (t-- > 0) {
int n = sc.nextInt();
int mat[] = new int[30+1];
for (int i = 1; i <= 30; i++) {
mat[i] = -1;
}
for (int i = 0; i < n; i++) {
int src = sc.nextInt();
mat[src] = sc.nextInt();
}
System.out.println(snakeLadder(mat, 30));
}
}
/*
* visited boolean array Queue of SNode(vertex,dist)
* add 1,0 to q
* loop till q is empty
* curr = poll from q
* if current vertex in n break
* v = curr vertex
* loop j = v + 1 j < v+6 and j<=n
* if j not visited
* create a new SNode and set its dist as curr.dist+1
* if mat[j] != -1 then set new node's vertex to mat[j]
* else set to j only
* add node to q
* return curr.dist
*/
private static int snakeLadder(int[] mat, int n) {
// mat [0, -1, -1, 22, -1, 8, -1, -1, -1, -1, -1, 26, -1, -1, -1, -1, -1, -1, -1, -1, 29, 9, -1, -1, -1, -1, -1, 1, -1, -1, -1]
boolean visited[] = new boolean[n+1];
Queue<SNode> q = new LinkedList<>();
q.add(new SNode(1, 0));
visited[0] = true;
SNode curr = null;
while (!q.isEmpty()) {
curr = q.poll();
if (curr.vertex == n) {
break;
}
int v = curr.vertex;
for (int j = v + 1; j <= v + 6 && j <= n; j++) {
if (!visited[j]) {
SNode s = new SNode();
s.dist = curr.dist + 1;
if (mat[j] != -1) {
s.vertex = mat[j];
} else {
s.vertex = j;
}
q.add(s);
}
}
}
return curr.dist;
}
}
class SNode {
int vertex;
int dist;
SNode(int vertex, int dist) {
this.vertex = vertex;
this.dist = dist;
}
public SNode() {
}
}
| [
"vidhyato21@gmail.com"
] | vidhyato21@gmail.com |
405a5b5a968fc44089f08be0b83661935efb7790 | 157d3f99a43fcedabc59992895eb9373bef87ed2 | /TopCoder/src/com/topcoder/problems/round156/PathFinding.java | a9f56ad31f0a835213ffd248421ec580aa90dd87 | [] | no_license | KaustubhMani/TopCoder | 7fd189c54a887939b575110409043e749fe84d12 | a96715777000d0ff618de72223d59115bf2493fe | refs/heads/master | 2021-01-20T04:51:07.046815 | 2017-04-02T01:34:13 | 2017-04-02T01:34:13 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,055 | java | package com.topcoder.problems.round156;
//http://community.topcoder.com/stat?c=problem_statement&pm=1110&rd=4585
public class PathFinding
{
char[][] grid = new char[24][24];
int nr, nc;
int dist[][] = new int[24*24][24*24];
int queue[]= new int[24*24*24*24];
int qptr = 0, qtail = 0;
int dr[] = {0,-1,-1,-1,0,0,1,1,1};
int dc[] = {0,-1,0,1,-1,1,-1,0,1};
static class Position
{
int ar;
int ac;
int br;
int bc;
int stepCount;
Position(int ar,
int ac,
int br,
int bc,
int stepCount)
{
this.ar = ar;
this.ac = ac;
this.br = br;
this.bc = bc;
this.stepCount = stepCount;
}
}
public int minTurns(String[] bd)
{
int rowLength = bd.length;
int colLength = bd[0].length();
boolean[][][][] visited= new boolean[20][20][20][20];
int startARow = 0;
int startACol = 0;
int startBRow = 0;
int startBCol = 0;
int ar = 0;
int ac = 0;
int br = 0;
int bc = 0;
char[][] matrix = new char[rowLength][colLength];
int best = Integer.MAX_VALUE;
for(int i = 0 ; i < bd.length ; i++)
{
for(int j = 0 ; j < bd[i].length() ; j++)
{
if (bd[i].charAt(j) == 'A')
{
ar = i;
startARow = ar;
ac = j;
startACol = ac;
}
else if (bd[i].charAt(j) == 'B')
{
br = i;
startBRow = br;
bc = j;
startBCol = bc;
}
else if (bd[i].charAt(j) == 'X')
{
matrix[i][j] = 'X';
}
else if (bd[i].charAt(j) == '.')
{
matrix[i][j] = '.';
}
}
}
Position[] queue = new Position[24*24*24*24];
int qstart = 0;
int qend = 0;
queue[qend++] = new Position(ar, ac, br, bc, 1);
visited[ar][ac][br][bc] = true;
while(qstart != qend)
{
Position pos = queue[qstart++];
ar = pos.ar;
ac = pos.ac;
br = pos.br;
bc = pos.bc;
int stepCount = pos.stepCount;
for(int aRow = -1 ; aRow <=1 ; aRow++)
{
int arr = ar + aRow;
if ( !(arr >= 0 && arr < rowLength))
{
continue;
}
for(int aCol = -1 ; aCol <= 1 ; aCol ++)
{
int acc = ac + aCol;
if ( !(acc >= 0 && acc < colLength))
{
continue;
}
if (matrix[arr][acc] == 'X')
continue;
for(int bRow = -1 ; bRow <=1 ; bRow ++)
{
int brr = br + bRow;
if ( !(brr >= 0 && brr < rowLength))
{
continue;
}
for(int bCol = -1 ; bCol <=1 ; bCol ++)
{
int bcc = bc + bCol;
if ( !(bcc >= 0 && bcc < colLength))
{
continue;
}
if (matrix[brr][bcc] == 'X')
continue;
// check for path cross
if (ar == brr &&
ac == bcc &&
br == arr &&
bc == acc)
{
continue;
}
// check if already visited
if (visited[arr][acc][brr][bcc])
continue;
// check for overlap
if (arr == brr
&& acc == bcc)
{
continue;
}
if (arr == startBRow
&& acc == startBCol
&& brr == startARow
&& bcc == startACol)
{
if (stepCount < best)
{
best = stepCount;
}
}
queue[qend++] = new Position(arr,
acc,
brr,
bcc,
stepCount+1);
visited[arr][acc][brr][bcc] = true;
}
}
}
}
}
return best == Integer.MAX_VALUE ? -1 : best;
}
public int minTurns1(String[] bd)
{
int sa = 0, sb = 0;
for (int r = 0; r < 24; r++) for (int c = 0; c < 24; c++) grid[r][c] = 'X';
nr = bd.length; nc = bd[0].length();
for (int r = 0; r < nr; r++)
for (int c = 0; c < nc; c++) {
grid[r+1][c+1] = bd[r].charAt(c);
if (grid[r+1][c+1] == 'A') {
sa = 24 * (r+1) + (c+1);
grid[r+1][c+1] = '.';
} else if (grid[r+1][c+1] == 'B') {
sb = 24 * (r+1) + (c+1);
grid[r+1][c+1] = '.';
}
}
for (int i = 0; i < 24*24; i++) for (int j = 0; j < 24*24; j++) dist[i][j] = -1;
dist[sa][sb] = 0;
queue[qptr++] = sa * 24 * 24 + sb;
while (qptr != qtail) {
int cur = queue[qtail++];
int a = cur / (24 * 24);
int b = cur % (24 * 24);
int ar = a / 24, ac = a % 24;
int br = b / 24, bc = b % 24;
// System.out.println(dist[a][b] + ": " + ar + "," + ac + " " + br + "," + bc);
for (int i = 0; i < 9; i++) {
int arr = ar + dr[i], acc = ac + dc[i];
if (grid[arr][acc] == 'X') continue;
for (int j = 0; j < 9; j++) {
int brr = br + dr[j], bcc = bc + dc[j];
if (grid[brr][bcc] == 'X') continue;
// System.out.println(" * " + arr + "," + acc + " " + brr + "," + bcc);
// check for collision
if (arr == brr && acc == bcc) continue;
// check for swap positions
if (ar == brr && ac == bcc && br == arr && bc == acc) continue;
// check for duplicate position
int aa = arr * 24 + acc;
int bb = brr * 24 + bcc;
if (dist[aa][bb] >= 0) continue;
// new position
dist[aa][bb] = dist[a][b] + 1;
queue[qptr++] = aa * 24 * 24 + bb;
}
}
}
return dist[sb][sa];
}
public static void main(String[] args)
{
int result = new PathFinding().minTurns(new String[]{"AB.................X",
"XXXXXXXXXXXXXXXXXXX.",
"X..................X",
".XXXXXXXXXXXXXXXXXXX",
"X..................X",
"XXXXXXXXXXXXXXXXXXX.",
"X..................X",
".XXXXXXXXXXXXXXXXXXX",
"X..................X",
"XXXXXXXXXXXXXXXXXXX.",
"X..................X",
".XXXXXXXXXXXXXXXXXXX",
"X..................X",
"XXXXXXXXXXXXXXXXXXX.",
"X..................X",
".XXXXXXXXXXXXXXXXXXX",
"X..................X",
"XXXXXXXXXXXXXXXXXXX.",
"...................X",
".XXXXXXXXXXXXXXXXXXX"}
);
System.out.println(result);
}
} | [
"suman_krec@yahoo.com"
] | suman_krec@yahoo.com |
9d81377d6e41c1295f768755e2f694302ebe1a66 | a0cf8ed1e6f806bc9c6d969f3ab2947a0ddbdfce | /MSG/.svn/pristine/2f/2fa39e51104f132f544f8f51a1c33be70e2ec1b4.svn-base | 742cba6a3f6afd908b17326302d2406915c7a47c | [] | no_license | misunyu/Mujava-Clustering | 35aa8480de81e6c2351ba860fc59c090b007d096 | 026192effef89f428dc279d76e2d8188bee86a96 | refs/heads/master | 2020-03-11T12:15:49.074291 | 2018-05-08T00:12:53 | 2018-05-08T00:12:53 | 129,992,561 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,856 | package MSG.traditional;
import MSG.MSGConstraints;
import MSG.MutantMonitor;
public class AOISMetaMutant {
public static double AOIS(double originalAfter) {
int op = MutantMonitor.subID;
double mutantValue = 0;
if (op == MSGConstraints.U_PRE_INCREMENT)
mutantValue = originalAfter;
else if (op == MSGConstraints.U_PRE_DECREMENT)
mutantValue = originalAfter;
else if (op == MSGConstraints.U_POST_INCREMENT)
mutantValue = originalAfter - 1;
else if (op == MSGConstraints.U_POST_DECREMENT)
mutantValue = originalAfter + 1;
return mutantValue;
}
public static float AOIS(float originalAfter) {
int op = MutantMonitor.subID;
float mutantValue = 0;
if (op == MSGConstraints.U_PRE_INCREMENT)
mutantValue = originalAfter;
else if (op == MSGConstraints.U_PRE_DECREMENT)
mutantValue = originalAfter;
else if (op == MSGConstraints.U_POST_INCREMENT)
mutantValue = originalAfter - 1;
else if (op == MSGConstraints.U_POST_DECREMENT)
mutantValue = originalAfter + 1;
return mutantValue;
}
public static int AOIS(int originalAfter) {
int op = MutantMonitor.subID;
int mutantValue = 0;
if (op == MSGConstraints.U_PRE_INCREMENT)
mutantValue = originalAfter;
else if (op == MSGConstraints.U_PRE_DECREMENT)
mutantValue = originalAfter;
else if (op == MSGConstraints.U_POST_INCREMENT)
mutantValue = originalAfter - 1;
else if (op == MSGConstraints.U_POST_DECREMENT)
mutantValue = originalAfter + 1;
return mutantValue;
}
public static long AOIS(long originalAfter) {
int op = MutantMonitor.subID;
long mutantValue = 0;
if (op == MSGConstraints.U_PRE_INCREMENT)
mutantValue = originalAfter;
else if (op == MSGConstraints.U_PRE_DECREMENT)
mutantValue = originalAfter;
else if (op == MSGConstraints.U_POST_INCREMENT)
mutantValue = originalAfter - 1;
else if (op == MSGConstraints.U_POST_DECREMENT)
mutantValue = originalAfter + 1;
return mutantValue;
}
public static double AOISValue(double original) {
int op = MutantMonitor.subID;
double returnValue = original;
if (MSGConstraints.U_PRE_INCREMENT == op) {
returnValue = original + 1;
} else if (MSGConstraints.U_PRE_DECREMENT == op) {
returnValue = original - 1;
} else if (MSGConstraints.U_POST_INCREMENT == op) {
returnValue = original + 1;
} else if (MSGConstraints.U_POST_DECREMENT == op) {
returnValue = original - 1;
}
return returnValue;
}
public static float AOISValue(float original) {
int op = MutantMonitor.subID;
float returnValue = original;
if (MSGConstraints.U_PRE_INCREMENT == op) {
returnValue = original + 1;
} else if (MSGConstraints.U_PRE_DECREMENT == op) {
returnValue = original - 1;
} else if (MSGConstraints.U_POST_INCREMENT == op) {
returnValue = original + 1;
} else if (MSGConstraints.U_POST_DECREMENT == op) {
returnValue = original - 1;
}
return returnValue;
}
public static int AOISValue(int original) {
int op = MutantMonitor.subID;
int returnValue = original;
if (MSGConstraints.U_PRE_INCREMENT == op) {
returnValue = original + 1;
} else if (MSGConstraints.U_PRE_DECREMENT == op) {
returnValue = original - 1;
} else if (MSGConstraints.U_POST_INCREMENT == op) {
returnValue = original + 1;
} else if (MSGConstraints.U_POST_DECREMENT == op) {
returnValue = original - 1;
}
return returnValue;
}
public static long AOISValue(long original) {
int op = MutantMonitor.subID;
long returnValue = original;
if (MSGConstraints.U_PRE_INCREMENT == op) {
returnValue = original + 1;
} else if (MSGConstraints.U_PRE_DECREMENT == op) {
returnValue = original - 1;
} else if (MSGConstraints.U_POST_INCREMENT == op) {
returnValue = original + 1;
} else if (MSGConstraints.U_POST_DECREMENT == op) {
returnValue = original - 1;
}
return returnValue;
}
}
| [
"misunyu@gmail.com"
] | misunyu@gmail.com | |
6c2be12b9c3efb23d210d2d521d0c0ee792cbcdf | 8b49a2a046fa59952290913407e100b2548312b0 | /src/prueba/Grupo.java | df18493b2b8f846fa7c1fe5e342edff7ddc6deba | [] | no_license | sbritocorral/dbMigration | 2a01c2a055e737d3b6695cd25f98c2dfffc44a9a | 8e42aa57833e134ded4b57c665b6b5cc91543125 | refs/heads/master | 2021-06-12T14:35:42.658114 | 2017-03-20T15:21:11 | 2017-03-20T15:21:11 | 85,494,124 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,495 | java | package prueba;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.sql.Statement;
public class Grupo implements Queryable{
private String tabla = "grupos";
private String codigo;
private String descripcion;
public String getCodigo() {
return codigo;
}
public void setCodigo(String codigo) {
this.codigo = codigo;
}
public String getDescripcion() {
return descripcion;
}
public void setDescripcion(String descripcion) {
this.descripcion = descripcion;
}
public String getTabla() {
return tabla;
}
public void setTabla(String tabla) {
this.tabla = tabla;
}
@Override
public String toString() {
return "Grupo [codigo=" + codigo + ", descripcion=" + descripcion + "]";
}
@Override
public Object toQuery(String dbType, Connection con) {
String query = null;
query = "INSERT INTO grupos (codigo, descripcion) values (?,?)";
try {
PreparedStatement statement = con.prepareStatement(query);
statement.setString(1, this.codigo);
statement.setString(2, this.descripcion);
return statement;
} catch (SQLException e) {
e.printStackTrace();
}
return query;
}
@Override
public Object beforeInsert(String dbType, Connection con) {
PreparedStatement stmt = null;
try {
String sql = "DELETE from grupos ;";
stmt = con.prepareStatement(sql);
} catch (SQLException e1) {
e1.printStackTrace();
}
return stmt;
}
}
| [
"s.britocorral@gmail.com"
] | s.britocorral@gmail.com |
63648d880885dfb739ee4fc79234cae26671306b | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/1/1_06f5f0c8eca2984a3dd78428d9045ca16ec77460/HttpPollingFunctionalTestCase/1_06f5f0c8eca2984a3dd78428d9045ca16ec77460_HttpPollingFunctionalTestCase_t.java | 6885fbdf0754640faea6b2197684497abc782787 | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 2,277 | java | package com.muleinaction;
import org.mule.api.service.Service;
import org.mule.api.context.notification.EndpointMessageNotificationListener;
import org.mule.api.context.notification.ServerNotification;
import org.mule.tck.FunctionalTestCase;
import org.mule.context.notification.EndpointMessageNotification;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.filefilter.WildcardFileFilter;
import java.io.File;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
/**
* @author John D'Emic (john.demic@gmail.com)
*/
public class HttpPollingFunctionalTestCase extends FunctionalTestCase {
private static String DEST_DIRECTORY = "./data/polling";
private CountDownLatch latch = new CountDownLatch(1);
protected void doSetUp() throws Exception {
super.doSetUp();
for (Object o : FileUtils.listFiles(new File(DEST_DIRECTORY), new String[]{"html"}, false)) {
File file = (File) o;
file.delete();
}
muleContext.registerListener(new EndpointMessageNotificationListener() {
public void onNotification(final ServerNotification notification) {
if ("httpPollingService".equals(notification.getResourceIdentifier())) {
final EndpointMessageNotification messageNotification = (EndpointMessageNotification) notification;
if (messageNotification.getEndpoint().getName().equals("endpoint.file.data.polling")) {
latch.countDown();
}
}
}
});
}
@Override
protected String getConfigResources() {
return "conf/http-polling-config.xml";
}
public void testCorrectlyInitialized() throws Exception {
final Service service = muleContext.getRegistry().lookupService(
"httpPollingService");
assertNotNull(service);
assertEquals("httpPollingModel", service.getModel().getName());
assertTrue("Message did not reach directory on time", latch.await(15, TimeUnit.SECONDS));
assertEquals(1, FileUtils.listFiles(new File(DEST_DIRECTORY), new WildcardFileFilter("*.*"), null).size());
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
608e643e1166b0638011de496efe8f00e637900a | f8fab0f1b02f02541799327b009466cb167bd4d7 | /app/src/androidTest/java/com/teicm/fiveandone/MapsActivityTest.java | 0a3b6c873c2dae20e46ef7ede49da8b02bee92f0 | [] | no_license | Touloumis/FiveAndOne | a6836046b0283f1c6ca91dbbb4430566b5dca492 | 1399a49fca444b6966c9fcb73f165a80c63e50e8 | refs/heads/master | 2021-01-12T10:56:29.552742 | 2016-12-21T17:12:24 | 2016-12-21T17:12:24 | 72,762,624 | 0 | 18 | null | 2017-01-05T21:33:01 | 2016-11-03T16:04:36 | Java | UTF-8 | Java | false | false | 1,733 | java | package com.teicm.fiveandone;
import android.test.ActivityInstrumentationTestCase2;
import android.widget.Button;
import android.widget.EditText;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.TextView;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.model.Marker;
public class MapsActivityTest extends ActivityInstrumentationTestCase2 <MapsActivity> {
MapsActivity cMain;
GoogleMap tmMap;
TextView tWelcome;
TextView tInfo;
Button tNext;
Button tBonus;
Marker tmSerres;
Marker tmThessaloniki;
Marker tmEdessa;
Marker tmLarissa;
Marker tmVolos;
Marker tmAthens;
public MapsActivityTest (Class <MapsActivity> activityClass){
super(activityClass);
}
public MapsActivityTest(String name) {
super(MapsActivity.class);
setName(name);
}
protected void setUp() throws Exception {
super.setUp();
cMain=getActivity();
tInfo = (TextView) cMain.findViewById(R.id.info);
tWelcome = (TextView) cMain.findViewById(R.id.welcome);
tNext = (Button) cMain.findViewById(R.id.next);
//tBonus = (Button) cMain.findViewById(R.id.Bonus);
setActivityInitialTouchMode(true);
}
//Check if activity was created
public final void testPreconditions(){
assertNotNull("Test If the Activity was Created",cMain);
}
//Check if edit text was created
public final void testTextView(){
assertNotNull(tInfo);
assertNotNull(tWelcome);
}
//Check if button was created
public final void testButton(){
assertNotNull(tNext);
}
}
| [
"nikos@nikos.gr"
] | nikos@nikos.gr |
bb6defb28d4b38a7a472a37879d6aa7179184781 | b6f3285d60fe9e117a934914e2c577aa300a2cda | /usbSerialExamples/src/main/java/com/hoho/android/usbserial/examples/CustomProber.java | 80eaf7134e6e3d613d2bf174df43a2886cbdebe2 | [
"MIT"
] | permissive | mik3y/usb-serial-for-android | 58ea88714ed62f25d38eb11aacd2b0f218c1d664 | fd8c155ca5f69ec80f8f0ac28bb73ffc97b92511 | refs/heads/master | 2023-08-05T15:45:34.366869 | 2023-07-31T06:19:24 | 2023-07-31T06:19:24 | 11,079,679 | 4,188 | 1,427 | MIT | 2023-08-24T16:49:30 | 2013-06-30T23:17:45 | Java | UTF-8 | Java | false | false | 786 | java | package com.hoho.android.usbserial.examples;
import com.hoho.android.usbserial.driver.FtdiSerialDriver;
import com.hoho.android.usbserial.driver.ProbeTable;
import com.hoho.android.usbserial.driver.UsbSerialProber;
/**
* add devices here, that are not known to DefaultProber
*
* if the App should auto start for these devices, also
* add IDs to app/src/main/res/xml/device_filter.xml
*/
class CustomProber {
static UsbSerialProber getCustomProber() {
ProbeTable customTable = new ProbeTable();
customTable.addProduct(0x1234, 0x0001, FtdiSerialDriver.class); // e.g. device with custom VID+PID
customTable.addProduct(0x1234, 0x0002, FtdiSerialDriver.class); // e.g. device with custom VID+PID
return new UsbSerialProber(customTable);
}
}
| [
"mail@kai-morich.de"
] | mail@kai-morich.de |
97e03902bc98b0532e411709117c4ae6af5dbd2c | 75552b1008626911a8aae3a6bc66851620334cfe | /bookstore-angular/src/main/java/com/bookstore/utility/SecurityUtility.java | 222098cc76f25baec4fa95d5f2e09b53f0212587 | [] | no_license | sanjayakoju/BookStore | 6e61ab98b9bf2144aa2bb579c1be1c9b047207f2 | d15e08bf5a8b6f74069350433264a92e391c65da | refs/heads/master | 2023-01-23T23:28:16.438014 | 2020-11-19T04:11:13 | 2020-11-19T04:11:13 | 269,624,893 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 916 | java | package com.bookstore.utility;
import java.security.SecureRandom;
import java.util.Random;
import org.springframework.context.annotation.Bean;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.stereotype.Component;
@Component
public class SecurityUtility {
private static final String SALT="salt"; //Salt should be protected carefully
@Bean
public static BCryptPasswordEncoder passwordEncoder()
{
return new BCryptPasswordEncoder(12, new SecureRandom(SALT.getBytes()));
}
@Bean
public static String randomPasswor()
{
String SALTCHARS="ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
StringBuilder salt=new StringBuilder();
Random random=new Random();
while(salt.length()<18)
{
int index=(int) (random.nextFloat() * SALTCHARS.length());
salt.append(SALTCHARS.charAt(index));
}
String saltStr=salt.toString();
return saltStr;
}
}
| [
"sanjayakoju42@gmail.com"
] | sanjayakoju42@gmail.com |
8ed4add15c2bcee2a45d8c6a6e4e6d28df7deb46 | 59871dbcb53e6366a4290e16fbe474e66513c21a | /src/main/java/algs/StdStats.java | 57ff63e3c0162feff142def3fefccefa1a5bdd88 | [] | no_license | windwail/demo | 585e6fe469dab5aa02cf74937d01646f6988bfc1 | 0f3a5be45f9abee5a658ca6a83154934d7480633 | refs/heads/master | 2021-07-11T14:16:29.967822 | 2019-09-17T12:14:40 | 2019-09-17T12:14:40 | 209,031,260 | 0 | 0 | null | 2020-10-13T16:06:28 | 2019-09-17T11:04:07 | Java | UTF-8 | Java | false | false | 18,426 | java | /******************************************************************************
* Compilation: javac StdStats.java
* Execution: java StdStats < input.txt
* Dependencies: StdOut.java
*
* Library of statistical functions.
*
* The test client reads an array of real numbers from standard
* input, and computes the minimum, mean, maximum, and
* standard deviation.
*
* The functions all throw a java.lang.IllegalArgumentException
* if the array passed in as an argument is null.
*
* The floating-point functions all return NaN if any input is NaN.
*
* Unlike Math.min() and Math.max(), the min() and max() functions
* do not differentiate between -0.0 and 0.0.
*
* % more tiny.txt
* 5
* 3.0 1.0 2.0 5.0 4.0
*
* % java StdStats < tiny.txt
* min 1.000
* mean 3.000
* max 5.000
* std dev 1.581
*
* Should these funtions use varargs instead of array arguments?
*
******************************************************************************/
package algs;
/**
* The {@code StdStats} class provides static methods for computing
* statistics such as min, max, mean, sample standard deviation, and
* sample variance.
* <p>
* For additional documentation, see
* <a href="https://introcs.cs.princeton.edu/22library">Section 2.2</a> of
* <i>Computer Science: An Interdisciplinary Approach</i>
* by Robert Sedgewick and Kevin Wayne.
*
* @author Robert Sedgewick
* @author Kevin Wayne
*/
public final class StdStats {
private StdStats() { }
/**
* Returns the maximum value in the specified array.
*
* @param a the array
* @return the maximum value in the array {@code a[]};
* {@code Double.NEGATIVE_INFINITY} if no such value
*/
public static double max(double[] a) {
validateNotNull(a);
double max = Double.NEGATIVE_INFINITY;
for (int i = 0; i < a.length; i++) {
if (Double.isNaN(a[i])) return Double.NaN;
if (a[i] > max) max = a[i];
}
return max;
}
/**
* Returns the maximum value in the specified subarray.
*
* @param a the array
* @param lo the left endpoint of the subarray (inclusive)
* @param hi the right endpoint of the subarray (exclusive)
* @return the maximum value in the subarray {@code a[lo..hi)};
* {@code Double.NEGATIVE_INFINITY} if no such value
* @throws IllegalArgumentException if {@code a} is {@code null}
* @throws IllegalArgumentException unless {@code (0 <= lo) && (lo < hi) && (hi <= a.length)}
*/
public static double max(double[] a, int lo, int hi) {
validateNotNull(a);
validateSubarrayIndices(lo, hi, a.length);
double max = Double.NEGATIVE_INFINITY;
for (int i = lo; i < hi; i++) {
if (Double.isNaN(a[i])) return Double.NaN;
if (a[i] > max) max = a[i];
}
return max;
}
/**
* Returns the maximum value in the specified array.
*
* @param a the array
* @return the maximum value in the array {@code a[]};
* {@code Integer.MIN_VALUE} if no such value
*/
public static int max(int[] a) {
validateNotNull(a);
int max = Integer.MIN_VALUE;
for (int i = 0; i < a.length; i++) {
if (a[i] > max) max = a[i];
}
return max;
}
/**
* Returns the minimum value in the specified array.
*
* @param a the array
* @return the minimum value in the array {@code a[]};
* {@code Double.POSITIVE_INFINITY} if no such value
*/
public static double min(double[] a) {
validateNotNull(a);
double min = Double.POSITIVE_INFINITY;
for (int i = 0; i < a.length; i++) {
if (Double.isNaN(a[i])) return Double.NaN;
if (a[i] < min) min = a[i];
}
return min;
}
/**
* Returns the minimum value in the specified subarray.
*
* @param a the array
* @param lo the left endpoint of the subarray (inclusive)
* @param hi the right endpoint of the subarray (exclusive)
* @return the maximum value in the subarray {@code a[lo..hi)};
* {@code Double.POSITIVE_INFINITY} if no such value
* @throws IllegalArgumentException if {@code a} is {@code null}
* @throws IllegalArgumentException unless {@code (0 <= lo) && (lo < hi) && (hi <= a.length)}
*/
public static double min(double[] a, int lo, int hi) {
validateNotNull(a);
validateSubarrayIndices(lo, hi, a.length);
double min = Double.POSITIVE_INFINITY;
for (int i = lo; i < hi; i++) {
if (Double.isNaN(a[i])) return Double.NaN;
if (a[i] < min) min = a[i];
}
return min;
}
/**
* Returns the minimum value in the specified array.
*
* @param a the array
* @return the minimum value in the array {@code a[]};
* {@code Integer.MAX_VALUE} if no such value
*/
public static int min(int[] a) {
validateNotNull(a);
int min = Integer.MAX_VALUE;
for (int i = 0; i < a.length; i++) {
if (a[i] < min) min = a[i];
}
return min;
}
/**
* Returns the average value in the specified array.
*
* @param a the array
* @return the average value in the array {@code a[]};
* {@code Double.NaN} if no such value
*/
public static double mean(double[] a) {
validateNotNull(a);
if (a.length == 0) return Double.NaN;
double sum = sum(a);
return sum / a.length;
}
/**
* Returns the average value in the specified subarray.
*
* @param a the array
* @param lo the left endpoint of the subarray (inclusive)
* @param hi the right endpoint of the subarray (exclusive)
* @return the average value in the subarray {@code a[lo..hi)};
* {@code Double.NaN} if no such value
* @throws IllegalArgumentException if {@code a} is {@code null}
* @throws IllegalArgumentException unless {@code (0 <= lo) && (lo < hi) && (hi <= a.length)}
*/
public static double mean(double[] a, int lo, int hi) {
validateNotNull(a);
validateSubarrayIndices(lo, hi, a.length);
int length = hi - lo;
if (length == 0) return Double.NaN;
double sum = sum(a, lo, hi);
return sum / length;
}
/**
* Returns the average value in the specified array.
*
* @param a the array
* @return the average value in the array {@code a[]};
* {@code Double.NaN} if no such value
*/
public static double mean(int[] a) {
validateNotNull(a);
if (a.length == 0) return Double.NaN;
int sum = sum(a);
return 1.0 * sum / a.length;
}
/**
* Returns the sample variance in the specified array.
*
* @param a the array
* @return the sample variance in the array {@code a[]};
* {@code Double.NaN} if no such value
*/
public static double var(double[] a) {
validateNotNull(a);
if (a.length == 0) return Double.NaN;
double avg = mean(a);
double sum = 0.0;
for (int i = 0; i < a.length; i++) {
sum += (a[i] - avg) * (a[i] - avg);
}
return sum / (a.length - 1);
}
/**
* Returns the sample variance in the specified subarray.
*
* @param a the array
* @param lo the left endpoint of the subarray (inclusive)
* @param hi the right endpoint of the subarray (exclusive)
* @return the sample variance in the subarray {@code a[lo..hi)};
* {@code Double.NaN} if no such value
* @throws IllegalArgumentException if {@code a} is {@code null}
* @throws IllegalArgumentException unless {@code (0 <= lo) && (lo < hi) && (hi <= a.length)}
*/
public static double var(double[] a, int lo, int hi) {
validateNotNull(a);
validateSubarrayIndices(lo, hi, a.length);
int length = hi - lo;
if (length == 0) return Double.NaN;
double avg = mean(a, lo, hi);
double sum = 0.0;
for (int i = lo; i < hi; i++) {
sum += (a[i] - avg) * (a[i] - avg);
}
return sum / (length - 1);
}
/**
* Returns the sample variance in the specified array.
*
* @param a the array
* @return the sample variance in the array {@code a[]};
* {@code Double.NaN} if no such value
*/
public static double var(int[] a) {
validateNotNull(a);
if (a.length == 0) return Double.NaN;
double avg = mean(a);
double sum = 0.0;
for (int i = 0; i < a.length; i++) {
sum += (a[i] - avg) * (a[i] - avg);
}
return sum / (a.length - 1);
}
/**
* Returns the population variance in the specified array.
*
* @param a the array
* @return the population variance in the array {@code a[]};
* {@code Double.NaN} if no such value
*/
public static double varp(double[] a) {
validateNotNull(a);
if (a.length == 0) return Double.NaN;
double avg = mean(a);
double sum = 0.0;
for (int i = 0; i < a.length; i++) {
sum += (a[i] - avg) * (a[i] - avg);
}
return sum / a.length;
}
/**
* Returns the population variance in the specified subarray.
*
* @param a the array
* @param lo the left endpoint of the subarray (inclusive)
* @param hi the right endpoint of the subarray (exclusive)
* @return the population variance in the subarray {@code a[lo..hi)};
* {@code Double.NaN} if no such value
* @throws IllegalArgumentException if {@code a} is {@code null}
* @throws IllegalArgumentException unless {@code (0 <= lo) && (lo < hi) && (hi <= a.length)}
*/
public static double varp(double[] a, int lo, int hi) {
validateNotNull(a);
validateSubarrayIndices(lo, hi, a.length);
int length = hi - lo;
if (length == 0) return Double.NaN;
double avg = mean(a, lo, hi);
double sum = 0.0;
for (int i = lo; i < hi; i++) {
sum += (a[i] - avg) * (a[i] - avg);
}
return sum / length;
}
/**
* Returns the sample standard deviation in the specified array.
*
* @param a the array
* @return the sample standard deviation in the array {@code a[]};
* {@code Double.NaN} if no such value
*/
public static double stddev(double[] a) {
validateNotNull(a);
return Math.sqrt(var(a));
}
/**
* Returns the sample standard deviation in the specified array.
*
* @param a the array
* @return the sample standard deviation in the array {@code a[]};
* {@code Double.NaN} if no such value
*/
public static double stddev(int[] a) {
validateNotNull(a);
return Math.sqrt(var(a));
}
/**
* Returns the sample standard deviation in the specified subarray.
*
* @param a the array
* @param lo the left endpoint of the subarray (inclusive)
* @param hi the right endpoint of the subarray (exclusive)
* @return the sample standard deviation in the subarray {@code a[lo..hi)};
* {@code Double.NaN} if no such value
* @throws IllegalArgumentException if {@code a} is {@code null}
* @throws IllegalArgumentException unless {@code (0 <= lo) && (lo < hi) && (hi <= a.length)}
*/
public static double stddev(double[] a, int lo, int hi) {
validateNotNull(a);
validateSubarrayIndices(lo, hi, a.length);
return Math.sqrt(var(a, lo, hi));
}
/**
* Returns the population standard deviation in the specified array.
*
* @param a the array
* @return the population standard deviation in the array;
* {@code Double.NaN} if no such value
*/
public static double stddevp(double[] a) {
validateNotNull(a);
return Math.sqrt(varp(a));
}
/**
* Returns the population standard deviation in the specified subarray.
*
* @param a the array
* @param lo the left endpoint of the subarray (inclusive)
* @param hi the right endpoint of the subarray (exclusive)
* @return the population standard deviation in the subarray {@code a[lo..hi)};
* {@code Double.NaN} if no such value
* @throws IllegalArgumentException if {@code a} is {@code null}
* @throws IllegalArgumentException unless {@code (0 <= lo) && (lo < hi) && (hi <= a.length)}
*/
public static double stddevp(double[] a, int lo, int hi) {
validateNotNull(a);
validateSubarrayIndices(lo, hi, a.length);
return Math.sqrt(varp(a, lo, hi));
}
/**
* Returns the sum of all values in the specified array.
*
* @param a the array
* @return the sum of all values in the array {@code a[]};
* {@code 0.0} if no such value
*/
private static double sum(double[] a) {
validateNotNull(a);
double sum = 0.0;
for (int i = 0; i < a.length; i++) {
sum += a[i];
}
return sum;
}
/**
* Returns the sum of all values in the specified subarray.
*
* @param a the array
* @param lo the left endpoint of the subarray (inclusive)
* @param hi the right endpoint of the subarray (exclusive)
* @return the sum of all values in the subarray {@code a[lo..hi)};
* {@code 0.0} if no such value
* @throws IllegalArgumentException if {@code a} is {@code null}
* @throws IllegalArgumentException unless {@code (0 <= lo) && (lo < hi) && (hi <= a.length)}
*/
private static double sum(double[] a, int lo, int hi) {
validateNotNull(a);
validateSubarrayIndices(lo, hi, a.length);
double sum = 0.0;
for (int i = lo; i < hi; i++) {
sum += a[i];
}
return sum;
}
/**
* Returns the sum of all values in the specified array.
*
* @param a the array
* @return the sum of all values in the array {@code a[]};
* {@code 0.0} if no such value
*/
private static int sum(int[] a) {
validateNotNull(a);
int sum = 0;
for (int i = 0; i < a.length; i++) {
sum += a[i];
}
return sum;
}
/**
* Plots the points (0, <em>a</em><sub>0</sub>), (1, <em>a</em><sub>1</sub>), ...,
* (<em>n</em>-1, <em>a</em><sub><em>n</em>-1</sub>) to standard draw.
*
* @param a the array of values
*/
public static void plotPoints(double[] a) {
validateNotNull(a);
int n = a.length;
StdDraw.setXscale(-1, n);
StdDraw.setPenRadius(1.0 / (3.0 * n));
for (int i = 0; i < n; i++) {
StdDraw.point(i, a[i]);
}
}
/**
* Plots the line segments connecting
* (<em>i</em>, <em>a</em><sub><em>i</em></sub>) to
* (<em>i</em>+1, <em>a</em><sub><em>i</em>+1</sub>) for
* each <em>i</em> to standard draw.
*
* @param a the array of values
*/
public static void plotLines(double[] a) {
validateNotNull(a);
int n = a.length;
StdDraw.setXscale(-1, n);
StdDraw.setPenRadius();
for (int i = 1; i < n; i++) {
StdDraw.line(i-1, a[i-1], i, a[i]);
}
}
/**
* Plots bars from (0, <em>a</em><sub><em>i</em></sub>) to
* (<em>a</em><sub><em>i</em></sub>) for each <em>i</em>
* to standard draw.
*
* @param a the array of values
*/
public static void plotBars(double[] a) {
validateNotNull(a);
int n = a.length;
StdDraw.setXscale(-1, n);
for (int i = 0; i < n; i++) {
StdDraw.filledRectangle(i, a[i]/2, 0.25, a[i]/2);
}
}
// throw an IllegalArgumentException if x is null
// (x is either of type double[] or int[])
private static void validateNotNull(Object x) {
if (x == null)
throw new IllegalArgumentException("argument is null");
}
// throw an exception unless 0 <= lo <= hi <= length
private static void validateSubarrayIndices(int lo, int hi, int length) {
if (lo < 0 || hi > length || lo > hi)
throw new IllegalArgumentException("subarray indices out of bounds: [" + lo + ", " + hi + ")");
}
/**
* Unit tests {@code StdStats}.
* Convert command-line arguments to array of doubles and call various methods.
*
* @param args the command-line arguments
*/
public static void main(String[] args) {
double[] a = StdArrayIO.readDouble1D();
StdOut.printf(" min %10.3f\n", min(a));
StdOut.printf(" mean %10.3f\n", mean(a));
StdOut.printf(" max %10.3f\n", max(a));
StdOut.printf(" stddev %10.3f\n", stddev(a));
StdOut.printf(" var %10.3f\n", var(a));
StdOut.printf(" stddevp %10.3f\n", stddevp(a));
StdOut.printf(" varp %10.3f\n", varp(a));
}
}
/******************************************************************************
* Copyright 2002-2018, Robert Sedgewick and Kevin Wayne.
*
* This file is part of algs4.jar, which accompanies the textbook
*
* Algorithms, 4th edition by Robert Sedgewick and Kevin Wayne,
* Addison-Wesley Professional, 2011, ISBN 0-321-57351-X.
* http://algs4.cs.princeton.edu
*
*
* algs4.jar 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.
*
* algs4.jar 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 algs4.jar. If not, see http://www.gnu.org/licenses.
******************************************************************************/
| [
"you@example.com"
] | you@example.com |
3c7f2176c76eef1be18605a498b7ff5f4b98f570 | 1e7053446858a9c15b960d32484d6703b4bdd44d | /hxe-common/src/main/java/com/hxe/common/utils/HttpContextUtils.java | cf2ba57625ea90bc5ab248590945095d2bdb3d94 | [
"Apache-2.0"
] | permissive | iceseed/springboot-HXR | 03741c054dab30de130eae1fe04e879733f44e7f | d7188dda02f8473b32ccad4773f126b251e433a8 | refs/heads/master | 2020-04-07T05:41:59.152888 | 2018-11-20T13:38:54 | 2018-11-20T13:38:54 | 158,106,246 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,042 | java | /**
* Copyright 2018 人人开源 http://www.renren.io
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
package com.hxe.common.utils;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
public class HttpContextUtils {
public static HttpServletRequest getHttpServletRequest() {
return ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
}
}
| [
"82789@DESKTOP-P3A0S22"
] | 82789@DESKTOP-P3A0S22 |
9f05011c0dd482e7aa09e1ccd0b83815d6d46a69 | 5ef0fe9a11b5e943ea9cf3e57b660b6f4c89c521 | /src/library/assistant/ui/login/LoginController.java | c759c56e755a86cd858afa24b896261dcd23cd1e | [] | no_license | RouaBoussetta/Library | f54ce9bbf269cb9e3002fea017619aea986fbf81 | 6e98101fc0be0b7cdb658aacf874e6585c49b05b | refs/heads/main | 2023-01-11T19:06:26.403120 | 2020-11-12T22:13:46 | 2020-11-12T22:13:46 | 312,218,039 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,264 | java | package library.assistant.ui.login;
import Utils.DataBase;
import com.jfoenix.controls.JFXPasswordField;
import com.jfoenix.controls.JFXTextField;
import java.io.IOException;
import java.net.URL;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.ResourceBundle;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.fxml.Initializable;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.input.MouseEvent;
import javafx.stage.Stage;
import javafx.stage.StageStyle;
import javax.swing.JOptionPane;
import library.assistant.data.model.User;
import library.assistant.util.LibraryAssistantUtil;
import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
public class LoginController implements Initializable {
private final static Logger LOGGER = LogManager.getLogger(LoginController.class.getName());
private static LoginController instance;
Connection connection = null;
PreparedStatement preparedStatement = null;
ResultSet resultSet = null;
private User loggedUser;
@FXML
private javafx.scene.control.Label error;
@FXML
private JFXTextField userMail;
@FXML
private JFXPasswordField userPassword;
@FXML
private javafx.scene.control.Label register;
public LoginController() throws IOException {
connection = DataBase.getInstance().getConnection();
}
public static LoginController getInstance() {
return instance;
}
public User getLoggedUser() {
return loggedUser;
}
@Override
public void initialize(URL url, ResourceBundle rb) {
}
public boolean mailandpasswordValidate() {
String regex = "^[a-zA-Z0-9_!#$%&'*+/=?`{|}~^.-]+@[a-zA-Z0-9.-]+$";
Pattern pattern = Pattern.compile(regex);
Matcher matcher = pattern.matcher(userMail.getText());
if (userPassword.getText().length() < 8) {
error.setText("*password length < 8 ");
}
if (matcher.matches()) {
error.setText("");
return true;
} else {
error.setText("*mail not valid");
return false;
}
}
@FXML
private void handleLoginButtonAction(ActionEvent event) {
String email = userMail.getText();
String password = userPassword.getText();
mailandpasswordValidate();
if (mailandpasswordValidate()) {
String sql = "SELECT * FROM admin WHERE usermail = ? and userpassword = ?;";
try {
preparedStatement = connection.prepareStatement(sql);
preparedStatement.setString(1, email);
preparedStatement.setString(2, password);
resultSet = preparedStatement.executeQuery();
if (!resultSet.next()) {
error.setText("failed please verifiy your email or password");
} else {
User user = new User();
user.setId(resultSet.getInt("id"));
error.setText("");
closeStage();
loadMain();
LOGGER.log(Level.INFO, "admin successfully logged in {}", email);
}
} catch (Exception e) {
e.printStackTrace();
}
} else {
userMail.getStyleClass().add("wrong-credentials");
userPassword.getStyleClass().add("wrong-credentials");
}
}
@FXML
private void handleCancelButtonAction(ActionEvent event) {
System.exit(0);
}
private void closeStage() {
((Stage) userMail.getScene().getWindow()).close();
}
/*
public void changeScenex(ActionEvent actionEvent) throws IOException {
Node node = (Node) actionEvent.getSource();
Stage dialogStage = (Stage) node.getScene().getWindow();
Scene scene = new Scene(FXMLLoader.load(getClass().getResource("/GUI/REGISTER.fxml")));
dialogStage.setScene(scene);
dialogStage.show();
}
public void resetPage(MouseEvent actionEvent) throws IOException {
Parent root = FXMLLoader.load(getClass().getResource("/GUI/resetMail.fxml"));
Scene scene = loginButton.getScene();
root.translateXProperty().set(scene.getWidth());
Pane parentContainer = (Pane) scene.getRoot();
parentContainer.getChildren().add(root);
Timeline timeline = new Timeline();
KeyValue kv = new KeyValue(root.translateXProperty(), 0, Interpolator.EASE_IN);
KeyFrame kf = new KeyFrame(Duration.seconds(1), kv);
timeline.getKeyFrames().add(kf);
timeline.setOnFinished(event1 -> {
parentContainer.getChildren().remove(container);
});
timeline.play();
}
*/
private void infoBox(String infoMessage, String titleBar) {
JOptionPane.showMessageDialog(null, infoMessage, "InfoBox: " + titleBar, JOptionPane.INFORMATION_MESSAGE);
}
void loadMain() {
try {
Parent parent = FXMLLoader.load(getClass().getResource("/library/assistant/ui/main/main.fxml"));
Stage stage = new Stage(StageStyle.DECORATED);
stage.setTitle("Library Assistant");
stage.setScene(new Scene(parent));
stage.show();
LibraryAssistantUtil.setStageIcon(stage);
} catch (IOException ex) {
LOGGER.log(Level.ERROR, "{}", ex);
}
}
void loadRegister() {
try {
Parent parent = FXMLLoader.load(getClass().getResource("/library/assistant/ui/register/register.fxml"));
Stage stage = new Stage(StageStyle.DECORATED);
stage.setTitle("Register");
stage.setScene(new Scene(parent));
stage.show();
LibraryAssistantUtil.setStageIcon(stage);
} catch (IOException ex) {
LOGGER.log(Level.ERROR, "{}", ex);
}
}
@FXML
private void createAccountAction(MouseEvent event) {
closeStage();
loadRegister();
}
}
| [
"roua.boussetta@esprit.tn"
] | roua.boussetta@esprit.tn |
8d6fc1414f8f6ed090c64eae765438f07293ad25 | a1526322b26a087435520bc6457463dba38eb7ec | /2020_08_11_Generics/src/main/java/Test_01/GenericArray.java | 53d9f50e1d0ce6d97fc4f50b415c6b9a995814ed | [] | no_license | tiled0203/Java_Development | 1ee7994ec41fb58ef948cc34090704d375c63803 | e2cce7c27c5a3d3ddc1c8769fbdad67dba6f1099 | refs/heads/master | 2023-01-14T12:29:15.335745 | 2020-11-19T13:12:58 | 2020-11-19T13:12:58 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 896 | java | package Test_01;
public class GenericArray<E> {
public E[] array;
public int getSize(){
return array.length;
}
public E peek(){
return array[array.length - 1];
}
public E push(E object){
E[] newArray = (E[])new Object[array.length + 1];
for (int i = 0; i < array.length; i++) {
newArray[i] = array[i];
}
newArray[array.length] = object;
array = newArray;
return object;
}
public E pop(){
E object = array[array.length - 1];
E[] newArray = (E[])new Object[array.length - 1];
for (int i = 0; i < array.length - 1; i++) {
newArray[i] = array[i];
}
return object;
}
public boolean isEmpty(){
return array.length == 0;
}
@Override
public String toString(){
return "stack: " + array.toString();
}
}
| [
"kenis.wouter@gmail.com"
] | kenis.wouter@gmail.com |
5e0b063031e3e604febf884924f499d9a342443d | 025cb8baa7e170c7fb202584330ad6aace26440d | /src/main/java/de/creep/steelsnake/hotkeys/LeftListener.java | 7fb08603a1239b0a8b4f5165aa2592ee688cd29b | [
"MIT"
] | permissive | Creepios/SteelSnake | 39f7b1fe03db0e0f3e19f0aef2ab5395d9a32395 | 730ee9252814624087bafa54abb9288d10ef0160 | refs/heads/master | 2023-01-12T03:09:52.183514 | 2022-12-26T20:10:37 | 2022-12-26T20:10:37 | 289,348,589 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 488 | java | // SteelSnake: File was created on 19.08.2020 by Creep (Discord: Creep#4924)
package de.creep.steelsnake.hotkeys;
import com.tulskiy.keymaster.common.HotKey;
import com.tulskiy.keymaster.common.HotKeyListener;
import de.creep.steelsnake.SteelSnake;
import de.creep.steelsnake.utils.Direction;
import java.awt.*;
public class LeftListener implements HotKeyListener {
public void onHotKey(HotKey hotKey) {
SteelSnake.getInstance().setSnakeDirection(Direction.LEFT);
}
} | [
"niklas.rang@gmx.de"
] | niklas.rang@gmx.de |
48875b87b3a621a28f6776774892a11b258bb56f | 821ed0666d39420d2da9362d090d67915d469cc5 | /core/api/src/test/java/org/onosproject/net/topology/PathServiceAdapter.java | 3e699e9bd78a43de0f0cb120376f74fcbcd89e04 | [
"Apache-2.0"
] | permissive | LenkayHuang/Onos-PNC-for-PCEP | 03b67dcdd280565169f2543029279750da0c6540 | bd7d201aba89a713f5ba6ffb473aacff85e4d38c | refs/heads/master | 2021-01-01T05:19:31.547809 | 2016-04-12T07:25:13 | 2016-04-12T07:25:13 | 56,041,394 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,947 | java | /*
* Copyright 2015 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.net.topology;
import org.onosproject.net.DisjointPath;
import org.onosproject.net.ElementId;
import org.onosproject.net.Link;
import org.onosproject.net.Path;
import java.util.Map;
import java.util.Set;
/**
* Test adapter for path service.
*/
public class PathServiceAdapter implements PathService {
@Override
public Set<Path> getPaths(ElementId src, ElementId dst) {
return null;
}
@Override
public Set<Path> getPaths(ElementId src, ElementId dst, LinkWeight weight) {
return null;
}
@Override
public Set<DisjointPath> getDisjointPaths(ElementId src, ElementId dst) {
return null;
}
@Override
public Set<DisjointPath> getDisjointPaths(ElementId src, ElementId dst, LinkWeight weight) {
return null;
}
@Override
public Set<DisjointPath> getDisjointPaths(ElementId src, ElementId dst,
Map<Link, Object> riskProfile) {
return null;
}
@Override
public Set<DisjointPath> getDisjointPaths(ElementId src, ElementId dst,
LinkWeight weight,
Map<Link, Object> riskProfile) {
return null;
}
}
| [
"826080529@qq.com"
] | 826080529@qq.com |
4a4aedeb178e7d18695b1f4b90afbcfb69c68f5a | 988eb5fcf04b2b5d4d53211aabb7f60c35ce373f | /src/main/java/com/lsz/demo/config/DataSourceConfiguration.java | 92992ef281305ec6cd35872f7ea8a304f86b6742 | [] | no_license | connorlsz/demo | 94078a7232a8c496ddbd5e9c387e947feca79f76 | 1b83449419e5737179f6f51ab3593850ecc61990 | refs/heads/master | 2021-03-27T17:38:41.192498 | 2020-09-21T01:05:35 | 2020-09-21T01:05:35 | 123,768,827 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,331 | java | package com.lsz.demo.config;
import com.mchange.v2.c3p0.ComboPooledDataSource;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.beans.PropertyVetoException;
/**
* 连接数据库 连接池
*/
@Configuration
// 扫描mapper文件
@MapperScan("com.lsz.demo.dao")
public class DataSourceConfiguration {
@Value("${jdbc.jdbcUserName}")
private String jdbcUserName;
@Value("${jdbc.jdbcDriverClass}")
private String driverClass;
@Value("${jdbc.jdbcUrl}")
private String jdbcUrl;
@Value("${jdbc.jdbcPassword}")
private String jdbcPassword;
@Bean(name = "dataSource")
public ComboPooledDataSource createComboPooledDataSource() throws PropertyVetoException {
ComboPooledDataSource comboPooledDataSource = new ComboPooledDataSource();
comboPooledDataSource.setDriverClass(driverClass);
comboPooledDataSource.setJdbcUrl(jdbcUrl);
comboPooledDataSource.setUser(jdbcUserName);
comboPooledDataSource.setPassword(jdbcPassword);
// 连接关闭时不提交事务
comboPooledDataSource.setAutoCommitOnClose(false);
return comboPooledDataSource;
}
}
| [
"connorlsz@163.com"
] | connorlsz@163.com |
03994d71acafa89040aaa04c45c9884b4a3ca2f1 | fa1715c6b97dccc2ac91f41d7cf08e4965e8df78 | /app/src/main/java/com/rockspin/bargainbits/ui/views/deallist/recycleview/storesgrid/StoreEntryViewModel.java | 964b70ef878a624638cf1f6b366988fd0a0d4a1a | [] | no_license | Rockspin/BargainBytesAndroid | 6b8c19aad6100b53e5125c8d2588b1994ddd23cb | b02391a5a25f47717e3e8aa5100d8dff97dc3c1a | refs/heads/master | 2021-01-19T21:18:55.651771 | 2019-11-20T15:50:17 | 2019-11-20T15:50:17 | 88,637,719 | 3 | 1 | null | 2017-11-09T21:39:55 | 2017-04-18T14:57:53 | Java | UTF-8 | Java | false | false | 663 | java | package com.rockspin.bargainbits.ui.views.deallist.recycleview.storesgrid;
import com.rockspin.bargainbits.data.models.cheapshark.Deal;
public class StoreEntryViewModel {
private final String storeId;
private final boolean isActive;
private StoreEntryViewModel(String storeId, boolean isActive) {
this.storeId = storeId;
this.isActive = isActive;
}
public String getStoreId() {
return storeId;
}
public boolean isActive() {
return isActive;
}
public static StoreEntryViewModel from(Deal deal) {
return new StoreEntryViewModel(deal.getStoreID(), deal.getSavings() > 0.0f);
}
}
| [
"val@rockspin.co.uk"
] | val@rockspin.co.uk |
c954b35ea34c8d403815e972b0f9ff47898b3a5f | 7da956597f103ec529783b5edb836f07ee6d701d | /MyApp/app/src/main/java/com/example/shreyus/myapp/TaskDbHelper.java | 9ebc696ad23dd672fdcb7ac294d1005190e0c0bf | [] | no_license | xxyypp/IBM_Dementia | 8cf999a188d3f5fd676f5308721b72a4dd090664 | 15ffc3f33f56a4a1f42f02c97b8b776e8fe7b0b5 | refs/heads/master | 2020-03-15T12:22:24.001643 | 2018-06-27T17:32:36 | 2018-06-27T17:32:36 | 132,142,285 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,055 | java | package com.example.shreyus.myapp;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
public class TaskDbHelper extends SQLiteOpenHelper {
public TaskDbHelper(Context context) {
super(context, TaskContract.DB_NAME, null, TaskContract.DB_VERSION);
}
/**
* Using database here for to-do list
* CREATE TABLE tasks (_id INTEGER PRIMARY KEY AUTOINCREMENT,title TEXT NOT NULL);
* @param db
*/
@Override
public void onCreate(SQLiteDatabase db) {
String createTable = "CREATE TABLE " + TaskContract.TaskEntry.TABLE + " ( " +
TaskContract.TaskEntry._ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " +
TaskContract.TaskEntry.COL_TASK_TITLE + " TEXT NOT NULL);";
db.execSQL(createTable);
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
db.execSQL("DROP TABLE IF EXISTS " + TaskContract.TaskEntry.TABLE);
onCreate(db);
}
}
| [
"yangpuypyp@outlook.com"
] | yangpuypyp@outlook.com |
607bbaaf0143e9b094546cc226462530e075e3b4 | 5363429ae1ab85a0f3cb30cefd68c379b3b7aa18 | /8-13/SC_TWO-1/security/src/main/java/com/two/security/config/CustomAccessDecisionManager.java | 5e181c5ba3d422c4b2f04aa7a9b4d046c8abd5fa | [] | no_license | gangsijay/mySuccessDemo | d08a4e5d88817e5f783d0cb94b2a973a964f2076 | 6aa6553ce440a137ba2f31a03f04bcbcf1cc3cd4 | refs/heads/master | 2020-03-25T22:57:33.531815 | 2019-03-05T15:19:30 | 2019-03-05T15:19:30 | 144,252,888 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,694 | java | package com.two.security.config;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.security.access.AccessDecisionManager;
import org.springframework.security.access.AccessDeniedException;
import org.springframework.security.access.ConfigAttribute;
import org.springframework.security.authentication.InsufficientAuthenticationException;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.stereotype.Service;
import java.util.Collection;
import java.util.Iterator;
/**
* 权限管理决断器
*
* @Author: 我爱大金子
* @Description: 权限管理决断器
* @Date: Create in 17:15 2017/7/5
*/
@Service
public class CustomAccessDecisionManager implements AccessDecisionManager {
Logger log = LoggerFactory.getLogger(CustomAccessDecisionManager.class);
// decide 方法是判定是否拥有权限的决策方法,
//authentication 是释CustomUserService中循环添加到 GrantedAuthority 对象中的权限信息集合.
//object 包含客户端发起的请求的requset信息,可转换为 HttpServletRequest request = ((FilterInvocation) object).getHttpRequest();
//configAttributes 为MyInvocationSecurityMetadataSource的getAttributes(Object object)这个方法返回的结果,此方法是为了判定用户请求的url 是否在权限表中,如果在权限表中,则返回给 decide 方法,用来判定用户是否有此权限。如果不在权限表中则放行。
@Override
public void decide(Authentication authentication, Object object, Collection<ConfigAttribute> configAttributes) throws AccessDeniedException, InsufficientAuthenticationException {
if(null== configAttributes || configAttributes.size() <=0) {
return;
}
ConfigAttribute c;
String needRole;
for(Iterator<ConfigAttribute> iter = configAttributes.iterator(); iter.hasNext(); ) {
c = iter.next();
needRole = c.getAttribute();
for(GrantedAuthority ga : authentication.getAuthorities()) {//authentication 为在注释1 中循环添加到 GrantedAuthority 对象中的权限信息集合
if(needRole.trim().equals(ga.getAuthority())) {
return;
}
}
log.info("【权限管理决断器】需要role:" + needRole);
}
throw new AccessDeniedException("Access is denied");
}
@Override
public boolean supports(ConfigAttribute attribute) {
return true;
}
@Override
public boolean supports(Class<?> clazz) {
return true;
}
} | [
"8gangsi@163.com"
] | 8gangsi@163.com |
3752905620ad507f84a049521009632c14bdea6b | 123344f89fa79a5f551b69cf3217c2133bb9250c | /reporting/src/main/java/ru/click/reporting/model/ClientPayments.java | 859d895b402f78e4c98ab8f726f83bea1d0475f3 | [] | no_license | kasyanov23/znamenka | 972cb7fb6a51137c075568410cca8c0ff9aa526f | 6fec8ec5f8680ef7878cbf6fb10deb94b8c3fe4c | refs/heads/master | 2021-01-12T01:44:36.564614 | 2016-12-26T14:14:08 | 2016-12-26T14:14:08 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 398 | java | package ru.click.reporting.model;
import lombok.Builder;
import lombok.Getter;
import java.sql.Date;
@Builder
@Getter
public class ClientPayments {
private final String clientName;
private final Date paymentDate;
private final Long sumPayments;
private final Long leftToAdd;
private final String productName;
private final String trainerName;
}
| [
"rina_seagull@mail.ru"
] | rina_seagull@mail.ru |
9e72a61dc20f915a695aa21a62ffedbb21790b4a | 5a52e0ff569b38cda45faf7552b6378bb8f28e43 | /app/src/main/java/com/cniao5/cniao5play/common/util/InstallAccessibilityService.java | 3df7a526301730c4db756d4f9b98a230f2f295a7 | [] | no_license | dazeGitHub/CNiaoPhoneAssist | d2cca26e5032310685a83bb1f835fa3a75de9dd6 | 0599c3a77c7c8a9473e3301c97e4909dce706e90 | refs/heads/master | 2021-01-01T06:25:45.213076 | 2019-01-09T09:16:10 | 2019-01-09T09:16:10 | 97,426,395 | 3 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,912 | java | package com.cniao5.cniao5play.common.util;
import android.accessibilityservice.AccessibilityService;
import android.os.Build;
import android.support.annotation.RequiresApi;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityNodeInfo;
import java.util.List;
/**
* 菜鸟窝http://www.cniao5.com 一个高端的互联网技能学习平台
*
* @author Ivan
* @version V1.0
* @Package com.cniao5.cniao5play.service
* @Description: ${TODO}(用一句话描述该文件做什么)
* @date
*/
public class InstallAccessibilityService extends AccessibilityService {
@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN)
public void onAccessibilityEvent(AccessibilityEvent event) {
AccessibilityNodeInfo nodeInfo = event.getSource();
if(nodeInfo==null){
return;
}
int evenType = event.getEventType();
if(evenType == AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED ||
evenType == AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED)
{
// 中文系统
click("安装");
click("下一步");
click("确定");
click("完成");
// 英文
}
}
@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN)
private void click(String text){
AccessibilityNodeInfo rootNodeInfo = getRootInActiveWindow();
List<AccessibilityNodeInfo> nodeInfos = rootNodeInfo.findAccessibilityNodeInfosByText(text);
if(nodeInfos==null ){
return;
}
for (AccessibilityNodeInfo info : nodeInfos){
if(info.getClassName().equals("android.widget.Button") && info.isClickable()){
info.performAction(AccessibilityNodeInfo.ACTION_CLICK);
}
}
}
@Override
public void onInterrupt() {
}
}
| [
"1992330573@qq.com"
] | 1992330573@qq.com |
e6fc05526195d6493e568e1a6d7bc1c58afa23ce | 144e1ec9468e6e3af01d2b8600ffc4e569f62984 | /图片浏览选择/ChooseImages/UIL/src/main/java/com/nostra13/universalimageloader/core/display/BitmapDisplayer.java | e10df202b853c91202c674cddafae742c1f2d516 | [] | no_license | blazecake/mz_demo | b7fe2f73b01f2e8b78220077fa2e3951b994174a | 56db361fb57ce617b1e9edd398bf3c83ea3fdd52 | refs/heads/master | 2021-01-19T08:53:30.529612 | 2015-04-02T01:11:13 | 2015-04-02T01:11:13 | 28,904,482 | 4 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,025 | java | /*******************************************************************************
* Copyright 2011-2013 Sergey Tarasevich
*
* 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.nostra13.universalimageloader.core.display;
import android.graphics.Bitmap;
import com.nostra13.universalimageloader.core.assist.LoadedFrom;
import com.nostra13.universalimageloader.core.imageaware.ImageAware;
/**
* Displays {@link android.graphics.Bitmap} in {@link com.nostra13.universalimageloader.core.imageaware.ImageAware}. Implementations can
* apply some changes to Bitmap or any animation for displaying Bitmap.<br />
* Implementations have to be thread-safe.
*
* @author Sergey Tarasevich (nostra13[at]gmail[dot]com)
* @see com.nostra13.universalimageloader.core.imageaware.ImageAware
* @see com.nostra13.universalimageloader.core.assist.LoadedFrom
* @since 1.5.6
*/
public interface BitmapDisplayer {
/**
* Displays bitmap in {@link com.nostra13.universalimageloader.core.imageaware.ImageAware}.
* <b>NOTE:</b> This method is called on UI thread so it's strongly recommended not to do any heavy work in it.
*
* @param bitmap Source bitmap
* @param imageAware {@linkplain com.nostra13.universalimageloader.core.imageaware.ImageAware Image aware view} to
* display Bitmap
* @param loadedFrom Source of loaded image
*/
void display(Bitmap bitmap, ImageAware imageAware, LoadedFrom loadedFrom);
}
| [
"maozhou3@163.com"
] | maozhou3@163.com |
d8a5a13419f061706b166d5e5d4431d06f46ac67 | 43ab3c4fa9da0689f46638d0d6e0231b5a467057 | /part-shop-rest/src/main/java/com/partsshop/rest/controller/PartsCategoryController.java | 32b35cdf8da8287d269def835aabbc55699b3bad | [] | no_license | alaaabuzaghleh/part-shop-project | 5bbe26ad0808e5807a48b20424fa2a8f6717e65d | a4dc5b21703f17da3cd7b2ecbd7f37d50415f3c1 | refs/heads/master | 2020-04-09T06:16:49.749315 | 2019-01-07T01:56:15 | 2019-01-07T01:56:15 | 160,105,692 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,231 | java | package com.partsshop.rest.controller;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import javax.validation.Valid;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.MessageSource;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.annotation.Secured;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.partsshop.rest.dto.CarRest;
import com.partsshop.rest.dto.PartsCategoryRest;
import com.partsshop.rest.dto.RestMessage;
import com.partsshop.rest.service.PartsCategoryService;
@RestController
@RequestMapping("/api/v1/parts-categories")
public class PartsCategoryController {
@Autowired
private PartsCategoryService service ;
@Autowired
private MessageSource messageSource ;
@PostMapping(value= {"", "/"})
@Secured("ROLE_ADMIN")
public ResponseEntity<?> saveNewPart(@RequestBody @Valid PartsCategoryRest rest,@RequestHeader("Accept-Language") Locale locale){
PartsCategoryRest toReturn = this.service.savePart(rest) ;
if(toReturn == null) {
List<String> ls = new ArrayList<>() ;
ls.add(this.messageSource.getMessage("Exception.unexpected", null, locale)) ;
return new ResponseEntity<>(new RestMessage(false, ls), HttpStatus.INTERNAL_SERVER_ERROR) ;
}else {
List<String> ls = new ArrayList<>() ;
ls.add(this.messageSource.getMessage("saved.success", null, locale)) ;
return new ResponseEntity<>(new RestMessage(true, ls), HttpStatus.CREATED) ;
}
}
@PutMapping(value= {"", "/"})
@Secured("ROLE_ADMIN")
public ResponseEntity<?> updatePart(@RequestBody @Valid PartsCategoryRest rest,@RequestHeader("Accept-Language") Locale locale){
PartsCategoryRest tempPart = this.service.getNameById(rest.getId());
if(tempPart== null) {
List<String> ls = new ArrayList<>() ;
ls.add(this.messageSource.getMessage("Parts.notFound", null, locale)) ;
return new ResponseEntity<>(new RestMessage(false, ls), HttpStatus.NOT_FOUND) ;
}else {
this.service.updatePart(rest) ;
List<String> ls = new ArrayList<>() ;
ls.add(this.messageSource.getMessage("saved.success", null, locale)) ;
return new ResponseEntity<>(new RestMessage(true, ls), HttpStatus.ACCEPTED) ;
}
}
@GetMapping(value= {"", "/"})
public ResponseEntity<?> getAllParts(@RequestHeader("Accept-Language") Locale locale){
List<PartsCategoryRest> parts=this.service.getNames();
if(parts==null || parts.isEmpty()) {
List<String> ls = new ArrayList<>() ;
ls.add(this.messageSource.getMessage("Parts.notFound", null, locale)) ;
return new ResponseEntity<>(new RestMessage(false, ls), HttpStatus.NOT_FOUND) ;
}else {
return new ResponseEntity<>(parts, HttpStatus.OK) ;
}
}
}
| [
"alaaabuzaghleh@Alaas-MacBook-Pro.local"
] | alaaabuzaghleh@Alaas-MacBook-Pro.local |
b37f90716a1f09054c2702e84cd94907ef3f5f41 | 3b510e7c35a0d6d10131436f09fb81a3f9414c13 | /randoop/src/main/java/randoop/operation/EnumConstant.java | d325f2bd4ec7d44dc45b585b7f49d0872b8aad7d | [
"MIT",
"Apache-2.0",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | Groostav/CMPT880-term-project | f9e680b5d54f6ff18ee2e21f091b0732bb831220 | 6120c4de0780aaea78870c3842be9a299b9e3100 | refs/heads/master | 2016-08-12T22:05:57.654319 | 2016-04-19T08:13:43 | 2016-04-19T08:13:43 | 55,188,786 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 6,551 | java | package randoop.operation;
import java.io.PrintStream;
import java.io.Serializable;
import java.util.Collections;
import java.util.List;
import randoop.ExecutionOutcome;
import randoop.NormalExecution;
import randoop.sequence.Variable;
import randoop.types.TypeNames;
/**
* EnumConstant is an {@link Operation} representing a constant value from an
* enum.
* <p>
* Using the formal notation in {@link Operation}, a constant named BLUE from
* the enum Colors is an operation BLUE : [] → Colors.
* <p>
* Execution simply returns the constant value.
*/
public class EnumConstant extends AbstractOperation implements Operation, Serializable {
private static final long serialVersionUID = 849994347169442078L;
public static final String ID = "enum";
private Enum<?> value;
public EnumConstant(Enum<?> value) {
if (value == null) {
throw new IllegalArgumentException("enum constant cannot be null");
}
this.value = value;
}
@Override
public boolean equals(Object obj) {
if (obj instanceof EnumConstant) {
EnumConstant e = (EnumConstant) obj;
return equals(e);
}
return false;
}
public boolean equals(EnumConstant e) {
return (this.value.equals(e.value));
}
@Override
public int hashCode() {
return value.hashCode();
}
@Override
public String toString() {
return toParseableString();
}
/**
* {@inheritDoc}
*
* @return an empty list.
*/
@Override
public List<Class<?>> getInputTypes() {
return Collections.emptyList();
}
public Class<?> type() {
return value.getDeclaringClass();
}
/**
* {@inheritDoc}
*
* @return the enum type.
*/
@Override
public Class<?> getOutputType() {
return type();
}
/**
* {@inheritDoc}
*
* @return a {@link NormalExecution} object holding the value of the enum
* constant.
*/
@Override
public ExecutionOutcome execute(Object[] statementInput, PrintStream out) {
assert statementInput.length == 0;
return new NormalExecution(this.value, 0);
}
/**
* {@inheritDoc} Adds qualified name of enum constant.
*/
@Override
public void appendCode(List<Variable> inputVars, StringBuilder b) {
b.append(TypeNames.getCompilableName(type()) + "." + this.value.name());
}
/**
* {@inheritDoc} Issues a string representation of an enum constant as a
* type-value pair. The parse function should return an equivalent object.
*
* @see EnumConstant#parse(String)
*/
@Override
public String toParseableString() {
return type().getName() + ":" + value.name();
}
/**
* Parses the description of an enum constant value in a string as returned by
* {@link EnumConstant#toParseableString()}.
*
* Valid strings may be of the form EnumType:EnumValue, or
* OuterClass$InnerEnum:EnumValue for an enum that is an inner type of a
* class.
*
* @param desc
* string representing type-value pair for an enum constant
* @return an EnumConstant representing the enum constant value in desc
* @throws OperationParseException
* if desc does not match expected form.
*/
public static EnumConstant parse(String desc) throws OperationParseException {
if (desc == null) {
throw new IllegalArgumentException("s cannot be null");
}
int colonIdx = desc.indexOf(':');
if (colonIdx < 0) {
String msg =
"An enum constant description must be of the form \""
+ "<type>:<value>"
+ " but description is \""
+ desc
+ "\".";
throw new OperationParseException(msg);
}
String typeName = desc.substring(0, colonIdx).trim();
String valueName = desc.substring(colonIdx + 1).trim();
Enum<?> value = null;
String errorPrefix =
"Error when parsing type-value pair "
+ desc
+ " for an enum description of the form <type>:<value>.";
if (typeName.isEmpty()) {
String msg = errorPrefix + " No type given.";
throw new OperationParseException(msg);
}
if (valueName.isEmpty()) {
String msg = errorPrefix + " No value given.";
throw new OperationParseException(msg);
}
String whitespacePattern = ".*\\s+.*";
if (typeName.matches(whitespacePattern)) {
String msg = errorPrefix + " The type has unexpected whitespace characters.";
throw new OperationParseException(msg);
}
if (valueName.matches(whitespacePattern)) {
String msg = errorPrefix + " The value has unexpected whitespace characters.";
throw new OperationParseException(msg);
}
Class<?> type;
try {
type = TypeNames.getTypeForName(typeName);
} catch (ClassNotFoundException e) {
String msg = errorPrefix + " The type given \"" + typeName + "\" was not recognized.";
throw new OperationParseException(msg);
}
if (!type.isEnum()) {
String msg = errorPrefix + " The type given \"" + typeName + "\" is not an enum.";
throw new OperationParseException(msg);
}
value = valueOf(type, valueName);
if (value == null) {
String msg =
errorPrefix
+ " The value given \""
+ valueName
+ "\" is not a constant of the enum "
+ typeName
+ ".";
throw new OperationParseException(msg);
}
return new EnumConstant(value);
}
/**
* valueOf searches the enum constant list of a class for a constant with the
* given name. Note: cannot make this work using valueOf method of Enum due to
* typing.
*
* @param type
* class that is already known to be an enum.
* @param valueName
* name for value that may be a constant of the enum.
* @return reference to actual constant value, or null if none exists in type.
*/
private static Enum<?> valueOf(Class<?> type, String valueName) {
for (Object obj : type.getEnumConstants()) {
Enum<?> e = (Enum<?>) obj;
if (e.name().equals(valueName)) {
return e;
}
}
return null;
}
/**
* value
*
* @return object for value of enum constant.
*/
public Enum<?> value() {
return this.value;
}
/**
* {@inheritDoc}
*
* @return value of enum constant.
*/
@Override
public Object getValue() {
return value();
}
/**
* {@inheritDoc}
*
* @return enclosing enum type.
*/
@Override
public Class<?> getDeclaringClass() {
return value.getDeclaringClass();
}
}
| [
"geoff_groos@msn.com"
] | geoff_groos@msn.com |
11c41ca452955ff0107ff4a2007f51a0791dafed | 4397216932e035b0f6cd7b258a3e4fe701c736b3 | /LeapYearCalculator/src/com/company/Main.java | 64d1ea12854f4a0ad78165c00140f25a5aac73b4 | [] | no_license | GitLudo95/IdeaProjects | 641c6ec2c5e1729bcfd4b7213392fea7f0c54770 | 42fb368a71bc35a72d342ba774a3453510936471 | refs/heads/master | 2021-08-16T02:07:25.361026 | 2021-05-08T15:26:17 | 2021-05-08T15:26:17 | 150,996,614 | 0 | 0 | null | 2021-06-15T15:59:48 | 2018-09-30T18:56:37 | Java | UTF-8 | Java | false | false | 1,477 | java | package com.company;
public class Main {
public static void main(String[] args) {
System.out.println(isLeapYear(1800));
System.out.println(getDaysInMonth(2,10000));
}
public static boolean isLeapYear (int year) {
if (year < 1 || year > 9999) {
return false;
} else if(year % 100 == 0 && year % 400 == 0) {
return true;
} else if(year % 100 == 0) {
return false;
} else if(year % 4 == 0) {
return true;
} else
return false;
}
public static int getDaysInMonth (int month, int year) {
if(year <1 || year >9999) {
return -1;
} else {
}
switch(month) {
case 1:
return 31;
case 2:
if(isLeapYear(year)) {
return 29;
} else
return 28;
case 3:
return 31;
case 4:
return 30;
case 5:
return 31;
case 6:
return 30;
case 7:
return 31;
case 8:
return 31;
case 9:
return 30;
case 10:
return 31;
case 11:
return 30;
case 12:
return 31;
default:
return -1;
}
}
} | [
"ludopieterse@gmail.com"
] | ludopieterse@gmail.com |
ba15c2a7995364f042fdec34d87eb85ab78a336f | bf0264c9fce4e60286d045b82bacad76dcffdb0b | /demo-model/src/main/java/com/example/demo/model/profile/student/entity/Student.java | 899b88b8b362de9331dd8b11d55693a0baaebc93 | [] | no_license | bhodossy/demo | a9e202f275c27dc94fc64492402b5055e364b998 | cc1d3c4571e472865c1e2050b1ecb376a5442ffa | refs/heads/master | 2020-03-13T22:38:26.881731 | 2018-05-08T17:25:01 | 2018-05-08T17:25:01 | 131,320,248 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 346 | java | package com.example.demo.model.profile.student.entity;
import com.example.demo.model.profile.Profile;
import lombok.*;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
@Data
@Builder
@AllArgsConstructor
@Entity
@DiscriminatorValue("S")
@EqualsAndHashCode(callSuper = true)
public class Student extends Profile {
}
| [
"balazs.hodossy@webvalto.hu"
] | balazs.hodossy@webvalto.hu |
4749f2e8d1ebe2651c83516c4366fbf653e1ee56 | 2ea60b577065bb5a7d7846f14c267054ecda3d9f | /supplies/FoodImpl.java | 0d4b5fbb1127ccd8bad7c11fe5e83132b4639df5 | [] | no_license | ndrwum/Oregon-Trail-Knockoff | b0458e75f8195c2fa672e49545d133e7e9290a6c | 68d012ab3652f889130a4b71df6e3d3730309b62 | refs/heads/master | 2021-01-20T18:57:44.667182 | 2018-02-14T19:40:42 | 2018-02-14T19:40:42 | 65,671,450 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,241 | java | package supplies;
/** Common parent class for all Food classes. */
public abstract class FoodImpl extends SuppliesImpl implements Food {
/* Fields */
private int days_till_expiration;
private int fill;
/* Constructors */
protected FoodImpl(int amount, int unit_weight, String name, int days,
int fill) {
super(amount, unit_weight, name);
// Validate input
if (days <= 0)
throw new IllegalArgumentException(
"Days till expiration must be positive!");
// Fill can be anything!
// Initialize fields
this.days_till_expiration = days;
this.fill = fill;
}
/* Food methods */
@Override
public void consume() throws NoFoodException {
if (getAmount() == 0)
throw new NoFoodException();
setAmount(getAmount() - 1);
}
@Override
public int getDaysTillExpiration() {
return days_till_expiration;
}
@Override
public void age() throws FoodExpiredException {
days_till_expiration -= 1;
if (days_till_expiration <= 0)
throw new FoodExpiredException();
}
@Override
public int getFill() {
return fill;
}
@Override
public String toString() {
return super.toString() + " (expires in " + getDaysTillExpiration()
+ " days)";
}
} | [
"ndrwum@yahoo.com"
] | ndrwum@yahoo.com |
777c6f4df85c7f356d1fc3137e27b2d5e78b0bc5 | 45665b150eb88bcb604b300a47a98bc647b4751f | /Source Code/src/ngo/music/soundcloudplayer/general/States.java | 06ced897b4b0a167e7c5d964696a9b8c5f0ce896 | [
"Apache-2.0"
] | permissive | FluidCoding/sound-cloud-player | 613d25a12791c763e34a27f9de1a94e9b7741b65 | 51e4608959f4038b457bcbcf8d5d7ba4a3139431 | refs/heads/master | 2021-01-14T12:10:02.998415 | 2015-04-07T11:05:17 | 2015-04-07T11:05:17 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 235 | java | package ngo.music.soundcloudplayer.general;
public final class States {
public static int musicPlayerState;
public static int appState;
public static int loginState = Constants.UserContant.NOT_LOGGED_IN;
private States(){
}
}
| [
"ngolebaotrung@gmail.com"
] | ngolebaotrung@gmail.com |
3400459e30fbce042cdc0332cc4d365c38e29975 | 27669359b0a803e0a48ea69b4f2bc3861c9505ce | /src/com/kingmon/project/webservice/common/service/BzdzRejectIpService.java | 0f819d63a7703bd92392121c4e7f00c85f87c80c | [] | no_license | radtek/project | dbc9121f048e006989d11390a55aaada1885712f | eb82bd4aa8876fc13c96d5b2ab563fe6ea168ae8 | refs/heads/master | 2020-05-24T15:59:55.410432 | 2017-09-06T02:12:04 | 2017-09-06T02:12:04 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,367 | java | package com.kingmon.project.webservice.common.service;
import java.util.Map;
import com.kingmon.base.data.DataSet;
import com.kingmon.project.webservice.common.model.ServiceBzdzRejectIp;
public interface BzdzRejectIpService {
/**
* 加载全部信息
* @param params
* @return
*/
DataSet rejectIpList(Map<String, String> params);
ServiceBzdzRejectIp selectById(String ip);
/**
* 添加
* @param
* @return
*/
public void addIp(Map<String, Object> params );
/**
* 修改
* @param
* @return
*/
public void saveIp(Map<String, Object> params );
/**
*
* @param ipid
*/
public void updateIpState(String ipid);
/**
* 限制Ip是否有效
* @param ipid
*/
public void removeIp(String ipid,String sfyy,String ip);
/**
* 修改限制接口
* @param params
*/
public void saveXzjkRejectIp(Map<String,Object> params);
/**
* WEB 通过IP查看限制信息
* @param ip
* @return
*/
public ServiceBzdzRejectIp selectBdIp(String ip);
/**
* 根据LongIP 查询 信息
* @param longip
* @return
*/
public ServiceBzdzRejectIp selectBdLongIp(Long longip);
}
| [
"821699546@qq.com"
] | 821699546@qq.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.