blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 4 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 689M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 22 values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 131 values | src_encoding stringclasses 34 values | language stringclasses 1 value | is_vendor bool 1 class | is_generated bool 2 classes | length_bytes int64 3 9.45M | extension stringclasses 32 values | content stringlengths 3 9.45M | authors listlengths 1 1 | author_id stringlengths 0 313 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
59c29f4f7d0e5c8eb60ff91edd8922aae0f7ea47 | 747723bd91ab9814e9f15134a48ce02fd605757f | /src/main/java/me/twis/persistance/FollowedTvShow.java | 420933a73f7cb417204a84869ae83d401e50d96f | [
"MIT"
] | permissive | zsolt-kali/twis | 44b959894a5656c28379f6bdd1df53339842f3e4 | c40e02f2682c924c1dcb56fe41a1837628ef5edb | refs/heads/master | 2021-01-10T01:51:34.993544 | 2016-01-25T21:32:46 | 2016-01-25T21:32:46 | 49,372,680 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 675 | java | package me.twis.persistance;
import com.fasterxml.jackson.annotation.JsonProperty;
import javax.persistence.Entity;
import javax.persistence.Id;
/**
* Created by kalizsolt on 21/01/16.
*/
@Entity
public class FollowedTvShow {
@Id
@JsonProperty("id")
private long id;
@JsonProperty("name")
private String name;
@JsonProperty("season")
private short season;
@JsonProperty("episode")
private short episode;
public FollowedTvShow() {}
public FollowedTvShow(long id, String name, short season, short episode) {
this.id = id;
this.name = name;
this.season = season;
this.episode = episode;
}
}
| [
"kalizsolt@gmail.com"
] | kalizsolt@gmail.com |
69e939782fb3c5b48ee876422cf0e0024bb9b137 | 06b5d461474d8a4980627ddcc80af017b347e7b0 | /ActtimeTimeSeleniumFramework/src/com/actime/pageObjectRepositoryLib/TimeTrack.java | c1e8c3882418e6ca0f7e8b359b809d77649f0fc4 | [] | no_license | sivananda1993/JenkinprojectRemote | ef2357d5c5e26d4dc112da4b1afc91141fd4095f | ef70192a02ca312ca16ab09252129dc14795d94f | refs/heads/master | 2020-09-22T22:18:42.280252 | 2016-09-13T15:34:56 | 2016-09-13T15:34:56 | 65,943,715 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 545 | java | package com.actime.pageObjectRepositoryLib;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import com.acttime.genericLib.WebDriverCommonLib;
public class TimeTrack extends WebDriverCommonLib{
@FindBy(xpath="//div[text()='Users']")
private WebElement userLnk;
@FindBy(xpath="//div[text()='Reports']")
private WebElement reportLnk;
public void navigateToUSerPage(){
userLnk.click();
waitForPageToLoad();
}
public void navigateToReportPage(){
waitForPageToLoad();
}
}
| [
"SIBU@192.168.2.7"
] | SIBU@192.168.2.7 |
44eea28cf5c8f290116b1f58abf361a9907eb766 | 38081f2eaf022ccc62b99bd8c0fa99eda7aae16f | /src/main/java/com/toledo/wallet/business/exceptions/WalletAcessByNotOwnerException.java | 6a14ee8e74b6e30eb843b3a52d0fa3ab9b1d9769 | [] | no_license | mateushtoledo/wallet | 8a85b3a6f43529f4f1ea1be40150904c0b52b531 | 58e9d3a272e434361d7c684a7a7005aac640c8f1 | refs/heads/master | 2021-01-16T09:10:03.918916 | 2020-03-06T01:57:53 | 2020-03-06T01:57:53 | 243,054,743 | 0 | 0 | null | 2020-03-04T03:01:37 | 2020-02-25T17:11:46 | Java | UTF-8 | Java | false | false | 278 | java | package com.toledo.wallet.business.exceptions;
public class WalletAcessByNotOwnerException extends RuntimeException {
private static final long serialVersionUID = -636365455365989561L;
public WalletAcessByNotOwnerException(String errorMessage) {
super(errorMessage);
}
}
| [
"mateushtoledo@gmail.com"
] | mateushtoledo@gmail.com |
b60f5b90f3ddb431c74124d7cc41ec1ead1edfeb | 8d36eb5d71a8860c234391fd0db887617668c748 | /collecat-manager/src/main/java/com/sf/collecat/manager/util/Validator.java | 89272f16cb0d3d14fcf0567c036cb7b2dd150a01 | [] | no_license | HashZhang/collecat | b0431081acab86104cffb2b4dddbdb02e3c92853 | 3385839d780ec59cea7ef1dae6a6f601e3355be3 | refs/heads/master | 2021-01-17T18:35:52.527258 | 2016-08-03T09:57:30 | 2016-08-03T09:57:30 | 62,217,570 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,093 | java | package com.sf.collecat.manager.util;
import com.alibaba.druid.sql.ast.SQLStatement;
import com.alibaba.druid.sql.dialect.mysql.parser.MySqlStatementParser;
import com.alibaba.druid.sql.dialect.mysql.visitor.MySqlSchemaStatVisitor;
import com.alibaba.druid.stat.TableStat;
import com.sf.collecat.common.model.Job;
import com.sf.collecat.common.model.Task;
import com.sf.collecat.common.utils.StrUtils;
import com.sf.collecat.manager.exception.validate.ValidateJDBCException;
import com.sf.collecat.manager.exception.validate.ValidateKafkaException;
import com.sf.collecat.manager.exception.validate.ValidateSQLException;
import com.sf.collecat.manager.sql.SQLParser;
import com.sf.kafka.api.produce.ProduceConfig;
import com.sf.kafka.api.produce.ProducerPool;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.sql.*;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
/**
* Created by 862911 on 2016/6/25.
*/
@Component
public class Validator {
@Autowired
private SQLParser sqlParser;
/**
* 验证SQL语句是否有问题
*
* @param task
* @return
* @throws SQLSyntaxErrorException
*/
public String validateSQL(Task task) throws ValidateSQLException {
MySqlStatementParser parser = new MySqlStatementParser(task.getInitialSql());
MySqlSchemaStatVisitor visitor = null;
try {
SQLStatement statement = parser.parseStatement();
visitor = new MySqlSchemaStatVisitor();
statement.accept(visitor);
} catch (Exception e) {
throw new ValidateSQLException("SQLSyntaxException!");
}
String table = null;
if (visitor.getTables().keySet().size() > 1) {
throw new ValidateSQLException("tables in select sql cannot be larger than 1!");
}
for (TableStat.Name tableStat : visitor.getTables().keySet()) {
table = tableStat.getName().toUpperCase();
}
return table;
}
public boolean validateKafKaConnection(Task task) throws ValidateKafkaException {
ProducerPool kafkaProducer = null;
try {
ProduceConfig produceConfig = new ProduceConfig(10, task.getKafkaUrl(), task.getKafkaClusterName(), task.getKafkaTopicTokens());
kafkaProducer = new ProducerPool(produceConfig);
} catch (Exception e) {
throw new ValidateKafkaException(e);
} finally {
if (kafkaProducer != null) {
kafkaProducer.close();
}
}
return true;
}
public boolean validateJDBCConnections(Task task) throws SQLException, ClassNotFoundException, ValidateJDBCException {
Class.forName("com.mysql.jdbc.Driver");
Set<String> stringSet = new HashSet<>();
List<Job> jobs = sqlParser.parse(task, new Date(task.getStartTime().getTime() + 1000));
for (Job job : jobs) {
Connection conn = null;
try {
if (stringSet.contains(job.getMysqlUrl() + job.getMysqlUsername() + job.getMysqlPassword())) {
continue;
}
stringSet.add(job.getMysqlUrl() + job.getMysqlUsername() + job.getMysqlPassword());
System.out.println("Validating:" + job.getMysqlUrl());
conn = DriverManager.getConnection(job.getMysqlUrl(), job.getMysqlUsername(), job.getMysqlPassword());
Statement stmt = conn.createStatement();
String table = validateSQL(task);
String sql = StrUtils.makeString("select * from ",table," limit 1");
stmt.execute(sql);
} catch (Exception e) {
throw new ValidateJDBCException(e);
} finally {
if (conn != null) {
conn.close();
}
}
}
return true;
}
}
| [
"zhanggaoxin@sf-express.com"
] | zhanggaoxin@sf-express.com |
046693f9099767c48c58244ac5df9834876844af | 2397102ea5b2a891f63692fb97ab72e0e7fe8a1b | /app/src/main/java/com/bnb/binh/skyintertainment/models/MSG1.java | 59a3768feff0658f38fd3a54c709169e0651ebbc | [] | no_license | bnbbinh1993/BB1 | 9e4dee6c905e32013f7a79fbe60596a650d6267c | 4127afa9dd55185757732ca512dba371a28c0802 | refs/heads/master | 2022-12-19T05:32:36.620452 | 2020-09-24T03:52:47 | 2020-09-24T03:52:47 | 266,488,112 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 355 | java | package com.bnb.binh.skyintertainment.models;
public class MSG1 {
private String nameMSG1;
public MSG1() {
}
public MSG1(String nameMSG1) {
this.nameMSG1 = nameMSG1;
}
public String getNameMSG1() {
return nameMSG1;
}
public void setNameMSG1(String nameMSG1) {
this.nameMSG1 = nameMSG1;
}
}
| [
"bnbbinh@gmail.com"
] | bnbbinh@gmail.com |
8756a609b8af5a5a8b350a3adfd5be970ac025a6 | 610affb288874d4984daccb309dd1696ada139e3 | /src/main/java/com/terasoft/myprayer/controller/PedidoController.java | 4df1685c0fb4e74eb0aaad212a05dc12b619ff1c | [] | no_license | DEVTIRIA/proyectoFinal | 1beb55f8b9942c42fe71e97437da9ccdaca77027 | f0f1f95f2a9277adafe83295a9cc06c21d71bb41 | refs/heads/master | 2021-01-22T02:04:50.958267 | 2015-07-04T02:38:26 | 2015-07-04T02:38:26 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,242 | java | package com.terasoft.myprayer.controller;
import java.util.Date;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import com.terasoft.myprayer.repository.Pedido;
import com.terasoft.myprayer.service.PedidoService;
@Controller
public class PedidoController {
private PedidoService pedidoService;
@Autowired
public PedidoController(PedidoService pedidoService) {
this.pedidoService = pedidoService;
}
@RequestMapping("/")
public String index(Model model) {
return "pedido";
}
@RequestMapping("/Pedido")
public String pedirOracion(Model model, HttpServletRequest request) {
Pedido pedido = new Pedido();
pedido.setPedifech(new Date());
pedido.setPedinomb(request.getParameter("persnomb"));
pedido.setPeditext(request.getParameter("perstext"));
pedido.setPedisexo(request.getParameter("perssexo"));
pedido.setPedimoti( parseMotivos(request) );
Long id = pedidoService.agregar(pedido);
model.addAttribute("perscons", id);
return "pedido";
}
private String parseMotivos(HttpServletRequest request) {
String [] motis = { request.getParameter("persmoti1"),
request.getParameter("persmoti2"),
request.getParameter("persmoti3"),
request.getParameter("persmoti4"),
request.getParameter("persmoti5")
};
StringBuilder sb = new StringBuilder();
Boolean p = true;
for (String moti : motis) {
if (moti != null) {
sb.append( p ? "" : ", " );
sb.append(moti);
p = false;
}
}
return sb.toString();
}
@RequestMapping("/Resumen")
public String resumen(Model model) {
Map<String, Long> totales = pedidoService.getTotales();
model.addAllAttributes(totales);
/*
List<Object[]> listSexo = pedidoService.contarPorSexo();
for (Object[] reg : listSexo) {
model.addAttribute((String) reg[0], (Long) reg[1]);
}
List<Object[]> listMotivo = pedidoService.contarPorMotivo();
for (Object[] reg : listMotivo) {
model.addAttribute((String) reg[0], (Long) reg[1]);
}
*/
return "resumen";
}
}
| [
"billy_hetfield@hotmail.com"
] | billy_hetfield@hotmail.com |
9bf9649c6e7f1cecfac4d8f00ed141ce3a2abc32 | f867b699f961f2988a29b7ff22aa1c197e5dd1c0 | /src/edu/purdue/pivot/skwiki/shared/Diff.java | 68e0f55e19a8294d169debc8ad1ff66a697d69ed | [] | no_license | gangda003/skwiki | fd8b56fb9ca76908ed621de21748b6714ed390db | 46f31aaf96b00a521324f91328e5395f88e1497a | refs/heads/master | 2021-08-16T19:19:24.143678 | 2017-11-20T07:55:47 | 2017-11-20T07:55:47 | 111,364,432 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 330 | java | package edu.purdue.pivot.skwiki.shared;
import java.io.Serializable;
public class Diff implements Serializable{
/**
* @param args
*/
public int operation = 0;//= "";
public String text = "";
public Diff()
{
}
public Diff(int opertion, String text)
{
this.operation = opertion;
this.text = text;
}
}
| [
"zzpnm003@gmail.com"
] | zzpnm003@gmail.com |
0991506c7ff7903d4f2969d2e9b0469affdc8817 | 05922b98094e96b304ba4b2144caa416c989c946 | /17_02_2017/src/fr/addaming/cataloge/ImplementV2.java | dec20fbdf5fbaf8afb599fb5b3e40b22ca3b6448 | [] | no_license | nour-alsafadi/inti | 22134305268974faf39ec2a49f1ab8ed551710bd | c9f2c2ad82d3ca7891c911ba2ae85ad6e45b7864 | refs/heads/master | 2021-01-20T02:47:23.345747 | 2017-04-26T08:40:27 | 2017-04-26T08:40:27 | 89,455,165 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 647 | java | package fr.addaming.cataloge;
import java.util.*;
public class ImplementV2 extends implement implements InterfaceV2 {
private List<Client> TabClient =new ArrayList<Client>();
public List<Client> getTabClient() {
return TabClient;
}
public void setTabClient(List<Client> tabClient) {
TabClient = tabClient;
}
@Override
public Client addClient(Client client) {
TabClient.add(client);
System.out.println(TabClient);
return client;
}
@Override
public List<Client> printAllClient() {
System.out.println(TabClient);
return TabClient;
}
public ImplementV2() {
super();
}
}
| [
"noreply@github.com"
] | nour-alsafadi.noreply@github.com |
4ae3437202f609703f7b210496d5979e5dce9725 | cae9c594e7dc920d17363c5731700088d30ef969 | /src/interviewBit/math/Gcd.java | 26ced3fc0be2e77e5af639747af0baae52618d4d | [] | no_license | tech-interview-prep/technical-interview-preparation | a0dd552838305d6995bf9e7dfb90f4571e2e2025 | 8b299d3e282452789f05b8d08135b5ff66c7b890 | refs/heads/master | 2022-02-08T09:28:35.889755 | 2022-02-06T22:20:48 | 2022-02-06T22:20:48 | 77,586,682 | 6 | 3 | null | null | null | null | UTF-8 | Java | false | false | 458 | java | package interviewBit.math;
/**
* Problem statement
*
*
* Given 2 non negative integers m and n, find gcd(m, n)
GCD of 2 integers m and n is defined as the greatest integer g such that g is a divisor of both m and n.
Both m and n fit in a 32 bit signed integer.
Example
m : 6
n : 9
GCD(m, n) : 3
*/
public class Gcd {
public int gcd(int a, int b) {
if(b == 0){
return a;
}
return gcd(b, a%b);
}
}
| [
"bkoteshwarreddy+github@gmail.com"
] | bkoteshwarreddy+github@gmail.com |
e702812a9b401d11a8a00d6e9234cba245e75989 | 22daed84f3c484c4eabc0e10dcfd5470f8eaeb20 | /app/src/test/java/com/babyandi/stephnoutsa/babyandi/ExampleUnitTest.java | cb9a107d689a7851ad4cc943354a933c85bc4726 | [] | no_license | stephanenoutsa/motherslove | e48e16560f99a83b0eba5fc6dce87b8e0fe29993 | b7c08dd449328b646a42dbdee7fa104187072359 | refs/heads/master | 2020-04-06T07:02:05.101060 | 2016-08-23T10:30:18 | 2016-08-23T10:30:18 | 50,256,170 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 326 | java | package com.babyandi.stephnoutsa.babyandi;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* To work on unit tests, switch the Test Artifact in the Build Variants view.
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
} | [
"stephanenoutsa@yahoo.com"
] | stephanenoutsa@yahoo.com |
e0daf0f1b27b3cc62707a35150f3231b236c3f90 | c2cd5cf34c83d137a3a08f9cf65718d0c6d0bbae | /camel-cxf/.history/ccxf/src/main/java/org/cx/ProcessorBean_20190128204910.java | af488a3f67fb9147c795443c5fbfd16a328cb7ab | [] | no_license | avi5kdonrh/ForFuse | bf4b7e8d67dfc19e2e1e5123f9a62b48d07ecd5b | dfba68ef6b166aec9425d2a1ba8a3fcc535fb232 | refs/heads/master | 2023-04-29T17:16:19.662030 | 2022-06-21T03:11:50 | 2022-06-21T03:11:50 | 162,456,808 | 0 | 0 | null | 2023-04-14T19:31:16 | 2018-12-19T15:31:21 | Java | UTF-8 | Java | false | false | 817 | java | package org.cx;
import java.io.ByteArrayInputStream;
import javax.xml.bind.JAXBContext;
import javax.xml.soap.MessageFactory;
import javax.xml.soap.SOAPMessage;
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
public class ProcessorBean implements Processor {
@Override
public void process(Exchange exchange) throws Exception {
String string = new String("Message Body");
SOAPMessage soapMessage = MessageFactory.newInstance().createMessage(null,
new ByteArrayInputStream(string.getBytes()));
JAXBContext context = JAXBContext.newInstance(soapMessage.getClass());
context.createMarshaller().marshal(soapMessage, System.out);
System.out.println(soapMessage.getSOAPBody().);
exchange.getIn().setBody(soapMessage);
}
} | [
"avi5kdon@gmail.com"
] | avi5kdon@gmail.com |
b23b90530d9dd0373c149374c424ec5d23872fa9 | 07abcad3885092aef8abe76e0d78c2296d7fcd1b | /twoFactorClient/src/ext/org/openTwoFactor/clientExt/com/thoughtworks/xstream/converters/basic/AbstractSingleValueConverter.java | 48c6615efecb366515ff1fa6cd979f73b415da93 | [] | no_license | mchyzer/openTwoFactor | df3acfc07f2f385999bd081eeaf2bfc937ee8ff0 | 6a62b59d176b13a1bc51a0b60a258cef7ea1012c | refs/heads/master | 2023-08-28T19:06:16.817966 | 2023-08-14T17:30:34 | 2023-08-14T17:30:34 | 10,210,206 | 2 | 2 | null | 2021-06-04T01:00:06 | 2013-05-22T02:42:06 | JavaScript | UTF-8 | Java | false | false | 1,949 | java | /*******************************************************************************
* Copyright 2012 Internet2
*
* 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.
******************************************************************************/
/*
* Copyright (C) 2006, 2007 XStream Committers.
* All rights reserved.
*
* The software in this package is published under the terms of the BSD
* style license a copy of which has been included with this distribution in
* the LICENSE.txt file.
*
* Created on 15. February 2006 by Mauro Talevi
*/
package org.openTwoFactor.clientExt.com.thoughtworks.xstream.converters.basic;
import org.openTwoFactor.clientExt.com.thoughtworks.xstream.converters.SingleValueConverter;
/**
* Base abstract implementation of {@link org.openTwoFactor.clientExt.com.thoughtworks.xstream.converters.SingleValueConverter}.
* <p/>
* <p>Subclasses should implement methods canConvert(Class) and fromString(String) for the conversion.</p>
*
* @author Joe Walnes
* @author Jörg Schaible
* @author Mauro Talevi
* @see org.openTwoFactor.clientExt.com.thoughtworks.xstream.converters.SingleValueConverter
*/
public abstract class AbstractSingleValueConverter implements SingleValueConverter {
public abstract boolean canConvert(Class type);
public String toString(Object obj) {
return obj == null ? null : obj.toString();
}
public abstract Object fromString(String str);
}
| [
"mchyzer@yahoo.com"
] | mchyzer@yahoo.com |
a80e64c1ec7cc2d9bd7b084fa11d740bfab5be52 | d9dd5b57915250d19173781117ec182cc95b2be4 | /chatbot/core/rasaframework/src/main/java/br/com/rasaframework/incoming/model/Intent.java | 04ee4fccb59469eb092f75c5b0998f95e3d8560f | [] | no_license | hopeforge/Harold_donateislife | 362ddf8bf23a448cb822bd820ca2baa15f4bb75a | 8c826eef5d1508bece2c379e885ac345130bc4b6 | refs/heads/master | 2022-12-09T18:42:45.893404 | 2019-12-27T18:26:47 | 2019-12-27T18:26:47 | 230,484,552 | 0 | 0 | null | 2022-12-08T23:49:02 | 2019-12-27T17:20:20 | TypeScript | UTF-8 | Java | false | false | 370 | java | package br.com.rasaframework.incoming.model;
public class Intent {
private String confidence;
private String name;
public String getConfidence() {
return confidence;
}
public void setConfidence(String confidence) {
this.confidence = confidence;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
| [
"hlimam@indracompany.com"
] | hlimam@indracompany.com |
877f29ad1eadc714a1c9f45f46fb4305c19dd3d9 | c6e578b5f536c2e25b7befd44197d60a6627d45c | /src/test/java/com/nutanix/deployer/AppTest.java | 574c65982aa974f9bd1693d72d35b67a00987d89 | [] | no_license | amareshdwivedi/deployer | 5a9d43cc575ff210e4efa1bf85c9ea53c6b4418b | e49a7dc0dc7b2af393bc06f2bbb942429b1f254c | refs/heads/master | 2016-09-09T19:51:20.480314 | 2015-04-20T07:36:59 | 2015-04-20T07:36:59 | 34,111,602 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 648 | java | package com.nutanix.deployer;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
/**
* Unit test for simple App.
*/
public class AppTest
extends TestCase
{
/**
* Create the test case
*
* @param testName name of the test case
*/
public AppTest( String testName )
{
super( testName );
}
/**
* @return the suite of tests being tested
*/
public static Test suite()
{
return new TestSuite( AppTest.class );
}
/**
* Rigourous Test :-)
*/
public void testApp()
{
assertTrue( true );
}
}
| [
"amaresh.dwivedi@nutanix.com"
] | amaresh.dwivedi@nutanix.com |
92dba5de3ba1653250d47d7d5493cb38a8481096 | 3a3ce8626c89a5807781a7e92d61463811fb1e76 | /antread-framework/src/main/java/com/antread/bdp/framework/dto/ResultDto.java | 37e531e334e2de7d8488f126550080d1a02bdc26 | [
"Apache-2.0"
] | permissive | iarwen/antread | aedb3fabca063949925e9963f8b7da0f33f8539b | 3d78dbf577358be127bc57ef46749a569a6951b3 | refs/heads/master | 2022-11-22T08:40:39.107030 | 2022-11-15T04:11:21 | 2022-11-15T04:11:21 | 71,334,472 | 0 | 0 | Apache-2.0 | 2022-11-15T04:12:41 | 2016-10-19T08:17:31 | Java | UTF-8 | Java | false | false | 1,194 | java | package com.antread.bdp.framework.dto;
/**
* 请调用结果返回
*
* @author wentao_chang
*
*/
public class ResultDto {
private boolean success = true;
private String msg;
private int errorCode = -1;
private Object userObject;
private long timestamp = System.currentTimeMillis();
public ResultDto() {
}
public ResultDto(boolean success) {
this.success = success;
}
public ResultDto(boolean success, String msg) {
this.success = success;
this.msg = msg;
}
public boolean isSuccess() {
return success;
}
public void setSuccess(boolean success) {
this.success = success;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public Object getUserObject() {
return userObject;
}
public void setUserObject(Object userObject) {
this.userObject = userObject;
}
public int getErrorCode() {
return errorCode;
}
public void setErrorCode(int errorCode) {
this.errorCode = errorCode;
}
public long getTimestamp() {
return timestamp;
}
public void setTimestamp(long timestamp) {
this.timestamp = timestamp;
}
}
| [
"wentao.chang@pactera.com"
] | wentao.chang@pactera.com |
fed4e6b5d877051411fc545ad9094a1968e05f41 | f2ecba7203c77980bf43cb6aa22cd87297c6dbe5 | /modules/commerce-training-car-garage-service/src/main/java/commerce/training/car/garage/service/impl/CarGarageLocalServiceImpl.java | d967532e153d8ada23448422e69211ea874423e3 | [] | no_license | stefanopuzzuoli-lr/commerce-gs-training | 33f5a41c02a737e0854293a0b509fd780b2cc201 | 76fd2716b118b7316b44f5faddaaccc3e96d174f | refs/heads/master | 2021-05-20T19:58:56.170351 | 2020-06-11T12:40:41 | 2020-06-11T12:40:41 | 252,399,176 | 0 | 0 | null | 2020-04-02T08:33:59 | 2020-04-02T08:33:58 | null | UTF-8 | Java | false | false | 4,332 | java | /**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library 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 Lesser General Public License for more
* details.
*/
package commerce.training.car.garage.service.impl;
import com.liferay.portal.kernel.exception.PortalException;
import com.liferay.portal.kernel.model.User;
import com.liferay.portal.kernel.service.ServiceContext;
import com.liferay.portal.kernel.util.Validator;
import java.util.Date;
import commerce.training.car.garage.exception.CarGarageCPDefinitionIdException;
import commerce.training.car.garage.exception.CarGarageLatitudeException;
import commerce.training.car.garage.exception.CarGarageLongitudeException;
import commerce.training.car.garage.exception.NoSuchCarGarageException;
import commerce.training.car.garage.model.CarGarage;
import commerce.training.car.garage.service.base.CarGarageLocalServiceBaseImpl;
/**
* The implementation of the car garage local service. <p> All custom service
* methods should be put in this class. Whenever methods are added, rerun
* ServiceBuilder to copy their definitions into the
* <code>commerce.training.car.garage.service.CarGarageLocalService</code>
* interface. <p> This is a local service. Methods of this service will not have
* security checks based on the propagated JAAS credentials because this service
* can only be accessed from within the same VM. </p>
*
* @author Gavin Hinfey
* @see CarGarageLocalServiceBaseImpl
*/
public class CarGarageLocalServiceImpl extends CarGarageLocalServiceBaseImpl {
/*
* NOTE FOR DEVELOPERS: Never reference this class directly. Use
* <code>commerce.training.car.garage.service.CarGarageLocalService</code>
* via injection or a <code>org.osgi.util.tracker.ServiceTracker</code> or
* use
* <code>commerce.training.car.garage.service.CarGarageLocalServiceUtil</
* code>.
*/
/**
* Creates a new CarGarage. CarGarage is a stores data for the commerce
* product type Car Service.
*
* @author Gavin Hinfey
* @param latitude
* @param longitude
* @param cpDefinitionId
* @param serviceContext
* @return CarGarage
* @exception PortalException
*/
@Override
public CarGarage addCarGarage(String title,
double latitude, double longitude, long cpDefinitionId,
ServiceContext serviceContext)
throws PortalException {
validate(latitude, longitude, cpDefinitionId);
CarGarage carGarage =
carGaragePersistence.create(counterLocalService.increment());
carGarage.setGroupId(serviceContext.getScopeGroupId());
User user = userLocalService.getUser(serviceContext.getUserId());
carGarage.setCompanyId(user.getCompanyId());
carGarage.setUserId(user.getUserId());
carGarage.setUserName(user.getScreenName());
carGarage.setCreateDate(new Date());
carGarage.setModifiedDate(new Date());
carGarage.setTitle(title);
carGarage.setLatitude(latitude);
carGarage.setLongitude(longitude);
carGarage.setCpDefinitionId(cpDefinitionId);
carGaragePersistence.update(carGarage);
return carGarage;
}
@Override
public CarGarage findByPrimaryKey(long carGarageId)
throws NoSuchCarGarageException {
return carGaragePersistence.findByPrimaryKey(carGarageId);
}
@Override
public CarGarage fetchByCPDefinitionId(long cpDefinitionId) {
return carGaragePersistence.fetchByCPDefinitionId(cpDefinitionId);
}
@Override
public CarGarage findByCPDefinitionId(long cpDefinitionId)
throws NoSuchCarGarageException {
return carGaragePersistence.findByCPDefinitionId(cpDefinitionId);
}
protected void validate(
double latitude, double longitude, long cpDefinitionId)
throws PortalException {
if (Validator.isNull(latitude)) {
throw new CarGarageLatitudeException();
}
if (Validator.isNull(longitude)) {
throw new CarGarageLongitudeException();
}
if (Validator.isNull(cpDefinitionId)) {
throw new CarGarageCPDefinitionIdException();
}
}
}
| [
"filipe.afonso@liferay.com"
] | filipe.afonso@liferay.com |
b39324381392c0246a848ac48f840ef391139d3a | 2133406379422aa1793a2cf8d9b4c9d143fb2079 | /SimpleORMFramework/src/main/java/sk/midnightnoon/simpleormframework/anotacie/Stlpec.java | 1bef4eef560aaff9f6e3fcf756f6c224a4d5c4f5 | [
"MIT"
] | permissive | M4t2h3w/Learn2Code | c0a4af8c00cf0d50af11f42b24297a5ed9445416 | 6b06e32d745cc7dc5d6ee1bb91100b116b8a75ec | refs/heads/master | 2023-01-31T03:34:04.437308 | 2020-12-14T16:37:24 | 2020-12-14T16:37:24 | 321,406,141 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 328 | java | package sk.midnightnoon.simpleormframework.anotacie;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
public @interface Stlpec {
String value();
}
| [
"matt.novotny25@gmail.com"
] | matt.novotny25@gmail.com |
643db209d579ce77fe33316edc918c43f111dbfe | e37e2341c64ae08f1cde06b5a978dfb6969d2d7e | /seleniumlearning/src/test/java/TESTNG/PrioryPgm2.java | ff5b6a323189ad3877b9e853df0112445a1c2cd4 | [] | no_license | soumyaMD/program1 | 87aa1b397a025afba6042ac05d85f1e52415a3da | dc65eea42d5e2950f6e866ce6381922309f11238 | refs/heads/master | 2023-05-12T22:26:36.202684 | 2020-02-04T10:52:19 | 2020-02-04T10:52:19 | 238,183,680 | 0 | 0 | null | 2023-05-01T20:27:37 | 2020-02-04T10:50:47 | HTML | UTF-8 | Java | false | false | 341 | java | package TESTNG;
import org.testng.annotations.Test;
public class PrioryPgm2 {
@Test(priority=1)
public void c_test()
{
System.out.println("Inside test C");
}
@Test(priority=10)
public void a_test()
{
System.out.println("Inside test A");
}
@Test(priority=2)
public void b_test()
{
System.out.println("Inside test B");
}
}
| [
"Training_b6b.01.07@BDC6-DX-840RX52.dir.svc.accenture.com"
] | Training_b6b.01.07@BDC6-DX-840RX52.dir.svc.accenture.com |
7c5a9a8eb201e12367b6f82a289939fec81ea5af | 5f3685144511fa7eea5d1df9b765f2dabb8ce969 | /app/src/main/java/com/christzhang/fragment/Fragment_showspage.java | 95f56b3335919b3ad3d830e8b26ed57498f623ff | [] | no_license | Nightstars/Smartvideo | 3b578777368fd44cd2b4fa00d28d7a78ff03097f | 87e7e0369e6fc6c5d78424237fc3c259b3622c58 | refs/heads/master | 2020-11-27T02:56:38.949149 | 2020-03-15T11:51:02 | 2020-03-15T11:51:02 | 229,279,246 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,089 | java | package com.christzhang.fragment;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.GridView;
import android.widget.SimpleAdapter;
import com.christzhang.bean.Resources;
import com.christzhang.player.PlayerActivity;
import com.christzhang.smartvideo.R;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 综艺页面
*/
public class Fragment_showspage extends Fragment {
private GridView gridView_shows;
private List<Map<String,Object>> datalist;
private int[] icon={R.drawable.sh1,R.drawable.sh2,R.drawable.sh3,R.drawable.sh4,R.drawable.sh5,R.drawable.sh6,R.drawable.sh7,R.drawable.sh8,R.drawable.sh9,R.drawable.xgdmx,R.drawable.xgdmx,R.drawable.xgdmx,R.drawable.xgdmx,R.drawable.xgdmx,R.drawable.xgdmx,R.drawable.xgdmx,R.drawable.xgdmx,R.drawable.xgdmx,R.drawable.xgdmx,R.drawable.xgdmx,R.drawable.xgdmx,R.drawable.xgdmx,R.drawable.xgdmx,R.drawable.xgdmx};
private String[] iconName={"这!就是街舞","少年可期","向往的生活","忘不了餐厅","密室大逃脱","极限挑战 ","创造营2019","奇遇人生","声入人心","雪怪大冒险","雪怪大冒险","雪怪大冒险","雪怪大冒险","雪怪大冒险","雪怪大冒险","雪怪大冒险","雪怪大冒险","雪怪大冒险","雪怪大冒险","雪怪大冒险","雪怪大冒险","雪怪大冒险","雪怪大冒险","雪怪大冒险"};
final Resources mVideoRes = new Resources();
private SimpleAdapter simpleAdapter;
public Fragment_showspage() {
// Required empty public constructor
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_showspage, container, false);
}
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
mVideoRes.setTitle("雪怪大冒险");
mVideoRes.setLink("rtmp://www.smartvideoplayer.ml:8999/vod/xueguaidamaoxian.mp4");
mVideoRes.setDescription("《雪怪大冒险》是一部囊括巨星阵容及美妙原创音乐的全年龄段冒险动画片。当一只年轻活泼的雪人发现了之前本认为不存在的人类," +
"大脚怪传奇自此乱了套。 影片讲述了一个关乎友情、勇气与探索之趣的动人故事。关于人类这个“小脚怪”的消息让原本单纯的雪人族群陷入了骚乱之中," +
"他们开始好奇,在雪村之外,究竟存在着一个怎样的世界?");
gridView_shows=(GridView)getActivity().findViewById(R.id.gridview_showspage);
datalist=new ArrayList<Map<String, Object>>();
simpleAdapter=new SimpleAdapter(getActivity(),getData(),R.layout.fragment_home_gridview_item,new String[]{"img","text"},new int[]{R.id.img,R.id.text_icon});
gridView_shows.setAdapter(simpleAdapter);
gridView_shows.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
Intent intent=new Intent(getActivity(), PlayerActivity.class);
intent.putExtra("videoType", 0);
intent.putExtra("video", mVideoRes);
startActivity(intent);
}
});
}
private List<Map<String,Object>> getData(){
for(int i=0;i<icon.length;i++)
{
Map<String,Object>map=new HashMap<String, Object>();
map.put("img",icon[i]);
map.put("text",iconName[i]);
datalist.add(map);
}
return datalist;
}
}
| [
"christzhangowner@gmail.com"
] | christzhangowner@gmail.com |
8c9736bc37413fb57ff24356d46856e8ec5d08e5 | 4730039783547dc02dca9b50e791fc91f3998f16 | /src/com/controller/deleteUserController.java | cc24f05ee67b1e58ee8ae32aa2ac8ac2fa5a050f | [] | no_license | pearlcrum/SupplementsWeb_JSP-Servlet | c5ea08f349c2a2eddc3dc51c924027b374f2d338 | fcaba50bc6ac709751c48c35924e9f9c70ba613d | refs/heads/main | 2023-09-04T01:57:04.362197 | 2021-11-03T13:11:02 | 2021-11-03T13:11:02 | 413,633,069 | 0 | 4 | null | null | null | null | UTF-8 | Java | false | false | 1,232 | java | package com.controller;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import com.biz.BbsCommentBiz;
import com.biz.UserBiz;
@WebServlet("/deleteUser")
public class deleteUserController extends HttpServlet {
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String no=(String)(request.getParameter("userID"));
UserBiz biz=new UserBiz();
System.out.println(no);
int res=biz.deleteUser(no);
System.out.println(res);
if(res>0) {
PrintWriter script = response.getWriter();
HttpSession session=request.getSession(true);
session.removeAttribute("userID");//세션 삭제
script.println("<script>");
script.println("location.href = 'main.jsp'");
script.println("</script>");
}
}
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
doGet(req,resp);
}
}
| [
"noreply@github.com"
] | pearlcrum.noreply@github.com |
f191ac0945ced08455b9ae544952f807a64afea9 | 20a5cad62642d85771e851a03c83ddfb3289a170 | /Assignment-2/Ritesh-Manish/testcase2.java | fcae7b678bdcc2a5cc82c8308ba2bd1d5980e33c | [] | no_license | IEEE-NITK/DBMS-CC-SP-17 | 19709c5425a3310e39fe703009cbaab98741487d | bcab8b3703895c7e789a07e3c4733bcbd1cf12e5 | refs/heads/master | 2021-01-20T05:33:49.979228 | 2017-07-28T03:55:48 | 2017-07-28T03:55:48 | 89,792,202 | 2 | 15 | null | 2017-06-10T23:57:28 | 2017-04-29T14:53:53 | Java | UTF-8 | Java | false | false | 1,038 | java | package ieee;
import static org.junit.Assert.*;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import org.junit.Test;
public class testcase2 {
@Test
public void test() throws FileNotFoundException, IOException {
ArrayList<studentRecordTestDrive> student = new ArrayList<studentRecordTestDrive>();
String csvFile = "data.csv";
String line = "";
String csvSeparator = ",";
try (BufferedReader br = new BufferedReader(new FileReader(csvFile))) {
while ((line = br.readLine()) != null) {
studentRecordTestDrive a = new studentRecordTestDrive();
String[] st = line.split(csvSeparator);
a.name = st[0];
a.rollNumber = st[1];
a.Class = st[2];
a.dateOfBirth = st[3];
a.contact = st[4];
student.add(a);
}
}
studentRecordTestDrive a=new studentRecordTestDrive();
a = student.get(12).search(student.get(12).rollNumber, "872532");
assertEquals("Vashti Kinyon",a.name);
}
}
| [
"sbs.191197@gmail.com"
] | sbs.191197@gmail.com |
cb7be5c4e5bcf90e4dd79deb14b52221134dfa7b | d01e9ee14f71dca2348e68ea1933147faa023cad | /jvb/src/main/java/org/jitsi/videobridge/rest/root/colibri/mucclient/MucClient.java | c1b5b4899e03a4b7b65e777216cb88482e1df36f | [
"Apache-2.0"
] | permissive | tlu88/jitsi-videobridge | 756defff847b1f2d3221fd8f5c4d978ed87a1c45 | 970eb7e1c979abcbc705d212571eb58ac4a30876 | refs/heads/master | 2022-12-10T12:34:54.473939 | 2020-09-03T17:24:24 | 2020-09-03T17:24:24 | 292,719,718 | 1 | 0 | Apache-2.0 | 2020-09-04T01:35:33 | 2020-09-04T01:35:32 | null | UTF-8 | Java | false | false | 2,773 | java | /*
* Copyright @ 2018 - present 8x8, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jitsi.videobridge.rest.root.colibri.mucclient;
import org.jitsi.videobridge.rest.*;
import org.jitsi.videobridge.rest.annotations.*;
import org.jitsi.videobridge.xmpp.*;
import org.json.simple.*;
import org.json.simple.parser.*;
import javax.inject.*;
import javax.servlet.http.*;
import javax.ws.rs.*;
import javax.ws.rs.core.*;
/**
* Add or remove XMPP environments to which the bridge will connect
*/
@Path("/colibri/muc-client")
@EnabledByConfig(RestApis.COLIBRI)
public class MucClient
{
@Inject
protected ClientConnectionImplSupplier clientConnectionImplSupplier;
@Path("/add")
@POST
@Consumes(MediaType.APPLICATION_JSON)
public Response addMucClient(String requestBody) throws ParseException
{
//NOTE: unfortunately MucClientConfiguration is not a compliant bean (it doesn't have
// a no-arg ctor) so we can't parse the json directly into a MucClientConfiguration
// instance and just take that as an argument here, we have to read the json
// ourselves.
Object o = new JSONParser().parse(requestBody);
if (!(o instanceof JSONObject))
{
return Response.status(HttpServletResponse.SC_BAD_REQUEST).build();
}
ClientConnectionImpl clientConnection = clientConnectionImplSupplier.get();
if (clientConnection.addMucClient((JSONObject)o))
{
return Response.ok().build();
}
return Response.status(HttpServletResponse.SC_BAD_REQUEST).build();
}
@Path("/remove")
@POST
@Consumes(MediaType.APPLICATION_JSON)
public Response removeMucClient(String requestBody) throws ParseException
{
Object o = new JSONParser().parse(requestBody);
if (!(o instanceof JSONObject))
{
return Response.status(HttpServletResponse.SC_BAD_REQUEST).build();
}
ClientConnectionImpl clientConnection = clientConnectionImplSupplier.get();
if (clientConnection.removeMucClient((JSONObject)o))
{
return Response.ok().build();
}
return Response.status(HttpServletResponse.SC_BAD_REQUEST).build();
}
}
| [
"noreply@github.com"
] | tlu88.noreply@github.com |
4b87c9e159e65ce9181f53b8efbdde275fd5e214 | 38484e8c3bfe9b518198e254bb6a9501252b20a2 | /src/main/java/dto/OrderLineDTO.java | 5a6f6bd130fc992b03823d27e3ba22ea9182f8ac | [] | no_license | Joghur/jInnie | 903192bd150ed4f9739eb42f8cf657b3274e717c | 227324fc8ee09da471e1edfaa3c138beaa560e8c | refs/heads/master | 2022-06-28T00:20:25.867760 | 2020-03-08T09:56:17 | 2020-03-08T09:56:17 | 209,953,871 | 0 | 0 | null | 2022-06-21T01:54:50 | 2019-09-21T08:56:25 | Java | UTF-8 | Java | false | false | 1,043 | java | package dto;
import entities.OrderLine;
import entities.Ordrer;
import enumeration.OrderState;
import java.time.format.DateTimeFormatter;
import java.util.List;
/**
*
* @author martin
*/
public class OrderLineDTO {
private Integer orderLineID;
private Integer quantity;
private ItemTypeDTO itemtype;
public OrderLineDTO() {
}
public OrderLineDTO(OrderLine m) {
this.orderLineID = m.getOrderLineID();
this.quantity = m.getQuantity();
this.itemtype = new ItemTypeDTO(m.getItemType());
}
public Integer getOrderLineID() {
return orderLineID;
}
public void setOrderLineID(Integer orderLineID) {
this.orderLineID = orderLineID;
}
public Integer getQuantity() {
return quantity;
}
public void setQuantity(Integer quantity) {
this.quantity = quantity;
}
public ItemTypeDTO getItemtype() {
return itemtype;
}
public void setItemtype(ItemTypeDTO itemtype) {
this.itemtype = itemtype;
}
}
| [
"joghur@gmail.com"
] | joghur@gmail.com |
9a8d8ce89ff1183ba70f7a7f57629a85f6b33d12 | 7e9a26726031f2d949a550eaeca93d3f5a1824e2 | /Chap04/PutAsterisk1.java | b1ec664ea258729af0cabd591a50fd4e7202640e | [] | no_license | yossy-h/new-merkai-java | 8781ff8a91ca87c58fb497a0c1d7f4cc11f64e80 | 5bcfaa01f98cc9a5621106cba908ef41c6948c65 | refs/heads/master | 2020-12-30T04:52:23.218599 | 2020-02-07T11:36:08 | 2020-02-07T11:36:08 | 238,866,115 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 373 | java | // 読み込んだ個数だけ*を表示(その1)
import java.util.Scanner;
class PutAsterisk1 {
public static void main(String[] args) {
Scanner stdIn = new Scanner(System.in);
System.out.print("何個*を表示しますか:");
int n = stdIn.nextInt();
int i = 0;
while (i < n) {
System.out.print('*');
i++;
}
System.out.println();
}
}
| [
"noreply@github.com"
] | yossy-h.noreply@github.com |
fb4797d7928d694fb4215ab8c6cce46b65d2cae5 | db4cc30150345039e82f1b9355c902f2588817b3 | /app/src/main/java/com/example/avery/wordflip/CustomWordActivity.java | 817a3cdec542e1bc21b6b0fa88b32dd37e58b98c | [] | no_license | averypierce/WordFlip | a424df371a16390f95bad15d5c030b5a1ede2b3e | 78d999799ee85334f70c09e0fbddaa538d995049 | refs/heads/master | 2021-01-19T04:08:38.051648 | 2017-08-14T21:18:08 | 2017-08-14T21:18:08 | 57,464,940 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,844 | java | package com.example.avery.wordflip;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.EditText;
import android.widget.ListView;
import android.widget.TextView;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
public class CustomWordActivity extends AppCompatActivity {
//LIST OF ARRAY STRINGS WHICH WILL SERVE AS LIST ITEMS
ArrayList<String> listItems=new ArrayList<String>();
//DEFINING A STRING ADAPTER WHICH WILL HANDLE THE DATA OF THE LISTVIEW
ArrayAdapter<String> adapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_custom_word);
adapter = new ArrayAdapter<String>(this,
android.R.layout.simple_list_item_1,
listItems);
ListView lv = (ListView)findViewById(R.id.listView);
lv.setAdapter(adapter);
loadUserDict();
}
private void writeUserDict(String word){
String FILENAME = "user_dict";
FileOutputStream fos = null;
try {
fos = openFileOutput(FILENAME, Context.MODE_APPEND);
fos.write(word.getBytes());
fos.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
private void deleteDict(){
String FILENAME = "user_dict";
FileOutputStream fos = null;
try {
fos = openFileOutput(FILENAME, Context.MODE_PRIVATE);
//fos.write("".getBytes());
fos.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
private void loadUserDict(){
String FILENAME = "user_dict";
FileInputStream fis = null;
String line = null;
try {
fis = openFileInput(FILENAME);
BufferedReader reader = new BufferedReader(new InputStreamReader(fis));
if (fis!=null) {
while ((line = reader.readLine()) != null) {
adapter.add(line);
}
}
fis.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
//Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_instructions, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle item selection
switch (item.getItemId()) {
case R.id.resetDict:
deleteDict();
adapter.clear();
return true;
default:
return super.onOptionsItemSelected(item);
}
}
public void add(View view){
EditText newword = (EditText) findViewById(R.id.editText);
String s = newword.getText().toString().trim() + "\n";
adapter.add(s);
newword.setText("");
writeUserDict(s);
}
public void done(View view){
Intent intent = new Intent(this,InstructionsActivity.class);
startActivity(intent);
finish();
}
}
| [
"fredknex@gmail.com"
] | fredknex@gmail.com |
804e4b5e2b71558cde24a36b09ee303cea5b5624 | bf25d5feb4acd421f87774a5859b61b36d0ab22d | /code/demo2RefactoredNew/src/main/evosuite-tests/utils/ComparadorAutonomia_ESTest.java | 105cbf0ec9fb4656c39ed009804e868bad2df718 | [] | no_license | ricardomilhazes/SoftwareTesting | db0c8b227680ce4fa4e527462deb17c7d6d50961 | 0a9107da079e48c56acbbcf3d68392bf19b3e1c6 | refs/heads/master | 2023-03-22T23:28:12.780295 | 2020-01-20T16:46:15 | 2020-01-20T16:46:15 | 340,483,351 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,473 | java | /*
* This file was automatically generated by EvoSuite
* Thu Jan 16 19:50:44 GMT 2020
*/
package utils;
import org.junit.Test;
import static org.junit.Assert.*;
import static org.evosuite.runtime.EvoAssertions.*;
import carros.Coordinate;
import carros.Veiculo;
import java.util.LinkedList;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.junit.runner.RunWith;
import utils.ComparadorAutonomia;
import utils.ParDatas;
@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true, useJEE = true)
public class ComparadorAutonomia_ESTest extends utils.ComparadorAutonomia_ESTest_scaffolding {
@Test(timeout = 4000)
public void test0() throws Throwable {
ComparadorAutonomia comparadorAutonomia0 = new ComparadorAutonomia();
Veiculo veiculo0 = new Veiculo();
Coordinate coordinate0 = new Coordinate(0.0, 693.72496);
LinkedList<ParDatas> linkedList0 = new LinkedList<ParDatas>();
Veiculo veiculo1 = new Veiculo("", "", (String) null, 1, 693.72496, 693.72496, 1, coordinate0, true, 31, linkedList0);
int int0 = comparadorAutonomia0.compare(veiculo0, veiculo1);
assertEquals((-1), int0);
}
@Test(timeout = 4000)
public void test1() throws Throwable {
ComparadorAutonomia comparadorAutonomia0 = new ComparadorAutonomia();
// Undeclared exception!
try {
comparadorAutonomia0.compare((Veiculo) null, (Veiculo) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("utils.ComparadorAutonomia", e);
}
}
@Test(timeout = 4000)
public void test2() throws Throwable {
ComparadorAutonomia comparadorAutonomia0 = new ComparadorAutonomia();
Veiculo veiculo0 = new Veiculo();
Veiculo veiculo1 = new Veiculo(veiculo0);
veiculo1.setAutonomia((-1604));
int int0 = comparadorAutonomia0.compare(veiculo0, veiculo1);
assertEquals(1, int0);
}
@Test(timeout = 4000)
public void test3() throws Throwable {
ComparadorAutonomia comparadorAutonomia0 = new ComparadorAutonomia();
Veiculo veiculo0 = new Veiculo();
int int0 = comparadorAutonomia0.compare(veiculo0, veiculo0);
assertEquals((-1), int0);
}
}
| [
"rmilhazesveloso@gmail.com"
] | rmilhazesveloso@gmail.com |
c7f61c0e639e1fee198aa0975a7b62fd33c57ccf | 955db743426618d3d0efb3599936b7c5f8d1d11c | /src/java/filters/AdminFilter.java | 9d83ed5174a01e09de3118f0a1fd47018f08ddfa | [] | no_license | RedLegend/Inshal-Week08Lab | 3db3277e8cb9ac2622e4b62e467de73d18a6975d | 2282d269e3834879dbe323e20a665d2cb3a496be | refs/heads/master | 2021-04-19T04:49:23.495858 | 2020-04-06T20:32:52 | 2020-04-06T20:32:52 | 249,582,054 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,125 | 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 filters;
import java.io.IOException;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import models.Role;
import models.User;
import org.apache.jasper.tagplugins.jstl.core.Catch;
import services.UserService;
/**
*athunentication= Authn(validate identity)
* Authorization = Authz(check permissions or rights)
* @author 789439
*/
public class AdminFilter implements Filter {
private static final boolean debug = true;
// The filter configuration object we are associated with. If
// this value is null, this filter instance is not currently
// configured.
private FilterConfig filterConfig = null;
private static final int ROLE_ADMIN = 1;
public AdminFilter() {
}
private void doBeforeProcessing(ServletRequest request, ServletResponse response)
throws IOException, ServletException {
if (debug) {
log("AdminFilter:DoBeforeProcessing");
}
// Write code here to process the request and/or response before
// the rest of the filter chain is invoked.
// For example, a logging filter might log items on the request object,
// such as the parameters.
/*
for (Enumeration en = request.getParameterNames(); en.hasMoreElements(); ) {
String name = (String)en.nextElement();
String values[] = request.getParameterValues(name);
int n = values.length;
StringBuffer buf = new StringBuffer();
buf.append(name);
buf.append("=");
for(int i=0; i < n; i++) {
buf.append(values[i]);
if (i < n-1)
buf.append(",");
}
log(buf.toString());
}
*/
}
private void doAfterProcessing(ServletRequest request, ServletResponse response)
throws IOException, ServletException {
if (debug) {
log("AdminFilter:DoAfterProcessing");
}
// Write code here to process the request and/or response after
// the rest of the filter chain is invoked.
// For example, a logging filter might log the attributes on the
// request object after the request has been processed.
/*
for (Enumeration en = request.getAttributeNames(); en.hasMoreElements(); ) {
String name = (String)en.nextElement();
Object value = request.getAttribute(name);
log("attribute: " + name + "=" + value.toString());
}
*/
// For example, a filter might append something to the response.
/*
PrintWriter respOut = new PrintWriter(response.getWriter());
respOut.println("<P><B>This has been appended by an intrusive filter.</B>");
*/
}
/**
*
* @param request The servlet request we are processing
* @param response The servlet response we are creating
* @param chain The filter chain we are processing
*
* @exception IOException if an input/output error occurs
* @exception ServletException if a servlet error occurs
*/
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain)
throws IOException, ServletException {
HttpServletRequest r = (HttpServletRequest) request;
HttpSession session = r.getSession();
int id = (int) session.getAttribute("id");
if (id == ROLE_ADMIN) {
chain.doFilter(request, response);
} else {
// // they do not have a username in the sesion
// // so, send them to login page
HttpServletResponse resp = (HttpServletResponse) response;
resp.sendRedirect("home");
}
}
/**
* Return the filter configuration object for this filter.
*/
public FilterConfig getFilterConfig() {
return (this.filterConfig);
}
/**
* Set the filter configuration object for this filter.
*
* @param filterConfig The filter configuration object
*/
public void setFilterConfig(FilterConfig filterConfig) {
this.filterConfig = filterConfig;
}
/**
* Destroy method for this filter
*/
public void destroy() {
}
/**
* Init method for this filter
*/
public void init(FilterConfig filterConfig) {
this.filterConfig = filterConfig;
if (filterConfig != null) {
if (debug) {
log("AdminFilter:Initializing filter");
}
}
}
/**
* Return a String representation of this object.
*/
@Override
public String toString() {
if (filterConfig == null) {
return ("AdminFilter()");
}
StringBuffer sb = new StringBuffer("AdminFilter(");
sb.append(filterConfig);
sb.append(")");
return (sb.toString());
}
private void sendProcessingError(Throwable t, ServletResponse response) {
String stackTrace = getStackTrace(t);
if (stackTrace != null && !stackTrace.equals("")) {
try {
response.setContentType("text/html");
PrintStream ps = new PrintStream(response.getOutputStream());
PrintWriter pw = new PrintWriter(ps);
pw.print("<html>\n<head>\n<title>Error</title>\n</head>\n<body>\n"); //NOI18N
// PENDING! Localize this for next official release
pw.print("<h1>The resource did not process correctly</h1>\n<pre>\n");
pw.print(stackTrace);
pw.print("</pre></body>\n</html>"); //NOI18N
pw.close();
ps.close();
response.getOutputStream().close();
} catch (Exception ex) {
}
} else {
try {
PrintStream ps = new PrintStream(response.getOutputStream());
t.printStackTrace(ps);
ps.close();
response.getOutputStream().close();
} catch (Exception ex) {
}
}
}
public static String getStackTrace(Throwable t) {
String stackTrace = null;
try {
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
t.printStackTrace(pw);
pw.close();
sw.close();
stackTrace = sw.getBuffer().toString();
} catch (Exception ex) {
}
return stackTrace;
}
public void log(String msg) {
filterConfig.getServletContext().log(msg);
}
}
| [
"789439@SAIT219080IT.ACDM.DS.SAIT.CA"
] | 789439@SAIT219080IT.ACDM.DS.SAIT.CA |
4df6272c82325b39a0b583c90bd3fdfc9e7ae580 | 70b0b8ddf9cdabd98323ce84b4e62edb46034bd2 | /app/src/main/java/volkodav/ampilogova/darya/projecte_github/Implementacio.java | 9c9206dad16e2dbb602ded3feb1e78f9dd6b9081 | [] | no_license | iespaucasesnoves/base-de-dades-app-daryaav | aeb675390b08e21881df2b0bb22590c4b958c093 | 9b4513e0ff668f5b77b1acabcb42cfca3e741a57 | refs/heads/master | 2020-04-12T05:22:51.010843 | 2019-02-06T10:21:43 | 2019-02-06T10:21:43 | 162,324,953 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,132 | java | package volkodav.ampilogova.darya.projecte_github;
/* EN AQUESTA CLASSE IMPLEMENTAREM ELS MÈTODES NECESSARIS PER INTERACTUAR AMB LA BASE DE DADES
AMB LA CLASSE SQLiteDatabase */
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import java.util.ArrayList;
import java.util.List;
import static volkodav.ampilogova.darya.projecte_github.Controlador.COLUMN_NOMBODEGA;
public class Implementacio {
private SQLiteDatabase database;
// CLASSE DE AJUDA
private Controlador dbAjuda;
private String[] allColumnsVi = { Controlador.COLUMN_ID,Controlador.COLUMN_NOMVI,Controlador.COLUMN_ANADA,
Controlador.COLUMN_LLOC, Controlador.COLUMN_GRADUACIO,Controlador.COLUMN_DATA,
Controlador.COLUMN_COMENTARI,Controlador.COLUMN_IDBODEGA,
Controlador.COLUMN_IDDENOMINACIO,Controlador.COLUMN_PREU,
Controlador.COLUMN_VALOLFATIVA,Controlador.COLUMN_VALGUSTATIVA,
Controlador.COLUMN_VALVISUAL,Controlador.COLUMN_NOTA,Controlador.COLUMN_FOTO,
Controlador.COLUMN_TIPUS};
// CONSTRUCTOR
public Implementacio(Context context) {
dbAjuda = new Controlador(context);
}
public void open() {
database = dbAjuda.getWritableDatabase();
}
public void close() {
dbAjuda.close();
}
// CREAM UN VI NOU
public Vi crearVi(Vi vi) {
ContentValues values = new ContentValues();
values.put(Controlador.COLUMN_NOMVI, vi.getNomVi());
values.put(Controlador.COLUMN_ANADA, vi.getAnada());
values.put(Controlador.COLUMN_TIPUS, vi.getTipus());
values.put(Controlador.COLUMN_LLOC, vi.getLloc());
values.put(Controlador.COLUMN_GRADUACIO, vi.getGraduacio());
values.put(Controlador.COLUMN_DATA, String.valueOf(vi.getData()));
values.put(Controlador.COLUMN_COMENTARI, vi.getComentari());
values.put(Controlador.COLUMN_IDBODEGA, vi.getIdBodega());
values.put(Controlador.COLUMN_IDDENOMINACIO,vi.getIdDenominacio());
values.put(Controlador.COLUMN_PREU,vi.getPreu());
values.put(Controlador.COLUMN_VALOLFATIVA,vi.getValOlfativa());
values.put(Controlador.COLUMN_VALGUSTATIVA,vi.getValGustativa());
values.put(Controlador.COLUMN_VALVISUAL,vi.getValVisual());
values.put(Controlador.COLUMN_NOTA,vi.getNota() );
values.put(Controlador.COLUMN_FOTO,vi.getFoto() );
long insertId = database.insert(Controlador.TABLE_VI, null,values);
vi.setId(insertId);
return vi;
}
// ACTUALITZAR UN VI
public boolean actualitzarVi(Vi vi) {
ContentValues values = new ContentValues();
long id = vi.getId();
values.put(Controlador.COLUMN_NOMVI, vi.getNomVi());
values.put(Controlador.COLUMN_ANADA, vi.getAnada());
values.put(Controlador.COLUMN_LLOC, vi.getLloc());
values.put(Controlador.COLUMN_TIPUS, vi.getTipus());
values.put(Controlador.COLUMN_GRADUACIO, vi.getGraduacio());
values.put(Controlador.COLUMN_DATA, String.valueOf(vi.getData()));
values.put(Controlador.COLUMN_COMENTARI, vi.getComentari());
values.put(Controlador.COLUMN_IDBODEGA, vi.getIdBodega());
values.put(Controlador.COLUMN_IDDENOMINACIO,vi.getIdDenominacio());
values.put(Controlador.COLUMN_PREU,vi.getPreu());
values.put(Controlador.COLUMN_VALOLFATIVA,vi.getValOlfativa());
values.put(Controlador.COLUMN_VALGUSTATIVA,vi.getValGustativa());
values.put(Controlador.COLUMN_VALVISUAL,vi.getValVisual());
values.put(Controlador.COLUMN_NOTA,vi.getNota() );
values.put(Controlador.COLUMN_FOTO,vi.getFoto() );
return database.update(Controlador.TABLE_VI, values,Controlador.COLUMN_ID + "=" +
id, null) > 0;
}
// ESBORRAR UN VI
public void esborrarVi(Vi vi) {
long id = vi.getId();
database.delete(Controlador.TABLE_VI, Controlador.COLUMN_ID + " = " + id,
null);
}
// MÈTODE QUE ENS TORNA EL VI, A TRAVÉS DEL ID PASSAT PER PARÀMETRE
public Vi getVi(long id) {
Vi vi;
Cursor cursor = database.query(Controlador.TABLE_VI,
allColumnsVi, Controlador.COLUMN_ID + " = " + id, null,
null, null, null);
if (cursor.getCount()>0) {
cursor.moveToFirst();
vi = cursorToVi(cursor);
// SI EL ID ÉS IGUAL A -1, VOLDRÀ DIR QUE NO ES TROBA EL VI
} else { vi = new Vi(); }
cursor.close();
return vi;
}
// MÈTODE QUE ENS TORNARÀ LA LLISTA DE TOTS ELS VINS
public List<Vi> getAllVi() {
List<Vi> vins = new ArrayList<Vi>();
Cursor cursor = database.query(Controlador.TABLE_VI, allColumnsVi, null,
null, null, null, Controlador.COLUMN_DATA + " DESC");
cursor.moveToFirst();
while (!cursor.isAfterLast()) {
Vi vi = cursorToVi(cursor);
vins.add(vi);
cursor.moveToNext();
}
// ENS ASSEGUREM DE TANCAR EL CURSOR
cursor.close();
return vins;
}
private Vi cursorToVi(Cursor cursor) {
Vi v = new Vi();
v.setId(cursor.getLong(0));
v.setNomVi(cursor.getString(1));
v.setAnada(cursor.getString(2));
v.setLloc(cursor.getString(3));
v.setGraduacio(cursor.getString(4));
v.setData(cursor.getString(5));
v.setComentari(cursor.getString(6));
v.setIdBodega(cursor.getLong(7));
v.setIdBodega(cursor.getLong(8));
v.setPreu(cursor.getFloat(9));
v.setValOlfativa(cursor.getString(10));
v.setValGustativa(cursor.getString(11));
v.setValVisual(cursor.getString(12));
v.setNota(cursor.getInt(13));
v.setFoto(cursor.getString(14));
v.setTipus(cursor.getString(15));
return v;
}
// CREAM EL SEGÜENT MÈTODE PER A QUE ENS TORNI TOTS ELS TIPUS DE VINS
public List<String> getAllTipus() {
List<String> llista = new ArrayList<String>();
String[] tipus_columna = {Controlador.COLUMN_TIPUS};
Cursor cursor = database.query(Controlador.TABLE_TIPUS, tipus_columna , null,
null, null, null, Controlador.COLUMN_TIPUS + " ASC");
cursor.moveToFirst();
while (!cursor.isAfterLast()) {
String tipus = cursor.getString(0);
llista.add(tipus);
cursor.moveToNext();
}
// ENS ASSEGUREM DE TANCAR EL CURSOR
cursor.close();
return llista;
}
// EL MÈTODE SEGÜENT ENS TORNARÀ EL NOM DE LA BODEGA A TRAVÉS DEL ID PASSAT PER PARÀMETRE
public Bodega getBodega(long id) {
Bodega b;
Cursor cursor = database.query(Controlador.TABLE_BODEGA,
new String [] {Controlador.COLUMN__IDBODEGA,Controlador.COLUMN_NOMBODEGA},
Controlador.COLUMN__IDBODEGA + " = " + id, null, null,
null, null);
if (cursor.getCount()>0) {
cursor.moveToFirst();
b = cursorToBodega(cursor);
} else { b = new Bodega(); } // SI EL ID ÉS -1 ÉS QUE NO ES TROBA
cursor.close();
return b;
}
// AQUEST MÈTODE ENS CERCARÀ LA BODEGA A TRAVÉS DEL NOM
public long findInsertBodegaPerNom(String bod) {
Bodega b;
long id;
Cursor cursor = database.query(Controlador.TABLE_BODEGA,
new String [] {Controlador.COLUMN__IDBODEGA,Controlador.COLUMN_NOMBODEGA},
Controlador.COLUMN_NOMBODEGA + " = '" + bod +"'", null,
null, null, null);
if (cursor.getCount()>0) {
cursor.moveToFirst();
b = cursorToBodega(cursor);
id = b.getIdBodega();
} else { id = createBodegafromList(bod); } // SI EL ID ÉS -1 ÉS QUE NO ES TROBA
cursor.close();
return id;
}
private Bodega cursorToBodega(Cursor cursor) {
Bodega b = new Bodega();
b.setIdBodega(cursor.getLong(0));
b.setNomBodega(cursor.getString(1));
return b;
}
// CREA LA BODEGA NOVA DINS LA LLISTA
private long createBodegafromList(String nomBodega) {
ContentValues values = new ContentValues();
values.put(Controlador.COLUMN_NOMBODEGA, nomBodega);
long insertId = database.insert(Controlador.TABLE_BODEGA, null,values);
return insertId;
}
public List<String> getAllBodega() {
List<String> llista = new ArrayList<String>();
String[] tipus_columna = {Controlador.COLUMN_NOMBODEGA};
Cursor cursor = database.query(Controlador.TABLE_BODEGA, tipus_columna , null,
null, null, null, Controlador.COLUMN_NOMBODEGA + " ASC");
cursor.moveToFirst();
while (!cursor.isAfterLast()) {
String bodega = cursor.getString(0);
llista.add(bodega);
cursor.moveToNext();
}
// ENS ASSEGUREM DE TANCAR EL CURSOR
cursor.close();
return llista;
}
} | [
"36270322+daryaav@users.noreply.github.com"
] | 36270322+daryaav@users.noreply.github.com |
caebe556e76b69ec8580c9d4e368f80fd94fd1c1 | b2444a2c13dc22c18b2cf51746d3c456033bf744 | /java-utils/src/main/java/com/cds/utils/annotation/SuppressForbidden.java | 4b6dd27cb8ce5e8102dc778666200ef0debc5f6d | [] | no_license | anancds/javaUtils | 8c815746edf6d9e66de189ab2008d6150f9ade5b | 4d881969b3273ce2593f708531c27c9c2e347639 | refs/heads/master | 2021-01-19T05:38:54.406756 | 2017-09-08T02:42:51 | 2017-09-08T02:42:51 | 58,536,997 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 433 | java | package com.cds.utils.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Created by chendongsheng5 on 2017/4/8.
*/
@Retention(RetentionPolicy.CLASS)
@Target({ElementType.CONSTRUCTOR, ElementType.FIELD, ElementType.METHOD, ElementType.TYPE})
public @interface SuppressForbidden {
String reason();
}
| [
"anancds@163.com"
] | anancds@163.com |
1ebf444fc1c5cf6d2cd4fbab40c26518bd496bb1 | aae446f7bbc953c3280c95a3fdb1b0e69b56000a | /07-javaoopgame/src/interaction/game/Orc.java | 52b1cc64e5030a67cdd159e86c8f4616f53e3a6c | [] | no_license | Ryu-kwonhee/javabasic | 499ee2c0c4e86099ee0ce2c5cd48167c0c3b151e | 48645def241fdb7bd5a4510872edfd14b308d3e6 | refs/heads/master | 2023-07-13T04:24:39.518230 | 2021-08-15T00:59:16 | 2021-08-15T00:59:16 | 380,178,606 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 745 | java | package interaction.game;
public class Orc {
private int hp;
private int atk;
private int def;
public Orc() {
this.hp = 5;
this.atk = 3;
this.def = 0;
}
// 유저가 공격했을때 내부에서 호출된 doBattle은
// 유저공격력 uAtk을 받아서 자신의 체력을 그만큼 차감합니다.
// 단, 방어력 수치까지 고려해서 체력이 차감되며
// 자신의 체력이 0이 되는 즉시 죽었다는 메세지를 같이 남깁니다.
public void doBattle(int uAtk) {
this.hp = (this.hp + this.def) - uAtk;
if(this.hp <= 0) {
System.out.println("이 오크는 이미 죽었습니다.");
}
}
public int getAtk() {
return this.atk;
}
public int getHp() {
return this.hp;
}
}
| [
"wnsgkdl123@naver.com"
] | wnsgkdl123@naver.com |
7cbd5a3b2ce954799988cb11c721b3f4b8991a40 | 61e6ad23d096cb33672bc8aa753008bf2666dc9c | /019-spring-security-jwt/src/main/java/lt/prava/utils/JwtUtil.java | 046c5848ef9b4f2e72ad556366e1e0f589208aec | [] | no_license | pra-va/spring-homeworks | a15671bb6c51a5c052c5a34a68045bf6b90a0034 | b25522bcb7dfd3eca7947427b4540fcf8209649a | refs/heads/master | 2020-12-12T08:09:59.256074 | 2020-01-23T16:29:25 | 2020-01-23T16:29:25 | 234,084,454 | 0 | 0 | null | 2020-10-13T18:52:48 | 2020-01-15T13:16:26 | HTML | UTF-8 | Java | false | false | 1,745 | java | package lt.prava.utils;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.function.Function;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.stereotype.Service;
import io.jsonwebtoken.Claims;
import io.jsonwebtoken.Jwts;
import io.jsonwebtoken.SignatureAlgorithm;
@Service
public class JwtUtil {
private String SECRET_KEY = "secret";
public String extractUsername(String token) {
return extractClaim(token, Claims::getSubject);
}
public Date extractExpiration(String token) {
return extractClaim(token, Claims::getExpiration);
}
public <T> T extractClaim(String token, Function<Claims, T> claimsResolver) {
final Claims claims = extractAllClaims(token);
return claimsResolver.apply(claims);
}
private Claims extractAllClaims(String token) {
return Jwts.parser().setSigningKey(SECRET_KEY).parseClaimsJws(token).getBody();
}
private Boolean isTokenExpired(String token) {
return extractExpiration(token).before(new Date());
}
public String generateToken(UserDetails userDetails) {
Map<String, Object> claims = new HashMap<>();
return createToken(claims, userDetails.getUsername());
}
private String createToken(Map<String, Object> claims, String subject) {
return Jwts.builder().setClaims(claims).setSubject(subject).setIssuedAt(new Date(System.currentTimeMillis()))
.setExpiration(new Date(System.currentTimeMillis() + 1000 * 60 * 60 * 10))
.signWith(SignatureAlgorithm.HS256, SECRET_KEY).compact();
}
public Boolean validateToken(String token, UserDetails userDetails) {
final String username = extractUsername(token);
return (username.equals(userDetails.getUsername()) && !isTokenExpired(token));
}
}
| [
"varaneckas@gmail.com"
] | varaneckas@gmail.com |
78529f5af491feb2a61c9d3f57b261616f496815 | a36dce4b6042356475ae2e0f05475bd6aed4391b | /2005/julypersistence2EJB/ejbModule/com/hps/july/persistence2/OfficeMemoPosHome.java | 80ee6ee2ae64af973065bee60f162ea4bf61cdf2 | [] | no_license | ildar66/WSAD_NRI | b21dbee82de5d119b0a507654d269832f19378bb | 2a352f164c513967acf04d5e74f36167e836054f | refs/heads/master | 2020-12-02T23:59:09.795209 | 2017-07-01T09:25:27 | 2017-07-01T09:25:27 | 95,954,234 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 953 | java | package com.hps.july.persistence2;
/**
* This is a Home interface for the Entity Bean
*/
public interface OfficeMemoPosHome extends javax.ejb.EJBHome {
/**
*
* @return com.hps.july.persistence2.OfficeMemoPos
* @param argIdpos int
* @param argIdHeader int
* @exception String The exception description.
* @exception String The exception description.
*/
com.hps.july.persistence2.OfficeMemoPos create(int argIdpos, int argIdHeader) throws javax.ejb.CreateException, java.rmi.RemoteException;
/**
* findByPrimaryKey method comment
* @return com.hps.july.persistence2.OfficeMemoPos
* @param key com.hps.july.persistence2.OfficeMemoPosKey
* @exception java.rmi.RemoteException The exception description.
* @exception javax.ejb.FinderException The exception description.
*/
com.hps.july.persistence2.OfficeMemoPos findByPrimaryKey(com.hps.july.persistence2.OfficeMemoPosKey key) throws java.rmi.RemoteException, javax.ejb.FinderException;
}
| [
"ildar66@inbox.ru"
] | ildar66@inbox.ru |
4fcf3a75b3207a4ab0c36048cb6b213a89bf256c | 0c47277d8e5c01f34633d2d688a30bf6990a2cb9 | /model/src/main/java/io/syndesis/model/filter/ExpressionFilterStep.java | aa2202a9138f210c54e2da0beca78fa5a91da0bd | [
"Apache-2.0"
] | permissive | zregvart/syndesis-rest | b01decd175d897ed467a78554c6078e82492d760 | 7f48cca668241b62ee249bf3f238bec1c0ae804a | refs/heads/master | 2023-03-19T16:15:33.721110 | 2017-08-10T15:32:34 | 2017-08-10T15:32:34 | 86,368,698 | 0 | 0 | Apache-2.0 | 2021-03-11T14:08:15 | 2017-03-27T18:13:42 | Java | UTF-8 | Java | false | false | 1,510 | java | /*
* Copyright (C) 2016 Red Hat, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.syndesis.model.filter;
import java.util.Collections;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import org.immutables.value.Value;
@Value.Immutable
@JsonDeserialize(builder = ExpressionFilterStep.Builder.class)
@JsonIgnoreProperties({"stepKind", "filterExpression"})
public interface ExpressionFilterStep extends FilterStep {
String STEP_KIND = "filter";
/**
* Filter in the simple expression language. This can be overwritten, but fectched
* by default from the configured properties.
*/
default String getFilterExpression() {
return getConfiguredProperties().orElseGet(Collections::emptyMap).get("filter");
}
class Builder extends ImmutableExpressionFilterStep.Builder { }
@Override
default String getStepKind() {
return STEP_KIND;
}
}
| [
"roland@ro14nd.de"
] | roland@ro14nd.de |
b5af16edf8ca76fb37b8780c27d308f264d89a94 | 824523ed8711cada4df93d48e2651c049d6ed365 | /Entregable 5/src/ttps/spring/clasesDAOimp/FoodTruckDAOHibernateJPA.java | be616a11fe7c7f8a3d07815ad9e3157f55f215e5 | [] | no_license | JulioCesar1988/TallerDeJava2020TrabajoFinal | 2a614b110d359ff4b61c3c55b589ddcc21cdc57c | 90e3be9c1ec27eac248f5d504eb15b44fc6caed5 | refs/heads/master | 2023-03-04T21:59:57.953805 | 2021-02-19T21:56:35 | 2021-02-19T21:56:35 | 305,178,891 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,701 | java | package ttps.spring.clasesDAOimp;
import java.util.List;
import javax.persistence.NoResultException;
import javax.persistence.Query;
import org.springframework.stereotype.Repository;
import ttps.spring.model.FoodTruck;
import ttps.spring.model.Usuario;
import ttps.spring.interfacesDAO.FoodTruckDAO;
@Repository
public class FoodTruckDAOHibernateJPA extends GenericDAOHibernateJPA<FoodTruck> implements FoodTruckDAO {
public FoodTruckDAOHibernateJPA() {
super(FoodTruck.class);
}
@Override
public List<FoodTruck> getFoodTruck(long usuarioId) {
// TODO Auto-generated method stub
// TODO Auto-generated method stub
try {
Query consulta = this.getEntityManager().createQuery("select u from FoodTruck u ");
return (List<FoodTruck>) consulta.getSingleResult();
} catch (NoResultException e) {
return null;
}
}
@Override
public FoodTruck validarExistencia(String nombre) {
// TODO Auto-generated method stub
try {
Query consulta = this.getEntityManager().createQuery("select u from FoodTruck u where u.nombre =?1");
consulta.setParameter(1, nombre);
FoodTruck resultado = (FoodTruck) consulta.getSingleResult();
return resultado;
} catch (NoResultException e) {
return null;
}
}
@Override
public List<FoodTruck> recuperarTodosFoodtruck(long usuarioId ) {
try {
Query consulta = this.getEntityManager().createQuery("select u from FoodTruck u ");
//consulta.setParameter(1, usuarioId);
List<FoodTruck> resultado = (List<FoodTruck>) consulta.getResultList();
return resultado;
} catch (NoResultException e) {
return null;
}
}
} | [
"julio.contreras@fluxit.com.ar"
] | julio.contreras@fluxit.com.ar |
9a880a1418ddf7cca5a389a749b11eebea94613d | 75cd764739a399af6ea3bda47c9305a962fe8a57 | /jar-project/SkyworthLiveTv/app/src/main/java/skyworth/skyworthlivetv/osd/ui/menu/func/sound/SoundMenuFuncSet.java | 948b2a25e44dced5c6fef2c4b1347417a74dce7f | [] | no_license | changxiangzhong/oceanus | a6a2a8d7a84c1070cc2f00e6eb277aadf7511dbd | 92ec2d6e5a94159dae1ce7f1183dcc93dd85c7df | refs/heads/master | 2023-08-31T12:27:22.813420 | 2017-08-04T06:57:17 | 2017-08-04T06:57:17 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 16,752 | java | package skyworth.skyworthlivetv.osd.ui.menu.func.sound;
import android.content.Context;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import Oceanus.Tv.Service.PictureManager.PictureManager;
import Oceanus.Tv.Service.PictureManager.PictureManagerDefinitions.EN_PICTURE_MODE;
import Oceanus.Tv.Service.PictureManager.PictureMode;
import Oceanus.Tv.Service.SoundManager.SoundManager;
import Oceanus.Tv.Service.SoundManager.SoundManagerDefinitions.EN_SOUND_MODE;
import Oceanus.Tv.Service.SoundManager.SoundManagerDefinitions.EN_SOUND_MODE_FREQ_TYPE;
import Oceanus.Tv.Service.SoundManager.SoundManagerDefinitions.EN_SOUND_SPDIF_MODE;
import Oceanus.Tv.Service.SoundManager.SoundMode;
import Oceanus.Tv.Service.SoundManager.SoundSetting;
import skyworth.skyworthlivetv.osd.common.data.BooleanData;
import skyworth.skyworthlivetv.osd.common.data.EnumData;
import skyworth.skyworthlivetv.osd.common.data.RangeData;
import skyworth.skyworthlivetv.osd.common.data.SwitchData;
import skyworth.skyworthlivetv.osd.common.data.TypedData;
import skyworth.skyworthlivetv.osd.ui.menu.TVMENU_COMMAND;
import skyworth.skyworthlivetv.osd.ui.menu.base.MenuFuncSet;
import skyworth.skyworthlivetv.osd.ui.menu.base.MenuFunction;
/**
* Created by xeasy on 2017/5/3.
*/
public class SoundMenuFuncSet extends MenuFuncSet {
private SoundSetting currentSoundSetting = null;
@Override
public void init(Context context)
{
super.init(context);
currentSoundSetting = SoundManager.getInstance().getCurrentSoundSetting();
}
private MenuFunction getSoundModeSetting = new MenuFunction(
TVMENU_COMMAND.MENUCMD_GET_SOUND_MODE_SETTING.toString()) {
@Override
public TypedData get(String cmd, TypedData typedData) {
Map<EN_SOUND_MODE, SoundMode> supportSoundModes = SoundManager.getInstance().getSupportSoundModes();
EnumData ret = new EnumData();
List<String> enumList = new ArrayList<String>();
Iterator<Map.Entry<EN_SOUND_MODE, SoundMode>> iter = supportSoundModes.entrySet().iterator();
while (iter.hasNext())
{
Map.Entry entry = (Map.Entry) iter.next();
EN_SOUND_MODE enSoundMode = (EN_SOUND_MODE) entry.getKey();
enumList.add(enSoundMode.toString());
}
ret.setEnumList(enumList);
ret.setEnumCount(enumList.size());
EN_SOUND_MODE currentValue = currentSoundSetting.getSoundMode();
ret.setCurrent(currentValue.toString());
return ret;
}
@Override
public BooleanData set(String cmd, TypedData typedData) {
return BooleanData.TRUE;
}
};
private MenuFunction soundMode = new MenuFunction(
TVMENU_COMMAND.MENUCMD_SOUND_MODE.toString()) {
@Override
public TypedData get(String cmd, TypedData typedData) {
Map<EN_SOUND_MODE, SoundMode> supportSoundModes = SoundManager.getInstance().getSupportSoundModes();
EnumData ret = new EnumData();
List<String> enumList = new ArrayList<String>();
Iterator<Map.Entry<EN_SOUND_MODE, SoundMode>> iter = supportSoundModes.entrySet().iterator();
while (iter.hasNext())
{
Map.Entry entry = (Map.Entry) iter.next();
EN_SOUND_MODE enSoundMode = (EN_SOUND_MODE) entry.getKey();
enumList.add(enSoundMode.toString());
}
ret.setEnumList(enumList);
ret.setEnumCount(enumList.size());
EN_SOUND_MODE currentValue = currentSoundSetting.getSoundMode();
ret.setCurrent(currentValue.toString());
return ret;
}
@Override
public BooleanData set(String cmd, TypedData typedData) {
EnumData enumData = (EnumData)(typedData);
EN_SOUND_MODE enSoundMode = EN_SOUND_MODE.valueOf(enumData.getCurrent());
currentSoundSetting.setSoundMode(enSoundMode);
return BooleanData.TRUE;
}
};
private MenuFunction eq120 = new MenuFunction(
TVMENU_COMMAND.MENUCMD_EQUALIZER_120HZ.toString()) {
@Override
public TypedData get(String cmd, TypedData typedData) {
Map<EN_SOUND_MODE, SoundMode> supportSoundModes = SoundManager.getInstance().getSupportSoundModes();
SoundMode soundMode = supportSoundModes.get(currentSoundSetting.getSoundMode());
RangeData rangeData = new RangeData();
rangeData.setMin(0);
rangeData.setCurrent(soundMode.getSoundModeHz(EN_SOUND_MODE_FREQ_TYPE.E_SOUND_MODE_FREQ_TYPE_120HZ));
rangeData.setMax(100);
return rangeData;
}
@Override
public BooleanData set(String cmd, TypedData typedData) {
Map<EN_SOUND_MODE, SoundMode> supportSoundModes = SoundManager.getInstance().getSupportSoundModes();
SoundMode soundMode = supportSoundModes.get(currentSoundSetting.getSoundMode());
RangeData rangeData = (RangeData) typedData;
soundMode.setSoundModeHz(EN_SOUND_MODE_FREQ_TYPE.E_SOUND_MODE_FREQ_TYPE_120HZ,rangeData.getCurrent());
return BooleanData.TRUE;
}
};
private MenuFunction eq500 = new MenuFunction(
TVMENU_COMMAND.MENUCMD_EQUALIZER_500HZ.toString()) {
@Override
public TypedData get(String cmd, TypedData typedData) {
Map<EN_SOUND_MODE, SoundMode> supportSoundModes = SoundManager.getInstance().getSupportSoundModes();
SoundMode soundMode = supportSoundModes.get(currentSoundSetting.getSoundMode());
RangeData rangeData = new RangeData();
rangeData.setMin(0);
rangeData.setCurrent(soundMode.getSoundModeHz(EN_SOUND_MODE_FREQ_TYPE.E_SOUND_MODE_FREQ_TYPE_500HZ));
rangeData.setMax(100);
return rangeData;
}
@Override
public BooleanData set(String cmd, TypedData typedData) {
Map<EN_SOUND_MODE, SoundMode> supportSoundModes = SoundManager.getInstance().getSupportSoundModes();
SoundMode soundMode = supportSoundModes.get(currentSoundSetting.getSoundMode());
RangeData rangeData = (RangeData) typedData;
soundMode.setSoundModeHz(EN_SOUND_MODE_FREQ_TYPE.E_SOUND_MODE_FREQ_TYPE_500HZ,rangeData.getCurrent());
return BooleanData.TRUE;
}
};
private MenuFunction eq1500 = new MenuFunction(
TVMENU_COMMAND.MENUCMD_EQUALIZER_1500HZ.toString()) {
@Override
public TypedData get(String cmd, TypedData typedData) {
Map<EN_SOUND_MODE, SoundMode> supportSoundModes = SoundManager.getInstance().getSupportSoundModes();
SoundMode soundMode = supportSoundModes.get(currentSoundSetting.getSoundMode());
RangeData rangeData = new RangeData();
rangeData.setMin(0);
rangeData.setCurrent(soundMode.getSoundModeHz(EN_SOUND_MODE_FREQ_TYPE.E_SOUND_MODE_FREQ_TYPE_1500HZ));
rangeData.setMax(100);
return rangeData;
}
@Override
public BooleanData set(String cmd, TypedData typedData) {
Map<EN_SOUND_MODE, SoundMode> supportSoundModes = SoundManager.getInstance().getSupportSoundModes();
SoundMode soundMode = supportSoundModes.get(currentSoundSetting.getSoundMode());
RangeData rangeData = (RangeData) typedData;
soundMode.setSoundModeHz(EN_SOUND_MODE_FREQ_TYPE.E_SOUND_MODE_FREQ_TYPE_1500HZ,rangeData.getCurrent());
return BooleanData.TRUE;
}
};
private MenuFunction eq5k = new MenuFunction(
TVMENU_COMMAND.MENUCMD_EQUALIZER_5KHZ.toString()) {
@Override
public TypedData get(String cmd, TypedData typedData) {
Map<EN_SOUND_MODE, SoundMode> supportSoundModes = SoundManager.getInstance().getSupportSoundModes();
SoundMode soundMode = supportSoundModes.get(currentSoundSetting.getSoundMode());
RangeData rangeData = new RangeData();
rangeData.setMin(0);
rangeData.setCurrent(soundMode.getSoundModeHz(EN_SOUND_MODE_FREQ_TYPE.E_SOUND_MODE_FREQ_TYPE_5KHZ));
rangeData.setMax(100);
return rangeData;
}
@Override
public BooleanData set(String cmd, TypedData typedData) {
Map<EN_SOUND_MODE, SoundMode> supportSoundModes = SoundManager.getInstance().getSupportSoundModes();
SoundMode soundMode = supportSoundModes.get(currentSoundSetting.getSoundMode());
RangeData rangeData = (RangeData) typedData;
soundMode.setSoundModeHz(EN_SOUND_MODE_FREQ_TYPE.E_SOUND_MODE_FREQ_TYPE_5KHZ,rangeData.getCurrent());
return BooleanData.TRUE;
}
};
private MenuFunction eq10k = new MenuFunction(
TVMENU_COMMAND.MENUCMD_EQUALIZER_10KHZ.toString()) {
@Override
public TypedData get(String cmd, TypedData typedData) {
Map<EN_SOUND_MODE, SoundMode> supportSoundModes = SoundManager.getInstance().getSupportSoundModes();
SoundMode soundMode = supportSoundModes.get(currentSoundSetting.getSoundMode());
RangeData rangeData = new RangeData();
rangeData.setMin(0);
rangeData.setCurrent(soundMode.getSoundModeHz(EN_SOUND_MODE_FREQ_TYPE.E_SOUND_MODE_FREQ_TYPE_10kHZ));
rangeData.setMax(100);
return rangeData;
}
@Override
public BooleanData set(String cmd, TypedData typedData) {
Map<EN_SOUND_MODE, SoundMode> supportSoundModes = SoundManager.getInstance().getSupportSoundModes();
SoundMode soundMode = supportSoundModes.get(currentSoundSetting.getSoundMode());
RangeData rangeData = (RangeData) typedData;
soundMode.setSoundModeHz(EN_SOUND_MODE_FREQ_TYPE.E_SOUND_MODE_FREQ_TYPE_10kHZ,rangeData.getCurrent());
return BooleanData.TRUE;
}
};
private MenuFunction balance = new MenuFunction(
TVMENU_COMMAND.MENUCMD_BALANCE.toString()) {
@Override
public TypedData get(String cmd, TypedData typedData) {
RangeData rangeData = new RangeData();
rangeData.setMin(-50);
rangeData.setCurrent(currentSoundSetting.getBalance());
rangeData.setMax(50);
return rangeData;
}
@Override
public BooleanData set(String cmd, TypedData typedData) {
RangeData rangeData = (RangeData) typedData;
currentSoundSetting.setBalance(rangeData.getCurrent());
return BooleanData.TRUE;
}
};
private MenuFunction surroundSound = new MenuFunction(
TVMENU_COMMAND.MENUCMD_SURROUND_SOUND.toString()) {
@Override
public TypedData get(String cmd, TypedData typedData) {
SwitchData switchData = new SwitchData();
switchData.setOn(currentSoundSetting.isSurroundMode());
return switchData;
}
@Override
public BooleanData set(String cmd, TypedData typedData) {
SwitchData switchData = (SwitchData) typedData;
currentSoundSetting.setSurroundMode(switchData.isOn());
return BooleanData.TRUE;
}
};
private MenuFunction autoVolumeCtrl = new MenuFunction(
TVMENU_COMMAND.MENUCMD_AUTO_VOLUME_CONTROL.toString()) {
@Override
public TypedData get(String cmd, TypedData typedData) {
SwitchData switchData = new SwitchData();
switchData.setOn(currentSoundSetting.isAutoVolume());
return switchData;
}
@Override
public BooleanData set(String cmd, TypedData typedData) {
SwitchData switchData = (SwitchData)typedData;
currentSoundSetting.setAutoVolume(switchData.isOn());
return BooleanData.TRUE;
}
};
private MenuFunction adSwitch = new MenuFunction(
TVMENU_COMMAND.MENUCMD_AD_SWITCH.toString()) {
@Override
public TypedData get(String cmd, TypedData typedData) {
SwitchData switchData = new SwitchData();
switchData.setOn(currentSoundSetting.isAdEnable());
return switchData;
}
@Override
public BooleanData set(String cmd, TypedData typedData) {
SwitchData switchData = (SwitchData)typedData;
currentSoundSetting.setAdEnable(switchData.isOn());
return BooleanData.TRUE;
}
};
private MenuFunction adVolume = new MenuFunction(
TVMENU_COMMAND.MENUCMD_AD_VOLUME.toString()) {
@Override
public TypedData get(String cmd, TypedData typedData) {
RangeData rangeData = new RangeData();
rangeData.setMin(-10);
rangeData.setCurrent(currentSoundSetting.getAdAbsoluteVolume());
rangeData.setMax(10);
return rangeData;
}
@Override
public BooleanData set(String cmd, TypedData typedData) {
RangeData rangeData = (RangeData) typedData;
currentSoundSetting.setAdAbsoluteVolume(rangeData.getCurrent());
return BooleanData.TRUE;
}
};
private MenuFunction spdifType = new MenuFunction(
TVMENU_COMMAND.MENUCMD_SPDIF_TYPE.toString()) {
@Override
public TypedData get(String cmd, TypedData typedData) {
EnumData ret = new EnumData();
List<String> enumList = new ArrayList<String>();
for(EN_SOUND_SPDIF_MODE mode : EN_SOUND_SPDIF_MODE.values()) {
enumList.add(mode.toString());
}
ret.setEnumList(enumList);
ret.setEnumCount(enumList.size());
EN_SOUND_SPDIF_MODE currentValue = currentSoundSetting.getSpdifMode();
ret.setCurrent(currentValue.toString());
return ret;
}
@Override
public BooleanData set(String cmd, TypedData typedData) {
EnumData enumData = (EnumData)(typedData);
EN_SOUND_SPDIF_MODE enSpdifMode = EN_SOUND_SPDIF_MODE.valueOf(enumData.getCurrent());
currentSoundSetting.setSpdifMode(enSpdifMode);
return BooleanData.TRUE;
}
};
private MenuFunction spdifDelay = new MenuFunction(
TVMENU_COMMAND.MENUCMD_SPDIF_DELAY.toString()) {
@Override
public TypedData get(String cmd, TypedData typedData) {
RangeData rangeData = new RangeData();
rangeData.setMin(-50);
rangeData.setCurrent(currentSoundSetting.getSpdifdelay());
rangeData.setMax(50);
return rangeData;
}
@Override
public BooleanData set(String cmd, TypedData typedData) {
RangeData rangeData = (RangeData) typedData;
currentSoundSetting.setSpdifdelay(rangeData.getCurrent());
return BooleanData.TRUE;
}
};
private MenuFunction audioOut = new MenuFunction(
TVMENU_COMMAND.MENUCMD_AUDIO_OUT.toString()) {
@Override
public TypedData get(String cmd, TypedData typedData) {
// EnumData ret = new EnumData();
// return ret;
Log.i("20170614", "audioOut get:"+cmd+",typedData:"+typedData);
Map<EN_SOUND_MODE, SoundMode> supportSoundModes = SoundManager.getInstance().getSupportSoundModes();
EnumData ret = new EnumData();
List<String> enumList = new ArrayList<String>();
Iterator<Map.Entry<EN_SOUND_MODE, SoundMode>> iter = supportSoundModes.entrySet().iterator();
while (iter.hasNext())
{
Map.Entry entry = (Map.Entry) iter.next();
EN_SOUND_MODE enSoundMode = (EN_SOUND_MODE) entry.getKey();
enumList.add(enSoundMode.toString());
}
ret.setEnumList(enumList);
ret.setEnumCount(enumList.size());
EN_SOUND_MODE currentValue = currentSoundSetting.getSoundMode();
ret.setCurrent(currentValue.toString());
return ret;
}
@Override
public BooleanData set(String cmd, TypedData typedData) {
EnumData enumData = (EnumData)(typedData);
Log.i("20170614", "audioOut set:"+enumData.getCurrent());
EN_SOUND_MODE enSoundMode = EN_SOUND_MODE.valueOf(enumData.getCurrent());
currentSoundSetting.setSoundMode(enSoundMode);
return BooleanData.TRUE;
}
};
} | [
"chencong1254@163.com"
] | chencong1254@163.com |
491317a2cd84438e9d9fc16e3e16ce13f2f6d7db | 5067dd94ff58650e9a533dea6eed36a5e3a6c044 | /Spring09_Git/src/main/java/com/gura/spring/shop/dao/ShopDaoImpl.java | 3ca2ab3dfa5ce92f414d559fafeb3359d11b66f7 | [] | no_license | thestaid/spring | 22c4ca3d6604cc33b9d189cc83542dc60d047102 | 320df035bc9cfa0da0155b05173ff3ed7faa1e64 | refs/heads/master | 2021-01-11T19:54:45.469753 | 2017-01-25T06:46:49 | 2017-01-25T06:46:49 | 79,424,127 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,451 | java | package com.gura.spring.shop.dao;
import java.util.HashMap;
import java.util.Map;
import org.apache.ibatis.session.SqlSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
@Repository
public class ShopDaoImpl implements ShopDao{
@Autowired
private SqlSession session;
//입금
@Override
public void deposit(String id, int money) {
Map<String, Object> param=new HashMap<String, Object>();
param.put("id", id);
param.put("money", money);
session.update("shop.deposit", param);
}
//인출
@Override
public void withDraw(String id, int money) {
Map<String, Object> param=new HashMap<String, Object>();
param.put("id", id);
param.put("money", money);
session.update("shop.withDraw", param);
}
//포인트 적립
@Override
public void addPoint(String id, int point) {
Map<String, Object> param=new HashMap<String, Object>();
param.put("id", id);
param.put("point", point);
session.update("shop.addPoint", param);
}
//배달 요청
@Override
public void deliveryRequest() {
// 트랜잭션을 관리하는 블럭에 custom Exception을 발생시켜
// 종류별로 Exception을 핸들링 할수있다,
//특정 조건에서 발생한다는 가정
throw new OopsException("오늘 눈이 와서 배송 불가");
//System.out.println("배송 요청을 했습니다.");
}
}
| [
"thestaid@naver.com"
] | thestaid@naver.com |
f7277505b98377b72ee149c7776f768a5c5d4778 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/16/16_8f8e29b5f746d5f3ce931658d19cc592f5dc8688/SiteServlet/16_8f8e29b5f746d5f3ce931658d19cc592f5dc8688_SiteServlet_s.java | 3403bd7820068907e7b99fe4b1d41bf470e9c25a | [] | 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 | 11,110 | java | /*
* Weblounge: Web Content Management System
* Copyright (c) 2010 The Weblounge Team
* http://weblounge.o2it.ch
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package ch.o2it.weblounge.dispatcher.impl;
import ch.o2it.weblounge.common.Times;
import ch.o2it.weblounge.common.impl.request.Http11ProtocolHandler;
import ch.o2it.weblounge.common.impl.request.Http11ResponseType;
import ch.o2it.weblounge.common.impl.request.WebloungeRequestImpl;
import ch.o2it.weblounge.common.impl.request.WebloungeResponseImpl;
import ch.o2it.weblounge.common.impl.util.classloader.ContextClassLoaderUtils;
import ch.o2it.weblounge.common.impl.util.classloader.JasperClassLoader;
import ch.o2it.weblounge.common.request.WebloungeRequest;
import ch.o2it.weblounge.common.site.Site;
import org.apache.commons.io.FilenameUtils;
import org.apache.commons.io.IOUtils;
import org.eclipse.jetty.util.resource.Resource;
import org.ops4j.pax.web.jsp.JspServletWrapper;
import org.osgi.framework.Bundle;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.net.URLConnection;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.Callable;
import javax.servlet.Servlet;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* Servlet that knows how to deal with resources loaded from <code>OSGi</code>
* context.
*/
public class SiteServlet extends HttpServlet {
/** The serial version UID */
private static final long serialVersionUID = 6443055837961417300L;
/** The logging facility */
private static final Logger logger = LoggerFactory.getLogger(SiteServlet.class);
/** The site */
private final Site site;
/** The http context */
private final BundleHttpContext siteHttpContext;
/** The Jasper servlet */
protected final Servlet jasperServlet;
/** Jasper specific class loader */
private final JasperClassLoader jasperClassLoader;
/** Path rules */
private List<ResourceSet> resourceSets = null;
/**
* Creates a new site servlet for the given bundle and context.
*
* @param site
* the site
* @param bundle
* the site bundle
* @param httpContext
* the http context
*/
public SiteServlet(final Site site, final BundleHttpContext httpContext) {
this.site = site;
this.siteHttpContext = httpContext;
this.jasperServlet = new JspServletWrapper(httpContext.getBundle());
this.jasperClassLoader = new JasperClassLoader(httpContext.getBundle(), JasperClassLoader.class.getClassLoader());
this.resourceSets = new ArrayList<ResourceSet>();
this.resourceSets.add(new SiteResourceSet());
this.resourceSets.add(new ModuleResourceSet());
}
/**
* Delegates to the jasper servlet with a controlled context class loader.
*
* @see JspServletWrapper#init(ServletConfig)
*/
public void init(final ServletConfig config) throws ServletException {
try {
ContextClassLoaderUtils.doWithClassLoader(jasperClassLoader, new Callable<Void>() {
public Void call() throws Exception {
jasperServlet.init(config);
return null;
}
});
} catch (ServletException e) {
throw e;
} catch (Throwable ignore) {
logger.error("Ignored exception", ignore);
}
}
/**
* Returns the site that is serving content through this servlet.
*
* @return the site
*/
public Site getSite() {
return site;
}
/**
* Returns the site's bundle.
*
* @return the bundle
*/
public Bundle getBundle() {
return siteHttpContext.getBundle();
}
/**
* Returns the bundle context that is used by this servlet to load the actual
* content for delivery.
*
* @return the bundle context
*/
public BundleHttpContext getBundleContext() {
return siteHttpContext;
}
/**
* Delegates to the jasper servlet.
*
* @see JspServletWrapper#getServletConfig()
*/
public ServletConfig getServletConfig() {
return jasperServlet.getServletConfig();
}
/**
* Depending on whether a call to a jsp is made or not, delegates to the
* jasper servlet with a controlled context class loader or tries to load the
* requested file from the bundle as a static resource.
*
* @see HttpServlet#service(HttpServletRequest, HttpServletResponse)
*/
public void service(final HttpServletRequest request,
final HttpServletResponse response) throws ServletException, IOException {
String filename = FilenameUtils.getName(request.getPathInfo());
if (filename.endsWith(".jsp")) {
serviceJavaServerPage(request, response);
} else {
serviceResource(request, response);
}
}
/**
* Delegates to jasper servlet with a controlled context class loader.
*
* @see JspServletWrapper#service(HttpServletRequest, HttpServletResponse)
*/
public void serviceJavaServerPage(final HttpServletRequest httpRequest,
final HttpServletResponse httpResponse) throws ServletException,
IOException {
final HttpServletRequest request;
final HttpServletResponse response;
// Wrap request and response if necessary
if (httpRequest instanceof WebloungeRequest) {
request = httpRequest;
response = httpResponse;
} else {
request = new WebloungeRequestImpl(httpRequest);
response = new WebloungeResponseImpl(httpResponse);
((WebloungeRequestImpl) request).init(site);
((WebloungeResponseImpl) response).setRequest((WebloungeRequestImpl) request);
}
// Configure request and response objects
try {
ContextClassLoaderUtils.doWithClassLoader(jasperClassLoader, new Callable<Void>() {
public Void call() throws Exception {
jasperServlet.service(request, response);
return null;
}
});
} catch (ServletException e) {
// re-thrown
throw e;
} catch (IOException e) {
// re-thrown
throw e;
} catch (Throwable t) {
// re-thrown
logger.error("Wow, certainly didn't expect this to happen!", t);
throw new ServletException(t);
}
}
/**
* Tries to serve the request as a static resource from the bundle.
*
* @param request
* the http servlet request
* @param response
* the http servlet response
* @throws ServletException
* if serving the request fails
* @throws IOException
* if writing the response back to the client fails
*/
protected void serviceResource(final HttpServletRequest request,
final HttpServletResponse response) throws ServletException, IOException {
Http11ResponseType responseType = null;
String requestPath = request.getPathInfo();
// There is also a special set of resources that we don't want to expose
if (isProtected(requestPath)) {
response.sendError(HttpServletResponse.SC_FORBIDDEN);
return;
}
// Does the resource exist?
final URL url = siteHttpContext.getResource(requestPath);
if (url == null) {
response.sendError(HttpServletResponse.SC_NOT_FOUND);
return;
}
// Load the resource from the bundle
final Resource resource = Resource.newResource(url);
if (!resource.exists()) {
response.sendError(HttpServletResponse.SC_NOT_FOUND);
return;
}
// We don't allow directory listings
if (resource.isDirectory()) {
response.sendError(HttpServletResponse.SC_FORBIDDEN);
return;
}
URLConnection conn = url.openConnection();
String mimeType = siteHttpContext.getMimeType(requestPath);
String encoding = null;
// Try to get mime type and content encoding from resource
if (mimeType == null)
mimeType = conn.getContentType();
encoding = conn.getContentEncoding();
if (mimeType != null) {
if (encoding != null)
mimeType += ";" + encoding;
response.setContentType(mimeType);
}
// Send the response back to the client
InputStream is = resource.getInputStream();
try {
logger.debug("Serving {}", url);
responseType = Http11ProtocolHandler.analyzeRequest(request, resource.lastModified(), Times.MS_PER_DAY + System.currentTimeMillis(), resource.length());
if (!Http11ProtocolHandler.generateResponse(response, responseType, is)) {
logger.warn("I/O error while generating content from {}", url);
}
} finally {
IOUtils.closeQuietly(is);
}
}
/**
* Returns <code>true</code> if the resource is protected. Examples of
* protected resources are <code>web.xml</code> inside of the
* <code>WEB-INF</code> directory etc.
*
* @param path
* the path to the resource that is about to be served
* @return <code>true</code> if the resource needs to be protected
*/
public boolean isProtected(String path) {
for (ResourceSet resourceSet : resourceSets) {
if (resourceSet.includes(path) && resourceSet.excludes(path))
return true;
}
return false;
}
/**
* Delegates to jasper servlet.
*
* @see JspServletWrapper#getServletInfo()
*/
public String getServletInfo() {
return jasperServlet.getServletInfo();
}
/**
* Delegates to jasper servlet with a controlled context class loader.
*
* @see JspServletWrapper#destroy()
*/
public void destroy() {
try {
ContextClassLoaderUtils.doWithClassLoader(jasperClassLoader, new Callable<Void>() {
public Void call() throws Exception {
jasperServlet.destroy();
return null;
}
});
} catch (Throwable t) {
logger.error("Wow, certainly didn't expect this to happen!", t);
}
}
/**
* {@inheritDoc}
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
return "site " + site;
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
5b0552bf870c1a34d61efd5d88f11327af8941be | 85cf441fd1c09320bb6166bef9e770bc15ce8c5f | /src/main/java/com/jeeps/ckan_extractor/web/controller/SdgController.java | 1ca78ce4d3aaa68a0686f113710fab1128744235 | [] | no_license | JamesJose7/sdg-od | ac4aee68802f418c6908da28f19e19d87aab2ccf | a5996f565962c9dd352b87e7702366be44510596 | refs/heads/master | 2020-04-12T20:49:25.422383 | 2019-11-21T16:31:06 | 2019-11-21T16:31:06 | 162,747,736 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,163 | java | package com.jeeps.ckan_extractor.web.controller;
import com.jeeps.ckan_extractor.model.ConfigurationSingleton;
import com.jeeps.ckan_extractor.model.SdgRelatedDataset;
import com.jeeps.ckan_extractor.service.KnowledgeBaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@Controller
public class SdgController {
@Value("${server.servlet.context-path}")
private String contextPath;
@Autowired
private KnowledgeBaseService knowledgeBaseService;
@RequestMapping("/sdg/overview")
public String sdgOverview(Model model) {
model.addAttribute("sparqlEndpoint", ConfigurationSingleton.getInstance()
.getConfigurationRegistry().getSparqlWebEndpoint());
model.addAttribute("contextPath", contextPath);
return "ods/ods-od-overview";
}
@RequestMapping("/sdg/{goal}")
public String sdgPage(Model model, @PathVariable("goal") int goal) {
if (goal > 17 || goal < 1)
return "redirect:/sdg/overview";
model.addAttribute("sdg", goal);
return "ods/sdg_page";
}
@RequestMapping("/sdg/datasets")
public String datasetsRelatedToOds(Model model) {
List<SdgRelatedDataset> datasets = knowledgeBaseService.findAllCatalogsRelatedToOds();
model.addAttribute("datasets", datasets);
try {
Map<String, Integer> datasetsPerOds = knowledgeBaseService.howManyDatasetsRelateToEachGoal();
model.addAttribute("odsLabels", datasetsPerOds.keySet());
model.addAttribute("datasetsCounts", datasetsPerOds.values());
} catch (Exception e) {
model.addAttribute("odsLabels", new ArrayList<String>());
model.addAttribute("datasetsCounts", new ArrayList<Integer>());
}
return "ods/datasets-list";
}
}
| [
"pepe.96.jose@gmail.com"
] | pepe.96.jose@gmail.com |
a11adf0c5230d389fccbd0947108ad1bde6fea34 | 247e3e51cf0aeca7e6d23a19f863ba0a7f084072 | /src/divide_conquer/FindMaxSumOfSubArray.java | 5aa36b3aa4709253424e79ed9784f4176b2540fc | [] | no_license | KeXianting/algorithm_java | 48b56da200ce70ba06529ce07f0407a920d4021b | 47a1f7f28b4b9643cb1689164cdb2661759dd5aa | refs/heads/master | 2021-05-16T16:22:47.161128 | 2019-07-01T03:09:19 | 2019-07-01T03:09:19 | 119,938,587 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,051 | java | package divide_conquer;
/**
* Created by kentorvalds on 2017/7/3.
* 题目:输入一个整形数组,数组里有正数也有负数。数组中连续的一个或多个整数组成一个子数组,每个子数组都有一个和。
* 求所有子数组的和的最大值。要求时间复杂度为O(n)。 浙大数据结构课本上有 思路:
* 求连续数字之和,当和为负值,抛弃.当和为正值,比较其与最大值,如大于,则替换之
* http://zhedahht.blog.163.com/blog/static/254111742007219147591/
* http://blog.csdn.net/v_JULY_v/article/details/6444021
*/
public class FindMaxSumOfSubArray {
public static void main(String[] arg){
FindMaxSumOfSubArray f = new FindMaxSumOfSubArray();
int[] arr = { 1, -2, 3, 10, -4, 7, 2, -5 };
System.out.println("MaxSum:" + f.findMaxSum(arr));
int[] a = { 13, -3, -25, 20, -3, -16, -23, 18, 20, -7, 12, -5, -22, 15, -4, 7 };
int[] s = getMaxSummary(a, 0, 15);
for (int i = 0; i < s.length; i++) {
System.out.println(s[i]);
}
}
public Integer findMaxSum(int[] arr) {
int curSum = 0;
int maxSum = 0;
int len = arr.length;
if (arr == null || len == 0) {
return null;
}
for (int i = 0; i < len; i++) {
curSum += arr[i];
if (curSum < 0) {
curSum = 0;
}
if (curSum > maxSum) {
maxSum = curSum;
}
}
// all data are negative
if (maxSum == 0) {
for (int i = 0; i < len; i++) {
if (i == 0) {
maxSum = arr[i];
}
if (arr[i] > maxSum) {
maxSum = arr[i];
}
}
}
return maxSum;
}
public static int[] getMaxSummary(int[] A, int low, int high) {
if (low == high) { // 如果長度就一個,那麼就把這個取出來
int[] result = { low, high, A[low] };
return result;
} else {
int middle = (int) Math.floor((low + high) / 2); // 获取中间值
int[] left = new int[3]; // 保存左边部分返回结果
int[] right = new int[3]; // 保存右边部分返回结果
int[] cross = new int[3]; // 返回交叉部分返回结果
left = getMaxSummary(A, low, middle);
right = getMaxSummary(A, middle + 1, high);
cross = getMaxCrossMid(A, low, high, middle);
if (left[2] >= right[2] && left[2] >= cross[2]) { // 那部分大就用了那部分
return left;
} else if (right[2] >= left[2] && right[2] >= cross[2]) {
return right;
} else {
return cross;
}
}
}
/**
* 獲取最大子數組(一部分在左邊,一部分在右邊)
*
* @param A
* @param low
* @param high
* @param middle
* @return
*/
public static int[] getMaxCrossMid(int[] A, int low, int high, int middle) {
int leftSum = Integer.MIN_VALUE;
int sum = 0; // 保存和的
int left = 0; // 记录左边位置
for (int i = middle; i >= low; i--) {
sum = sum + A[i];
if (sum > leftSum) { // 证明所加数字为正数,那么符合条件(因为最大子数组内正数越多指定越大)
leftSum = sum;
left = i;
}
}
int rightSum = Integer.MIN_VALUE;
int sum2 = 0;
int right = 0; // 记录右边位置
for (int i = middle + 1; i <= high; i++) {
sum2 = sum2 + A[i];
if (sum2 > rightSum) {
rightSum = sum2;
right = i;
}
}
int[] result = new int[3];
result[0] = left;
result[1] = right;
result[2] = leftSum + rightSum;
return result;
}
}
| [
"xianting_ke@163.com"
] | xianting_ke@163.com |
0153abc735a595f4755f62bcd01020afc16c56be | ffb51aa15e6e8d2f259843c783e66af7c0a85ff8 | /src/java/com/tsp/sct/bo/InvocaWsNetCancela.java | c4a10022a4a6877f1e9acd2359af26fc12b0a776 | [] | no_license | Karmaqueda/SGFENS_BAFAR-1 | c9c9b0ffad3ac948b2a76ffbbd5916c1a8751c51 | 666f858fc49abafe7612600ac0fd468c54c37bfe | refs/heads/master | 2021-01-18T16:09:08.520888 | 2016-08-01T18:49:40 | 2016-08-01T18:49:40 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,705 | java | /*
* To change this template, choose DateManage | Templates
* and open the template in the editor.
*/
package com.tsp.sct.bo;
import com.tsp.interconecta.ws.WsGenericResp;
import com.tsp.interconecta.ws.dotnet.ArrayOfString;
import com.tsp.interconecta.ws.dotnet.EnviaCFDI;
import com.tsp.interconecta.ws.dotnet.EnviaCFDISoap;
import com.tsp.interconecta.ws.dotnet.RespuestaCancelacion;
import com.tsp.sct.util.DateManage;
import javax.xml.datatype.DatatypeConfigurationException;
import javax.xml.datatype.XMLGregorianCalendar;
/**
*
* @author ISC César Ulises Martínez García
*/
public class InvocaWsNetCancela {
/**
* Constrcutor vacío
*/
public InvocaWsNetCancela() {
}
/**
* Método que realiza la cancelación de un XML realizando la
* implementación del WebService de .NET
* @param rfcEmisor Es el rfc del Emisor de las facturas a cancelar.
* @param fechaHora fecha y hora en que se realiza la llamada a cancelación, será reemplazada por el sistema del SAT
* @param listaUUID Es la lista de UUID a cancelar y que pertenecen al mismo Emisor
* @param certificadoCSD Arreglo de bytes del archivo .cer del Emisor que esta solicitando la cancelación
* @param privateKeyBase64 Es la llave privada .key del emisor codificada en base64 (Ver clase ...util.UtilSecurity.java)
* @return RespuestaCancelacion
*/
/*
public RespuestaCancelacion cancelar(String rfcEmisor, java.util.Date fechaHora, ArrayOfString listaUUID, byte[] certificadoCSD, String privateKeyBase64) throws DatatypeConfigurationException {
RespuestaCancelacion respCancelaNet = null;
XMLGregorianCalendar fechaHoraCancela = DateManage.dateToXMLGregorianCalendar(fechaHora);
respCancelaNet = cancelarCFDICerKey(rfcEmisor, fechaHoraCancela, listaUUID, certificadoCSD, privateKeyBase64);
return respCancelaNet;
}
private static RespuestaCancelacion cancelarCFDICerKey(java.lang.String rfcEmisor, javax.xml.datatype.XMLGregorianCalendar fechaHoraTimbre, com.tsp.interconecta.ws.dotnet.ArrayOfString uuid, byte[] bytesCer, java.lang.String keyBase64) {
EnviaCFDI service = new EnviaCFDI();
EnviaCFDISoap port = service.getEnviaCFDISoap();
return port.cancelarCFDICerKey(rfcEmisor, fechaHoraTimbre, uuid, bytesCer, keyBase64);
}
public RespuestaCancelacion cancelarCFDIPeticionPreFormada(byte[] bytesXMLPeticionCancelacion) {
EnviaCFDI service = new EnviaCFDI();
EnviaCFDISoap port = service.getEnviaCFDISoap();
return port.cancelarCFDIPeticionPreFormada(bytesXMLPeticionCancelacion);
}
*
*/
public WsGenericResp cancelaCFDI32(java.lang.String user, java.lang.String userPassword, byte[] certificadoEmisor, byte[] llavePrivadaEmisor, java.lang.String llavePrivadaEmisorPassword, java.lang.String xmlCFDI) {
com.tsp.interconecta.ws.InterconectaWsService service = new com.tsp.interconecta.ws.InterconectaWsService();
com.tsp.interconecta.ws.InterconectaWs port = service.getInterconectaWsPort();
return port.cancelaCFDI32(user, userPassword, certificadoEmisor, llavePrivadaEmisor, llavePrivadaEmisorPassword, xmlCFDI);
}
public WsGenericResp cancelaCFDIxp(java.lang.String user, java.lang.String userPassword, java.lang.String xmlPeticionCancelacionSellada) {
com.tsp.interconecta.ws.InterconectaWsService service = new com.tsp.interconecta.ws.InterconectaWsService();
com.tsp.interconecta.ws.InterconectaWs port = service.getInterconectaWsPort();
return port.cancelaCFDIxp(user, userPassword, xmlPeticionCancelacionSellada);
}
}
| [
"ing.gloriapalmagonzalez@gmail.com"
] | ing.gloriapalmagonzalez@gmail.com |
c6822ceacd82bc28ac6c40b315536b18c2aae821 | b19bb152ec161fc7936f93d154511ef181ea323b | /sources/android/support/v4/app/NotificationCompatSideChannelService.java | ee06b70ab65912766a642d2c74bbdaeda7894baf | [] | no_license | hiepgaf/Camera-APK | fa893c5165ae3b73d630943d640163aaf7a0447e | 2c314aba059c5551166e90fb9a3f521346a92bb5 | refs/heads/master | 2020-04-05T02:29:18.095598 | 2018-09-04T06:32:22 | 2018-09-04T06:32:22 | 156,478,724 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,810 | java | package android.support.v4.app;
import android.app.Notification;
import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.support.v4.app.INotificationSideChannel.Stub;
/* compiled from: PG */
public abstract class NotificationCompatSideChannelService extends Service {
/* compiled from: PG */
class NotificationSideChannelStub extends Stub {
NotificationSideChannelStub() {
}
public void cancel(String str, int i, String str2) {
NotificationCompatSideChannelService.this.checkPermission(getCallingUid(), str);
long clearCallingIdentity = clearCallingIdentity();
try {
NotificationCompatSideChannelService.this.cancel(str, i, str2);
} finally {
restoreCallingIdentity(clearCallingIdentity);
}
}
public void cancelAll(String str) {
NotificationCompatSideChannelService.this.checkPermission(getCallingUid(), str);
long clearCallingIdentity = clearCallingIdentity();
try {
NotificationCompatSideChannelService.this.cancelAll(str);
} finally {
restoreCallingIdentity(clearCallingIdentity);
}
}
public void notify(String str, int i, String str2, Notification notification) {
NotificationCompatSideChannelService.this.checkPermission(getCallingUid(), str);
long clearCallingIdentity = clearCallingIdentity();
try {
NotificationCompatSideChannelService.this.notify(str, i, str2, notification);
} finally {
restoreCallingIdentity(clearCallingIdentity);
}
}
}
public abstract void cancel(String str, int i, String str2);
public abstract void cancelAll(String str);
public abstract void notify(String str, int i, String str2, Notification notification);
void checkPermission(int i, String str) {
String[] packagesForUid = getPackageManager().getPackagesForUid(i);
int length = packagesForUid.length;
int i2 = 0;
while (i2 < length) {
if (!packagesForUid[i2].equals(str)) {
i2++;
} else {
return;
}
}
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append("NotificationSideChannelService: Uid ");
stringBuilder.append(i);
stringBuilder.append(" is not authorized for package ");
stringBuilder.append(str);
throw new SecurityException(stringBuilder.toString());
}
public IBinder onBind(Intent intent) {
return intent.getAction().equals(NotificationManagerCompat.ACTION_BIND_SIDE_CHANNEL) ? null : null;
}
}
| [
"dewanshrawat15@gmail.com"
] | dewanshrawat15@gmail.com |
585f303cb1e6084c7445d824142a3e702857f435 | 30b61de232fcb9ebacc2fa103faf9588d2b3c44d | /Java Fundamentals/Arrays/assignment3.java | c561c6a78e287533d1c07a102babe168e9540f58 | [] | no_license | MayankRanjan10/Java-Mini-Projects | 36e59ca4eb14f6e1fb8cf34ca22f6789d03995cd | ea080971b7df885bee38a3a67f0edb38c03d3dc6 | refs/heads/main | 2023-04-27T07:57:25.710868 | 2021-05-17T02:41:44 | 2021-05-17T02:41:44 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 257 | java | import java.util.*;
class assignment3
{
public static void main(String[] args) {
int[] arr = {1,2,3,4,5};
int n = Integer.parseInt(args[0]);
int temp=-1;
for(int i=0;i<arr.length;i++){
if(arr[i]==n)
temp=i;
}
System.out.print(temp);
}
} | [
"mayank6027ranjan@gmail.com"
] | mayank6027ranjan@gmail.com |
4c9814b8c7a673974e59682b1b76999e32093102 | a5e0d2d2808f3504761b419a1a47455c4ff9967f | /sung-template/src/main/java/com/nssoft/api/user/Login.java | 7f5d72ef365d40ecbe9d5ed9465edb5a549ebdb1 | [] | no_license | zhangsung/learngit | 7e1ac7c03770f465444fec145cc48bed1bef4c6b | bfe6bdf533b4ca4e2f752db29f5606495a9aabb6 | refs/heads/master | 2021-01-10T01:44:12.075002 | 2015-12-15T08:08:38 | 2015-12-15T08:08:38 | 48,030,133 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,429 | java | package com.nssoft.api.user;
import java.io.IOException;
import org.apache.log4j.Logger;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authc.AuthenticationException;
import org.apache.shiro.authc.ExcessiveAttemptsException;
import org.apache.shiro.authc.IncorrectCredentialsException;
import org.apache.shiro.authc.LockedAccountException;
import org.apache.shiro.authc.UnknownAccountException;
import org.apache.shiro.authc.UsernamePasswordToken;
import org.apache.shiro.subject.Subject;
import org.springframework.stereotype.Controller;
import org.springframework.web.servlet.view.InternalResourceViewResolver;
import com.neighborsystem.durian.exception.AbsException;
import com.neighborsystem.durian.restapi.api.HttpMethod;
import com.nssoft.controller.AbsQuery;
import com.nssoft.exception.AuthFailException;
import com.nssoft.model.Success;
import com.nssoft.util.RequestUtil;
/**
*
* @ClassName Login
* @Description Copyright (c) 2014 by NS Soft.
* @author xuliguo
* @date 2015年7月24日 上午9:20:21
* @version V1.0
*
*/
@SuppressWarnings({"unused", "rawtypes"})
@Controller("/v1/api/user/login.json")
public class Login extends AbsQuery<Success> {
private static final Logger logger = Logger.getLogger(Login.class);
@Override
public Success executeAPI(HttpServletRequest req,
HttpServletResponse res, String arg2) throws AbsException {
String resultPageURL = InternalResourceViewResolver.FORWARD_URL_PREFIX + "/";
String username = req.getParameter(MustParam.username.name());
String password = req.getParameter(MustParam.password.name());
// 获取HttpSession中的验证码
/*String verifyCode = (String) request.getSession().getAttribute(
"verifyCode");
// 获取用户请求表单中输入的验证码
String submitCode = WebUtils.getCleanParam(request, "verifyCode");
System.out.println("用户[" + username + "]登录时输入的验证码为[" + submitCode
+ "],HttpSession中的验证码为[" + verifyCode + "]");
if (StringUtils.isEmpty(submitCode)
|| !StringUtils.equals(verifyCode, submitCode.toLowerCase())) {
request.setAttribute("message_login", "验证码不正确");
return resultPageURL;
}*/
UsernamePasswordToken token = new UsernamePasswordToken(username,
password);
token.setRememberMe(true);
if (logger.isDebugEnabled())
logger.debug("为了验证登录用户而封装的token为"
+ ReflectionToStringBuilder.toString(token,
ToStringStyle.MULTI_LINE_STYLE));
// 获取当前的Subject
Subject currentUser = SecurityUtils.getSubject();
try {
if (logger.isDebugEnabled())
logger.debug("对用户[" + username + "]进行登录验证..验证开始");
currentUser.login(token);
if (logger.isDebugEnabled())
logger.debug("对用户[" + username + "]进行登录验证..验证通过");
resultPageURL = "index.html";
} catch (UnknownAccountException e) {
logger.error(e);
throw new AuthFailException("未知账户");
} catch (IncorrectCredentialsException e) {
logger.error(e);
throw new AuthFailException("密码错误");
} catch (LockedAccountException e) {
logger.error(e);
throw new AuthFailException("账户已锁定");
} catch (ExcessiveAttemptsException e) {
logger.error(e);
throw new AuthFailException("用户名或密码错误次数过多");
} catch (AuthenticationException e) {
logger.error(e);
throw new AuthFailException("登录失败");
}
if (currentUser.isAuthenticated()) {
boolean isAjaxRequest = RequestUtil.isAjaxRequest(req);
if (isAjaxRequest) {
return new Success(true, "登录成功.");
} else {
try {
res.sendRedirect(req.getContextPath() + "/index.html");
} catch (IOException e) {
logger.error(e);
}
}
} else {
token.clear();
}
return null;
}
@Override
public String getApiId() {
return "auth_login";
}
@Override
public HttpMethod getHttpMethod() {
return HttpMethod.POST;
}
@Override
public Class getMustParameter() throws AbsException {
return MustParam.class;
}
@Override
public Class getOptionParameter() throws AbsException {
return null;
}
private enum MustParam {
username, password
}
}
| [
"songkakasi@163.com"
] | songkakasi@163.com |
8bae693110c74c094d0943e92bae7d84019b03dc | 6879ba7829d313c4e87cf6e1ba2957c44cdae713 | /APCS Final Project/src/Spike.java | 311db9cac4200042a1912499dfa4ce68ca7db460 | [] | no_license | VictorSuciu/APCS-Final-Project | 49c28f46f6d4bea7ea203dd93b309528e7b48cd8 | 8b4885719ac657658f989298ef87809fb8baebc0 | refs/heads/master | 2021-01-21T18:42:41.296342 | 2018-08-24T02:00:11 | 2018-08-24T02:00:11 | 92,074,599 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 676 | java |
import java.awt.Rectangle;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
public class Spike {
private int x;
private int y;
private Rectangle spikeHitBox = new Rectangle(30, 30);
JLabel spike;
public Spike(int x, int y) {
this.x = x * 30;
this.y = y * 30;
spike = new JLabel(new ImageIcon("Platformer Spike.png"));
spike.setBounds(this.x, this.y, 30, 30);
Game.panel.add(spike);
Game.panel.setComponentZOrder(spike, 0);
spikeHitBox.setLocation(spike.getX(), spike.getY());
}
public Rectangle getHitBox() {
return spikeHitBox;
}
public void remove() {
Game.panel.remove(spike);
spikeHitBox.reshape(0, 0, 0, 0);
}
}
| [
"Victor@10.0.0.28"
] | Victor@10.0.0.28 |
dfdd691ea5e47286a9d96c859a0cfa7c4753f5d5 | bf5c50cbcb40a479eb255c757bcb06186a25fa9f | /src/FixDebugSix2.java | 4390c3ad0c5810ac34e6db19a72a68c1ff40e6a9 | [] | no_license | jverea/Chapter6 | 5f8293cb7a1cfec92634f0468378bd63a255db25 | f14b59efae422cef988320b4909669b8066056e4 | refs/heads/master | 2020-05-21T01:08:40.826495 | 2019-05-22T18:13:24 | 2019-05-22T18:13:24 | 185,849,657 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 629 | java | // FixDebugSix2.java
// Display every character between Unicode 65 and 122
// Start new line after 20 characters
public class FixDebugSix2 {
public static void main(String args[]) {
char letter;
int a;
final int MIN = 65;
final int MAX = 122;
final int STOPLINE1 = 85;
final int STOPLINE2 = 122;
for (a = MIN; a <= MAX; a++) {
letter = (char) a;
System.out.print(" " + letter);
// if (a == letter) (a == a) {
System.out.print("");
}
System.out.println("/nEnd of application");
}
} | [
"jvereagovan2018@gmail.com"
] | jvereagovan2018@gmail.com |
aa71897c0ac1f0dd35c7f1638f2ff5995c302272 | 30ce31989513fe03ca0736555adf6e8b80b1c093 | /src/com/cisco/axl/api/_8/UpdateGatekeeperReq.java | 29b1c4be909ebc78692e4b30e7d9e2c27a2daa72 | [] | no_license | axenlarde/Woot | 21374d0c29e9d6e0b6f0f91f2cbb455f2e2a875e | 447728a2793f42530884bb0f3f388d33b3708bc1 | refs/heads/master | 2022-04-09T19:19:33.826592 | 2020-02-07T10:36:55 | 2020-02-07T10:36:55 | 115,440,477 | 4 | 1 | null | null | null | null | UTF-8 | Java | false | false | 4,357 | java |
package com.cisco.axl.api._8;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for UpdateGatekeeperReq complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="UpdateGatekeeperReq">
* <complexContent>
* <extension base="{http://www.cisco.com/AXL/API/8.5}NameAndGUIDRequest">
* <sequence>
* <element name="newName" type="{http://www.cisco.com/AXL/API/8.5}UniqueString128" minOccurs="0"/>
* <element name="description" type="{http://www.cisco.com/AXL/API/8.5}String128" minOccurs="0"/>
* <element name="rrqTimeToLive" type="{http://www.cisco.com/AXL/API/8.5}XInteger" minOccurs="0"/>
* <element name="retryTimeout" type="{http://www.cisco.com/AXL/API/8.5}XInteger" minOccurs="0"/>
* <element name="enableDevice" type="{http://www.cisco.com/AXL/API/8.5}boolean" minOccurs="0"/>
* </sequence>
* </extension>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "UpdateGatekeeperReq", propOrder = {
"newName",
"description",
"rrqTimeToLive",
"retryTimeout",
"enableDevice"
})
public class UpdateGatekeeperReq
extends NameAndGUIDRequest
{
protected String newName;
protected String description;
@XmlElement(defaultValue = "60")
protected String rrqTimeToLive;
@XmlElement(defaultValue = "300")
protected String retryTimeout;
@XmlElement(defaultValue = "true")
protected String enableDevice;
/**
* Gets the value of the newName property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getNewName() {
return newName;
}
/**
* Sets the value of the newName property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setNewName(String value) {
this.newName = value;
}
/**
* Gets the value of the description property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getDescription() {
return description;
}
/**
* Sets the value of the description property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setDescription(String value) {
this.description = value;
}
/**
* Gets the value of the rrqTimeToLive property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getRrqTimeToLive() {
return rrqTimeToLive;
}
/**
* Sets the value of the rrqTimeToLive property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setRrqTimeToLive(String value) {
this.rrqTimeToLive = value;
}
/**
* Gets the value of the retryTimeout property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getRetryTimeout() {
return retryTimeout;
}
/**
* Sets the value of the retryTimeout property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setRetryTimeout(String value) {
this.retryTimeout = value;
}
/**
* Gets the value of the enableDevice property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getEnableDevice() {
return enableDevice;
}
/**
* Sets the value of the enableDevice property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setEnableDevice(String value) {
this.enableDevice = value;
}
}
| [
"Alexandre@NANALENO"
] | Alexandre@NANALENO |
06ceef3049ce7c76bb16bdd74503a4d1ec137c5c | 1ffb10e631e9ad0a43086c153ef3c5b96cc11ff0 | /invoicing/src/main/java/com/bjpowernode/tag/vo/easyui/Tab.java | 6a60516f4da4c48ff45c5f5c3f9168fe7a612448 | [] | no_license | Eason2001/Java_EE_Development | c758af9a4a1eef7f1d9f005e32c2f89869de5662 | 3d41d99e3973b1fa9b166029f6bb9eaa5712bb70 | refs/heads/master | 2021-01-09T05:18:54.901811 | 2017-02-03T15:28:39 | 2017-02-03T15:28:39 | 80,795,487 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,720 | java | package com.bjpowernode.tag.vo.easyui;
/**
* TAB模型
*
* @author
*
*/
public class Tab {
private String href;
private String iframe;
private String id;
private String title;
private String icon = "'icon-default'";
private String width;// 宽度
private String heigth;// 高度
private boolean cache;
private String content;
private boolean closable=true;
/**
* @return the closable
*/
public boolean isClosable() {
return closable;
}
/**
* @param closable
* the closable to set
*/
public void setClosable(boolean closable) {
this.closable = closable;
}
public String getHref() {
return href;
}
public void setHref(String href) {
this.href = href;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getIcon() {
return icon;
}
public void setIcon(String icon) {
this.icon = icon;
}
public String getWidth() {
return width;
}
public void setWidth(String width) {
this.width = width;
}
public String getHeigth() {
return heigth;
}
public void setHeigth(String heigth) {
this.heigth = heigth;
}
public boolean isCache() {
return cache;
}
public void setCache(boolean cache) {
this.cache = cache;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getIframe() {
return iframe;
}
public void setIframe(String iframe) {
this.iframe = iframe;
}
}
| [
"zhicheng2001@gmail.com"
] | zhicheng2001@gmail.com |
4afa03b64f8abadbfb01961fb19928fe1ede9d16 | 7f5f7c73e41d7fba4946b628815c71e0d4208b04 | /FrequentFlyerApi/src/main/java/com/frequentflyer/controller/exception/UnauthorizedMemberException.java | cb93dd6f25e1f8678b9cd8783d5b8582067e6bae | [] | no_license | Theo3285/FrequentFlyerMicroservice | 63d911774c5ff0f0acd324d0009d286895bd25c8 | a65ae0dbf814b5cf7172c5b6e0ec57ab3811fae9 | refs/heads/master | 2021-09-03T15:52:47.972609 | 2018-01-10T07:05:33 | 2018-01-10T07:05:33 | 115,990,409 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 206 | java | package com.frequentflyer.controller.exception;
public class UnauthorizedMemberException extends RuntimeException {
public UnauthorizedMemberException(String message) {
super(message);
}
}
| [
"christophe@thepaut.net"
] | christophe@thepaut.net |
1da5bc42a6d5e035459e1ccdf54c8d5a1318d57b | 7bda8a85375719c677d17591097cc3da69c85f95 | /wzorce/WzorceProjektowe/src/factory/NY/NYPizzaStore.java | 0adbb62fe3a231ed164028572fcba0b8151a7038 | [] | no_license | tomekb82/WzorceProjektowe | 5e95569ad1c824dcccab228a07706bb541617cf7 | c546caf897d7041880d0adec6088f9184349f9f2 | refs/heads/master | 2020-04-10T21:12:28.627837 | 2016-12-05T17:48:37 | 2016-12-05T17:48:37 | 65,686,988 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 773 | java | package factory.NY;
import factory.CheesePizza;
import factory.PepperoniPizza;
import factory.Pizza;
import factory.PizzaStore;
import factory.ingredients.PizzaIngredientFactory;
/**
* Created by tomek on 15.08.16.
*/
public class NYPizzaStore extends PizzaStore {
@Override
protected Pizza createPizza(String type) {
Pizza pizza = null;
PizzaIngredientFactory ingredientFactory = new NYPizzaIngredientFactory();
if(type.equals("cheese")){
pizza = new CheesePizza(ingredientFactory);
pizza.setName("NY cheese pizza");
} else if(type.equals("pepperoni")){
pizza = new PepperoniPizza(ingredientFactory);
pizza.setName("NY pepperoni pizza");
}
return pizza;
}
}
| [
"tomasz.belina@qualent.eu"
] | tomasz.belina@qualent.eu |
c12527c466e57d3ad3df2256a06c0c606cbc1845 | d493276f3a09b6f161b9d3a79d5df55f48a0557c | /LeetCode_ImplementPrefixTrie.java | d6566f55d7a27fa9990110e3498c5a963b0df4f8 | [] | no_license | AnneMayor/algorithmstudy | 31e034e9e7c8ffab0601f58b9ec29bea62aacf24 | 944870759ff43d0c275b28f0dcf54f5dd4b8f4b1 | refs/heads/master | 2023-04-26T21:25:21.679777 | 2023-04-15T09:08:02 | 2023-04-15T09:08:02 | 182,223,870 | 0 | 0 | null | 2021-06-20T06:49:02 | 2019-04-19T07:42:00 | C++ | UTF-8 | Java | false | false | 1,929 | java | public class LeetCode_ImplementPrefixTrie {
static class TrieNode {
private TrieNode[] links;
private final int R = 26;
private boolean isEnd;
public TrieNode() {
links = new TrieNode[R];
}
public boolean containsKey(char ch) {
return links[ch - 'a'] != null;
}
public TrieNode get(char ch) {
return links[ch - 'a'];
}
public void put(char ch, TrieNode node) {
links[ch - 'a'] = node;
}
public void setEnd() {
isEnd = true;
}
public boolean getEnd() {
return isEnd;
}
}
static class Trie {
private TrieNode root;
public Trie() {
root = new TrieNode();
}
public void insert(String word) {
TrieNode node = root;
for(int i = 0; i < word.length(); i++) {
char currentChar = word.charAt(i);
if(!node.containsKey(currentChar)) {
node.put(currentChar, new TrieNode());
}
node = node.get(currentChar);
}
node.setEnd();
}
private TrieNode searchPrefix(String prefix) {
TrieNode node = root;
for(int i = 0; i < prefix.length(); i++) {
char currentChar = prefix.charAt(i);
if(node.containsKey(currentChar)) {
node = node.get(currentChar);
} else return null;
}
return node;
}
public boolean search(String word) {
TrieNode node = searchPrefix(word);
return node != null && node.getEnd();
}
public boolean startsWith(String prefix) {
TrieNode node = searchPrefix(prefix);
return node != null;
}
}
}
| [
"melllamodahye@gmail.com"
] | melllamodahye@gmail.com |
7337d23b61c10c9a293dab9dd30882ca96b7df65 | 87a58c160797ef58f36316799685a680b781e487 | /src/main/java/com/course/springboot/repositories/services/EmployeesService.java | ec0a5d9e79bab4acbc13ee0c7471b61fed50d2d1 | [] | no_license | Goico91/springboot-course-repositories | 77127c30a6b97e9ae11999541d1ff1603178d2a2 | 5c8640fa96ed07834f249b69c1ddce29eb589232 | refs/heads/master | 2023-01-31T23:46:43.416973 | 2020-12-12T15:54:14 | 2020-12-12T15:54:14 | 318,290,799 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 640 | java | package com.course.springboot.repositories.services;
import com.course.springboot.repositories.config.error.RestException;
import com.course.springboot.repositories.vo.Employee;
import org.springframework.data.domain.Pageable;
import java.util.List;
public interface EmployeesService {
List<Employee> getEmployees(String name, String surname, Integer office, Pageable pageable);
Employee getEmployee(int id) throws RestException;
void createEmployee(Employee employee) throws RestException;
void updateEmployee(int id, Employee employee) throws RestException;
void deleteEmployee(int id) throws RestException;
}
| [
"Carlos.Goicoechea"
] | Carlos.Goicoechea |
6a7e1f8b86f4373ca59a1e4f897499e59b2beac8 | 4c5b4f00609d6386af5c4093c887445e3bc4a644 | /src/main/java/com/chen/lvyou/entity/Admin.java | 43516af370da458ef67fd8864dbd5f49868edb1f | [] | no_license | vacantlot/lvyou | 42edb856f6a88bc43c994782bf402adf40e92449 | 94699021ca6de11b23d02a7c566aea39a9d6b454 | refs/heads/master | 2020-05-23T13:30:01.321358 | 2019-05-17T13:06:50 | 2019-05-17T13:06:50 | 180,379,492 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 487 | java | package com.chen.lvyou.entity;
public class Admin {
private String username;
private String password;
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username == null ? null : username.trim();
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password == null ? null : password.trim();
}
} | [
"1011755994@qq.com"
] | 1011755994@qq.com |
54f8601b4108423034e7dd5cbce6b8f1a8edcd1f | 498dd2daff74247c83a698135e4fe728de93585a | /clients/google-api-services-content/v2/1.29.2/com/google/api/services/content/model/OrdersInStoreRefundLineItemRequest.java | 5d4d3389d6549d6865310fe19aec2898016cec90 | [
"Apache-2.0"
] | permissive | googleapis/google-api-java-client-services | 0e2d474988d9b692c2404d444c248ea57b1f453d | eb359dd2ad555431c5bc7deaeafca11af08eee43 | refs/heads/main | 2023-08-23T00:17:30.601626 | 2023-08-20T02:16:12 | 2023-08-20T02:16:12 | 147,399,159 | 545 | 390 | Apache-2.0 | 2023-09-14T02:14:14 | 2018-09-04T19:11:33 | null | UTF-8 | Java | false | false | 6,864 | java | /*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
/*
* This code was generated by https://github.com/googleapis/google-api-java-client-services/
* Modify at your own risk.
*/
package com.google.api.services.content.model;
/**
* Model definition for OrdersInStoreRefundLineItemRequest.
*
* <p> This is the Java data model class that specifies how to parse/serialize into the JSON that is
* transmitted over HTTP when working with the Content API for Shopping. For a detailed explanation
* see:
* <a href="https://developers.google.com/api-client-library/java/google-http-java-client/json">https://developers.google.com/api-client-library/java/google-http-java-client/json</a>
* </p>
*
* @author Google, Inc.
*/
@SuppressWarnings("javadoc")
public final class OrdersInStoreRefundLineItemRequest extends com.google.api.client.json.GenericJson {
/**
* The amount that is refunded. Required.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private Price amountPretax;
/**
* Tax amount that correspond to refund amount in amountPretax. Required.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private Price amountTax;
/**
* The ID of the line item to return. Either lineItemId or productId is required.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.String lineItemId;
/**
* The ID of the operation. Unique across all operations for a given order.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.String operationId;
/**
* The ID of the product to return. This is the REST ID used in the products service. Either
* lineItemId or productId is required.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.String productId;
/**
* The quantity to return and refund.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.Long quantity;
/**
* The reason for the return.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.String reason;
/**
* The explanation of the reason.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.String reasonText;
/**
* The amount that is refunded. Required.
* @return value or {@code null} for none
*/
public Price getAmountPretax() {
return amountPretax;
}
/**
* The amount that is refunded. Required.
* @param amountPretax amountPretax or {@code null} for none
*/
public OrdersInStoreRefundLineItemRequest setAmountPretax(Price amountPretax) {
this.amountPretax = amountPretax;
return this;
}
/**
* Tax amount that correspond to refund amount in amountPretax. Required.
* @return value or {@code null} for none
*/
public Price getAmountTax() {
return amountTax;
}
/**
* Tax amount that correspond to refund amount in amountPretax. Required.
* @param amountTax amountTax or {@code null} for none
*/
public OrdersInStoreRefundLineItemRequest setAmountTax(Price amountTax) {
this.amountTax = amountTax;
return this;
}
/**
* The ID of the line item to return. Either lineItemId or productId is required.
* @return value or {@code null} for none
*/
public java.lang.String getLineItemId() {
return lineItemId;
}
/**
* The ID of the line item to return. Either lineItemId or productId is required.
* @param lineItemId lineItemId or {@code null} for none
*/
public OrdersInStoreRefundLineItemRequest setLineItemId(java.lang.String lineItemId) {
this.lineItemId = lineItemId;
return this;
}
/**
* The ID of the operation. Unique across all operations for a given order.
* @return value or {@code null} for none
*/
public java.lang.String getOperationId() {
return operationId;
}
/**
* The ID of the operation. Unique across all operations for a given order.
* @param operationId operationId or {@code null} for none
*/
public OrdersInStoreRefundLineItemRequest setOperationId(java.lang.String operationId) {
this.operationId = operationId;
return this;
}
/**
* The ID of the product to return. This is the REST ID used in the products service. Either
* lineItemId or productId is required.
* @return value or {@code null} for none
*/
public java.lang.String getProductId() {
return productId;
}
/**
* The ID of the product to return. This is the REST ID used in the products service. Either
* lineItemId or productId is required.
* @param productId productId or {@code null} for none
*/
public OrdersInStoreRefundLineItemRequest setProductId(java.lang.String productId) {
this.productId = productId;
return this;
}
/**
* The quantity to return and refund.
* @return value or {@code null} for none
*/
public java.lang.Long getQuantity() {
return quantity;
}
/**
* The quantity to return and refund.
* @param quantity quantity or {@code null} for none
*/
public OrdersInStoreRefundLineItemRequest setQuantity(java.lang.Long quantity) {
this.quantity = quantity;
return this;
}
/**
* The reason for the return.
* @return value or {@code null} for none
*/
public java.lang.String getReason() {
return reason;
}
/**
* The reason for the return.
* @param reason reason or {@code null} for none
*/
public OrdersInStoreRefundLineItemRequest setReason(java.lang.String reason) {
this.reason = reason;
return this;
}
/**
* The explanation of the reason.
* @return value or {@code null} for none
*/
public java.lang.String getReasonText() {
return reasonText;
}
/**
* The explanation of the reason.
* @param reasonText reasonText or {@code null} for none
*/
public OrdersInStoreRefundLineItemRequest setReasonText(java.lang.String reasonText) {
this.reasonText = reasonText;
return this;
}
@Override
public OrdersInStoreRefundLineItemRequest set(String fieldName, Object value) {
return (OrdersInStoreRefundLineItemRequest) super.set(fieldName, value);
}
@Override
public OrdersInStoreRefundLineItemRequest clone() {
return (OrdersInStoreRefundLineItemRequest) super.clone();
}
}
| [
"chingor@google.com"
] | chingor@google.com |
6b462737e7eff6a2819a7782fc5cdfa0674fcf1b | 1c6dbfe4cb49a6ffb6cff421e8cb310005008f7d | /core/src/com/honor/enums/Sounds.java | df83f48bdc63447041c756239892fa6c885a18e5 | [] | no_license | Horbee/LD46 | 5346f8551d716390ad91df756901680f63bef4e6 | c1410417998c1921be017440489d158252da82ab | refs/heads/master | 2022-04-28T18:06:24.575191 | 2020-04-28T09:44:05 | 2020-04-28T09:44:05 | 257,116,670 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 80 | java | package com.honor.enums;
public enum Sounds {
HURT, SHOOT, EXPLODE, HEALTH
}
| [
"n.horox@gmail.com"
] | n.horox@gmail.com |
336a5ee5a837b85e203b4a5fcb5962c60d58e8c4 | 87853af5741facd18fac4280510b92e12fef7bb5 | /src/main/java/ru/rudal/cloud/fileserver/entity/Role.java | ad1046e363b2b110835bed8f0634c6d9dd8f50a4 | [] | no_license | rudalexey/CloudFileServer | 2efbd759b31dca55c4ca8ee9691d6e00355b197f | 17fa39f90ac677f0d73d73c87107bfbf644838e3 | refs/heads/master | 2022-09-18T20:18:35.833691 | 2019-12-09T18:55:34 | 2019-12-09T18:55:34 | 222,651,971 | 0 | 0 | null | 2022-09-08T01:04:43 | 2019-11-19T08:57:45 | Java | UTF-8 | Java | false | false | 1,194 | java | package ru.rudal.cloud.fileserver.entity;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.*;
import java.util.Collection;
import java.util.StringJoiner;
/**
* @author Aleksey Rud
*/
@Entity
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Table(name = "cfs_role")
public class Role {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(name = "name",nullable = false)
private String name;
@ManyToMany(mappedBy = "roles")
private Collection<User> users;
@ManyToMany
@JoinTable(
name = "cfs_roles_privileges",
joinColumns = @JoinColumn(
name = "role_id", referencedColumnName = "id"),
inverseJoinColumns = @JoinColumn(
name = "privilege_id", referencedColumnName = "id"))
private Collection<Privilege> privileges;
@Override
public String toString() {
return new StringJoiner(", ", Role.class.getSimpleName() + "[", "]")
.add("id=" + id)
.add("name='" + name + "'")
.toString();
}
}
| [
"alexey.rud@infonetsoft.ru"
] | alexey.rud@infonetsoft.ru |
fe24f0be4d6f629e751bb5956095e243044b854b | 1b7254388e7121f670a857a99bbc35afaffd4d9d | /BeeCost02/src/main/java/com/wbdp/wx/QRcode/util/CreateQRCode.java | af8a5f34019e46d41cbe6aaa8cc4f1d3b8ec2305 | [] | no_license | javaxiaowang/wbdpcomm | 4625d5414ace61b5319188f197d80fd86a433616 | 4c3edc6d1ffda1a6e1c453bcbfd1a4fdf0c66f90 | refs/heads/master | 2021-07-09T23:29:30.293509 | 2017-10-10T03:06:47 | 2017-10-10T03:06:47 | 106,360,396 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 2,273 | java | package com.wbdp.wx.QRcode.util;
import java.io.File;
import java.nio.file.Path;
import java.util.Date;
import java.util.HashMap;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.zxing.BarcodeFormat;
import com.google.zxing.EncodeHintType;
import com.google.zxing.MultiFormatWriter;
import com.google.zxing.client.j2se.MatrixToImageWriter;
import com.google.zxing.common.BitMatrix;
import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
import com.wbdp.wx.service.impl.mine.MineSerciceImpl;
public class CreateQRCode {
/**日志log*/
private static Logger log = LoggerFactory.getLogger(CreateQRCode.class);
/**
* 生成二维码
* @return
*/
public static String createQRCode(String content,String savePath,String openid){
int width = 300;//二维码图片的宽度
int height = 300;//二维码图片的高度
String format = "png";//二维码格式
//String content = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxb125fba57e2524e2&redirect_uri=http%3A%2F%2Fwisedp.com%2Fwisemifi%2Fwx%2Fwisemifi%2Ftobuypage&response_type=code&scope=snsapi_base&state=123#wechat_redirect";//二维码内容
//定义二维码内容参数
HashMap hints = new HashMap();
//设置字符集编码格式
hints.put(EncodeHintType.CHARACTER_SET, "UTF-8");
//设置容错等级,在这里我们使用M级别
hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.M);
//设置边框距
hints.put(EncodeHintType.MARGIN, 2);
//生成二维码
try {
String timestamp = String.valueOf(new Date().getTime() / 1000);
//指定二维码内容
BitMatrix bitMatrix = new MultiFormatWriter().encode(content, BarcodeFormat.QR_CODE, width, height,hints);
savePath = savePath+openid+"-"+timestamp+"-qr"+".png";
log.info("生成二维码地址:"+savePath);
//指定生成图片的保存路径 示例:E:/QRcode/test02.jpg
Path file = new File(savePath).toPath();
//生成二维码
MatrixToImageWriter.writeToPath(bitMatrix, format, file);
savePath = "http://wisedp.com/BeeCost/downimg/"+openid+"-"+timestamp+"-qr"+".png";
return savePath;
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
}
| [
"wisedata003@DESKTOP-KT46F12"
] | wisedata003@DESKTOP-KT46F12 |
b1cd6aa98661c7dd0c91221993b174a15ea7519f | 3747d18165ba286e898ab3684b3e7d08f78a1ce8 | /app/src/main/java/com/example/tuananhe/myapplication/floating_bubble/floatingview/ScreenChangedListener.java | ca599849b83c892e2f6c0de4169892e9607ba74c | [] | no_license | anhent-1521/graduation_thesis | 40578ce9ad07fd764a1fc9bec8f2e68f64aba316 | 1341efca050b2f51482e2cbc8571c9b87489322d | refs/heads/develop | 2020-07-12T00:46:31.179183 | 2020-01-09T15:43:52 | 2020-01-09T15:43:52 | 204,678,146 | 1 | 0 | null | 2020-01-09T15:43:55 | 2019-08-27T10:22:54 | Java | UTF-8 | Java | false | false | 1,059 | java | /**
* Copyright 2015 RECRUIT LIFESTYLE CO., LTD.
* <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.example.tuananhe.myapplication.floating_bubble.floatingview;
import android.graphics.Rect;
/**
* スクリーンの変化を扱うリスナです。
*/
interface ScreenChangedListener {
/**
* スクリーンが変化した時に呼び出されます。
*
* @param windowRect System window rect
* @param visibility System UI Mode
*/
void onScreenChanged(Rect windowRect, int visibility);
}
| [
"nguyen.tuan.anhe@framgia.com"
] | nguyen.tuan.anhe@framgia.com |
515439ea1f0f345ebee7f03e61fb60890c56bb95 | 52936a85bccf0f3857404cc2b7b7f4dbcf4f343f | /src/main/java/com/github/ateranimavis/tiny_mcp/TinyV2.java | a23a0484b0c972a59e2d08471d5fcff14bad438f | [
"MIT",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | AterAnimAvis/tiny-mcp | faa7a87e2a0b932e440d8fed79083164044d45d2 | b0c09d064e16af845cc98943d9021139fdd909c9 | refs/heads/master | 2023-06-20T08:18:24.169493 | 2021-03-12T20:22:21 | 2021-03-12T20:22:21 | 330,269,320 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 373 | java | package com.github.ateranimavis.tiny_mcp;
public class TinyV2 extends Main {
public static void main(String[] args) throws Exception {
generate(args, (mcpType, mcpVersion, mappingsChannel, mappingsVersion, yarnVersion, yarnBuild) ->
generate(mcpType, mcpVersion, mappingsChannel, mappingsVersion, yarnVersion, yarnBuild, true)
);
}
}
| [
"AterAnimAvis@gmail.com"
] | AterAnimAvis@gmail.com |
0a6e9794b627625732a3c7ef219d058bc9715d30 | 63e0cd899972adbb117a17d8d40eef8fefb56d62 | /android/android48_fragment/app/src/main/java/com/sc/android48_fragment/viewpager/ViewPagerAdapter.java | 5c6b40beb9190ef3464ad4e93be64f64f0fd5ae9 | [] | no_license | sherazc/playground | 8b90e1f7b624a77a3f3e9cf5f71eecf984aa8180 | 7fe926d2564b12d96f237b253511dd7c2a302b64 | refs/heads/master | 2023-08-16T17:22:29.564713 | 2023-08-16T04:34:52 | 2023-08-16T04:34:52 | 87,116,642 | 2 | 1 | null | 2023-05-04T18:25:45 | 2017-04-03T20:15:15 | PHP | UTF-8 | Java | false | false | 712 | java | package com.sc.android48_fragment.viewpager;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;
import com.sc.android48_fragment.app.R;
public class ViewPagerAdapter extends FragmentStatePagerAdapter {
int[] images = {R.drawable.image1, R.drawable.image2, R.drawable.image3, R.drawable.image4,};
public ViewPagerAdapter(FragmentManager fragmentManager) {
super(fragmentManager);
}
@Override
public Fragment getItem(int position) {
return Fragment04a.newInstance(position, images[position]);
}
@Override
public int getCount() {
return images.length;
}
}
| [
"sheraz@mbp.com"
] | sheraz@mbp.com |
c823712995cada2cb66fc83b4174f1685379d68d | 5505945799e1f10c956e4ca126de67e08de772fa | /src/main/java/blog/service/BlogDaoService.java | b5b84336f9a631d28dad3fef6eb25f81f13cc6a5 | [] | no_license | wyh9527/javablog | df53880e0380f589660e193917497119f40bd8ff | f31c5527974237d42ca17e123a5d91a756e1f997 | refs/heads/master | 2021-09-07T19:46:45.528225 | 2018-02-28T03:53:27 | 2018-02-28T03:53:27 | 117,938,610 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 404 | java | package blog.service;
import java.util.List;
import blog.entity.Blog;
public interface BlogDaoService {
public List<Blog> selectAllBlog();
public Blog findById(Integer id );
public void addBlog(Blog blog);
public void deleteBlog(Integer id);
public boolean updateBlog(Blog blog);
public Integer getBlogByTypeId(Integer typeId);
public List<Blog> BlogByType(Integer typeId);
}
| [
"269446962@qq.com"
] | 269446962@qq.com |
b8efa99bbbbb262fb16efc03996a49424b81d2a2 | e73025430f98612b4bce8faa13abdee1243bb9cd | /module03-examples/module03-question19/src/test/java/com/spring/professional/exam/tutorial/module03/question19/service/EmployeeServiceTest.java | 91c7b345ebbc553035e8de771f175ae4a5ce578d | [] | no_license | a2ankitrai/spring-cert-code-examples | 938ddb647518e735c0ddba3b3809f95ea58750b3 | 491718751129bb0c09cb7bc2608934f7aedb2e81 | refs/heads/master | 2023-03-29T22:16:25.459200 | 2021-03-31T06:32:13 | 2021-03-31T06:32:13 | 331,714,577 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,058 | java | package com.spring.professional.exam.tutorial.module03.question19.service;
import com.spring.professional.exam.tutorial.module03.question19.Runner;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.annotation.Rollback;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.transaction.annotation.Transactional;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = {Runner.class})
public class EmployeeServiceTest {
@Autowired
private EmployeeService employeeService;
@Test
@Transactional
public void shouldRollbackTransaction() {
employeeService.methodWithTransaction();
// ...
}
@Test
@Transactional
@Rollback(false)
public void shouldNotRollbackTransaction() {
employeeService.methodWithTransaction();
// ...
}
} | [
"ankit.rai@payconiq.com"
] | ankit.rai@payconiq.com |
555f4d3f4a07baf0d3f39296c9948af58fe09d51 | 9b1c9a829a21956591e12b5aba6c5fd31748e8b7 | /app/src/main/java/com/example/kyl3g/sunhacksnov2018/Callback/GroceryCallback.java | c14c55a456a0b5c80500bf00938c936e170412f5 | [] | no_license | realkg22/PantryHunt | 665525d21236b83c58474cace933ba736d7d0cba | 8149abda8cd91f60fb4f55a233bdab28f1e1f257 | refs/heads/master | 2022-12-26T10:58:04.314628 | 2020-09-24T06:32:41 | 2020-09-24T06:32:41 | 298,182,065 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 186 | java | package com.example.kyl3g.sunhacksnov2018.Callback;
import com.example.kyl3g.sunhacksnov2018.Objects.Grocery;
public interface GroceryCallback {
void callback(Grocery callback);
}
| [
"kyl3gonzalez22@gmail.com"
] | kyl3gonzalez22@gmail.com |
20ace80008c683fbf455bc3b0da4fa88780c5aa3 | e9ff0a97288a5d54d33a12822be8b16755c01a74 | /app/build/generated/not_namespaced_r_class_sources/debug/r/androidx/viewpager/R.java | 69e4a41b9ad78e7a6041cc45aa5339ae8ad6efe8 | [] | no_license | Josenatr/MPD_Coursework | 9fc18cf34a04184b5e9a89ed8c79f6e78494cada | 0555b9876e17bd2f8e85807ffd57a7ad87bac2ca | refs/heads/master | 2022-04-23T03:11:55.359781 | 2020-04-21T15:50:50 | 2020-04-21T15:50:50 | 257,249,178 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,449 | 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.viewpager;
public final class R {
private R() {}
public static final class attr {
private attr() {}
public static final int alpha = 0x7f020027;
public static final int font = 0x7f02008a;
public static final int fontProviderAuthority = 0x7f02008c;
public static final int fontProviderCerts = 0x7f02008d;
public static final int fontProviderFetchStrategy = 0x7f02008e;
public static final int fontProviderFetchTimeout = 0x7f02008f;
public static final int fontProviderPackage = 0x7f020090;
public static final int fontProviderQuery = 0x7f020091;
public static final int fontStyle = 0x7f020092;
public static final int fontVariationSettings = 0x7f020093;
public static final int fontWeight = 0x7f020094;
public static final int ttcIndex = 0x7f020159;
}
public static final class color {
private color() {}
public static final int notification_action_color_filter = 0x7f0400d3;
public static final int notification_icon_bg_color = 0x7f0400d4;
public static final int ripple_material_light = 0x7f0400df;
public static final int secondary_text_default_material_light = 0x7f0400e1;
}
public static final class dimen {
private dimen() {}
public static final int compat_button_inset_horizontal_material = 0x7f05004b;
public static final int compat_button_inset_vertical_material = 0x7f05004c;
public static final int compat_button_padding_horizontal_material = 0x7f05004d;
public static final int compat_button_padding_vertical_material = 0x7f05004e;
public static final int compat_control_corner_material = 0x7f05004f;
public static final int compat_notification_large_icon_max_height = 0x7f050050;
public static final int compat_notification_large_icon_max_width = 0x7f050051;
public static final int notification_action_icon_size = 0x7f050061;
public static final int notification_action_text_size = 0x7f050062;
public static final int notification_big_circle_margin = 0x7f050063;
public static final int notification_content_margin_start = 0x7f050064;
public static final int notification_large_icon_height = 0x7f050065;
public static final int notification_large_icon_width = 0x7f050066;
public static final int notification_main_column_padding_top = 0x7f050067;
public static final int notification_media_narrow_margin = 0x7f050068;
public static final int notification_right_icon_size = 0x7f050069;
public static final int notification_right_side_padding_top = 0x7f05006a;
public static final int notification_small_icon_background_padding = 0x7f05006b;
public static final int notification_small_icon_size_as_large = 0x7f05006c;
public static final int notification_subtext_size = 0x7f05006d;
public static final int notification_top_pad = 0x7f05006e;
public static final int notification_top_pad_large_text = 0x7f05006f;
}
public static final class drawable {
private drawable() {}
public static final int notification_action_background = 0x7f06006e;
public static final int notification_bg = 0x7f06006f;
public static final int notification_bg_low = 0x7f060070;
public static final int notification_bg_low_normal = 0x7f060071;
public static final int notification_bg_low_pressed = 0x7f060072;
public static final int notification_bg_normal = 0x7f060073;
public static final int notification_bg_normal_pressed = 0x7f060074;
public static final int notification_icon_background = 0x7f060075;
public static final int notification_template_icon_bg = 0x7f060076;
public static final int notification_template_icon_low_bg = 0x7f060077;
public static final int notification_tile_bg = 0x7f060078;
public static final int notify_panel_notification_icon_bg = 0x7f060079;
}
public static final class id {
private id() {}
public static final int action_container = 0x7f07000e;
public static final int action_divider = 0x7f070010;
public static final int action_image = 0x7f070011;
public static final int action_text = 0x7f070018;
public static final int actions = 0x7f070019;
public static final int async = 0x7f070021;
public static final int blocking = 0x7f070025;
public static final int chronometer = 0x7f07002e;
public static final int forever = 0x7f070048;
public static final int icon = 0x7f070050;
public static final int icon_group = 0x7f070051;
public static final int info = 0x7f070055;
public static final int italic = 0x7f070057;
public static final int line1 = 0x7f07005c;
public static final int line3 = 0x7f07005d;
public static final int normal = 0x7f070068;
public static final int notification_background = 0x7f070069;
public static final int notification_main_column = 0x7f07006a;
public static final int notification_main_column_container = 0x7f07006b;
public static final int right_icon = 0x7f070078;
public static final int right_side = 0x7f070079;
public static final int tag_transition_group = 0x7f07009c;
public static final int tag_unhandled_key_event_manager = 0x7f07009d;
public static final int tag_unhandled_key_listeners = 0x7f07009e;
public static final int text = 0x7f0700a0;
public static final int text2 = 0x7f0700a1;
public static final int time = 0x7f0700a4;
public static final int title = 0x7f0700a5;
}
public static final class integer {
private integer() {}
public static final int status_bar_notification_info_maxnum = 0x7f080005;
}
public static final class layout {
private layout() {}
public static final int notification_action = 0x7f09001e;
public static final int notification_action_tombstone = 0x7f09001f;
public static final int notification_template_custom_big = 0x7f090026;
public static final int notification_template_icon_group = 0x7f090027;
public static final int notification_template_part_chronometer = 0x7f09002b;
public static final int notification_template_part_time = 0x7f09002c;
}
public static final class string {
private string() {}
public static final int status_bar_notification_info_overflow = 0x7f0c004a;
}
public static final class style {
private style() {}
public static final int TextAppearance_Compat_Notification = 0x7f0d00ec;
public static final int TextAppearance_Compat_Notification_Info = 0x7f0d00ed;
public static final int TextAppearance_Compat_Notification_Line2 = 0x7f0d00ef;
public static final int TextAppearance_Compat_Notification_Time = 0x7f0d00f2;
public static final int TextAppearance_Compat_Notification_Title = 0x7f0d00f4;
public static final int Widget_Compat_NotificationActionContainer = 0x7f0d015d;
public static final int Widget_Compat_NotificationActionText = 0x7f0d015e;
}
public static final class styleable {
private styleable() {}
public static final int[] ColorStateListItem = { 0x10101a5, 0x101031f, 0x7f020027 };
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[] FontFamily = { 0x7f02008c, 0x7f02008d, 0x7f02008e, 0x7f02008f, 0x7f020090, 0x7f020091 };
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, 0x7f02008a, 0x7f020092, 0x7f020093, 0x7f020094, 0x7f020159 };
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;
}
}
| [
"adam.hosie98@gmail.com"
] | adam.hosie98@gmail.com |
645710eac1f0a317204e5df3999be554e286e5b6 | 0549f6eff732526eba6a85e644c47cfe206258c7 | /src/main/java/com/cartoes/api/security/filters/JwtAuthenticationTokenFilter.java | 441eb833b845de15ed83bbe71e7d106e24c55334 | [] | no_license | hsjferson/cartApp | bab2f6eeb50e864b42f41522235c8c133b66281b | 246dac5cb5540e8e46a31443037656c555d83995 | refs/heads/master | 2022-12-17T01:03:32.473084 | 2020-09-20T19:31:06 | 2020-09-20T19:31:06 | 292,295,980 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,189 | java | package com.cartoes.api.security.filters;
import java.io.IOException;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.web.authentication.WebAuthenticationDetailsSource;
import org.springframework.web.filter.OncePerRequestFilter;
import com.cartoes.api.security.utils.JwtTokenUtil;
public class JwtAuthenticationTokenFilter extends OncePerRequestFilter {
private static final String AUTH_HEADER = "Authorization";
private static final String BEARER_PREFIX = "Bearer ";
@Autowired
private UserDetailsService userDetailsService;
@Autowired
private JwtTokenUtil jwtTokenUtil;
@Override
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain chain) throws ServletException, IOException {
String token = request.getHeader(AUTH_HEADER);
if (token != null && token.startsWith(BEARER_PREFIX)) {
token = token.substring(7);
}
String username = jwtTokenUtil.getUsernameFromToken(token);
if (username != null && SecurityContextHolder.getContext().getAuthentication() == null) {
UserDetails userDetails = this.userDetailsService.loadUserByUsername(username);
if (jwtTokenUtil.tokenValido(token)) {
UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken(userDetails, null, userDetails.getAuthorities());
authentication.setDetails(new WebAuthenticationDetailsSource().buildDetails(request));
SecurityContextHolder.getContext().setAuthentication(authentication);
}
}
chain.doFilter(request, response);
}
}
| [
"jferson919@gmail.com"
] | jferson919@gmail.com |
ecaa9d82f1d196ac1885f2f294a05ba8e1fed80b | 503e92bb3243deb6e1250c6a18489004510d91da | /digita.innovation.one.test/src/digital/innovation/one/test/Main.java | b8ec0d563e877ff87b89837c45d5b72ac31c1547 | [] | no_license | Felipe-builder/java-modular.dio | 5b3262ba52f5e8b0bdefcf90d73b26a5a351ea61 | 53be02aca1120216816959425120076733c7d694 | refs/heads/main | 2023-06-22T12:24:38.891363 | 2021-07-21T00:52:47 | 2021-07-21T00:52:47 | 387,950,942 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 231 | java | package digital.innovation.one.test;
//import digital.innovation.one.utils.Calculadora; Error
public class Main {
public static void main(String[] args) {
// Calculadora calculadora = new Calculadora(); ERROR
}
}
| [
"felipesvascon@gmail.com"
] | felipesvascon@gmail.com |
36a1b265ee18de4327dbd722d9e98b4380edeed9 | 55fa97889d0144ecb189b121a01834a13cdb4925 | /app/src/main/java/com/mgtv/exodemo/MyApplication.java | b2b08aaa3801730c67294af62c5979c30cd02fec | [] | no_license | xiaxiaxa/ExoPlayerDemo | 3d8d5e58b10eb8b690512f6df3558284966759f1 | 01724f3fb5e6410bdbdb36126be2896bd2e5e263 | refs/heads/master | 2022-11-14T05:19:22.849188 | 2020-07-14T10:35:07 | 2020-07-14T10:35:07 | 279,475,132 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,997 | java | package com.mgtv.exodemo;
import android.app.Application;
import com.google.android.exoplayer2.upstream.DataSource;
import com.google.android.exoplayer2.upstream.DefaultDataSourceFactory;
import com.google.android.exoplayer2.upstream.DefaultHttpDataSourceFactory;
import com.google.android.exoplayer2.upstream.FileDataSourceFactory;
import com.google.android.exoplayer2.upstream.HttpDataSource;
import com.google.android.exoplayer2.upstream.TransferListener;
import com.google.android.exoplayer2.upstream.cache.Cache;
import com.google.android.exoplayer2.upstream.cache.CacheDataSource;
import com.google.android.exoplayer2.upstream.cache.CacheDataSourceFactory;
import com.google.android.exoplayer2.upstream.cache.NoOpCacheEvictor;
import com.google.android.exoplayer2.upstream.cache.SimpleCache;
import com.google.android.exoplayer2.util.Util;
import java.io.File;
public class MyApplication extends Application {
protected String userAgent;
private Cache downloadCache;
private static final String DOWNLOAD_CONTENT_DIRECTORY = "downloads";
private File downloadDirectory;
@Override
public void onCreate() {
super.onCreate();
userAgent = Util.getUserAgent(this, "ExoPlayer2018");
}
/** Returns a {@link DataSource.Factory}. */
public DataSource.Factory buildDataSourceFactory(TransferListener listener) {
DefaultDataSourceFactory upstreamFactory =
new DefaultDataSourceFactory(this, listener, buildHttpDataSourceFactory(listener));
return buildReadOnlyCacheDataSource(upstreamFactory, getDownloadCache());
}
/** Returns a {@link HttpDataSource.Factory}. */
public HttpDataSource.Factory buildHttpDataSourceFactory(
TransferListener listener) {
return new DefaultHttpDataSourceFactory(userAgent, listener);
}
private synchronized Cache getDownloadCache() {
if (downloadCache == null) {
File downloadContentDirectory = new File(getDownloadDirectory(), DOWNLOAD_CONTENT_DIRECTORY);
downloadCache = new SimpleCache(downloadContentDirectory, new NoOpCacheEvictor());
}
return downloadCache;
}
private static CacheDataSourceFactory buildReadOnlyCacheDataSource(
DefaultDataSourceFactory upstreamFactory, Cache cache) {
return new CacheDataSourceFactory(
cache,
upstreamFactory,
new FileDataSourceFactory(),
/* cacheWriteDataSinkFactory= */ null,
CacheDataSource.FLAG_IGNORE_CACHE_ON_ERROR,
/* eventListener= */ null);
}
private File getDownloadDirectory() {
if (downloadDirectory == null) {
downloadDirectory = getExternalFilesDir(null);
if (downloadDirectory == null) {
downloadDirectory = getFilesDir();
}
}
return downloadDirectory;
}
}
| [
"xiawei@mgtv.com"
] | xiawei@mgtv.com |
482af4a04a432d4e8cdbbf073db2f852a78e4c9b | b4f95b0d4b90c50f692e6334796baa8be9262bda | /app/src/main/java/com/example/bankomat/MainActivity.java | 8674d3fb08814269fb8096aefd5338b72a8e8e42 | [] | no_license | MadWilson/Bankomat | 94e1d4f6c4d890748f49626ea4654c7dd6170938 | 7da801caa76fb966c4848afcd01c35490804b5ea | refs/heads/master | 2023-03-22T08:03:51.326555 | 2021-03-14T12:18:55 | 2021-03-14T12:18:55 | 347,628,498 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 333 | java | package com.example.bankomat;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
} | [
"filippovsergey0610@gmail.com"
] | filippovsergey0610@gmail.com |
d4faa92ef2105d36466bffca95bc0e9b4f1dda78 | 9f5afaa9b4854539a5f8c9ff3ff1030e7e80e3a2 | /bravo/trunk/src/java/com/cutty/bravo/components/common/web/NewsAction.java | 99f3f722c12834a2ffe07de83f9b11d4eb704005 | [] | no_license | derekzhang79/cutty | 523619bf3287dd5fc1ca9f05fa9d54b63fe3f432 | fcada4a51c113f8f29896909581d6b284bcf89be | refs/heads/master | 2020-06-19T19:56:59.294781 | 2014-03-24T07:38:00 | 2014-03-24T07:38:00 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,263 | java | /* com.cutty.bravo.components.common.web.NewsAction.java
{{IS_NOTE
* <p>
* <a href="NewsAction.java.html"><i>View Source</i></a>
* </p>
History:
2008-11-10 ����16:48:53, Created by Cathy.Lin
}}IS_NOTE
Copyright (C) 2008 Bravo Corporation. All Rights Reserved.
*/
package com.cutty.bravo.components.common.web;
import java.io.IOException;
import java.util.List;
import javax.servlet.ServletException;
import org.apache.struts2.ServletActionContext;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.ParentPackage;
import com.cutty.bravo.components.common.domain.News;
import com.cutty.bravo.components.common.manager.NewsManager;
import com.cutty.bravo.core.web.handler.RequestHandler;
import com.cutty.bravo.core.web.struts2.EntityAction;
@Namespace("/common")
@ParentPackage("bravo")
public class NewsAction extends EntityAction<News> {
private static final long serialVersionUID = 7084749492129233473L;
private NewsManager newsManager;
public NewsManager getNewsManager() {
return newsManager;
}
public void setNewsManager(NewsManager newsManager) {
this.newsManager = newsManager;
}
public String viewNews() throws ServletException, IOException {
List<News> newsList = newsManager.getNews();
ServletActionContext.getRequest().setAttribute("bravoHome", RequestHandler.getContextRequestHandler().getRequest().getContextPath());
ServletActionContext.getRequest().setAttribute("newsList", newsList);
return "show";
}
public String viewDetailNews() throws ServletException, IOException {
int newsID = Integer.parseInt(ServletActionContext.getRequest()
.getParameter("id"));
List<News> singleNewsList = newsManager.getSingleNews(newsID);
News singleNews = new News();
singleNews = singleNewsList.get(0);
ServletActionContext.getRequest().setAttribute("title", singleNews.getTitle());
ServletActionContext.getRequest().setAttribute("content", singleNews.getContent());
ServletActionContext.getRequest().setAttribute("publisher", singleNews.getPublisher());
ServletActionContext.getRequest().setAttribute("createDt", singleNews.getCreateDt());
return "detailShow";
}
}
| [
"wujx21cn@gmail.com"
] | wujx21cn@gmail.com |
167fb60c1fa834bfc20c918d82cbcd8f98abf166 | ad48405d7da6dfca768a67bcd1bcd7be2e97235e | /src/com/baidu/ai/dbconnect/DBHelper.java | 2c4aa43edaa5528e343e12afa02558ec5bdf2458 | [
"Apache-2.0"
] | permissive | yuanhang110/Food-identify | 9252ce751d6c23d83c863b3575565535e4a50907 | 609e4aea4a7b4aa0bfc5f68c5c20ebb90015039e | refs/heads/master | 2022-08-25T11:56:15.096680 | 2020-05-22T18:42:00 | 2020-05-22T18:42:00 | 134,068,978 | 1 | 0 | null | 2020-05-22T18:42:01 | 2018-05-19T14:26:22 | Java | GB18030 | Java | false | false | 1,007 | java | package com.baidu.ai.dbconnect;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
/**
* 用于建立数据库连接的类
*/
public class DBHelper {
private static final String DB_CONN_RUL = "jdbc:mysql://localhost:3306/DishData?serverTimezone=UTC";
private static final String DB_USER_NAME = "root";
private static final String DB_PASSWORD = "920691910";
/**
* 获得一个连接, 连接数据库
*
* @return connection类对象
*/
public static Connection getConnection() {
Connection connection = null;
try {
// 加载驱动
Class.forName("com.mysql.cj.jdbc.Driver");
// 生成连接
connection = DriverManager.getConnection(DB_CONN_RUL, DB_USER_NAME, DB_PASSWORD);
} catch (SQLException e) {
e.printStackTrace();
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
return connection;
}
}
| [
"920691910@qq.com"
] | 920691910@qq.com |
c36c329d7d7f33a52519534c3554a0cee4f82d29 | 2cb0b7a4fba65289d1e84b01713ef6c539d29b3a | /SoulPACK ver.1.4/src/net/sf/odinms/client/status/MonsterStatusEffect.java | 3b06e8ac18568a376a35538e5dd4f611a57e399c | [] | no_license | godtaehee/SoulPack1.4 | 1f9c1122317a4b77ec7f03163071acb24a6e6aa1 | 55a1ab2dc4a6ae28f2fde9927eabe033f4eb9be1 | refs/heads/main | 2023-06-02T10:15:51.252407 | 2021-06-16T15:30:08 | 2021-06-16T15:30:08 | 377,543,247 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,430 | java | /*
This file is part of the OdinMS Maple Story Server
Copyright (C) 2008 Patrick Huy <patrick.huy@frz.cc>
Matthias Butz <matze@odinms.de>
Jan Christian Meyer <vimes@odinms.de>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License version 3
as published by the Free Software Foundation. You may not use, modify
or distribute this program under any other version of the
GNU Affero General Public License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package net.sf.odinms.client.status;
import java.util.Map;
import java.util.concurrent.ScheduledFuture;
import net.sf.odinms.client.ISkill;
import net.sf.odinms.tools.ArrayMap;
public class MonsterStatusEffect {
private Map<MonsterStatus, Integer> stati;
private ISkill skill;
private boolean monsterSkill;
private ScheduledFuture<?> cancelTask;
private ScheduledFuture<?> poisonSchedule;
public MonsterStatusEffect(Map<MonsterStatus, Integer> stati, ISkill skillId, boolean monsterSkill) {
this.stati = new ArrayMap<MonsterStatus, Integer>(stati);
this.skill = skillId;
this.monsterSkill = monsterSkill;
}
public Map<MonsterStatus, Integer> getStati() {
return stati;
}
public Integer setValue(MonsterStatus status, Integer newVal) {
return stati.put(status, newVal);
}
public ISkill getSkill() {
return skill;
}
public boolean isMonsterSkill() {
return monsterSkill;
}
public ScheduledFuture<?> getCancelTask() {
return cancelTask;
}
public void setCancelTask(ScheduledFuture<?> cancelTask) {
this.cancelTask = cancelTask;
}
public void removeActiveStatus(MonsterStatus stat) {
stati.remove(stat);
}
public void setPoisonSchedule(ScheduledFuture<?> poisonSchedule) {
this.poisonSchedule = poisonSchedule;
}
public void cancelPoisonSchedule() {
if (poisonSchedule != null) {
poisonSchedule.cancel(false);
}
}
} | [
"wonderfulhuman@naver.com"
] | wonderfulhuman@naver.com |
a6c97fddf7b3cfcb32d5863237f434884d433ab7 | 62d60146d619f92aba687ff384e3a61b81e18cd0 | /providers/azureblob/src/main/java/org/jclouds/azureblob/binders/BindAzureContentMetadataToRequest.java | 2a577754a4d6a77619e66a39dcb725d755a21c0a | [
"Apache-2.0"
] | permissive | rackspace/jclouds | 991f406292eb762657cf057aec1adadb9e34d6d9 | 9662edf9032572b3d1147c78f0556a5cdfe37fc0 | refs/heads/master | 2020-12-25T15:40:44.578960 | 2016-08-29T22:09:07 | 2016-08-30T09:14:33 | 10,088,197 | 2 | 1 | null | 2014-03-01T01:56:17 | 2013-05-15T21:18:47 | Java | UTF-8 | Java | false | false | 2,891 | java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jclouds.azureblob.binders;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
import javax.inject.Singleton;
import org.jclouds.azure.storage.reference.AzureStorageHeaders;
import org.jclouds.http.HttpRequest;
import org.jclouds.io.ContentMetadata;
import org.jclouds.rest.Binder;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Multimaps;
@Singleton
public class BindAzureContentMetadataToRequest implements Binder {
public BindAzureContentMetadataToRequest() {
}
@SuppressWarnings("unchecked")
@Override
public <R extends HttpRequest> R bindToRequest(R request, Object input) {
checkArgument(checkNotNull(input, "input") instanceof ContentMetadata,
"this binder is only valid for ContentMetadata");
checkNotNull(request, "request");
ContentMetadata contentMetadata = (ContentMetadata) input;
ImmutableMap.Builder<String, String> headers = ImmutableMap.builder();
String cacheControl = contentMetadata.getCacheControl();
if (cacheControl != null) {
headers.put(AzureStorageHeaders.CACHE_CONTROL, cacheControl);
}
String contentDisposition = contentMetadata.getContentDisposition();
if (contentDisposition != null) {
headers.put(AzureStorageHeaders.CONTENT_DISPOSITION, contentDisposition);
}
String contentEncoding = contentMetadata.getContentEncoding();
if (contentEncoding != null) {
headers.put(AzureStorageHeaders.CONTENT_ENCODING, contentEncoding);
}
String contentLanguage = contentMetadata.getContentLanguage();
if (contentLanguage != null) {
headers.put(AzureStorageHeaders.CONTENT_LANGUAGE, contentLanguage);
}
String contentType = contentMetadata.getContentType();
if (contentType != null) {
headers.put(AzureStorageHeaders.CONTENT_TYPE, contentType);
}
return (R) request.toBuilder().replaceHeaders(Multimaps.forMap(headers.build())).build();
}
}
| [
"gaul@apache.org"
] | gaul@apache.org |
e3c50f1dd3837bb404688e4c0d5798771d3a010e | 582b3b233d9c979323aabed1749d83d7b9fa0228 | /loginsite/src/java/login/AllUserServ.java | 5937d8a892a72477aaf3ac45a1ce9ba583315bab | [] | no_license | PadminiNancy/Hiberuts | 227abd500c6732327d7db190056161f901c9c336 | db7991ccd548b0bfb936f1f290d4e95137da6d0d | refs/heads/master | 2020-04-13T00:02:42.708308 | 2018-12-22T19:23:18 | 2018-12-22T19:23:18 | 162,836,329 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,152 | java | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package login;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.*;
import javax.servlet.RequestDispatcher;
import org.hibernate.*;
/**
*
* @author Nancy
*/
public class AllUserServ extends HttpServlet {
/**
* Processes requests for both HTTP <code>GET</code> and <code>POST</code> methods.
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
PrintWriter out = response.getWriter();
SessionFactory sf = HibernateUtil.getSessionFactory();
Session session = sf.openSession();
Transaction tx = null;
RequestDispatcher rd = null;
try {
tx = session.beginTransaction();
Query q = session.createQuery("From Users");
List l = q.list();
request.setAttribute("data",l);
if(l!=null)
{
rd = request.getRequestDispatcher("allusers.jsp");
}
else
{
rd = request.getRequestDispatcher("allusers.jsp?msg=not found");
}
rd.forward(request, response);
tx.commit();
session.close();
}
catch (Exception e)
{
response.sendRedirect("error.jsp");
}
}
// <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">
/**
* Handles the HTTP <code>GET</code> method.
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
}
/**
* Handles the HTTP <code>POST</code> method.
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
}
/**
* Returns a short description of the servlet.
* @return a String containing servlet description
*/
@Override
public String getServletInfo() {
return "Short description";
}// </editor-fold>
}
| [
"pdmnnancy@gmail.com"
] | pdmnnancy@gmail.com |
dc6b8b42348e1edf7aa76a103d44631c6dc0e9b6 | 63672504035ac3c9984950b4e8a9acd813783922 | /MapReduce/java/mapreduce/jobhistory/TaskAttemptFinishedEvent.java | a78efc2a598d6d4fb595da9617ccfef69c45ca2e | [] | no_license | ameet20/MapReduce | aa68b12fba4483216364de24bf16517cf6c403c0 | 3553bfd965f51668dbeeb3d71efa4f5f21887c8b | refs/heads/master | 2021-07-20T21:09:19.852918 | 2021-07-09T11:31:47 | 2021-07-09T11:31:47 | 162,818,675 | 1 | 2 | null | null | null | null | UTF-8 | Java | false | false | 2,963 | java | package org.apache.hadoop.mapreduce.jobhistory;
import java.io.IOException;
import org.apache.hadoop.classification.InterfaceAudience;
import org.apache.hadoop.classification.InterfaceStability;
import org.apache.hadoop.mapreduce.Counters;
import org.apache.hadoop.mapreduce.TaskAttemptID;
import org.apache.hadoop.mapreduce.TaskID;
import org.apache.hadoop.mapreduce.TaskType;
import org.apache.avro.util.Utf8;
/**
* Event to record successful task completion
*
*/
@InterfaceAudience.Private
@InterfaceStability.Unstable
public class TaskAttemptFinishedEvent implements HistoryEvent {
private TaskAttemptFinished datum = new TaskAttemptFinished();
/**
* Create an event to record successful finishes for setup and cleanup
* attempts
* @param id Attempt ID
* @param taskType Type of task
* @param taskStatus Status of task
* @param finishTime Finish time of attempt
* @param hostname Host where the attempt executed
* @param state State string
* @param counters Counters for the attempt
*/
public TaskAttemptFinishedEvent(TaskAttemptID id,
TaskType taskType, String taskStatus,
long finishTime,
String hostname, String state, Counters counters) {
datum.taskid = new Utf8(id.getTaskID().toString());
datum.attemptId = new Utf8(id.toString());
datum.taskType = new Utf8(taskType.name());
datum.taskStatus = new Utf8(taskStatus);
datum.finishTime = finishTime;
datum.hostname = new Utf8(hostname);
datum.state = new Utf8(state);
datum.counters = EventWriter.toAvro(counters);
}
TaskAttemptFinishedEvent() {}
public Object getDatum() { return datum; }
public void setDatum(Object datum) {
this.datum = (TaskAttemptFinished)datum;
}
/** Get the task ID */
public TaskID getTaskId() { return TaskID.forName(datum.taskid.toString()); }
/** Get the task attempt id */
public TaskAttemptID getAttemptId() {
return TaskAttemptID.forName(datum.attemptId.toString());
}
/** Get the task type */
public TaskType getTaskType() {
return TaskType.valueOf(datum.taskType.toString());
}
/** Get the task status */
public String getTaskStatus() { return datum.taskStatus.toString(); }
/** Get the attempt finish time */
public long getFinishTime() { return datum.finishTime; }
/** Get the host where the attempt executed */
public String getHostname() { return datum.hostname.toString(); }
/** Get the state string */
public String getState() { return datum.state.toString(); }
/** Get the counters for the attempt */
Counters getCounters() { return EventReader.fromAvro(datum.counters); }
/** Get the event type */
public EventType getEventType() {
// Note that the task type can be setup/map/reduce/cleanup but the
// attempt-type can only be map/reduce.
return getTaskId().getTaskType() == TaskType.MAP
? EventType.MAP_ATTEMPT_FINISHED
: EventType.REDUCE_ATTEMPT_FINISHED;
}
}
| [
"noreply@github.com"
] | ameet20.noreply@github.com |
e5e639ab902bb9a49cc1b4e3b4757e290f5d38ea | 266f3f6ef409fcae71e1eb5a5b4dcff1556469a9 | /src/main/java/com/restaurant/management/service/scrumboard/impl/BoardListServiceImpl.java | 96b3fa5ef65bc964f6e6d252be4f67cd3db2fb14 | [] | no_license | t-janicki/order-management-sytem | abc61573470c1f77ca083523f18b1baefafa1d73 | d34a6ebe55e126e18c1ebff927a341405202b08a | refs/heads/master | 2022-02-22T16:03:01.003768 | 2019-09-28T19:15:15 | 2019-09-28T19:15:15 | 168,579,843 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 253 | java | package com.restaurant.management.service.scrumboard.impl;
import com.restaurant.management.service.scrumboard.BoardListService;
import org.springframework.stereotype.Service;
@Service
public class BoardListServiceImpl implements BoardListService {
}
| [
"tjaygallery@gmail.com"
] | tjaygallery@gmail.com |
43fc05c8392f678c8ac2f8158e83e8fc4ecf9ac1 | bcec64a351e4cfaf863285899114e7770c20eb38 | /src/com/jing/app/common/entity/App.java | e7e54f1fb32967add9e72d7f26b22f54ce0742e1 | [] | no_license | q302568556/linsen618 | dc0ec82bf46d8641b8e1e8bf92ffaf5d243ac558 | 31a95e180ed95c2c65dd26a0c2406399317ce615 | refs/heads/master | 2020-12-24T17:26:49.941953 | 2015-03-23T15:03:04 | 2015-03-23T15:03:04 | 31,999,683 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,715 | java | package com.jing.app.common.entity;
/**
* Created by Jing on 2015/3/19.
*/
public class App {
private String appid;
private String apptitle;
private String appsummary;
private String appimg;
public String getAppid() {
return appid;
}
public void setAppid(String appid) {
this.appid = appid;
}
public String getApptitle() {
return apptitle;
}
public void setApptitle(String apptitle) {
this.apptitle = apptitle;
}
public String getAppsummary() {
return appsummary;
}
public void setAppsummary(String appsummary) {
this.appsummary = appsummary;
}
public String getAppimg() {
return appimg;
}
public void setAppimg(String appimg) {
this.appimg = appimg;
}
@Override
public boolean equals(Object o) {
if(this == o) {
return true;
}
if(o == null || getClass() != o.getClass()) {
return false;
}
App app = (App) o;
if(appid != null ? !appid.equals(app.appid) : app.appid != null) {
return false;
}
if(appimg != null ? !appimg.equals(app.appimg) : app.appimg != null) {
return false;
}
if(appsummary != null ? !appsummary.equals(app.appsummary) : app.appsummary != null) {
return false;
}
if(apptitle != null ? !apptitle.equals(app.apptitle) : app.apptitle != null) {
return false;
}
return true;
}
@Override
public int hashCode() {
int result = appid != null ? appid.hashCode() : 0;
result = 31 * result + (apptitle != null ? apptitle.hashCode() : 0);
result = 31 * result + (appsummary != null ? appsummary.hashCode() : 0);
result = 31 * result + (appimg != null ? appimg.hashCode() : 0);
return result;
}
}
| [
"liuxiaojing618@gmail.com"
] | liuxiaojing618@gmail.com |
3fe401f7836a190d9077a3e32b553532d96975c7 | d1ffaec31f5b34555dd61e14cdb9159924a941ea | /Finales/final-2017-07-31-Compresor/final-compresor-alumno/entrada/Comprimible.java | acd1547645c8eef0c648e87e2b0e0d9029bb7cce | [
"MIT"
] | permissive | guille-acosta/7507-Algo3 | 79250bf90d927881636074cd80c6a4da5039f0c9 | 4e3019ca8199f1e3e40aa21d5110f2697a72f12b | refs/heads/master | 2023-08-12T03:44:14.748803 | 2021-09-17T12:07:23 | 2021-09-17T12:07:23 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 127 | java | package entrada;
import compresor.Compresor;
public interface Comprimible {
public String comprimir(Compresor compresor);
}
| [
"fdelmazo@fi.uba.ar"
] | fdelmazo@fi.uba.ar |
44852c4b7020a18ff7dd3d8f21a601770c674243 | d2dc632c0c3e1dbd09c74764c392ab9b8fb134c8 | /src/covoiturage/Covoiturage.java | d6f6d429155d99fec82797cfee557c82746468ab | [] | no_license | hamzachelaifa/covoiturage | 0af2a3c9084ea614c783269b36f1f0ad3ed60feb | 0cbaa42da4abf473e834bb1f9b19e2791381b56f | refs/heads/master | 2016-09-06T19:37:25.679404 | 2014-02-17T15:08:54 | 2014-02-17T15:08:54 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 355 | java | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package covoiturage;
/**
*
* @author Fedi
*/
public class Covoiturage {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
}
}
| [
"Greed@Hamza.esprit.tn"
] | Greed@Hamza.esprit.tn |
c68ceeddf14ed1d610d756b22a8716f271f93dc2 | ac9b3dff49910a76b79cc4ef4bd03d71c6a23126 | /tpo-web/assignment5/src/DAL/IRepository.java | ccad8a6a354459a48d229507ba149040fc507733 | [] | no_license | OleksandrBieliakov/tpo | 0cf97c84de9b50b20f897e9452b23df46b824219 | 517fd37976f2a91f5020d61daed840cc8812390b | refs/heads/master | 2021-02-18T12:24:28.845295 | 2020-06-17T09:47:00 | 2020-06-17T09:47:00 | 245,194,858 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 499 | java | package DAL;
import DTOs.Requests.ListResourcesReq;
import DTOs.Requests.LoginReq;
import DTOs.Requests.ResourceDetailsReq;
import DTOs.Responses.ListResourcesRes;
import DTOs.Responses.LoginRes;
import DTOs.Responses.ResourceDetailsRes;
public interface IRepository {
LoginRes login(LoginReq request) throws Exception;
ListResourcesRes listResources(ListResourcesReq request) throws Exception;
ResourceDetailsRes getResourceDetails(ResourceDetailsReq request) throws Exception;
}
| [
"abel9k@gmail.com"
] | abel9k@gmail.com |
2479ecbb016baf553611c1fe836acf04172177c8 | 2e4a04b20e0b429e57149e23d56889588bbc09e2 | /Chapter02/src/main/java/com/packt/modern/api/aop/TimeMonitorAspect.java | c8650a86113b2b9d39c71aa348b65518882f5a0b | [
"MIT"
] | permissive | kayazas123/Modern-API-Development-with-Spring-and-Spring-Boot | 1db9ae0269ae801d8adbc3143e073741ed59c6b3 | db4586f22997c6d591cf449fc9e5c3c33803764d | refs/heads/main | 2023-04-30T14:45:29.565008 | 2021-05-21T11:41:34 | 2021-05-21T11:41:34 | 371,608,373 | 1 | 0 | null | 2021-05-28T06:51:59 | 2021-05-28T06:51:59 | null | UTF-8 | Java | false | false | 1,143 | java | package com.packt.modern.api.aop;
import java.util.Arrays;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.stereotype.Component;
/**
* @author : github.com/sharmasourabh
* @project : Chapter02 - Modern API Development with Spring and Spring Boot
* @created : 10/20/2020, Tuesday
**/
@Aspect
@Component
public class TimeMonitorAspect {
@Around("@annotation(TimeMonitor)")
public Object logTime(ProceedingJoinPoint joinPoint) throws Throwable {
System.out.println("Starting " + joinPoint.getSignature().toShortString());
System.out.println(joinPoint.getSignature().getName() + " input -> " + Arrays.toString((int[])joinPoint.getArgs()[0]));
long start = System.nanoTime();
Object proceed = joinPoint.proceed();
long executionTime = System.nanoTime() - start;
System.out.println(joinPoint.getSignature().getName() + "ed -> " + Arrays.toString((int[])joinPoint.getArgs()[0]));
System.out.println(joinPoint.getSignature().getName() + " took: " + executionTime + " ns\n");
return proceed;
}
}
| [
"sousharm"
] | sousharm |
b858558c554d2df0427d7c63349b814016ec3eb1 | 692eb7e4326c09fd14c60ea0492bad1e033b41c2 | /src/main/java/com/github/navnandan/kafka/connect/base/MySourceConnectorConfig.java | 1d172052db6b11a8afec077376887018f90860e5 | [
"Apache-2.0"
] | permissive | nav-nandan/kafka-connect-base | 750795ec23b02681aaeb0668f5b351cd9d5aa917 | 81abd642f06041a823282cb7e9fcab81907cd312 | refs/heads/master | 2022-12-28T19:55:59.888389 | 2020-05-06T08:46:44 | 2020-05-06T08:46:44 | 261,697,536 | 0 | 0 | Apache-2.0 | 2020-10-13T21:46:33 | 2020-05-06T08:29:17 | Java | UTF-8 | Java | false | false | 971 | java | package com.github.navnandan.kafka.connect.base;
import org.apache.kafka.common.config.AbstractConfig;
import org.apache.kafka.common.config.ConfigDef;
import org.apache.kafka.common.config.ConfigDef.Type;
import org.apache.kafka.common.config.ConfigDef.Importance;
import java.util.Map;
public class MySourceConnectorConfig extends AbstractConfig {
public static final String MY_SETTING_CONFIG = "my.setting";
private static final String MY_SETTING_DOC = "This is a setting important to my connector.";
public MySourceConnectorConfig(ConfigDef config, Map<String, String> parsedConfig) {
super(config, parsedConfig);
}
public MySourceConnectorConfig(Map<String, String> parsedConfig) {
this(conf(), parsedConfig);
}
public static ConfigDef conf() {
return new ConfigDef()
.define(MY_SETTING_CONFIG, Type.STRING, Importance.HIGH, MY_SETTING_DOC);
}
public String getMy(){
return this.getString(MY_SETTING_CONFIG);
}
}
| [
"navnandan626@gmail.com"
] | navnandan626@gmail.com |
57362dbd9ecf0c5fad6a9891b968c4e0a263389b | 8612252e1c4680c40bc86e6e2a73937ef5849ea3 | /src/main/java/asci/activebatch/enumFolderSecurityAccess.java | 0eab395b76453df9aedf152c9deece5fade00bdd | [] | no_license | mevteev/ABATAdmin | 6bfe99db5ebafd71ed629986b1cb76ae46d53d96 | 356e5f1b6387f644f27835fd41fbc743dc001403 | refs/heads/master | 2021-01-19T03:38:05.215620 | 2016-07-04T15:02:46 | 2016-07-04T15:02:46 | 44,537,478 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,202 | java | package asci.activebatch;
import com4j.*;
/**
*/
public enum enumFolderSecurityAccess implements ComEnum {
/**
* <p>
* The value of this constant is 4
* </p>
*/
abatFSA_ReadVariables(4),
/**
* <p>
* The value of this constant is 2
* </p>
*/
abatFSA_ReadProperties(2),
/**
* <p>
* The value of this constant is 6
* </p>
*/
abatFSA_Read(6),
/**
* <p>
* The value of this constant is 8
* </p>
*/
abatFSA_Write(8),
/**
* <p>
* The value of this constant is 14
* </p>
*/
abatFSA_Modify(14),
/**
* <p>
* The value of this constant is 16
* </p>
*/
abatFSA_Delete(16),
/**
* <p>
* The value of this constant is 64
* </p>
*/
abatFSA_Use(64),
/**
* <p>
* The value of this constant is 61440
* </p>
*/
abatFSA_Manage(61440),
/**
* <p>
* The value of this constant is 3840
* </p>
*/
abatFSA_Executive(3840),
/**
* <p>
* The value of this constant is 65536
* </p>
*/
abatFSA_Trigger(65536),
/**
* <p>
* The value of this constant is 196608
* </p>
*/
abatFSA_TriggerQueue(196608),
/**
* <p>
* The value of this constant is 327680
* </p>
*/
abatFSA_TriggerParams(327680),
/**
* <p>
* The value of this constant is 589824
* </p>
*/
abatFSA_TriggerCreds(589824),
/**
* <p>
* The value of this constant is 32505856
* </p>
*/
abatFSA_InstanceCtrl(32505856),
/**
* <p>
* The value of this constant is 256
* </p>
*/
abatFSA_ChangePerms(256),
/**
* <p>
* The value of this constant is 32
* </p>
*/
abatFSA_Create(32),
/**
* <p>
* The value of this constant is 1
* </p>
*/
abatFSA_List(1),
/**
* <p>
* The value of this constant is 512
* </p>
*/
abatFSA_TakeOwnership(512),
/**
* <p>
* The value of this constant is 1024
* </p>
*/
abatFSA_ChangePolicy(1024),
/**
* <p>
* The value of this constant is -1
* </p>
*/
abatFSA_FullControl(-1), ;
private final int value;
enumFolderSecurityAccess(int value) {
this.value = value;
}
public int comEnumValue() {
return value;
}
}
| [
"mevteev@gmail.com"
] | mevteev@gmail.com |
c8d0507f8da0fbb881c8a78c034faa5fa9adf429 | 81860db3c1225db5521b99b93ebbe4cafb37f233 | /src/main/java/pl/pozadr/genderdetector/controller/DetectorController.java | 810d04c86cc1cee9bf481dd66d4028ebef8b7d9f | [] | no_license | Pozadr/Gender_detector | 6305b2747a2aa1eb87eb814820b606453aaf6422 | 89c4c1ced3894c2e59599307746f9a7eaf6e7fc3 | refs/heads/master | 2023-04-17T06:24:32.917495 | 2021-04-21T15:21:11 | 2021-04-21T15:21:11 | 351,185,491 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,393 | java | package pl.pozadr.genderdetector.controller;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import pl.pozadr.genderdetector.dto.request.GenderRequestDto;
import pl.pozadr.genderdetector.dto.request.TokensRequestDto;
import pl.pozadr.genderdetector.dto.response.GenderResponseDto;
import pl.pozadr.genderdetector.dto.response.TokensResponseDto;
import pl.pozadr.genderdetector.service.gender.GenderService;
import pl.pozadr.genderdetector.service.tokens.TokensService;
import javax.validation.Valid;
import java.util.List;
/**
* Application API. Provides a description of Swagger for readability in the Swagger UI.
* http://localhost:8080/swagger-ui.html
*/
@RequestMapping(produces = {MediaType.APPLICATION_JSON_VALUE}, path = "/gender-detector")
@RestController
public class DetectorController {
private final GenderService genderService;
private final TokensService tokensService;
@Autowired
public DetectorController(GenderService genderService, TokensService tokensService) {
this.genderService = genderService;
this.tokensService = tokensService;
}
@PostMapping("/v1")
@ApiOperation(value = "Checks the gender according to the method on the given name.", response = GenderResponseDto.class)
public ResponseEntity<GenderResponseDto> getGender(@RequestBody @Valid GenderRequestDto genderRequestDto) {
genderRequestDto.isMethodParamValid();
String gender = genderService.checkGender(genderRequestDto);
return ResponseEntity.ok(new GenderResponseDto(
genderRequestDto.getName(), genderRequestDto.getMethod(), gender));
}
@PostMapping("/v1/tokens")
@ApiOperation(value = "Gets tokens in the pagination range.", response = TokensResponseDto.class)
public ResponseEntity<TokensResponseDto> getTokens(@RequestBody @Valid TokensRequestDto tokensRequestDto) {
List<String> tokens = tokensService.getTokens(tokensRequestDto);
return ResponseEntity.ok(new TokensResponseDto(tokensRequestDto.getPageNo(), tokensRequestDto.getPageSize(),
tokens));
}
}
| [
"adpozor@gmail.com"
] | adpozor@gmail.com |
6993679177e07f249281ae5913cc8bdd6ee9ec71 | b68a2767c3be6e20126c9aa92c281a42e0742a3f | /app/src/androidTest/java/com/example/syong/exam7_3/ExampleInstrumentedTest.java | 1c06d943191c0c0809b60079d7990a85a47d15cb | [] | no_license | SungYongPark95/exam7_3 | 376e545b9f20aa9a944c4547fd6883a8321d9724 | 870669a7d0f091c672a3ba5fbde90a2e1eb09656 | refs/heads/master | 2020-09-22T12:44:10.482523 | 2019-12-01T17:26:49 | 2019-12-01T17:26:49 | 225,200,180 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 766 | java | package com.example.syong.exam7_3;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("com.example.syong.exam7_3", appContext.getPackageName());
}
}
| [
"psy.20.2014@gmail.com"
] | psy.20.2014@gmail.com |
f9434c4b799947e8d1c3cf8cd9ce13de971f0356 | b423bb105ed2608e6fdf6901777e2c3c67c94cb4 | /src/main/java/com/example/springboorutil/myannotation/MyAnnotation.java | 3917e9b19d58ac0ccc2673130d8613a9e858276a | [] | no_license | hujunr1991/utils | e33c01832c0435f8ad86bb8964e3769cf506044f | efe989d2154f8472f35692c408052bebfd8267d9 | refs/heads/master | 2022-07-09T23:34:07.495525 | 2020-09-27T06:36:13 | 2020-09-27T06:36:13 | 185,002,000 | 0 | 0 | null | 2022-06-29T17:21:12 | 2019-05-05T08:24:18 | Java | UTF-8 | Java | false | false | 570 | java | package com.example.springboorutil.myannotation;
import net.bytebuddy.implementation.bind.annotation.RuntimeType;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Documented
@Target({ElementType.TYPE, ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@Inherited
public @interface MyAnnotation {
public String name() default "";
public int age() default 18;
}
| [
"hujunr151@163.com"
] | hujunr151@163.com |
430b3fadab7fb700117f1d69d75351c191b55ad6 | 9a84caad4a3727dced444e2a06487250f29dff59 | /Code/ReadpdfFile.java | 577030bfab950235394357b67500e273a35e226b | [] | no_license | shrikant-jagtap/Source-Extraction-System | 87817479a79959fce07537a9b2556576b3c4238f | c5921ae2af49e6d7edc55a8f26a302992d6ac947 | refs/heads/master | 2020-04-05T22:36:56.052182 | 2018-11-12T19:13:33 | 2018-11-12T19:13:33 | 154,004,794 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,978 | java | import org.apache.lucene.queryparser.classic.ParseException;
import org.apache.pdfbox.io.RandomAccessBufferedFileInputStream;
import org.apache.pdfbox.io.RandomAccessRead;
import org.apache.pdfbox.pdfparser.PDFParser;
import org.apache.pdfbox.text.PDFTextStripper;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
public class ReadpdfFile {
public static String pdfconvert(String currentUrl, String searchWord) throws IOException, ParseException {
write_output wo=new write_output();
try {
String url_select = currentUrl;
URL url = new URL(url_select);
String temp = url.getFile();
String temp1 = temp.substring(7, temp.lastIndexOf(".") + 4);
System.out.println(" gasdvgj " + temp1);
url = new URL(temp1);
InputStream fileToParse = new RandomAccessBufferedFileInputStream(url.openStream());
//parse() -- This will parse the stream and populate the COSDocument object.
//COSDocument object -- This is the in-memory representation of the PDF document
PDFParser parser = new PDFParser((RandomAccessRead) fileToParse);
parser.parse();
//getPDDocument() -- This will get the PD document that was parsed. When you are done with this document you must call close() on it to release resources
//PDFTextStripper() -- This class will take a pdf document and strip out all of the text and ignore the formatting and such.
String output = new PDFTextStripper().getText(parser.getPDDocument());
// System.out.println(output);
/* TextSearch ts = new TextSearch();
double score = ts.find(output, searchWord); */
parser.getPDDocument().close();
return output;
} catch (Exception e) {
wo.error("pdfconvert : "+e.toString());
return "";
}
}
}
| [
"shrikant.jagtap1510@gmail.com"
] | shrikant.jagtap1510@gmail.com |
b6045ee8ff1ea846a9960ed1e8adaa1c6272c7c6 | cad53347aa3b97c585ea809900bcf3609bad0d9a | /Manutenção de Software/Aula03/src/main/java/entidades/Aluno.java | f7f513ebf7618f9fa436fed4acf654248d0b17fc | [] | no_license | danilomartinssilva/ueg20191 | a44ca19adaf29c641e80d12c470074309130f668 | a6263011792a1ae5540362919c6897b0d0967948 | refs/heads/master | 2021-07-09T15:45:35.976216 | 2019-08-17T19:52:45 | 2019-08-17T19:52:45 | 202,925,428 | 0 | 0 | null | 2020-10-13T15:24:17 | 2019-08-17T19:50:49 | Java | UTF-8 | Java | false | false | 1,573 | 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 entidades;
/**
*
* @author danilo
*/
public class Aluno {
private Curso curso;
private String nome;
private Integer idade;
private String email;
private String endereco;
/**
* @return the curso
*/
public Curso getCurso() {
return curso;
}
/**
* @param curso the curso to set
*/
public void setCurso(Curso curso) {
this.curso = curso;
}
/**
* @return the nome
*/
public String getNome() {
return nome;
}
/**
* @param nome the nome to set
*/
public void setNome(String nome) {
this.nome = nome;
}
/**
* @return the idade
*/
public Integer getIdade() {
return idade;
}
/**
* @param idade the idade to set
*/
public void setIdade(Integer idade) {
this.idade = idade;
}
/**
* @return the email
*/
public String getEmail() {
return email;
}
/**
* @param email the email to set
*/
public void setEmail(String email) {
this.email = email;
}
/**
* @return the endereco
*/
public String getEndereco() {
return endereco;
}
/**
* @param endereco the endereco to set
*/
public void setEndereco(String endereco) {
this.endereco = endereco;
}
}
| [
"danilomartinssilva@r7.com"
] | danilomartinssilva@r7.com |
30f8342e9709dc80886969244fc844279fe67835 | 1c6364c86d7d25c2c9be7727dcc2135dedbb72e8 | /queue/src/java/gov/nih/nci/queue/utils/QueueProducerUtil.java | c08fa6b99a659b33f400931c95c74fbaded3ad15 | [] | no_license | CBIIT/nci-analysis-tools-web-presence | 101b91d094a9e5f06013ba5d1c31b7a70b27c4de | 6b190cb269f861fadb473e8fd8542e09e13ca460 | refs/heads/master | 2023-08-17T17:31:33.399592 | 2023-08-16T16:00:52 | 2023-08-16T16:00:52 | 18,336,280 | 4 | 5 | null | 2015-11-13T01:17:30 | 2014-04-01T16:25:14 | JavaScript | UTF-8 | Java | false | false | 2,901 | 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 gov.nih.nci.queue.utils;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.jms.Connection;
import javax.jms.ConnectionFactory;
import javax.jms.DeliveryMode;
import javax.jms.JMSException;
import javax.jms.MessageProducer;
import javax.jms.Queue;
import javax.jms.Session;
import javax.jms.TextMessage;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
/**
*
* @author Yutao
*/
public class QueueProducerUtil {
private final static Logger LOGGER = Logger.getLogger(QueueProducerUtil.class.getCanonicalName());
private Context context;
private Queue msgQueue;
private ConnectionFactory connectionFactory;
private final String CONNECTION_FACTORY_JNDI;
private final String QUEUE_JNDI;
public QueueProducerUtil(String queueId) {
CONNECTION_FACTORY_JNDI = new StringBuilder("openejb:Resource/")
.append(PropertiesUtil.getProperty("queue.connectionfactory").trim())
.toString();
QUEUE_JNDI = new StringBuilder("openejb:Resource/")
.append(queueId.trim())
.toString();
}
/*
* Add message into Queue.
*/
public void produce(String jsonString) {
LOGGER.log(Level.INFO, "CONNECTION_FACTORY: {0} QUEUE: {1}", new Object[]{CONNECTION_FACTORY_JNDI, QUEUE_JNDI});
try {
context = new InitialContext();
connectionFactory = (ConnectionFactory) context.lookup(CONNECTION_FACTORY_JNDI);
msgQueue = (Queue) context.lookup(QUEUE_JNDI);
// Connect to Queue.
Connection connection = connectionFactory.createConnection();
connection.start();
// Create a Session and set auto acknowledge.
Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
// Create a MessageProducer from the Session to the Topic or Queue
MessageProducer producer = session.createProducer(msgQueue);
producer.setDeliveryMode(DeliveryMode.PERSISTENT);
// create a message
TextMessage message = session.createTextMessage(jsonString);
// Tell the producer to send the message
producer.send(message);
// close all.
producer.close();
session.close();
connection.close();
} catch (NamingException ne) {
LOGGER.log(Level.SEVERE, "Problems during Lookup JNDI. Error: {0}", ne.getMessage());
} catch (JMSException jmse) {
LOGGER.log(Level.SEVERE, "Problems during Queue. Error: {0}", jmse.getMessage());
}
}
}
| [
"yutao.wang@nih.gov"
] | yutao.wang@nih.gov |
04c785b6d885677494de83fe4afae302d6201f30 | c1ae5fd52f2bddb16eef64201421d6a13be4c738 | /SigmaSI final1/src/org/ucla/sigma/interfazdao/IServicioCardiologiaDAO.java | 6d9defe9c3360ff884970ed7fa3e4c4916c7b47d | [] | no_license | albertdug/SIGMAJava | 1ecbdf14c24d6d672976b8e3d825679d0bafc72d | 03d6727283a10789902ffe68e7e8eab70442edfb | refs/heads/master | 2016-09-05T19:33:43.373250 | 2015-07-16T02:11:11 | 2015-07-16T02:11:11 | 39,170,294 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 152 | java | package org.ucla.sigma.interfazdao;
import org.ucla.sigma.daobase.IHibernateDAO;
public interface IServicioCardiologiaDAO extends IHibernateDAO {
}
| [
"albertrdg@gmail.com"
] | albertrdg@gmail.com |
6155d8cb28812b3f1d0cc104c32f988e1d8831c3 | 8ae3e415a0ab19b171504a469b850484432b3099 | /ClassLabs/src/com/cs122/classlabs/Bank.java | 66416c2714a1c0cc3b13351fa7d8afdf5c02af68 | [] | no_license | carlosfigueroa123/cs122 | 1c95fa9f001ca5351b35259d10fd195f1fcdc1f3 | bdcbbdcfece304c8d1be407c0fb8c4351f8d397d | refs/heads/master | 2023-04-14T08:17:19.839948 | 2021-04-27T03:44:01 | 2021-04-27T03:44:01 | 289,984,249 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 999 | java | package com.cs122.classlabs;
public class Bank {
private Account [] icu;
public Bank()
{
icu = new Account[5];
icu[0] = new Credit("Sam Diaz", 560, 5.3);
icu[1] = new Deposit("Carla Rodriguez", 340, 2.3);
icu[2] = new Savings("Woody Allen", 1200, 2.3, 2000);
icu[3] = new Checking("Diane Dior", 300, 2.3, 5.0);
icu[4] = new Checking("Norm Andia", 750, 2.4, 4.0);
}
public void balance ()
{
double amount;
for (int count=0; count < icu.length; count++)
{
System.out.println(icu[count]);
amount = icu[count].balance(); // polymorphic
if (amount == 0.0)
System.out.println("");
else
System.out.println("Real balance (including fees and interest): " + amount);
System.out.println("-----------------------------------");
}
}
}
| [
"70162843+carlosfigueroa123@users.noreply.github.com"
] | 70162843+carlosfigueroa123@users.noreply.github.com |
2b967fa9b10e79ebe64a337d1d8d3b9fef4e1ff5 | 8bb57607197432fd54cfed45fd5396501d8d5a3a | /src/FactoryPattern/ShapeFactory.java | 42ab6545c2825b657b1249bbad079c74170edb3e | [] | no_license | lucasgaspar22/DesignPatterns-Java | 5a124f9cc781f54d1fd23008fcc6aef53d4742fa | f59c0492188c159a764e09fff895e7772cd97da5 | refs/heads/master | 2020-05-31T16:20:56.643891 | 2019-06-06T13:53:51 | 2019-06-06T13:53:51 | 190,378,853 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 378 | java | package FactoryPattern;
public class ShapeFactory {
public Shape getShape(String shapeType) {
if(shapeType == null) return null;
else if(shapeType.equalsIgnoreCase("CIRCLE")) return new Circle();
else if(shapeType.equalsIgnoreCase("RECTANGLE")) return new Rectangle();
else if(shapeType.equalsIgnoreCase("TRIANGLE")) return new Triangle();
else return null;
}
}
| [
"lucasprgaspar@gmail.com"
] | lucasprgaspar@gmail.com |
089ed1f45666a4aaf40dc7cb5948e2da2bfe32ad | 40a5b47d6241cd2659cb6d6dbbeadbb2faea3e71 | /user_apply/src/finance/ideal/util/ChainCodeUtils.java | 597959e5a0bb6fa72aff087eadb1214246b49916 | [] | no_license | id-Fnnkina/bfm | e22c3864a310e8c20aa6a581d60fd49b5c780e66 | 2ffaeaf79b0a5f6c685880aebb33591f14e3815a | refs/heads/master | 2023-05-29T20:43:16.122241 | 2021-06-08T05:00:58 | 2021-06-08T05:00:58 | 369,698,532 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,033 | java | package finance.ideal.util;
import com.alibaba.fastjson.JSONObject;
import finance.ideal.domain.Applicant;
import finance.ideal.domain.SysConfig;
import org.apache.http.HttpEntity;
import org.apache.http.HttpStatus;
import org.apache.http.StatusLine;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
import java.io.IOException;
import java.util.Date;
/**
* Created by AIR on 2018/11/22.
*/
public class ChainCodeUtils {
String token = "wwwwwwwwwwwwwwwwwwwwwwwwww";
//园区
//final static String baseUrl = "http://192.168.20.68:8031/";
// final static String baseUrl = "http://172.31.24.34:8031/enroll";
// final static String invokeUrl = "http://172.31.24.34:8031/api/invoke";
// public final static String queryUrl = "http://172.31.24.34:8031/api/query";
//复旦
final static String baseUrl = "http://10.190.11.72:8031/enroll";
final static String invokeUrl = "http://10.190.11.72:8031/api/invoke";
public final static String queryUrl = "http://10.190.11.72:8031/api/query";
public void invoke(Applicant applicant, SysConfig sc, String source) throws Exception {
String RecordId2 = String.valueOf(System.currentTimeMillis());
String VerifyDate = "";
String inParams = "id=111&name =222";
String [] p = sc.getInparam().split(",");
// for(String s : p){
// if("uphone".equals(s)){
// inParams.append("uphone="+applicant.getUphone()+"&");
// }else if("cardnum".equals(s)){
// inParams.append("cardnum="+applicant.getIdnumber());
// }
// }
// String params = "{ \"passWord\": \"123\", \"peerWithOrg\": \"peerOrg1\", \"userName\": \"zhangwei\"}";
Date dt= new Date();
Long time= dt.getTime();
System.out.println(time);
String params ="{\n" +
" \"args\":[\n" +
" \""+time+"\",\n" +
" \""+applicant.getOrdernum()+"\",\n" +
" \""+applicant.getServietype()+"\",\n" +
" \""+applicant.getIdnumber()+"\",\n" +
" \""+applicant.getUname()+"\",\n" +
" \""+applicant.getUphone()+"\",\n" +
" \""+applicant.getBankcard()+"\",\n" +
" \""+source+"\",\n" +
" \""+VerifyDate+"\",\n" +
" \"http://172.31.24.34:8031/index/\",\n" +
" \""+inParams+"\"\n" +
" ],\n" +
" \"chainCodeName\":\"VerifyChainCode\",\n" +
" \"function\":\"verify\",\n" +
" \"chainCodeVersion\":\"1.0\",\n" +
" \"userName\":\"111\",\n" +
" \"belongWithOrg\":\"peerOrg1\",\n" +
" \"channelName\":\"idealchannel\",\n" +
" \"peerWithOrgs\":[\n" +
" \"peerOrg1\"\n" +
" ]\n" +
"}";
System.out.println(params);
// System.out.println(taskName + "=========" + data.adName);
// System.out.println(params);
// System.out.println("数据序号:"+data.radom);
String ret = doPost(invokeUrl, params, "");
JSONObject jsonObject = JSONObject.parseObject(ret);
if ("000000".equals(jsonObject.getString("code"))) {
System.out.println(" 合约调用成功! ");
//scCount.addAndGet(1);
} else {
//system.err.println(data.getClass() + " 合约调用失败!");
//flCount.addAndGet(1);
System.out.println(jsonObject.getString("msg") );
System.out.println("合约调用失败!");
//throw new Exception(jsonObject +" "+data.toString());
}
}
public void query(Applicant applicant, SysConfig sc, String source) throws Exception {
String RecordId2 = String.valueOf(System.currentTimeMillis());
String VerifyDate = "";
String inParams = "id=111&name =222";
String [] p = sc.getInparam().split(",");
// for(String s : p){
// if("uphone".equals(s)){
// inParams.append("uphone="+applicant.getUphone()+"&");
// }else if("cardnum".equals(s)){
// inParams.append("cardnum="+applicant.getIdnumber());
// }
// }
// String params = "{ \"passWord\": \"123\", \"peerWithOrg\": \"peerOrg1\", \"userName\": \"zhangwei\"}";
System.out.println(applicant.getOrdernum()+applicant.getBankcard());
String params ="{\n" +
" \"userName\":\"111\",\n" +
" \"args\":[\n" +
" \""+applicant.getOrdernum()+"\"\n" +
" ],\n" +
" \"channelName\":\"idealchannel\",\n" +
" \"chainCodeName\":\"VerifyChainCode\",\n" +
" \"chainCodeVersion\":\"1.0\",\n" +
" \"function\":\"queryListByBusinessNumber\",\n" +
" \"peerWithOrg\":\"peerOrg1\"\n" +
"}";
// System.out.println(taskName + "=========" + data.adName);
// System.out.println(params);
// System.out.println("数据序号:"+data.radom);
String ret = doPost(queryUrl, params, "");
JSONObject jsonObject = JSONObject.parseObject(ret);
if ("000000".equals(jsonObject.getString("code"))) {
System.out.println(" 合约调用成功! ");
System.out.println(jsonObject.getString("data"));
//scCount.addAndGet(1);
} else {
//system.err.println(data.getClass() + " 合约调用失败!");
//flCount.addAndGet(1);
System.out.println(jsonObject.getString("msg") );
System.out.println("合约调用失败!");
//throw new Exception(jsonObject +" "+data.toString());
}
}
/**
* post请求(用于请求json格式的参数)
*
* @param url
* @param params
* @return
*/
public String doPost(String url, String params, String Authorization) throws Exception {
CloseableHttpClient httpclient = HttpClients.createDefault();
HttpPost httpPost = new HttpPost(url);
httpPost.setHeader("Accept", "application/json");
httpPost.setHeader("Content-Type", "application/json");
if (Authorization != null) {
httpPost.setHeader("Authorization", Authorization);
}
String charSet = "UTF-8";
StringEntity entity = new StringEntity(params, charSet);
httpPost.setEntity(entity);
CloseableHttpResponse response = null;
try {
response = httpclient.execute(httpPost);
StatusLine status = response.getStatusLine();
int state = status.getStatusCode();
if (state == HttpStatus.SC_OK) {
HttpEntity responseEntity = response.getEntity();
String jsonString = EntityUtils.toString(responseEntity);
return jsonString;
} else {
System.err.println("请求返回:" + state + "(" + url + ")");
}
} finally {
if (response != null) {
try {
response.close();
} catch (IOException e) {
e.printStackTrace();
}
}
try {
httpclient.close();
} catch (IOException e) {
e.printStackTrace();
}
}
return null;
}
// public static void main(String[] args) throws Exception {
// Chaincode chaincode = new Chaincode();
// chaincode.quer();
// }
}
| [
"wuma139421of@126.com"
] | wuma139421of@126.com |
0959ada02284d2687f2b12a739678ff972f3341d | ff35da4991a2c754d8a627efd46d19ef82d75a2f | /src/main/java/example/AddServlet.java | b2acf6991000cc814eb922148fc22cd2b8662d2a | [] | no_license | tomjenkinson/wildfly-widgets | c7eb7646e5f87317e63e6ba8eb03deafc7f60b8d | 4b6fd1bd97ab4e95b07acbff2d7c08930b771e5d | refs/heads/master | 2020-03-29T18:35:10.414570 | 2018-08-01T21:24:34 | 2018-09-24T16:05:51 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,781 | java | package example;
import java.io.IOException;
import java.io.PrintWriter;
import javax.ejb.EJB;
import javax.ejb.EJBAccessException;
import javax.servlet.ServletException;
import javax.servlet.annotation.HttpConstraint;
import javax.servlet.annotation.ServletSecurity;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@WebServlet(urlPatterns = "/add", loadOnStartup = 1)
@ServletSecurity(
@HttpConstraint(rolesAllowed = {"employee"})
)
public class AddServlet extends HttpServlet {
@EJB
private Products products;
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException,IOException {
String name = req.getParameter("productname");
String price = req.getParameter("productprice");
String numInStock = req.getParameter("productstock");
try {
products.addProduct(name, Double.valueOf(price), Integer.valueOf(numInStock));
try (PrintWriter writer = resp.getWriter()) {
writer.println("<html>");
writer.println(" <head><title>Update WildFly Widget Inventory</title></head>");
writer.println(" <body>");
writer.println(" <h2>Update WildFly Widgets Inventory</h2>");
writer.println(" <p><font size=\"5\" color=\"blue\">New product was successfully added!</font></p>");
writer.println(" <br/>");
writer.println(" <form>");
writer.println(" <input type=\"button\" value=\"Back\" onclick=\"window.location.href='./index.html'\" style=\"font-size : 16px;\"/>");
writer.println(" </form>");
writer.println(" </body>");
writer.println("</html>");
}
} catch (EJBAccessException e) {
try (PrintWriter writer = resp.getWriter()) {
writer.println("<html>");
writer.println(" <head><title>Update WildFly Widget Inventory</title></head>");
writer.println(" <body>");
writer.println(" <h2>Update WildFly Widgets Inventory</h2>");
writer.println(" <p><font size=\"5\" color=\"red\">New product was not added. Only an admin can add a new product!</font></p>");
writer.println(" <br/>");
writer.println(" <form>");
writer.println(" <input type=\"button\" value=\"Back\" onclick=\"window.location.href='./index.html'\" style=\"font-size : 16px;\"/>");
writer.println(" </form>");
writer.println(" </body>");
writer.println("</html>");
}
}
}
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
try (PrintWriter writer = resp.getWriter()) {
writer.println("<html>");
writer.println(" <head><title>Update WildFly Widget Inventory</title></head>");
writer.println("<style>");
writer.println(" input {");
writer.println(" font-size: 24px");
writer.println(" }");
writer.println("</style>");
writer.println(" <body>");
writer.println(" <h2>Update WildFly Widgets Inventory</h2>");
writer.println(" <p><font size=\"5\" color=\"blue\">Only users with the \"admin\" role can successfully add a product.</font></p>");
writer.println(" <form action=\"./add\" method=\"post\">");
writer.println(" <font size=\"5\">Product name:</font>");
writer.println(" <br/>");
writer.println(" <input type=\"text\" name=\"productname\">");
writer.println(" <br/>");
writer.println(" <br/>");
writer.println(" <font size=\"5\">Product price:</font>");
writer.println(" <br/>");
writer.println(" <input type=\"text\" name=\"productprice\">");
writer.println(" <br/>");
writer.println(" <br/>");
writer.println(" <font size=\"5\">Product stock:</font>");
writer.println(" <br/>");
writer.println(" <input type=\"text\" name=\"productstock\">");
writer.println(" <br/>");
writer.println(" <br/>");
writer.println(" <input type=\"submit\" value=\"Submit\">");
writer.println(" </form>");
writer.println(" </body>");
writer.println("</html>");
}
}
}
| [
"fjuma@redhat.com"
] | fjuma@redhat.com |
5d644a454e66dced98a95561cdcaca1ea6e28616 | 4e4a4d694ab61dbff32787940e1a6bc66cdd81c0 | /PetCare System/src/model/dao/PessoaDao.java | 647192b3a23666f670542707a06b905a35450579 | [] | no_license | uhconst/PetCare | 7205330467bc70d1051803ce23ec50b0525d628d | f408bbbad4d1641c4582326c898632f0135b5e28 | refs/heads/master | 2021-01-12T08:26:55.702242 | 2017-02-02T00:33:32 | 2017-02-02T00:33:32 | 76,578,870 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,605 | 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 model.dao;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.Query;
import model.domain.Pessoa;
/**
*
* @author Constancio
*/
public class PessoaDao{
public void salvarAtualizar(Pessoa pessoa) {
EntityManager em = Conexao.getEntityManager();
em.getTransaction().begin();
if(pessoa.getId() !=null){
pessoa = em.merge(pessoa);
}
em.persist(pessoa);
em.getTransaction().commit();
em.close();
}
public void excluir(Pessoa pessoa) {
EntityManager em = Conexao.getEntityManager();
em.getTransaction().begin();
pessoa = em.merge(pessoa);
em.remove(pessoa);
em.getTransaction().commit();
em.close();
}
public List<Pessoa> pesquisar(Pessoa pessoa) {
EntityManager em = Conexao.getEntityManager();
StringBuilder sql = new StringBuilder("from Pessoa p "
+ "where 1 = 1 ");
if (pessoa.getId() !=null) {
sql.append("and p.id = :id_pessoa ");
}
if (pessoa.getNome() !=null &&
!pessoa.getNome().equals("")){
sql.append("and LOWER(p.nome) like '%'||LOWER(:nome)||'%' ");
}
if (pessoa.getSobrenome() !=null &&
!pessoa.getSobrenome().equals("")){
sql.append("and LOWER(p.sobrenome) like '%'||LOWER(:sobrenome)||'%' ");
}
if (pessoa.getCpf() !=null &&
!pessoa.getCpf().equals("")){
System.out.print("\nCPF no Dao: " + pessoa.getCpf());
sql.append("and p.cpf like '%'||:cpf||'%'");
}
Query query = em.createQuery(sql.toString());
if (pessoa.getId() !=null) {
query.setParameter("id_pessoa",pessoa.getId());
}
if (pessoa.getNome() != null &&
!pessoa.getNome().equals("")){
query.setParameter("nome","%"+pessoa.getNome());
}
if (pessoa.getSobrenome() != null &&
!pessoa.getSobrenome().equals("")){
query.setParameter("sobrenome","%"+pessoa.getSobrenome());
}
if (pessoa.getCpf() != null &&
!pessoa.getCpf().equals("")){
query.setParameter("cpf","%"+pessoa.getCpf());
}
return query.getResultList();
}
}
| [
"uryelhenrique.c@gmail.com"
] | uryelhenrique.c@gmail.com |
8bfd312e509f38dcd3a18b5ef174c5619926bd0c | 27fa23bade31a5c2a07228d40310fc27057b77c2 | /src/com/company/Cherry.java | 19c948a8de5aac55ba5095600b1dea373e022424 | [] | no_license | Thorben-b/Sokoban | ca8d2f634f3568307ed9d8b8f248bf98c3e5434d | 86db6b6bc3ee3831da0b5d377ac3de8541d70827 | refs/heads/master | 2021-01-12T18:58:45.489867 | 2015-05-15T19:08:13 | 2015-05-15T19:08:13 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 180 | java | package com.company;
/**
* Created by Sefa Yavuz on 15-1-2015.
*/
public class Cherry extends Fruit {
public Cherry(int value)
{
super.setValue(value);
}
}
| [
"seff61@gmail.com"
] | seff61@gmail.com |
a77efd75e0520a1e14ec5a977a72402615760949 | 55550afe1c18aacba9a481c690755cb7395d35f1 | /Week_01/G20190343020257/LeetCode_66_0257.java | 297593a4af15f12e211040e3fd6777568eb464ee | [] | no_license | algorithm005-class02/algorithm005-class02 | eb5c0865fbb2c58362fddcd4fc8f8b9d02bb208c | 1a1abf5aabdd23755769efaa6c33579bc5b0917b | refs/heads/master | 2020-09-22T11:48:20.613692 | 2020-03-02T05:31:11 | 2020-03-02T05:31:11 | 225,177,649 | 45 | 153 | null | 2020-03-02T05:31:13 | 2019-12-01T14:47:06 | Java | UTF-8 | Java | false | false | 376 | java | class Solution {
public int[] plusOne(int[] digits) {
for (int i = digits.length - 1; i >= 0; --i) {
if (digits[i] < 9) {
digits[i]++;
return digits;
}
digits[i] = 0;
}
int[] newDigits = new int[digits.length + 1];
newDigits[0] = 1;
return newDigits;
}
}
| [
"xhz@192.168.0.105"
] | xhz@192.168.0.105 |
6730ffdcc9b86919871f5490abed297f9ba5d90a | 8484faee6e3602c92ea40c075d290f24988ed00c | /Frontend/IntermonGame/core/src/com/myteam/intermon/states/LoginState.java | 4f29a82ae5c528f204827456efb523d10906fc95 | [] | no_license | wattzhikang/infinite-monsters | 682a8653805cce5c54db2d23fc0a43303177d4d9 | ffeeb0d7f1dabfe2f9aeff5956ef3c922220e2d2 | refs/heads/master | 2022-12-15T12:24:29.096469 | 2019-05-03T14:43:25 | 2019-05-03T14:43:25 | 188,727,957 | 1 | 1 | null | 2022-12-10T00:18:33 | 2019-05-26T20:21:08 | Java | UTF-8 | Java | false | false | 4,825 | java | package com.myteam.intermon.states;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Input;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.scenes.scene2d.InputListener;
import com.badlogic.gdx.scenes.scene2d.ui.Label;
import com.badlogic.gdx.scenes.scene2d.ui.Skin;
import com.badlogic.gdx.scenes.scene2d.ui.Table;
import com.badlogic.gdx.scenes.scene2d.ui.TextField;
import com.badlogic.gdx.utils.JsonReader;
import com.badlogic.gdx.utils.JsonValue;
import com.myteam.intermon.ClientSocket;
import com.myteam.intermon.Communication.MessageConverter;
import java.io.IOException;
public class LoginState extends State
{
private ClientSocket clientSocket;
private Texture loginBtn;
private Texture exitBtn;
private String username = "";
private String password = "";
private String serverMessage;
private MessageConverter mc;
private UsernameTextInputListener usernameListener = new UsernameTextInputListener();
private PasswordTextInputListener passwordListener = new PasswordTextInputListener();
public LoginState(GameStateManager gsm, ClientSocket cs)
{
super(gsm);
clientSocket = cs;
loginBtn = new Texture("login_button.jpg");
exitBtn = new Texture("exit_button.jpg");
mc = new MessageConverter();
}
@Override
public void handleInput()
{
//login button x min: 0, x max: 300
//login button y min: 775, y max: 1075
//exit button x min: 1475, x max: 1800
//exit button y min: 775, y max: 1075
int x = Gdx.input.getX();
int y = Gdx.input.getY();
if(Gdx.input.justTouched())
{
boolean loginBtnPushed = false;
if((x >= 0 && x <= 300) && (y >= 775 && y <= 1075) && username != null && password != null)
{
System.out.println("login button pushed");
loginBtnPushed = true;
JsonValue clientInfo = new JsonValue(username);
clientInfo.setName("username");
clientInfo.addChild("password", new JsonValue(password));
clientInfo.addChild("requestType", new JsonValue("authentication"));
String client = mc.setMessage(clientInfo);
try
{
clientSocket.sendMessage(client);
serverMessage = clientSocket.readMessage();
}
catch (IOException e)
{
e.printStackTrace();
}
catch (ClassNotFoundException e)
{
e.printStackTrace();
}
JsonReader reader = new JsonReader();
JsonValue subscription = reader.parse(serverMessage);
boolean validLogin = subscription.getBoolean("loginSuccess");
if(validLogin)
{
gsm.set(new PlayState(gsm, clientSocket, username));
dispose();
}
}
else if((x >= 1475 && x <= 1800) && (y >= 775 && y <= 1075))
{
System.out.println("exit button pushed");
dispose();
}
/*if(!loginBtnPushed)
{
Gdx.input.getTextInput(passwordListener, "Password", "", "password");
Gdx.app.log("password", password);
Gdx.input.getTextInput(usernameListener, "Username", "", "username");
Gdx.app.log("username", username);
}*/
}
}
@Override
public void update(float dt)
{
handleInput();
}
@Override
public void render(SpriteBatch sb)
{
Gdx.gl.glClearColor(0, 0, 0, 0);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
sb.begin();
sb.draw(loginBtn, 0, 0);
sb.draw(exitBtn, Gdx.graphics.getWidth() - exitBtn.getWidth(), 0);
sb.end();
}
@Override
public void dispose()
{
loginBtn.dispose();
exitBtn.dispose();
}
public class UsernameTextInputListener implements Input.TextInputListener
{
@Override
public void input(String text)
{
username = text;
}
@Override
public void canceled()
{
username = "";
}
}
public class PasswordTextInputListener implements Input.TextInputListener
{
@Override
public void input(String text)
{
password = text;
}
@Override
public void canceled()
{
password = "";
}
}
}
| [
"lademers@iastate.edu"
] | lademers@iastate.edu |
a34803bed22ec8c51636efd9ce8416ac036a33a3 | 001134b7f4fd0b081a4029aacc1af0d9ea700285 | /08 RestWithSpringBootUdemy Custom Serialization/src/main/java/br/com/erudio/services/PersonServices.java | 7c4dbc2d66ee1f28b6089d727e1f885b95c4c5ad | [] | no_license | leonardocasagrande/rest-spring-udemy | 621038f93bc519e604537cb2e7a8c310518eb17d | 7bbfc8919d9707b8a8d81cd37eed0c3f8d73c6ea | refs/heads/master | 2023-04-16T22:18:12.861657 | 2021-04-30T13:58:07 | 2021-04-30T13:58:07 | 361,259,557 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,685 | java | package br.com.erudio.services;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import br.com.erudio.converter.DozerConverter;
import br.com.erudio.data.model.Person;
import br.com.erudio.data.vo.v1.PersonVO;
import br.com.erudio.exception.ResourceNotFoundException;
import br.com.erudio.repository.PersonRepository;
@Service
public class PersonServices {
@Autowired
PersonRepository repository;
public PersonVO findById(Long id) {
var entity = repository.findById(id)
.orElseThrow(() -> new ResourceNotFoundException("No records found for this ID"));
return DozerConverter.parseObject(entity, PersonVO.class);
}
public List<PersonVO> findAll() {
return DozerConverter.parseListObjects(repository.findAll(), PersonVO.class);
}
public PersonVO create(PersonVO person) {
var entity = DozerConverter.parseObject(person, Person.class);
var vo = DozerConverter.parseObject(repository.save(entity), PersonVO.class);
return vo;
}
public PersonVO update(PersonVO person) {
var entity = repository.findById(person.getId())
.orElseThrow(() -> new ResourceNotFoundException("No records found for this ID"));
entity.setFirstName(person.getFirstName());
entity.setLastName(person.getLastName());
entity.setAddress(person.getAddress());
entity.setGender(person.getGender());
var vo = DozerConverter.parseObject(repository.save(entity), PersonVO.class);
return vo;
}
public void delete(Long id) {
Person entity = repository.findById(id)
.orElseThrow(() -> new ResourceNotFoundException("No records found for this ID"));
repository.delete(entity);
}
}
| [
"leoc.casagrande@hotmail.com"
] | leoc.casagrande@hotmail.com |
4245988cc1ddb6043770dd509a6f64729dab4031 | 3a1b8fb217ea11c3805fa55f0d5a9b7caebf7968 | /plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/DefaultPlcDiscoveryResponse.java | b3f5022b62958fa52ffcc69c0d8548e975aab349 | [
"Apache-2.0",
"Unlicense"
] | permissive | isabella232/plc4x | ff343eabcd674a5dcb1e7c3b64f71d5aa93a6eba | adabb660a73a50d0cc396cccb09fa4ae61231225 | refs/heads/develop | 2023-08-27T14:09:35.983668 | 2021-10-06T19:01:43 | 2021-10-06T19:01:43 | 418,112,438 | 0 | 0 | Apache-2.0 | 2021-10-17T12:04:53 | 2021-10-17T11:45:09 | null | UTF-8 | Java | false | false | 2,435 | java | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.plc4x.java.spi.messages;
import com.fasterxml.jackson.annotation.*;
import org.apache.plc4x.java.api.messages.*;
import org.apache.plc4x.java.api.types.PlcResponseCode;
import org.apache.plc4x.java.spi.generation.ParseException;
import org.apache.plc4x.java.spi.generation.WriteBuffer;
import org.apache.plc4x.java.spi.utils.Serializable;
import java.util.*;
@JsonTypeInfo(use = JsonTypeInfo.Id.CLASS, property = "className")
public class DefaultPlcDiscoveryResponse implements PlcDiscoveryResponse, Serializable {
private final PlcDiscoveryRequest request;
private final PlcResponseCode responseCode;
private final List<PlcDiscoveryItem> values;
@JsonCreator(mode = JsonCreator.Mode.PROPERTIES)
public DefaultPlcDiscoveryResponse(@JsonProperty("request") PlcDiscoveryRequest request,
@JsonProperty("responseCode") PlcResponseCode responseCode,
@JsonProperty("values") List<PlcDiscoveryItem> values) {
this.request = request;
this.responseCode = responseCode;
this.values = values;
}
@Override
public PlcDiscoveryRequest getRequest() {
return request;
}
public PlcResponseCode getResponseCode() {
return responseCode;
}
public List<PlcDiscoveryItem> getValues() {
return values;
}
@Override
public void serialize(WriteBuffer writeBuffer) throws ParseException {
writeBuffer.pushContext("PlcDiscoveryResponse");
// TODO: Implement
writeBuffer.popContext("PlcDiscoveryResponse");
}
}
| [
"christofer.dutz@c-ware.de"
] | christofer.dutz@c-ware.de |
d457db18be4a936d7f0f1697d44eb0531f72847c | fd532dafb44e74703e1e9417070b123f0de18b9f | /src/main/java/cn/com/xinli/portal/transport/huawei/package-info.java | d45ae23758f6178ecf1666e044ad26106f39605d | [] | no_license | Morcal/SpringBootServer | 865b998255299c203f5fe07e8ce046933527d59a | 5d4e254b76c342d913db37f5bf69d6258aecd1c0 | refs/heads/master | 2021-01-20T19:27:02.899755 | 2016-07-06T13:27:40 | 2016-07-06T13:27:40 | 62,722,827 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,343 | java | /**
* Provides HUAWEI portal implementation.
*
* <p>PWS includes a embedded portal-server which accepts incoming
* portal request and respond accordingly. Developers can enable
* this mimic portal-server as HUAWEI NAS/BRAS by enabling
* system configuration in "dev" profile.
*
* <p>Both HUAWEI Protocol {@link cn.com.xinli.portal.transport.huawei.Version#V1} and
* {@link cn.com.xinli.portal.transport.huawei.Version#V2} are implemented as
* <em>Stateless</em>, and they share the same
* {@link cn.com.xinli.portal.transport.huawei.nio.ByteBufferCodecFactory} which
* is also implemented as <em>Stateless</em>.
*
* <p>{@link cn.com.xinli.portal.transport.huawei.support.HuaweiPortal}
* is a facade for internal implementations, portal client can create by
* {@link cn.com.xinli.portal.transport.huawei.support.HuaweiPortal#getConnector(
* cn.com.xinli.portal.transport.huawei.Endpoint)}.
* Portal server can be created by
* {@link cn.com.xinli.portal.transport.huawei.support.HuaweiPortal#createServer(
* cn.com.xinli.portal.transport.huawei.Endpoint, cn.com.xinli.portal.transport.huawei.ServerHandler)} (
* Mimic NAS/BRAS can be create by
* {@link cn.com.xinli.portal.transport.huawei.support.HuaweiPortal#createNas(
* cn.com.xinli.portal.transport.huawei.Endpoint)}.
*/
package cn.com.xinli.portal.transport.huawei; | [
"zhou.pen9@gmail.com"
] | zhou.pen9@gmail.com |
d1943fdf607234c842481efa5d4f956fc52644d7 | 13d540346c120c865eb9c4c72f20665713863aad | /src/Results.java | 05496d7c46a5ae3da02af68d0c71ec8364143b6b | [] | no_license | arbalzer/RummyGame | 26c0af5d0a00b1b9a889749343612a350275a247 | bbb04776e3163f2acc63f069e3c5e6aed8f8c758 | refs/heads/master | 2021-01-11T19:49:05.993940 | 2017-01-19T01:44:26 | 2017-01-19T01:44:26 | 79,403,885 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,450 | 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.
*/
/**
*
* @author Kendra
*/
public class Results extends javax.swing.JFrame {
/**
* Creates new form Results
*/
public Results() {
initComponents();
}
/**
* 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() {
jLayeredPane1 = new javax.swing.JLayeredPane();
jLabel2 = new javax.swing.JLabel();
jButton1 = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();
jLabel1 = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jLayeredPane1.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
jLabel2.setFont(new java.awt.Font("Engravers MT", 1, 48)); // NOI18N
jLabel2.setForeground(new java.awt.Color(255, 255, 255));
jLabel2.setText("[Name] Wins!");
jLayeredPane1.add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(60, 50, 490, 90));
jButton1.setText("Play Again");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
jLayeredPane1.add(jButton1, new org.netbeans.lib.awtextra.AbsoluteConstraints(250, 200, 90, -1));
jButton2.setText("Exit");
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
}
});
jLayeredPane1.add(jButton2, new org.netbeans.lib.awtextra.AbsoluteConstraints(270, 250, -1, -1));
jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Light-Wood-Background-Wallpaper.jpg"))); // NOI18N
jLabel1.setText("jLabel1");
jLayeredPane1.add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 560, 360));
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLayeredPane1)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLayeredPane1)
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
StartPage start = new StartPage();
start.setVisible(true);
dispose();
}//GEN-LAST:event_jButton1ActionPerformed
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
dispose();
}//GEN-LAST:event_jButton2ActionPerformed
/**
* @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(Results.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(Results.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(Results.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(Results.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 Results().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLayeredPane jLayeredPane1;
// End of variables declaration//GEN-END:variables
}
| [
"andrew.r.balzer@gmail.com"
] | andrew.r.balzer@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.