blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 410 | content_id stringlengths 40 40 | detected_licenses listlengths 0 51 | license_type stringclasses 2 values | repo_name stringlengths 5 132 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringlengths 4 80 | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 684M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 22 values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 132 values | src_encoding stringclasses 34 values | language stringclasses 1 value | is_vendor bool 1 class | is_generated bool 2 classes | length_bytes int64 3 9.45M | extension stringclasses 28 values | content stringlengths 3 9.45M | authors listlengths 1 1 | author_id stringlengths 0 352 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
59f3d76c447aab75a8eefdcac900d2a73d7c0625 | f2eb081b15b21d801927cab1c734dfb18a230dd8 | /changgou-parent/changgou-service/changgou-service-goods/src/main/java/com/wk/goods/service/ParaService.java | b83125121c95037f89e0227b4877af05ad690a44 | [] | no_license | wk-001/changgou | e7be9524a075e774e7e157c99ada3d0e9c4a4050 | 2f9ea55775f56482e4b2a6a345a2c9a6641bdb81 | refs/heads/master | 2022-07-06T01:30:21.177309 | 2020-03-14T07:55:19 | 2020-03-14T07:55:19 | 239,932,807 | 1 | 2 | null | 2022-06-21T02:47:16 | 2020-02-12T05:15:04 | JavaScript | UTF-8 | Java | false | false | 1,326 | java | package com.wk.goods.service;
import com.github.pagehelper.PageInfo;
import com.wk.goods.pojo.Para;
import java.util.List;
/****
* @Author:admin
* @Description:Para业务层接口
* @Date 2019/6/14 0:16
*****/
public interface ParaService {
/**
* 根据分类ID查询template_id,再用template_id查询参数集合
* @param categoryId
* @return
*/
List<Para> findByCategoryId(Integer categoryId);
/***
* Para多条件分页查询
* @param para
* @param page
* @param size
* @return
*/
PageInfo<Para> findPage(Para para, int page, int size);
/***
* Para分页查询
* @param page
* @param size
* @return
*/
PageInfo<Para> findPage(int page, int size);
/***
* Para多条件搜索方法
* @param para
* @return
*/
List<Para> findList(Para para);
/***
* 删除Para
* @param id
*/
void delete(Integer id);
/***
* 修改Para数据
* @param para
*/
void update(Para para);
/***
* 新增Para
* @param para
*/
void add(Para para);
/**
* 根据ID查询Para
* @param id
* @return
*/
Para findById(Integer id);
/***
* 查询所有Para
* @return
*/
List<Para> findAll();
}
| [
"123@qq.com"
] | 123@qq.com |
5db240ac43582c9aa7519cc6237511907ac77f45 | 12bb49769a72df1826a9dbc83f7f85254c581acb | /IIMJOBSTest/src/test/java/com/iimjobs/qa/testcases/JobFeedTest.java | 6521becda5648f8f58f88d99d053c8518929447e | [] | no_license | Yatendra21/IIMJOBS | b74da89cf98ce958f676b082cc575f317d833cff | 8746153b91d252025a298d2afc80ca95569afb20 | refs/heads/master | 2022-07-22T11:59:17.179657 | 2019-09-02T08:47:05 | 2019-09-02T08:47:05 | 167,133,172 | 0 | 0 | null | 2022-06-29T17:10:47 | 2019-01-23T06:53:25 | HTML | UTF-8 | Java | false | false | 1,262 | java | package com.iimjobs.qa.testcases;
import java.io.IOException;
import org.testng.Assert;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import com.iimjobs.qa.base.Testbase;
import com.iimjobs.qa.pages.Createyourjobfeed;
import com.iimjobs.qa.pages.JobFeed;
import com.iimjobs.qa.pages.LoginPage;
public class JobFeedTest extends Testbase{
LoginPage loginpage;
JobFeed jobfeed;
Createyourjobfeed createyourjobfeed;
public JobFeedTest() throws IOException {
super();
}
@BeforeMethod
public void setuphomepage() throws IOException {
initilization();
loginpage = new LoginPage();
jobfeed=new JobFeed();
loginpage.login(prop.getProperty("EmailID"), prop.getProperty("Password"));
}
@Test(priority=1)
public void verifyjobfeedpage() {
String title=jobfeed.validatejobfeedpage();
Assert.assertEquals(title, "My Jobfeed");
}
@Test(priority=2)
public void verifyjobfeedpagetext() {
boolean flag=jobfeed.validatejobfeedpagetext();
Assert.assertTrue(flag);
}
@Test(priority=3)
public void createyourjobfeed() throws IOException {
createyourjobfeed=jobfeed.createownjobfeed();
}
@AfterMethod
public void teardown() {
driver.quit();
}
}
| [
"32636877+Yatendra21@users.noreply.github.com"
] | 32636877+Yatendra21@users.noreply.github.com |
84634eb4bda5792f303ef99defb25adac026a6fd | b90382aea9fd27a7ee8c9d3198c7f6e57ecdad8c | /gmall-mbg/src/main/java/com/topjia/gmall/sms/service/FlashPromotionSessionService.java | 3a3dfd08d0ab13c1067f8ff4ffee8e08a65c3b12 | [] | no_license | topjia-vip/gmall | 7a26a78dbd33beb99ce836a5e6b50336dd78827a | 29b1cc2eda939a34dafd3c4a5e887730fcbb5929 | refs/heads/master | 2022-06-22T17:44:54.470948 | 2019-11-24T07:46:15 | 2019-11-24T07:46:15 | 223,708,602 | 0 | 0 | null | 2022-06-21T02:18:06 | 2019-11-24T07:34:43 | Java | UTF-8 | Java | false | false | 343 | java | package com.topjia.gmall.sms.service;
import com.topjia.gmall.sms.entity.FlashPromotionSession;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 限时购场次表 服务类
* </p>
*
* @author wjh
* @since 2019-11-24
*/
public interface FlashPromotionSessionService extends IService<FlashPromotionSession> {
}
| [
"1256957450@qq.com"
] | 1256957450@qq.com |
716aa8105916406d36abd44031ade6086eca6715 | 80403ec5838e300c53fcb96aeb84d409bdce1c0c | /server/modules/study/src/org/labkey/study/query/SpecimenPivotByDerivativeType.java | 8449817ddf0a2196e87b4df8d18cb7800aa5442a | [] | no_license | scchess/LabKey | 7e073656ea494026b0020ad7f9d9179f03d87b41 | ce5f7a903c78c0d480002f738bccdbef97d6aeb9 | refs/heads/master | 2021-09-17T10:49:48.147439 | 2018-03-22T13:01:41 | 2018-03-22T13:01:41 | 126,447,224 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 3,012 | java | /*
* Copyright (c) 2012-2015 LabKey Corporation
*
* 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.labkey.study.query;
import org.apache.commons.lang3.math.NumberUtils;
import org.labkey.api.data.ColumnInfo;
import org.labkey.api.data.Container;
import org.labkey.api.study.StudyService;
import java.util.Map;
/**
* User: klum
* Date: Mar 9, 2012
*/
public class SpecimenPivotByDerivativeType extends BaseSpecimenPivotTable
{
public static final String PIVOT_BY_DERIVATIVE_TYPE = "Primary/Derivative Type Vial Counts";
private static final String COLUMN_DESCRIPTION_FORMAT = "Number of vials of primary & derivative type %s/%s";
public SpecimenPivotByDerivativeType(final StudyQuerySchema schema)
{
super(SpecimenReportQuery.getPivotByDerivativeType(schema.getContainer(), schema.getUser()), schema);
setDescription("Contains up to one row of Specimen Primary/Derivative Type totals for each " + StudyService.get().getSubjectNounSingular(getContainer()) +
"/visit combination.");
Container container = getContainer();
Map<Integer, NameLabelPair> primaryTypeMap = getPrimaryTypeMap(container);
Map<Integer, NameLabelPair> derivativeTypeMap = getDerivativeTypeMap(container);
for (ColumnInfo col : getRealTable().getColumns())
{
// look for the primary/derivative pivot encoding
String parts[] = col.getName().split(AGGREGATE_DELIM);
if (parts != null && parts.length == 2)
{
String types[] = parts[0].split(TYPE_DELIM);
if (types != null && types.length == 2)
{
int primaryId = NumberUtils.toInt(types[0]);
int derivativeId = NumberUtils.toInt(types[1]);
if (primaryTypeMap.containsKey(primaryId) && derivativeTypeMap.containsKey(derivativeId))
{
wrapPivotColumn(col,
COLUMN_DESCRIPTION_FORMAT,
primaryTypeMap.get(primaryId),
derivativeTypeMap.get(derivativeId),
new NameLabelPair(parts[1], parts[1]));
}
}
}
}
setDefaultVisibleColumns(getDefaultVisibleColumns());
addWrapColumn(_rootTable.getColumn("Container"));
}
}
| [
"klum@labkey.com"
] | klum@labkey.com |
cacc2b2a66d5c31ee2b2f8f21c9ce4f25429fe07 | 319f4da54086cec5bbea530c6a3dcb6db89fc105 | /yangdi-base-search/src/main/java/com/ewandian/b2b2c/search/domain/document/AdsEntity.java | bf8741e96b41bca9b1a3098b1e060f99b8c92fe2 | [] | no_license | YangDiA/yangdi-elasticsearch | b6a75fa99607d241a93d0b8b57c44662a99bc498 | e0e40c15a26cc09fb344d6a594aba1ac37866a95 | refs/heads/master | 2021-01-19T17:05:07.612032 | 2017-08-22T09:42:30 | 2017-08-22T09:42:30 | 101,045,836 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 4,636 | java | package com.ewandian.b2b2c.search.domain.document;
import com.ewandian.b2b2c.search.app.constant.MmsegAnalyzerConstant;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.FieldIndex;
import org.springframework.data.elasticsearch.annotations.FieldType;
import java.util.Date;
//import java.sql.Date;
/**
* Created by Administrator on 2016/12/6.
*/
@Document(indexName = "adindex",type = "ad")
public class AdsEntity {
@Id
@Field(
type = FieldType.String,
index = FieldIndex.not_analyzed
)
private String id;
@Field(
type = FieldType.String,
index = FieldIndex.not_analyzed
)
private String adId;
@Field(
type = FieldType.String,
index = FieldIndex.not_analyzed
)
private String columnId;
@Field(
type = FieldType.String,
index = FieldIndex.not_analyzed
)
private String columnIdentify;
@Field(
type = FieldType.String,
index = FieldIndex.not_analyzed
)
private String isDeleted;
@Field(
type = FieldType.String,
index = FieldIndex.not_analyzed
)
private String shopId;
@Field(
type = FieldType.String,
index = FieldIndex.not_analyzed
)
private String status;
@Field(
type = FieldType.String,
index = FieldIndex.analyzed,
analyzer = MmsegAnalyzerConstant.mmseg_maxword,
searchAnalyzer = MmsegAnalyzerConstant.mmseg_maxword
)
private String title;
@Field(
type = FieldType.String,
index = FieldIndex.analyzed,
analyzer = MmsegAnalyzerConstant.mmseg_maxword,
searchAnalyzer = MmsegAnalyzerConstant.mmseg_maxword
)
private String paperWork;
@Field(
type = FieldType.Date,
index = FieldIndex.not_analyzed
)
private Date deliveryStartDate;
@Field(
type = FieldType.Date,
index = FieldIndex.not_analyzed
)
private Date deliveryEndDate;
@Field(
type = FieldType.String,
index = FieldIndex.not_analyzed
)
private String seqNo;
private String adImage;
private String linkHref;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getAdId() {
return adId;
}
public void setAdId(String adId) {
this.adId = adId;
}
public String getColumnId() {
return columnId;
}
public void setColumnId(String columnId) {
this.columnId = columnId;
}
public String getColumnIdentify() {
return columnIdentify;
}
public void setColumnIdentify(String columnIdentify) {
this.columnIdentify = columnIdentify;
}
public String getIsDeleted() {
return isDeleted;
}
public void setIsDeleted(String isDeleted) {
this.isDeleted = isDeleted;
}
public String getShopId() {
return shopId;
}
public void setShopId(String shopId) {
this.shopId = shopId;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getPaperWork() {
return paperWork;
}
public void setPaperWork(String paperWork) {
this.paperWork = paperWork;
}
public String getAdImage() {
return adImage;
}
public void setAdImage(String adImage) {
this.adImage = adImage;
}
public String getLinkHref() {
return linkHref;
}
public void setLinkHref(String linkHref) {
this.linkHref = linkHref;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public Date getDeliveryStartDate() {
return deliveryStartDate;
}
public void setDeliveryStartDate(Date deliveryStartDate) {
this.deliveryStartDate = deliveryStartDate;
}
public Date getDeliveryEndDate() {
return deliveryEndDate;
}
public void setDeliveryEndDate(Date deliveryEndDate) {
this.deliveryEndDate = deliveryEndDate;
}
public String getSeqNo() {
return seqNo;
}
public void setSeqNo(String seqNo) {
this.seqNo = seqNo;
}
} | [
"yangdi@1wandian.com"
] | yangdi@1wandian.com |
add731c4ca245ab601d7b6aa326017c02c9361c5 | d6a6fcd59778cd2bdf3de8a11b6995405edf7715 | /pris/src/main/java/br/com/pris/pris/controllers/FuncionarioController.java | 0bdee4bcae10ae81bc06306e65670b1d8f4bfa57 | [] | no_license | pi-gestao-pedidos/BackEnd | ac0821993ce5de89728e1dbdd278da0ad0a2217f | 110989676cc3f699a9ec4a1c6638abd46c9bd1bb | refs/heads/master | 2023-01-21T13:34:32.989679 | 2020-11-21T14:20:04 | 2020-11-21T14:20:04 | 308,710,137 | 0 | 0 | null | 2020-11-21T16:34:26 | 2020-10-30T18:15:31 | Java | UTF-8 | Java | false | false | 1,901 | java | package br.com.pris.pris.controllers;
import javax.validation.Valid;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import br.com.pris.pris.model.entities.Funcionario;
import br.com.pris.pris.model.services.FuncionarioService;
@RestController
@RequestMapping("/funcionarios")
@CrossOrigin
public class FuncionarioController {
@Autowired
private FuncionarioService service;
@PostMapping
public ResponseEntity<Funcionario> insertFuncionario(@Valid @RequestBody Funcionario funcionario) {
return ResponseEntity.ok(service.addFuncionario(funcionario));
}
@GetMapping
public ResponseEntity<Iterable<Funcionario>> showAllFuncionarios() {
return ResponseEntity.ok(service.findAllFuncionarios());
}
@GetMapping("/{id}")
public ResponseEntity<Funcionario> showFuncionarioById(@PathVariable Integer id) {
return ResponseEntity.ok(service.findFuncionarioById(id));
}
@PutMapping("/{id}")
public ResponseEntity<Funcionario> updateFuncionario(@Valid @RequestBody Funcionario funcionario,
@PathVariable Integer id) {
return ResponseEntity.ok(service.changeFuncionario(funcionario, id));
}
@DeleteMapping("/{id}")
public ResponseEntity<?> deleteFuncionario(@PathVariable Integer id) {
service.deleteFuncionario(id);
return ResponseEntity.noContent().build();
}
}
| [
"dreis.gti@gmail.com"
] | dreis.gti@gmail.com |
4be25f57d69eb9d530d7c0af62728c2d513c0f08 | 33a895621939aaf90bcd258295edfa7e3794cd37 | /SLEUTH-rest/src/main/java/be/moac/sleuth/person/web/PersonRestController.java | dc9c904c1c3fb79f3c70337f42bf6d276b359244 | [] | no_license | janvanrensbergen/sleuth-demo | 04709dcceb688060a855ae084c4a9774c89a012d | 78521cbf1af29c33bf419c1ebd0035e0962cb73f | refs/heads/master | 2021-01-17T19:08:50.760283 | 2016-06-24T05:38:43 | 2016-06-24T05:38:43 | 61,319,065 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,538 | java | package be.moac.sleuth.person.web;
import be.moac.sleuth.person.PersonForm;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;
import javax.validation.Valid;
/**
* @author Jan Van Rensbergen.
*/
@RestController
@RequestMapping(path = "/person")
public class PersonRestController {
private static final Logger logger = LoggerFactory.getLogger(PersonRestController.class);
private final RestTemplate restTemplate;
@Autowired
public PersonRestController(RestTemplate restTemplate) {
this.restTemplate = restTemplate;
}
@RequestMapping(method = RequestMethod.POST)
public String register(@RequestBody @Valid PersonForm person) {
logger.info("Received some person [{} {}] through rest. Sending to some service.", person.getFirstName(), person.getName());
final ResponseEntity<String> response = this.restTemplate
.postForEntity("http://localhost:8282/api/person", person, String.class);
logger.info("Some service responded with code [{}] and body [{}]", response.getStatusCode(), response.getBody());
return "OK";
}
}
| [
"jan.vanrensbergen@gmail.com"
] | jan.vanrensbergen@gmail.com |
4665dcc9a37c8e88a4cb469197feec497473c0bc | d0b84a7fbcea5a4903bc1369e86716c4af1fafde | /DesignPatterns/src/designpattern/creational/singleton/BillPughSingleton.java | 3cdbafc535ec74d0c8c27301b1d5d0dfbc78aaae | [] | no_license | TheAbhishekKumarSinha/CodingDevelopment | 1a3ed3ae8e6afeb1141fe3c3392bbcf1a88a171e | 4b543f37198547984d98035b20de4a80bac6fd2e | refs/heads/master | 2022-07-28T00:34:13.717371 | 2022-07-16T15:49:37 | 2022-07-16T15:49:37 | 126,588,512 | 0 | 0 | null | 2018-10-14T10:54:39 | 2018-03-24T10:25:28 | Java | UTF-8 | Java | false | false | 399 | java | package designpattern.creational.singleton;
/**
* @author Abhishek Kumar Sinha
*
*/
public class BillPughSingleton {
private BillPughSingleton() {
}
private static class SingletonHelper {
private static final BillPughSingleton INSTANCE = new BillPughSingleton();
}
public static BillPughSingleton getInstance() {
return SingletonHelper.INSTANCE;
}
}
| [
"abhishekkumar.sinha@misys.com"
] | abhishekkumar.sinha@misys.com |
2057d8406c180f66a8bc23384b54875f99ad7d7e | 158ed2906743f3f8e3bf27e6adcb4c0a6d5fbef9 | /src/test/java/com/ltanner/inventoryManagement/AppTest.java | 27c65e524cacec13860023d655b4f6a22e8118c1 | [] | no_license | AstroEL/InventoryManagementAPI | a86bfeddf156837256855f9951e2d76e7c76901d | fccff5cdd526cd3ea17b6e6a72c9c638478babed | refs/heads/master | 2022-07-23T22:58:20.192747 | 2019-11-08T00:15:42 | 2019-11-08T00:15:42 | 220,352,730 | 1 | 0 | null | 2022-06-21T02:11:39 | 2019-11-08T00:13:34 | Java | UTF-8 | Java | false | false | 659 | java | package com.ltanner.inventoryManagement;
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 );
}
}
| [
"leiland12@gmail.com"
] | leiland12@gmail.com |
089a635e9e991a182f3f9abe611a78a2797d0ec6 | 28c444100fd19fb9fd58bad46542f5bcf3892cbd | /tron-math/src/main/java/com/migtron/tron/math/color/ColorSimilarity.java | 159f46804d4e6b86d8fbfaa62a5aef8d5226e9a9 | [] | no_license | albarral/migtron3 | bf6213ca54c3f238a867cde82fd592e83a1aea87 | ed39a84499b49326f21d76a23ab69b33bf8931ac | refs/heads/master | 2021-07-06T04:29:29.557680 | 2019-06-13T17:45:10 | 2019-06-13T17:45:10 | 191,623,462 | 0 | 0 | null | 2020-10-13T13:51:19 | 2019-06-12T18:20:42 | Java | UTF-8 | Java | false | false | 1,202 | java | /*
* Copyright (C) 2019 by Migtron Robotics
* albarral@migtron.com
*/
package com.migtron.tron.math.color;
import com.migtron.tron.math.Vec3f;
import com.migtron.tron.math.Vec3s;
/**
* Utility class to perform color similarity computations using local RGB color and global hsv essence.
* @author albarral
*/
public class ColorSimilarity
{
private float SAME_RGB_LOCAL; // required RGB similarity vs local color
private float SAME_HSV_GLOBAL; // required HSV similarity vs global color public static final float HUE_SECTOR = 60.0f;
public ColorSimilarity(float sameLocalRGB, float sameGlobalHSV)
{
this.SAME_RGB_LOCAL = sameLocalRGB;
this.SAME_HSV_GLOBAL = sameGlobalHSV;
}
public ColorSimilarity()
{
this(1.0f, 1.0f);
}
public float getRGBSimilarity() {return SAME_RGB_LOCAL;};
public float getHSVSimilarity() {return SAME_HSV_GLOBAL;};
public boolean checkSameColor(Vec3f rgb1, Vec3s rgb2, HSVEssence hsvEssence, Vec3f hsv2)
{
return ((rgb1.getEuclideanDistance(rgb2) < SAME_RGB_LOCAL) &&
hsvEssence.getDistance(hsv2) < SAME_HSV_GLOBAL);
}
}
| [
"albarral@migtron.com"
] | albarral@migtron.com |
a1236930b895f2ae1406db776b44a48ac25cab24 | bbca5701b310ebf07a8def09156acf4f70381fa9 | /security/security.core/src/main/java/com/gwtjs/icustom/springsecurity/support/CustomUserDetailsService.java | 25b9a1bb1d280c24e584091ab2ad5ac7ad8cd4cc | [
"Apache-2.0"
] | permissive | flash8627/icustom-boot | 4ed6f4393e7a384658a5d29c10f992c379ec5195 | ec68cadf54ae7a2b2f8b1c5c61be8e7feaf8e695 | refs/heads/master | 2021-01-19T00:49:51.423273 | 2017-11-10T13:52:12 | 2017-11-10T13:52:12 | 87,210,825 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,918 | java | package com.gwtjs.icustom.springsecurity.support;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import javax.inject.Inject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Component;
import com.gwtjs.icustom.springsecurity.dao.ISysRoleDao;
import com.gwtjs.icustom.springsecurity.dao.ISysUserDao;
import com.gwtjs.icustom.springsecurity.entity.SysRoleVO;
import com.gwtjs.icustom.springsecurity.entity.SysUserVO;
/**
* 认证管理器,实现用户认证的入口
* <p>
* 以从数据库中读入用户的密码,角色信息,是否锁定,账号是否过期等
* </p>
*/
@Component
public class CustomUserDetailsService implements UserDetailsService {
@Autowired
private ISysUserDao userDao;
@Inject
private ISysRoleDao isysRoleDao;
/**
* 用户登陆在这里
*/
@Override
public UserDetails loadUserByUsername(String account)
throws UsernameNotFoundException {
// SysUser对应数据库中的用户表,是最终存储用户和密码的表,可自定义
SysUserVO user = userDao.findByAccount(account);
if (user == null) {
throw new UsernameNotFoundException("account " + account + " not found");
}else{
Set<SysRoleVO> sysRoles = this.getUserRoles(isysRoleDao.findByUserRoles(user.getId()));
user.setSysRoles(sysRoles);
}
// SecurityUser实现UserDetails并将SysUser的name映射为username
SecurityUser seu = new SecurityUser(user);
return seu;
}
/**
*
*/
private Set<SysRoleVO> getUserRoles(List<SysRoleVO> list){
Set<SysRoleVO> set = new HashSet<SysRoleVO>();
for (SysRoleVO sysRole : list) {
set.add(sysRole);
}
return set;
}
}
| [
"flash8627@hotmail.com"
] | flash8627@hotmail.com |
a614e5856d731f9bd741e2e0531700b112c0d8b7 | bbce4f9ec2de93f540809ff09c7e6b25f76a564e | /app/src/main/java/com/amin/fastandroidnetworkingdemo/model/MovieGenre.java | e93afc56170ab3dab0fe686e707997b9a12593d8 | [] | no_license | amin200x/MovieBuff | ae2eb2be5b849ee7dc5912020b60ec401a10506f | 441288a8de93f579e4f4118206d890908821ebcd | refs/heads/main | 2023-02-01T17:14:53.530533 | 2020-12-15T10:11:16 | 2020-12-15T10:11:16 | 321,589,811 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,420 | java |
package com.amin.fastandroidnetworkingdemo.model;
import android.os.Parcel;
import android.os.Parcelable;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
public class MovieGenre implements Parcelable
{
@SerializedName("id")
@Expose
private Integer id;
@SerializedName("name")
@Expose
private String name;
public final static Creator<MovieGenre> CREATOR = new Creator<MovieGenre>() {
@SuppressWarnings({
"unchecked"
})
public MovieGenre createFromParcel(Parcel in) {
return new MovieGenre(in);
}
public MovieGenre[] newArray(int size) {
return (new MovieGenre[size]);
}
}
;
protected MovieGenre(Parcel in) {
this.id = ((Integer) in.readValue((Integer.class.getClassLoader())));
this.name = ((String) in.readValue((String.class.getClassLoader())));
}
public MovieGenre() {
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public void writeToParcel(Parcel dest, int flags) {
dest.writeValue(id);
dest.writeValue(name);
}
public int describeContents() {
return 0;
}
}
| [
"amin@gmail.com"
] | amin@gmail.com |
f3646a57cf45dbcd8e04fc9505cb8dd94e0346b8 | 6da98bd81e0133ee13f6b4574ce87012f3a867ef | /libserialhelper/src/main/java/com/ewedo/libserialhelper/util/CmdBuilder.java | c7e341108d5c4ca3f08eb54cd077650dc5a39f43 | [] | no_license | Fozei/CommonLib | 4d78b5b435b65e2f16af2215778ea82ce98a7dc3 | 37324281fe2ed18e8a5dcc8e14b4f7e84dd7270a | refs/heads/master | 2020-03-19T23:25:34.604243 | 2018-06-12T02:19:18 | 2018-06-12T02:19:18 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,003 | java | package com.ewedo.libserialhelper.util;
import com.ewedo.libserialhelper.Constants;
/**
* Created by fozei on 17-11-16.
*/
class CmdBuilder {
/**
* 拼接没有数据包的简单命令
*
* @param cmd 要发送的指令
* @return 拼接结果
*/
public static byte[] buildSimpleCmd(byte[] cmd) {
//STX + Length + Length + cmd.length + ETX + BCC
byte[] result = new byte[cmd.length + 5];
int index = 0;
result[index++] = Constants.STX;
result[index++] = (byte) (cmd.length >> 8);
result[index++] = (byte) cmd.length;
for (byte aCmd : cmd) {
result[index++] = aCmd;
}
result[index++] = Constants.ETX;
result[index] = generateBcc(result);
return result;
}
public static byte[] buildCmdWithData(byte[] cmd, byte segment, byte[] pwd) {
//0x02 0x00 0x09 0x35 0x32 扇区号 6 byte hex 密码 0x03
byte[] result = new byte[cmd.length + 6 + pwd.length];
int index = 0;
result[index++] = Constants.STX;
result[index++] = (byte) (cmd.length >> 8);
result[index++] = (byte) (cmd.length + pwd.length + 1);
for (byte aCmd : cmd) {
result[index++] = aCmd;
}
result[index++] = segment;
for (byte aPwd : pwd) {
result[index++] = aPwd;
}
result[index++] = Constants.ETX;
result[index] = generateBcc(result);
return result;
}
public static byte[] buildReadDataCmd(byte[] cmd, byte segment, byte bound) {
//0x02 0x00 0x04 0x35 0x33 扇区号 块号 0x03 BCC
byte[] result = new byte[9];
int index = 0;
result[index++] = Constants.STX;
result[index++] = (byte) (0x00);
result[index++] = (byte) (0x04);
for (byte aCmd : cmd) {
result[index++] = aCmd;
}
result[index++] = segment;
result[index++] = bound;
result[index++] = Constants.ETX;
result[index] = generateBcc(result);
return result;
}
private static byte generateBcc(byte[] result) {
byte bcc = result[0];
for (int i = 1; i < result.length; i++) {
bcc ^= result[i];
}
return bcc;
}
public static byte[] buildWriteDataCmd(byte[] cmd, byte segment, byte area, byte[] data) {
byte[] result = new byte[26];
int index = 0;
result[index++] = Constants.STX;
result[index++] = (byte) (0x00);
result[index++] = (byte) (cmd.length + 2 + data.length);
for (byte aCmd : cmd) {
result[index++] = aCmd;
}
result[index++] = segment;
result[index++] = area;
for (byte aData : data) {
result[index++] = aData;
}
result[index++] = Constants.ETX;
result[index] = generateBcc(result);
return result;
}
}
| [
"fozei@qq.com"
] | fozei@qq.com |
d2034ca2344da1147a58a1276a861764cd17a640 | b35e42618890b01f01f5408c05741dc895db50a2 | /opentsp-dongfeng-modules/opentsp-dongfeng-openapi/dongfeng-openapi-core/src/main/java/com/navinfo/opentsp/dongfeng/openapi/core/service/impl/PositionReportService.java | a819d1d2b06731273a2923d2f33d3b1e838dc49a | [] | no_license | shanghaif/dongfeng-huanyou-platform | 28eb5572a1f15452427456ceb3c7f3b3cf72dc84 | 67bcc02baab4ec883648b167717f356df9dded8d | refs/heads/master | 2023-05-13T01:51:37.463721 | 2018-03-07T14:24:03 | 2018-03-07T14:26:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,836 | java | package com.navinfo.opentsp.dongfeng.openapi.core.service.impl;
import com.navinfo.opentsp.dongfeng.common.result.HttpCommandResultWithData;
import com.navinfo.opentsp.dongfeng.common.service.BaseService;
import com.navinfo.opentsp.dongfeng.common.util.StringUtil;
import com.navinfo.opentsp.dongfeng.openapi.core.pojo.AuditStationPojo;
import com.navinfo.opentsp.dongfeng.openapi.core.service.IPositionReportService;
import com.navinfo.opentsp.dongfeng.openapi.dto.station.StationPositionReportInfo;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
* @author tushenghong
* @version 1.0
* @date 2017-07-17
* @modify
* @copyright Navi Tsp
*/
@Service
public class PositionReportService extends BaseService implements IPositionReportService {
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
@Transactional
public HttpCommandResultWithData stationLocationReport(StationPositionReportInfo info) {
HttpCommandResultWithData result = new HttpCommandResultWithData();
AuditStationPojo pojo = toAuditStationPojo(info);
dao.executeUpdate("addStationAudit", pojo);
return result;
}
private AuditStationPojo toAuditStationPojo(StationPositionReportInfo info) {
AuditStationPojo pojo = new AuditStationPojo();
pojo.setStationId(StringUtil.toBigInteger(info.getId()));
pojo.setAddress(info.getAddress());
pojo.setStationType(Integer.valueOf(info.getLv()));
pojo.setLongitude(StringUtil.toBigInteger(info.getLon()));
pojo.setLatitude(StringUtil.toBigInteger(info.getLat()));
pojo.setAccountId(StringUtil.toBigInteger(info.getUserId()));
pojo.setCreateTime(StringUtil.toBigInteger(StringUtil.getCurrentTimeSeconds()));
return pojo;
}
}
| [
"zhangtiantong@aerozhonghuan.com"
] | zhangtiantong@aerozhonghuan.com |
697e8783822859b03de9bcaa5c94ce89377359fa | 82cc2675fdc5db614416b73307d6c9580ecbfa0c | /eb-service/quartz-service/src/main/java/cn/comtom/quartz/job/EBRSTInfoReportJob.java | d0cf36ea7bac4a23a72a08d3aae99bc2670de37e | [] | no_license | hoafer/ct-ewbsv2.0 | 2206000c4d7c3aaa2225f9afae84a092a31ab447 | bb94522619a51c88ebedc0dad08e1fd7b8644a8c | refs/heads/master | 2022-11-12T08:41:26.050044 | 2020-03-20T09:05:36 | 2020-03-20T09:05:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,041 | java | package cn.comtom.quartz.job;
import cn.comtom.quartz.service.ILinkageService;
import cn.comtom.quartz.utils.SpringContextUtils;
import cn.comtom.tools.response.ApiResponse;
import lombok.extern.slf4j.Slf4j;
import org.quartz.DisallowConcurrentExecution;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import java.util.Date;
/**
* 台站信息上报
* @author:liuhy
* @date: 2019/5/9
* @time: 下午 2:15
*/
@Slf4j
@DisallowConcurrentExecution
public class EBRSTInfoReportJob implements Job {
private ILinkageService linkageService = (ILinkageService) SpringContextUtils.getBean("linkageServiceImpl");
@Override
public void execute(JobExecutionContext context) throws JobExecutionException {
log.info("=====台站信息资源上报开始====[{}]",new Date());
ApiResponse response = linkageService.ebrstInfoReport();
log.info("=====台站信息资源上报上报结束====[{}],result=[{}]",new Date(),response.getSuccessful());
}
}
| [
"568656253@qq.com"
] | 568656253@qq.com |
41f3c0c4e05e7d04aa3c701268ee7e26f3ee2191 | 905e2896a76fa634f0684ad07b641b4e76778c94 | /hibernatetutorial/src/main/java/com/vivek/myhibernate/UserApp1.java | 52f4da7923f663c7ceb7c9d737b3039a81a5fcd7 | [] | no_license | vivekdubeydeveloper/hibernate | 8556692b66ffbf616b74e9c35c86644e2af36ff4 | 3d9cdb492c209d92ec87976c7df3c5bb8efc03f6 | refs/heads/master | 2022-06-24T19:49:32.007308 | 2019-12-03T17:30:55 | 2019-12-03T17:30:55 | 225,419,662 | 0 | 0 | null | 2022-06-21T02:22:12 | 2019-12-02T16:27:02 | Java | UTF-8 | Java | false | false | 1,152 | java | package com.vivek.myhibernate;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;
import com.vivek.myhibernate.entity.UserDetails;
/**
* Hello world!
*
*/
public class UserApp1
{
public static void main( String[] args )
{
//create entity this is transient object not associated with session
UserDetails user=new UserDetails();
user.setId(6);
user.setUserName("Mohan");
user.setDept("IT");
//read configuration and build session factory
SessionFactory sf=new Configuration().configure().buildSessionFactory();
//Read configuration File Explicitly
//SessionFactory sf=new Configuration().configure("hibernate.cfg.xml").buildSessionFactory();
//open session
Session session=sf.openSession();
//begin transaction
session.beginTransaction();
//save user
session.save(user);
//user is persistent object associate with session
session.getTransaction().commit();
session.close();
//after session closed object is detached
//close session factory
sf.close();
}
}
| [
"vivek.dubeydeveloper@gmail.com"
] | vivek.dubeydeveloper@gmail.com |
7a7eb438b33d4a9991390766ed52e98361532850 | b53d98c4ac7227dd93d4b7408907bc1296d04ad0 | /com/media/common/model/video/BoxOfficeTotal.java | 0cffd69ea09b3cf2706bbae14ac713a00e07f433 | [] | no_license | yangmeichenlei/demo | 0f5dd02a4e4016d022a98662e0e6dcd8d58b1d41 | 3804ef064245d6d4efe4672b2fa4a22512ea121c | refs/heads/master | 2020-04-13T07:52:02.599651 | 2018-12-25T08:50:05 | 2018-12-25T08:50:05 | 163,064,318 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,414 | java | package com.media.common.model.video;
import com.media.common.base.BaseModel;
import java.math.BigDecimal;
import java.util.Date;
/**
* @author zhaoRong
*
*/
public class BoxOfficeTotal extends BaseModel {
private static final long serialVersionUID = 1L;
private String pkBoxOfficeTotalId;
private String videoId;
private BigDecimal boxOfficeTotal;
private Date lastUpdateTime;
private String memo;
public String getPkBoxOfficeTotalId() {
return pkBoxOfficeTotalId;
}
public void setPkBoxOfficeTotalId(String pkBoxOfficeTotalId) {
this.pkBoxOfficeTotalId = pkBoxOfficeTotalId == null ? null : pkBoxOfficeTotalId.trim();
}
public String getVideoId() {
return videoId;
}
public void setVideoId(String videoId) {
this.videoId = videoId == null ? null : videoId.trim();
}
public BigDecimal getBoxOfficeTotal() {
return boxOfficeTotal;
}
public void setBoxOfficeTotal(BigDecimal boxOfficeTotal) {
this.boxOfficeTotal = boxOfficeTotal;
}
public Date getLastUpdateTime() {
return lastUpdateTime;
}
public void setLastUpdateTime(Date lastUpdateTime) {
this.lastUpdateTime = lastUpdateTime;
}
public String getMemo() {
return memo;
}
public void setMemo(String memo) {
this.memo = memo == null ? null : memo.trim();
}
} | [
"lilinyang@qq.cmd"
] | lilinyang@qq.cmd |
32f7d616f7a0f4bda086c144f770834d0abfdaa3 | 2b71fc9dee9d0d55a451ad9e26f29d1d91ee4c4e | /core/src/test/java/org/goldian/ccfin_core/ExampleUnitTest.java | 7da8fd3cf1f17c7db2b08c4b8e707fede469065c | [] | no_license | ruokwangpawn/Latte | 0c7748383f749951d75903e70e64568189a2e8ce | d1c3fe0e81eb04be4216ad627f0e6beed6fc4597 | refs/heads/master | 2022-02-21T02:49:11.062756 | 2022-02-09T08:14:34 | 2022-02-09T08:14:34 | 110,524,875 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 400 | java | package org.goldian.ccfin_core;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
} | [
"240527800@qq.com"
] | 240527800@qq.com |
d4fd1b4319c19fb9d7d8026bd55811f0d4366cea | 8a428922c320d214518e52f59c2a84fed9999928 | /src/main/java/com/sda/pizzeria/service/UserRoleService.java | 2b9925f4ba8b83d4da3e038957d939413668bbf2 | [] | no_license | SaintAmeN/java_12_pizzeria | 82e49ef77fa247ea7513da4f61953318ea123fe5 | 0684837b5a251b7fa199ec87e59863d0475194ec | refs/heads/master | 2020-04-09T02:08:09.423966 | 2018-12-02T14:48:26 | 2018-12-02T14:48:26 | 159,929,755 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 958 | java | package com.sda.pizzeria.service;
import com.sda.pizzeria.model.UserRole;
import com.sda.pizzeria.repository.UserRoleRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.util.HashSet;
import java.util.List;
import java.util.Optional;
import java.util.Set;
@Service
public class UserRoleService {
@Value("${pizzeria.user.defaultRoles}")
private String[] defaultRoles;
@Autowired
private UserRoleRepository userRoleRepository;
public Set<UserRole> getDefaultUserRoles(){
Set<UserRole> userRoles = new HashSet<>();
for (String role : defaultRoles) {
Optional<UserRole> singleRole = userRoleRepository.findByName(role);
if (singleRole.isPresent()) {
userRoles.add(singleRole.get());
}
}
return userRoles;
}
}
| [
"pawel.reclaw@gmail.com"
] | pawel.reclaw@gmail.com |
b40b99c64269dae954c82af4827d552c453b06a7 | 3140584b31299bcf49c88563d847ece40d77d1b9 | /user-service/src/main/java/com/yzhao66/cloud/service/UserService.java | 943514fecd667b76036df39cffaed28906f21802 | [] | no_license | yzhao66/springcloud-demo | 5ece44863ccdb7ca29a4ab3f83a5ee7b4298a2f0 | 35d83cb068b63693eb27590e8d3f5e5beab69e98 | refs/heads/master | 2023-03-25T04:43:15.392543 | 2021-03-26T03:23:00 | 2021-03-26T03:23:00 | 264,128,748 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 374 | java | package com.yzhao66.cloud.service;
import com.yzhao66.cloud.domain.User;
import java.util.List;
/**
* Created by macro on 2019/8/29.
*/
public interface UserService {
void create(User user);
User getUser(Long id);
void update(User user);
void delete(Long id);
User getByUsername(String username);
List<User> getUserByIds(List<Long> ids);
}
| [
"yangzhuohao@cecii.cn"
] | yangzhuohao@cecii.cn |
ec78189c25a9f3ed91591abc7e3c544018851d75 | ad597acefb5ee65c39731a1035f4f1a642514891 | /Expeciall_2016_12_11/LikeException.java | 234527206c205cf4db4e1f593dc2c058aefd2d97 | [] | no_license | congrobot123/Huangss | 2b4a6f4828091a53c4add497d2d2ac94cb280fa7 | e59418ffdd8efc6aa765479a5d55bc366e5df67a | refs/heads/master | 2020-08-03T14:59:36.025164 | 2016-12-13T14:16:36 | 2016-12-13T14:16:36 | 73,545,219 | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 531 | java | import java.util.Scanner;
public class LikeException
{
public static void main(String[] args) throws Exception
{
Scanner scan =new Scanner(System.in);
System.out.println("请输入一个字符串:");
String[] st = new String[3];
for(int i =0; i < st.length; i++)
{
st[i] = scan.next();
}
if(st[0].equalsIgnoreCase("I") && st[1].equalsIgnoreCase("am") && st[2].equalsIgnoreCase("007"))
{
System.out.println("亲爱的007");
}
else
{
throw new Exception("对不起,请下次进入");
}
}
}
| [
"770363228@qq.com"
] | 770363228@qq.com |
2462db5387b3e112df5c215a60ef2db2c47cf468 | 2b236a8a50d4b3fc8144f9c0ad57d7691a505b16 | /MultiDataSource-portlet/docroot/WEB-INF/src/com/meera/multidatasource/service/impl/TableFromDefaultDataSourceLocalServiceImpl.java | 50af92df45f1bb17bcdc1aaa49bd9f13c04bdd06 | [] | no_license | LiferaySavvy/Liferay-Plugin-Portlet-Connecting-Multiple-Datasources | d972b7f6280db645f4978a0267cfd3137e711043 | d044ef3faf71ec0871b4d088a693f51aef6885d9 | refs/heads/master | 2021-01-10T16:55:44.279116 | 2015-11-23T13:09:59 | 2015-11-23T13:09:59 | 46,720,880 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,823 | java | /**
* Copyright (c) 2000-2012 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 com.meera.multidatasource.service.impl;
import com.meera.multidatasource.service.base.TableFromDefaultDataSourceLocalServiceBaseImpl;
/**
* The implementation of the table from default data source 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 {@link com.meera.multidatasource.service.TableFromDefaultDataSourceLocalService} 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 E5410
* @see com.meera.multidatasource.service.base.TableFromDefaultDataSourceLocalServiceBaseImpl
* @see com.meera.multidatasource.service.TableFromDefaultDataSourceLocalServiceUtil
*/
public class TableFromDefaultDataSourceLocalServiceImpl
extends TableFromDefaultDataSourceLocalServiceBaseImpl {
/*
* NOTE FOR DEVELOPERS:
*
* Never reference this interface directly. Always use {@link com.meera.multidatasource.service.TableFromDefaultDataSourceLocalServiceUtil} to access the table from default data source local service.
*/
} | [
"meera.success@gmail.com"
] | meera.success@gmail.com |
61bd324b66450e3b7b957495cc356277d2340eee | bfcf51666d966dddf0429d988ca2ffe10f2f92a4 | /dubbo-mvc-web/src/main/java/com/vcooline/demo/dubbo/web/DemoController.java | 52b7ce7941612a0461e1e0bccf06749ec7386ef9 | [] | no_license | emac/dubbo-demo-mvc | a5b60fd68d692bd36676754433af53bfd85ec5ea | 11d70a070e859a82cfc6cd444361f676673d26d6 | refs/heads/master | 2021-03-12T20:28:10.546651 | 2015-07-24T15:39:58 | 2015-07-24T15:39:58 | 41,414,811 | 3 | 1 | null | null | null | null | UTF-8 | Java | false | false | 652 | java | package com.vcooline.demo.dubbo.web;
import com.vcooline.demo.dubbo.api.DemoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
/**
* @author Emac
*/
@Controller
public class DemoController {
@Autowired
private DemoService demoService;
@RequestMapping("/")
public String index() {
return "index";
}
@RequestMapping("/demo")
public @ResponseBody String demo() {
return demoService.sayHello("world");
}
}
| [
"shen.b@vcooline.com"
] | shen.b@vcooline.com |
e78dc6dc30e9caf3685d096b35ea7f6d32af4c8a | a52db087080bf4fe1be941cadda246af3ca06bc6 | /src/main/java/com/why/platform/framework/engine/http/ExporterServer.java | d5d6d1aa22e6c6c1571ad6fd1b1e926ea43534b1 | [] | no_license | wanghaiyang1221/application-engine | 0ec5f5b8b606acf1490bce3528572fef5374c49f | 98effce84d3106a5f21054398b10b61479cb27d3 | refs/heads/master | 2021-04-09T15:04:34.930535 | 2018-03-16T08:32:36 | 2018-03-16T08:32:36 | 125,479,952 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 205 | java | package com.why.platform.framework.engine.http;
/**
* Created by zhouxl on 2016/11/17 0017.
*/
public interface ExporterServer {
void start() throws Exception;
void stop() throws Exception;
}
| [
"619331247@qq.com"
] | 619331247@qq.com |
b81907d013b40ec382c5f7c3c6647ea42c9468f5 | 8acff4c2a4817b9de82f95db92a77a1382b96d27 | /src/main/java/br/com/zupacademy/neto/casadocodigo/erros/ResourceNotFoundException.java | 3c03d6a6c88b117931067d832f49f37dd88d3bb9 | [
"Apache-2.0"
] | permissive | netomantonio/orange-talents-05-template-casa-do-codigo | b9da0a7632d2bf314a5370e789b6382d1b070923 | 4387bb2f3402bf1aa67670f71f385e7652eb5f62 | refs/heads/main | 2023-05-04T16:50:37.741974 | 2021-05-23T00:44:04 | 2021-05-23T00:44:04 | 368,201,313 | 0 | 0 | Apache-2.0 | 2021-05-17T13:45:54 | 2021-05-17T13:45:54 | null | UTF-8 | Java | false | false | 338 | java | package br.com.zupacademy.neto.casadocodigo.erros;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ResponseStatus;
@ResponseStatus(HttpStatus.NOT_FOUND)
public class ResourceNotFoundException extends RuntimeException{
public ResourceNotFoundException(String message) {
super(message);
}
} | [
"netomantonio@gmail.com"
] | netomantonio@gmail.com |
261b754ce407edf3cd6cd78f3f3e278ba60e2f12 | 4780edea7365473879760459fb5a4dea3c93ca94 | /src/bd2/controllers/LoginController.java | 41aea1ac4531cf4eafd53cbfccfa07795357402c | [] | no_license | KPucilowski/pwr_bd2 | 28e1090826025aeeb3acd502cb2f705a6f99ae1e | a0669cedbf67845ad16bc06c05e9a9ebdc23dbca | refs/heads/main | 2023-02-20T03:30:59.429692 | 2021-01-19T14:48:26 | 2021-01-19T14:48:26 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,326 | java | package bd2.controllers;
import bd2.App;
import bd2.models.LoginModel;
import bd2.tools.LoginTools;
import bd2.views.LoginView;
import javax.swing.*;
import java.security.NoSuchAlgorithmException;
import java.sql.SQLException;
public class LoginController implements IController {
private final LoginView view;
private final LoginModel model;
public LoginController() {
this.view = new LoginView();
this.model = new LoginModel(null);
init();
}
@Override
public void init() {
view.getLoginButton().addActionListener(e -> login());
}
@Override
public void dispose() {
view.dispose();
}
private void login() {
try {
var login = view.getLoginField().getText();
var pass = LoginTools.charToSha256(view.getPasswordField().getPassword());
model.login(login, pass);
if (model.getType() != null) {
App.reconnect(model, "pass");
dispose();
}
} catch (SQLException | NoSuchAlgorithmException e) {
JOptionPane.showMessageDialog(null,
"Wrong login and/or password. Try again.",
"Error",
JOptionPane.ERROR_MESSAGE);
e.printStackTrace();
}
}
}
| [
"addanik@gmail.com"
] | addanik@gmail.com |
5352f6587bca89a73fc72a6827f583d0cc1508d3 | 60c5a55e6577b865f8af774ca7c62c81b6eced88 | /SimpleDBServer/src/simpledb/parse/InsertData.java | 0c14f33416a8098412b7875ba7cfcc1eafc5d531 | [] | no_license | philip-w-howard/SimpleDB | 30ac2062e8bd9e3ac38b8dffe00ccd4ddc3e55a5 | a7578bed712c28f82c9e09c1a4aa0f8d5d03a547 | refs/heads/master | 2021-01-25T12:01:56.290610 | 2014-04-28T21:54:30 | 2014-04-28T21:54:30 | 18,180,317 | 2 | 2 | null | null | null | null | UTF-8 | Java | false | false | 1,154 | java | package simpledb.parse;
import simpledb.query.Constant;
import java.util.*;
/**
* Data for the SQL <i>insert</i> statement.
* @author Edward Sciore
*/
public class InsertData {
private String tblname;
private List<String> flds;
private List<Constant> vals;
/**
* Saves the table name and the field and value lists.
*/
public InsertData(String tblname, List<String> flds, List<Constant> vals) {
this.tblname = tblname;
this.flds = flds;
this.vals = vals;
}
/**
* Returns the name of the affected table.
* @return the name of the affected table
*/
public String tableName() {
return tblname;
}
/**
* Returns a list of fields for which
* values will be specified in the new record.
* @return a list of field names
*/
public List<String> fields() {
return flds;
}
/**
* Returns a list of values for the specified fields.
* There is a one-one correspondence between this
* list of values and the list of fields.
* @return a list of Constant values.
*/
public List<Constant> vals() {
return vals;
}
}
| [
"phil.w.howard@gmail.com"
] | phil.w.howard@gmail.com |
7761233ec83a6c771efa81d3d06933f3eab7769f | d4cb139d0a72eaf9511baf8f2435f1024ee29023 | /src/android/com/missiveapp/openwith/Serializer.java | 0a6c2f981e418517e9342fec569d5268c1bef0a5 | [
"MIT"
] | permissive | yosuke/cordova-plugin-openwith | c5d2c9badbf67ac55553cf7dc2dfd91455ad63c6 | 0c135085d1c55b151531412b25a1e3092857631e | refs/heads/master | 2020-03-26T08:27:08.472113 | 2019-10-19T22:11:41 | 2019-10-19T22:11:41 | 144,703,008 | 0 | 0 | null | 2018-08-14T10:06:54 | 2018-08-14T10:06:54 | null | UTF-8 | Java | false | false | 5,572 | java | package com.missiveapp.openwith;
import android.content.ClipData;
import android.content.ContentResolver;
import android.content.Intent;
import android.database.Cursor;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.provider.MediaStore;
import android.util.Base64;
import java.io.IOException;
import java.io.InputStream;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
/**
* Handle serialization of Android objects ready to be sent to javascript.
*/
class Serializer {
/** Convert an intent to JSON.
*
* This actually only exports stuff necessary to see file content
* (streams or clip data) sent with the intent.
* If none are specified, null is return.
*/
public static JSONObject toJSONObject(
final ContentResolver contentResolver,
final Intent intent)
throws JSONException {
JSONArray items = null;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
items = itemsFromClipData(contentResolver, intent.getClipData());
}
if (items == null || items.length() == 0) {
items = itemsFromExtras(contentResolver, intent.getExtras());
}
if (items == null) {
return null;
}
final JSONObject action = new JSONObject();
action.put("action", translateAction(intent.getAction()));
action.put("exit", readExitOnSent(intent.getExtras()));
action.put("items", items);
return action;
}
public static String translateAction(final String action) {
if ("android.intent.action.SEND".equals(action) ||
"android.intent.action.SEND_MULTIPLE".equals(action)) {
return "SEND";
} else if ("android.intent.action.VIEW".equals(action)) {
return "VIEW";
}
return action;
}
/** Read the value of "exit_on_sent" in the intent's extra.
*
* Defaults to false. */
public static boolean readExitOnSent(final Bundle extras) {
if (extras == null) {
return false;
}
return extras.getBoolean("exit_on_sent", false);
}
/** Extract the list of items from clip data (if available).
*
* Defaults to null. */
public static JSONArray itemsFromClipData(
final ContentResolver contentResolver,
final ClipData clipData)
throws JSONException {
if (clipData != null) {
final int clipItemCount = clipData.getItemCount();
JSONObject[] items = new JSONObject[clipItemCount];
for (int i = 0; i < clipItemCount; i++) {
items[i] = toJSONObject(contentResolver, clipData.getItemAt(i).getUri());
}
return new JSONArray(items);
}
return null;
}
/** Extract the list of items from the intent's extra stream.
*
* See Intent.EXTRA_STREAM for details. */
public static JSONArray itemsFromExtras(
final ContentResolver contentResolver,
final Bundle extras)
throws JSONException {
if (extras == null) {
return null;
}
final JSONObject item = toJSONObject(
contentResolver,
(Uri) extras.get(Intent.EXTRA_STREAM));
if (item == null) {
return null;
}
final JSONObject[] items = new JSONObject[1];
items[0] = item;
return new JSONArray(items);
}
/** Convert an Uri to JSON object.
*
* Object will include:
* "type" of data;
* "uri" itself;
* "path" to the file, if applicable.
* "data" for the file.
*/
public static JSONObject toJSONObject(
final ContentResolver contentResolver,
final Uri uri)
throws JSONException {
if (uri == null) {
return null;
}
final JSONObject json = new JSONObject();
final String type = contentResolver.getType(uri);
json.put("type", type);
json.put("uri", uri);
json.put("path", getRealPathFromURI(contentResolver, uri));
return json;
}
/** Return data contained at a given Uri as Base64. Defaults to null. */
public static String getDataFromURI(
final ContentResolver contentResolver,
final Uri uri) {
try {
final InputStream inputStream = contentResolver.openInputStream(uri);
final byte[] bytes = ByteStreams.toByteArray(inputStream);
return Base64.encodeToString(bytes, Base64.DEFAULT);
}
catch (IOException e) {
return "";
}
}
/** Convert the Uri to the direct file system path of the image file.
*
* source: https://stackoverflow.com/questions/20067508/get-real-path-from-uri-android-kitkat-new-storage-access-framework/20402190?noredirect=1#comment30507493_20402190 */
public static String getRealPathFromURI(
final ContentResolver contentResolver,
final Uri uri) {
final String[] proj = { MediaStore.Images.Media.DATA };
final Cursor cursor = contentResolver.query(uri, proj, null, null, null);
if (cursor == null) {
return "";
}
final int column_index = cursor.getColumnIndex(MediaStore.Images.Media.DATA);
if (column_index < 0) {
cursor.close();
return "";
}
cursor.moveToFirst();
final String result = cursor.getString(column_index);
cursor.close();
return result;
}
}
| [
"etienne@heliom.ca"
] | etienne@heliom.ca |
44f17b4da8b86bfb42c9dff2afae142be2952359 | 5e24dc1aa3f71f38bdc6b0f31cea2cff4fd6355a | /src/main/java/com/mcakir/core/base/repository/BaseRepository.java | 4d68cb9b86fbaac318ec8fea5de37b55b09b809b | [] | no_license | ByKIRTAN/SpringMVC | 7b5fabff64a00fd124697927c003a86ac61152b5 | dd9fbe2cd1c047f691db9395ff147a43a5d1d79e | refs/heads/master | 2020-04-06T06:49:17.389243 | 2015-11-06T13:48:41 | 2015-11-06T13:48:41 | 46,125,566 | 1 | 0 | null | 2015-11-13T14:10:53 | 2015-11-13T14:10:52 | null | UTF-8 | Java | false | false | 176 | java | package com.mcakir.core.base.repository;
import org.springframework.data.jpa.repository.JpaRepository;
public interface BaseRepository<T> extends JpaRepository<T, Long> {
}
| [
"mcakir.web@gmail.com"
] | mcakir.web@gmail.com |
6a0df8d40cb476da3a96977abff53ef2faa35f60 | 94e5880912d9d9f90dee123277261fd95156e387 | /src/local/JPL/ch22/ex22_03/Luncher.java | abdc1eda719e24aaf5b037dd5b23485b301782df | [] | no_license | mikan/java-training-course | 5135bc940061e2832ba8a743d41629e73db6bc74 | c4a3528bfdc6308f548f069cfdd5966d0105b061 | refs/heads/master | 2021-01-09T20:52:08.314015 | 2014-08-02T16:12:28 | 2014-08-02T16:12:28 | 13,364,128 | 1 | 0 | null | 2020-01-28T19:11:53 | 2013-10-06T15:21:40 | Java | UTF-8 | Java | false | false | 226 | java | /*
* Copyright(C) 2014 Yutaka Kato
*/
package local.JPL.ch22.ex22_03;
public class Luncher {
public static void main(String[] args) {
System.out.println(new WhichChars("Testing 1 2 3").toString());
}
}
| [
"yutakakato@icloud.com"
] | yutakakato@icloud.com |
193ed9fa0d9b1c1aa0dd7797e40cf089a11908f2 | 3be06fef3717172e972021a617e2e6396090df40 | /component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/invoke/Get_givenEtag_whenIfMatchHeaderDoesMatch_ok_TODO.java | 00b5a15bdb14a8fec88e4b94fa6575311c955317 | [
"Apache-2.0"
] | permissive | fengabe/isis | a7479344776a039e141ac7a74be072f321f73193 | e5e5a72867c5a6fb20f6eb008fcf4423afeca68a | refs/heads/master | 2020-04-08T07:19:10.689819 | 2013-05-06T15:28:35 | 2013-05-06T15:28:35 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 158 | java | package org.apache.isis.viewer.restfulobjects.tck.domainobjectorservice.id.action.invoke;
public class Get_givenEtag_whenIfMatchHeaderDoesMatch_ok_TODO {
}
| [
"danhaywood@apache.org"
] | danhaywood@apache.org |
7a63b6815607a51ecfbf3137de28efd5102ef793 | d5ec76cc9a2a170cb7939a0f09304e6190d7d2df | /src/main/java/duke605/ms/glow/lib/GlowTab.java | 8749b66fdfb28635ebdf19e67a21d09fecd8f4d2 | [] | no_license | duke605/Glow | 60bc5faa8de83dc80d484f0f9835c9f5f55d9831 | 8889e35540d1e94272822985bfa2c6e2879c0d94 | refs/heads/master | 2021-01-22T16:25:57.931609 | 2014-08-28T20:41:32 | 2014-08-28T20:41:32 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 314 | java | package duke605.ms.glow.lib;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
public class GlowTab extends CreativeTabs {
public GlowTab() {
super("glow");
}
@Override
public Item getTabIconItem() {
return LibItems.glowstoneGoggles;
}
}
| [
"duke6605@gmail.com"
] | duke6605@gmail.com |
170fb2879600ddd41345a85a82fec761d850c323 | 59359f96e193b5801a4f4679db6629e60b1b19aa | /1902SE/src/io/Person.java | fee03dcadc17db4cf07172d042f03e075a2716ed | [] | no_license | Conwie/Study | 90af41fec60b9683a18680363c3a5dd885652ab6 | 06ce79ec7d3b5dfa4f90194f53ab163a05236fd0 | refs/heads/master | 2020-06-18T11:52:42.468411 | 2019-08-10T07:32:27 | 2019-08-10T07:32:27 | 196,295,253 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,382 | java | package io;
import java.io.Serializable;
import java.util.Arrays;
/**
* 使用当前类测试对象流的对象读写操作
*
* 一个类若希望被对象流读写,那么这个类必须要
* 实现接口:Serializable
* @author soft01
*
*/
public class Person implements Serializable{
private static final long serialVersionUID = 1L;
private String name;
private int age;
private String gender;
/*
* 当一个属性使用transient修饰后,那么进行序列化
* 时这个值会被忽略,忽略不必要的属性可以达到对象
* 序列化瘦身操作,减少不必要的资源开销。
*/
private transient String[] otherInfo;
public Person(String name, int age, String gender, String[] otherInfo) {
this.name = name;
this.age = age;
this.gender = gender;
this.otherInfo = otherInfo;
}
public String getName() {
return name;
}
public int getAge() {
return age;
}
public String getGender() {
return gender;
}
public String[] getOtherInfo() {
return otherInfo;
}
public void setName(String name) {
this.name = name;
}
public void setAge(int age) {
this.age = age;
}
public void setGender(String gender) {
this.gender = gender;
}
public void setOtherInfo(String[] otherInfo) {
this.otherInfo = otherInfo;
}
public String toString() {
return name+","+age+","+gender+","+Arrays.toString(otherInfo);
}
}
| [
"zhaokangwei@163.com"
] | zhaokangwei@163.com |
b9fa02b1a40eb013c89e3c25ec7e1bb29236123a | f70b9696255c875960460f5c3508c305a81c2858 | /Lab4/DisplayCalendars.java | e21a5f8f45507e5536aabd47c042eabc815ddffb | [] | no_license | ashwinath/JavaLab | df82036d9faff5a2a3ac0576a84fde61b6f7ef7b | a0bb99656adbc6b2100b690dd5a2ad11c73e5e1b | refs/heads/master | 2021-01-10T14:02:39.919649 | 2016-03-11T16:29:29 | 2016-03-11T16:29:29 | 52,792,426 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,367 | java | // File: DisplayCalendars.java
// Purpose: Generate months of a calendar
// Author: Ashwin Nath Chatterji
// Date: 14-02-2016
import java.util.Scanner;
public class DisplayCalendars {
public class Calendar {
// sunday is 0, wed is 3 and sun is 6; i.e 0-6
private int startDay;
private int year;
public Calendar(int startDay, int year) {
this.startDay = startDay;
this.year = year;
}
private boolean isLeapYear() {
return ((this.year % 4 == 0) && (this.year % 100 != 0) || (this.year % 400 == 0));
}
private int getDaysInMonth(int month) {
switch (month) {
case (1) : return 31;
case (2) : return isLeapYear() ? 29 : 28;
case (3) : return 31;
case (4) : return 30;
case (5) : return 31;
case (6) : return 30;
case (7) : return 31;
case (8) : return 31;
case (9) : return 30;
case (10) : return 31;
case (11) : return 30;
case (12) : return 31;
default: return -1;
}
}
private String getMonthName(int month) {
String monthName;
switch (month) {
case (1) : monthName = "January"; break;
case (2) : monthName = "February"; break;
case (3) : monthName = "March"; break;
case (4) : monthName = "April"; break;
case (5) : monthName = "May"; break;
case (6) : monthName = "June"; break;
case (7) : monthName = "July"; break;
case (8) : monthName = "August"; break;
case (9) : monthName = "September"; break;
case (10) : monthName = "October"; break;
case (11) : monthName = "November"; break;
case (12) : monthName = "December"; break;
default: monthName = "Error"; break;
}
return monthName;
}
private void printCalendarHeader(int month) {
String monthName = getMonthName(month);
System.out.println(" " + monthName + " " + this.year);
System.out.println("-----------------------------");
System.out.println(" Sun Mon Tue Wed Thu Fri Sat");
}
private void generateMonth(int month) {
// do something
int count = 1;
int daysInLine = 0;
// skip initial days first
for (; daysInLine != this.startDay; ++daysInLine) {
System.out.print(" ");
}
// print the numbers on the calendar
int numberOfDays = getDaysInMonth(month);
for (; count <= numberOfDays; ++count, ++daysInLine, ++(this.startDay)) {
System.out.print(String.format("%4d", count));
if (daysInLine == 6) {
System.out.println();
daysInLine = -1;
}
if (this.startDay == 6)
this.startDay = -1;
}
}
public void generateCalendar() {
for (int i = 1; i != 13; ++i) {
printCalendarHeader(i);
generateMonth(i);
System.out.println();
System.out.println();
}
}
}
public static void main (String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.print("Enter a year: ");
int year = scanner.nextInt();
System.out.print("Enter the first day of the year (0-6): ");
int startDay = scanner.nextInt();
DisplayCalendars meh = new DisplayCalendars();
Calendar mehmeh = meh.new Calendar(startDay, year);
mehmeh.generateCalendar();
}
}
| [
"ashwinath@hotmail.com"
] | ashwinath@hotmail.com |
5bc268c5132900e83e839bcf7e2218be87c6221a | 5a555ceb202f0b96191b539099de0b80315268bb | /app/build/generated/source/buildConfig/androidTest/debug/com/virupawadegmail/sdhmancharpune/test/BuildConfig.java | 321ba565eb7fd64118e1963a3811cc9c8243378f | [] | no_license | amitiwary999/Blogerlove | 60eea9872d92bf136ad78bc17c4e43f9450bd1c9 | c06e4fc93d6bb66a9de20b1953c9622bcbd05936 | refs/heads/master | 2021-06-09T03:49:25.555075 | 2016-12-08T20:59:58 | 2016-12-08T20:59:58 | 68,702,485 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 485 | java | /**
* Automatically generated file. DO NOT MODIFY
*/
package com.virupawadegmail.sdhmancharpune.test;
public final class BuildConfig {
public static final boolean DEBUG = Boolean.parseBoolean("true");
public static final String APPLICATION_ID = "com.virupawadegmail.sdhmancharpune.test";
public static final String BUILD_TYPE = "debug";
public static final String FLAVOR = "";
public static final int VERSION_CODE = 1;
public static final String VERSION_NAME = "1.0";
}
| [
"tiwarya9@gmail.com"
] | tiwarya9@gmail.com |
9c3eede81de50356ec51bb377ff47eb124e99f68 | 377405a1eafa3aa5252c48527158a69ee177752f | /src/com/paypal/android/sdk/payments/aD.java | 261d0f8a2e9958f2c5067dc37cf2ddd026c62f72 | [] | no_license | apptology/AltFuelFinder | 39c15448857b6472ee72c607649ae4de949beb0a | 5851be78af47d1d6fcf07f9a4ad7f9a5c4675197 | refs/heads/master | 2016-08-12T04:00:46.440301 | 2015-10-25T18:25:16 | 2015-10-25T18:25:16 | 44,921,258 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 878 | java | // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/kpdus/jad.html
// Decompiler options: braces fieldsfirst space lnc
package com.paypal.android.sdk.payments;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
// Referenced classes of package com.paypal.android.sdk.payments:
// PayPalService
final class aD extends BroadcastReceiver
{
private PayPalService a;
aD(PayPalService paypalservice)
{
a = paypalservice;
super();
}
public final void onReceive(Context context, Intent intent)
{
if (intent.getAction().equals("com.paypal.android.sdk.clearAllUserData"))
{
a.g();
Log.w("paypal.sdk", "active service user data cleared");
}
}
}
| [
"rich.foreman@apptology.com"
] | rich.foreman@apptology.com |
726b4dd709e3273b2bff83e3ab2cee3a3b399891 | 35491da5c302de8e38a2cd79dd89d44f5787c8e2 | /src/cn/rain/Exceptions/UserExistedException.java | 38206e79c947b9e95e10a25acb6e91da8e4146b1 | [] | no_license | YangBingxi/Java-StudentCourse-Manage_Server | 9ba905a18f05484561ae7f17445dd1f3fd3f5ef3 | 13b0e5c25c13730ad6f9872bb69984eacaeb6751 | refs/heads/master | 2022-01-08T03:17:30.348915 | 2019-06-01T13:58:46 | 2019-06-01T13:58:46 | null | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 886 | java | package cn.rain.Exceptions;
/**
* 用户已存在时抛出此异常
*
* @author SwYoung
* @version V1.0
* @since 2019-4-29
*/
public class UserExistedException extends Exception {
private static final long serialVersionUID = 2958039873765717022L;
public UserExistedException() {
super();
// TODO Auto-generated constructor stub
}
public UserExistedException(String message, Throwable cause, boolean enableSuppression,
boolean writableStackTrace) {
super();
// TODO Auto-generated constructor stub
}
public UserExistedException(String message, Throwable cause) {
super(message, cause);
// TODO Auto-generated constructor stub
}
public UserExistedException(String message) {
super(message);
// TODO Auto-generated constructor stub
}
public UserExistedException(Throwable cause) {
super(cause);
// TODO Auto-generated constructor stub
}
}
| [
"798640762@qq.com"
] | 798640762@qq.com |
27eb18cf9df464475e33b2f7df73417113ee97a2 | 7269fd6a4cb9355a33b6510eb35c3e3d3326201c | /product-service/src/main/java/com/labs/entities/enums/OrderStatus.java | b07b9ba6ad28c361b078075b3f15585cba101feb | [] | no_license | medmedCH/Bubble-store-back-end | 484a70ab55c92778ba45464159bfed1d98a00e58 | 4de4f8d303e6724d5b908a306485fd815fc2024e | refs/heads/main | 2023-06-07T16:43:33.331238 | 2021-06-18T09:28:27 | 2021-06-18T09:28:27 | 341,688,027 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 89 | java | package com.labs.entities.enums;
public enum OrderStatus {
CREATION, CLOSED,PAID
} | [
"mohamed.chabbouh@esprit.tn"
] | mohamed.chabbouh@esprit.tn |
5f837d54bd8fb2980331431ef8bf0d40dc90ecb5 | 63d319fbd88e49701d8dcc2919c8f3a6013e90d0 | /CoCoNut/org.reuseware.coconut.fragment.edit/src/org/reuseware/coconut/fragment/provider/ComposedFragmentItemProvider.java | c005d3bf1642854d10a0448af01fa3475d10aa53 | [] | no_license | DevBoost/Reuseware | 2e6b3626c0d434bb435fcf688e3a3c570714d980 | 4c2f0170df52f110c77ee8cffd2705af69b66506 | refs/heads/master | 2021-01-19T21:28:13.184309 | 2019-06-09T20:39:41 | 2019-06-09T20:48:34 | 5,324,741 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 4,477 | java | /*******************************************************************************
* Copyright (c) 2006-2012
* Software Technology Group, Dresden University of Technology
* DevBoost GmbH, Berlin, Amtsgericht Charlottenburg, HRB 140026
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Software Technology Group - TU Dresden, Germany;
* DevBoost GmbH - Berlin, Germany
* - initial API and implementation
******************************************************************************/
/**
* <copyright>
* </copyright>
*
* $Id$
*/
package org.reuseware.coconut.fragment.provider;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.edit.provider.ComposedImage;
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
import org.eclipse.emf.edit.provider.IItemLabelProvider;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.IItemPropertySource;
import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
import org.eclipse.ui.PlatformUI;
import org.reuseware.coconut.fragment.Fragment;
/**
* This is the item provider adapter for a {@link org.reuseware.coconut.fragment.ComposedFragment} object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public class ComposedFragmentItemProvider
extends FragmentItemProvider
implements
IEditingDomainItemProvider,
IStructuredItemContentProvider,
ITreeItemContentProvider,
IItemLabelProvider,
IItemPropertySource {
/**
* This constructs an instance from a factory and a notifier.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ComposedFragmentItemProvider(AdapterFactory adapterFactory) {
super(adapterFactory);
}
/**
* This returns the property descriptors for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
if (itemPropertyDescriptors == null) {
super.getPropertyDescriptors(object);
}
return itemPropertyDescriptors;
}
/**
* This returns ComposedFragment.gif.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated NOT
*/
@Override
public Object getImage(Object object) {
Fragment fragment = (Fragment) object;
List<String> ufi = fragment.getUFI();
if (ufi.isEmpty()) {
return overlayImage(object,
getResourceLocator().getImage("full/obj16/FragmentDiagramFile"));
}
String fileName = ufi.get(ufi.size()-1);
List<Object> images = new ArrayList<Object>(2);
// XXX the PlatformUI dependency could be set to optional and only used
// when available
images.add(PlatformUI.getWorkbench().getEditorRegistry()
.getImageDescriptor(fileName));
images.add(getResourceLocator().getImage("full/obj16/OverlayComposed"));
return new ComposedImage(images);
}
/**
* This returns the label text for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated NOT
*/
@Override
public String getText(Object object) {
return super.getText(object);
}
/**
* This handles model notifications by calling {@link #updateChildren} to update any cached
* children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void notifyChanged(Notification notification) {
updateChildren(notification);
super.notifyChanged(notification);
}
/**
* This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
* that can be created under this object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
super.collectNewChildDescriptors(newChildDescriptors, object);
}
}
| [
"jendrik.johannes@devboost.de"
] | jendrik.johannes@devboost.de |
b15ea9398ec8def2efcfc196d4405de8f827f081 | 7b2310271ae64060cf1f1460c79990a09b95ca59 | /src/main/java/queue/LinkedQueue.java | 7733893c2edd934e1c1756b781795e7fb64b62c4 | [] | no_license | balajivenki/algo | 924045d21d41099a44239a2e2712c8c17f129e36 | d89a37aeeb2f4352273ad0d4fa3e5ca1389f3c03 | refs/heads/master | 2021-01-01T16:45:56.011704 | 2017-08-03T13:00:06 | 2017-08-03T13:00:06 | 97,911,978 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,175 | java | package queue;
/**
* Created by bvenkatesan on 7/16/17.
*/
public class LinkedQueue {
public static class QNode {
int data;
QNode next;
QNode(int data) {
this.data = data;
next = null;
}
}
public QNode front, rear;
public void enqueue(int data) {
QNode qNode = new QNode(data);
if(rear == null) {
this.front = this.rear = qNode;
return;
} else {
this.rear.next = qNode;
this.rear = qNode;
}
}
public int dequeue() {
if(this.front == null) {
return Integer.MIN_VALUE;
}
int item = this.front.data;
this.front = this.front.next;
if(this.front == null) {
this.rear = null;
}
System.out.println("Dequeued item is "+ item);
return item;
}
public static void main(String[] args) {
LinkedQueue q=new LinkedQueue();
q.enqueue(10);
q.enqueue(20);
q.dequeue();
q.dequeue();
q.enqueue(30);
q.enqueue(40);
q.enqueue(50);
q.dequeue();
}
}
| [
"venkatesan.balaji@gmail.com"
] | venkatesan.balaji@gmail.com |
42807a20cac64dd1d28280442160dce521a6a064 | 0422cecf7ca43765afaaeaacc012fc13f70db88f | /spring-40-security/spring-02-security-customize/src/main/java/tian/pusen/handler/CustomAccessDeniedHandler.java | a8527b5dfd96ed2c548546cb9e77e7c36cee1b45 | [
"MIT"
] | permissive | pustian/learn-spring-boot | bf4982782942073bb4cff2b3f855f247f012dd63 | 9fe44b486d4f4d155e65147a4daface52e76d32d | refs/heads/master | 2021-04-16T04:25:09.211648 | 2020-06-10T15:16:35 | 2020-06-10T15:16:35 | 249,327,629 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,409 | java | package tian.pusen.handler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.security.access.AccessDeniedException;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.web.access.AccessDeniedHandler;
import org.springframework.stereotype.Component;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
/**
*
* @author: BaoZhou
* @date : 2018/6/25 19:27
*/
@Component
public class CustomAccessDeniedHandler implements AccessDeniedHandler {
private static Logger logger = LoggerFactory.getLogger(CustomAccessDeniedHandler.class);
@Override
public void handle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, AccessDeniedException e) throws IOException, ServletException {
Authentication auth
= SecurityContextHolder.getContext().getAuthentication();
if (auth != null) {
logger.info("User '" + auth.getName()
+ "' attempted to access the protected URL: "
+ httpServletRequest.getRequestURI());
}
httpServletResponse.sendRedirect(httpServletRequest.getContextPath() + "/403");
}
}
| [
"pustian@msn.com"
] | pustian@msn.com |
9a105b6b300cb60f4cc7e90202d264e89bef3940 | d537d9e6e7768f72a6bdf6325c23a82c936b5ed6 | /src/main/java/pl/paweln/agricola/action/Build1BarnOrBakeBreadAction.java | 71aef349c07793d7e1c8ff179c81c7a769098a5c | [] | no_license | paweln1975/Agricola | 1a1608583925f100fffb71ae60f03a543fc9737b | b06be24cf1d8e66ed9818a99294b8c5d8a785d80 | refs/heads/master | 2023-02-21T19:24:34.557599 | 2021-01-24T15:23:31 | 2021-01-24T15:23:31 | 323,131,677 | 0 | 0 | null | 2021-01-24T15:23:33 | 2020-12-20T17:52:28 | Java | UTF-8 | Java | false | false | 260 | java | package pl.paweln.agricola.action;
public class Build1BarnOrBakeBreadAction extends SpecificAction {
public Build1BarnOrBakeBreadAction() {
super(ActionType.BUILD_1_BARN_OR_BAKE_BREAD);
super.setName("Build 1 Barn or Bake Bread");
}
}
| [
"pawel.niedziela@gmail.com"
] | pawel.niedziela@gmail.com |
c8a10bbfc3bf8cefbefa6a390822de29fee55d5c | 1153de40cf48076779039f1b29df45067b72397d | /nettosphere-samples/games/src/main/java/org/nettosphere/samples/games/NettoSphereGamesServer.java | 443039e52169f4be5a8f8ff56f27c496b125ff13 | [
"Apache-2.0"
] | permissive | seamusmac/atmosphere-samples | 9b90a648cf148a8b3c59d9da7f8efd3535c16c3f | 5faf36a6b98d90598b9289fe6b2c5313ab977bb5 | refs/heads/master | 2021-01-14T10:53:09.766108 | 2016-02-18T20:26:08 | 2016-02-18T20:26:08 | 24,748,345 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,134 | java | /*
* Copyright 2014 Jeanfrancois Arcand
*
* 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.nettosphere.samples.games;
import org.atmosphere.cpr.ApplicationConfig;
import org.atmosphere.nettosphere.Config;
import org.atmosphere.nettosphere.Nettosphere;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
/**
* A bootstrap class that start Nettosphere and Snake!.
*/
public class NettoSphereGamesServer {
private static final Logger logger = LoggerFactory.getLogger(Nettosphere.class);
public static void main(String[] args) throws IOException {
Config.Builder b = new Config.Builder();
b.resource(SnakeManagedService.class)
// For *-distrubution
.resource("./webapps")
// For mvn exec:java
.resource("./src/main/resources")
// For running inside an IDE
.resource("./nettosphere-samples/games/src/main/resources")
.initParam(ApplicationConfig.PROPERTY_SESSION_SUPPORT, "true")
.port(8080).host("127.0.0.1").build();
Nettosphere s = new Nettosphere.Builder().config(b.build()).build();
s.start();
String a = "";
logger.info("NettoSphere Games Server started on port {}", 8080);
logger.info("Type quit to stop the server");
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
while (!(a.equals("quit"))) {
a = br.readLine();
}
System.exit(-1);
}
}
| [
"jfarcand@apache.org"
] | jfarcand@apache.org |
d9e05a7cd157fbd201bd7bc86a222e30c92dc514 | a2cdbc692c05a073ba83c1b6368965fab0d90ccb | /src/main/java/com/mongodb/hvdf/allocators/SliceDetails.java | e099044007d678dd7cfe283d5d5a481024b07945 | [
"Apache-2.0"
] | permissive | mridul-sahu/hvdf | 4f378813789db604b9f12716d81294e6aeea7b70 | b2480b5602e3bf4fae7de7867bf4e5e58f92f329 | refs/heads/master | 2020-04-18T06:34:12.657975 | 2014-11-25T19:12:44 | 2014-11-25T19:12:44 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 632 | java | package com.mongodb.hvdf.allocators;
import java.util.Comparator;
public class SliceDetails {
public String name;
public long minTime;
public long maxTime;
public SliceDetails(String name, long minTime, long maxTime) {
this.name = name;
this.maxTime = maxTime;
this.minTime = minTime;
}
public static class Comparators {
public static Comparator<SliceDetails> MIN_TIME_DESCENDING = new Comparator<SliceDetails>() {
@Override
public int compare(SliceDetails o1, SliceDetails o2) {
return Long.compare(o2.minTime, o1.minTime);
}
};
}
}
| [
"darren.wood@10gen.com"
] | darren.wood@10gen.com |
b2b84678f4d4a85dbbafd3428ea5c676565fd000 | 648d6ed9897b49755cb6791f6a843f7835998f5f | /src/leetcode/pro123/Solution2.java | 953917a4233f234b5078053299723788a308a3c3 | [] | no_license | 12Dong/leetCode | 06c4016b074c746b7ed88b67c45f3e169d58f27e | 71dbcab669a5c81adc52a0c2fd47b6f823bfd518 | refs/heads/master | 2023-07-18T01:12:07.677778 | 2023-06-26T15:57:34 | 2023-06-26T15:57:34 | 127,150,489 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 53 | java | package leetcode.pro123;
public class Solution2 {
}
| [
"289663639@qq.com"
] | 289663639@qq.com |
c4cb4c3253df8464b77eadb5e2105903bc7c8ff4 | c49a7251aaaf759e5a60e2114f283fbe59ac17cf | /threads/src/Habitant.java | 2d1a6187ebb295ac47f2b964dc7d45dc73cb7d19 | [] | no_license | laurentkeil/work | 4d64d63751f0308f3c28abb69a31240015c5b36d | 763092b8dd385f7debb14900dda0fcf518c0abbe | refs/heads/master | 2021-05-01T05:17:17.471722 | 2017-01-22T17:57:17 | 2017-01-22T17:57:17 | 79,734,666 | 0 | 0 | null | null | null | null | ISO-8859-1 | Java | false | false | 668 | java |
public class Habitant implements Runnable {
// construction de notre unique chaudiere
final Chaudiere chaudiere = new Chaudiere() ;
public void run() {
// chaque habitant possède son propre thermostat
Thermostat thermostat = new Thermostat(chaudiere) ;
int nTry = 0 ;
do {
// il demande a monter la temperature
thermostat.plusChaud() ;
nTry++ ;
// on lui donne le droit de le faire 5 fois
} while (nTry < 5) ;
}
public int getTemperature() {
return this.chaudiere.getTemperature() ;
}
}
| [
"laurent_0306@hotmail.com"
] | laurent_0306@hotmail.com |
6dc78a527ab6677dbcc7713f7decf8bbaca8bcf0 | ca896234acd4afd79d7f7fbe92058774570c1671 | /01.project_as_tool/myTool/src/testObject/ClsMaker.java | 3f615ca9197e9a3d2123baa01ac0713050264fb5 | [] | no_license | lotuswlz/wlz-project | a315a923fa64950a338df74a7a22c8ccb2a6ac19 | 33c5c2453eddc9f8bf254bb18733cc0d785e1fd1 | refs/heads/master | 2021-03-12T21:58:23.089919 | 2011-08-03T11:37:10 | 2011-08-03T11:37:10 | 37,233,555 | 0 | 0 | null | null | null | null | EUC-JP | Java | false | false | 497 | java | /*
* All Rights Reserved. Copyright(C) 2008 OfferMe.com.au, Australia
*
* History
* Version Update Date Updater Details
* 1.0.00 2009-11-27 Cathy Wu Create
*/
package testObject;
public abstract class ClsMaker<T> {
private T data;
public ClsMaker() {
}
public T getData() {
return data;
}
public void setData(T data) {
this.data = data;
}
}
| [
"cathywu1983@7a8edffc-7ee6-fc29-a90d-33c668f46aec"
] | cathywu1983@7a8edffc-7ee6-fc29-a90d-33c668f46aec |
53b8371b961a29bf4876bc895abe65a9721a1657 | 2760ddb02280f03048c89efc1df20a8c85946be3 | /src/estruturadecisao/NotaAluno.java | 08c414a17081ce77900cdb8bd81d338debec0c0d | [] | no_license | andreldsr/fixacao01 | a53bdb3c99f863b89d652fdfac0e1c1d41bccef0 | d55ba37af179e33eae1ba04ceb5aa171b9f0cb49 | refs/heads/master | 2023-06-05T03:56:31.841198 | 2021-06-29T23:53:49 | 2021-06-29T23:53:49 | 381,525,464 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 616 | java | package estruturadecisao;
import java.util.Scanner;
public class NotaAluno {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.println("Digite a primeira nota: ");
Double nota1 = in.nextDouble();
System.out.println("Digite a segunda nota: ");
Double nota2 = in.nextDouble();
double media = (nota1 + nota2)/2;
if(media >= 7){
System.out.println("O aluno foi aprovado. Nota final: " + media);
}else {
System.out.println("O aluno foi reprovado. Nota final: " + media);
}
}
}
| [
"andre.silva@saude.ce.gov.br"
] | andre.silva@saude.ce.gov.br |
188ec7ee84307e0338c2ba4b57d95ae3648c1eea | 1a51f14e3356da0784cafa3da9812fd0ad186a52 | /src/com/stock/userInfomation/ChangeEquipAction.java | 1d0335dfd0afd5b2b7dc5973778c61f83bc05ff4 | [] | no_license | heavendarren/tfkj_stock | 5c25851ca3360a4c800f4cbc5639e8313d392c19 | 5ad5640293160ee40107887a53d6260a4c15f3d5 | refs/heads/master | 2020-11-29T14:44:07.613103 | 2017-04-07T02:29:52 | 2017-04-07T02:29:52 | 87,493,214 | 0 | 1 | null | null | null | null | WINDOWS-1252 | Java | false | false | 1,636 | java | package com.stock.userInfomation;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import com.hrbank.business.frame.BusinessPaginationAction;
import com.takucin.aceeci.frame.sql.DataRow;
import com.takucin.aceeci.frame.sql.DataSet;
public class ChangeEquipAction extends BusinessPaginationAction{
private ChangeEquipService service = new ChangeEquipService();
public ActionForward init(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
ChangeEquipForm f = (ChangeEquipForm) form;
if(request.getParameter("equtype").equals("1")){
f.setType("ONU");
}else {
f.setType("»ú¶¥ºÐ");
}
return firstPage(mapping, form, request, response);
}
public ActionForward query(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
ChangeEquipForm f = (ChangeEquipForm) form;
f.setHidden();
return firstPage(mapping, form, request, response);
}
public ActionForward getActionForward(ActionMapping mapping) {
return mapping.findForward(FW_INIT);
}
public DataSet<DataRow> getResult(ActionForm form, int first, int rows)
throws Exception {
ChangeEquipForm f = (ChangeEquipForm) form;
return service.getResult((ChangeEquipForm) form, first, rows);
}
public int getResultCount(ActionForm form) throws Exception {
return service.getResultCount((ChangeEquipForm) form);
}
}
| [
"heavendarren@126.com"
] | heavendarren@126.com |
eeb450c0048b756ede386f99afa4aa7e76bb2894 | e8ee8a6095e94803be76419fa5ffa6147300c76a | /caffeine/src/test/java/com/github/benmanes/caffeine/cache/testing/CacheValidationListener.java | 8d8eb3cf21ac88386acbf697d9d47a0cc1c3f309 | [
"Apache-2.0"
] | permissive | misselvexu/caffeine | 3a35883fc1de8578560d2109bf1120af44b3f10c | 24da0f842fffe9d6854832a1490264fcf531ca0f | refs/heads/master | 2022-11-25T14:17:05.683492 | 2022-11-09T07:03:43 | 2022-11-09T07:03:43 | 198,823,831 | 0 | 0 | Apache-2.0 | 2019-07-25T12:05:26 | 2019-07-25T12:05:25 | null | UTF-8 | Java | false | false | 12,567 | java | /*
* Copyright 2014 Ben Manes. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.github.benmanes.caffeine.cache.testing;
import static com.github.benmanes.caffeine.cache.testing.AsyncCacheSubject.assertThat;
import static com.github.benmanes.caffeine.cache.testing.CacheContextSubject.assertThat;
import static com.github.benmanes.caffeine.cache.testing.CacheSubject.assertThat;
import static com.github.benmanes.caffeine.testing.Awaits.await;
import static com.google.common.collect.ImmutableList.toImmutableList;
import static com.google.common.truth.Truth.assertThat;
import static com.google.common.truth.Truth.assertWithMessage;
import static org.testng.ITestResult.FAILURE;
import static uk.org.lidalia.slf4jext.ConventionalLevelHierarchy.TRACE_LEVELS;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.atomic.AtomicBoolean;
import org.apache.commons.lang3.StringUtils;
import org.joor.Reflect;
import org.mockito.Mockito;
import org.testng.Assert;
import org.testng.IInvokedMethod;
import org.testng.IInvokedMethodListener;
import org.testng.ISuite;
import org.testng.ISuiteListener;
import org.testng.ITestContext;
import org.testng.ITestResult;
import org.testng.SuiteRunner;
import org.testng.TestListenerAdapter;
import org.testng.TestRunner;
import org.testng.internal.TestResult;
import com.github.benmanes.caffeine.cache.AsyncCache;
import com.github.benmanes.caffeine.cache.Cache;
import com.github.benmanes.caffeine.cache.Caffeine;
import com.github.benmanes.caffeine.cache.Policy.Eviction;
import com.github.benmanes.caffeine.cache.Policy.FixedExpiration;
import com.github.benmanes.caffeine.cache.Policy.VarExpiration;
import com.github.benmanes.caffeine.cache.Reset;
import com.github.benmanes.caffeine.cache.testing.CacheSpec.CacheExecutor;
import com.github.benmanes.caffeine.cache.testing.CacheSpec.CacheExpiry;
import com.github.benmanes.caffeine.cache.testing.CacheSpec.CacheScheduler;
import com.github.benmanes.caffeine.cache.testing.CacheSpec.ExecutorFailure;
import com.github.valfirst.slf4jtest.TestLoggerFactory;
/**
* A listener that validates the internal structure after a successful test execution.
*
* @author ben.manes@gmail.com (Ben Manes)
*/
public final class CacheValidationListener implements ISuiteListener, IInvokedMethodListener {
private static final Cache<Object, String> simpleNames = Caffeine.newBuilder().build();
private static final ITestContext testngContext = Mockito.mock(ITestContext.class);
private static final AtomicBoolean detailedParams = new AtomicBoolean(false);
private static final Object[] EMPTY_PARAMS = {};
private final List<Collection<?>> resultQueues = new CopyOnWriteArrayList<>();
private final AtomicBoolean beforeCleanup = new AtomicBoolean();
@Override
public void onStart(ISuite suite) {
if (suite instanceof SuiteRunner) {
var invokedMethods = Reflect.on(suite).fields().get("invokedMethods");
if ((invokedMethods != null) && (invokedMethods.get() instanceof Collection)) {
resultQueues.add(invokedMethods.get());
}
}
}
@Override
public void beforeInvocation(IInvokedMethod method, ITestResult testResult) {
TestLoggerFactory.getAllTestLoggers().values().stream()
.forEach(logger -> logger.setEnabledLevels(TRACE_LEVELS));
TestLoggerFactory.clear();
if (beforeCleanup.get() || !beforeCleanup.compareAndSet(false, true)) {
return;
}
// Remove unused listener that retains all test results
// https://github.com/cbeust/testng/issues/2096#issuecomment-706643074
if (testResult.getTestContext() instanceof TestRunner) {
var runner = (TestRunner) testResult.getTestContext();
runner.getTestListeners().stream()
.filter(listener -> listener.getClass() == TestListenerAdapter.class)
.flatMap(listener -> Reflect.on(listener).fields().values().stream())
.filter(field -> field.get() instanceof Collection)
.forEach(field -> resultQueues.add(field.get()));
resultQueues.add(runner.getFailedButWithinSuccessPercentageTests().getAllResults());
resultQueues.add(runner.getSkippedTests().getAllResults());
resultQueues.add(runner.getPassedTests().getAllResults());
resultQueues.add(runner.getFailedTests().getAllResults());
var invokedMethods = Reflect.on(runner).fields().get("m_invokedMethods");
if ((invokedMethods != null) && (invokedMethods.get() instanceof Collection)) {
resultQueues.add(invokedMethods.get());
}
}
}
@Override
public void afterInvocation(IInvokedMethod method, ITestResult testResult) {
try {
if (testResult.isSuccess()) {
validate(testResult);
} else if (!detailedParams.get()) {
detailedParams.set(true);
}
} catch (Throwable caught) {
testResult.setStatus(FAILURE);
testResult.setThrowable(new AssertionError(getTestName(method), caught));
} finally {
cleanUp(testResult);
}
}
/** Validates the internal state of the cache. */
private void validate(ITestResult testResult) {
CacheContext context = Arrays.stream(testResult.getParameters())
.filter(param -> param instanceof CacheContext)
.map(param -> (CacheContext) param)
.findFirst().orElse(null);
if (context != null) {
awaitExecutor(context);
checkCache(context);
checkNoStats(testResult, context);
checkExecutor(testResult, context);
checkNoEvictions(testResult, context);
}
checkLogger(testResult);
}
/** Waits until the executor has completed all of the submitted work. */
private void awaitExecutor(CacheContext context) {
if (context.executor() != null) {
context.executor().resume();
if ((context.cacheExecutor != CacheExecutor.DIRECT)
&& (context.cacheExecutor != CacheExecutor.DISCARDING)
&& (context.executor().submitted() != context.executor().completed())) {
await().pollInSameThread().until(() ->
context.executor().submitted() == context.executor().completed());
}
}
}
/** Returns the name of the executed test. */
private static String getTestName(IInvokedMethod method) {
return StringUtils.substringAfterLast(method.getTestMethod().getTestClass().getName(), ".")
+ "#" + method.getTestMethod().getConstructorOrMethod().getName();
}
/** Checks whether the {@link TrackingExecutor} had unexpected failures. */
private static void checkExecutor(ITestResult testResult, CacheContext context) {
var testMethod = testResult.getMethod().getConstructorOrMethod().getMethod();
var cacheSpec = testMethod.getAnnotation(CacheSpec.class);
if ((cacheSpec == null) || (context.executor() == null)) {
return;
}
if (cacheSpec.executorFailure() == ExecutorFailure.EXPECTED) {
assertThat(context.executor().failed()).isGreaterThan(0);
} else if (cacheSpec.executorFailure() == ExecutorFailure.DISALLOWED) {
assertThat(context.executor().failed()).isEqualTo(0);
}
}
/** Checks that the cache is in an valid state. */
private void checkCache(CacheContext context) {
if (context.cache != null) {
assertThat(context.cache).isValid();
} else if (context.asyncCache != null) {
assertThat(context.asyncCache).isValid();
} else {
Assert.fail("Test requires that the CacheContext holds the cache under test");
}
}
/** Checks the statistics if {@link CheckNoStats} is found. */
private static void checkNoStats(ITestResult testResult, CacheContext context) {
var testMethod = testResult.getMethod().getConstructorOrMethod().getMethod();
boolean checkNoStats = testMethod.isAnnotationPresent(CheckNoStats.class)
|| testResult.getTestClass().getRealClass().isAnnotationPresent(CheckNoStats.class);
if (!checkNoStats) {
return;
}
assertThat(context).stats().hits(0).misses(0).success(0).failures(0);
}
/** Checks the statistics if {@link CheckNoEvictions} is found. */
private static void checkNoEvictions(ITestResult testResult, CacheContext context) {
var testMethod = testResult.getMethod().getConstructorOrMethod().getMethod();
boolean checkNoEvictions = testMethod.isAnnotationPresent(CheckNoEvictions.class)
|| testResult.getTestClass().getRealClass().isAnnotationPresent(CheckNoEvictions.class);
if (!checkNoEvictions) {
return;
}
assertThat(context).removalNotifications().hasNoEvictions();
assertThat(context).evictionNotifications().isEmpty();
}
/** Checks that no logs above the specified level were emitted. */
private static void checkLogger(ITestResult testResult) {
var testMethod = testResult.getMethod().getConstructorOrMethod().getMethod();
var checkMaxLogLevel = Optional.ofNullable(testMethod.getAnnotation(CheckMaxLogLevel.class))
.orElse(testResult.getTestClass().getRealClass().getAnnotation(CheckMaxLogLevel.class));
if (checkMaxLogLevel != null) {
var events = TestLoggerFactory.getLoggingEvents().stream()
.filter(event -> event.getLevel().ordinal() > checkMaxLogLevel.value().ordinal())
.collect(toImmutableList());
assertWithMessage("maxLevel=%s", checkMaxLogLevel.value()).that(events).isEmpty();
}
}
/** Free memory by clearing unused resources after test execution. */
private void cleanUp(ITestResult testResult) {
resultQueues.forEach(Collection::clear);
TestLoggerFactory.clear();
resetMocks(testResult);
resetCache(testResult);
boolean briefParams = !detailedParams.get();
if (testResult.isSuccess() && briefParams) {
clearTestResults(testResult);
}
stringifyParams(testResult, briefParams);
dedupTestName(testResult, briefParams);
CacheContext.interner().clear();
}
private void dedupTestName(ITestResult testResult, boolean briefParams) {
if ((testResult.getName() != null) && briefParams) {
testResult.setTestName(simpleNames.get(testResult.getName(), Object::toString));
}
}
@SuppressWarnings("unchecked")
private void resetMocks(ITestResult testResult) {
for (Object param : testResult.getParameters()) {
if (param instanceof CacheContext) {
var context = (CacheContext) param;
if (context.expiryType() == CacheExpiry.MOCKITO) {
Mockito.clearInvocations(context.expiry());
}
if (context.cacheScheduler == CacheScheduler.MOCKITO) {
Mockito.clearInvocations(context.scheduler());
}
}
}
}
private void resetCache(ITestResult testResult) {
for (Object param : testResult.getParameters()) {
if (param instanceof CacheContext) {
var context = (CacheContext) param;
if (context.isCaffeine()) {
Reset.destroy(context.cache());
}
}
}
}
private void clearTestResults(ITestResult testResult) {
var result = (TestResult) testResult;
result.setParameters(EMPTY_PARAMS);
result.setContext(testngContext);
}
private void stringifyParams(ITestResult testResult, boolean briefParams) {
Object[] params = testResult.getParameters();
for (int i = 0; i < params.length; i++) {
Object param = params[i];
if ((param instanceof AsyncCache<?, ?>) || (param instanceof Cache<?, ?>)
|| (param instanceof Map<?, ?>) || (param instanceof Eviction<?, ?>)
|| (param instanceof FixedExpiration<?, ?>) || (param instanceof VarExpiration<?, ?>)
|| ((param instanceof CacheContext) && briefParams)) {
params[i] = simpleNames.get(param.getClass(), key -> ((Class<?>) key).getSimpleName());
} else if (param instanceof CacheContext) {
params[i] = simpleNames.get(param.toString(), Object::toString);
} else {
params[i] = Objects.toString(param);
}
}
}
}
| [
"ben.manes@gmail.com"
] | ben.manes@gmail.com |
9a7b2390867a556f4fdbb9ef3188f97d3173a86a | 558807267252c629fb720e61c6420a952d408701 | /personWebService/src/main/java/org/personWebService/server/ws/rest/PwsRestLogicTrafficLog.java | e578782134256bc7446c30dc6bcc29245fc87069 | [] | no_license | mchyzer/personWebService | 8c4857b6e44b6da8b81cf0910c8d29972ed9abd2 | dc560577f87932d0a39db9e2c8574fe1d64fd7de | refs/heads/master | 2020-12-24T16:24:08.849430 | 2019-05-09T13:42:01 | 2019-05-09T13:42:01 | 20,572,298 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 914 | java | /**
* @author mchyzer
* $Id: TfRestLogicTrafficLog.java,v 1.1 2013/06/20 06:02:50 mchyzer Exp $
*/
package org.personWebService.server.ws.rest;
import java.util.Map;
import org.apache.commons.logging.Log;
import org.personWebService.server.util.PersonWsServerUtils;
/**
* logger to log the traffic of
*/
public class PwsRestLogicTrafficLog {
/** logger */
private static final Log LOG = PersonWsServerUtils.getLog(PwsRestLogicTrafficLog.class);
/**
* log something to the log file
* @param message
*/
public static void wsRestTrafficLog(String message) {
LOG.debug(message);
}
/**
* log something to the log file
* @param messageMap
*/
public static void wsRestTrafficLog(Map<String, Object> messageMap) {
if (LOG.isDebugEnabled()) {
LOG.debug(PersonWsServerUtils.mapToString(messageMap));
}
}
}
| [
"mchyzer@yahoo.com"
] | mchyzer@yahoo.com |
4e8742cd92bf05fd979c6de46c47a4426faec6b7 | e700ea2696fa70c88699ae12ffc4e68423d8af8d | /Farmaceutica/src/java/Models/Categoria.java | 88c27bbc8f6c919ca617c7ab41bbe1996cbb180c | [] | no_license | MaximilianoFarias1987/ProyectoJavaWeb | a79288c7c5f6d88462b8161e48a425d3fcc1b53f | b35eaa69e321868ef5a3deba719c9f5662ef709b | refs/heads/main | 2023-08-28T07:10:14.160999 | 2021-11-12T15:15:32 | 2021-11-12T15:15:32 | 426,604,775 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 820 | java | package Models;
public class Categoria {
private int idCategoria;
private String descripcion;
public Categoria() {
}
public Categoria(int idCategoria, String descripcion) {
this.idCategoria = idCategoria;
this.descripcion = descripcion;
}
public int getIdCategoria() {
return idCategoria;
}
public void setIdCategoria(int idCategoria) {
this.idCategoria = idCategoria;
}
public String getDescripcion() {
return descripcion;
}
public void setDescripcion(String descripcion) {
this.descripcion = descripcion;
}
@Override
public String toString() {
return "Categoria{" + "idCategoria=" + idCategoria + ", descripcion=" + descripcion + '}';
}
}
| [
"maximilianocba07@gmail.com"
] | maximilianocba07@gmail.com |
e9183eb416658372f87a950b6b8740379501c37c | 34ffaac3490fe8199a476712ed69c61740298a0e | /mplus/mplus-data/src/main/java/de/hydro/gv/mplus/data/ContractApproverId.java | 04bdc2297a557e1ea40444ef587027268cc48969 | [] | no_license | yevhen-miro/myrepo | e34bb3bab000e2cbc9b145c121e46b0907b5a7e5 | 7fb52a43ebff3f9ede3509ce5331defb57783441 | refs/heads/master | 2022-12-06T06:24:31.815644 | 2019-09-09T08:43:42 | 2019-09-09T08:43:42 | 31,064,078 | 0 | 0 | null | 2022-11-24T04:24:44 | 2015-02-20T12:32:28 | TSQL | UTF-8 | Java | false | false | 1,980 | java | package de.hydro.gv.mplus.data;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Embeddable;
public class ContractApproverId implements Serializable{
private static final long serialVersionUID = 1322156687657879113L;
private Long contractId;
private Integer signLevel;
private String approverId;
public ContractApproverId() {
}
public ContractApproverId(Long conId, Integer signLevel, String approverId ) {
this.contractId = conId;
this.signLevel = signLevel;
this.approverId = approverId;
}
public Long getConId() {
return contractId;
}
public void setConId(Long conId) {
this.contractId = conId;
}
public Integer getSignLevel() {
return signLevel;
}
public void setSignLevel(Integer signLevel) {
this.signLevel = signLevel;
}
public String getApproverId() {
return approverId;
}
public void setApproverId(String approverId) {
this.approverId = approverId;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((approverId == null) ? 0 : approverId.hashCode());
result = prime * result + ((contractId == null) ? 0 : contractId.hashCode());
result = prime * result + ((signLevel == null) ? 0 : signLevel.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
ContractApproverId other = (ContractApproverId) obj;
if (approverId == null) {
if (other.approverId != null)
return false;
} else if (!approverId.equals(other.approverId))
return false;
if (contractId == null) {
if (other.contractId != null)
return false;
} else if (!contractId.equals(other.contractId))
return false;
if (signLevel == null) {
if (other.signLevel != null)
return false;
} else if (!signLevel.equals(other.signLevel))
return false;
return true;
}
}
| [
"yevhen.miroshnychenko@hydro.com"
] | yevhen.miroshnychenko@hydro.com |
3aaefd5174a45ae6aab3ad2cf548bd8ef93f1675 | dec6bbc5db0759c4b04f50fe891977ba7f72b62c | /Programs/src/main/java/com/scriptbees/sample/SimpleCompoundInterest.java | 198f2e404796f9b2ed61c28509848274dd1c6a4f | [] | no_license | vamsi340/TestGet | a3964c205d3f14d4f689f860226d13260cb91379 | 09cdf36e3cffc2120aa4cad4a214e73ff50e8ebd | refs/heads/master | 2021-07-07T04:49:45.965117 | 2019-07-08T04:48:19 | 2019-07-08T04:48:19 | 192,918,278 | 0 | 0 | null | 2020-10-13T14:25:40 | 2019-06-20T12:44:06 | Java | UTF-8 | Java | false | false | 628 | java | package com.scriptbees.sample;
import java.util.Scanner;
public class SimpleCompoundInterest {
public static void main(String argu[]) {
double pr, rate, t, sim, com;
Scanner s = new Scanner(System.in);
System.out.println("Enter the amount:");
pr = s.nextDouble();
System.out.println("Enter the No.of years:");
t = s.nextDouble();
System.out.println("Enter the Rate of interest");
rate = s.nextDouble();
sim = (pr * t * rate) / 100;
com = pr * Math.pow(1.0 + rate / 100.0, t) - pr;
System.out.println("Simple Interest=" + sim);
System.out.println("Compound Interest=" + com);
}
}
| [
"vamsi.r@scriptbees.com"
] | vamsi.r@scriptbees.com |
7464807bf74c71e8cbb084121eafa3268bfbc902 | 6eb3c4a10a24970c424bd3877e553fbfea32fe41 | /profile-service/src/main/java/com/rentcarsplatform/profileservice/repository/CustomerRepository.java | 6aade772385a7b3c8b0f080b05bb617f98dcefb1 | [] | no_license | kpsdilshan/AJ-Rent-A-Car-Service | 7bb4c9c6c636dae504793193dd5c141294aaa849 | 0e27ba8ce817d57ff103806877c1da14b7bfd968 | refs/heads/master | 2022-12-06T17:17:35.615637 | 2020-08-01T11:18:15 | 2020-08-01T11:18:15 | 284,013,524 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 321 | java | package com.rentcarsplatform.profileservice.repository;
import com.rentcarsplatform.profileservice.model.Customer;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
@Repository
public interface CustomerRepository extends JpaRepository<Customer,Integer> {
}
| [
"kpsdilshan2@gmail.com"
] | kpsdilshan2@gmail.com |
ffd7c98baee5d3a658e4bee0bfe5e788b938b608 | dd8a642e5277919744ffb9bb7951e13084c44250 | /bundles/at.bestsolution.dart.server.api/src-gen/at/bestsolution/dart/server/api/model/NavigationRegion.java | f2c2e64cfe90838581882386e687c7e13093df61 | [] | no_license | tomsontom/dartedit | 7107ce2631d2c39eb0c4fc35db82576ebe456844 | 4bf2402692ef260db80631d4adbb772c83555604 | refs/heads/master | 2016-08-08T03:17:49.099642 | 2015-07-08T10:53:01 | 2015-07-08T10:53:01 | 38,748,516 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 711 | java | package at.bestsolution.dart.server.api.model;
import java.util.Map;
public class NavigationRegion {
private int offset ;
private int length ;
private int[] targets ;
public NavigationRegion() {
}
public int getOffset() {
return this.offset;
}
public void setOffset(int offset) {
this.offset = offset;
}
public int getLength() {
return this.length;
}
public void setLength(int length) {
this.length = length;
}
public int[] getTargets() {
return this.targets;
}
public void setTargets(int[] targets) {
this.targets = targets;
}
public String toString() {
return "NavigationRegion@"+hashCode()+"[offset = "+offset+", length = "+length+", targets = "+targets+"]";
}
}
| [
"tom.schindl@bestsolution.at"
] | tom.schindl@bestsolution.at |
fbf5ec219ad5b88f5d0fb8a5e97b93ac34fb63cb | 57c9af82c8ef038adbf13eb4986eca44ba9de4c1 | /app/src/main/java/com/example/microsoftengageapp2021/adapters/PendingUsersAdapter.java | 6079743bf3ab882249b5456a4db7ccd7d2b3e4f7 | [] | no_license | ayushr1912/Microsoft | 35f054a8717ab1a8c41ca64ee7a1c5a695b40142 | e4d6f515ace0d2b9782fe5184fd55864f118218d | refs/heads/master | 2023-06-15T04:03:34.936117 | 2021-07-13T08:39:37 | 2021-07-13T08:39:37 | 385,535,442 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,765 | java | package com.example.microsoftengageapp2021.adapters;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.recyclerview.widget.RecyclerView;
import com.example.microsoftengageapp2021.R;
import com.example.microsoftengageapp2021.models.User;
import com.example.microsoftengageapp2021.receivers.PendingUsersReceiver;
import org.jetbrains.annotations.NotNull;
import java.util.ArrayList;
import java.util.List;
public class PendingUsersAdapter extends RecyclerView.Adapter<PendingUsersAdapter.UserViewHolder>{
private final List<User> users;
private final PendingUsersReceiver pendingUsersReceiver;
private final List<User> selectedPendingUsers;
public PendingUsersAdapter(List<User> users, PendingUsersReceiver pendingUsersReceiver) {
this.users = users;
this.pendingUsersReceiver = pendingUsersReceiver;
selectedPendingUsers = new ArrayList<>();
}
public List<User> getSelectedPendingUsers(){
return selectedPendingUsers;
}
@NotNull
@Override
public UserViewHolder onCreateViewHolder(@NotNull ViewGroup parent, int viewType) {
return new UserViewHolder(
LayoutInflater.from(parent.getContext()).inflate(
R.layout.display_pending_user,
parent,
false
)
);
}
@Override
public void onBindViewHolder(@NonNull @NotNull PendingUsersAdapter.UserViewHolder holder, int position) {
holder.setUserData(users.get(position));
}
@Override
public int getItemCount() {
return users.size();
}
class UserViewHolder extends RecyclerView.ViewHolder{
TextView displayPendingUser;
ImageView sendInvite, selectedPendingUserImg, verifiedUser, unknownUser, sendRoomCode;
ConstraintLayout pendingUserContainer;
UserViewHolder(@NotNull View itemView) {
super(itemView);
displayPendingUser = itemView.findViewById(R.id.displayFullName);
sendInvite = itemView.findViewById(R.id.IC_addUser);
sendRoomCode = itemView.findViewById(R.id.IC_chat);
verifiedUser = itemView.findViewById(R.id.pendingVerifiedImg);
unknownUser = itemView.findViewById(R.id.pendingUnknownImg);
pendingUserContainer = itemView.findViewById(R.id.pendingUserContainer);
selectedPendingUserImg = itemView.findViewById(R.id.selectedPendingUserImg);
}
void setUserData(User user)
{
displayPendingUser.setText(String.format("%s",user.fullName));
if(user.email==null){
unknownUser.setVisibility(View.VISIBLE);
verifiedUser.setVisibility(View.INVISIBLE);
sendRoomCode.setVisibility(View.INVISIBLE);
} else{
unknownUser.setVisibility(View.INVISIBLE);
verifiedUser.setVisibility(View.VISIBLE);
}
sendInvite.setOnClickListener(v -> pendingUsersReceiver.sendInvitation(user));
sendRoomCode.setOnClickListener(v -> pendingUsersReceiver.sendRoomCode(user));
pendingUserContainer.setOnLongClickListener(v -> {
if(selectedPendingUserImg.getVisibility()!= View.VISIBLE){
selectedPendingUsers.add(user);
selectedPendingUserImg.setVisibility(View.VISIBLE);
sendInvite.setVisibility(View.GONE);
sendRoomCode.setVisibility(View.GONE);
if(verifiedUser.getVisibility()==View.VISIBLE){
verifiedUser.setVisibility(View.GONE);
}
if(unknownUser.getVisibility()==View.VISIBLE){
unknownUser.setVisibility(View.GONE);
}
pendingUsersReceiver.onMultiplePendingUsersAction(true);
}
return true;
});
pendingUserContainer.setOnClickListener(v -> {
if(selectedPendingUserImg.getVisibility()==View.VISIBLE) {
selectedPendingUsers.remove(user);
selectedPendingUserImg.setVisibility(View.GONE);
if(verifiedUser.getVisibility()==View.GONE){
verifiedUser.setVisibility(View.VISIBLE);
}
if(unknownUser.getVisibility()==View.GONE){
unknownUser.setVisibility(View.VISIBLE);
}
sendInvite.setVisibility(View.VISIBLE);
sendRoomCode.setVisibility(View.VISIBLE);
if (selectedPendingUsers.size() == 0) {
pendingUsersReceiver.onMultiplePendingUsersAction(false);
}
}else{
if(selectedPendingUsers.size()>0){
selectedPendingUsers.add(user);
selectedPendingUserImg.setVisibility(View.VISIBLE);
sendInvite.setVisibility(View.GONE);
sendRoomCode.setVisibility(View.GONE);
if(verifiedUser.getVisibility()==View.VISIBLE){
verifiedUser.setVisibility(View.GONE);
}
if(unknownUser.getVisibility()==View.VISIBLE){
unknownUser.setVisibility(View.GONE);
}
}
}
});
}
}
}
| [
"ayushr1900@gmail.com"
] | ayushr1900@gmail.com |
0fd3119a14fa7c05deca906c4abd82725792d2d2 | 4a2785fa22dbf1b8d7507bee2af22015c98ac73b | /Source code/keshe12/app/src/main/java/com/example/hp/materialtest/db/user_comment_deliver.java | ff475c67aeadae75f6b40976aca94813ead98b54 | [] | no_license | HWenTing/Take-out | 9607b93e5f1324e4cec99200441503d00a694c67 | 3b2c84a029d6446c31c0df723965b966e8515e81 | refs/heads/master | 2020-05-09T17:22:47.837614 | 2019-04-14T12:47:42 | 2019-04-14T12:47:42 | 181,305,007 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 648 | java | package com.example.hp.materialtest.db;
import org.litepal.crud.DataSupport;
/**
* Created by HP on 2018/9/3.
*/
public class user_comment_deliver extends DataSupport {
private int id;
private double score;
private String comment;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public double getScore() {
return score;
}
public void setScore(double score) {
this.score = score;
}
public String getComment() {
return comment;
}
public void setComment(String comment) {
this.comment = comment;
}
}
| [
"982740445@qq.com"
] | 982740445@qq.com |
430aeb1e3401e90fa0d64fe7f9ff735e4b7ba277 | a5e6f27020c23b5755d64d661e24eaef2ca2220f | /main.1/java/com/openbravo/pos/forms/Payments.java | 2e6de9cde0e76a7ae1f3aff177490e26f327060e | [] | no_license | AXE2005/SmartPos | 1681ad1133631ef13e170ca67020e02668d823b9 | 7f433b92ee458931093420d045ff996db3ef77bf | refs/heads/master | 2020-03-18T09:45:49.034449 | 2018-05-23T14:07:07 | 2018-05-23T14:07:07 | 134,579,231 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,145 | java | // uniCenta oPOS - Touch Friendly Point Of Sale
// Copyright (c) 2017 Alejandro Camargo
// https://unicenta.com
//
// This file is part of uniCenta oPOS
//
// uniCenta oPOS is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// uniCenta oPOS is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with uniCenta oPOS. If not, see <http://www.gnu.org/licenses/>.
package com.openbravo.pos.forms;
import java.util.HashMap;
/**
*
* @author Jack Gerrard
*/
public class Payments {
private Double amount;
private Double tendered;
private final HashMap paymentPaid;
private final HashMap paymentTendered;
private final HashMap rtnMessage;
private String name;
private final HashMap paymentVoucher;
/**
*
*/
public Payments() {
paymentPaid = new HashMap();
paymentTendered = new HashMap();
rtnMessage = new HashMap();
paymentVoucher = new HashMap();
}
/**
*
* @param pName
* @param pAmountPaid
* @param pTendered
* @param rtnMsg
*/
public void addPayment (String pName, Double pAmountPaid, Double pTendered, String rtnMsg){
if (paymentPaid.containsKey(pName)){
paymentPaid.put(pName,Double.parseDouble(paymentPaid.get(pName).toString()) + pAmountPaid);
paymentTendered.put(pName,Double.parseDouble(paymentTendered.get(pName).toString()) + pTendered);
rtnMessage.put(pName, rtnMsg);
}else {
paymentPaid.put(pName, pAmountPaid);
paymentTendered.put(pName,pTendered);
rtnMessage.put(pName, rtnMsg);
}
}
/**
*
* @param pName
* @param pAmountPaid
* @param pTendered
* @param rtnMsg
* @param pVoucher
*/
public void addPayment (String pName, Double pAmountPaid, Double pTendered, String rtnMsg, String pVoucher){
if (paymentPaid.containsKey(pName)){
paymentPaid.put(pName,Double.parseDouble(paymentPaid.get(pName).toString()) + pAmountPaid);
paymentTendered.put(pName,Double.parseDouble(paymentTendered.get(pName).toString()) + pTendered);
rtnMessage.put(pName, rtnMsg);
paymentVoucher.put(pName, pVoucher);
}else {
paymentPaid.put(pName, pAmountPaid);
paymentTendered.put(pName,pTendered);
rtnMessage.put(pName, rtnMsg);
paymentVoucher.put(pName, pVoucher);
}
}
/**
*
* @param pName
* @return
*/
public Double getTendered (String pName){
return(Double.parseDouble(paymentTendered.get(pName).toString()));
}
/**
*
* @param pName
* @return
*/
public Double getPaidAmount (String pName){
return(Double.parseDouble(paymentPaid.get(pName).toString()));
}
/**
*
* @return
*/
public Integer getSize(){
return (paymentPaid.size());
}
/**
*
* @param pName
* @return
*/
public String getRtnMessage(String pName){
return (rtnMessage.get(pName).toString());
}
public String getVoucher(String pName){
return (paymentVoucher.get(pName).toString());
}
public String getFirstElement(){
String rtnKey= paymentPaid.keySet().iterator().next().toString();
return(rtnKey);
}
/**
*
* @param pName
*/
public void removeFirst (String pName){
paymentPaid.remove(pName);
paymentTendered.remove(pName);
rtnMessage.remove(pName);
// paymentVoucher.remove(pName);
}
} | [
"josephcoelo@hotmail.com"
] | josephcoelo@hotmail.com |
dba8ea5ed315f0a938e2d3f666978509c112944b | 88dc4ee40e395ef0ce7f681590d2063bc3ea2aaa | /app/src/main/java/com/muliamaulana/denius/model/Sources.java | b428bb4f87593f42b334051c9763ac429aeb84b7 | [] | no_license | muliamaulana/Denius | c2588c7d5e9b90d4cd1c4cc80fca7258c44f7eb7 | 5c45c095018628d6ddb310b80f4b4ff18df27ce6 | refs/heads/master | 2020-03-27T13:12:09.580762 | 2018-08-30T16:30:01 | 2018-08-30T16:30:01 | 146,286,960 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 589 | java | package com.muliamaulana.denius.model;
import com.google.gson.annotations.SerializedName;
import java.util.List;
/**
* Created by muliamaulana on 8/19/2018.
*/
public class Sources {
@SerializedName("status")
public String status;
@SerializedName("sources")
public List<AllSources> sources = null;
public Sources(String status, List<AllSources> sources) {
this.status = status;
this.sources = sources;
}
public String getStatus() {
return status;
}
public List<AllSources> getSources() {
return sources;
}
}
| [
"m.muliamaulana@gmail.com"
] | m.muliamaulana@gmail.com |
6582abad8b70cc53cd63a073a34e071fa48b6e8d | 9591131978b71781509dd90521308a7f6b942fb0 | /app/src/main/java/com/vartista/www/vartista/fragments/NotificationsFragment.java | e18e29230e2364e6290fd4603213054a8b188bb9 | [] | no_license | zaptox/vartistaa | 5722fc4ab3a74037249fb89ee386c44e4f00ae5d | b7d7b1ee06fa7e3e2660f5b0ed91cbea65bbe30a | refs/heads/master | 2020-03-26T05:59:19.733172 | 2019-07-24T14:55:35 | 2019-07-24T14:55:35 | 144,584,210 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,696 | java | package com.vartista.www.vartista.fragments;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.vartista.www.vartista.R;
import com.vartista.www.vartista.adapters.TwoListInRecyclerView;
import com.vartista.www.vartista.beans.usernotificationitems;
import org.apache.http.HttpResponse;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
/**
* Created by Dell on 2019-04-18.
*/
public class NotificationsFragment extends Fragment {
RecyclerView view;
private RecyclerView.LayoutManager layoutManager;
private TwoListInRecyclerView listadapter;
ArrayList<usernotificationitems> requestlist;
ArrayList<usernotificationitems> notificationlist;
TabLayout tabLayout;
int user_id;
public NotificationsFragment() {
// Required empty public constructor
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View view1 =inflater.inflate(R.layout.activity_asynctask__multiple_url, container, false);
// become_sp=(Button)view.findViewById(R.id.become_sp);
view = (RecyclerView)view1.findViewById(R.id.user_notificationlist);
requestlist=new ArrayList<usernotificationitems>();
notificationlist=new ArrayList<usernotificationitems>();
layoutManager = new LinearLayoutManager(getContext());
view.setHasFixedSize(true);
view.setLayoutManager(layoutManager);
SharedPreferences ob = getActivity().getSharedPreferences("Login", Context.MODE_PRIVATE);
user_id = ob.getInt("user_id", 0);
new NotificationsFragment.Conncetion(getContext(),user_id).execute();
return view1;
}
class Conncetion extends AsyncTask<String,String ,String[]> {
private int user_customer_id;
private ProgressDialog dialog;
public Conncetion(Context activity, int user_customer_id) {
dialog = new ProgressDialog(activity);
this.user_customer_id = user_customer_id;
}
@Override
protected void onPreExecute() {
dialog.setMessage("Retriving data Please Wait..");
dialog.show();
}
@Override
protected String[] doInBackground(String... strings) {
final String BASE_URL = "http://vartista.com/vartista_app/usernotificationstatus.php?user_customer_id="+user_id;
final String BASE_URL2 = "http://vartista.com/vartista_app/fetch_notificationmsg.php?user_id="+user_id;
String[] ob = new String[2];
ob[0] = getjsonfromurl(BASE_URL);
ob[1] = getjsonfromurl(BASE_URL2);
return ob;
}
@Override
protected void onPostExecute(String[] result) {
if (dialog.isShowing()) {
dialog.dismiss();
}
try {
JSONObject jsonResult = new JSONObject(result[0]);
JSONObject jsonResult2 = new JSONObject(result[1]);
int success = jsonResult.getInt("success");
int success2 = jsonResult2.getInt("success");
if (success == 1) {
JSONArray services = jsonResult.getJSONArray("services");
for (int j = 0; j < services.length(); j++) {
JSONObject ser1 = services.getJSONObject(j);
String username = ser1.getString("username");
String image = ser1.getString("image");
String request_detail = ser1.getString("request_status");
String Time = ser1.getString("time");
String reqest_sendat = ser1.getString("reqeustsend_at") ;
String accepted_date = ser1.getString("accepted_date");
String rejected_date = ser1.getString("rejected_date");
String pay_verify_date = ser1.getString("pay_verify_date");
String Cancelled_date = ser1.getString("cancelled_date");
String completed_date = ser1.getString("completed_date");
String Canceled_by_id = ser1.getString("cancelled_by_id");
String Service_title = ser1.getString("service_title");
Double price = ser1.getDouble("price");
requestlist.add(new usernotificationitems(username,image,request_detail,Time,reqest_sendat,accepted_date,rejected_date,pay_verify_date,Cancelled_date,completed_date,Canceled_by_id,Service_title,price));
}
} else {
}
if(success2==1){
JSONArray services2 = jsonResult2.getJSONArray("services");
for ( int i = 0 ; i < services2.length(); i++){
JSONObject serv2 = services2.getJSONObject(i);
String notificationid = serv2.getString("id");
String username = serv2.getString("name");
String title = serv2.getString("title");
String msg = serv2.getString("msg");
String created_at = serv2.getString("created_at");
String sp_status = serv2.getString("sp_status");
notificationlist.add(new usernotificationitems(notificationid,username,title,msg,created_at,sp_status));
}
} else {
}
listadapter = new TwoListInRecyclerView(getContext(),requestlist,notificationlist);
view.setAdapter(listadapter);
} catch (JSONException e) {
e.printStackTrace();
}
}
}
public String getjsonfromurl(String BASE_URL){
String result = "";
try {
HttpClient client = new DefaultHttpClient();
HttpGet request = new HttpGet();
request.setURI(new URI(BASE_URL));
HttpResponse response = client.execute(request);
BufferedReader reader = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
StringBuffer stringBuffer = new StringBuffer();
String line = "";
while ((line = reader.readLine()) != null) {
stringBuffer.append(line);
break;
}
reader.close();
result = stringBuffer.toString();
} catch (URISyntaxException e) {
e.printStackTrace();
return new String("Exception is " + e.getMessage());
} catch (ClientProtocolException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return result;
}
}
| [
"mallahgq2252@gmail.com"
] | mallahgq2252@gmail.com |
7a743a082e2844a3883e2349657ce488318df118 | 6c82d44d378f0a0a870d76e129d7f9845d957317 | /app/src/main/java/com/android/sportclub/MainActivity.java | 6fc7e6fedac0f17b11557a80ff8ce7eb0281067a | [] | no_license | Rolar12/SportClub | 9576c460c944755271f72535cd6124fb01290dcb | 3bfba7fba74c26dd1c5031ea3c0f99f165cde352 | refs/heads/master | 2022-11-30T08:23:19.190430 | 2020-07-27T19:08:44 | 2020-07-27T19:08:44 | 282,991,552 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,991 | java | package com.android.sportclub;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.loader.app.LoaderManager;
import androidx.loader.content.CursorLoader;
import androidx.loader.content.Loader;
import android.content.ContentUris;
import android.content.Intent;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;
import com.android.sportclub.data.MemberCursorAdapter;
import com.android.sportclub.data.SportClubContract.MemberEntry;
import com.android.sportclub.data.SportClubDbHelper;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
public class MainActivity extends AppCompatActivity implements View.OnClickListener, LoaderManager.LoaderCallbacks<Cursor> {
ListView membersListView;
public static final int MEMBER_LOADER = 123;
MemberCursorAdapter memberCursorAdapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
membersListView = findViewById(R.id.memberListView);
FloatingActionButton addUserButton = findViewById(R.id.floatingActionButton);
addUserButton.setOnClickListener(this);
memberCursorAdapter = new MemberCursorAdapter(this, null, false);
membersListView.setAdapter(memberCursorAdapter);
membersListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Intent intent = new Intent(MainActivity.this, AddMemberActivity.class);
Uri currentMemberUri = ContentUris.withAppendedId(MemberEntry.CONTENT_URI, id);
intent.setData(currentMemberUri);
startActivity(intent);
}
});
getSupportLoaderManager().initLoader(MEMBER_LOADER, null, this);
}
@Override
public void onClick(View v) {
Intent intent = new Intent(MainActivity.this, AddMemberActivity.class);
startActivity(intent);
}
@NonNull
@Override
public Loader<Cursor> onCreateLoader(int i, @Nullable Bundle bundle) {
String [] projection = {MemberEntry._ID, MemberEntry.COLUMN_FIRST_NAME, MemberEntry.COLUMN_LAST_NAME, MemberEntry.COLUMN_SPORT};
CursorLoader cursorLoader = new CursorLoader(this, MemberEntry.CONTENT_URI, projection, null, null, null);
return cursorLoader;
}
@Override
public void onLoadFinished(@NonNull Loader<Cursor> loader, Cursor cursor) {
memberCursorAdapter.swapCursor(cursor);
}
@Override
public void onLoaderReset(@NonNull Loader<Cursor> loader) {
memberCursorAdapter.swapCursor(null);
}
}
| [
"orlovmaxims@gmail.com"
] | orlovmaxims@gmail.com |
ff057ad8d3ab0573b8142a1ad80eba1d72003c28 | ba41f386b8a2dee857cec6b43666977e5adbad34 | /src/main/java/_00_universalUtil/model/StorePic.java | 34c373d69f5d3dab8c41478ed7eec7f6aa5e982a | [] | no_license | eatogo/Web-Service-Recommendation | 7bcaf3ce119897448dc4faf2e6005b3ed00dbc19 | d7596edb5691d37a583c81b535291168ad083cf5 | refs/heads/master | 2021-09-11T21:13:21.056231 | 2018-04-12T14:03:37 | 2018-04-12T14:03:37 | 119,363,865 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 61 | java | package _00_universalUtil.model;
public class StorePic {
}
| [
"idontwannarock@gmail.com"
] | idontwannarock@gmail.com |
229e6eeefe05adcae649695bcc57afdc6de661eb | 9cb4c5e68a9873d74bd9d972be0f0310b8b7ec84 | /coleccionesI/src/teoria/listas/Lista1.java | 53f29973ae41f023d721cc5670f6b1f7f388cd1c | [] | no_license | programacionDAMVC/curso_2020_2021 | 386929260d64f6f9e00f40aec0ecef9d72e9fae6 | 2fada19efeda3c75bf753c05952edd9273a3cf85 | refs/heads/main | 2023-05-10T02:15:21.991906 | 2021-06-15T14:42:17 | 2021-06-15T14:42:17 | 355,239,758 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,126 | java | package teoria.listas;
import java.util.*;
public class Lista1 {
public static void main(String[] args) {
//no parametrizamos
ArrayList lista1 = new ArrayList(); //de objetos iguales, los guardo como Object
lista1.add("hola"); //objeto String
lista1.add('c'); //lo guarda como Character
lista1.add(2); //lo guarda como Integer
//vamos a ver los datos
System.out.println(lista1);
String dato1 = (String) lista1.get(0);
char dato2 = (char) lista1.get(1);
int dato3 = (int) lista1.get(2);
System.out.printf("Cadena %s, char %c y entero %d%n", dato1, dato2, dato3);
//mejora, parametrizando la listas, todos son de la misma clase, permite clases hijas de Object
List<String> listaCadenas = new ArrayList<>();
listaCadenas.add("hola");
listaCadenas.add("buenas");
// listaCadenas.add(1); no permitido, solo String
//listaCadenas.add('c'); no permitido, solo String
System.out.println(listaCadenas);
listaCadenas.add(0, "bye");
System.out.println(listaCadenas);
listaCadenas.set(0, "hello");
System.out.println(listaCadenas);
int posicion = 12;
if (posicion < listaCadenas.size())
System.out.println(listaCadenas.get(posicion));
listaCadenas.remove("hello");
listaCadenas.remove(0);
System.out.println(listaCadenas); //solo queda la cadena buenas
System.out.printf("¿Contiene buenas la lista? %b%n", listaCadenas.contains("buenas"));
System.out.printf("¿Contiene hello la lista? %b%n", listaCadenas.contains("hello"));
System.out.printf("Posición de buenas en la lista %d%n", listaCadenas.indexOf("buenas"));
listaCadenas.add("buenas");
System.out.printf("Posición de buenas en la lista %d%n", listaCadenas.indexOf("buenas"));
//ejemplo de lista de float
List<Float> listaFloat = new ArrayList<>(); //crea una lista dinámica, se crea inicialmente con cero elemento
float[] arrayFloat = new float[12]; //crea una lista estática, no puede cambier el tamaño, y se crea con 12 floats que son todos 0.0
listaFloat.add(2.2f);
arrayFloat[11] = 2.2f;
listaFloat.add(2f);
listaFloat.add(0, 2.3f);
System.out.println(listaFloat);
//inicializando lista con contenido
List<String> listaInmutableString = List.of("uno", "dos");
System.out.println(listaInmutableString);
// listaInmutableString.add("tres"); es inmutable no se puede añadir mas elementos
// listaInmutableString.remove(0); es inmutable no se puede quitar elementos
//parecido
String[] arrayCadenas = {"uno", "dos"};
// listaInmutableString.set(0, "one");
System.out.println(listaInmutableString);
//otra forma de crear listas con valores inciales
List<String> stringList = Arrays.asList("one", "two");
System.out.println(stringList);
//stringList.add("three");
//stringList.remove(0);
//INMUTABLES
}
}
| [
"programacionpsdam@gmail.com"
] | programacionpsdam@gmail.com |
28a47d03df05bdaad7ac6394eaa2d73052575bfa | 034b53d3b28244e69ae6233c64aff2ed572fd3b0 | /eclipse workspace-oxygen/Experiment2/src/exp2/Experiment2.java | 933c699cd918ab4f0bfae1704798a3a828a143db | [] | no_license | 871049921/MyCode | 87aeee00db3bf7036b8b1f9c1d9c537643bb439b | 3f6ec85bad7c0f69720c1627fd6be9e1e0ccb5fe | refs/heads/master | 2020-05-20T06:42:32.200976 | 2019-06-20T13:57:26 | 2019-06-20T13:57:26 | 185,433,073 | 1 | 0 | null | null | null | null | GB18030 | Java | false | false | 1,399 | java | package exp2;
import java.io.*;
public class Experiment2 {
public static void main(String[] args) throws Exception{
String allInformation = "";//所有信息
int i = 0;
Goods[] goods = new Goods[10];
String randomGoodsName[] = {"pen", "pencil", "backpack", "ruler", "apple", "pear",
"banana", "strawberry", "watermelon", "water"};
SalesRecord[] allRecords = new SalesRecord[1000];
//创建盒装商品类
for (; i < 5; i++) {
goods[i] = new Goods(randomGoodsName[i], "" + i, i * 10 + 10);
//System.out.println(goods[i].getGoodInfomation());
}
//创建散装商品类
for (; i < 10; i++) {
goods[i] = new Goods(randomGoodsName[i], i * 10 + 10);
//System.out.println(goods[i].getGoodInfomation());
}
for (int j = 0; j < 1000; j++) {
int goodsNumber = (int)(Math.random()*10);
if (goods[goodsNumber].isBoxPacked() == true) {//盒装
allRecords[j] = new SalesRecord(goods[goodsNumber], goods[goodsNumber].getBarCode(), goodsNumber);
}
else {
allRecords[j] = new SalesRecord(goods[goodsNumber], goodsNumber);
}
allInformation += allRecords[j].getEveryInformation() + "\n";
}
PrintWriter output = new PrintWriter(new File("fuck.txt"));
output.println(allInformation + SalesRecord.getAllInformationOfToday(goods, 10));
System.out.println(allInformation + SalesRecord.getAllInformationOfToday(goods, 10));
output.close();
}
}
| [
"871049921@qq.com"
] | 871049921@qq.com |
ac1cddce365670db6fdba7ee6d04bb62800c0ef5 | 619d7b729ef99bd2e782dfcb4d7f38ae55382061 | /theDefault/src/main/java/theHeart/powers/HemorrhagePower.java | 704e0b64a2d01870f85b0edc04e230a6a91a1b30 | [
"MIT"
] | permissive | Magicut101/theHeart | f6e6d32704d87772b8d99479291f909acff95062 | 43025bb36a479234ff4df06c757adf5630a190d3 | refs/heads/master | 2020-06-14T03:21:52.020673 | 2019-08-20T17:11:46 | 2019-08-20T17:11:46 | 194,478,121 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,151 | java | package theHeart.powers;
import basemod.interfaces.CloneablePowerInterface;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.TextureAtlas;
import com.megacrit.cardcrawl.actions.common.MakeTempCardInDrawPileAction;
import com.megacrit.cardcrawl.cards.status.Slimed;
import com.megacrit.cardcrawl.powers.DrawPower;
import com.megacrit.cardcrawl.actions.common.ApplyPowerAction;
import com.megacrit.cardcrawl.actions.common.DrawCardAction;
import com.megacrit.cardcrawl.actions.common.MakeTempCardInDiscardAction;
import com.megacrit.cardcrawl.cards.AbstractCard;
import com.megacrit.cardcrawl.cards.status.Wound;
import com.megacrit.cardcrawl.core.AbstractCreature;
import com.megacrit.cardcrawl.core.CardCrawlGame;
import com.megacrit.cardcrawl.dungeons.AbstractDungeon;
import com.megacrit.cardcrawl.localization.PowerStrings;
import com.megacrit.cardcrawl.powers.AbstractPower;
import theHeart.DefaultMod;
import theHeart.util.TextureLoader;
public class HemorrhagePower extends AbstractPower implements CloneablePowerInterface {
public AbstractCreature source;
public static final String POWER_ID = DefaultMod.makeID("Hemorrhage");
private static final PowerStrings powerStrings = CardCrawlGame.languagePack.getPowerStrings(POWER_ID);
public static final String NAME = powerStrings.NAME;
public static final String[] DESCRIPTIONS = powerStrings.DESCRIPTIONS;
// We create 2 new textures *Using This Specific Texture Loader* - an 84x84 image and a 32x32 one.
private static final Texture tex84 = TextureLoader.getTexture("Hemorrhage84.png");
private static final Texture tex32 = TextureLoader.getTexture("Hemorrhage32.png");
public HemorrhagePower(final AbstractCreature owner, final int amount) {
name = NAME;
ID = POWER_ID;
this.owner = owner;
this.amount = amount;
type = PowerType.BUFF;
isTurnBased = false;
// We load those textures here.
this.region128 = new TextureAtlas.AtlasRegion(tex84, 0, 0, 84, 84);
this.region48 = new TextureAtlas.AtlasRegion(tex32, 0, 0, 32, 32);
updateDescription();
}
public void atStartOfTurn() {
if (!AbstractDungeon.getMonsters().areMonstersBasicallyDead()) {
flash();
AbstractDungeon.actionManager.addToBottom(new MakeTempCardInDiscardAction(new Wound(), amount));
}
}
/* */
/* */
/* */
/* */ public void stackPower(int stackAmount) {
/* 41 */ this.fontScale = 8.0F;
/* 42 */ this.amount += stackAmount;
/* */ }
/* */
public void updateDescription() {
if (amount == 1) {
description = DESCRIPTIONS[0] + amount + DESCRIPTIONS[1];
} else if (amount > 1) {
description = DESCRIPTIONS[0] + amount + DESCRIPTIONS[2];
}
}
/* */
public AbstractPower makeCopy() {
return new HemorrhagePower(owner, amount);
}
} | [
"garciaandy42@hotmail.com"
] | garciaandy42@hotmail.com |
3e2157ade1e08804f960d718b1fa404ac20d48ad | 30e830d8e2e3fd14d700444f14a02de27e849316 | /夏天酒店管理系统/jdglxt/.svn/pristine/79/799746e19e59c399095e8170385b762cffb6d627.svn-base | 2c267cb8bb0ac4ae1537cdcf69ba8faddfcfab79 | [] | no_license | MissionSuccess/JavaSwing | 74d8320cc89274c28432b8ddf814e330575b730e | fe50f974aabdcad7b643268d7f8b3318b51b2c66 | refs/heads/master | 2021-08-07T03:54:02.357265 | 2018-11-21T11:41:49 | 2018-11-21T11:41:49 | 146,053,786 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,835 | package org.lanqiao.jdmrg.view;
import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.jar.Pack200;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JPanel;
import org.lanqiao.jdmrg.view.*;
//import dao.UpdateClient;
//import view.CanvasFrame;
//import view.KeyFrame;
//import view.RoomClientFrame;
/**
* 前台界面
*
* @author wzg
*/
@SuppressWarnings("serial")
public class QTPanel extends JPanel{
public QTPanel() {
JPanel jj=this;
this.setLayout(null);
this.setSize(210, 640);
this.setLocation(0, 0);
this.setBackground(Color.white);
JButton Key = new JButton();
Key.setFont(new Font("楷体",Font.BOLD,32));
Key.setSize(195, 65);
Key.setLocation(7, 90);
Key.setIcon(new ImageIcon("src/images/房卡激活.png"));
JButton Indent = new JButton();
Indent.setFont(new Font("楷体",Font.BOLD,32));
Indent.setSize(195, 65);
Indent.setLocation(7, 180);
Indent.setIcon(new ImageIcon("src/images/订单处理.png"));
JButton Client= new JButton();
Client.setFont(new Font("楷体",Font.BOLD,32));
Client.setSize(195, 65);
Client.setLocation(7, 270);
Client.setIcon(new ImageIcon("src/images/房客信息.png"));
JButton Roomdie = new JButton();
Roomdie.setFont(new Font("楷体",Font.BOLD,32));
Roomdie.setSize(195, 65);
Roomdie.setLocation(7, 360);
Roomdie.setIcon(new ImageIcon("src/images/房间维护.png"));
JButton Money = new JButton();
Money.setFont(new Font("楷体",Font.BOLD,32));
Money.setSize(195, 65);
Money.setLocation(7, 450);
Money.setIcon(new ImageIcon("src/images/历史订单.png"));
JButton Exit = new JButton();
Exit.setFont(new Font("楷体",Font.BOLD,32));
Exit.setSize(195, 65);
Exit.setLocation(7, 540);
Exit.setIcon(new ImageIcon("src/images/退出系统.png"));
this.add(Key);
this.add(Indent);
this.add(Client);
this.add(Roomdie);
this.add(Money);
this.add(Exit);
/**
* 房卡激活
*/
Key.addActionListener(new ActionListener() {
public void actionPerformed(final ActionEvent e) {
KeyPanel aKeyFrame=new KeyPanel();
CanvasFrame2.delePanelRight(aKeyFrame);
return;
}
});
/**
* 订单处理
*/
Indent.addActionListener(new ActionListener() {
public void actionPerformed(final ActionEvent e) {
new TestFrame().addRecepIndent();
CanvasFrame2.delePanelRight(TestFrame.j2);
return;
}
});
/**
* 房客信息
*/
Client.addActionListener(new ActionListener() {
public void actionPerformed(final ActionEvent e) {
RoomClientPanel aRoomClientFrame =new RoomClientPanel ();
CanvasFrame2.delePanelRight(aRoomClientFrame );
}
});
/**
* 房间维护
*/
Roomdie.addActionListener(new ActionListener() {
public void actionPerformed(final ActionEvent e) {
new TestFrame().addRoomMaintain();
CanvasFrame2.delePanelRight(TestFrame.j2);
return;
}
});
/**
* 历史订单
*/
Money.addActionListener(new ActionListener() {
public void actionPerformed(final ActionEvent e) {
new TestFrame().addHistoryIndent();
CanvasFrame2.delePanelRight(TestFrame.j2);
return;
}
});
/**
* 退出系统
*/
Exit.addActionListener(new ActionListener() {
public void actionPerformed(final ActionEvent e) {
new Denglu();
CanvasFrame2.deleAllPanelRight();
CanvasFrame2.jfff.dispose();
return;
}
});
}
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
Image img = null;
try {
img = new ImageIcon("src/images/左边有logo.png").getImage();
} catch (Exception e) {
e.printStackTrace();
}
g.drawImage(img, 0, 0, 210,640,null);
repaint();
}
} | [
"41855798+MissionSuccess@users.noreply.github.com"
] | 41855798+MissionSuccess@users.noreply.github.com | |
434f255b9ef3b65ce78f52b1a3726044155a1b41 | 32d71a1f8b198805ae9c3e6a8ad5ec2490eff804 | /src/main/java/org/core/implementation/bukkit/entity/BSnapshotValueEntity.java | 9865b2714aac5e8179fe32112da267c281e5aa57 | [] | no_license | Minecraft-Ships/CoreToBukkit | 9baeeb947ce52e044c1c4e852e194af365e1c901 | 5babd2ae7137101492aab73d34989de98f12f9c3 | refs/heads/master | 2023-07-07T02:23:10.031569 | 2023-06-21T20:09:05 | 2023-06-21T20:09:05 | 143,561,258 | 0 | 1 | null | 2023-02-05T19:39:48 | 2018-08-04T20:34:02 | Java | UTF-8 | Java | false | false | 7,297 | java | package org.core.implementation.bukkit.entity;
import org.bukkit.Location;
import org.bukkit.util.Vector;
import org.core.TranslateCore;
import org.core.adventureText.AText;
import org.core.entity.Entity;
import org.core.entity.EntitySnapshot;
import org.core.entity.EntityType;
import org.core.entity.LiveEntity;
import org.core.implementation.bukkit.platform.BukkitPlatform;
import org.core.implementation.bukkit.world.BWorldExtent;
import org.core.implementation.bukkit.world.position.impl.sync.BExactPosition;
import org.core.utils.entry.AbstractSnapshotValue;
import org.core.vector.type.Vector3;
import org.core.world.position.impl.Position;
import org.core.world.position.impl.sync.SyncExactPosition;
import org.jetbrains.annotations.Nullable;
import java.util.Collection;
import java.util.HashSet;
import java.util.Optional;
import java.util.Set;
public class BSnapshotValueEntity<BE extends org.bukkit.entity.Entity, E extends BLiveEntity<BE>>
implements EntitySnapshot<E> {
private final EntityType<E, ? extends EntitySnapshot<E>> type;
private final E createdFrom;
private Set<EntitySnapshotValue<? super BE, ?>> snapshotValues = new HashSet<>();
public BSnapshotValueEntity(E entity) {
BE bukkitEntity = entity.getBukkitEntity();
this.snapshotValues = EntitySnapshotValue.getSnapshotValues(bukkitEntity);
this.type = entity.getType();
this.createdFrom = entity;
this.snapshotValues.forEach(sv -> sv.storeValue(bukkitEntity));
}
public BSnapshotValueEntity(BSnapshotValueEntity<BE, E> entity) {
this.snapshotValues.addAll(entity.snapshotValues);
this.type = entity.getType();
this.createdFrom = entity.createdFrom;
}
private <V> Optional<EntitySnapshotValue<?, V>> getSnapshotValue(String id) {
return this.snapshotValues
.parallelStream()
.filter(v -> v.getId().equals(id))
.findAny()
.map(v -> (EntitySnapshotValue<?, V>) v);
}
@Override
public SyncExactPosition getPosition() {
return new BExactPosition(this.<Location>getSnapshotValue("LOCATION").get().getValue());
}
@Override
public EntityType<E, ? extends EntitySnapshot<E>> getType() {
return this.type;
}
@Override
public Entity<EntitySnapshot<? extends LiveEntity>> setPitch(double value) {
Location loc = this.<Location>getSnapshotValue("LOCATION").get().getValue();
loc.setPitch((float) value);
return this;
}
@Override
public Entity<EntitySnapshot<? extends LiveEntity>> setYaw(double value) {
Location loc = this.<Location>getSnapshotValue("LOCATION").get().getValue();
loc.setYaw((float) value);
return this;
}
@Override
public Entity<EntitySnapshot<? extends LiveEntity>> setRoll(double value) {
return this;
}
@Override
public Entity<EntitySnapshot<? extends LiveEntity>> setPosition(Position<? extends Number> position) {
EntitySnapshotValue<?, Location> locValue = this.<Location>getSnapshotValue("LOCATION").get();
Location oldLoc = locValue.getValue();
Location loc = new Location(((BWorldExtent) position.getWorld()).getBukkitWorld(),
position.getX().doubleValue(), position.getY().doubleValue(),
position.getZ().doubleValue());
loc.setPitch(oldLoc.getPitch());
loc.setYaw(oldLoc.getYaw());
locValue.setValue(loc);
return this;
}
@Override
public Entity<EntitySnapshot<? extends LiveEntity>> setGravity(boolean check) {
this.<Boolean>getSnapshotValue("GRAVITY").get().setValue(check);
return this;
}
@Override
public Entity<EntitySnapshot<? extends LiveEntity>> setVelocity(Vector3<Double> velocity) {
this
.<Vector>getSnapshotValue("VELOCITY")
.get()
.setValue(new Vector(velocity.getX(), velocity.getY(), velocity.getZ()));
return this;
}
@Override
public Entity<EntitySnapshot<? extends LiveEntity>> setCustomName(@Nullable AText text) {
if (text == null) {
this.<String>getSnapshotValue("CUSTOM_NAME").get().setValue(null);
return this;
}
this.<String>getSnapshotValue("CUSTOM_NAME").get().setValue(text.toLegacy());
return this;
}
@Override
public Entity<EntitySnapshot<? extends LiveEntity>> setCustomNameVisible(boolean visible) {
this.<Boolean>getSnapshotValue("CUSTOM_NAME_VISIBLE").get().setValue(visible);
return this;
}
@Override
public double getPitch() {
return this.<Location>getSnapshotValue("LOCATION").get().getValue().getPitch();
}
@Override
public double getYaw() {
return this.<Location>getSnapshotValue("LOCATION").get().getValue().getYaw();
}
@Override
public double getRoll() {
return 0;
}
@Override
public boolean hasGravity() {
return this.<Boolean>getSnapshotValue("GRAVITY").get().getValue();
}
@Override
public Vector3<Double> getVelocity() {
Vector vector = this.<Vector>getSnapshotValue("VELOCITY").get().getValue();
return Vector3.valueOf(vector.getX(), vector.getY(), vector.getZ());
}
@Override
public Optional<AText> getCustomName() {
Optional<EntitySnapshotValue<?, String>> opText = this.getSnapshotValue("CUSTOM_NAME");
return opText.map(stringEntitySnapshotValue -> AText.ofLegacy(stringEntitySnapshotValue.getValue()));
}
@Override
public boolean isCustomNameVisible() {
return this.<Boolean>getSnapshotValue("CUSTOM_NAME_VISIBLE").get().getValue();
}
@Override
public Collection<EntitySnapshot<? extends LiveEntity>> getPassengers() {
return new HashSet<>();
}
@Override
public Entity<EntitySnapshot<? extends LiveEntity>> addPassengers(Collection<? extends EntitySnapshot<? extends LiveEntity>> entities) {
return this;
}
@Override
public Entity<EntitySnapshot<? extends LiveEntity>> removePassengers(Collection<EntitySnapshot<? extends LiveEntity>> entities) {
return this;
}
@Override
public boolean isOnGround() {
return this.<Boolean>getSnapshotValue("IS_ON_GROUND").get().getValue();
}
@Override
public boolean isRemoved() {
return this.<Boolean>getSnapshotValue("IS_REMOVED").map(AbstractSnapshotValue::getValue).orElse(false);
}
@Override
public E spawnEntity() {
Location loc = this.<Location>getSnapshotValue("LOCATION").get().getValue();
BE entity = (BE) loc.getWorld().spawnEntity(loc, ((BEntityType<?, ?>) this.type).getBukkitEntityType());
this.snapshotValues.stream().map(sv -> (EntitySnapshotValue<BE, ?>) sv).forEach(sv -> sv.applyValue(entity));
return (E) ((BukkitPlatform) TranslateCore.getPlatform()).createEntityInstance(entity);
}
@Override
public EntitySnapshot<E> createSnapshot() {
return new BSnapshotValueEntity<>(this);
}
@Override
public Optional<E> getCreatedFrom() {
return Optional.ofNullable(this.createdFrom);
}
}
| [
"nekronmoseley@gmail.com"
] | nekronmoseley@gmail.com |
90499da48a1f243498fd435a76ddca1daf48fa85 | e5150d7e230615498fb653b80a60185d64d2292d | /SBNotification/src/main/java/Notify/NotificationRestController.java | fd6497693449369aadb6f34219d637a5b6c0951f | [] | no_license | NitinSingh01/NotificationServices | 14c726d50df8f4a0670a14c950dacfc4802f5291 | c4b6da00b23aefaa13702ffb0ce77d13957881bd | refs/heads/master | 2022-11-18T18:12:24.076645 | 2020-07-07T14:53:25 | 2020-07-07T14:53:25 | 276,280,945 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,928 | java | package Notify;
import java.net.URISyntaxException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.mail.MailException;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import Notify.Transaction;
@RestController
public class NotificationRestController {
@Autowired
NotificationRepository notificationRepo;
@RequestMapping(method=RequestMethod.POST, value="/microbank/v1/notify/customer")
public void notify_msg1(@RequestBody String data) throws JsonMappingException, JsonProcessingException{
Object mapper = new ObjectMapper();
Customer c = ((ObjectMapper) mapper).readValue(data, Customer.class);
System.out.println(c.getEmail());
notificationRepo.sendSuccessfulRegistraionEmail(c);
}
@RequestMapping(method=RequestMethod.POST, value="/microbank/v1/notify/customer/account/transaction")
public void notify_msg2(@RequestBody String user)throws JsonMappingException, JsonProcessingException, MailException, URISyntaxException{
Object mapper = new ObjectMapper();
Transaction c = ((ObjectMapper) mapper).readValue(user, Transaction.class);
notificationRepo.sendTransactionEmail(c);
}
@RequestMapping(method=RequestMethod.POST, value="/microbank/v1/notify/customer/account")
public void notify_msg3(@RequestBody String data) throws JsonMappingException, JsonProcessingException, MailException, URISyntaxException{
Object mapper = new ObjectMapper();
Account c = ((ObjectMapper) mapper).readValue(data, Account.class);
notificationRepo.sendAccountCreatedEmail(c);
}
}
| [
"nitin.singh01@ad.infosys.com"
] | nitin.singh01@ad.infosys.com |
638a5405b9c17512047ef97e6ac9b8554a9742f2 | 3b2a3adb9fa3826bd0ebd3c0500f27d61ecc61c6 | /servlets/src/main/java/ru/itis/repositories/CrudRepository.java | 6d385afa51045fa23739c59cb16edae25504ac92 | [] | no_license | FakDL/asulgaraev_inf | 5b45053a29fe33de31c45427c6ae3a4d7a5d93a1 | 3d1c30bf71df1e998142597f317d47fd6a161236 | refs/heads/master | 2023-04-27T00:36:05.014008 | 2021-05-30T21:16:12 | 2021-05-30T21:16:12 | 293,893,606 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 288 | java | package ru.itis.repositories;
import java.util.List;
import java.util.Optional;
public interface CrudRepository<T> {
Optional<T> findById(Long id);
List<T> findAll();
void save(T entity);
void update(T entity);
void delete(T entity);
void deleteById(Long id);
}
| [
"43212319+FakDL@users.noreply.github.com"
] | 43212319+FakDL@users.noreply.github.com |
ed8abbd7ce548972eeaac8529e94d5c8cb7d3ce2 | bb4beb950c7b6f597b598536021d6c2c00514c66 | /app/src/main/java/com/e/my_room/Nota.java | c5da9a398fafe09fb97c3087e5e15c9d1628d080 | [] | no_license | RojoF/Room_beta | 92dc106b5639943772c4440596311756f3d04ee5 | 486b8f6536a05770bc465f73e0b7b83a00c21284 | refs/heads/master | 2022-11-24T22:13:00.348677 | 2020-08-04T07:21:17 | 2020-08-04T07:21:17 | 284,901,988 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 852 | java | package com.e.my_room;
import androidx.annotation.NonNull;
import androidx.room.ColumnInfo;
import androidx.room.Entity;
import androidx.room.PrimaryKey;
import java.util.UUID;
/**
* Esta clase contiene un objeto de tipo Nota, con un id y el texto de dicha Nota.
*
* @author Raúl Félez Jiménez
* @version 2020.07
*/
@Entity(tableName = "nota")
public class Nota {
@PrimaryKey
@NonNull
private String mId;
@ColumnInfo(name = "contenido")
private String mMensaje;
public Nota() {
mId = UUID.randomUUID().toString();
}
@NonNull
public String getId() {
return mId;
}
public void setId(@NonNull String id) {
mId = id;
}
public String getMensaje() {
return mMensaje;
}
public void setMensaje(String mensaje) {
mMensaje = mensaje;
}
}
| [
"rojof83@gmail.com"
] | rojof83@gmail.com |
7e1a2d98aadacdcbd6327b776a56e1a34ad262a4 | c704787944c6be5b4264a67e0d5bd90113fd335d | /app/src/main/java/edu/smartgate/reza/smartgateta/ServerConfig.java | 7aa2a61e6183968359fa501c55f45b97e8a6613b | [] | no_license | ejakpratama/SmartGateTA | 31575ad984d9da1af946ed4662e75c18f1330a86 | 315d165261068eb6d5b83af52da9c1b24344a74a | refs/heads/master | 2020-03-06T18:06:25.917414 | 2018-04-01T09:48:42 | 2018-04-01T09:48:44 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 881 | java | package edu.smartgate.reza.smartgateta;
/**
* Created by Reza on 16-Dec-17.
*/
class ServerConfig {
//labkom
//private static final String SERVER_URL = "http://192.168.1.123/smartgate/";
//rumah
//protected static final String SERVER_URL = "http://192.168.100.10/smartgate/";
//ruang dosen siskom
//protected static final String SERVER_URL = "http://192.168.0.115/smartgate/";
//hosting online
protected static final String SERVER_URL = "http://smartgateta.xyz/smartgate/";
//php
static final String URL_LOGIN = SERVER_URL+"LoginUser.php";
static final String URL_REGISTER = SERVER_URL+"RegisterUserLengkap.php";
static final String URL_RIWAYAT = SERVER_URL+"AmbilStatusGerbang.php";
static final String URL_UPDATE = SERVER_URL+"UpdateGbg.php";
static final String URL_CHECK = SERVER_URL+"CheckStatusGerbang.php";
}
| [
"reza.blaze26@gmail.com"
] | reza.blaze26@gmail.com |
e98c7bd8b145649fa509684dacfbee35607b388d | 36f10d3acf2806a8711e075a10cdcf3a9b3f5481 | /src/main/java/com/app/ildong/sys/controller/SysPopupMgmtController.java | 36380810b8755f8e27177a8b52b6d3650d413ee7 | [] | no_license | Parkjongyong/DailyGit | c2668a9396fb2353354c94423f0697facdeb383f | feeae1937ef3e47347e93164c99d4b8bac2fd8eb | refs/heads/master | 2023-08-10T09:00:59.149471 | 2021-09-14T05:52:37 | 2021-09-14T05:52:37 | 405,889,871 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 13,329 | java | /**
* 알림팝업 조회/등록/수정 컨트롤러
* @author 길용덕
* @since 2020.06.17
*
* << 개정이력(Modification Information) >>
* -------------------------------------------------
* 수정일 수정자 수정내용
* ---------- -------- ---------------------------
* 2020.06.18 길용덕 최초생성
* -------------------------------------------------
*/
package com.app.ildong.sys.controller;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import com.app.ildong.common.model.JsonData;
import com.app.ildong.common.model.mvc.BaseController;
import com.app.ildong.common.pagenation.PaginationInfo;
import com.app.ildong.common.service.CommonSelectService;
import com.app.ildong.common.service.FileManageService;
import com.app.ildong.common.util.FileUtil;
import com.app.ildong.common.util.PageUtil;
import com.app.ildong.common.util.StringUtil;
import com.app.ildong.sys.service.SysBoardService;
import com.app.ildong.sys.service.SysPopupMgmtService;
@Controller
public class SysPopupMgmtController extends BaseController {
private static final Logger logger = LoggerFactory.getLogger(SysPopupMgmtController.class);
@Autowired
private SysBoardService sysBoardService;
@Autowired
private SysPopupMgmtService sysPopupMgmtService;
@Autowired
private CommonSelectService commonSelectService;
@Autowired
private FileManageService fileManageService;
@RequestMapping("/com/sys/sysBoardViewPop.do")
public String sysBoardView(@RequestParam Map<String,Object> paramMap, HttpServletRequest request, ModelMap model) throws Exception {
//필요공통코드 목록
model.putAll(commonSelectService.selectCodeList(new String[]{"ADM002"}));
paramMap.put("COMP_CD", getCompCd());
sysBoardService.updateBoardHit(paramMap);
model.addAttribute("boardInfo", sysBoardService.selectBoardInfo(paramMap));
model.addAttribute("boardInfoAll", sysBoardService.selectBoardInfoAll(paramMap));
model.addAttribute("data", paramMap);
model.addAttribute("boardView", sysBoardService.selectBoard(paramMap));
return "com/sys/sysBoardViewPop";
}
@RequestMapping("/com/sys/sysBoardListPop.do")
public String sysBoardList(@RequestParam Map<String,Object> paramMap, HttpServletRequest request, ModelMap model) throws Exception {
String url = "com/sys/sysBoardListPop";
paramMap.put("COMP_CD", getCompCd());
Map<String, Object> boardInfo = sysBoardService.selectBoardInfo(paramMap);
if("FAQ".equals(boardInfo.get("BOARD_TYPE"))) {
//필요공통코드 목록
model.putAll(commonSelectService.selectCodeList(new String[]{"ADM003"}));
url = "com/sys/sysBoardListPopFaq";
}
model.addAttribute("boardInfo", boardInfo);
model.addAttribute("boardInfoAll", sysBoardService.selectBoardInfoAll(paramMap));
model.addAttribute("data", paramMap);
return url;
}
@RequestMapping("/com/sys/sysPopupMgmt.do")
public String sysPopupMgmt(@RequestParam Map<String,Object> paramMap, HttpServletRequest request, Model model) {
return "com/sys/sysPopupMgmt";
}
@RequestMapping("/com/sys/selectSysPopupMgmtList.do")
@ResponseBody
public JsonData selectSysPopupMgmtList(@RequestBody Map<String,Object> paramMap, HttpServletRequest request, ModelMap model) {
JsonData jsonData = new JsonData();
try {
List<Map<String,Object>> dataList = sysPopupMgmtService.selectSysPopupMgmtList(paramMap);
if (null!=dataList && 0<dataList.size()) {
Integer totalCnt = Integer.valueOf( ((Map<String,Object>)dataList.get(0)).get("TOT_CNT").toString() );
jsonData.setPageRows(paramMap, dataList, totalCnt);
} else {
jsonData.setPageRows(paramMap, null, 0);
}
} catch (Exception e) {
logger.error("팝업관리 조회 오류", e);
}
if( logger.isDebugEnabled()) {
logger.debug("jsonData = " + jsonData);
}
return jsonData;
}
@RequestMapping("/com/sys/sysPopupMgmtWrite.do")
public String sysPopupMgmtWrite(@RequestParam Map<String,Object> paramMap, HttpServletRequest request, Model model) {
return "com/sys/sysPopupMgmtWrite";
}
@RequestMapping("/com/sys/insertPopupMgmt.do")
@ResponseBody
public JsonData insertPopupMgmt(@RequestBody Map<String,Object> paramMap, HttpServletRequest request, ModelMap model) {
JsonData jsonData = new JsonData();
int result = 0;
String resultCd = "";
try {
result = sysPopupMgmtService.insertPopupMgmt(paramMap);
if(result > 0) {
resultCd = "S";
} else {
resultCd = "E";
}
jsonData.addFields("resultCd", resultCd);
} catch (Exception e) {
logger.error("팝업관리 새 팝업 작성 저장 오류", e);
jsonData.setErrMsg(e.getMessage());
}
if( logger.isDebugEnabled()) {
logger.debug("jsonData = " + jsonData);
}
return jsonData;
}
@RequestMapping("/com/sys/modifyPopupMgmt.do")
@ResponseBody
public JsonData modifyPopupMgmt(@RequestBody Map<String,Object> paramMap, HttpServletRequest request, ModelMap model) {
JsonData jsonData = new JsonData();
int result = 0;
String resultCd = "";
try {
result = sysPopupMgmtService.updatePopupMgmt(paramMap);
if(result > 0) {
resultCd = "S";
} else {
resultCd = "E";
}
jsonData.addFields("resultCd", resultCd);
} catch (Exception e) {
logger.error("팝업관리 새 팝업 작성 수정 오류", e);
jsonData.setErrMsg(e.getMessage());
}
if( logger.isDebugEnabled()) {
logger.debug("jsonData = " + jsonData);
}
return jsonData;
}
@RequestMapping("/com/sys/sysPopupMgmtModify.do")
public String sysPopupMgmtModify(@RequestParam Map<String,Object> paramMap, HttpServletRequest request, Model model) {
model.addAttribute("popupView", sysPopupMgmtService.selectPopupMgmt(paramMap));
return "com/sys/sysPopupMgmtModify";
}
@RequestMapping("/com/sys/sysPopupMgmtView.do")
public String sysPopupMgmtView(@RequestParam Map<String,Object> paramMap, HttpServletRequest request, Model model) {
model.addAttribute("popupView", sysPopupMgmtService.selectPopupMgmt(paramMap));
return "com/sys/sysPopupMgmtView";
}
@RequestMapping("/com/sys/selectSysPopupMgmtListMain.do")
@ResponseBody
public JsonData selectSysPopupMgmtListMain(@RequestBody Map<String,Object> paramMap, HttpServletRequest request, ModelMap model) {
JsonData jsonData = new JsonData();
try {
logger.debug("=============================================================================");
List<Map<String,Object>> dataList = sysPopupMgmtService.selectSysPopupMgmtListMain(paramMap);
if (null!=dataList && 0<dataList.size()) {
jsonData.setPageRows(paramMap, dataList, 0);
} else {
jsonData.setPageRows(paramMap, null, 0);
}
} catch (Exception e) {
e.printStackTrace();
jsonData.setErrMsg(e.getMessage());
}
if( logger.isDebugEnabled()) {
logger.debug("jsonData = " + jsonData);
}
return jsonData;
}
@RequestMapping("/com/sys/selectPopupMgmtMain.do")
public String selectPopupMgmtMain(@RequestParam Map<String,Object> paramMap, HttpServletRequest request, Model model) {
model.addAttribute("popupView", sysPopupMgmtService.selectPopupMgmtMain(paramMap));
return "com/sys/sysPopupMgmtView";
}
@RequestMapping("/com/sys/sysBoardListPopup.do")
public String sysBoardListPopup(@RequestParam Map<String, Object> paramMap, HttpServletRequest request, ModelMap model) throws Exception {
// 공지사항
JsonData jsonData = new JsonData();
/*
* BP 공지사항
*/
List<Map<String, Object>> dataList = sysBoardService.selectNoticeList(paramMap);
if (null != dataList && 0 < dataList.size()) {
Integer totalCnt = Integer.valueOf(((Map<String, Object>) dataList.get(0)).get("TOT_CNT").toString());
jsonData.setPageRows(paramMap, dataList, totalCnt);
model.addAttribute("TOT_CNT", totalCnt);
model.addAttribute("page", jsonData.getPage());
} else {
jsonData.setPageRows(paramMap, null, 0);
model.addAttribute("TOT_CNT", "0");
model.addAttribute("page", jsonData.getPage());
}
PaginationInfo paginationInfo = new PaginationInfo();
paginationInfo.setCurrentPageNo(jsonData.getPage());
paginationInfo.setRecordCountPerPage(jsonData.getPageUnit());
paginationInfo.setPageSize(jsonData.getPageSize());
paginationInfo.setTotalRecordCount(jsonData.getRecords());
/*
* BP 공지사항
*/
model.addAttribute("dataList", dataList);
model.addAttribute("paginationInfo", paginationInfo);
model.addAttribute("boardInfo", sysBoardService.selectBoardInfo(paramMap));
model.addAttribute("srchGrp", StringUtil.nvl(paramMap.get("srchGrp"), ""));
model.addAttribute("srchTxt", StringUtil.nvl(paramMap.get("srchTxt"), ""));
return "com/sys/sysBoardListPopup";
}
@RequestMapping(value = "/com/sys/sysBoardDetailPopup.do")
public String sysBoardDetailPopup(@RequestParam Map<String,Object> paramMap, HttpServletRequest request, ModelMap model) throws Exception {
sysBoardService.updateBoardHit(paramMap);
Map<String, Object> noticeInfo = sysBoardService.selectBoard(paramMap);
Map<String, Object> subNoticeInfo = sysBoardService.selectSubNotice(paramMap);
if(!"".equals(StringUtil.nvl(noticeInfo.get("ATTACHMENT"), "")) ){
paramMap.put("APP_SEQ", StringUtil.nvl(noticeInfo.get("ATTACHMENT"), ""));
List<Map<String, Object>> uploadedFiles = fileManageService.selectUploadedFileList(paramMap);
model.addAttribute("fileList", FileUtil.convertForFileView(uploadedFiles));
}
model.addAttribute("page", StringUtil.nvl(paramMap.get("page"), "1"));
model.addAttribute("noticeInfo", noticeInfo);
model.addAttribute("subNoticeInfo", subNoticeInfo);
model.addAttribute("boardInfo", sysBoardService.selectBoardInfo(paramMap));
model.addAttribute("srchGrp", StringUtil.nvl(paramMap.get("srchGrp"), ""));
model.addAttribute("srchTxt", StringUtil.nvl(paramMap.get("srchTxt"), ""));
model.addAttribute("BOARD_ID", StringUtil.nvl(paramMap.get("BOARD_ID"), ""));
return "com/sys/sysBoardDetailPopup";
}
@RequestMapping("/com/sys/selectcoNoticeList.do")
@ResponseBody
public JsonData selectcoNoticeList(@RequestBody Map<String, Object> paramMap, HttpServletRequest request, ModelMap model) {
JsonData jsonData = new JsonData();
try {
List<Map<String,Object>> dataList = sysBoardService.selectNoticeList(paramMap);
if (null != dataList && 0 < dataList.size()) {
Integer totalCnt = Integer.valueOf(((Map<String, Object>) dataList.get(0)).get("TOT_CNT").toString());
jsonData.setPageRows(paramMap, dataList, totalCnt);
} else {
jsonData.setPageRows(paramMap, null, 0);
}
PaginationInfo paginationInfo = new PaginationInfo();
paginationInfo.setCurrentPageNo(jsonData.getPage()) ;
paginationInfo.setRecordCountPerPage(jsonData.getPageUnit());
paginationInfo.setPageSize(jsonData.getPageSize());
paginationInfo.setTotalRecordCount(jsonData.getRecords());
jsonData.addFields("pagingTag", PageUtil.renderPagination(paginationInfo, "linkPage"));
} catch (Exception e) {
e.printStackTrace();
jsonData.setErrMsg(e.getMessage());
}
if (logger.isDebugEnabled()) {
logger.debug("jsonData = " + jsonData);
}
return jsonData;
}
}
| [
"zzhsazz@naver.com"
] | zzhsazz@naver.com |
a92381d9df6944c94eaaa0cb5fcc3972cd01608a | cd9b815162c7e3e711358d966ff480c98722985d | /src/main/java/com/home_vedio_pro/util/UUIDUtil.java | 09168305245e994731a9d6cb99e3783b2fcb765f | [] | no_license | wswangbo007/home_vedio | 11bc63cd8d4590290013bef5dc8242f908eaf251 | a888d0a41f48474feee31a6ddb31ed40ba514c88 | refs/heads/master | 2021-01-10T02:20:44.352985 | 2016-01-19T03:54:15 | 2016-01-19T03:54:15 | 49,924,668 | 1 | 2 | null | null | null | null | UTF-8 | Java | false | false | 272 | java | package com.home_vedio_pro.util;
import java.util.UUID;
/**
* UUID
* @author wangB
*/
public class UUIDUtil {
/**
* 获取UUID
* @return string
*/
public static String getUUID() {
return UUID.randomUUID().toString().replace("-", "");
}
} | [
"527882238@qq.com"
] | 527882238@qq.com |
646ea080aebc3fe34c80cb6a100ea2ec17cbc157 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/9/9_a8b6587748158ecc773602a60e4450d6996edf34/AbstractNPC/9_a8b6587748158ecc773602a60e4450d6996edf34_AbstractNPC_s.java | f1086b371b6fbd0ee339bb356c5ff29bb9b71084 | [] | 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,342 | java | package net.citizensnpcs.api.npc;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.annotation.Nullable;
import net.citizensnpcs.api.CitizensAPI;
import net.citizensnpcs.api.ai.GoalController;
import net.citizensnpcs.api.ai.SimpleGoalController;
import net.citizensnpcs.api.ai.speech.SimpleSpeechController;
import net.citizensnpcs.api.ai.speech.SpeechController;
import net.citizensnpcs.api.event.DespawnReason;
import net.citizensnpcs.api.event.NPCAddTraitEvent;
import net.citizensnpcs.api.event.NPCRemoveEvent;
import net.citizensnpcs.api.event.NPCRemoveTraitEvent;
import net.citizensnpcs.api.persistence.PersistenceLoader;
import net.citizensnpcs.api.trait.Trait;
import net.citizensnpcs.api.trait.trait.MobType;
import net.citizensnpcs.api.trait.trait.Speech;
import net.citizensnpcs.api.util.DataKey;
import net.citizensnpcs.api.util.MemoryDataKey;
import net.citizensnpcs.api.util.Messaging;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.LivingEntity;
import org.bukkit.event.HandlerList;
import org.bukkit.metadata.FixedMetadataValue;
import com.google.common.base.Function;
import com.google.common.base.Splitter;
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
public abstract class AbstractNPC implements NPC {
private final GoalController goalController = new SimpleGoalController();
private final int id;
protected final MetadataStore metadata = new SimpleMetadataStore() {
@Override
public void remove(String key) {
super.remove(key);
if (getBukkitEntity() != null)
getBukkitEntity().removeMetadata(key, CitizensAPI.getPlugin());
}
@Override
public void set(String key, Object data) {
super.set(key, data);
if (getBukkitEntity() != null)
getBukkitEntity().setMetadata(key, new FixedMetadataValue(CitizensAPI.getPlugin(), data));
}
@Override
public void setPersistent(String key, Object data) {
super.setPersistent(key, data);
if (getBukkitEntity() != null)
getBukkitEntity().setMetadata(key, new FixedMetadataValue(CitizensAPI.getPlugin(), data));
}
};
private String name;
private final List<String> removedTraits = Lists.newArrayList();
protected final List<Runnable> runnables = Lists.newArrayList();
private final SpeechController speechController = new SimpleSpeechController(this);
protected final Map<Class<? extends Trait>, Trait> traits = Maps.newHashMap();
protected AbstractNPC(int id, String name) {
if (name.length() > 16) {
Messaging.severe("ID", id, "created with name length greater than 16, truncating", name, "to",
name.substring(0, 15));
name = name.substring(0, 15);
}
this.id = id;
this.name = name;
addTrait(MobType.class);
}
@Override
public void addTrait(Class<? extends Trait> clazz) {
addTrait(getTraitFor(clazz));
}
@Override
public void addTrait(Trait trait) {
if (trait == null) {
Messaging.severe("Cannot register a null trait. Was it registered properly?");
return;
}
if (trait.getNPC() == null) {
trait.linkToNPC(this);
}
// if an existing trait is being replaced, we need to remove the
// currently registered runnable to avoid conflicts
Trait replaced = traits.get(trait.getClass());
Bukkit.getPluginManager().registerEvents(trait, CitizensAPI.getPlugin());
traits.put(trait.getClass(), trait);
if (isSpawned())
trait.onSpawn();
if (trait.isRunImplemented()) {
if (replaced != null)
runnables.remove(replaced);
runnables.add(trait);
}
Bukkit.getPluginManager().callEvent(new NPCAddTraitEvent(this, trait));
}
@Override
public NPC clone() {
NPC copy = CitizensAPI.getNPCRegistry().createNPC(getTrait(MobType.class).getType(), getFullName());
DataKey key = new MemoryDataKey();
this.save(key);
copy.load(key);
for (Trait trait : copy.getTraits()) {
trait.onCopy();
}
return copy;
}
@Override
public MetadataStore data() {
return this.metadata;
}
@Override
public boolean despawn() {
return despawn(DespawnReason.PLUGIN);
}
@Override
public void destroy() {
Bukkit.getPluginManager().callEvent(new NPCRemoveEvent(this));
runnables.clear();
for (Trait trait : traits.values()) {
HandlerList.unregisterAll(trait);
trait.onRemove();
}
traits.clear();
CitizensAPI.getNPCRegistry().deregister(this);
}
@Override
public GoalController getDefaultGoalController() {
return goalController;
}
@Override
public SpeechController getDefaultSpeechController() {
// TODO: Remove in future versions.
// This is here to add the Speech trait to any existing NPCs
// that were created pre-SpeechController, if invoked.
if (!hasTrait(Speech.class))
addTrait(Speech.class);
return speechController;
}
@Override
public String getFullName() {
return name;
}
@Override
public int getId() {
return id;
}
@Override
public String getName() {
String parsed = name;
for (ChatColor color : ChatColor.values())
if (parsed.contains("<" + color.getChar() + ">"))
parsed = parsed.replace("<" + color.getChar() + ">", "");
return parsed;
}
@Override
public <T extends Trait> T getTrait(Class<T> clazz) {
Trait trait = traits.get(clazz);
if (trait == null) {
trait = getTraitFor(clazz);
addTrait(trait);
}
return trait != null ? clazz.cast(trait) : null;
}
protected Trait getTraitFor(Class<? extends Trait> clazz) {
return CitizensAPI.getTraitFactory().getTrait(clazz);
}
@Override
public Iterable<Trait> getTraits() {
return traits.values();
}
@Override
public boolean hasTrait(Class<? extends Trait> trait) {
return traits.containsKey(trait);
}
@Override
public boolean isProtected() {
return data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
}
@Override
public void load(final DataKey root) {
metadata.loadFrom(root.getRelative("metadata"));
// Load traits
String traitNames = root.getString("traitnames");
Set<DataKey> keys = Sets.newHashSet(root.getRelative("traits").getSubKeys());
Iterables.addAll(keys, Iterables.transform(Splitter.on(',').split(traitNames), new Function<String, DataKey>() {
@Override
public DataKey apply(@Nullable String input) {
return root.getRelative("traits." + input);
}
}));
for (DataKey traitKey : keys) {
if (traitKey.keyExists("enabled") && !traitKey.getBoolean("enabled")
&& traitKey.getRaw("enabled") instanceof Boolean) {
// avoid YAML coercing map existence to boolean
continue;
}
Class<? extends Trait> clazz = CitizensAPI.getTraitFactory().getTraitClass(traitKey.name());
Trait trait;
if (hasTrait(clazz)) {
trait = getTrait(clazz);
loadTrait(trait, traitKey);
} else {
trait = CitizensAPI.getTraitFactory().getTrait(clazz);
if (trait == null) {
Messaging.severeTr("citizens.notifications.trait-load-failed", traitKey.name(), getId());
continue;
}
loadTrait(trait, traitKey);
addTrait(trait);
}
}
}
private void loadTrait(Trait trait, DataKey traitKey) {
try {
trait.load(traitKey);
PersistenceLoader.load(trait, traitKey);
} catch (Throwable ex) {
Messaging.logTr("citizens.notifications.trait-load-failed", traitKey.name(), getId());
}
}
@Override
public void removeTrait(Class<? extends Trait> traitClass) {
Trait trait = traits.remove(traitClass);
if (trait != null) {
Bukkit.getPluginManager().callEvent(new NPCRemoveTraitEvent(this, trait));
removedTraits.add(trait.getName());
if (trait.isRunImplemented())
runnables.remove(trait);
HandlerList.unregisterAll(trait);
trait.onRemove();
}
}
@Override
public void save(DataKey root) {
metadata.saveTo(root.getRelative("metadata"));
root.setString("name", getFullName());
// Save all existing traits
StringBuilder traitNames = new StringBuilder();
for (Trait trait : traits.values()) {
DataKey traitKey = root.getRelative("traits." + trait.getName());
trait.save(traitKey);
PersistenceLoader.save(trait, traitKey);
removedTraits.remove(trait.getName());
traitNames.append(trait.getName() + ",");
}
if (traitNames.length() > 0) {
root.setString("traitnames", traitNames.substring(0, traitNames.length() - 1));
} else
root.setString("traitnames", "");
for (String name : removedTraits) {
root.removeKey("traits." + name);
}
removedTraits.clear();
}
@Override
public void setName(String name) {
this.name = name;
if (!isSpawned())
return;
LivingEntity bukkitEntity = getBukkitEntity();
bukkitEntity.setCustomName(getFullName());
if (bukkitEntity.getType() == EntityType.PLAYER) {
Location old = bukkitEntity.getLocation();
despawn(DespawnReason.PENDING_RESPAWN);
spawn(old);
}
}
@Override
public void setProtected(boolean isProtected) {
data().setPersistent(NPC.DEFAULT_PROTECTED_METADATA, isProtected);
}
public void update() {
for (int i = 0; i < runnables.size(); ++i) {
runnables.get(i).run();
}
if (isSpawned()) {
goalController.run();
}
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
f242db11c4ecda642be418c46b13e0c527541288 | 1294e95badd03a0a2b1d47c26bf58ba62b4c2693 | /YoutubeFavorite/src/main/java/com/doheum/yf/client/ClientService.java | a9157229a4624b0724cd2c19fa340828c4099c31 | [] | no_license | ParkDoheum/YoutubeFavorite | 775ed951641ebfa343a089cd25297389a1d697f8 | 2c45953ffdd64c67d06bb581e690b2ad564fb457 | refs/heads/master | 2020-04-08T15:05:38.043576 | 2018-11-30T08:13:03 | 2018-11-30T08:13:03 | 159,465,113 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 422 | java | package com.doheum.yf.client;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.doheum.yf.client.dao.ClientMapper;
import com.doheum.yf.model.YoutubeVO;
@Service
public class ClientService {
@Autowired
private ClientMapper mapper;
public List<YoutubeVO> getList() {
return mapper.getList();
}
}
| [
"USER@USER18-PC"
] | USER@USER18-PC |
5db24c10c1bd4185dee3265c392559d80fad8f90 | 4ea6d93e27c800b09cc19cfca3be6a15b0075a9f | /src/main/java/huffman/TreeNode.java | 8153b28beec59c8b4e46eeb11062c684f34fc5bf | [] | no_license | cellargalaxy/JavaDataStructureCurriculumDesign | 8f8f7112d2a7cc6fde37e9dc478a16e9fe057cfc | c5296e2eef9401cea168e987524268d3bfda51a1 | refs/heads/master | 2020-12-30T14:12:44.999694 | 2017-06-06T12:55:30 | 2017-06-06T12:55:30 | 91,289,596 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,142 | java | package huffman;
/**
* Created by cellargalaxy on 2017/5/15.
*/
public class TreeNode<T> {
private TreeNode parent;
private TreeNode left;
private TreeNode right;
private T t;
private long count;
private String coding;
protected TreeNode(T t, long count) {
this.t = t;
this.count = count;
coding = "";
}
public TreeNode getParent() {
return parent;
}
public void setParent(TreeNode parent) {
this.parent = parent;
}
public TreeNode getLeft() {
return left;
}
public void setLeft(TreeNode left) {
this.left = left;
}
public TreeNode getRight() {
return right;
}
public void setRight(TreeNode right) {
this.right = right;
}
public long getCount() {
return count;
}
public void setCount(long count) {
this.count = count;
}
public T getT() {
return t;
}
public void setT(T t) {
this.t = t;
}
public String getCoding() {
return coding;
}
public void setCoding(String coding) {
this.coding = coding;
}
@Override
public String toString() {
return "TreeNode{" +
"t=" + t +
", count=" + count +
", coding='" + coding + '\'' +
'}';
}
}
| [
"cellargalaxy@gmail.com"
] | cellargalaxy@gmail.com |
f5bd5a2c0ba5664c25d803b90e6001428ce56396 | 48fbd64287cb595bbe6d85d0849d1842674a7f46 | /prog/java_revision/Example/Example.java | e118e2d4cf301e819f0be3f31ecfae82b4350657 | [] | no_license | stevenaeola/gitpitch | c89cf0bd2cc81bc38b42f0737af81894e5aea30b | 0eca661e4cfb67bf060ae06852459cf248f58e2a | refs/heads/master | 2021-11-11T12:06:59.258896 | 2021-11-08T17:24:57 | 2021-11-08T17:24:57 | 149,439,800 | 24 | 51 | null | 2019-04-01T17:18:36 | 2018-09-19T11:24:11 | JavaScript | UTF-8 | Java | false | false | 1,763 | java | import java.util.ArrayList;
import java.util.List;
import java.util.Collections;
// concrete class
public class Example extends AbstractClassExample implements InterfaceExample, Comparable<Example>
{
// fields
// primitive type
private int field1;
// object type, type parameter
private ArrayList<String> field2;
// constructors
public Example(int field1){
super();
// field field1 is not visible
this.field1 = field1;
field2 = new ArrayList<String>();
}
// methods
// get method (accessor)
public int getField1(){
return field1;
}
// modifier method
public void addToField2(String toAdd){
field2.add(toAdd);
}
// overloaded method
public void addToField2(int toAdd){
// operator overloading
field2.add("Number " + toAdd);
}
// overriden method from Object
public String toString(){
String stuff = "A lovely object " + field1;
for(String thing: field2){
stuff += thing;
}
return stuff;
}
public int compareTo(Example other){
return this.getField1() - other.field1;
}
public static void main(String[] args){
// referring to static (class) variable
System.out.println(Example.numberOfObjects + " objects");
// polymorphism: dynamic type <> static type
List<Example> objects = new ArrayList<Example>();
for(int i = 0; i<args.length; i++ ){
objects.add(new Example(new Integer(args[i])));
}
// calling static (class) method
Collections.sort(objects);
System.out.println(objects);
System.out.println(Example.numberOfObjects + " objects");
}
}
| [
"s.p.bradley@durham.ac.uk"
] | s.p.bradley@durham.ac.uk |
542d6e651dcc16f92112ac4d3072ad82aef2a677 | c187d981fc6e697314c1fdcbdf0d9fa6bf83785c | /Adapter-Pattern/src/main/java/thridLogin/LoginForWechatAdapter.java | dbc88c4c97b07dd72cb52b1b86b38ff0a8f19367 | [] | no_license | zhengquan45/Play-with-DesignPattern | e18bbb70b1a2c3bb423062d71d4e67a50e113a9a | 1737601a267c65489213ceb513eccef9f348c3ac | refs/heads/master | 2022-10-07T22:47:32.655745 | 2020-06-10T01:05:27 | 2020-06-10T01:05:27 | 267,460,837 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 275 | java | package thridLogin;
public class LoginForWechatAdapter implements LoginAdapter{
public boolean support(Object adapter) {
return adapter instanceof LoginForWechatAdapter;
}
public ResultMsg login(String id, Object adapter) {
return null;
}
}
| [
"zheng_quan45@163.com"
] | zheng_quan45@163.com |
57cb110e800dbf33958a758b9d8ce394947ba41b | f269c1d88eace07323e8c5c867e9c3ba3139edb5 | /dk-impl-basic/dk-config-client/src/main/java/cn/laoshini/dk/config/client/DkConfigClientEnvironment.java | eacce051b18316b1fa90668acec924486137db5f | [
"Apache-2.0"
] | permissive | BestJex/dangkang | 6f693f636c13010dd631f150e28496d1ed7e4bc9 | de48d5107172d61df8a37d5f597c1140ac0637e6 | refs/heads/master | 2022-04-17T23:12:06.406884 | 2020-04-21T14:42:57 | 2020-04-21T14:42:57 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,824 | java | package cn.laoshini.dk.config.client;
import java.io.IOException;
import java.util.Properties;
import org.springframework.cloud.config.client.ConfigClientProperties;
import org.springframework.cloud.config.client.ConfigServicePropertySourceLocator;
import org.springframework.core.env.CompositePropertySource;
import org.springframework.core.env.ConfigurableEnvironment;
import org.springframework.core.env.MapPropertySource;
import org.springframework.core.env.MutablePropertySources;
import org.springframework.core.env.PropertiesPropertySource;
import org.springframework.core.env.PropertySource;
import org.springframework.core.env.StandardEnvironment;
import org.springframework.core.io.DefaultResourceLoader;
import org.springframework.core.io.Resource;
import org.springframework.core.io.ResourceLoader;
import org.springframework.core.io.support.ResourcePropertySource;
import cn.laoshini.dk.common.ResourcesHolder;
import cn.laoshini.dk.exception.BusinessException;
import cn.laoshini.dk.util.LogUtil;
import cn.laoshini.dk.util.StringUtil;
/**
* @author fagarine
*/
public class DkConfigClientEnvironment extends StandardEnvironment {
private static final String[] CONFIG_CLIENT_FILE = { "bootstrap", "config-client" };
private static final String[] FILE_SUFFIX = { ".properties", ".yml", ".yaml" };
@Override
protected void customizePropertySources(MutablePropertySources propertySources) {
super.customizePropertySources(propertySources);
loadConfigProperties(this);
}
private void loadConfigProperties(ConfigurableEnvironment environment) {
Resource resource = null;
ResourceLoader resourceLoader = new DefaultResourceLoader(this.getClass().getClassLoader());
String configFile = ResourcesHolder.getConfigClientFile();
if (StringUtil.isNotEmptyString(configFile)) {
resource = resourceLoader.getResource(configFile);
}
if (resource == null || !resource.exists() || !resource.isFile()) {
for (String prefix : CONFIG_CLIENT_FILE) {
for (String suffix : FILE_SUFFIX) {
configFile = prefix + suffix;
resource = resourceLoader.getResource(configFile);
if (resource.exists() && resource.isFile()) {
break;
}
}
}
}
if (!resource.exists() || !resource.isFile()) {
throw new BusinessException("config.client.file", "找不到有效的配置中心客户端配置文件");
}
MutablePropertySources propertySources = environment.getPropertySources();
try {
// 加载config client配置文件信息到environment中
LogUtil.start("config client file:" + resource.getFile());
ResourcePropertySource propertySource = new ResourcePropertySource(resource);
propertySources.addLast(propertySource);
} catch (IOException e) {
LogUtil.error(e, "读取config client配置信息出错");
}
// 初始化配置中心服务与数据
propertySources.addLast(initConfigServicePropertySourceLocator(environment));
}
/**
* 初始化配置中心服务与数据
*
* @param environment environment
* @return 返回从配置中心拉取到的配置信息
*/
private PropertySource<?> initConfigServicePropertySourceLocator(ConfigurableEnvironment environment) {
String uri = environment.getProperty("dk.config.server");
String name = environment.getProperty("dk.config.name");
String label = environment.getProperty("dk.config.label");
String profile = environment.getProperty("dk.config.profile");
LogUtil.start("application name:{}, uri:{}, profile:{}, label:{}", name, uri, profile, label);
// 创建配置中心客户端配置数据
ConfigClientProperties configClientProperties = new ConfigClientProperties(environment);
Properties properties = new Properties();
if (StringUtil.isEmptyString(uri)) {
throw new BusinessException("config.server.url", "配置中心URL未配置,配置项:dk.config.server");
}
configClientProperties.setUri(uri.split(","));
if (StringUtil.isEmptyString(name)) {
throw new BusinessException("config.client.name", "配置中心客户端name未配置,配置项:dk.config.name");
}
configClientProperties.setName(name);
properties.put("spring.cloud.config.name", name);
if (StringUtil.isEmptyString(profile)) {
throw new BusinessException("config.client.profile", "配置中心客户端profile未配置,配置项:dk.config.profile");
}
configClientProperties.setProfile(profile);
properties.put("spring.cloud.config.profile", profile);
if (StringUtil.isNotEmptyString(label)) {
configClientProperties.setLabel(label);
properties.put("spring.cloud.config.label", label);
}
environment.getPropertySources().addLast(new PropertiesPropertySource("springCloudConfigClient", properties));
// 定位Environment属性并拉取数据
ConfigServicePropertySourceLocator configServicePropertySourceLocator = new ConfigServicePropertySourceLocator(
configClientProperties);
PropertySource<?> propertySource = configServicePropertySourceLocator.locate(environment);
LogUtil.start("config propertySource:" + propertySource.getName());
for (PropertySource ps : ((CompositePropertySource) propertySource).getPropertySources()) {
LogUtil.start(ps.getName() + ":" + ((MapPropertySource) ps).getSource());
}
return propertySource;
}
}
| [
"125767187@qq.com"
] | 125767187@qq.com |
da88d4f373bf6a5ff43f5a65f997aaee6c642a40 | b3ec06fab450ac371b78298bc9992f5b2f722638 | /src/main/java/af/gov/anar/query/adhocquery/service/AdHocScheduledJobRunnerService.java | 94339c7351bb0005c5bb9d96f60faaddbb1711a3 | [] | no_license | Anar-Framework/anar-adhocquery | ca349d97755dbb6322dd376afa53e33474c2d593 | 329d5d706cb03802a4ef69ad773ba184f00ded0d | refs/heads/master | 2020-12-21T02:23:05.395941 | 2020-02-05T04:30:15 | 2020-02-05T04:30:15 | 236,278,110 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 135 | java |
package af.gov.anar.query.adhocquery.service;
public interface AdHocScheduledJobRunnerService {
void generateClientSchedule();
}
| [
"mohammadbadarhashimi@gmail.com"
] | mohammadbadarhashimi@gmail.com |
6a39bc72aed57e42bdc1ffb41d9934b3304d739f | 102aa70d26d9a18fe9cad796e3f99af0859ca2e4 | /photoview/src/main/java/cn/finalteam/rxgalleryfinal/interactor/impl/MediaBucketFactoryInteractorImpl.java | 635b2c90d692ce37d4cdc7fe783c2a297cf32bf7 | [] | no_license | imyetse/TopWerewolf | cfad1bd3c73d9c08eec4e42cbd9da6e0ebb81537 | f7118761dc8c65fd2d23fb5861906e6bad789484 | refs/heads/master | 2021-01-20T14:58:31.307478 | 2017-06-18T15:58:03 | 2017-06-18T15:58:03 | 90,696,233 | 34 | 13 | null | null | null | null | UTF-8 | Java | false | false | 2,009 | java | package cn.finalteam.rxgalleryfinal.interactor.impl;
import android.content.Context;
import java.util.List;
import cn.finalteam.rxgalleryfinal.bean.BucketBean;
import cn.finalteam.rxgalleryfinal.interactor.MediaBucketFactoryInteractor;
import cn.finalteam.rxgalleryfinal.utils.MediaUtils;
import rx.Observable;
import rx.Observer;
import rx.android.schedulers.AndroidSchedulers;
import rx.schedulers.Schedulers;
/**
* Desction:
* Author:pengjianbo
* Date:16/7/4 下午8:29
*/
public class MediaBucketFactoryInteractorImpl implements MediaBucketFactoryInteractor {
private Context context;
private boolean isImage;
private OnGenerateBucketListener onGenerateBucketListener;
public MediaBucketFactoryInteractorImpl(Context context, boolean isImage, OnGenerateBucketListener onGenerateBucketListener) {
this.context = context;
this.isImage = isImage;
this.onGenerateBucketListener = onGenerateBucketListener;
}
@Override
public void generateBuckets() {
Observable.create((Observable.OnSubscribe<List<BucketBean>>) subscriber -> {
List<BucketBean> bucketBeanList = null;
if(isImage) {
bucketBeanList = MediaUtils.getAllBucketByImage(context);
} else {
bucketBeanList = MediaUtils.getAllBucketByVideo(context);
}
subscriber.onNext(bucketBeanList);
subscriber.onCompleted();
})
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<List<BucketBean>>() {
@Override
public void onCompleted() {
}
@Override
public void onError(Throwable e) {
onGenerateBucketListener.onFinished(null);
}
@Override
public void onNext(List<BucketBean> bucketBeanList) {
onGenerateBucketListener.onFinished(bucketBeanList);
}
});
}
}
| [
"imyetse@163.com"
] | imyetse@163.com |
8a6eb4635b7ca4f5663887d41b000c059c7c47ee | dec4a846475ca996df07d8d404a364f9fa9436a9 | /src/main/java/me/minikuma/week5/Circle.java | 4ad82d4700910c954c98fc660a323ff5440de3fe | [] | no_license | minikuma/study-halle | 7eeb56a93f4a4efc6a21e7247098ea5a247dd8bd | 5c6b4d89d670b2038deadd36a29038641e7646f9 | refs/heads/master | 2023-07-17T04:28:05.269751 | 2021-08-30T07:18:19 | 2021-08-30T07:18:19 | 321,232,004 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 388 | java | package me.minikuma.week5;
public class Circle {
// 인스턴스 필드
public double r;
// 생성자
public Circle(double r) {
this.r = r;
}
public static void main(String[] args) {
Circle circle = new Circle(100);
circle.r = 100;
System.out.println("객체 생성 후 인스턴스 필드에 값 적용 = " + circle.r);
}
}
| [
"minikuma@naver.com"
] | minikuma@naver.com |
0ecec00f585912d5da2653294d62c4d07940edda | 673a0acef3adad5479302565be2584482052c44b | /API/guillegramAPI/src/main/java/guille/guillegram/api/GuillegramApiApplication.java | 2bb87bf4ad91938d06b3b5ba9b916ae344fee6c6 | [] | no_license | ekzGuille/Guillegram | c303a58a7243f94a7143a784261f88203829ff56 | eb596d0e68427ead49626a9f3a39df394d2ad646 | refs/heads/master | 2020-04-23T18:02:03.837917 | 2019-04-19T11:35:29 | 2019-04-19T11:35:29 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 328 | java | package guille.guillegram.api;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class GuillegramApiApplication {
public static void main(String[] args) {
SpringApplication.run(GuillegramApiApplication.class, args);
}
}
| [
"guillermosesesantos@hotmail.com"
] | guillermosesesantos@hotmail.com |
83ced2bb88ae309706affb5a6d6ce942d4674b24 | f741d0932cc199c4fc29e18e10e1d274e4d7ed5a | /src/gui/NewsAggregatorGUI.java | 668f3541e1b1227b3250453f48d051421fe07b29 | [] | no_license | cchun319/Aggregator | 6aa861b7d7bd015c471a47dff4026837d8920742 | 8720cbfc79849ad3ddfb72bdee889fb7d2c2aee1 | refs/heads/master | 2023-01-03T18:05:29.189064 | 2020-11-01T03:04:04 | 2020-11-01T03:04:04 | 290,331,237 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,834 | java | package gui;
import java.awt.BorderLayout;
import java.awt.Desktop;
import java.awt.EventQueue;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.NavigableMap;
import java.util.NavigableSet;
import java.util.Map.Entry;
import javax.swing.DefaultListModel;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import indexing.IIndexBuilder;
import indexing.IndexBuilder;
/**
* @author ericfouh
*/
public class NewsAggregatorGUI
{
private JFrame frame;
private AutocompletePanel searchBox;
private JComboBox rssBox;
private IIndexBuilder idxBuilder;
public static final String[] rssUrls =
{ "https://rss.nytimes.com/services/xml/rss/nyt/US.xml",
"http://feeds.washingtonpost.com/rss/rss_powerpost",
"http://rss.cnn.com/rss/cnn_us.rss",
"http://feeds.foxnews.com/foxnews/latest",
"http://feeds.bbci.co.uk/news/world/rss.xml",
"http://rss.cnn.com/rss/cnn_topstories.rss",
"http://localhost:8090/sample_rss_feed.xml" };
/**
*
*/
private Map<?, ?> invIdx;
private boolean autocomplete = false;
/**
* Launch the application.
*/
public static void main(String[] args)
{
EventQueue.invokeLater(new Runnable() {
public void run()
{
try
{
NewsAggregatorGUI window = new NewsAggregatorGUI();
window.frame.setVisible(true);
}
catch (Exception e)
{
e.printStackTrace();
}
}
});
}
/**
* Create the application.
*/
public NewsAggregatorGUI()
{
initialize();
}
private void initRSSList()
{
idxBuilder = new IndexBuilder();
rssBox = new JComboBox(rssUrls);
rssBox.setSelectedIndex(0);
}
/**
* Initialize the contents of the frame.
*/
private void initialize()
{
frame = new JFrame();
frame.setBounds(100, 100, 450, 600);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().setLayout(null);
JButton btnSearch = new JButton("Search");
btnSearch.setBounds(350, 135, 90, 30);
btnSearch.setEnabled(false);
frame.getContentPane().add(btnSearch);
DefaultListModel<String> articlesList = new DefaultListModel<String>();
JList results = new JList(articlesList);
// results.setBounds(0, 270, 450, 300);
JScrollPane scrollPane = new JScrollPane();
scrollPane.setViewportView(results);
results.setLayoutOrientation(JList.VERTICAL);
scrollPane.setVisible(true);
JPanel panel = new JPanel(new BorderLayout());
panel.add(scrollPane);
panel.setBounds(0, 270, 450, 300);
frame.add(panel);
initRSSList();
rssBox.setBounds(0, 0, 350, 27);
frame.getContentPane().add(rssBox);
JButton btnAddRSS = new JButton("Add RSS");
btnAddRSS.setBounds(350, 1, 90, 29);
frame.getContentPane().add(btnAddRSS);
JButton btnIndex = new JButton("Create Indexes");
btnIndex.setBounds(0, 32, 117, 29);
btnIndex.setEnabled(false);
frame.getContentPane().add(btnIndex);
JButton btnHome = new JButton("Home Page");
btnHome.setBounds(129, 32, 117, 29);
btnHome.setEnabled(false);
frame.getContentPane().add(btnHome);
JButton btnAutoCplt = new JButton("Autocomplete");
btnAutoCplt.setToolTipText("Update autocomplete file");
btnAutoCplt.setBounds(250, 32, 117, 29);
btnAutoCplt.setEnabled(false);
frame.getContentPane().add(btnAutoCplt);
searchBox = new AutocompletePanel("./src/autocomplete.txt");
searchBox.setBounds(0, 135, 350, 130);
searchBox.setVisible(true);
frame.getContentPane().add(searchBox);
DefaultListModel listModel = new DefaultListModel();
JList rssList = new JList(listModel);
rssList.setToolTipText("News Sources");
rssList.setEnabled(false);
rssList.setBounds(10, 59, 350, 75);
frame.getContentPane().add(rssList);
// add RSS
btnAddRSS.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e)
{
btnIndex.setEnabled(true);
String selected = (String)rssBox.getSelectedItem();
if (!listModel.contains(selected))
{
// limit 4 sources
if (listModel.size() == 4)
{
listModel.remove(0);
}
listModel.addElement(selected);
}
}
});
// index building
btnIndex.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e)
{
// Convert listmodel to a List
List<String> feeds = new ArrayList<>(listModel.size());
for (int i = 0; i < listModel.size(); i++)
feeds.add((String)listModel.get(i));
Map<String, List<String>> map = idxBuilder.parseFeed(feeds);
Map<String, Map<String, Double>> index =
idxBuilder.buildIndex(map);
invIdx = idxBuilder.buildInvertedIndex(index);
btnHome.setEnabled(true);
btnSearch.setEnabled(true);
btnAutoCplt.setEnabled(true);
}
});
// Home page
btnHome.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e)
{
Map<String, List<Entry<String, Double>>> articles =
(Map<String, List<Entry<String, Double>>>)invIdx;
Collection<Entry<String, List<String>>> home =
(Collection<Entry<String, List<String>>>)idxBuilder
.buildHomePage(invIdx);
if (home.size() > 0)
{
articlesList.clear();
}
Iterator<Entry<String, List<String>>> iter = home.iterator();
while (iter.hasNext())
{
Entry<String, List<String>> entry = iter.next();
articlesList.addElement(entry.getKey());
for (String url : entry.getValue())
articlesList.addElement("\t\t" + url);
}
}
});
// Autocomplete
btnAutoCplt.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e)
{
idxBuilder
.createAutocompleteFile(idxBuilder.buildHomePage(invIdx));
searchBox = new AutocompletePanel("./src/autocomplete.txt");
}
});
// search
btnSearch.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e)
{
String query = searchBox.getSearchText();
if (query.length() > 0)
{
List<String> articles =
idxBuilder.searchArticles(query, invIdx);
if (articles != null && articles.size() > 0)
{
articlesList.clear();
articlesList.addElement(query);
for (String url : articles)
articlesList.addElement("\t\t" + url);
}
}
}
});
// clickable results
results.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent evt)
{
JList list = (JList)evt.getSource();
if (evt.getClickCount() == 1)
{
// index of the article
int index = list.locationToIndex(evt.getPoint());
String url = articlesList.get(index);
URI uriAddress;
try
{
URI uri = new URI(url.trim());
if (url.contains("http://"))
Desktop.getDesktop().browse(uri);
}
catch (UnsupportedEncodingException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
catch (URISyntaxException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
catch (IOException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
});
}
}
| [
"chun3@seas.upenn.edu"
] | chun3@seas.upenn.edu |
f653574d868288835dbd21a90cf136183eef1e5d | 6476f66243ec0d4259de3a2fde69e89c45c7f880 | /src/day07nestedif/NestedIf01.java | aaaddcafbe9c533eca7d6d86b30a15d902cd8544 | [] | no_license | osaykan/dersler | 94ddb286554fbbfd1d8ffc48bea3cf030041ed1b | 90f5f306e0e58cb4b66468e2abf76169a42d980c | refs/heads/main | 2023-04-05T05:06:44.608832 | 2021-04-17T12:17:55 | 2021-04-17T12:17:55 | 289,004,960 | 0 | 0 | null | null | null | null | ISO-8859-3 | Java | false | false | 924 | java | package day07nestedif;
import java.util.Scanner;
public class NestedIf01 {
public static void main(String[] args) {
// Kullanicidan bir sayi alin. Bu sayi pozitif ise 9 dan buyukmu diye kontrol rdin, 9 dan büyükse ekrana sayi yazdirin
// 9 dan kücükesit ve sifirdan büyük esitse ekrana rakam yazdirin.
// Bu sayi negatif ise ekrana Sayi yazdirin.
Scanner scan = new Scanner(System.in);
System.out.println("Bir Tamsayi giriniz");
int num = scan.nextInt();
if(num>=0){ // Outer if
if(num>9){ // Inner if
System.out.println("Sayi");
}
else if(num<=9 && num>=0){
System.out.println("Rakam");
}
}
else if(num<0){
System.out.println("Sayi");
}
scan.close();//Scanner class ini kullandiktan sonra en alta main metodunun icinde Scanner class ini kapatiniz. Bunun icin scan.close yazilir.
}
}
| [
"osmanaykan34@gmail.com"
] | osmanaykan34@gmail.com |
db1c8cec8358ead427e355c1882411e0d6cfb760 | de487688683fff63903753d9a57467e37e6fad6e | /springBootLearning/src/main/java/com/springbootlearning/config/MvcConfig.java | 42014576bbcba545527b1357682654da79b2fb30 | [] | no_license | kindnessiliy/learningSSM | 5d5b78037bfba1d2cf16d50736e230961289d514 | 429ac910429d12e1b2e6265ab2d0ab4774f1c90d | refs/heads/master | 2023-01-30T03:52:27.097082 | 2020-12-07T14:49:31 | 2020-12-07T14:49:31 | 315,514,827 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 845 | java | package com.springbootlearning.config;
import com.springbootlearning.interceptor.MyInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
/**
* @author:zyh
* @Time:2020-11-22-16:13
* @email:1269231889@qq.com
*/
@Configuration
public class MvcConfig implements WebMvcConfigurer {
//注册拦截器
@Bean
public MyInterceptor myInterceptor(){
return new MyInterceptor();
}
//添加拦截器到拦截连
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(myInterceptor()).addPathPatterns("/*");
}
}
| [
"1269231889@qq,com"
] | 1269231889@qq,com |
0d0c6e099c17ab70243d2851a21924afaa39d88b | 09b178bbf6257a453c1e9283e9200b32e756ad11 | /src/main/java/com/steven/tmt/domain/IsHeadOf.java | d32f566775b41b134b581c29e48f306494f8ae0d | [] | no_license | VDSteven/tmt | e482524dae10e1dcf8e78b368dec0150681ed9b5 | 8fdc74405fa931b399aee0aa4856116a5464d5fb | refs/heads/master | 2021-01-19T10:42:01.607381 | 2017-02-16T16:45:14 | 2017-02-16T16:45:14 | 82,201,022 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,959 | java | package com.steven.tmt.domain;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.io.Serializable;
import java.util.Objects;
/**
* A IsHeadOf.
*/
@Entity
@Table(name = "is_head_of", uniqueConstraints = @UniqueConstraint(columnNames = {"head_id", "employee_id"}))
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public class IsHeadOf implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@ManyToOne(optional = false)
@NotNull
private User head;
@ManyToOne(optional = false)
@NotNull
private User employee;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public User getHead() {
return head;
}
public IsHeadOf head(User user) {
this.head = user;
return this;
}
public void setHead(User user) {
this.head = user;
}
public User getEmployee() {
return employee;
}
public IsHeadOf employee(User user) {
this.employee = user;
return this;
}
public void setEmployee(User user) {
this.employee = user;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
IsHeadOf isHeadOf = (IsHeadOf) o;
if (isHeadOf.id == null || id == null) {
return false;
}
return Objects.equals(id, isHeadOf.id);
}
@Override
public int hashCode() {
return Objects.hashCode(id);
}
@Override
public String toString() {
return "IsHeadOf{" +
"id=" + id +
'}';
}
}
| [
"vsteven@student.ethz.ch"
] | vsteven@student.ethz.ch |
b208a1682ded1d5b7c4a5a405daf19f0affe50e7 | 8552a3dee9193ceca22f83aca9655332a34adf56 | /Cloud_Storage/src/index/Repo_Upload.java | be0126c36bb29988af06ec0f7583a42c48344874 | [] | no_license | sharmarahul25/Cloud_storage | e8e79efa2c1a6f2b87275325218d3b8d1ef6a469 | 74d9fbacbc4ef7abc3264650380aa6c024683b0e | refs/heads/master | 2021-01-23T06:39:31.201691 | 2014-03-21T10:25:33 | 2014-03-21T10:25:33 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,740 | java | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package index;
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.awt.Font;
import java.io.File;
import java.io.IOException;
import java.sql.*;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.apache.commons.net.ftp.FTPClient;
/**
*
*
*/
public class Repo_Upload {
JFrame f1=new JFrame("Upload in Repesitory");
JLabel l1=new JLabel("Name");
JLabel l2=new JLabel("Type");
JLabel l3=new JLabel("Subject");
JLabel l4=new JLabel("Browse");
JLabel l5=new JLabel("Share with");
String sub[] = {"DAA","OS","ELE","DSA","OOM","OOT","NETWORKING","EWS","DBMS","CCS","DCO"};
String type[] = {"Codes","Assingments","Notes","PPTs","Others"};
JTextField t1=new JTextField();
JComboBox t2=new JComboBox(type);
JComboBox t3=new JComboBox(sub);
JTextField t4=new JTextField();
JComboBox t5=new JComboBox();
JButton b4=new JButton("Browse");
JButton bu=new JButton("Upload");
String path1,path2,str,ex=null,name=null;
String s1="ftp://172.16.1.1/Upload/";
String id,ss1,ss2,ss3,ss4,ss5,ss6,ss7;
int il,il1,cc=0;
String ad;
Statement stat;
ResultSet rs;
public Repo_Upload(String admin){
ad=admin;
Container content = f1.getContentPane();
content.setBackground(Color.WHITE);
f1.setIconImage(Toolkit.getDefaultToolkit().getImage("logo.jpg"));
f1.setBounds(100,100,800,600);
f1.setLayout(null);
l1.setBounds(20,20,100,30);
t1.setBounds(120,20,400,30);
l2.setBounds(20,60,100,30);
t2.setBounds(120,60,200,30);
l3.setBounds(20,110,100,30);
t3.setBounds(120,110,200,30);
l4.setBounds(20,150,100,30);
t4.setBounds(120,150,400,30);
l5.setBounds(20,200,100,30);
t5.setBounds(120,200,150,30);
b4.setBounds(540,150,100,30);
bu.setBounds(250,240,200,40);
//
connection con1=new connection();
con1.createconnectn();
String s;
try
{
stat = con1.con.createStatement();
//s=group.getText();
rs=stat.executeQuery("select grp_name from groupmem where(mem_id='"+ad+"')");
}
catch (SQLException fe)
{
System.err.println("actionpermd(): SQLException: " + fe.getMessage());
}
try
{
int c=0;
String pa=null;
t5.addItem("Public");
while(rs.next())
{
pa=rs.getString("grp_name");
if(pa!=null)
{
t5.addItem(pa);
}
}
}
catch (SQLException fe)
{
System.err.println("actionpermd(): SQLException: " + fe.getMessage());
}
//}
//
b4.addActionListener(new ActionListener(){
@Override
public void actionPerformed(ActionEvent e){
JFileChooser chooser = new JFileChooser();
chooser.showOpenDialog(null);
File f = chooser.getSelectedFile();
path1 = f.getPath();
t4.setText(path1);
}
});
bu.addActionListener(new ActionListener(){
@Override
public void actionPerformed(ActionEvent e){
FTPClient f=new FTPClient();
FTPUtils u=new FTPUtils();
try {
u.ftpConnect(f,"172.16.1.1","anonymous","");
System.out.println("logged in");
} catch (IOException ex) {
Logger.getLogger(Movies_Upload.class.getName()).log(Level.SEVERE, null, ex);
}
id=ad+System.currentTimeMillis();
path1=t4.getText();
if(!"".equals(path1))
{ cc=0;
for(il=path1.length()-1;il>=0;il--)
{
if(path1.charAt(il)=='.')
break;
}
ex=path1.substring(il,path1.length());
}
else
{JOptionPane.showMessageDialog(null,"Select file");
cc=1;
}
ss5=t1.getText();
if("".equals(ss5))
{
cc=1;
JOptionPane.showMessageDialog(null,"Enter file Name");
}
try {
if(cc!=1)
{
u.uploadFile(f,path1,s1,id+ex);
JOptionPane.showMessageDialog(null,"File Uploaded");
}
//System.out.println("logged in");
} catch (IOException ex) {
Logger.getLogger(Movies_Upload.class.getName()).log(Level.SEVERE, null, ex);
}
connection con1=new connection();
con1.createconnectn();
try
{
stat = con1.con.createStatement();
ss1=t1.getText();
ss2=(String)t2.getSelectedItem();
ss3=(String)t3.getSelectedItem();
ss4=s1+id+ex;
ss5=(String)t5.getSelectedItem();
if(cc!=1)
rs=stat.executeQuery("insert into Repo values('"+id+"','"+ss1+"','"+ss2+"','"+ss3+"','"+ss4+"','"+ss5+"')");
}
catch (SQLException fe)
{
System.err.println("actionpermd(): SQLException: " + fe.getMessage());
}
id=null;
ss6=null;
ss7=null;
s1="ftp://172.16.1.1/Repository/";
}
});
//
f1.add(l1);
f1.add(l2);
f1.add(l3);
f1.add(l4);
f1.add(t1);
f1.add(t2);
f1.add(t3);
f1.add(l5);
f1.add(t5);
f1.add(t4);
f1.add(b4);
f1.add(bu);
f1.setVisible(true);
}
}
| [
"sharma.rahul2509@gmail.com"
] | sharma.rahul2509@gmail.com |
3a6cc911fa5d2e2811a5faa2f984fa3dc2ec9fad | 3c171b3e1a68fadc2883ca41a2d1083484a4f6f4 | /GraphCaculor/src/yty.java | ea0e12049104f0ca44fe096d8af9485e9d8c5e89 | [] | no_license | 1xwb/nihao | a35a4628351d8b6818d33555f3203fffdd1995e1 | 0042aaf044832f4f432fcfd4face7cfecebd526b | refs/heads/master | 2020-05-15T22:13:08.290439 | 2019-04-21T11:12:47 | 2019-04-21T11:12:47 | 182,521,007 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 37 | java |
public class yty {
//你好
}
| [
"1053968252@qq.com"
] | 1053968252@qq.com |
490f2b0293b3bdd88a6724b2b9e58a193c415b0d | 55f518a56976bdc2c84dc221874ed7dfc0eb04f5 | /src/main/java/org/embulk/input/marketo/MarketoService.java | 04da12f1a5080abc59a2ac2929e4a2e4ae41af68 | [
"MIT"
] | permissive | biyanna1985/embulk-input-marketo | 8dfeee2eb52655e34eb2422e9636a317f0b69357 | eefac2f80ae68d3fc3f482dd6c71a3c71164fe05 | refs/heads/master | 2020-03-25T19:15:28.901369 | 2018-05-28T15:59:33 | 2018-05-28T15:59:33 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 789 | java | package org.embulk.input.marketo;
import com.fasterxml.jackson.databind.node.ObjectNode;
import org.embulk.input.marketo.model.MarketoField;
import java.io.File;
import java.util.Date;
import java.util.List;
/**
* Created by tai.khuu on 9/6/17.
*/
public interface MarketoService
{
List<MarketoField> describeLead();
File extractLead(Date startTime, Date endTime, List<String> extractedFields, String filterField, int pollingTimeIntervalSecond, int bulkJobTimeoutSecond);
File extractAllActivity(Date startTime, Date endTime, int pollingTimeIntervalSecond, int bulkJobTimeoutSecond);
Iterable<ObjectNode> getAllListLead(List<String> extractFields);
Iterable<ObjectNode> getAllProgramLead(List<String> extractFields);
Iterable<ObjectNode> getCampaign();
}
| [
"khuutantai@gmail.com"
] | khuutantai@gmail.com |
521d0a1c31635d2d06d54ff5f0a68fd015658d2e | acdb5af316a9ffe905c43fe1c06ecd2fd2959fad | /order/order-consumer/src/main/java/com/imooc/order/consumer/dataobject/OrderDetail.java | 8e00bfa690c27b6b865103d922653fb3422efe48 | [
"Apache-2.0"
] | permissive | huluobo11/spring-cloud-demo | c3b9fbf3d69d2fce4347f775d6c5269c99968044 | 13d0929d09fc9265f97ebb77c8a4492dddb6f8f2 | refs/heads/master | 2020-04-04T23:00:05.391550 | 2019-04-05T10:15:41 | 2019-04-05T10:15:41 | 156,343,604 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 525 | java | package com.imooc.order.consumer.dataobject;
import lombok.Data;
import javax.persistence.Entity;
import javax.persistence.Id;
import java.math.BigDecimal;
import java.util.Date;
@Data
@Entity
public class OrderDetail {
@Id
private String detailId;
private String orderId;
private String productId;
private String productName;
private BigDecimal productPrice;
private Integer productQuantity;
private String productIcon;
private Date createTime;
private Date updateTime;
}
| [
"15136129644@139.com"
] | 15136129644@139.com |
3c3eeb3e9e9ab6d9c75fab7ba1735e3ef1619fb0 | 37af4fa993a86b4cbc00486acc72adb4eff1225f | /iorx/src/main/java/ubiquisense/iorx/protocols/ableton/internal/impl/LiveReturnVolumeImpl.java | dd08c234cfb919325615285fdaf820e84c001874 | [] | no_license | lucascraft/iorx | 3880a6cfb990d61bf4e506424f5ea1a59f3085e3 | d94fcbe57677b420b49e968c859aa766c014e9b9 | refs/heads/master | 2021-07-22T18:58:13.396550 | 2019-12-02T22:42:35 | 2019-12-02T22:42:35 | 119,903,510 | 0 | 0 | null | 2021-06-04T01:01:22 | 2018-02-01T22:52:37 | HTML | UTF-8 | Java | false | false | 606 | java | /**
* <copyright>
* </copyright>
*
* $Id$
*/
package ubiquisense.iorx.protocols.ableton.internal.impl;
import ubiquisense.iorx.protocols.ableton.internal.LiveReturnVolume;
public class LiveReturnVolumeImpl extends AbletonLiveSndCmdImpl implements LiveReturnVolume {
int trackID;
float level;
public LiveReturnVolumeImpl() {
super();
}
public int getTrackID() {
return trackID;
}
public void setTrackID(int newTrackID) {
trackID = newTrackID;
}
public float getLevel() {
return level;
}
public void setLevel(float newLevel) {
level = newLevel;
}
} //LiveReturnVolumeImpl
| [
"lucas@LAPTOP-2SKH5AVA"
] | lucas@LAPTOP-2SKH5AVA |
1bab62ee60b8c54bb1e8b0ef39e9795aafef072e | 61bb0909755750788322b41c7763bd06993e4add | /src/monitorizacionInversa/Services.java | 1c1df94405b261e9f1c72554598d9e5a547e270f | [] | no_license | rvipas/servidorXML-RCP | d657cae48a2a8e5339a587c14198a1008131440b | 77d0a1a852000e766c189725cca1d94c93728264 | refs/heads/master | 2021-01-23T01:01:53.720796 | 2017-03-22T19:07:04 | 2017-03-22T19:07:04 | 85,865,871 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 183 | java | package monitorizacionInversa;
import java.util.Date;
public interface Services {
public void notifica(String msg);
public boolean inserta(String ident, Date fecha);
}
| [
"rvidal8.7@gmail.com"
] | rvidal8.7@gmail.com |
6e94a0b6f80daabb13dc07e033de494166edf52c | 7aadd1f4959512a4646e13e96b2193672dd9ad55 | /MementoPattern/src/com/MementoPattern/Main.java | 0603a5f8b0ad1567148714c7f45ef969d9621c5c | [] | no_license | jungle8884/DesignPattern_Code | 42c2c5d99c0750c0f59dec005b55c4d55ed8ba98 | 8d7533b55cc9bded62a02d95967faf7a463b2d52 | refs/heads/master | 2022-09-29T22:21:57.233188 | 2020-06-08T16:03:03 | 2020-06-08T16:03:03 | 263,634,520 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 598 | java | package com.MementoPattern;
import com.MementoPattern.sample.Caretaker;
import com.MementoPattern.sample.Originator;
public class Main {
public static void main(String[] args) {
// sample code
{
Originator o = new Originator();
o.setState("On");
o.Show();
Caretaker c = new Caretaker();
c.setMemento(o.CreateMemento());//保存备忘录---状态
o.setState("Off");//状态改变
o.Show();
o.SetMemento(c.getMemento());//恢复原始状态
o.Show();
}
}
}
| [
"jungle8884@163.com"
] | jungle8884@163.com |
83a4dd15a3c08450a26ff50fbcab01a0fc89425d | d43a62d1af37d378d9d88bed16568214a923f2cf | /portal/src/main/java/usi/dbdp/portal/sysmgr/controller/LogController.java | 3d44461d7bc1deefbafe92e96bfe10245da202b2 | [
"MIT"
] | permissive | pyplzy/mylab | 2a9d11763b483a7899152a336420a415cb6c570c | c3a897f217d871f3d66e15d0ebbc3325a4ec8910 | refs/heads/master | 2023-06-08T16:05:13.904405 | 2021-06-29T10:33:21 | 2021-06-29T10:33:21 | 290,156,687 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,051 | java | package usi.dbdp.portal.sysmgr.controller;
import java.util.Date;
import java.util.Map;
import javax.annotation.Resource;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import usi.dbdp.portal.dto.ChangeLogInfo;
import usi.dbdp.portal.entity.LoginLog;
import usi.dbdp.portal.sysmgr.service.LogService;
import usi.dbdp.portal.util.CommonUtil;
import usi.dbdp.uic.dto.PageObj;
/**
* 登录日志和信息变更日志查询
* @author lmwang
* 创建时间:2015-4-16 下午9:09:22
*/
@Controller
@RequestMapping("/log")
public class LogController {
@Resource
private LogService logService;
/**
* 到日志查询页面
* @param model
* @return
*/
@RequestMapping(value="/menu_to_toMenu.do", method = RequestMethod.GET)
public String toMenu(Model model){
//日期输入框默认今天
model.addAttribute("today", CommonUtil.format(new Date(), "yyyy-MM-dd"));
model.addAttribute("todayStart", CommonUtil.format(new Date(), "yyyy-MM-dd")+" 00:00:00");
model.addAttribute("todayEnd", CommonUtil.format(new Date(), "yyyy-MM-dd")+" 23:59:59");
return "portal/system/logQuery";
}
/**
* 查询登录日志
* @param loginLog 登录日志
* @param pageObj
* @return
*/
@RequestMapping(value="/menu_to_getLoginLogs.do", method = RequestMethod.POST)
@ResponseBody
public Map<String , Object > getLoginLog(LoginLog loginLog ,PageObj pageObj){
return logService.getUicLoginLogInfo(loginLog, pageObj);
}
/**
* 查询信息变更日志
* @param changeLogInfo 信息变更日志dto
* @param pageObj 分页对象
* @return
*/
@RequestMapping(value="/menu_to_getChgLogs.do", method = RequestMethod.POST)
@ResponseBody
public Map<String , Object > getChangeLog(ChangeLogInfo changeLogInfo, PageObj pageObj){
return logService.getUicChangeLogInfo(changeLogInfo, pageObj);
}
}
| [
"peiyapengqinshuche@163.com"
] | peiyapengqinshuche@163.com |
6e8ecfe6cf2bed7cdcafd3534318a45e068184e3 | c5b7ac300801614f5d6694f5973e0c5184e20f84 | /ExJava/Frutas/src/Frutas.java | bc33fc8d4972bf013452df85ce984aef0b9a04cb | [] | no_license | 1234Vinicius/Java-Concept | b32e12e3f2d3aeda4c49afbcb0af876b6e891294 | b69428e2dab11bf3998dd6742660fb0d54a77848 | refs/heads/main | 2023-08-18T19:36:30.808252 | 2021-10-06T15:31:18 | 2021-10-06T15:31:18 | 413,631,012 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 150 | java |
public class Frutas {
private String carro;
private String modelo;
private boolean anda;
}
}
| [
"99887799vinicius@gmail.com"
] | 99887799vinicius@gmail.com |
faf53a868c41cd0ccd630aaa292e1b05a9a8d6b4 | 5ec06dab1409d790496ce082dacb321392b32fe9 | /clients/spring/generated/src/main/java/org/openapitools/model/ComAdobeGraniteSocialgraphImplSocialGraphFactoryImplInfo.java | 8ae8a2b0f7986254dc20af7221d187901eeaf6a0 | [
"Apache-2.0"
] | permissive | shinesolutions/swagger-aem-osgi | e9d2385f44bee70e5bbdc0d577e99a9f2525266f | c2f6e076971d2592c1cbd3f70695c679e807396b | refs/heads/master | 2022-10-29T13:07:40.422092 | 2021-04-09T07:46:03 | 2021-04-09T07:46:03 | 190,217,155 | 3 | 3 | Apache-2.0 | 2022-10-05T03:26:20 | 2019-06-04T14:23:28 | null | UTF-8 | Java | false | false | 4,336 | java | package org.openapitools.model;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.openapitools.model.ComAdobeGraniteSocialgraphImplSocialGraphFactoryImplProperties;
import javax.validation.Valid;
import javax.validation.constraints.*;
/**
* ComAdobeGraniteSocialgraphImplSocialGraphFactoryImplInfo
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2019-08-05T01:13:37.880Z[GMT]")
public class ComAdobeGraniteSocialgraphImplSocialGraphFactoryImplInfo {
@JsonProperty("pid")
private String pid = null;
@JsonProperty("title")
private String title = null;
@JsonProperty("description")
private String description = null;
@JsonProperty("properties")
private ComAdobeGraniteSocialgraphImplSocialGraphFactoryImplProperties properties = null;
public ComAdobeGraniteSocialgraphImplSocialGraphFactoryImplInfo pid(String pid) {
this.pid = pid;
return this;
}
/**
* Get pid
* @return pid
**/
@ApiModelProperty(value = "")
public String getPid() {
return pid;
}
public void setPid(String pid) {
this.pid = pid;
}
public ComAdobeGraniteSocialgraphImplSocialGraphFactoryImplInfo title(String title) {
this.title = title;
return this;
}
/**
* Get title
* @return title
**/
@ApiModelProperty(value = "")
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public ComAdobeGraniteSocialgraphImplSocialGraphFactoryImplInfo description(String description) {
this.description = description;
return this;
}
/**
* Get description
* @return description
**/
@ApiModelProperty(value = "")
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public ComAdobeGraniteSocialgraphImplSocialGraphFactoryImplInfo properties(ComAdobeGraniteSocialgraphImplSocialGraphFactoryImplProperties properties) {
this.properties = properties;
return this;
}
/**
* Get properties
* @return properties
**/
@ApiModelProperty(value = "")
@Valid
public ComAdobeGraniteSocialgraphImplSocialGraphFactoryImplProperties getProperties() {
return properties;
}
public void setProperties(ComAdobeGraniteSocialgraphImplSocialGraphFactoryImplProperties properties) {
this.properties = properties;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ComAdobeGraniteSocialgraphImplSocialGraphFactoryImplInfo comAdobeGraniteSocialgraphImplSocialGraphFactoryImplInfo = (ComAdobeGraniteSocialgraphImplSocialGraphFactoryImplInfo) o;
return Objects.equals(this.pid, comAdobeGraniteSocialgraphImplSocialGraphFactoryImplInfo.pid) &&
Objects.equals(this.title, comAdobeGraniteSocialgraphImplSocialGraphFactoryImplInfo.title) &&
Objects.equals(this.description, comAdobeGraniteSocialgraphImplSocialGraphFactoryImplInfo.description) &&
Objects.equals(this.properties, comAdobeGraniteSocialgraphImplSocialGraphFactoryImplInfo.properties);
}
@Override
public int hashCode() {
return Objects.hash(pid, title, description, properties);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ComAdobeGraniteSocialgraphImplSocialGraphFactoryImplInfo {\n");
sb.append(" pid: ").append(toIndentedString(pid)).append("\n");
sb.append(" title: ").append(toIndentedString(title)).append("\n");
sb.append(" description: ").append(toIndentedString(description)).append("\n");
sb.append(" properties: ").append(toIndentedString(properties)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
| [
"cliffano@gmail.com"
] | cliffano@gmail.com |
e771270cbd142c44c64bf287323a9dc6c0f7235b | c3f860040de95cd91e9c5f54175a0eccc7d9a520 | /Prova/app/src/main/java/simulado/jeansarlon/prova/tela2.java | 598e33525e51d6fb282854f85730362167e68ccf | [] | no_license | jeansarlon/Android | a1fedc7cc77b5dc4813f5455aee4dcbfc5092b18 | fde99536a36d201be2c6a7dead65572343ba562d | refs/heads/master | 2021-05-08T00:53:58.472856 | 2017-10-22T00:05:51 | 2017-10-22T00:05:51 | 107,824,722 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,226 | java | package simulado.jeansarlon.prova;
import android.content.SharedPreferences;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
public class tela2 extends AppCompatActivity {
private static final String NOME_PREFS = "preferencias";
TextView tvNome;
TextView tvEmail;
ImageView ivTime;
Button btSalvar;
Button btFechar;
String nome;
String email;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_tela2);
tvNome = (TextView) findViewById(R.id.tvNome);
tvEmail = (TextView) findViewById(R.id.tvEmail);
ivTime = (ImageView) findViewById(R.id.ivFoto);
btSalvar = (Button) findViewById(R.id.btSalvar);
btFechar = (Button) findViewById(R.id.btFechar);
final Bundle extras = getIntent().getExtras();
if (extras != null){
nome = extras.getString("nome", "Não veio");
email = extras.getString("email", "Não veio");
int time = extras.getInt("time", 0);
tvNome.setText(nome);
tvEmail.setText(email);
if (time == 1) {
ivTime.setImageResource(R.drawable.gremio);
}else{
ivTime.setImageResource(R.drawable.inter);
}
}
btSalvar.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
SharedPreferences prefs = getSharedPreferences(NOME_PREFS, 0);
SharedPreferences.Editor editor = (prefs).edit();
editor.putString("nome", nome);
editor.putString("email", email);
editor.commit();
Toast.makeText(tela2.this, "Salvo!!", Toast.LENGTH_SHORT).show();
}
});
btFechar.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
}
}
| [
"jean.sarlon@icloud.com"
] | jean.sarlon@icloud.com |
581055ec218deed0d92a0c4c6ed3ef84ea3a75a7 | 7ca4bc1066d904fe8459126c942023482a5e642c | /WLanLocator/src/com/locator/wlan/WLanData.java | 6c957f05f8fc302c9deb8c398bddc95989fa766c | [] | no_license | NicoBleh/WLanLocator | aaa43d2da0221e4f7c227239fa710047050aba36 | 3734493b1d673dd474a77a07c5c33fa33c05419c | refs/heads/master | 2021-01-19T06:26:05.440860 | 2012-12-12T14:15:23 | 2012-12-12T14:15:23 | 7,131,100 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,499 | java | package com.locator.wlan;
import java.util.ArrayList;
import java.util.List;
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.wifi.ScanResult;
import android.net.wifi.WifiManager;
import android.os.AsyncTask;
import com.locator.wlan.interfaces.Observer;
import com.locator.wlan.interfaces.Subject;
/**
* Class to pull ScanResults from the devices wifi and notify its observers.
* The Subject is started as a Async Task to no get in interference with the ui Thread.
*
* @author Nico Bleh
* @version 1.0
*
*/
public class WLanData extends AsyncTask<Void, Void, Void> implements Subject {
/**
* Fields
*/
private ArrayList<Observer> observerList; //List of registered observers
private ConnectivityManager conManager;
private boolean run; //Variable to control the lifecicle of the AsyncTask
private int updateintervall; //Time which the AsyncTask waits before pulling new scans
private WifiManager wifiService;
private List<ScanResult> scanlist; //Temporal list with found AccessPoints
private List<ScanResult> oldscanlist; //Temporal list with found AccessPoints
/**
* Constructor
*/
public WLanData(Context context, int updateintervall) {
this.updateintervall = updateintervall;
run = true;
conManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo netInfo;
netInfo = conManager.getNetworkInfo(ConnectivityManager.TYPE_WIFI);
netInfo.getState();
wifiService = (WifiManager) context.getSystemService(Context.WIFI_SERVICE); //Instanz des WifiManagers holen
oldscanlist = null;
observerList = new ArrayList<Observer>();
}
/**
* Registers a observer at the subject
*
* @return void
* @param Observer the observer to be notified
*/
@Override
public void registerObserver(Observer o) {
observerList.add(o);
}
/**
* Registers a observer at the subject
*
* @return void
* @param Observer the observer who not wants to be notified any more
*/
@Override
public void removeObserver(Observer o) {
observerList.remove(o);
}
/**
* Notifies all the observers registered by passing the latest List of Accesspoints
*/
@Override
public void notifyObservers() {
for(Observer o : observerList) {
o.update(scanlist);
}
}
public void endTask() {
this.run = false;
}
/**
* Gets the scan results and notifies his observers if results have changed
*/
@Override
protected Void doInBackground(Void... params) {
while(run) {
//WLan-Netze scannen
wifiService.startScan();
//Ergebnisse holen
scanlist = wifiService.getScanResults();
if(!equalLists(scanlist, oldscanlist) && scanlist != null) {
oldscanlist = scanlist;
this.notifyObservers();
}
try {
Thread.sleep(updateintervall);
} catch (InterruptedException e) {
}
}
return null;
}
/**
* Determines the equalness of two schan results
*
* @param list1
* @param list2
* @return true if the two scan results a equal. Else false
*/
private boolean equalLists(List<ScanResult> list1, List<ScanResult> list2) {
if(list1 == null || list2 == null) return false;
if(list1.size() != list2.size()) {
return false;
}
else {
for(int i=0; i < list1.size(); i++) {
if(!list1.get(i).BSSID.equals(list2.get(i).BSSID) || list1.get(i).level != list2.get(i).level)
return false;
}
return true;
}
}
}
| [
"n_bleh@gmx.de"
] | n_bleh@gmx.de |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.