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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1a80fe06decc5893dc2021210d971661ba10f9cb | 3cc05271257eb12224b84b2dfd5c003ec3cd9f34 | /MeteoCalDaverioDemaria/src/main/java/MeteoCal/business/security/boundary/UserManagerInterface.java | fdb1fb42778c256070afd13e7c00b142c57d8654 | [] | no_license | matteo-daverio/Meteocal | 8990288680c32b3f872326380ebceea787942148 | 46241abaa07327205dd2b555b892ddf4d25a47a7 | refs/heads/master | 2021-01-19T06:00:23.946642 | 2016-07-11T08:25:18 | 2016-07-11T08:25:18 | 63,005,151 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 758 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package MeteoCal.business.security.boundary;
import MeteoCal.business.security.entity.Users;
import java.util.List;
import javax.ejb.Remote;
/**
*
* @author DeMaria
*/
@Remote
public interface UserManagerInterface {
public void save(Users user) throws Exception;
public void unregister();
public Users getLoggedUser();
public Users findByMail(String mail);
public List<String> getListUsers();
public List<String> getListUsersPublic();
public void setCalendar(boolean status, Users user);
}
| [
"valerio.demaria@mail.polimi.it"
] | valerio.demaria@mail.polimi.it |
ab97d372ce8280bc2817aa17c9707d4e122a3095 | cc5965990c4890acc52b5c1da54fe0bbd1f77966 | /src/main/java/com/shaunabram/springboot/Customer.java | 413069d3d0b55c07ec23141f2425c8e0d838d727 | [] | no_license | sabram/SpringBootGradleJPA | 5cf48679849d9818db54d59263c470b6e33d16d8 | fa928db6d592b260eb9957a7968d20d3068f0593 | refs/heads/master | 2021-01-10T04:34:23.115223 | 2014-08-09T21:13:33 | 2014-08-09T21:13:33 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 742 | java | package com.shaunabram.springboot;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
@Entity
public class Customer {
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
private long id;
private String firstName;
private String lastName;
protected Customer() {}
public Customer(String firstName, String lastName) {
this.firstName = firstName;
this.lastName = lastName;
}
@Override
public String toString() {
return String.format(
"Customer[id=%d, firstName='%s', lastName='%s']",
id, firstName, lastName);
}
public String getFirstName() {
return firstName;
}
public String getLastName() {
return lastName;
}
}
| [
"shaunabram@gmail.com"
] | shaunabram@gmail.com |
55506c2e31ec47b989eaa272a8a60c9f6fb80e70 | b9254fe139849986dce8dabb3a0e5f2eea60d29a | /app/src/main/java/com/example/sqliteexample/crudsqlite/CRUD.java | 032d3e7dfb1816ce28617d7796d1dbd4f189926d | [] | no_license | aluth313/SQLite-Example-Android | 4f5e35e3fd3b50938094af530cb0c7733f936efb | 54d6cc2de151545d8397f723aae8f32a336dc3ff | refs/heads/master | 2022-11-07T04:01:47.296128 | 2020-06-09T04:22:34 | 2020-06-09T04:22:34 | 270,902,025 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,894 | java | package com.example.sqliteexample.crudsqlite;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import com.example.sqliteexample.model.Mahasiswa;
import java.util.ArrayList;
public class CRUD extends SQLiteOpenHelper {
Context context;
public CRUD(Context context) {
super(context, Constant.DATABASE_NAME, null, Constant.DATABASE_VERSION);
this.context = context;
}
@Override
public void onCreate(SQLiteDatabase db) {
String sqlCreateTable = "CREATE TABLE IF NOT EXISTS " + Constant.DATABASE_TABLE
+ "(id INTEGER PRIMARY KEY AUTOINCREMENT,"
+ Constant.KEY_NRP + " TEXT (50) NOT NULL,"
+ Constant.KEY_NAMA_LENGKAP + " TEXT (50))";
db.execSQL(sqlCreateTable);
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
String sqlDrop = "DROP TABLE IF EXISTS " + Constant.DATABASE_TABLE;
String sqlCreateTable = "CREATE TABLE " + Constant.DATABASE_TABLE
+ "(id INTEGER PRIMARY KEY AUTOINCREMENT,"
+ Constant.KEY_NRP + " TEXT (50) NOT NULL,"
+ Constant.KEY_NAMA_LENGKAP + " TEXT (50))";
db.execSQL(sqlDrop);
db.execSQL(sqlCreateTable);
onCreate(db);
}
public void create(Mahasiswa mahasiswa){
SQLiteDatabase db = this.getWritableDatabase();
ContentValues values = new ContentValues();
values.put(Constant.KEY_NRP, mahasiswa.getNrp());
values.put(Constant.KEY_NAMA_LENGKAP, mahasiswa.getNama());
db.insert(Constant.DATABASE_TABLE,null,values);
db.close();
}
public void update(Mahasiswa mahasiswa) {
SQLiteDatabase db = this.getWritableDatabase();
ContentValues values = new ContentValues();
values.put(Constant.KEY_NRP, mahasiswa.getNrp());
values.put(Constant.KEY_NAMA_LENGKAP, mahasiswa.getNama());
db.update(Constant.DATABASE_TABLE,values,Constant.KEY_NRP + "=?", new String[]{mahasiswa.getNrp()});
db.close();
}
public ArrayList<Mahasiswa> selectAll(){
ArrayList<Mahasiswa> mahasiswas = new ArrayList<>();
String selectAllQuery = "SELECT * FROM " + Constant.DATABASE_TABLE;
SQLiteDatabase db = this.getReadableDatabase();
Cursor cursor = db.rawQuery(selectAllQuery, null);
if (cursor.moveToFirst()){
while (!cursor.isAfterLast()){
String nrp = cursor.getString(1);
String nama = cursor.getString(2);
Mahasiswa mahasiswa = new Mahasiswa(nrp,nama);
mahasiswas.add(mahasiswa);
cursor.moveToNext();
}
}
return mahasiswas;
}
}
| [
"luthfiahmad36@gmail.com"
] | luthfiahmad36@gmail.com |
a1be4bfb61160e9b717cd566585586b8f55cab2a | f214289d71523ec1b0934e528d9009531fc34e00 | /core/src/main/generated-java/com/neofect/gts/core/services/sm/repository/SubSumRepository_.java | bf9641c08c6f1fb20930390c545ca82e616ac169 | [] | no_license | oilpal/gts_backend_apigen | 5d16cfb267bdfbdef1f3792f8bb06f2805491e87 | dac16b52dd661a5935cb73c4e7e656c49e8de693 | refs/heads/master | 2022-04-09T15:17:52.474514 | 2020-03-05T08:10:57 | 2020-03-05T08:10:57 | 244,796,425 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,456 | java | /*
* Source code generated by UnvUS.
* Copyright(c) 2017 unvus.com All rights reserved.
* Template skrull-pack-mybatis:src/main/java/repository/RepositoryBase.e.vm.java
* Template is part of project: https://git.unvus.com/unvus/opensource/pack-unvus-mybatis
*/
package com.neofect.gts.core.services.sm.repository;
import java.util.List;
import java.util.Map;
import org.springframework.stereotype.Repository;
import com.neofect.gts.core.services.sm.domain.SubSum;
import com.unvus.config.mybatis.pagination.Pageable;
import com.unvus.config.mybatis.support.DefaultMapper;
/**
* Repository for {@link SubSum}
* @see com.neofect.gts.core.services.sm.repository.SubSumRepository
*/
@DefaultMapper
@Repository
public interface SubSumRepository_ {
SubSum simpleGetSubSum(Long id);
int simpleListSubSumCnt(Map<String, Object> params);
/**
* if yuou want to avoid result objects less than dataPerPage caused by "1:N mappings".. <br/>
* add function that return "distinct id list" and name it with : <br/>
* <code>List<Long> listSubSumIds(Map<String, Object> params)</code> <br/>
* and replace @Pageable with : <br/>
* <code>@Pageable(useMergeQuery = true)</code> <br/>
*/
@Pageable
List<SubSum> simpleListSubSum(Map<String, Object> params);
int insertSubSum(SubSum subSum);
int updateSubSum(SubSum subSum);
int updateSubSumDynamic(SubSum subSum);
int deleteSubSum(Long id);
}
| [
"jd@relaybrand.com"
] | jd@relaybrand.com |
797de72f8fc0a5f382dbda770a5dfa354248d78f | a8717fcb48ea570acb157f8e054d80dc8c2f19d5 | /src/main/java/it/unisa/model/UserBean.java | 42a98af2ed986b17ba02fc4f001f5f05c2e4fbee | [] | no_license | PGG106/TSW2021_francese-ComicShop | 0ab3eb0e536602cb8678dd79aaf396a869ce9697 | aeda9ca46973f572d8956c8f3a6e2e5a2ad690a9 | refs/heads/main | 2023-06-15T18:27:20.242799 | 2021-07-13T16:00:30 | 2021-07-13T16:00:30 | 353,488,656 | 2 | 2 | null | null | null | null | UTF-8 | Java | false | false | 1,758 | java | package it.unisa.model;
import java.time.LocalDate;
public class UserBean {
private String username;
private String nome;
private String cognome;
private String email;
private String password;
private String num_tel;
private String paese_residenza;
private LocalDate data_nascita;
private boolean valid;
private boolean admin;
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getCognome() {
return cognome;
}
public void setCognome(String cognome) {
this.cognome = cognome;
}
public String getNome() {
return nome;
}
public void setNome(String nome) {
this.nome = nome;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getNum_tel() {
return num_tel;
}
public void setNum_tel(String num_tel) {
this.num_tel = num_tel;
}
public String getPaese_residenza() {
return paese_residenza;
}
public void setPaese_residenza(String paese_residenza) {
this.paese_residenza = paese_residenza;
}
public LocalDate getData_nascita() {
return data_nascita;
}
public void setData_nascita(LocalDate data_nascita) {
this.data_nascita = data_nascita;
}
public boolean isValid() {
return valid;
}
public void setValid(boolean valid) {
this.valid = valid;
}
public boolean IsAdmin() {
return admin;
}
public void setAdmin(Boolean admin) {
this.admin=admin;
}
}
| [
"giuseppepagano10@gmail.com"
] | giuseppepagano10@gmail.com |
d90eec451766a3e3bd0118b2735a98d67e4e0b7f | 92c2c701c2be7fe8a67f7b14cc219f131e74bf87 | /src/Operators/RelationalOperatorAndLogicalOperator.java | 2fd1e3edd602c030d65cd0b33de0d2cb40aa414d | [] | no_license | jaison-jacob/IntenshipOPerators | e0441484dce988451cac3a8b3c28c852dad39a70 | c730ad01e3dc53d98accf6774be71b26111f234d | refs/heads/master | 2023-01-08T15:29:45.861266 | 2020-11-08T16:22:57 | 2020-11-08T16:22:57 | 311,103,442 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,523 | java | package Operators;
public class RelationalOperatorAndLogicalOperator {
public static void main(String arg[]){
int num1 = 78;
int num2 = 45;
//condition satisfy
if(num1 == 78 && num2 == 45){
System.out.println("condition satisfy with && = "+ (num1+num2));
}else{
System.out.println("condition not satisfy with && ");
}
//condition unsatisfy
num2 = 90;
if(num1 == 78 && num2 == 45){
System.out.println("condition satisfy with && = "+ (num1+num2));
}else{
System.out.println("condition not satisfy with && ");
}
//condition satisfy with "||" operator
if(num1 == 78 || num2 == 45){
System.out.println("condition satisfy with || = = "+ (num1+num2));
}else{
System.out.println("condition not satisfy with || = ");
}
//condition unsatisfy with "||" operator
num1 = 66;
if(num1 == 78 || num2 == 45){
System.out.println("condition satisfy with || = "+ (num1+num2));
}else{
System.out.println("condition not satisfy with ||");
}
//condition satisfy with "!=" operator
if(num1 != 78 ){
System.out.println("condition satisfy with != = "+ (num1+num2));
}else{
System.out.println("condition not satisfy with "!="");
}
//condition unsatisfy with "!=" operator
if(num1 != 66){
System.out.println("condition satisfy with != = "+ (num1+num2));
}
else{
System.out.println("condition not satisfy with !=");
}
num1 = 89;
num2 = 34;
//use ">"
if(num1 > num2){
System.out.println("Condition satisfy with >");
}else{
System.out.println("condition notsatisfy");
}
//use "<"
if(num1 > num2){
System.out.println("Condition satisfy with <");
}else{
System.out.println("condition notsatisfy <");
}
//use "=<"
if(num1 <= num2){
System.out.println("num1 less than or equal num2");
}else{
System.out.println("num2 less than or equal num1");
}
//use ">"
if(num1 < num2){
System.out.println("num1 less than num2");
}else{
System.out.println("num2 less than num1");
}
}
}
| [
"jaisonjai250795@gmail.com"
] | jaisonjai250795@gmail.com |
16458804933181a47700f3d5d7fe0e260d56da6e | 097df92ce1bfc8a354680725c7d10f0d109b5b7d | /com/amazon/ws/emr/hadoop/fs/shaded/com/google/gson/internal/Streams$1.java | 6fac25c6617cd6f70da3acd6db4715adf1478195 | [] | no_license | cozos/emrfs-hadoop | 7a1a1221ffc3aa8c25b1067cf07d3b46e39ab47f | ba5dfa631029cb5baac2f2972d2fdaca18dac422 | refs/heads/master | 2022-10-14T15:03:51.500050 | 2022-10-06T05:38:49 | 2022-10-06T05:38:49 | 233,979,996 | 2 | 2 | null | 2022-10-06T05:41:46 | 2020-01-15T02:24:16 | Java | UTF-8 | Java | false | false | 260 | java | package com.amazon.ws.emr.hadoop.fs.shaded.com.google.gson.internal;
class Streams$1 {}
/* Location:
* Qualified Name: com.amazon.ws.emr.hadoop.fs.shaded.com.google.gson.internal.Streams.1
* Java Class Version: 5 (49.0)
* JD-Core Version: 0.7.1
*/ | [
"Arwin.tio@adroll.com"
] | Arwin.tio@adroll.com |
9cf73d9636d97ab6145f272f16ae1afe9ec783e9 | ce35330fa5108fe6e764fbfd024c6d4ff669e8db | /core/src/main/java/top/dcenter/ums/security/core/auth/config/ValidateCodeBeanAutoConfiguration.java | 34f2f94e89711c5fc99b10450b562835a5006048 | [
"MIT"
] | permissive | opcooc/UMS | 32b50cb25081ee05ffbac28848dc6ecee48fdc59 | e82f8af05b329d2f65a4b6a29564292664f09864 | refs/heads/master | 2023-01-04T07:00:55.844533 | 2020-11-10T11:59:04 | 2020-11-10T11:59:04 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,848 | java | /*
* MIT License
* Copyright (c) 2020-2029 YongWu zheng (dcenter.top and gitee.com/pcore and github.com/ZeroOrInfinity)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package top.dcenter.ums.security.core.auth.config;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.support.GenericApplicationContext;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.lang.NonNull;
import org.springframework.lang.Nullable;
import top.dcenter.ums.security.core.api.authentication.handler.BaseAuthenticationFailureHandler;
import top.dcenter.ums.security.core.api.validate.code.ValidateCodeGeneratorHolder;
import top.dcenter.ums.security.core.api.validate.code.ValidateCodeProcessorHolder;
import top.dcenter.ums.security.core.api.validate.code.image.ImageCodeFactory;
import top.dcenter.ums.security.core.api.validate.code.job.RefreshValidateCodeJob;
import top.dcenter.ums.security.core.api.validate.code.slider.SliderCodeFactory;
import top.dcenter.ums.security.core.api.validate.code.sms.SmsCodeSender;
import top.dcenter.ums.security.core.auth.controller.ValidateCodeController;
import top.dcenter.ums.security.core.auth.properties.ValidateCodeProperties;
import top.dcenter.ums.security.core.auth.validate.codes.ValidateCodeFilter;
import top.dcenter.ums.security.core.auth.validate.codes.image.DefaultImageCodeFactory;
import top.dcenter.ums.security.core.auth.validate.codes.image.ImageCodeGenerator;
import top.dcenter.ums.security.core.auth.validate.codes.image.ImageValidateCodeProcessor;
import top.dcenter.ums.security.core.auth.validate.codes.job.DefaultRefreshValidateCodeJobImpl;
import top.dcenter.ums.security.core.auth.validate.codes.slider.SimpleSliderCodeFactory;
import top.dcenter.ums.security.core.auth.validate.codes.slider.SliderCoderProcessor;
import top.dcenter.ums.security.core.auth.validate.codes.slider.SliderValidateCodeGenerator;
import top.dcenter.ums.security.core.auth.validate.codes.sms.DefaultSmsCodeSender;
import top.dcenter.ums.security.core.auth.validate.codes.sms.SmsCodeGenerator;
import top.dcenter.ums.security.core.auth.validate.codes.sms.SmsValidateCodeProcessor;
import java.util.concurrent.ScheduledExecutorService;
/**
* 验证码功能配置
* @author zhailiang
* @author YongWu zheng
* @version V1.0 Created by 2020/5/5 0:02
*/
@Configuration
@AutoConfigureAfter({SecurityAutoConfiguration.class})
@Slf4j
public class ValidateCodeBeanAutoConfiguration {
@SuppressWarnings("SpringJavaAutowiredFieldsWarningInspection")
@Autowired
private GenericApplicationContext applicationContext;
@Bean
@ConditionalOnMissingBean(type = "top.dcenter.ums.security.core.auth.validate.codes.image.ImageCodeGenerator")
public ImageCodeGenerator imageCodeGenerator(ValidateCodeProperties validateCodeProperties,
ImageCodeFactory imageCodeFactory) {
return new ImageCodeGenerator(validateCodeProperties, imageCodeFactory);
}
@Bean
@ConditionalOnMissingBean(type = "top.dcenter.ums.security.core.auth.validate.codes.sms.SmsCodeGenerator")
public SmsCodeGenerator smsCodeGenerator(ValidateCodeProperties validateCodeProperties, SmsCodeSender smsCodeSender) {
return new SmsCodeGenerator(validateCodeProperties, smsCodeSender);
}
@Bean
@ConditionalOnMissingBean(type = "top.dcenter.ums.security.core.api.validate.code.sms.SmsCodeSender")
public SmsCodeSender smsCodeSender(ValidateCodeProperties validateCodeProperties) {
return new DefaultSmsCodeSender(validateCodeProperties);
}
@Bean
@ConditionalOnMissingBean(type = "top.dcenter.ums.security.core.api.validate.code.image.ImageCodeFactory")
public ImageCodeFactory imageCodeFactory(ValidateCodeProperties validateCodeProperties) {
return new DefaultImageCodeFactory(validateCodeProperties);
}
@Bean
@ConditionalOnMissingBean(type = "top.dcenter.ums.security.core.auth.validate.codes.image.ImageValidateCodeProcessor")
public ImageValidateCodeProcessor imageValidateCodeProcessor(@NonNull ValidateCodeGeneratorHolder validateCodeGeneratorHolder,
@NonNull ValidateCodeProperties validateCodeProperties,
@Nullable @Autowired(required = false) StringRedisTemplate stringRedisTemplate) {
return new ImageValidateCodeProcessor(validateCodeGeneratorHolder,
validateCodeProperties.getValidateCodeCacheType() ,
stringRedisTemplate);
}
@Bean
@ConditionalOnMissingBean(type = "top.dcenter.ums.security.core.auth.validate.codes.sms.SmsValidateCodeProcessor")
public SmsValidateCodeProcessor smsValidateCodeProcessor(@NonNull ValidateCodeGeneratorHolder validateCodeGeneratorHolder,
@NonNull ValidateCodeProperties validateCodeProperties,
@Nullable @Autowired(required = false) StringRedisTemplate stringRedisTemplate) {
return new SmsValidateCodeProcessor(validateCodeGeneratorHolder,
validateCodeProperties.getValidateCodeCacheType() ,
stringRedisTemplate);
}
@Bean
@ConditionalOnMissingBean(type = "top.dcenter.ums.security.core.api.validate.code.slider.SliderCodeFactory")
public SimpleSliderCodeFactory simpleSliderCodeFactory(ValidateCodeProperties validateCodeProperties) {
return new SimpleSliderCodeFactory(validateCodeProperties);
}
@Bean
@ConditionalOnMissingBean(type = "top.dcenter.ums.security.core.auth.validate.codes.slider.SliderValidateCodeGenerator")
public SliderValidateCodeGenerator sliderValidateCodeGenerator(ValidateCodeProperties validateCodeProperties,
SliderCodeFactory sliderCodeFactory) {
return new SliderValidateCodeGenerator(sliderCodeFactory, validateCodeProperties);
}
@Bean
@ConditionalOnMissingBean(type = "top.dcenter.ums.security.core.auth.validate.codes.slider.SliderCoderProcessor")
public SliderCoderProcessor sliderCoderProcessor(@NonNull ValidateCodeGeneratorHolder validateCodeGeneratorHolder,
@NonNull ValidateCodeProperties validateCodeProperties,
@Nullable @Autowired(required = false) StringRedisTemplate stringRedisTemplate) {
return new SliderCoderProcessor(validateCodeGeneratorHolder,
validateCodeProperties,
stringRedisTemplate);
}
@Bean
@ConditionalOnProperty(prefix = "ums.codes", name = "enable-refresh-validate-code-job", havingValue = "true")
public RefreshValidateCodeJob refreshValidateCodeJob(ValidateCodeProperties validateCodeProperties,
@Qualifier("jobTaskScheduledExecutor") ScheduledExecutorService jobTaskScheduledExecutor) {
return new DefaultRefreshValidateCodeJobImpl(validateCodeProperties, jobTaskScheduledExecutor);
}
@Bean
public ValidateCodeProcessorHolder validateCodeProcessorHolder() {
return new ValidateCodeProcessorHolder();
}
@Bean
public ValidateCodeGeneratorHolder validateCodeGeneratorHolder() {
return new ValidateCodeGeneratorHolder();
}
@Bean()
public ValidateCodeController validateCodeController() {
return new ValidateCodeController();
}
@Bean
@ConditionalOnMissingBean(type = "top.dcenter.ums.security.core.auth.validate.codes.ValidateCodeFilter")
public ValidateCodeFilter validateCodeFilter(ValidateCodeProcessorHolder validateCodeProcessorHolder,
BaseAuthenticationFailureHandler baseAuthenticationFailureHandler,
ValidateCodeProperties validateCodeProperties) {
return new ValidateCodeFilter(validateCodeProcessorHolder, baseAuthenticationFailureHandler, validateCodeProperties);
}
} | [
"zyw23zyw23@163.com"
] | zyw23zyw23@163.com |
55c025cb749c166ee64279d371f40bae7d97a7a4 | f3d9d8ef8994c807e22616c7b9a387fed4235cec | /src/main/java/weclaw/security/SecurityConstants.java | a482affc0b18cc73923881f1b5916bbdcfd1dd26 | [
"MIT"
] | permissive | weclaw1/spring_backend | 00aae6adc9e1053cc1dfb20bd47ca7b5a2645e78 | 273f0ca3b6868514d0e01bd1dfb58f7c44443d73 | refs/heads/master | 2021-05-08T15:58:32.127013 | 2018-04-19T22:09:39 | 2018-04-19T22:09:39 | 120,134,236 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 181 | java | package weclaw.security;
public class SecurityConstants {
public static final String HEADER_STRING = "Authorization";
public static final String TOKEN_PREFIX = "Bearer ";
} | [
"r.weclawski@gmail.com"
] | r.weclawski@gmail.com |
357ee045182e69979424c8bcd8641cbe75eede5e | 34434692778a37be3f4507340f123676882388b5 | /Patterns_CollectOrganize/src/sa_CollectOrganize/SoftwareArchitecture.java | 63471d19c8081c41559eb566f051236104fb6e90 | [] | no_license | sahayapurv/MasterThesis---Pattern-Sirius | f0e2ecdc7ee6abf356ae16a985da05333d32b939 | a896ca971b5f44732ffae553d7bdf70eb1373b17 | refs/heads/master | 2020-03-23T16:38:16.733959 | 2018-07-21T15:04:17 | 2018-07-21T15:04:17 | 141,821,111 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,897 | java | /**
*/
package sa_CollectOrganize;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EObject;
/**
* <!-- begin-user-doc -->
* A representation of the model object '<em><b>Software Architecture</b></em>'.
* <!-- end-user-doc -->
*
* <p>
* The following features are supported:
* </p>
* <ul>
* <li>{@link sa_CollectOrganize.SoftwareArchitecture#getSAElements <em>SA Elements</em>}</li>
* <li>{@link sa_CollectOrganize.SoftwareArchitecture#getLinks <em>Links</em>}</li>
* </ul>
*
* @see sa_CollectOrganize.SaPackage#getSoftwareArchitecture()
* @model
* @generated
*/
public interface SoftwareArchitecture extends EObject {
/**
* Returns the value of the '<em><b>SA Elements</b></em>' containment reference list.
* The list contents are of type {@link sa_CollectOrganize.SAElement}.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>SA Elements</em>' containment reference list isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>SA Elements</em>' containment reference list.
* @see sa_CollectOrganize.SaPackage#getSoftwareArchitecture_SAElements()
* @model containment="true"
* @generated
*/
EList<SAElement> getSAElements();
/**
* Returns the value of the '<em><b>Links</b></em>' containment reference list.
* The list contents are of type {@link sa_CollectOrganize.Link}.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Links</em>' containment reference list isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Links</em>' containment reference list.
* @see sa_CollectOrganize.SaPackage#getSoftwareArchitecture_Links()
* @model containment="true"
* @generated
*/
EList<Link> getLinks();
} // SoftwareArchitecture
| [
"sahayapurv@gmail.com"
] | sahayapurv@gmail.com |
a17f6f1f867c0c4f6383a317f51ebcd2e4709d04 | 5ef2582fb3df514f11a50022d5e06d46ef2aa818 | /src/java/com/bsw/dao/TbBwIPHDetlDao.java | b0d0786bfaf19df59223d8ecbf25e2eac6cb3112 | [] | no_license | mauwahid/BSWRestAPI | 8abb129d8ac312aae5bc97d6f46a4d654b99be19 | f0cbf087b02582061808aafee4e16a2880d5e678 | refs/heads/master | 2021-05-15T03:31:43.703716 | 2017-10-17T04:42:20 | 2017-10-17T04:42:20 | 107,218,865 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,964 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.bsw.dao;
import com.bsw.domain.TbBWIPHDetl;
import com.bsw.domain.TbCMCountryCityTMP;
import com.bsw.domain.reqres.ResponseInterface;
import com.bsw.domain.reqres.SaveResponse;
import com.bsw.utils.Common;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
*
* @author Maulana Wahid Abdurrahman
*/
public class TbBwIPHDetlDao {
private Connection conn;
private String queryCreateIPHDet = "INSERT INTO TBBW_IPH_DETL " +
"(ID_IPH, FILE_SEQ, COM_CD, FILE_NM," +
"PHY_FILE_NM, FILE_EXT, FILE_SIZE, FILE_TP," +
"DOCUMENT_NO, EXT_DMT, CREATED_BY, CREATED_TIME," +
"DOC_TP, PHY_FILE_PATH, REMARKS) " +
"values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
private String queryUpdateIPHDet = "UPDATE TBBW_IPH_DETL " +
"SET FILE_SEQ = ?, FILE_NM =?," +
"PHY_FILE_NM =?, FILE_EXT =?, FILE_SIZE=?, FILE_TP=?," +
"DOCUMENT_NO=?, EXT_DMT=?, CREATED_BY=?, CREATED_TIME=?," +
"COM_CD=?, PHY_FILE_PATH=?, REMARKS = ? WHERE ID_IPH =? AND DOC_TP =?";
private String queryDeleteIPHDet = "DELETE TBBW_IPH_DETL " +
" WHERE ID_IPH =? AND FILE_SEQ =? AND DOC_TP =?";
public static TbBwIPHDetlDao getInstance(Connection conn){
return new TbBwIPHDetlDao(conn);
}
public TbBwIPHDetlDao(Connection conn){
this.conn = conn;
}
public ResponseInterface saveIPHDet(TbBWIPHDetl tbBwIPHDet){
PreparedStatement statement = null;
int res = 0;
SaveResponse response = new SaveResponse();
try {
statement = conn.prepareStatement(queryCreateIPHDet);
statement.setString(1, tbBwIPHDet.getIdIPH());
statement.setString(2, tbBwIPHDet.getFileSeq());
statement.setString(3, tbBwIPHDet.getComCd());
statement.setString(4, tbBwIPHDet.getFileNm());
statement.setString(5, tbBwIPHDet.getPhyFileNm());
statement.setString(6, tbBwIPHDet.getFileExt());
statement.setString(7, tbBwIPHDet.getFileSize());
statement.setString(8, tbBwIPHDet.getFileTp());
statement.setString(9, tbBwIPHDet.getDocumentNo());
try {
statement.setDate(10, Common.convertToDate(tbBwIPHDet.getExtDmt()));
} catch (Exception ex) {
Logger.getLogger(TbBwIPHDetlDao.class.getName()).log(Level.SEVERE, null, ex);
}
statement.setString(11, tbBwIPHDet.getCreatedBy());
statement.setDate(12, Common.getCurrentDate());
statement.setString(13, tbBwIPHDet.getDocTp());
statement.setString(14, tbBwIPHDet.getPhyFilePath());
statement.setString(15, tbBwIPHDet.getRemarks());
res = statement.executeUpdate();
if (res>0) {
response.setId(tbBwIPHDet.getIdIPH());
response.setStatus("SUCCESS");
response.setStatusDesc("SAVE SUCCESS");
}else{
response.setStatus("FAILED");
response.setStatusDesc("SAVE FAILED");
}
statement.close();
conn.close();
System.out.println("AFTER ALL");
// return list;
} catch (SQLException exception) {
try {
statement.close();
conn.close();
System.out.println("EXCEPTION 1");
// response.setUserStatus("NOT FOUND");
response.setStatus("FAILED");
response.setStatusDesc(exception.getMessage());
// return null;
} catch (SQLException ex) {
Logger.getLogger(TbCMCountryCityTMP.class.getName()).log(Level.SEVERE, null, ex);
// response.setUserStatus("NOT FOUND");
System.out.println("EXCEPTION 2");
response.setStatus("FAILED");
response.setStatus(exception.getMessage());
// return null;
}
}
return response;
}
public ResponseInterface updateIPHDet(TbBWIPHDetl tbBwIPHDet){
PreparedStatement statement = null;
int res = 0;
SaveResponse response = new SaveResponse();
try {
statement = conn.prepareStatement(queryUpdateIPHDet);
statement.setString(1, tbBwIPHDet.getFileSeq());
statement.setString(2, tbBwIPHDet.getFileNm());
statement.setString(3, tbBwIPHDet.getPhyFileNm());
statement.setString(4, tbBwIPHDet.getFileExt());
statement.setString(5, tbBwIPHDet.getFileSize());
statement.setString(6, tbBwIPHDet.getFileTp());
statement.setString(7, tbBwIPHDet.getDocumentNo());
try {
statement.setDate(8, Common.convertToDate(tbBwIPHDet.getExtDmt()));
} catch (Exception ex) {
Logger.getLogger(TbBwIPHDetlDao.class.getName()).log(Level.SEVERE, null, ex);
}
statement.setString(9, tbBwIPHDet.getCreatedBy());
statement.setDate(10, Common.getCurrentDate());
statement.setString(12, tbBwIPHDet.getPhyFilePath());
statement.setString(13, tbBwIPHDet.getRemarks());
statement.setString(14, tbBwIPHDet.getIdIPH());
statement.setString(11, tbBwIPHDet.getComCd());
statement.setString(15, tbBwIPHDet.getDocTp());
res = statement.executeUpdate();
if (res>0) {
response.setId(tbBwIPHDet.getIdIPH());
response.setStatus("SUCCESS");
response.setStatusDesc("UPDATE SUCCESS");
}else{
response.setStatus("FAILED");
response.setStatusDesc("UPDATE FAILED");
}
statement.close();
conn.close();
System.out.println("AFTER ALL");
// return list;
} catch (SQLException exception) {
try {
statement.close();
conn.close();
System.out.println("EXCEPTION 1");
// response.setUserStatus("NOT FOUND");
response.setStatus("FAILED");
response.setStatusDesc(exception.getMessage());
// return null;
} catch (SQLException ex) {
Logger.getLogger(TbCMCountryCityTMP.class.getName()).log(Level.SEVERE, null, ex);
// response.setUserStatus("NOT FOUND");
System.out.println("EXCEPTION 2");
response.setStatus("FAILED");
response.setStatus(exception.getMessage());
// return null;
}
}
return response;
}
public ResponseInterface deleteIPHDet(String idIph,String fileSeq,String docTp){
PreparedStatement statement = null;
int res = 0;
SaveResponse response = new SaveResponse();
try {
statement = conn.prepareStatement(queryDeleteIPHDet);
statement.setString(1,idIph);
statement.setString(2,fileSeq);
statement.setString(3, docTp);
res = statement.executeUpdate();
if (res>0) {
// response.setId(tbBwIPHDet.getIdIPH());
response.setStatus("SUCCESS");
response.setStatusDesc("DELETE SUCCESS");
}else{
response.setStatus("FAILED");
response.setStatusDesc("DELETE FAILED");
}
statement.close();
conn.close();
System.out.println("AFTER ALL");
// return list;
} catch (SQLException exception) {
try {
statement.close();
conn.close();
System.out.println("EXCEPTION 1");
// response.setUserStatus("NOT FOUND");
response.setStatus("FAILED");
response.setStatusDesc(exception.getMessage());
// return null;
} catch (SQLException ex) {
Logger.getLogger(TbCMCountryCityTMP.class.getName()).log(Level.SEVERE, null, ex);
// response.setUserStatus("NOT FOUND");
System.out.println("EXCEPTION 2");
response.setStatus("FAILED");
response.setStatus(exception.getMessage());
// return null;
}
}
return response;
}
}
| [
"mau.wahid@gmail.com"
] | mau.wahid@gmail.com |
0d5e72788ac46da15147acb88dcb4d94fcf01e2e | 72c3f818614057e6ba7db70235445cc3959b7fc4 | /build/app/generated/not_namespaced_r_class_sources/debug/r/io/flutter/plugins/url_launcher_macos/R.java | 17bf028213c97bfa82b27e7f32e624a262c6663c | [] | no_license | Aamirkhan2610/PosterSellNew | 6b0789e44d702a8b4b66b4afb2d6f74b59d09e15 | 5fe0ac4e5c8114db4573c02b606db7394bc251dc | refs/heads/master | 2023-05-05T22:40:49.016816 | 2021-05-27T08:31:24 | 2021-05-27T08:31:24 | 371,301,355 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 13,497 | java | /* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* gradle plugin from the resource data it found. It
* should not be modified by hand.
*/
package io.flutter.plugins.url_launcher_macos;
public final class R {
private R() {}
public static final class attr {
private attr() {}
public static final int alpha = 0x7f030027;
public static final int font = 0x7f0300d7;
public static final int fontProviderAuthority = 0x7f0300d9;
public static final int fontProviderCerts = 0x7f0300da;
public static final int fontProviderFetchStrategy = 0x7f0300db;
public static final int fontProviderFetchTimeout = 0x7f0300dc;
public static final int fontProviderPackage = 0x7f0300dd;
public static final int fontProviderQuery = 0x7f0300de;
public static final int fontStyle = 0x7f0300df;
public static final int fontVariationSettings = 0x7f0300e0;
public static final int fontWeight = 0x7f0300e1;
public static final int ttcIndex = 0x7f0301df;
}
public static final class color {
private color() {}
public static final int notification_action_color_filter = 0x7f050072;
public static final int notification_icon_bg_color = 0x7f050073;
public static final int ripple_material_light = 0x7f05007e;
public static final int secondary_text_default_material_light = 0x7f050080;
}
public static final class dimen {
private dimen() {}
public static final int compat_button_inset_horizontal_material = 0x7f06004e;
public static final int compat_button_inset_vertical_material = 0x7f06004f;
public static final int compat_button_padding_horizontal_material = 0x7f060050;
public static final int compat_button_padding_vertical_material = 0x7f060051;
public static final int compat_control_corner_material = 0x7f060052;
public static final int compat_notification_large_icon_max_height = 0x7f060053;
public static final int compat_notification_large_icon_max_width = 0x7f060054;
public static final int notification_action_icon_size = 0x7f0600c0;
public static final int notification_action_text_size = 0x7f0600c1;
public static final int notification_big_circle_margin = 0x7f0600c2;
public static final int notification_content_margin_start = 0x7f0600c3;
public static final int notification_large_icon_height = 0x7f0600c4;
public static final int notification_large_icon_width = 0x7f0600c5;
public static final int notification_main_column_padding_top = 0x7f0600c6;
public static final int notification_media_narrow_margin = 0x7f0600c7;
public static final int notification_right_icon_size = 0x7f0600c8;
public static final int notification_right_side_padding_top = 0x7f0600c9;
public static final int notification_small_icon_background_padding = 0x7f0600ca;
public static final int notification_small_icon_size_as_large = 0x7f0600cb;
public static final int notification_subtext_size = 0x7f0600cc;
public static final int notification_top_pad = 0x7f0600cd;
public static final int notification_top_pad_large_text = 0x7f0600ce;
}
public static final class drawable {
private drawable() {}
public static final int notification_action_background = 0x7f07007e;
public static final int notification_bg = 0x7f07007f;
public static final int notification_bg_low = 0x7f070080;
public static final int notification_bg_low_normal = 0x7f070081;
public static final int notification_bg_low_pressed = 0x7f070082;
public static final int notification_bg_normal = 0x7f070083;
public static final int notification_bg_normal_pressed = 0x7f070084;
public static final int notification_icon_background = 0x7f070085;
public static final int notification_template_icon_bg = 0x7f070086;
public static final int notification_template_icon_low_bg = 0x7f070087;
public static final int notification_tile_bg = 0x7f070088;
public static final int notify_panel_notification_icon_bg = 0x7f070089;
}
public static final class id {
private id() {}
public static final int accessibility_action_clickable_span = 0x7f080006;
public static final int accessibility_custom_action_0 = 0x7f080007;
public static final int accessibility_custom_action_1 = 0x7f080008;
public static final int accessibility_custom_action_10 = 0x7f080009;
public static final int accessibility_custom_action_11 = 0x7f08000a;
public static final int accessibility_custom_action_12 = 0x7f08000b;
public static final int accessibility_custom_action_13 = 0x7f08000c;
public static final int accessibility_custom_action_14 = 0x7f08000d;
public static final int accessibility_custom_action_15 = 0x7f08000e;
public static final int accessibility_custom_action_16 = 0x7f08000f;
public static final int accessibility_custom_action_17 = 0x7f080010;
public static final int accessibility_custom_action_18 = 0x7f080011;
public static final int accessibility_custom_action_19 = 0x7f080012;
public static final int accessibility_custom_action_2 = 0x7f080013;
public static final int accessibility_custom_action_20 = 0x7f080014;
public static final int accessibility_custom_action_21 = 0x7f080015;
public static final int accessibility_custom_action_22 = 0x7f080016;
public static final int accessibility_custom_action_23 = 0x7f080017;
public static final int accessibility_custom_action_24 = 0x7f080018;
public static final int accessibility_custom_action_25 = 0x7f080019;
public static final int accessibility_custom_action_26 = 0x7f08001a;
public static final int accessibility_custom_action_27 = 0x7f08001b;
public static final int accessibility_custom_action_28 = 0x7f08001c;
public static final int accessibility_custom_action_29 = 0x7f08001d;
public static final int accessibility_custom_action_3 = 0x7f08001e;
public static final int accessibility_custom_action_30 = 0x7f08001f;
public static final int accessibility_custom_action_31 = 0x7f080020;
public static final int accessibility_custom_action_4 = 0x7f080021;
public static final int accessibility_custom_action_5 = 0x7f080022;
public static final int accessibility_custom_action_6 = 0x7f080023;
public static final int accessibility_custom_action_7 = 0x7f080024;
public static final int accessibility_custom_action_8 = 0x7f080025;
public static final int accessibility_custom_action_9 = 0x7f080026;
public static final int action_container = 0x7f08002f;
public static final int action_divider = 0x7f080031;
public static final int action_image = 0x7f080032;
public static final int action_text = 0x7f080038;
public static final int actions = 0x7f080039;
public static final int async = 0x7f080041;
public static final int blocking = 0x7f080044;
public static final int chronometer = 0x7f08004c;
public static final int dialog_button = 0x7f08005e;
public static final int forever = 0x7f08006d;
public static final int icon = 0x7f080072;
public static final int icon_group = 0x7f080073;
public static final int info = 0x7f080077;
public static final int italic = 0x7f080078;
public static final int line1 = 0x7f08007e;
public static final int line3 = 0x7f08007f;
public static final int normal = 0x7f08008d;
public static final int notification_background = 0x7f08008e;
public static final int notification_main_column = 0x7f08008f;
public static final int notification_main_column_container = 0x7f080090;
public static final int right_icon = 0x7f08009a;
public static final int right_side = 0x7f08009b;
public static final int tag_accessibility_actions = 0x7f0800c6;
public static final int tag_accessibility_clickable_spans = 0x7f0800c7;
public static final int tag_accessibility_heading = 0x7f0800c8;
public static final int tag_accessibility_pane_title = 0x7f0800c9;
public static final int tag_screen_reader_focusable = 0x7f0800ca;
public static final int tag_transition_group = 0x7f0800cb;
public static final int tag_unhandled_key_event_manager = 0x7f0800cc;
public static final int tag_unhandled_key_listeners = 0x7f0800cd;
public static final int text = 0x7f0800ce;
public static final int text2 = 0x7f0800cf;
public static final int time = 0x7f0800d7;
public static final int title = 0x7f0800d8;
}
public static final class integer {
private integer() {}
public static final int status_bar_notification_info_maxnum = 0x7f09000f;
}
public static final class layout {
private layout() {}
public static final int custom_dialog = 0x7f0b001c;
public static final int notification_action = 0x7f0b002d;
public static final int notification_action_tombstone = 0x7f0b002e;
public static final int notification_template_custom_big = 0x7f0b0035;
public static final int notification_template_icon_group = 0x7f0b0036;
public static final int notification_template_part_chronometer = 0x7f0b003a;
public static final int notification_template_part_time = 0x7f0b003b;
}
public static final class string {
private string() {}
public static final int status_bar_notification_info_overflow = 0x7f0d004e;
}
public static final class style {
private style() {}
public static final int TextAppearance_Compat_Notification = 0x7f0e0116;
public static final int TextAppearance_Compat_Notification_Info = 0x7f0e0117;
public static final int TextAppearance_Compat_Notification_Line2 = 0x7f0e0119;
public static final int TextAppearance_Compat_Notification_Time = 0x7f0e011c;
public static final int TextAppearance_Compat_Notification_Title = 0x7f0e011e;
public static final int Widget_Compat_NotificationActionContainer = 0x7f0e01c5;
public static final int Widget_Compat_NotificationActionText = 0x7f0e01c6;
}
public static final class styleable {
private styleable() {}
public static final int[] ColorStateListItem = { 0x10101a5, 0x101031f, 0x7f030027 };
public static final int ColorStateListItem_android_color = 0;
public static final int ColorStateListItem_android_alpha = 1;
public static final int ColorStateListItem_alpha = 2;
public static final int[] FontFamily = { 0x7f0300d9, 0x7f0300da, 0x7f0300db, 0x7f0300dc, 0x7f0300dd, 0x7f0300de };
public static final int FontFamily_fontProviderAuthority = 0;
public static final int FontFamily_fontProviderCerts = 1;
public static final int FontFamily_fontProviderFetchStrategy = 2;
public static final int FontFamily_fontProviderFetchTimeout = 3;
public static final int FontFamily_fontProviderPackage = 4;
public static final int FontFamily_fontProviderQuery = 5;
public static final int[] FontFamilyFont = { 0x1010532, 0x1010533, 0x101053f, 0x101056f, 0x1010570, 0x7f0300d7, 0x7f0300df, 0x7f0300e0, 0x7f0300e1, 0x7f0301df };
public static final int FontFamilyFont_android_font = 0;
public static final int FontFamilyFont_android_fontWeight = 1;
public static final int FontFamilyFont_android_fontStyle = 2;
public static final int FontFamilyFont_android_ttcIndex = 3;
public static final int FontFamilyFont_android_fontVariationSettings = 4;
public static final int FontFamilyFont_font = 5;
public static final int FontFamilyFont_fontStyle = 6;
public static final int FontFamilyFont_fontVariationSettings = 7;
public static final int FontFamilyFont_fontWeight = 8;
public static final int FontFamilyFont_ttcIndex = 9;
public static final int[] GradientColor = { 0x101019d, 0x101019e, 0x10101a1, 0x10101a2, 0x10101a3, 0x10101a4, 0x1010201, 0x101020b, 0x1010510, 0x1010511, 0x1010512, 0x1010513 };
public static final int GradientColor_android_startColor = 0;
public static final int GradientColor_android_endColor = 1;
public static final int GradientColor_android_type = 2;
public static final int GradientColor_android_centerX = 3;
public static final int GradientColor_android_centerY = 4;
public static final int GradientColor_android_gradientRadius = 5;
public static final int GradientColor_android_tileMode = 6;
public static final int GradientColor_android_centerColor = 7;
public static final int GradientColor_android_startX = 8;
public static final int GradientColor_android_startY = 9;
public static final int GradientColor_android_endX = 10;
public static final int GradientColor_android_endY = 11;
public static final int[] GradientColorItem = { 0x10101a5, 0x1010514 };
public static final int GradientColorItem_android_color = 0;
public static final int GradientColorItem_android_offset = 1;
}
}
| [
"aamirkhan2610@gmail.com"
] | aamirkhan2610@gmail.com |
52207e371964163b9e140cdb8342a4401873eaa5 | d1b26c0ddbc87874f3c3a3d9690c3a54b55c86e9 | /project-learn/src/main/java/com/pro/learn/entity/Person.java | eb6e8f39f27f74e1553d8c78e687c784cd1f870f | [] | no_license | mahuai/project-controller | 9c5486042240e8401460ea7b069b88359e878a5a | 67f567a7182bf9cf229b3425e2baf7c19dc8286a | refs/heads/master | 2020-03-23T11:47:36.727248 | 2018-10-30T02:08:15 | 2018-10-30T02:08:15 | 141,521,195 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 993 | java | package com.pro.learn.entity;
/**
* @author ms
* @Description: class description
* @Package com.pro.learn.entity
* @date: Created in 2018/9/5 15:16
*/
public class Person {
private String name;
private Integer age;
private String sex;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Integer getAge() {
return age;
}
public void setAge(Integer age) {
this.age = age;
}
public String getSex() {
return sex;
}
public void setSex(String sex) {
this.sex = sex;
}
public Person(String name, Integer age, String sex) {
this.name = name;
this.age = age;
this.sex = sex;
}
@Override
public String toString() {
return "Person{" +
"name='" + name + '\'' +
", age=" + age +
", sex='" + sex + '\'' +
'}';
}
}
| [
"ma@shuazhenit.com"
] | ma@shuazhenit.com |
d023fb714e51bb22f2864997280926839610f421 | 78d1cc160181eee36e0fed53a1c27519e78f0747 | /src/main/java/org/kavaproject/kavatouch/imageio/GraphicsImageProperties.java | 4099c8fc034ff07444d80a0ec13b3d744ab3ba51 | [
"BSD-3-Clause",
"MIT",
"Apache-2.0",
"BSD-2-Clause"
] | permissive | KavaProject/KavaTouch | ed3c30c1b3d8ce5d20d12e013c09d82302764c52 | a5a815797c62694f0ad2e56334365548b7db1cc2 | refs/heads/master | 2021-01-25T08:36:59.365774 | 2014-03-29T11:20:20 | 2014-03-29T11:20:20 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 891 | java | /*
* Copyright 2013 The Kava Project Developers. See the COPYRIGHT file at the top-level directory of this distribution
* and at http://kavaproject.org/COPYRIGHT.
*
* Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the
* MIT license <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option. This file may not be copied,
* modified, or distributed except according to those terms.
*/
package org.kavaproject.kavatouch.imageio;
import org.kavaproject.kavatouch.internal.CData;
import org.kavaproject.kavatouch.internal.Header;
@Header("CGImageProperties")
public class GraphicsImageProperties {
@CData("kCGImagePropertyPixelWidth")
public float pixelWidth;
@CData("kCGImagePropertyPixelHeight")
public float pixelHeight;
@CData("kCGImagePropertyHasAlpha")
public boolean hasAlpha;
}
| [
"m6s@kavaproject.org"
] | m6s@kavaproject.org |
96873110da80d1ae63148076eb303b238ab8d7a4 | 93740012e907b568a0a8c842aeb27769ad2024ed | /classlib/java.base/src/main/resources/META-INF/modules/java.base/classes/java/lang/foreign/FunctionDescriptor.java | 3b6627d7f92c5b3918850b44d5808d00edc2f03e | [
"Apache-2.0"
] | permissive | mirkosertic/Bytecoder | 2beb0dc07d3d00777c9ad6eeb177a978f9a6464b | 7af3b3c8f26d2f9f922d6ba7dd5ba21ab2acc6db | refs/heads/master | 2023-09-01T12:38:20.003639 | 2023-08-17T04:59:00 | 2023-08-25T09:06:25 | 88,152,958 | 831 | 75 | Apache-2.0 | 2023-09-11T13:47:20 | 2017-04-13T10:21:59 | Java | UTF-8 | Java | false | false | 5,814 | java | /*
* Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code 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
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package java.lang.foreign;
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodType;
import java.util.Objects;
import java.util.Optional;
import java.util.List;
import jdk.internal.foreign.FunctionDescriptorImpl;
import jdk.internal.javac.PreviewFeature;
/**
* A function descriptor models the signature of foreign functions. A function descriptor is made up of zero or more
* argument layouts and zero or one return layout. A function descriptor is typically used when creating
* {@linkplain Linker#downcallHandle(MemorySegment, FunctionDescriptor, Linker.Option...) downcall method handles} or
* {@linkplain Linker#upcallStub(MethodHandle, FunctionDescriptor, SegmentScope) upcall stubs}.
*
* @implSpec
* Implementing classes are immutable, thread-safe and <a href="{@docRoot}/java.base/java/lang/doc-files/ValueBased.html">value-based</a>.
*
* @see MemoryLayout
* @since 19
*/
@PreviewFeature(feature=PreviewFeature.Feature.FOREIGN)
public sealed interface FunctionDescriptor permits FunctionDescriptorImpl {
/**
* {@return the return layout (if any) associated with this function descriptor}
*/
Optional<MemoryLayout> returnLayout();
/**
* {@return the argument layouts associated with this function descriptor (as an immutable list)}.
*/
List<MemoryLayout> argumentLayouts();
/**
* Returns a function descriptor with the given argument layouts appended to the argument layout array
* of this function descriptor.
* @param addedLayouts the argument layouts to append.
* @return the new function descriptor.
*/
FunctionDescriptor appendArgumentLayouts(MemoryLayout... addedLayouts);
/**
* Returns a function descriptor with the given argument layouts inserted at the given index, into the argument
* layout array of this function descriptor.
* @param index the index at which to insert the arguments
* @param addedLayouts the argument layouts to insert at given index.
* @return the new function descriptor.
* @throws IllegalArgumentException if {@code index < 0 || index > argumentLayouts().size()}.
*/
FunctionDescriptor insertArgumentLayouts(int index, MemoryLayout... addedLayouts);
/**
* Returns a function descriptor with the given memory layout as the new return layout.
* @param newReturn the new return layout.
* @return the new function descriptor.
*/
FunctionDescriptor changeReturnLayout(MemoryLayout newReturn);
/**
* Returns a function descriptor with the return layout dropped. This is useful to model functions
* which return no values.
* @return the new function descriptor.
*/
FunctionDescriptor dropReturnLayout();
/**
* Returns the method type consisting of the carrier types of the layouts in this function descriptor.
* <p>
* The carrier type of a layout is determined as follows:
* <ul>
* <li>If the layout is a {@link ValueLayout} the carrier type is determined through {@link ValueLayout#carrier()}.</li>
* <li>If the layout is a {@link GroupLayout} the carrier type is {@link MemorySegment}.</li>
* <li>If the layout is a {@link PaddingLayout}, or {@link SequenceLayout} an {@link IllegalArgumentException} is thrown.</li>
* </ul>
*
* @return the method type consisting of the carrier types of the layouts in this function descriptor
* @throws IllegalArgumentException if one or more layouts in the function descriptor can not be mapped to carrier
* types (e.g. if they are sequence layouts or padding layouts).
*/
MethodType toMethodType();
/**
* Creates a function descriptor with the given return and argument layouts.
* @param resLayout the return layout.
* @param argLayouts the argument layouts.
* @return the new function descriptor.
*/
static FunctionDescriptor of(MemoryLayout resLayout, MemoryLayout... argLayouts) {
Objects.requireNonNull(resLayout);
// Null checks are implicit in List.of(argLayouts)
return FunctionDescriptorImpl.of(resLayout, List.of(argLayouts));
}
/**
* Creates a function descriptor with the given argument layouts and no return layout.
* @param argLayouts the argument layouts.
* @return the new function descriptor.
*/
static FunctionDescriptor ofVoid(MemoryLayout... argLayouts) {
// Null checks are implicit in List.of(argLayouts)
return FunctionDescriptorImpl.ofVoid(List.of(argLayouts));
}
}
| [
"mirko.sertic@web.de"
] | mirko.sertic@web.de |
28814550e1953b708f1e4286988a17134170efa2 | b6e99b0346572b7def0e9cdd1b03990beb99e26f | /src/gcom/cadastro/localidade/ControladorLocalidadeLocalHome.java | 1c66726825653d4720d93bf097bfdc40ae4e5e44 | [] | no_license | prodigasistemas/gsan | ad64782c7bc991329ce5f0bf5491c810e9487d6b | bfbf7ad298c3c9646bdf5d9c791e62d7366499c1 | refs/heads/master | 2023-08-31T10:47:21.784105 | 2023-08-23T17:53:24 | 2023-08-23T17:53:24 | 14,600,520 | 19 | 20 | null | 2015-07-29T19:39:10 | 2013-11-21T21:24:16 | Java | ISO-8859-1 | Java | false | false | 723 | java | package gcom.cadastro.localidade;
import javax.ejb.CreateException;
/**
* <p>
*
* Title: GCOM
* </p>
* <p>
*
* Description: Sistema de Gestão Comercial
* </p>
* <p>
*
* Copyright: Copyright (c) 2004
* </p>
* <p>
*
* Company: COMPESA - Companhia Pernambucana de Saneamento
* </p>
*
* @author not attributable
* @version 1.0
*/
public interface ControladorLocalidadeLocalHome extends javax.ejb.EJBLocalHome {
/**
* < <Descrição do método>>
*
* @return Descrição do retorno
* @exception CreateException
* Descrição da exceção
*/
public ControladorLocalidadeLocal create() throws CreateException;
}
| [
"piagodinho@gmail.com"
] | piagodinho@gmail.com |
f6162e7528b86cbfc897b11513e916c830258b24 | 2bb14b297dc3b2e27539df52ad24240bf2495ec9 | /src/com/hrms/lib/Global.java | 0af64609ec7b64111d57195f8aff45476a5e4385 | [] | no_license | swathi858/test | 9b68147b14d67e8cc625461347edb3ce446c9ad8 | a3e42f093232419d6bd046f3caacfc43908159b8 | refs/heads/master | 2022-12-28T00:28:16.411024 | 2020-10-16T13:02:09 | 2020-10-16T13:02:09 | 304,627,106 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 501 | java | package com.hrms.lib;
import org.openqa.selenium.WebDriver;
public class Global {
public WebDriver driver;
// TODO Auto-generated method stub
//testdata
public String url="http://127.0.0.1/orangehrm-2.6/login.php";
public String un="admin";
public String pwd="admin";
//objectsinfo
public String txt_loginname="txtUserName";
public String txt_password="txtPassword";
public String btn_login="Submit";
public String link_logout="Logout";
}
| [
"HP@USER"
] | HP@USER |
f85fe74701f2c5cdf996c73f402541ad1177a01b | 430c7b3287018863c4e4b03562ce07585139965a | /src/circuito/Julio 9/aliens.java | 849be3bd519f1d9f0e7a4798832d2aa721763424 | [] | no_license | santjuan/ICPCTraining2013 | 6d98f09042b4f6b738ddd2bdf2eae0d77cb511df | 193c84b49bcbe3a0158b569a5d370fa4601f6e4c | refs/heads/master | 2016-09-05T08:57:35.612606 | 2013-12-15T00:10:17 | 2013-12-15T00:10:17 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,650 | java | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;
public class aliens
{
static class Scanner
{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st = new StringTokenizer("");
public String nextLine()
{
try
{
return br.readLine();
}
catch(Exception e)
{
throw(new RuntimeException());
}
}
public String next()
{
while(!st.hasMoreTokens())
{
String l = nextLine();
if(l == null)
return null;
st = new StringTokenizer(l);
}
return st.nextToken();
}
public int nextInt()
{
return Integer.parseInt(next());
}
public long nextLong()
{
return Long.parseLong(next());
}
public double nextDouble()
{
return Double.parseDouble(next());
}
public int[] nextIntArray(int n)
{
int[] res = new int[n];
for(int i = 0; i < res.length; i++)
res[i] = nextInt();
return res;
}
public long[] nextLongArray(int n)
{
long[] res = new long[n];
for(int i = 0; i < res.length; i++)
res[i] = nextLong();
return res;
}
public double[] nextDoubleArray(int n)
{
double[] res = new double[n];
for(int i = 0; i < res.length; i++)
res[i] = nextLong();
return res;
}
public void sortIntArray(int[] array)
{
Integer[] vals = new Integer[array.length];
for(int i = 0; i < array.length; i++)
vals[i] = array[i];
Arrays.sort(vals);
for(int i = 0; i < array.length; i++)
array[i] = vals[i];
}
public void sortLongArray(long[] array)
{
Long[] vals = new Long[array.length];
for(int i = 0; i < array.length; i++)
vals[i] = array[i];
Arrays.sort(vals);
for(int i = 0; i < array.length; i++)
array[i] = vals[i];
}
public void sortDoubleArray(double[] array)
{
Double[] vals = new Double[array.length];
for(int i = 0; i < array.length; i++)
vals[i] = array[i];
Arrays.sort(vals);
for(int i = 0; i < array.length; i++)
array[i] = vals[i];
}
public String[] nextStringArray(int n)
{
String[] vals = new String[n];
for(int i = 0; i < n; i++)
vals[i] = next();
return vals;
}
Integer nextInteger()
{
String s = next();
if(s == null)
return null;
return Integer.parseInt(s);
}
int[][] nextIntMatrix(int n, int m)
{
int[][] ans = new int[n][];
for(int i = 0; i < n; i++)
ans[i] = nextIntArray(m);
return ans;
}
}
static boolean leq(int a1, int a2, int b1, int b2)
{
return(a1 < b1 || a1 == b1 && a2 <= b2);
}
static boolean leq(int a1, int a2, int a3, int b1, int b2, int b3)
{
return(a1 < b1 || a1 == b1 && leq(a2,a3, b2,b3));
}
static int[] c;
static void radixPass(int[] a, int[] b, int[] r, int n, int K, int delta)
{
if(c == null || c.length != K + 1) c = new int[K + 1];
for(int i = 0; i <= K; i++) c[i] = 0;
for(int i = 0; i < n; i++) c[r[a[i] + delta]]++;
for(int i = 0, sum = 0; i <= K; i++)
{
int t = c[i];
c[i] = sum;
sum += t;
}
for (int i = 0; i < n; i++) b[c[r[a[i] + delta]]++] = a[i];
}
// find the suffix array SA of s[0..n-1] in {1..K}^n
// require s[n]=s[n+1]=s[n+2]=0, n>=2
static void suffixArray(int[] s, int[] SA, int n, int K)
{
int n0=(n+2)/3, n1=(n+1)/3, n2=n/3, n02=n0+n2;
int[] s12 = new int[n02 + 3]; s12[n02] = s12[n02+1] = s12[n02+2] = 0;
int[] SA12 = new int[n02 + 3]; SA12[n02]=SA12[n02+1]=SA12[n02+2]=0;
int[] s0 = new int[n0];
int[] SA0 = new int[n0];
for (int i=0, j=0; i < n + (n0 - n1); i++) if (i % 3 != 0) s12[j++] = i;
radixPass(s12, SA12, s, n02, K, 2);
radixPass(SA12, s12 , s, n02, K, 1);
radixPass(s12, SA12, s, n02, K, 0);
int name = 0, c0 = -1, c1 = -1, c2 = -1;
for(int i = 0; i < n02; i++)
{
if(s[SA12[i]] != c0 || s[SA12[i] + 1] != c1 || s[SA12[i] + 2] != c2)
{
name++;
c0 = s[SA12[i]];
c1 = s[SA12[i] + 1];
c2 = s[SA12[i] + 2];
}
if(SA12[i] % 3 == 1) s12[SA12[i] / 3] = name;
else s12[SA12[i] / 3 + n0] = name;
}
if (name < n02)
{
suffixArray(s12, SA12, n02, name);
for (int i = 0; i < n02; i++) s12[SA12[i]] = i + 1;
}
else for(int i = 0; i < n02; i++) SA12[s12[i] - 1] = i;
for (int i = 0, j = 0; i < n02; i++) if (SA12[i] < n0) s0[j++] = 3 * SA12[i];
radixPass(s0, SA0, s, n0, K, 0);
for(int p = 0, t = n0 - n1, k = 0; k < n; k++)
{
int i = (SA12[t] < n0 ? SA12[t] * 3 + 1 : (SA12[t] - n0) * 3 + 2);
int j = SA0[p];
if (SA12[t] < n0 ? leq(s[i], s12[SA12[t] + n0], s[j], s12[j/3]) :
leq(s[i],s[i+1],s12[SA12[t]-n0+1], s[j],s[j+1],s12[j/3+n0]))
{
SA[k] = i;
t++;
if (t == n02) for(k++; p < n0; p++, k++) SA[k] = SA0[p];
}
else
{
SA[k] = j;
p++;
if(p == n0) for(k++; t < n02; t++, k++) SA[k] = (SA12[t] < n0 ? SA12[t] * 3 + 1 : (SA12[t] - n0) * 3 + 2);
}
}
}
static class SuffixArray
{
int n;
int[] g, b, sa, lcp, rmq, aux;
char[] t;
SuffixArray(String entrada)
{
int tamMax = entrada.length();
g = new int[tamMax];
b = new int[tamMax];
sa = new int[tamMax];
lcp = new int[tamMax];
aux = new int[tamMax + 3];
int logn = 1;
int n = tamMax;
for (int k = 1; k < n; k *= 2) ++logn;
rmq = new int[n * logn];
buildSA(entrada);
}
void buildSA(String sas)
{
n = sas.length();
t = sas.toCharArray();
for(int i = 0; i < n; i++)
aux[i] = t[i];
aux[n] = aux[n + 1] = aux[n + 2] = 0;
suffixArray(aux, sa, n, 230);
buildLCP();
buildRMQ();
}
void buildLCP()
{
int[] a = sa;
int h = 0;
for(int i = 0; i < n; i++) b[a[i]] = i;
for(int i = 0; i < n; i++)
{
if (b[i] != 0)
{
for(int j = a[b[i] - 1]; j + h < n && i + h < n && t[j + h] == t[i + h]; ++h);
lcp[b[i]] = h;
}
else lcp[b[i]] = -1;
if(h > 0) --h;
}
}
void buildRMQ()
{
int[] b = rmq;
System.arraycopy(lcp, 0, b, 0, n);
int delta = 0;
for(int k = 1; k < n; k *= 2)
{
System.arraycopy(b, delta, b, n + delta, n);
delta += n;
for(int i = 0; i < n - k; i++) b[i + delta] = Math.min(b[i + delta], b[i + k + delta]);
}
}
// longest common prefix between suffixes sa[x] and sa[y]
int lcp(int x, int y)
{
return x == y ? n - sa[x] : x > y ? minimum(y + 1, x) : minimum(x + 1, y);
}
// range minimum query of lcp array
int minimum(int x, int y)
{
int z = y - x, k = 0, e = 1, s;
s = (((z & 0xffff0000) != 0) ? 1 : 0) << 4; z >>= s; e <<= s; k |= s;
s = (((z & 0x0000ff00) != 0) ? 1 : 0) << 3; z >>= s; e <<= s; k |= s;
s = (((z & 0x000000f0) != 0) ? 1 : 0) << 2; z >>= s; e <<= s; k |= s;
s = (((z & 0x0000000c) != 0) ? 1 : 0) << 1; z >>= s; e <<= s; k |= s;
s = (((z & 0x00000002) != 0) ? 1 : 0) << 0; z >>= s; e <<= s; k |= s;
return Math.min(rmq[x + n * k], rmq[y + n * k - e + 1]);
}
// outer LCP computation: O(m - o)
int computeLCP(char[] t, int n, char[] p, int m, int o, int k)
{
int i = o;
for (; i < m && k + i < n && p[i] == t[k + i]; ++i);
return i;
}
boolean COMP(int h, int k, int m, char[] p)
{
return (h == m || (k + h < n && p[h] < t[k + h]));
}
// Mamber-Myers's O(m + log n) string matching with LCP/RMQ
int find(String o)
{
char[] p = o.toCharArray();
int m = o.length();
int l = -1, lh = 0, r = n - 1, rh = computeLCP(t, n, p, m, 0, sa[n - 1]);
if(!COMP(rh, sa[r], m, p)) return -1;
for(int k = (l + r) / 2; l + 1 < r; k = (l + r) / 2)
{
int A = minimum(l + 1, k), B = minimum(k + 1, r);
if(A >= B)
{
if(lh < A) l = k;
else if(lh > A)
{
r = k;
rh = A;
}
else
{
int i = computeLCP(t, n, p, m, A, sa[k]);
if (COMP(i, sa[k], m, p))
{
r = k;
rh = i;
}
else
{
l = k;
lh = i;
}
}
}
else
{
if (rh < B) r = k;
else if (rh > B)
{
l = k;
lh = B;
}
else
{
int i = computeLCP(t, n, p, m, B, sa[k]);
if(COMP(i, sa[k], m, p))
{
r = k;
rh = i;
}
else
{
l = k;
lh = i;
}
}
}
}
return rh == m ? sa[r] : -1;
}
}
//Example with Range Maximum Query
static class SegmentTree
{
long[] M;
public SegmentTree(int size)
{
M = new long[size * 4 + 4];
}
//it's initially called update(1, 0, size - 1, pos, value)
void update(int node, int b, int e, int pos, long value)
{
//if the current interval doesn't intersect
//the updated position return -1
if (pos > e || pos < b)
return;
//if the current interval is the updated position
//then update it
if (b == e)
{
M[node] = value;
return;
}
update(2 * node, b, (b + e) / 2, pos, value);
update(2 * node + 1, (b + e) / 2 + 1, e, pos, value);
//update current value after updating childs
M[node] = Math.max(M[2 * node], M[2 * node + 1]);
}
//it's initially called query(1, 0, size - 1, i, j)
long query(int node, int b, int e, int i, int j)
{
long p1, p2;
//if the current interval doesn't intersect
//the query interval return -1
if (i > e || j < b)
return -1;
//if the current interval is completely included in
//the query interval return the value of this node
if (b >= i && e <= j)
return M[node];
//compute the value from
//left and right part of the interval
p1 = query(2 * node, b, (b + e) / 2, i, j);
p2 = query(2 * node + 1, (b + e) / 2 + 1, e, i, j);
//join them to generate result
long tmp = Math.max(p1, p2);
return tmp;
}
}
public static void main(String[] args)
{
Scanner sc = new Scanner();
while(true)
{
int m = sc.nextInt();
if(m == 0) return;
String entrada = sc.nextLine();
SuffixArray suffix = new SuffixArray(entrada);
SegmentTree segment = new SegmentTree(entrada.length());
for(int i = 0; i < entrada.length(); i++)
segment.update(1, 0, entrada.length() - 1, i, suffix.sa[i]);
int bestLen = -1;
int bestRight = 0;
for(int i = 0; i + m <= entrada.length(); i++)
{
int lcp = suffix.lcp(i, i + m - 1);
if(lcp > 0)
if(bestLen <= lcp)
{
int rightMost = (int) segment.query(1, 0, entrada.length() - 1, i, i + m - 1);
if(bestLen == lcp && bestRight > rightMost) continue;
bestLen = lcp;
bestRight = rightMost;
}
}
if(bestLen == -1) System.out.println("none");
else System.out.println(bestLen + " " + bestRight);
}
}
}
| [
"santigutierrez1@gmail.com"
] | santigutierrez1@gmail.com |
d17671440cbe88aab297e6de85b602c7b2388388 | f136a2dce4d129559bcb50cfa4fd368017c38721 | /app/src/main/java/com/zhuanghongji/mpchartexample/fragments/SineCosineFragment.java | c22e2c979c321340184e0e1210958fa25ea6433e | [] | no_license | hexingbo/MPChartExample | 0624d3aae86aab1efcf20166bfdd3071b000839c | ac9caecb283846638eb3b56b23ebcb0fff6a993c | refs/heads/master | 2021-08-30T20:30:22.276192 | 2017-12-19T09:55:54 | 2017-12-19T09:55:54 | 114,748,344 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,666 | java | package com.zhuanghongji.mpchartexample.fragments;
import android.graphics.Typeface;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.github.mikephil.charting.charts.LineChart;
import com.github.mikephil.charting.components.Legend;
import com.github.mikephil.charting.components.XAxis;
import com.github.mikephil.charting.components.YAxis;
import com.zhuanghongji.mpchartexample.R;
public class SineCosineFragment extends SimpleFragment {
public static Fragment newInstance() {
return new SineCosineFragment();
}
private LineChart mChart;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.frag_simple_line, container, false);
mChart = (LineChart) v.findViewById(R.id.lineChart1);
mChart.getDescription().setEnabled(false);
mChart.setDrawGridBackground(false);
mChart.setData(generateLineData());
mChart.animateX(3000);
Typeface tf = Typeface.createFromAsset(getActivity().getAssets(),"OpenSans-Light.ttf");
Legend l = mChart.getLegend();
l.setTypeface(tf);
YAxis leftAxis = mChart.getAxisLeft();
leftAxis.setTypeface(tf);
leftAxis.setAxisMaximum(1.2f);
leftAxis.setAxisMinimum(-1.2f);
mChart.getAxisRight().setEnabled(false);
XAxis xAxis = mChart.getXAxis();
xAxis.setEnabled(false);
return v;
}
}
| [
"386985454@qq.com"
] | 386985454@qq.com |
47fc06e6c23d2f21fdbadead282b1cb6bd98e5bb | 57e06dbe4a6a342837af48e86ac78336f452d97f | /Week04/Week04_hyeonji/app/src/main/java/com/example/week04_hyeonji/Fragment_Game.java | 4b272f4d1f6f04a85ccd33591e432f52b8c1a98d | [] | no_license | Apptive-12th/Apptive12Study | a86152551cba59312199d42ae36fa6339d319438 | e4d15f10b7bae08a05041d7be09fd46513bce064 | refs/heads/master | 2020-04-16T06:40:29.329676 | 2019-03-24T04:32:53 | 2019-03-24T04:32:53 | 165,356,478 | 0 | 0 | null | 2019-03-24T04:35:30 | 2019-01-12T06:45:33 | Java | UTF-8 | Java | false | false | 561 | java | package com.example.week04_hyeonji;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
public class Fragment_Game extends Fragment {
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
return inflater.inflate(R.layout.fragment_game,null);
}
}
| [
"gussm120@naver.com"
] | gussm120@naver.com |
9bc86198676e7ab6c4d2ecb711aa48a7a28bc0b8 | 30053e0fe21f828e099c522b07cbb4c9a118d799 | /app/src/main/java/com/celerii/celerii/adapters/TutorialsAdapter.java | 0b4adc800962d5f5d7b1c5425561d3e11e85e6b2 | [] | no_license | Celeriillc/March21 | 521cba2a0df82c02d4a69cfb29675d4888170fa6 | 90c8b281785a6c28e53635d0009994a8d3942527 | refs/heads/master | 2023-08-22T04:55:31.778628 | 2021-10-24T11:09:15 | 2021-10-24T11:09:15 | 349,854,275 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,084 | java | package com.celerii.celerii.adapters;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import androidx.recyclerview.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.celerii.celerii.Activities.Settings.BrowserActivityForInfo;
import com.celerii.celerii.Activities.Settings.TutorialsDetailActivity;
import com.celerii.celerii.R;
import com.celerii.celerii.models.TutorialModel;
import java.util.List;
public class TutorialsAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
private List<TutorialModel> tutorialModelList;
private Context context;
public static final int Header = 1;
public static final int Normal = 2;
public static final int Footer = 3;
public class MyViewHolder extends RecyclerView.ViewHolder {
public TextView tutorialTitle;
public View clickableView;
public MyViewHolder(final View view) {
super(view);
tutorialTitle = (TextView) view.findViewById(R.id.tutorialtitle);
clickableView = view;
}
}
public class HeaderViewHolder extends RecyclerView.ViewHolder {
TextView tutorialHeader;
public HeaderViewHolder(View view) {
super(view);
tutorialHeader = (TextView) view.findViewById(R.id.tutorialheader);
}
}
public TutorialsAdapter(List<TutorialModel> tutorialModelList, Context context) {
this.tutorialModelList = tutorialModelList;
this.context = context;
}
@Override
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View rowView;
switch (viewType) {
case Normal:
rowView = LayoutInflater.from(parent.getContext()).inflate(R.layout.tutorial_row, parent, false);
return new TutorialsAdapter.MyViewHolder(rowView);
case Header:
rowView = LayoutInflater.from(parent.getContext()).inflate(R.layout.tutorial_header, parent, false);
return new TutorialsAdapter.HeaderViewHolder(rowView);
default:
rowView = LayoutInflater.from(parent.getContext()).inflate(R.layout.tutorial_row, parent, false);
return new TutorialsAdapter.MyViewHolder(rowView);
}
}
public void onBindViewHolder(final RecyclerView.ViewHolder holder, int position) {
if (holder instanceof MyViewHolder) {
final TutorialModel tutorialModel = tutorialModelList.get(position);
((MyViewHolder) holder).tutorialTitle.setText(tutorialModel.getTitle());
((MyViewHolder) holder).clickableView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(context, TutorialsDetailActivity.class);
Bundle bundle = new Bundle();
bundle.putString("title", tutorialModel.getTitle());
bundle.putString("body", tutorialModel.getHtmlBody());
bundle.putString("youtubeVideoID", tutorialModel.getYoutubeVideoID());
bundle.putString("poster", tutorialModel.getCreatedBy());
intent.putExtras(bundle);
((Activity)context).startActivity(intent);
}
});
}
}
@Override
public int getItemCount() {
return tutorialModelList.size();
}
@Override
public int getItemViewType(int position) {
if(isPositionHeader (position)) {
return Header;
} else if(isPositionFooter (position)) {
return Footer;
}
return Normal;
}
private boolean isPositionHeader (int position) {
return position == 0;
}
private boolean isPositionFooter (int position) {
return position == tutorialModelList.size () + 1;
}
}
| [
"egbeejay@gmail.com"
] | egbeejay@gmail.com |
e13798a45caa3f746a1c275d3cfad24a3f39db75 | bb7f944f4fe14358a1f84898f3a0b12cf1590c9a | /android/support/v4/view/MotionEventCompatHoneycombMr1.java | c9ed574b8df8a2de01db23d2c37463e2d6497485 | [] | no_license | snehithraj27/Pedometer-Android-Application | 0c53fe02840920c0449baeb234eda4b43b6cf8b6 | e0d93eda0b5943b6ab967d38f7aa3240d2501dfb | refs/heads/master | 2020-03-07T01:28:11.432466 | 2018-03-28T18:54:59 | 2018-03-28T18:54:59 | 127,184,714 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 622 | java | package android.support.v4.view;
import android.view.MotionEvent;
class MotionEventCompatHoneycombMr1
{
static float getAxisValue(MotionEvent paramMotionEvent, int paramInt)
{
return paramMotionEvent.getAxisValue(paramInt);
}
static float getAxisValue(MotionEvent paramMotionEvent, int paramInt1, int paramInt2)
{
return paramMotionEvent.getAxisValue(paramInt1, paramInt2);
}
}
/* Location: /Users/snehithraj/Desktop/a/dex2jar-2.0/classes-dex2jar.jar!/android/support/v4/view/MotionEventCompatHoneycombMr1.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | [
"snehithraj27@users.noreply.github.com"
] | snehithraj27@users.noreply.github.com |
d351bbc97f37d58a19d058a615f17f77cf62ffe6 | 0f97e37247ce3caea5c0adcf7cbfdd0cb70faad7 | /RoamRest_Refactored/RoamRest_Refactored/src/main/java/com/bt/ngoss/common/helper/MessageHelper.java | 2e6236bd55f7b8bac66117a0189b12f26416e21b | [] | no_license | rkb160391/RC | 63228b556227d396596632f147e22d83c80d11fc | 0eeb81ba67168dc2cd0d5f5d86cebff8db3dfabd | refs/heads/master | 2022-12-20T20:40:41.971541 | 2018-05-30T04:12:51 | 2018-05-30T04:12:51 | 135,385,598 | 0 | 0 | null | 2022-12-16T07:55:45 | 2018-05-30T03:55:46 | Java | UTF-8 | Java | false | false | 628 | java | package com.bt.ngoss.common.helper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.bt.ngoss.model.Message;
import com.bt.ngoss.service.MessageService;
import com.bt.ngoss.vo.MessageVO;
@Component
public class MessageHelper {
@Autowired
MessageService messageService;
public MessageVO handleBusinessMessage(int messageCode) {
MessageVO messageVO = new MessageVO();
Message message = messageService.getMessage(messageCode);
messageVO.setMessagecode(message.getCode());
messageVO.setMessage(message.getMessage());
return messageVO;
}
}
| [
"rkb160391@gmail.com"
] | rkb160391@gmail.com |
cf2d0ba9320408a75063bcbc723e900623ecde32 | 3df556c8e89e7316868b9a261f85a27aa7eb5859 | /src/genFileList/src/ExtractionOperationUtil.java | e14b15d9251658fd14ed7ca3b6eb11fbe3778625 | [] | no_license | laijingfeng/FontPruner | 0953467128d5a041a545e9e9b4caaeecd5a5b15a | bc3852fb9ea291658e3766ac02a23864eeb882bf | refs/heads/master | 2021-12-31T01:46:57.320251 | 2021-12-21T13:34:48 | 2021-12-21T13:34:48 | 145,287,343 | 2 | 0 | null | 2018-08-19T08:51:28 | 2018-08-19T08:51:28 | null | GB18030 | Java | false | false | 2,825 | java | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class ExtractionOperationUtil {
/***
* 是否是汉字
*/
public static boolean isChineseCharacters(String str){
boolean temp = false;
Pattern p=Pattern.compile("[\u4e00-\u9fa5]");
Matcher m=p.matcher(str);
if(m.find()){
temp = true;
}
return temp;
}
/**
* 筛选有效字符
*/
public static String ExtractVaildString(String str) {
return str.replaceAll( "\\s*|\t|\r|\n","");
}
public static void WriteStr2File(String str,File file,String encode){
try {
FileOutputStream writerStream = new FileOutputStream(file);
BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(writerStream,encode));
writer.write(str);
writer.close();
} catch (FileNotFoundException e1) {
e1.printStackTrace();
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
public static List<String> ExtractStringListFromFile(File file) {
ArrayList<String> stringList =new ArrayList<String>();
try {
String encode =EncodingDetect.getJavaEncode(file.getAbsolutePath());
BufferedReader bufReader =
new BufferedReader(
new InputStreamReader(
new FileInputStream(
file),encode));
for (String tmp = null; (tmp = bufReader.readLine()) != null; tmp = null) {
stringList.add(tmp);
}
bufReader.close();
} catch (IOException e) {
e.printStackTrace();
}
return stringList;
}
public static String ExtractStringFromFile(File file) {
StringBuffer strBuf =null;
try {
String encode =EncodingDetect.getJavaEncode(file.getPath());
BufferedReader bufReader =
new BufferedReader(
new InputStreamReader(
new FileInputStream(
file),encode));
strBuf = new StringBuffer();
for (String tmp = null; (tmp = bufReader.readLine()) != null; tmp = null) {
strBuf.append(tmp);
}
bufReader.close();
} catch (IOException e) {
e.printStackTrace();
}
return strBuf.toString();
}
public static void checkCharInMapNum(
Map<Character, Integer> map, char c) {
if(!map.containsKey(c))
{
map.put(c,1);
}else{
map.put(c,map.get(c)+1);
}
}
}
| [
"gemfeeling@hotmail.com"
] | gemfeeling@hotmail.com |
3bc3beee7b29d8471d2bae0f88783f40bad38f7f | 5bfcb396567079d9fc75ba16488e304df601c197 | /app/src/main/java/tw/com/masterhand/gmorscrm/model/ModifyApprovers.java | eb938c00a58f0a2ad59bc5784f9f2d1f25039c08 | [] | no_license | mangle12/Android_GmorsCRM_20191231 | 70bb5e495cdc1fc0b6dfe6bc3f4040a601df58e5 | bf7f49cc0510c2bfdfb30b805cf531f9098098e6 | refs/heads/master | 2021-02-12T04:01:15.042347 | 2020-03-06T02:59:51 | 2020-03-06T02:59:51 | 244,559,120 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,002 | java | package tw.com.masterhand.gmorscrm.model;
public class ModifyApprovers {
public String trip_id;// TripID
public String approval_stage_id;
public String approval_stage_user_id;// 被更換的user_id
public String user_id;// 更換的user_id
public String getTrip_id() {
return trip_id;
}
public void setTrip_id(String trip_id) {
this.trip_id = trip_id;
}
public String getApproval_stage_id() {
return approval_stage_id;
}
public void setApproval_stage_id(String approval_stage_id) {
this.approval_stage_id = approval_stage_id;
}
public String getApproval_stage_user_id() {
return approval_stage_user_id;
}
public void setApproval_stage_user_id(String approval_stage_user_id) {
this.approval_stage_user_id = approval_stage_user_id;
}
public String getUser_id() {
return user_id;
}
public void setUser_id(String user_id) {
this.user_id = user_id;
}
}
| [
"chy080203@gmail.com"
] | chy080203@gmail.com |
6fb297860641388b2bbd7680603863dceb872322 | 660cabcd681d12096d5259bd629e2e24f499f03a | /src/chatmodule/ClientsHolder.java | 77884bb67108c203b30d01bc7e4611f9161b7999 | [] | no_license | achrafelkari/chat-pair-a-pair | a559047b40490d598f4890cdf0ff454eef5fca17 | 372ee973d018eec2bf0f6937836b0396fb6927f9 | refs/heads/master | 2021-01-10T14:52:55.264045 | 2016-01-28T08:46:21 | 2016-01-28T08:46:21 | 50,567,994 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 741 | java | package chatmodule;
/**
* chatmodule/ClientsHolder.java .
* Generated by the IDL-to-Java compiler (portable), version "3.2"
* from chat.idl
* lundi 25 janvier 2016 22 h 27 CET
*/
public final class ClientsHolder implements org.omg.CORBA.portable.Streamable
{
public String value[] = null;
public ClientsHolder ()
{
}
public ClientsHolder (String[] initialValue)
{
value = initialValue;
}
public void _read (org.omg.CORBA.portable.InputStream i)
{
value = chatmodule.ClientsHelper.read (i);
}
public void _write (org.omg.CORBA.portable.OutputStream o)
{
chatmodule.ClientsHelper.write (o, value);
}
public org.omg.CORBA.TypeCode _type ()
{
return chatmodule.ClientsHelper.type ();
}
}
| [
"elkari.achraf@gmail.com"
] | elkari.achraf@gmail.com |
5b452e453afa952020788def1c6b48751b88a329 | 36d028bd5d8c02b7f68cd74bdc7721df05d569c9 | /src/main/java/com/example/demo/designpattern设计模式/structural结构型/proxy代理模式/db/DataSourceContextHolder.java | 1907f5ea641007e6b53c4361bf818c369e63f429 | [] | no_license | 2571138262/Design-pattern-and-principles | 43f45b517dd9317c8cedcd3981af9efac2ae615e | fc905a0ad8f2937fb6e7bde431bc501e510290fe | refs/heads/master | 2022-08-18T15:18:47.790037 | 2020-05-03T01:13:05 | 2020-05-03T01:13:05 | 217,059,664 | 0 | 0 | null | 2021-03-31T21:50:07 | 2019-10-23T13:06:54 | Java | UTF-8 | Java | false | false | 582 | java | package com.example.demo.designpattern设计模式.structural结构型.proxy代理模式.db;
/**
* 数据源上下文处理类
*/
public class DataSourceContextHolder {
// 里边存放dataSource的Bean name
private static final ThreadLocal<String> CONTEXT_HOLDER = new ThreadLocal<>();
public static void setDBType(String dbType){
CONTEXT_HOLDER.set(dbType);
}
public static String getDBType(){
return (String) CONTEXT_HOLDER.get();
}
public static void clearDBType(){
CONTEXT_HOLDER.remove();
}
}
| [
"2571138262@qq.com"
] | 2571138262@qq.com |
46e728346e94ff56edda7f625ccdd9257d433780 | a49be5d9ceb442d28a6c73d99be02675235a2ec2 | /src/com/korres/controller/admin/TemplateController.java | ffb20b5bc5b6207775bd18b72bb7a8701f7ec141 | [] | no_license | liuyanhao/korres | ab8eeb46226315d04d8d1d5ca8f29e7ad87b6de2 | b6316debd64ecef268df714b58ce409249471335 | refs/heads/master | 2020-04-13T23:22:26.684772 | 2018-12-29T16:59:46 | 2018-12-29T16:59:46 | 163,504,526 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,107 | java | package com.korres.controller.admin;
import javax.annotation.Resource;
import com.korres.service.TemplateService;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer;
import com.korres.Template.TemplateType;
@Controller("adminTemplateController")
@RequestMapping({ "/admin/template" })
public class TemplateController extends BaseController {
@Resource(name = "freeMarkerConfigurer")
private FreeMarkerConfigurer freeMarkerConfigurer;
@Resource(name = "templateServiceImpl")
private TemplateService templateService;
@RequestMapping(value = { "/edit" }, method = { org.springframework.web.bind.annotation.RequestMethod.GET })
public String edit(String id, ModelMap model) {
if (StringUtils.isEmpty(id)){
return "/admin/common/error";
}
model.addAttribute("template", this.templateService.get(id));
model.addAttribute("content", this.templateService.read(id));
return "/admin/template/edit";
}
@RequestMapping(value = { "/update" }, method = { org.springframework.web.bind.annotation.RequestMethod.POST })
public String update(String id, String content,
RedirectAttributes redirectAttributes) {
if ((StringUtils.isEmpty(id)) || (content == null)){
return "/admin/common/error";
}
this.templateService.write(id, content);
this.freeMarkerConfigurer.getConfiguration().clearTemplateCache();
setRedirectAttributes(redirectAttributes, ADMIN_MESSAGE_SUCCESS);
return "redirect:list.jhtml";
}
@RequestMapping(value = { "/list" }, method = { org.springframework.web.bind.annotation.RequestMethod.GET })
public String list(TemplateType type, ModelMap model) {
model.addAttribute("type", type);
model.addAttribute("types", TemplateType.values());
model.addAttribute("templates", this.templateService.getList(type));
return "/admin/template/list";
}
} | [
"1094921525@qq.com"
] | 1094921525@qq.com |
8c6a521e9d0f765e2eed51eb8ce607d4fd02461c | b451d80fa0f3d831a705ed58314b56dcd180ef4a | /kpluswebup_dao/src/main/java/com/kpluswebup/web/domain/CustomerGroupSetDTO.java | dca40ec1fd428d8ca5258633e39fa19d4d983474 | [] | no_license | beppezhang/sobe | 8cbd9bbfcc81330964c2212c2a75f71fe98cc8df | 5fafd84d96a3b082edbadced064a9c135115e719 | refs/heads/master | 2021-01-13T06:03:19.431407 | 2017-06-22T03:35:54 | 2017-06-22T03:35:54 | 95,071,332 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,058 | java | package com.kpluswebup.web.domain;
import java.util.Date;
/**
* @author Administrator 会员分组条件
*/
public class CustomerGroupSetDTO extends BaseDTO {
private Long id;
private String groupID;
private Integer setType; // 条件类型 1:年龄 2:累计积分3:消费金额 4:注册日期5可用积分6性别
private String minimum;
private String maxmum;
private Integer isDeleted;
private String creator;
private Date createTime;
private String modifier;
private Date modifyTime;
public String getGroupID() {
return groupID;
}
public void setGroupID(String groupID) {
this.groupID = groupID;
}
public Integer getSetType() {
return setType;
}
public void setSetType(Integer setType) {
this.setType = setType;
}
public String getMinimum() {
return minimum;
}
public void setMinimum(String minimum) {
this.minimum = minimum;
}
public String getMaxmum() {
return maxmum;
}
public void setMaxmum(String maxmum) {
this.maxmum = maxmum;
}
public Integer getIsDeleted() {
return isDeleted;
}
public void setIsDeleted(Integer isDeleted) {
this.isDeleted = isDeleted;
}
public String getCreator() {
return creator;
}
public void setCreator(String creator) {
this.creator = creator;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public String getModifier() {
return modifier;
}
public void setModifier(String modifier) {
this.modifier = modifier;
}
public Date getModifyTime() {
return modifyTime;
}
public void setModifyTime(Date modifyTime) {
this.modifyTime = modifyTime;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
}
| [
"zhangshangliang@sunlight.bz"
] | zhangshangliang@sunlight.bz |
0705a7ae137f8894e5fdc0155f9a59af9b7bfb7e | fd01cec88e44f66d0772eb0a5ae5e7d3d5dcb237 | /app/src/main/java/cn/ed/pku/sean/weather/bean/FutureWeather.java | 01a4793c4f1f3effd0ef89c6765c7f5f62be792c | [] | no_license | zhtea/Weather | 5c7d650c79c2911b47c30c23565b17abac1315c5 | a764f0b1c3f7c3109ccc621b919d96b46170f555 | refs/heads/master | 2021-01-10T01:48:23.371849 | 2015-12-08T13:18:08 | 2015-12-08T13:18:08 | 44,236,132 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 949 | java | package cn.ed.pku.sean.weather.bean;
/**
* Created by Bryce on 2015/12/8.
*/
public class FutureWeather {
private String fdate;
private String fhigh;
private String flow;
private String ftype;
private String ffengxiang;
public String getFdate() {
return fdate;
}
public void setFdate(String fdate) {
this.fdate = fdate;
}
public String getFhigh() {
return fhigh;
}
public void setFhigh(String fhigh) {
this.fhigh = fhigh;
}
public String getFlow() {
return flow;
}
public void setFlow(String flow) {
this.flow = flow;
}
public String getFtype() {
return ftype;
}
public void setFtype(String ftype) {
this.ftype = ftype;
}
public String getFfengxiang() {
return ffengxiang;
}
public void setFfengxiang(String ffengxiang) {
this.ffengxiang = ffengxiang;
}
}
| [
"zslzone@gmail.com"
] | zslzone@gmail.com |
6afcbf7e49c3c0ddd7dcd86821891f33fa5c2a00 | 93c5acd52cec077929932437da69faf5f22b6e83 | /app/src/main/java/homePage/tests_page/test_maths.java | 87592035dd68a3d7b855298c8311f4442534f262 | [] | no_license | knkbga/IIT-Project-JEE | b203a14c8ae1d4158974adb0858eeef91733054b | b8501103b05885f74736127867584ae64d1fc315 | refs/heads/master | 2020-05-04T20:51:54.229704 | 2017-03-18T06:55:57 | 2017-03-18T06:55:57 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 508 | java | package homePage.tests_page;
/**
* Created by kanak on 16/10/16.
*/
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.example.nitin.myapp.R;
public class test_maths extends Fragment {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
return inflater.inflate(R.layout.test_maths, container, false);
}
} | [
"kanakbagga1@gmail.com"
] | kanakbagga1@gmail.com |
57b024517f094eee6dfba81af8b29b197d598a6c | 51bbfe4653e7ba7c95e7822151b2f8b59ca8083c | /microsoft/glide-3.8.0/library/src/androidTest/java/com/bumptech/glide/load/engine/CacheLoaderTest.java | aac4e5d2fc5d6ec097445201d8a0aa8544c99885 | [
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0",
"BSD-3-Clause",
"LicenseRef-scancode-generic-cla",
"BSD-2-Clause-Views",
"Xfig",
"MIT",
"LicenseRef-scancode-public-domain"
] | permissive | Ankitvaibs/Virus | 8a744ba01ba2b1e09fea95aeacd37518261cd187 | debf3a893ee3cf328e155b1eb760ce2b7290043a | refs/heads/master | 2020-04-29T03:07:12.010478 | 2019-03-18T03:22:49 | 2019-03-18T03:22:49 | 175,797,516 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,959 | java | package com.bumptech.glide.load.engine;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyInt;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import com.bumptech.glide.load.Key;
import com.bumptech.glide.load.ResourceDecoder;
import com.bumptech.glide.load.engine.cache.DiskCache;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.annotation.Config;
import java.io.File;
import java.io.IOException;
@RunWith(RobolectricTestRunner.class)
@Config(manifest = Config.NONE, emulateSdk = 18)
public class CacheLoaderTest {
private DiskCache diskCache;
private CacheLoader cacheLoader;
private Key key;
private ResourceDecoder<File, Object> decoder;
private Resource<Object> expected;
@SuppressWarnings("unchecked")
@Before
public void setUp() {
diskCache = mock(DiskCache.class);
cacheLoader = new CacheLoader(diskCache);
key = mock(Key.class);
decoder = mock(ResourceDecoder.class);
expected = mock(Resource.class);
}
@Test
public void testCacheDecoderIsCalledIfInCache() throws IOException {
File result = new File("test");
when(diskCache.get(eq(key))).thenReturn(result);
int width = 100;
int height = 101;
cacheLoader.load(key, decoder, width, height);
verify(decoder).decode(eq(result), eq(width), eq(height));
}
@Test
public void testReturnsDecodedResourceIfInCache() throws IOException {
int width = 50;
int height = 75;
File file = new File("test");
when(diskCache.get(eq(key))).thenReturn(file);
when(decoder.decode(eq(file), eq(width), eq(height))).thenReturn(expected);
assertEquals(expected, cacheLoader.load(key, decoder, width, height));
}
@Test
public void testReturnsNullIfNotInCache() {
assertNull(cacheLoader.load(key, decoder, 100, 100));
}
@Test
public void testDiskCacheEntryIsDeletedIfCacheDecoderThrows() throws IOException {
when(diskCache.get(eq(key))).thenReturn(new File("test"));
when(decoder.decode(any(File.class), anyInt(), anyInt())).thenThrow(new IOException("Test"));
cacheLoader.load(key, decoder, 100, 100);
verify(diskCache).delete(eq(key));
}
@Test
public void testDiskCacheEntryIsDeletedIfDiskCacheContainsIdAndCacheDecoderReturnsNull() throws IOException {
when(diskCache.get(eq(key))).thenReturn(new File("test"));
when(decoder.decode(any(File.class), anyInt(), anyInt())).thenReturn(null);
cacheLoader.load(key, decoder, 100, 101);
verify(diskCache).delete(eq(key));
}
} | [
"42571581+Ankitvaibs@users.noreply.github.com"
] | 42571581+Ankitvaibs@users.noreply.github.com |
6e8a3329db1148f75dd4c0739cbf605c78b45902 | 1e72bb8942652b1828d9391394cd290cb38692dd | /eclipse_emf_casestudy/com.sap.casestudy.subhankar.ui/src/com/sap/casestudy/subhankar/ui/views/MTSLabelProvider.java | 6a25ac1dbb625988b08204ef4fb38c1b9f169aa3 | [] | no_license | subhankarc/myWork | 2b57edc1c78fd939b34f7f2ce0da99c382bb3e35 | 6f769ba31a8fcec5c6284a9de8afb17a0db14197 | refs/heads/master | 2021-01-15T13:44:24.658850 | 2015-05-11T10:57:58 | 2015-05-11T10:57:58 | 33,064,544 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,088 | java | package com.sap.casestudy.subhankar.ui.views;
import org.eclipse.core.resources.IProject;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ILabelProviderListener;
import org.eclipse.swt.graphics.Image;
import com.sap.casestudy.subhankar.casestudymodel.BusinessObject;
import com.sap.casestudy.subhankar.casestudymodel.DeploymentUnit;
import com.sap.casestudy.subhankar.casestudymodel.IAdtMainObject;
import com.sap.casestudy.subhankar.casestudymodel.IAdtObject;
import com.sap.casestudy.subhankar.casestudymodel.ProcessComponent;
import com.sap.casestudy.subhankar.ui.util.ImageUtilityClass;
public class MTSLabelProvider implements ILabelProvider {
@Override
public Image getImage(Object element) {
Image image = null;
if (element instanceof IProject) {
image = ImageUtilityClass.getImage(ImageUtilityClass.ICON_MTS_PROJECT);
} else if (element instanceof ITreeNode) {
return ((ITreeNode) element).getImage();
} else if (element instanceof DeploymentUnit) {
image = ImageUtilityClass.getImage(ImageUtilityClass.ICON_DEPLOYMENT_UNIT);
} else if (element instanceof ProcessComponent) {
image = ImageUtilityClass.getImage(ImageUtilityClass.ICON_PROCESS_COMPONENT);
} else if (element instanceof BusinessObject) {
image = ImageUtilityClass.getImage(ImageUtilityClass.ICON_BUSINESS_OBJECT);
}
return image;
}
@Override
public String getText(Object element) {
if (element instanceof IProject) {
return ((IProject) element).getName();
} else if (element instanceof IAdtObject) {
return ((IAdtMainObject) element).getTechnicalName();
} else if (element instanceof ITreeNode) {
return ((ITreeNode) element).getNodeLabel();
}
return null;
}
@Override
public void addListener(ILabelProviderListener listener) {
}
@Override
public void dispose() {
}
@Override
public boolean isLabelProperty(Object element, String property) {
return false;
}
@Override
public void removeListener(ILabelProviderListener listener) {
}
}
| [
"s.chattopadhyay@sap.com"
] | s.chattopadhyay@sap.com |
1a9076a1a236ee309e82b1d7e0ec8699211362af | 4c66ca92a54046e77c7bfa8b4ecbe019fb7a8300 | /generic-request-processing/src/test/java/com/mydomain/example/ApplicationMain.java | d15e6f3c34338e6829e847ebe3736131a2ad288d | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | griseau/sample-apps | 62cc8b17775871d0cd925f3ffae1d0d5095a7592 | 6ff38dd15c02ade68d90f9dfa65117cc554fec4f | refs/heads/master | 2021-07-12T02:44:44.320901 | 2021-02-09T16:17:35 | 2021-02-09T16:17:35 | 271,524,697 | 0 | 0 | Apache-2.0 | 2020-06-11T11:06:17 | 2020-06-11T11:06:16 | null | UTF-8 | Java | false | false | 1,198 | java | // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.mydomain.example;
import com.yahoo.application.Application;
import com.yahoo.application.Networking;
import org.junit.Test;
import java.nio.file.FileSystems;
import java.util.Objects;
import static org.junit.Assume.assumeTrue;
/**
* This uses the Application class to set up a container instance of this application
* in this JVM. All other aspects of the application package than a single container
* cluster is ignored. This is useful for e.g starting a container instance in your IDE
* and serving real HTTP requests for interactive debugging.
* <p>
* After starting this you can open
* http://localhost:8080/processing/
* in your browser.
*/
public class ApplicationMain {
public static void main(String[] args) throws Exception {
try (Application app = Application.fromApplicationPackage(FileSystems.getDefault().getPath("src/main/application"),
Networking.enable)) {
Objects.requireNonNull(app);
Thread.sleep(Long.MAX_VALUE);
}
}
}
| [
"bratseth@oath.com"
] | bratseth@oath.com |
3df36c2aa6902508e9e16eb0a1c38119d19ac3cc | cce31526a4ebe850bc26f4509dead991f3f01ba4 | /JavaSWF-J2AVM/src/org/javaswf/j2avm/model/attributes/DeprecatedAttribute.java | e2b79b4ff51819f4620a6fae032d4e960b6bd370 | [] | no_license | jukka/javaswf | 68aa6c5a08784958da56d9534a6fc4e33bfd17b3 | 42085273de31026067d0f6b2d772bb4fd02a06e1 | refs/heads/master | 2023-08-15T02:42:05.076507 | 2008-10-20T12:04:56 | 2008-10-20T12:04:56 | 538,528 | 4 | 0 | null | null | null | null | UTF-8 | Java | false | false | 694 | java | package org.javaswf.j2avm.model.attributes;
import java.io.DataInput;
import java.io.IOException;
import org.epistem.io.IndentingPrintWriter;
import org.javaswf.j2avm.model.parser.ConstantPool;
/**
* The deprecated attribute
*
* @author nickmain
*/
public class DeprecatedAttribute extends AttributeModel {
public DeprecatedAttribute() {
super( AttributeName.Deprecated.name() );
}
public static DeprecatedAttribute parse( ConstantPool pool, DataInput in ) throws IOException {
return new DeprecatedAttribute();
}
/** Dump for debug purposes */
public final void dump( IndentingPrintWriter out ) {
out.println( name );
}
}
| [
"nickmain@e29addf9-c237-0410-9dab-b6fc98e26c49"
] | nickmain@e29addf9-c237-0410-9dab-b6fc98e26c49 |
a4c57085c5280a9869b9cd452c937b52205c3f1a | 9f1b16f8724b1f2927e19da117dc9fb570dbf22c | /DNacosDemo/model/src/main/java/com/amd/bean/DemoBean.java | 73722bc99fe2250529937d9fcdce078bbd18cb8a | [] | no_license | jurson86/dubbo-nacos-demo | c7b24493f8cb73caba13ef0151eb8bf6bff0d8ff | 6ddcfe4604d43e462349734c15c33a4ca61c8972 | refs/heads/master | 2022-07-02T15:32:41.759668 | 2019-08-10T07:15:13 | 2019-08-10T07:15:13 | 201,359,008 | 0 | 0 | null | 2022-06-10T19:58:53 | 2019-08-09T00:36:32 | Java | UTF-8 | Java | false | false | 161 | java | package com.amd.bean;
/**
* @ClassName DemoBean
* @Description: TODO
* @Author koumingming
* @Date 2019/8/5
* @Version V1.0
**/
public class DemoBean {
}
| [
"user@example.com"
] | user@example.com |
951d220bc8c29bbeb05708a4010c8cb10dca1218 | 95eedbca1f9d7173dba57dfc443e63f86e054d7c | /src/test/java/com/allbirds/utility/Helper.java | 202f5781b0a5d2ec1ecb953641b10acfb875d177 | [] | no_license | veranikabakhur/myTestFramework | 2aebfbf7c201f0269f5fffe0f85e1323eb178b45 | 0ca135ba44929c24f82b377e35b17085a1b133b2 | refs/heads/master | 2022-05-27T00:12:00.713965 | 2020-05-05T03:11:58 | 2020-05-05T03:11:58 | 261,346,472 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,548 | java | package com.allbirds.utility;
import org.apache.commons.compress.compressors.FileNameUtil;
import org.openqa.selenium.OutputType;
import org.openqa.selenium.TakesScreenshot;
import org.openqa.selenium.WebDriver;
import ru.yandex.qatools.ashot.AShot;
import ru.yandex.qatools.ashot.Screenshot;
import ru.yandex.qatools.ashot.shooting.ShootingStrategies;
import javax.imageio.ImageIO;
import java.io.File;
import java.io.IOException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.logging.FileHandler;
import java.util.logging.StreamHandler;
public class Helper {
public static String captureScreenshot (WebDriver driver) throws IOException {
//File src = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
Screenshot src = new AShot().shootingStrategy(ShootingStrategies.viewportPasting(1000)).takeScreenshot(driver);
String screenshotPath = System.getProperty("/usr/dir", "./Screenshots/AllBirds" + getCurrentDateTime() +".png");
ImageIO.write(src.getImage(), "jpg", new File(screenshotPath));
return screenshotPath;
}
public static String getCurrentDateTime(){
DateFormat customFormat = new SimpleDateFormat("MM_dd_yyyy_HH-mm-ss");
Date currentDate = new Date();
return customFormat.format(currentDate);
}
public void handleFrames(){
}
public void handleAlerts() {
}
public void handleMultipleWindows(){
}
public void handleSynIssues(){
}
}
| [
"37030898+veranikabakhur@users.noreply.github.com"
] | 37030898+veranikabakhur@users.noreply.github.com |
71085c92869023ea106b7b9a025c42cdcbe1a8a8 | db73c83b672acbbf16df102b59ca31427725bd7d | /l8/ll.java | 8932bfe8b279d281d5db143a2fb7b816755a161f | [] | no_license | Tarun1999chandila/java_codes | e9e136b332cb1843c1e733014a269106c6d04aef | d08afdb1bbf150dc1623281134911c8a61db2236 | refs/heads/master | 2022-11-18T10:44:13.988325 | 2020-07-13T16:11:47 | 2020-07-13T16:11:47 | 279,351,095 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,926 | java | package l8;
import java.util.*;
public class ll {
private class node {
public node(int i) {
// TODO Auto-generated constructor stub
this.data = i;
}
public node() {
// TODO Auto-generated constructor stub
}
int data;
node next;
}
private node head;
private node tail;
private int size;
public boolean isEmpty() {
return size == 0;
}
public int getfirst() throws Exception {
if (size == 0) {
throw new Exception("LL is empty");
}
return head.data;
}
public int getlast() throws Exception {
if (size == 0) {
throw new Exception("LL is empty");
}
return tail.data;
}
public int getat(int idx) throws Exception {
if (size == 0) {
throw new Exception("LL is empty");
}
if (idx < 0 || idx >= size) {
throw new Exception("invalid index");
}
node temp = head;
for (int i = 0; i < idx; i++) {
temp = temp.next;
}
return temp.data;
}
public node getnodeat(int idx) throws Exception {
if (size == 0) {
throw new Exception("LL is empty");
}
if (idx < 0 || idx >= size) {
throw new Exception("invalid index");
}
node temp = head;
for (int i = 0; i < idx; i++) {
temp = temp.next;
}
return temp;
}
public void display() {
System.out.println("---------------------");
node temp = head;
while (temp != null) {
System.out.print(temp.data + " ");
temp = temp.next;
}
System.out.println(".");
System.out.println("---------------------");
}
public void addlast(int item) {
node nn = new node();
nn.data = item;
if (size > 0) {
tail.next = nn;
}
if (size == 0) {
head = tail = nn;
this.size++;
} else {
tail = nn;
size++;
}
}
public void addfirst(int item) {
node nn = new node();
nn.data = item;
if (size > 0) {
nn.next = head;
} else if (size == 0) {
head = tail = nn;
size++;
} else {
head = nn;
size++;
}
}
public void addAt(int item, int idx) throws Exception {
if (size == 0) {
throw new Exception("ll is empty");
}
if (idx < 0 || idx >= size) {
throw new Exception("invalid index");
}
if (idx == 0) {
addfirst(item);
return;
} else if (idx == size) {
addlast(item);
return;
}
// create a new node
node nn = new node();
nn.data = item;
nn.next = null;
// links set
node nm1 = getnodeat(idx - 1);
node np1 = nm1.next;
nm1.next = nn;
nn.next = np1;
// data members
size++;
}
public int removeFirst() throws Exception {
if (size == 0) {
throw new Exception("LL is Empty.");
}
int temp = head.data;
if (size == 1) {
head = tail = null;
size--;
} else {
head = head.next;
size--;
}
return temp;
}
public int removeLast() throws Exception {
if (size == 0) {
throw new Exception("LL is Empty.");
}
int temp = tail.data;
if (size == 1) {
head = tail = null;
size--;
} else {
tail = getnodeat(size - 2);
tail.next = null;
size--;
}
return temp;
}
public int removeAt(int idx) throws Exception {
if (size == 0) {
throw new Exception("LL is Empty.");
}
if (idx < 0 || idx >= size) {
throw new Exception("Invalid Index.");
}
if (idx == 0) {
return removeFirst();
} else if (idx == size - 1) {
return removeLast();
} else {
node nm1 = getnodeat(idx - 1);
node n = nm1.next;
node np1 = n.next;
nm1.next = np1;
size--;
return n.data;
}
}
public int kthfromlast(int k) {
node slow = head;
node fast = head;
for (int i = 0; i < k; i++) {
fast = fast.next;
}
while (fast.next != null) {
fast = fast.next;
slow = slow.next;
}
return slow.data;
}
public static void main(String[] args) throws Exception {
// TODO Auto-generated method stub
ll list = new ll();
Scanner scn=new Scanner(System.in);
int n=0;
while(n!=-1){
n=scn.nextInt();
list.addlast(n);
}
int m=scn.nextInt();
System.out.println(list.kthfromlast(m));
}
} | [
"you@example.com"
] | you@example.com |
aa2dbae6d4d3595a9a3a7f49e313df24b0aafba2 | 41bcdf4ebfaccc8c4e88cec995cd9c468916ecff | /Chapter2/Messaging_and_social_networking/SamplePush/app/src/main/java/com/example/samplepush/MainActivity.java | ca30cb0c0e1acf5110df53b4b16242913614b71e | [] | no_license | LeeSM0518/Android | c2f788974ba9e3a6b5fd14de08efabfe2f97a20a | e2d99d017c4d4be9e8d930e1e041aa37aa825347 | refs/heads/master | 2021-07-13T14:20:56.427947 | 2020-06-11T18:39:18 | 2020-06-11T18:39:18 | 163,975,884 | 0 | 0 | null | 2019-02-24T13:43:51 | 2019-01-03T13:22:00 | Java | UTF-8 | Java | false | false | 2,497 | java | package com.example.samplepush;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import com.google.android.gms.tasks.OnSuccessListener;
import com.google.firebase.iid.FirebaseInstanceId;
import com.google.firebase.iid.InstanceIdResult;
public class MainActivity extends AppCompatActivity {
TextView textView;
TextView textView2;
EditText editText;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
textView = findViewById(R.id.receiveTextView);
textView2 = findViewById(R.id.dataTextView);
editText = findViewById(R.id.sendEditText);
FirebaseInstanceId.getInstance().getInstanceId()
.addOnSuccessListener(this, new OnSuccessListener<InstanceIdResult>() {
@Override
public void onSuccess(InstanceIdResult instanceIdResult) {
String newToken = instanceIdResult.getToken();
println("등록 id : " + newToken);
}
});
Button button = findViewById(R.id.button);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String instanceId = FirebaseInstanceId.getInstance().getId();
println("확인된 인스턴스 id : " + instanceId);
}
});
}
public void println(String data) {
textView2.append(data + "\n");
Log.d("FMS", data);
}
@Override
protected void onNewIntent(Intent intent) {
println("onNewIntent 호출됨");
if (intent != null) {
processIntent(intent);
}
super.onNewIntent(intent);
}
@SuppressLint("SetTextI18n")
private void processIntent(Intent intent) {
String from = intent.getStringExtra("from");
if (from == null) {
println("from is null.");
return;
}
String contents = intent.getStringExtra("contents");
println("DATA : " + from + ", " + contents);
textView.setText("[" + from + "]로부터 수신한 데이터 : " + contents);
}
} | [
"nalsm98@naver.com"
] | nalsm98@naver.com |
57dfe324da00e5ceced6adfb6ca0bf8314b2840d | a6460656a5a55ed56da1f1065873015930c2399b | /Cap4 zuul(路由网关)/eureka-consumer-feign-zuul/src/main/java/com/example/demo/service/HelloService.java | 276205e513c341b2eb44d03b5b31ed88e5d68ee7 | [] | no_license | lomoCgx/springCloudLearn | d13d00fe96420bcfbb5435dbaa5adade60baedf5 | e7b8537e98d21436423893fc279781deca2daf52 | refs/heads/master | 2021-04-26T21:52:50.129299 | 2018-12-14T08:43:24 | 2018-12-14T08:43:24 | 124,170,127 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 477 | java | package com.example.demo.service;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
@ FeignClient("eureka-provider-feign")
public interface HelloService {
@RequestMapping(value = "/hi",method = RequestMethod.GET)
String sayHi(@RequestParam(value = "name") String name);
}
| [
"lomo_cgx@aliyun.com"
] | lomo_cgx@aliyun.com |
29bdf4db430b1ade9815555adaa169f8cd28fee0 | 45bd9650f0093319a8da732a9a5d05684db30ee7 | /app/src/main/java/com/nerdery/umbrella/model/WeatherCellModel.java | 43caa217cd6fcb68516cb0929ff800327fcf65bb | [] | no_license | matthewsparr/Weather-App | 41ce036c12bf9ce35deff67892e63b2bfdd2a070 | e4d3c927572bfb6925c4354a3e06616bf415834c | refs/heads/master | 2021-01-10T07:24:56.985238 | 2016-01-15T19:24:23 | 2016-01-15T19:24:23 | 49,739,868 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 701 | java | package com.nerdery.umbrella.model;
import java.util.List;
/**
* Created by Matthew on 11/21/2015.
*/
public class WeatherCellModel {
public String time;
public String icon;
public String temp;
public Boolean highTemp;
public Boolean lowTemp;
public void setHighTemp(Boolean highTemp) {
this.highTemp = highTemp;
}
public void setLowTemp(Boolean lowTemp) {
this.lowTemp = lowTemp;
}
public WeatherCellModel(String time, String icon, String temp, Boolean highTemp, Boolean lowTemp) {
this.time = time;
this.icon = icon;
this.temp = temp;
this.highTemp = highTemp;
this.lowTemp = lowTemp;
}
}
| [
"matthewsparr247@gmail.com"
] | matthewsparr247@gmail.com |
3c02fb0f74a6eaba9b825e33f24e0cf68bab8715 | bc639d15bcc35b6e58f97ca02bee2dc66eba894b | /src/com/vmware/vim25/UnconfiguredPropertyValue.java | f57a97522a12aa02be95128964ac38bc13d28a63 | [
"BSD-3-Clause"
] | permissive | benn-cs/vijava | db473c46f1a4f449e52611055781f9cfa921c647 | 14fd6b5d2f1407bc981b3c56433c30a33e8d74ab | refs/heads/master | 2021-01-19T08:15:17.194988 | 2013-07-11T05:17:08 | 2013-07-11T05:17:08 | 7,495,841 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,837 | java | /*================================================================================
Copyright (c) 2012 Steve Jin. All Rights Reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of VMware, Inc. nor the names of its contributors may be used
to endorse or promote products derived from this software without specific prior
written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL VMWARE, INC. OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
================================================================================*/
package com.vmware.vim25;
/**
* @author Steve Jin (http://www.doublecloud.org)
* @version 5.1
*/
@SuppressWarnings("all")
public class UnconfiguredPropertyValue extends InvalidPropertyValue {
} | [
"sjin2008@3374d856-466b-4dc9-8cc5-e1e8506a9ea1"
] | sjin2008@3374d856-466b-4dc9-8cc5-e1e8506a9ea1 |
a53f3f5bb2b4e57382038415b5e5bff2ea629822 | cb38df977f3315f7705e73f54cbf05425692f9f6 | /src/Board.java | ec7af65e32a14a2066e5371a9ebeba4d1ee29c7a | [] | no_license | laurendayoun/TetrisFinalProject | 3eb7fc94cc035d0619b8ac3c95daf0d4c192c815 | 36fb23261be35ea75c31135081e3dd56ad58be95 | refs/heads/master | 2021-01-21T15:27:29.618448 | 2017-06-09T20:08:03 | 2017-06-09T20:08:03 | 91,846,025 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,995 | java | import javafx.scene.Scene;
import javafx.scene.layout.Pane;
import java.lang.reflect.Array;
import java.util.ArrayList;
/**
* Created by Lauren Oh on 6/5/2017.
*/
public class Board extends Pane
{
public int[][] grid;
public Board()
{
Pane root = new Pane();
Scene scene = new Scene(root, 300, 480);
grid = new int[15][24];
for (int i = 0; i < 15; i++)
{
for (int j = 0; j < 24; j++)
{
grid[i][j] = 0;
}
}
}
public Board(int height, int width)
{
Pane root = new Pane();
Scene scene = new Scene(root, width, height);
grid = new int[width/20][height/20];
for (int i = 0; i < width/20; i++)
{
for (int j = 0; j < height/20; j++)
{
grid[i][j] = 0;
}
}
}
public void addpiece(TetrisPiece piece)
{
ArrayList<TetrisBlock> parts = piece.getpiece();
for (TetrisBlock block : parts)
{
int x = block.getx()/20;
int y = block.gety()/20;
grid[x][y] = 1;
}
}
public void removepiece(TetrisPiece piece)
{
ArrayList<TetrisBlock> parts = piece.getpiece();
for (TetrisBlock block : parts)
{
int x = block.getx()/20;
int y = block.gety()/20;
grid[x][y] = 0;
}
}
public void moveleft(TetrisPiece piece)
{
if (this.canmove(piece, -1, 0))
{
this.removepiece(piece);
piece.moveleft();
this.addpiece(piece);
}
}
public void moveright(TetrisPiece piece)
{
if (this.canmove(piece, 1, 0))
{
this.removepiece(piece);
piece.moveright();
this.addpiece(piece);
}
}
public void movedown(TetrisPiece piece)
{
if (this.canmove(piece, 0,1))
{
this.removepiece(piece);
piece.movedown();
this.addpiece(piece);
}
}
public void rotate(TetrisPiece piece1, int dir)
{
ArrayList<TetrisBlock> parts = piece1.getpiece();
for (int i = 0; i < 4; i++)
{
TetrisBlock a = parts.get(i);
int x = piece1.getcx() - dir*piece1.getcy() + dir*a.gety();
int y = piece1.getcy() + dir*piece1.getcx() - dir*a.getx();
int dx = x - a.getx();
int dy = y - a.gety();
if (this.canmoveblock(a, dx, dy))
{
continue;
}
}
this.removepiece(piece1);
piece1.rotate(dir);
this.addpiece(piece1);
}
public boolean canmove(TetrisPiece piece, int hori, int verti)
{
ArrayList<TetrisBlock> parts = piece.getpiece();
for (TetrisBlock block : parts)
{
int x = hori + block.getx()/20;
int y = verti + block.gety()/20;
if (x < 0 || x > 15 || y < 0 || y > 24)
{
return false;
}
if (grid[x][y] == 1)
{
return false;
}
}
return true;
}
public boolean canmoveblock(TetrisBlock b, int hori, int verti)
{
int x = hori/20 + b.getx()/20;
int y = verti/20 + b.gety()/20;
if (x < 0 || x > 15 || y < 0 || y > 24)
{
return false;
}
if (grid[x][y] == 1)
{
return false;
}
return true;
}
public boolean IsRowFull(int row)
{
for (int i = 0; i < 15; i++)
{
if (grid[i][row] == 0)
{
continue;
}
else
{
return true;
}
}
return false;
}
public void clearrow()
{
if ()
}
}
| [
"laurendayoun@gmail.com"
] | laurendayoun@gmail.com |
c7ffc3d4a9be3410f42424f63a02f25d48451bff | a4375f2340d47e18df9ab888f4888899e8d84667 | /src/main/java/de/core23/othello/gui/GamePanel.java | cc1404c39f070b581d7881136b7bc0098624b5e5 | [
"MIT"
] | permissive | core23/othello | 5d986c1dea0a78599d3aac6dd293886085bca2e4 | 66ae72a79d0a3c91910aca28d3d43384396bf031 | refs/heads/master | 2020-05-01T19:42:47.985440 | 2009-02-10T19:00:00 | 2019-03-25T20:02:02 | 177,655,626 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,840 | java | package de.core23.othello.gui;
import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Point;
import java.awt.font.FontRenderContext;
import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage;
import java.util.LinkedList;
import javax.swing.JPanel;
import de.core23.othello.misc.Style;
import de.core23.othello.model.Player;
import de.core23.othello.model.PlayerType;
public class GamePanel extends JPanel implements Style {
private BufferedImage _bufferImage;
private Graphics _bufferGraphics;
private FontMetrics _fontMetrics;
private static final long serialVersionUID = 1L;
private PlayerType[][] _map = new PlayerType[SIZE][SIZE];
private LinkedList<Player> _playerList;
private Player _currentPlayer;
private LinkedList<Point> _possibleMoves;
public GamePanel() {
super();
setSize((Style.BLOCK_SIZE + Style.BLOCK_PADDING * 2) * Style.SIZE + Style.PANEL_PADDING * 2,
(Style.BLOCK_SIZE + Style.BLOCK_PADDING * 2) * Style.SIZE + Style.PANEL_PADDING * 3);
initBuffer();
reset();
}
private void initBuffer() {
_bufferImage = new BufferedImage((Style.BLOCK_SIZE + Style.BLOCK_PADDING * 2) * Style.SIZE + Style.PANEL_PADDING * 2,
(Style.BLOCK_SIZE + Style.BLOCK_PADDING * 2) * Style.SIZE + Style.PANEL_PADDING * 4, BufferedImage.TYPE_INT_RGB);
_bufferGraphics = _bufferImage.getGraphics();
Graphics2D g = _bufferImage.createGraphics();
g.setColor(COLOR_BG);
g.fillRect(0, 0, getWidth(), getHeight());
_bufferGraphics.setFont(new Font("Helvetica", Font.BOLD, 13)); //$NON-NLS-1$
_fontMetrics = _bufferGraphics.getFontMetrics();
}
public void reset() {
for (int x = 0; x < SIZE; x++) {
for (int y = 0; y < SIZE; y++) {
_map[x][y] = null;
}
}
drawAll();
}
public void setPlayers(LinkedList<Player> playerList) {
_playerList = playerList;
drawPlayerNames();
}
public void updateScore() {
drawPlayerNames();
}
public void setStone(int x, int y, PlayerType type) {
_map[x][y] = type;
drawStone(x, y);
}
public void setPossibleMoves(Player player, LinkedList<Point> possibleMoves) {
clearPossibleMoves();
_currentPlayer = player;
_possibleMoves = possibleMoves;
drawPossibleMoves();
}
private void drawGrid() {
// Lines
_bufferGraphics.setColor(COLOR_LINE);
for (int x = 1; x < SIZE; x++)
_bufferGraphics.drawLine(PANEL_PADDING + x * (BLOCK_SIZE + BLOCK_PADDING * 2), PANEL_PADDING, PANEL_PADDING + x * (BLOCK_SIZE + BLOCK_PADDING * 2),
PANEL_PADDING + (BLOCK_SIZE + BLOCK_PADDING * 2) * SIZE);
for (int y = 1; y < SIZE; y++)
_bufferGraphics.drawLine(PANEL_PADDING + 0, PANEL_PADDING + y * (BLOCK_SIZE + BLOCK_PADDING * 2), PANEL_PADDING + (BLOCK_SIZE + BLOCK_PADDING * 2)
* SIZE, PANEL_PADDING + y * (BLOCK_SIZE + BLOCK_PADDING * 2));
}
private void drawStone(int x, int y) {
if (_map[x][y] != null) {
_bufferGraphics.setColor(_map[x][y].color());
} else {
_bufferGraphics.setColor(COLOR_BG);
}
_bufferGraphics.fillOval(PANEL_PADDING + x * (BLOCK_SIZE + BLOCK_PADDING * 2) + BLOCK_PADDING, PANEL_PADDING + y * (BLOCK_SIZE + BLOCK_PADDING * 2)
+ BLOCK_PADDING, BLOCK_SIZE, BLOCK_SIZE);
}
private void drawPlayerNames() {
// Clear
_bufferGraphics.setColor(Style.COLOR_BG);
_bufferGraphics.fillRect(PANEL_PADDING, PANEL_PADDING + (BLOCK_SIZE + BLOCK_PADDING * 2) * SIZE, getWidth() - PANEL_PADDING * 2, _fontMetrics
.getHeight());
// Player Score
FontRenderContext frc = _fontMetrics.getFontRenderContext();
if (_playerList != null) {
int posX = 0;
int posY = PANEL_PADDING + (BLOCK_SIZE + BLOCK_PADDING * 2) * SIZE + (int) _fontMetrics.getHeight();
int width = (int) (BLOCK_SIZE + BLOCK_PADDING * 2) * SIZE / _playerList.size();
for (int i = 0; i < _playerList.size(); i++) {
Player player = _playerList.get(i);
_bufferGraphics.setColor(player.getColor());
if (i == _playerList.size() - 1)
posX = PANEL_PADDING + (BLOCK_SIZE + BLOCK_PADDING * 2) * SIZE - Style.PLAYER_TEXT_SIZE;
else
posX = PANEL_PADDING + width * i;
String text = player.getName() + ":"; //$NON-NLS-1$
Rectangle2D rectFont = _bufferGraphics.getFont().getStringBounds(text, frc);
_bufferGraphics.drawString(text, posX, posY);
text = player.getStones() + ""; //$NON-NLS-1$
rectFont = _bufferGraphics.getFont().getStringBounds(text, frc);
_bufferGraphics.drawString(text, posX + Style.PLAYER_TEXT_SIZE - (int) rectFont.getWidth(), posY);
}
}
}
private void clearPossibleMoves() {
if (_currentPlayer != null) {
_bufferGraphics.setColor(Style.COLOR_BG);
for (Point point : _possibleMoves)
_bufferGraphics.drawOval(PANEL_PADDING + (int) point.getX() * (BLOCK_SIZE + BLOCK_PADDING * 2) + BLOCK_PADDING, PANEL_PADDING
+ (int) point.getY() * (BLOCK_SIZE + BLOCK_PADDING * 2) + BLOCK_PADDING, BLOCK_SIZE, BLOCK_SIZE);
}
}
private void drawPossibleMoves() {
if (_currentPlayer != null) {
_bufferGraphics.setColor(_currentPlayer.getColor());
for (Point point : _possibleMoves)
_bufferGraphics.drawOval(PANEL_PADDING + (int) point.getX() * (BLOCK_SIZE + BLOCK_PADDING * 2) + BLOCK_PADDING, PANEL_PADDING
+ (int) point.getY() * (BLOCK_SIZE + BLOCK_PADDING * 2) + BLOCK_PADDING, BLOCK_SIZE, BLOCK_SIZE);
}
}
private void drawAll() {
drawGrid();
// Stones
for (int x = 0; x < SIZE; x++) {
for (int y = 0; y < SIZE; y++) {
drawStone(x, y);
}
}
drawPossibleMoves();
drawPlayerNames();
repaint();
}
@Override
public void paint(Graphics g) {
g.drawImage(_bufferImage, 0, 0, this);
}
public Point getPoint(Point p) {
int x = (p.x - Style.PANEL_PADDING) / (BLOCK_SIZE + BLOCK_PADDING * 2);
int y = (p.y - PANEL_PADDING) / (BLOCK_SIZE + BLOCK_PADDING * 2);
return new Point(x, y);
}
}
| [
"mail@core23.de"
] | mail@core23.de |
e1e04b53ed1f9784a3c65bcb2670cbf00c9debd7 | bd4f65d667e2b7f9b5fb7fa1cf797035119a2e56 | /project/LibEvaluacion/src/com/utez/evaluacion/entityMan/EntityManEvaluacion.java | 6d66e2c782d09a20d8e973778ad72f04c2173e0c | [] | no_license | angellagunas/MigracionBD | 13bdc27355e0436ecb0f49f4f13fa965462de5ff | 96552a4022bbfb0039225ae70ba3987f63eee7d9 | refs/heads/master | 2021-03-27T16:09:06.819932 | 2014-07-23T14:17:53 | 2014-07-23T14:17:53 | 22,110,124 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 549 | java | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.utez.evaluacion.entityMan;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
/**
*
* @author Sergio
*/
public final class EntityManEvaluacion {
private static EntityManagerFactory emf = Persistence.createEntityManagerFactory("EvaluacionPU");
public EntityManEvaluacion() {
}
public static EntityManagerFactory getInstance() {
return emf;
}
}
| [
"xenondevelops@gmail.com"
] | xenondevelops@gmail.com |
7005d2632d4a3848d3b708efeaf7e4a854e30b2d | b68c79222d1b95cd2563650c0cc5b1e7f26a083f | /src/com/chase/framerwork/common/ResponseCode.java | f7f0a0a9f9b468ebdea2df781f16835b239f23ba | [] | no_license | w286332849/chase | 4ea1796512eb7f1c553fa9a595d5a6655e79af8d | 5d70e9c249ec815176b558b56c7d5a861172e1b9 | refs/heads/master | 2021-05-16T18:25:46.220404 | 2021-01-27T05:45:16 | 2021-01-27T05:45:16 | 7,850,965 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 354 | java | package com.chase.framerwork.common;
/**
* 请求响应码
* @author Chase
*
*/
public enum ResponseCode {
// 登陆响应码
LOGIN_001,LOGIN_002,LOGIN_003,LOGIN_004,
// 通用
UNKNOW_9999,
// 新增用户
USER_SUCCESS_001,USER_SUCCESS_002,USER_SUCCESS_003,
USER_FAIL_004,USER_FAIL_005,USER_FAIL_006,USER_FAIL_007
}
| [
"286332849@qq.com"
] | 286332849@qq.com |
80d541579fdfe3ad79db469d514980d00bb9e6b4 | e2738dfaec459819d63056414e28c84cc64f3ea0 | /src/main/java/br/com/conductor/pier/api/v2/model/StatusBoletoResponse.java | aeeb081269d250aabdb6df30eaff447c8880ea81 | [] | no_license | carlosmanoel/pier-sdk-java | 5cd7e89da7fad1a7f164b72bf44bc0c67a00eb25 | 2e80f250c1900b9f25f3f1f4e76da119124955b0 | refs/heads/master | 2020-12-22T10:28:42.213135 | 2020-01-23T21:08:27 | 2020-01-23T21:08:27 | 236,751,472 | 1 | 0 | null | 2020-01-28T14:16:22 | 2020-01-28T14:16:21 | null | UTF-8 | Java | false | false | 2,491 | java | package br.com.conductor.pier.api.v2.model;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* Representa\u00E7\u00E3o da resposta do recurso de status de boleto
**/
@ApiModel(description = "Representa\u00E7\u00E3o da resposta do recurso de status de boleto")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen")
public class StatusBoletoResponse {
private String status = null;
private String data = null;
/**
* Descri\u00E7\u00E3o do status CNAB sumarizado do boleto
**/
public StatusBoletoResponse status(String status) {
this.status = status;
return this;
}
@ApiModelProperty(example = "null", value = "Descri\u00E7\u00E3o do status CNAB sumarizado do boleto")
@JsonProperty("status")
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
/**
* Data em que o status foi definido
**/
public StatusBoletoResponse data(String data) {
this.data = data;
return this;
}
@ApiModelProperty(example = "null", value = "Data em que o status foi definido")
@JsonProperty("data")
public String getData() {
return data;
}
public void setData(String data) {
this.data = data;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
StatusBoletoResponse statusBoletoResponse = (StatusBoletoResponse) o;
return Objects.equals(this.status, statusBoletoResponse.status) &&
Objects.equals(this.data, statusBoletoResponse.data);
}
@Override
public int hashCode() {
return Objects.hash(status, data);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class StatusBoletoResponse {\n");
sb.append(" status: ").append(toIndentedString(status)).append("\n");
sb.append(" data: ").append(toIndentedString(data)).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 ");
}
}
| [
"thiago.sampaio@conductor.com.br"
] | thiago.sampaio@conductor.com.br |
42f6a2248bdb21e14aafb5476dd2fa008e368097 | 0c8b0d3711cf5b5a45d93f7fae07d10fc3c56442 | /week6/Multithreading/src/blocking/queue/BlockingQueueDemo.java | 4077a2102a727404616719a75a90e13b5d043b6f | [] | no_license | antonpetkoff/Core-Java-2 | eec6aabe8463ccd314ee69eb7bac9148c4e8b9c9 | 503dbcdf389699615ef66895e0012e2c834bcd9e | refs/heads/master | 2020-04-11T04:26:56.183051 | 2015-06-08T14:48:17 | 2015-06-08T14:48:17 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,864 | java | package blocking.queue;
public class BlockingQueueDemo {
public static final int BBQ_LIMIT = 3;
public static final int POLL_COUNT = 20;
public static final int POLL_FREQUENCY = 10; // in milliseconds
public static final int OFFER_COUNT = 20;
public static final int OFFER_FREQUENCY = 1000; // in milliseconds
public static void main(String[] args) throws InterruptedException {
final BlockingBoundedQueue<Integer> bq = new BlockingBoundedQueue<>(BBQ_LIMIT);
Thread consumer = new Thread(new Runnable() {
@Override
public void run() {
for (int i = 0; i < POLL_COUNT; ++i) {
try {
Thread.sleep(POLL_FREQUENCY);
} catch (InterruptedException e) {
e.printStackTrace();
}
System.out.println("Trying to poll from BBQ...");
System.out.println("Element " + bq.poll() + " polled successfully!");
}
}
});
Thread producer = new Thread(new Runnable() {
@Override
public void run() {
for (int i = 0; i < OFFER_COUNT; ++i) {
try {
Thread.sleep(OFFER_FREQUENCY);
} catch (InterruptedException e) {
e.printStackTrace();
}
System.out.println("Trying to offer to BBQ...");
bq.offer(i);
System.out.println("Element " + i + " offered to BlockingQueue.");
}
}
});
consumer.start();
producer.start();
consumer.join();
producer.join();
}
}
| [
"tonynho010@gmail.com"
] | tonynho010@gmail.com |
f355b31d971faf751dc211e457ed61bbec0619f6 | ca8313467cf41210a9005b9ff391e818e1703408 | /test/src/ch/fhnw/cpib/scanner/states/ColonState.java | 0d792bd1c84e9484fb894e27d378cffa62e08cee | [] | no_license | jakobruder/cpib | f332dd9d078254be8c9f39e6b8897d4dbedf70d8 | f4363297ea6c295d2442486a49f2a64854828669 | refs/heads/master | 2021-01-10T10:29:33.820811 | 2016-01-13T13:08:54 | 2016-01-13T13:08:54 | 44,187,605 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 640 | java | package ch.fhnw.cpib.scanner.states;
import ch.fhnw.cpib.scanner.enums.Terminals;
import ch.fhnw.cpib.scanner.exceptions.ScannerException;
import ch.fhnw.cpib.scanner.interfaces.IScannerState;
import ch.fhnw.cpib.scanner.interfaces.ITokenList;
import ch.fhnw.cpib.scanner.symbols.Base;
public class ColonState implements IScannerState {
@Override
public IScannerState handleCharacter(String ch, ITokenList list)
throws ScannerException {
if (ch.matches("=")) {
return new BecomesState();
} else {
list.add(new Base(Terminals.COLON));
return new DefaultState().handleCharacter(ch, list);
}
}
}
| [
"jakob.ruder@ubs.com"
] | jakob.ruder@ubs.com |
bfe6e4f7f39684b43dd18cd7918ab6bcbbdc6f74 | df3fa3351d2342d42237bdae76ab0a9c01c40a6b | /memory/src/DiaoDu.java | 27a1594ebe3e618e706249efa615afb48ce92fdb | [] | no_license | jia8012/Java_study | 72ab19f39acdfc1c8f27cf8000f2362e21239a5d | 834e628ab43ec58f5278349699a96bc4cbcc6f1d | refs/heads/master | 2020-08-28T02:11:21.409771 | 2020-04-29T15:13:25 | 2020-04-29T15:13:25 | 217,557,556 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,361 | java | import java.util.Scanner;
class Node{
String name;
int priority;
int runtime;
int arrivaltime;
int starttime;
int endtime;
int turntime; //周转时间
double dturntime; //带权周转时间
Node nextnode;
int statu;
int newarrival;
int newruntime;
public Node(String name,int priority,int runtime,int arrivaltime, int starttime, int endtime, int turntime, double dturntime){
this.name = name;
this.priority = priority;
this.runtime = runtime;
this.arrivaltime = arrivaltime;
this.nextnode = null;
this.starttime = starttime;
this.endtime = endtime;
this.turntime = turntime;
this.dturntime = dturntime;
this.newarrival = arrivaltime;
this.newruntime = runtime;
}
}
class Create{
public Node createNode(Node head, String name, int priority, int runtime, int arrivaltime, int starttime, int endtime, int turntime, double dturntime){
if(head == null){
Node node = new Node(name,priority,runtime,arrivaltime,starttime,endtime,turntime,dturntime);
head = node;
return head;
}
Node cur = head;
while(cur.nextnode!=null){
cur = cur.nextnode;
}
Node node = new Node(name,priority,runtime,arrivaltime,starttime,endtime,turntime,dturntime);
cur.nextnode = node;
return head;
}
public void check(Node head){
if(head == null){
System.out.println("当前没有节点信息");
return;
}
Node cur = head;
while(cur!=null){
System.out.println("名字:"+cur.name+",优先级:"+cur.priority+",运行时间:"+cur.runtime+",到达时间"+cur.arrivaltime);
cur = cur.nextnode;
}
}
}
class Algorithm{
private Node pre = null;
private Node prev = null;
private Node min = null;
private int num = 0;
private int start = 0;
private double nums = 0.0;
private int count = 0;
private static Create create = new Create();
private static Node CreateHead(Node head){
Node head2 = null;
Node cur = head;
while(cur!=null){
head2 = create.createNode(head2,cur.name,cur.priority,cur.runtime,cur.arrivaltime,cur.starttime,cur.endtime,cur.turntime,cur.dturntime);
cur = cur.nextnode;
}
return head2;
}
private void endFun(){
System.out.println("平均周转时间:" + (double) this.num / this.count + "平均带权周转时间:" + this.nums / this.count);
this.start = 0;
this.num = 0;
this.nums = 0;
this.count = 0;
}
private static Node toolMethod(Node min,Node prev,int start,Node head){
min.starttime = start;
min.endtime = min.starttime + min.runtime;
min.turntime = min.endtime - min.arrivaltime;
min.dturntime = (double) min.turntime / (double) min.runtime;
System.out.println("名字:" + min.name + ",优先级:" + min.priority + ",运行时间:" + min.runtime + ",到达时间" + min.arrivaltime + ",开始时间:" + min.starttime + ",结束时间:" + min.endtime + ",周转时间:" + min.turntime + ",带权周转时间:" + min.dturntime);
if (prev == null) {
if (min.nextnode == null) {
return null;
}
return min.nextnode;
} else {
prev.nextnode = min.nextnode;
}
return head;
}
private static Node findMin(Node head){
Node cur = head;
Node real = null;
int mintime = cur.arrivaltime;
while(cur!=null){
if(cur.arrivaltime<=mintime){
mintime = cur.arrivaltime;
real = cur;
}
cur = cur.nextnode;
}
return real;
}
public void Fcfs(Node head) {
Node head2 = CreateHead(head);
while (head2 != null) {
min = null;
pre = null;
Node cur = head2;
int mintime = cur.arrivaltime;
while (cur != null) {
if (cur.arrivaltime <= mintime) {
mintime = cur.arrivaltime;
prev = pre;
min = cur;
}
pre = cur;
cur = cur.nextnode;
}
if (min.arrivaltime > start) {
start = min.arrivaltime;
}
head2 = toolMethod(min,prev,start,head2);
start = start + min.runtime;
num += min.turntime;
nums += min.dturntime;
count++;
}
this.endFun();
}
public void Priority(Node head){
Node head2 = CreateHead(head);
while(head2!=null){
min = null;
pre = null;
Node cur = head2;
int mintime = 0;
while(cur!=null){
if(cur.priority >= mintime && cur.arrivaltime <= start){
mintime = cur.priority;
prev = pre;
min = cur;
}
pre = cur;
cur = cur.nextnode;
}
if(min == null){
min = findMin(head2);
}
if(min.arrivaltime > start){
start = min.arrivaltime;
}
head2 = toolMethod(min,prev,start,head2);
start = start + min.runtime;
num += min.turntime;
nums += min.dturntime;
count++;
}
this.endFun();
}
public void ShortProcess(Node head){
Node head2 = CreateHead(head);
while(head2!=null){
min = null;
pre = null;
Node cur = head2;
int mintime = 1000;
while(cur!=null){
if(cur.runtime <= mintime && cur.arrivaltime <= start){
mintime = cur.runtime;
prev = pre;
min = cur;
}
pre = cur;
cur = cur.nextnode;
}
if(min == null){
min = findMin(head2);
}
if(min.arrivaltime > start){
start = min.arrivaltime;
}
head2 = toolMethod(min,prev,start,head2);
start = start + min.runtime;
num += min.turntime;
nums += min.dturntime;
count++;
}
this.endFun();
}
private static double resRatio(Node node,int start){
int waittime = start - node.arrivaltime;
return (double)waittime/node.runtime;
}
public void Hreponse(Node head){
Node head2 = CreateHead(head);
while(head2!=null){
min = null;
pre = null;
Node cur = head2;
double mintime = 0.0;
while(cur!=null){
double resratio = resRatio(cur,start);
if(resratio >= mintime && cur.arrivaltime <= start){
mintime = resratio;
prev = pre;
min = cur;
}
pre = cur;
cur = cur.nextnode;
}
if(min == null){
min = findMin(head2);
}
if(min.arrivaltime > start){
start = min.arrivaltime;
}
head2 = toolMethod(min,prev,start,head2);
start = start + min.runtime;
num += min.turntime;
nums += min.dturntime;
count++;
}
this.endFun();
}
public static Node QueueHead(Node head){
Node cur = head;
Node nodemin = null;
Node head2 = null;
int min = 1000;
int count = 0;
while(cur!=null){
count++;
cur = cur.nextnode;
}
while(count!=0) {
min = 1000;
cur = head;
while (cur != null) {
if (cur.arrivaltime < min && cur.statu == 0) {
nodemin = cur;
min = cur.arrivaltime;
}
cur = cur.nextnode;
}
nodemin.statu = 1;
count--;
head2 = create.createNode(head2,nodemin.name,nodemin.priority,nodemin.runtime,nodemin.arrivaltime,nodemin.starttime,nodemin.endtime,nodemin.turntime,nodemin.dturntime);
}
return head2;
}
public static void insert(Node head,Node min){
Node cur = head;
Node pre = null;
while(cur!=null){
if(cur.arrivaltime > min.newarrival){
pre.nextnode = min;
min.nextnode = cur;
return;
}
pre = cur;
cur = cur.nextnode;
}
pre.nextnode = min;
min.nextnode = cur;
}
public void Roundrobin(Node head,int Rtime){
Node newnode = null;
Node head2 = QueueHead(head);
create.check(head2);
System.out.println(head2.newruntime);
System.out.println(head2.newarrival);
while(head2!=null){
min = head2;
if(min.arrivaltime > start){
start = min.arrivaltime;
}
if(min.newruntime > Rtime){
min.newruntime -= Rtime;
start += Rtime;
min.newarrival += Rtime;
newnode = new Node(min.name,min.priority,min.runtime,min.arrivaltime,min.starttime,min.endtime,min.turntime,min.dturntime);
newnode.newarrival = min.newarrival;
newnode.newruntime = min.newruntime;
insert(head2,newnode);
head2 = min.nextnode;
}else{
start += min.newruntime;
min.endtime = start;
min.turntime = min.endtime - min.arrivaltime;
min.dturntime = (double) min.turntime / (double) min.runtime;
head2 = min.nextnode;
num += min.turntime;
nums += min.dturntime;
count++;
System.out.println("名字:" + min.name + "、优先级:" + min.priority + "、运行时间:" + min.runtime + "、到达时间" + min.arrivaltime + "、开始时间:" + min.starttime + "、结束时间:" + min.endtime + "、周转时间:" + min.turntime + "、带权周转时间:" + min.dturntime);
}
}
this.endFun();
}
}
public class DiaoDu {
public static void dispatchMenu(Node head){
Scanner sc = new Scanner(System.in);
Algorithm al = new Algorithm();
int count = 1;
while(count == 1){
System.out.println("请选择调度算法:");
System.out.println("1.先来先服务算法");
System.out.println("2.短作业优先算法");
System.out.println("3.高优先级优先算法");
System.out.println("4.高响应比优先算法");
System.out.println("5.时间片轮转算法");
System.out.println("0.退出");
int num = sc.nextInt();
switch(num){
case 1:al.Fcfs(head);
break;
case 2:al.ShortProcess(head);
break;
case 3:al.Priority(head);
break;
case 4:al.Hreponse(head);
break;
case 5:al.Roundrobin(head,1);
break;
case 0:count = 0;
break;
default:System.out.println("输入错误请重新输入");
}
}
}
public static void mainMenu(){
Create create = new Create();
Node head = null;
Scanner sc = new Scanner(System.in);
int count1 = 1;
while(count1 == 1){
System.out.println("请选择你需要的服务:");
System.out.println("1.添加新进程");
System.out.println("2.使用调度算法进行排序");
System.out.println("3.查看当前进程信息");
System.out.println("0.退出");
int num = sc.nextInt();
switch(num){
case 1:
String name;
int priority;
int runtime;
int arrivaltime;
System.out.println("请输入进程名字:");
name = sc.next();
System.out.println("请输入进程优先级:");
priority = sc.nextInt();
System.out.println("请输入进行运行时间:");
runtime = sc.nextInt();
System.out.println("请输入进程到达时间:");
arrivaltime = sc.nextInt();
head = create.createNode(head,name,priority, runtime,arrivaltime,0,0,0,0);
break;
case 2:DiaoDu.dispatchMenu(head);
break;
case 3:create.check(head);
break;
case 0:count1 = 0;
break;
default:System.out.println("输入错误请重新输入");
}
}
}
public static void main(String[] args) {
// TODO Auto-generated method stub
DiaoDu.mainMenu();
}
} | [
"845776779@qq.com"
] | 845776779@qq.com |
cfb50c2a22bafb4cf87a6be2ddb4bff886762c8d | 8e77ed1d11d3ee6486976bdc6b7c5c1043c4d6df | /src/cn/com/oims/dao/pojo/ExamItemAddress.java | 91d6ed9a3097a8b884540a3e1f3b567a74ce9812 | [] | no_license | 498473645/OIMS | e553f266629b7baf0e0dc31bd50edcd534c83c21 | 4477b5882e6478c3cac44c83a2d2539eb98e887a | refs/heads/main | 2023-08-07T04:41:21.592563 | 2021-09-23T03:10:21 | 2021-09-23T03:10:21 | 409,429,603 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,070 | java | package cn.com.oims.dao.pojo;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
/**
* @author: hh
* @date: 2021/8/19
*/
@Entity
@Table(name = "exam_item_address")
public class ExamItemAddress implements Serializable {
@Id
@Column(name = "deptCode")
private String deptCode;
private String name;
private String location;
private String memos;
public String getLocation() {
return this.location;
}
public void setLocation(String location) {
this.location = location;
}
public String getDeptCode() {
return this.deptCode;
}
public void setDeptCode(String deptCode) {
this.deptCode = deptCode;
}
public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
}
public String getMemos() {
return memos;
}
public void setMemos(String memos) {
this.memos = memos;
}
}
| [
"you@example.com"
] | you@example.com |
51d049981865a603fc89c01b67f75d96cfe61727 | 9272784a4043bb74a70559016f5ee09b0363f9d3 | /modules/xiaomai-domain/src/main/java/com/antiphon/xiaomai/modules/dao/custom/CustomSkillDao.java | 2222ab4efbdbffcaee9f061438223f20e3d92689 | [] | no_license | sky8866/test | dd36dad7e15a5d878e599119c87c1b50bd1f2b93 | 93e1826846d83a5a1d25f069dadd169a747151af | refs/heads/master | 2021-01-20T09:27:12.080227 | 2017-08-29T09:33:19 | 2017-08-29T09:33:19 | 101,595,198 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 251 | java | package com.antiphon.xiaomai.modules.dao.custom;
import com.antiphon.xiaomai.modules.dao.base.HibernateDao;
import com.antiphon.xiaomai.modules.entity.custom.CustomSkill;
public interface CustomSkillDao extends HibernateDao<CustomSkill>{
}
| [
"286549429@qq.com"
] | 286549429@qq.com |
43ae543695b86e37a834b26c2166c178763ceceb | 36bbde826ff3e123716dce821020cf2a931abf6e | /mason/mason2/core/src/main/java/com/perl5/lang/mason2/psi/stubs/MasonParentNamespacesStubIndex.java | 46ff0280a5bff16ab547dc0f41f09d9db4cad321 | [
"Apache-2.0"
] | permissive | Camelcade/Perl5-IDEA | 0332dd4794aab5ed91126a2c1ecd608f9c801447 | deecc3c4fcdf93b4ff35dd31b4c7045dd7285407 | refs/heads/master | 2023-08-08T07:47:31.489233 | 2023-07-27T05:18:40 | 2023-07-27T06:17:04 | 33,823,684 | 323 | 79 | NOASSERTION | 2023-09-13T04:36:15 | 2015-04-12T16:09:15 | Java | UTF-8 | Java | false | false | 1,448 | java | /*
* Copyright 2015-2023 Alexandr Evstigneev
*
* 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.perl5.lang.mason2.psi.stubs;
import com.intellij.psi.stubs.StubIndexKey;
import com.perl5.lang.mason2.psi.MasonNamespaceDefinition;
import com.perl5.lang.perl.psi.stubs.PerlStubIndexBase;
import org.jetbrains.annotations.NotNull;
public class MasonParentNamespacesStubIndex extends PerlStubIndexBase<MasonNamespaceDefinition> {
public static final int VERSION = 1;
public static final StubIndexKey<String, MasonNamespaceDefinition> KEY = StubIndexKey.createIndexKey("perl.mason2.namespace.parent");
@Override
public int getVersion() {
return super.getVersion() + VERSION;
}
@Override
protected @NotNull Class<MasonNamespaceDefinition> getPsiClass() {
return MasonNamespaceDefinition.class;
}
@Override
public @NotNull StubIndexKey<String, MasonNamespaceDefinition> getKey() {
return KEY;
}
} | [
"hurricup@gmail.com"
] | hurricup@gmail.com |
6a8e4d5f649ac14c4777c68a05a18135a7c0a576 | 96c989a3c6c7fbd10d2bf8e94cb0eb62ce0fe560 | /src/main/java/org/rest/sec/dto/User.java | ebe7b341a61be7b2c10b7694ed58e454ca29ce46 | [
"MIT"
] | permissive | vargar2/REST | 25becc52d9809a5a2c0db8e5fd42580da6f105ca | 1a1883d74b1b452043d8ef5dc657628ec0cf0f4c | refs/heads/master | 2021-01-20T23:09:48.983228 | 2012-03-09T14:51:35 | 2012-03-09T14:51:35 | 3,680,117 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,600 | java | package org.rest.sec.dto;
import java.util.Set;
import javax.xml.bind.annotation.XmlRootElement;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.rest.common.IEntity;
import org.rest.sec.model.Principal;
import org.rest.sec.model.Role;
import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
import com.thoughtworks.xstream.annotations.XStreamImplicit;
@XmlRootElement
@XStreamAlias( "user" )
public class User implements IEntity{
@XStreamAsAttribute private Long id;
private String name;
private String password;
/* Marshalling */
// - note: this gets rid of the collection entirely
@XStreamImplicit// - note: this requires: xstream.addDefaultImplementation( java.util.HashSet.class, PersistentSet.class );
// @XStreamConverter( value = HibernateCollectionConverter.class )
private Set< Role > roles;
public User(){
super();
}
public User( final String nameToSet, final String passwordToSet, final Set< Role > rolesToSet ){
super();
name = nameToSet;
password = passwordToSet;
roles = rolesToSet;
}
public User( final Principal principal ){
super();
name = principal.getName();
roles = principal.getRoles();
id = principal.getId();
}
// API
@Override
public Long getId(){
return id;
}
@Override
public void setId( final Long idToSet ){
id = idToSet;
}
public String getName(){
return name;
}
public void setName( final String nameToSet ){
name = nameToSet;
}
public String getPassword(){
return password;
}
public void setPassword( final String passwordToSet ){
password = passwordToSet;
}
public Set< Role > getRoles(){
return roles;
}
public void setRoles( final Set< Role > rolesToSet ){
roles = rolesToSet;
}
//
@Override
public int hashCode(){
final int prime = 31;
int result = 1;
result = prime * result + ( ( name == null ) ? 0 : name.hashCode() );
return result;
}
@Override
public boolean equals( final Object obj ){
if( this == obj )
return true;
if( obj == null )
return false;
if( getClass() != obj.getClass() )
return false;
final User other = (User) obj;
if( name == null ){
if( other.name != null )
return false;
}
else if( !name.equals( other.name ) )
return false;
return true;
}
@Override
public String toString(){
return new ToStringBuilder( this ).append( "id", id ).append( "name", name ).toString();
}
}
| [
"hanriseldon@gmail.com"
] | hanriseldon@gmail.com |
395382c081cd432791506ed94576fb10cd3be17b | 3ae06d7ffeb3abb228d073eeeca70446c76e5f41 | /electronic_gradebook/src/main/java/lewandowski/electronic_gradebook/payload/ApiResponse.java | cc73b858d456d4414b294d623133d24c14e85c09 | [] | no_license | lewandowski2004/Elektronic-Gradebook-Backend | 504e4998519dfddc344eca26d61ff217038d6e81 | 44763c8ef13ecb65cd685bb9f972a05b0ff04f86 | refs/heads/master | 2021-04-17T09:35:52.137193 | 2020-04-18T10:01:53 | 2020-04-18T10:01:53 | 249,434,230 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 565 | java | package lewandowski.electronic_gradebook.payload;
public class ApiResponse {
private Boolean success;
private String message;
public ApiResponse(Boolean success, String message) {
this.success = success;
this.message = message;
}
public Boolean getSuccess() {
return success;
}
public void setSuccess(Boolean success) {
this.success = success;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
}
| [
"lewandowski2004@o2.pl"
] | lewandowski2004@o2.pl |
a18b4115716ec469b08cda247e21791f9942be20 | f1d7a1cd8d70bbde4801e516c1fc7789cb42a541 | /BarkerA Program 2/src/edu/trident/barker/cpt237/Main.java | 5d77395e9899591c1c7e28261009284f32e57bc8 | [] | no_license | Adam-Barker/java-school-projects | 1ec94e4ce9280392696fa192ab7e8d50862595ea | 34e7fe422b04e15c790e4a3ed71cd9d890e0f230 | refs/heads/master | 2021-01-13T00:44:35.587485 | 2015-10-22T22:18:52 | 2015-10-22T22:18:52 | 44,775,950 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 755 | java | //FILE: Main.Java
//PROG: Adam Barker
//PURP: Initiates Cab object and UI
package edu.trident.barker.cpt237;
import javax.swing.JOptionPane;
public class Main
{
public static void main(String[] args)
{
boolean done = false;
while(!done){
try{
String strGasInput =JOptionPane.showInputDialog("Please enter initial amount of gas! It's free :)");
double gasInput = Double.parseDouble(strGasInput);
Cab2 cab = new Cab2(gasInput);
@SuppressWarnings("unused")
UserInterface cabUi = new UserInterface(cab);
done = true;
}catch (NumberFormatException e1) {
JOptionPane.showMessageDialog(null,
"That is an invalid number! Please try again!");
}catch (NullPointerException e2){
System.exit(0);
}
}
}
}
| [
"adam.barker311@gmail.com"
] | adam.barker311@gmail.com |
4fccc6fe66660a7c4c22d05884191f36957f655d | fae81ed2e92abccd65f71eda6e8dc06ffdc1b35a | /trunk/com/planet_ink/coffee_mud/core/interfaces/ActionCode.java | 330a1b450d0ab7247ed929e14865a38ce1b49e9d | [
"Apache-2.0"
] | permissive | Kejardon/EspressoMUD | 4525740dc2610319e675886b7dfe47c222ff60ab | 4c5898a6266b09d351198346c11c47461c293640 | refs/heads/master | 2020-05-18T20:16:36.867331 | 2015-05-23T03:21:52 | 2015-05-23T03:21:52 | 5,268,760 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,563 | java | package com.planet_ink.coffee_mud.core.interfaces;
import com.planet_ink.coffee_mud.core.interfaces.*;
import com.planet_ink.coffee_mud.core.*;
import java.util.*;
/*
EspressoMUD copyright 2015 Kejardon
Licensed under the Apache License, Version 2.0. You may obtain a copy of the license at
http://www.apache.org/licenses/LICENSE-2.0
*/
/*
Simple interface denoting code to handle an arbitrary action
prereqs called before even doing the message, creates list of other things that need to be done first
sendAction called to do the action (okMessage and response and executeMsg) (Note: ActionCode is basically locked to a single thread at this point)
satisfiesPrereqs is called during the okMessage to double check prereqs and set up response if needed.
handleAction is called during the executeMsg to resolve the action.
Eat command starts the process. Calls eatPrereqs then maybe sendEat
eatPrereqs figures out what needs to be done before eating the first item in the list, and starts it.
sendEat creates and sends the Eat CMMsg, uses Race.getBiteSize
Eat CMMsg triggers Body okMessage and response.
okMessage calls satisfiesEatPrereqs again to confirm the MOB is still able to eat the object at the time the message gets room lock, and assigns response
response calls handleEat to do the action of giving the PC nourishment and such? Perhaps make EatCode a msg responder..
handleEat calls Race.diet to calculate PC nourishment and Race.applyDiet to reduce the consumed item.
*/
public interface ActionCode
{
public enum Type
{
GET,
GIVE,
MOVE
}
/*
-1 : Failed
0 : No prereqs (or trivial?)
1 : Must do prereqs first (Perhaps return number of prereq commands?)
Redoing
null : Failed
Empty ArrayList : No prereqs(or trivial)
Populated ArrayList : Must do prereqs first (do after last in the arraylist)
*/
public ArrayList<MOB.QueuedCommand> prereqs(MOB mob, Body body, CMMsg msg);
//-1 : Failed
//0 : Done successfully
//>=1 : Done partially, long of next-time-to-continue-action? or 1 and use TIME_TICK... or have this return TIME_TICK most of the time...
//Note: It is up to the ActionCode to return msg when it is done.
public long sendAction(MOB mob, Body body, CMMsg msg);
//okMessage call
public boolean satisfiesPrereqs(CMMsg msg);
//executeMsg call
public void handleAction(CMMsg msg);
//Respond to okMessage call. Not sure if this actually makes sense in a general case.
//public boolean satisfiesReqs(CMMsg msg);
}
| [
"Kevin Swanson@Kejardon2014.netgear.com"
] | Kevin Swanson@Kejardon2014.netgear.com |
08b4993833de95b920d92c2e4af5eaea252e4804 | 51b69fe39e65500d66e946e83d8c061dc8567a70 | /MyApplication_V1/app/src/main/java/mangoabliu/finalproject/RegistrationActivity.java | 7686b22bbb05f7bd6383122206b2ee18d912024f | [] | no_license | wbb123/PVP-Card-Android- | 2f029e615033de147f894d85b62c727faeb65317 | 4b24c62794da3d33a43466a6405525c89fcc4bc9 | refs/heads/master | 2021-01-13T12:28:04.963139 | 2017-09-06T20:02:33 | 2017-09-06T20:02:33 | 78,537,977 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,805 | java | package mangoabliu.finalproject;
import android.graphics.Typeface;
import android.media.AudioManager;
import android.media.MediaPlayer;
import android.media.SoundPool;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.text.InputType;
import android.text.method.HideReturnsTransformationMethod;
import android.text.method.PasswordTransformationMethod;
import android.util.Log;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.view.inputmethod.EditorInfo;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.EditText;
import mangoabliu.finalproject.Layout.FontTextView;
import mangoabliu.finalproject.Model.GameModel;
/**
* Created by herenjie on 2016/11/13.
*/
public class RegistrationActivity extends AppCompatActivity {
GameModel gameModel;
Button btn_cancel,btn_register;
EditText et_UserName,et_Password,et_Password_repeat;
//REVISED BY LYRIS 11/26+++
FontTextView tv_UserName,tv_Password,tv_Password_repeat;
CheckBox cb_ShowPW;
private static MediaPlayer bgm;
private SoundPool soundPool;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//register to Model
gameModel= GameModel.getInstance();
gameModel.addActivity(this);
gameModel.setRegistrationActivity(this);
// FULLSCREEN /LYRIS 11.26
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity_registration);
btn_cancel = (Button)findViewById(R.id.cancelButton);
btn_register = (Button) findViewById(R.id.registerButton);
btn_cancel.setOnClickListener(new bt_CancelListener());
btn_register.setOnClickListener(new bt_RegisterListener());
et_UserName = (EditText) findViewById(R.id.usernameRegisterText);
et_Password = (EditText) findViewById(R.id.passwordRegisterText);
et_Password_repeat = (EditText) findViewById(R.id.passwordConfirmText);
//ADD TV CB IME BY LYRIS 11/26+++
tv_UserName =(FontTextView) findViewById(R.id.usernameRegister);
tv_Password =(FontTextView)findViewById(R.id.passwordRegister);
tv_Password_repeat =(FontTextView) findViewById(R.id.passwordRegisterConfirm);
Typeface typeFace = Typeface.createFromAsset(getAssets(),"fonts/Marvel-Bold.ttf");
tv_UserName.setTypeface(typeFace);
tv_Password.setTypeface(typeFace);
tv_Password_repeat.setTypeface(typeFace);
//IME
et_UserName.setInputType(EditorInfo.TYPE_CLASS_TEXT);
et_Password.setInputType(InputType.TYPE_CLASS_TEXT |InputType.TYPE_TEXT_VARIATION_PASSWORD);
et_Password_repeat.setInputType(InputType.TYPE_CLASS_TEXT |InputType.TYPE_TEXT_VARIATION_PASSWORD);
cb_ShowPW=(CheckBox) findViewById(R.id.cb_showconfirmpassword);
cb_ShowPW.setOnClickListener(new cb_OnclickListener());
cb_ShowPW.setTypeface(typeFace);
BGMInit();
}
public void successful(String msg){
gameModel.showToast(RegistrationActivity.this, msg);
super.onBackPressed();
}
public void errorMessage(String err){
gameModel.showToast(RegistrationActivity.this, err);
}
private class bt_RegisterListener implements View.OnClickListener {
public void onClick(View v) {
if(gameModel.isSoundOn()==1){
soundPool.play(1,1,1,1,0,3);
}
String str_UserName=et_UserName.getText().toString();
String str_Password=et_Password.getText().toString();
String str_Pwd_confirm = et_Password_repeat.getText().toString();
Log.i("RegistrationActivity","bt_RegisterListener onClick!");
if(str_UserName.equals(""))
gameModel.showToast(RegistrationActivity.this, "Please Input the Username");
else if(str_Password.equals(""))
gameModel.showToast(RegistrationActivity.this, "Please Input the Password");
else if(!str_Pwd_confirm.equals(str_Password)){
gameModel.showToast(RegistrationActivity.this, "Password is not same");
}else{
gameModel.registration(str_UserName, str_Password);
}
}
}
private class bt_CancelListener implements View.OnClickListener {
public void onClick(View view) {
if(gameModel.isSoundOn()==1){
soundPool.play(1,1,1,1,0,3);
}
RegistrationActivity.super.onBackPressed();
overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out);
}
}
//show password /Lyris 11-26
private class cb_OnclickListener implements View.OnClickListener{
@Override
public void onClick(View v) {
if(gameModel.isSoundOn()==1){
soundPool.play(1,1,1,1,0,3);
}
if(RegistrationActivity.this.cb_ShowPW.isChecked()){
RegistrationActivity.this.et_Password.setTransformationMethod(HideReturnsTransformationMethod.getInstance());
RegistrationActivity.this.et_Password_repeat.setTransformationMethod(HideReturnsTransformationMethod.getInstance());
}
else{
RegistrationActivity.this.et_Password.setTransformationMethod(PasswordTransformationMethod.getInstance());
RegistrationActivity.this.et_Password_repeat.setTransformationMethod(PasswordTransformationMethod.getInstance());
}
}
}
public void BGMInit(){
//循环播放
if(gameModel.isMusicOn()==1){
bgm = MediaPlayer.create(this,R.raw.index_bg);
bgm.start();
bgm.setOnCompletionListener(new MediaPlayer.OnCompletionListener(){
@Override
public void onCompletion(MediaPlayer mp) {
bgm.start();
}
});
}
if(gameModel.isSoundOn()==1){
soundPool = new SoundPool(1, AudioManager.STREAM_MUSIC,0);
soundPool.load(this, R.raw.button, 1); //button
}
}
//跳转、中断暂停播放,回activity继续播放
@Override
protected void onStart() {
super.onStart();
if(gameModel.isMusicOn()==1) bgm.start();
}
@Override
protected void onStop() {
super.onStop();
if(bgm!= null)
bgm.pause();
}
@Override
protected void onDestroy() {
super.onDestroy();
if(bgm!= null)
bgm.release();
}
}
| [
"wen.bbing@hotmail.com"
] | wen.bbing@hotmail.com |
8cae83535cc35023335ffa78f2deef7a9e96e3fd | 515db64f15b5e0036ce5f2726f25ef903383e25e | /Examen1VeranoPatrones/src/ejercicio2/Error.java | 89ed18043b49cc66301f78f259b940248fc1000b | [] | no_license | AnaTeresaQR/gitHubRespaldo | 755b2d686257ccbca0ce0e492140cbed38f8c6f8 | 874c64490a081cee78ac031b44e3feb2b38cbd27 | refs/heads/master | 2016-09-01T13:23:29.839764 | 2016-04-02T01:09:29 | 2016-04-02T01:09:29 | 54,410,819 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 162 | java | package ejercicio2;
/**
*
* @author Ana Teresa
*/
public class Error extends Exception {
public Error(String message) {
super(message);
}
}
| [
"ana.quesada@ucrso.info"
] | ana.quesada@ucrso.info |
58e5b1b4f0a2751d31ff6639dac4429c9f48aca7 | 0bbbbba42a53404330910f91e619ba376ab50c52 | /app/src/main/java/com/example/a71033/nct_v1/module/model/ProListResponse.java | f359b5ff4369ed83db943809c63493711755e5b5 | [] | no_license | 710330668/cct | 06f6effd488b3fe9236433042d2955b1ff7ac5f5 | 5cf3fbd2370d97cc0852b86612dfdf5715fdc6fe | refs/heads/master | 2021-07-18T06:58:01.551386 | 2017-10-26T03:02:02 | 2017-10-26T03:02:02 | 106,240,196 | 1 | 0 | null | 2017-10-26T03:02:03 | 2017-10-09T05:30:10 | Java | UTF-8 | Java | false | false | 2,680 | java | package com.example.a71033.nct_v1.module.model;
import com.example.a71033.nct_v1.common.BaseResponse;
import java.util.List;
/**
* Created by 71033 on 2017/10/25.
*/
public class ProListResponse extends BaseResponse {
private List<Product> proList;
public List<Product> getProducts() {
return proList;
}
public List<Product> getProList() {
return proList;
}
public void setProList(List<Product> proList) {
this.proList = proList;
}
public static class Product{
private String proName;
private String proPresentPrice;
private String proOriginalPrice;
private String proIcon;
private String proType;
private String proVersion;
private String proDes;
private List<ProductDetailFigure> lists;
public String getProName() {
return proName;
}
public void setProName(String proName) {
this.proName = proName;
}
public String getProPresentPrice() {
return proPresentPrice;
}
public void setProPresentPrice(String proPresentPrice) {
this.proPresentPrice = proPresentPrice;
}
public String getProOriginalPrice() {
return proOriginalPrice;
}
public void setProOriginalPrice(String proOriginalPrice) {
this.proOriginalPrice = proOriginalPrice;
}
public String getProIcon() {
return proIcon;
}
public void setProIcon(String proIcon) {
this.proIcon = proIcon;
}
public String getProType() {
return proType;
}
public void setProType(String proType) {
this.proType = proType;
}
public String getProVersion() {
return proVersion;
}
public void setProVersion(String proVersion) {
this.proVersion = proVersion;
}
public String getProDes() {
return proDes;
}
public void setProDes(String proDes) {
this.proDes = proDes;
}
public List<ProductDetailFigure> getLists() {
return lists;
}
public void setLists(List<ProductDetailFigure> lists) {
this.lists = lists;
}
}
public static class ProductDetailFigure{
private String proDetailFigureURL;
public String getProDetailFigureURL() {
return proDetailFigureURL;
}
public void setProDetailFigureURL(String proDetailFigureURL) {
this.proDetailFigureURL = proDetailFigureURL;
}
}
}
| [
"qq452608069@sina.com"
] | qq452608069@sina.com |
8e57a33d922ed3354a0bc103b9426298ebdf0593 | ed589ea2c8dededa36d3b6d24fc86472a22322b6 | /trunk/GoJava4/serge.savin/KickstarterFiles/com/sergiisavin/kickstarter/userinterface/printer/Printer.java | 3d69564dbb93797d2f893a959af41f63ed99f3a8 | [] | no_license | baygoit/GoJava | dcf884d271a4612051036e4fdc2c882c343ec870 | a0a07165092bcc60e109c84227b0024f4bca38ed | refs/heads/master | 2020-04-16T01:46:09.808322 | 2016-08-06T06:28:13 | 2016-08-06T06:28:13 | 42,005,479 | 8 | 27 | null | 2016-03-09T11:26:20 | 2015-09-06T14:28:53 | Java | UTF-8 | Java | false | false | 120 | java | package com.sergiisavin.kickstarter.userinterface.printer;
public interface Printer {
void print(String text);
}
| [
"nissserge@gmail.com@371e26f7-1d5d-4d7b-6139-2def7fa80f1e"
] | nissserge@gmail.com@371e26f7-1d5d-4d7b-6139-2def7fa80f1e |
f05f52c7f65a990629d9991d039d0c71e6265e52 | 60972f8f9a1c587c8489950674d4d39a060bcb7b | /src/test/java/StepDefination/stepdefination.java | 9105dc0584028e4b5068a5d79697232d979325fb | [] | no_license | BegariPriyanka/SDET | 2a096bc2f733ca9b7a9055f0210aa36f50cd8ab5 | 076efe6f19b178e0f82d2554167411f5c1d3c601 | refs/heads/master | 2023-04-18T21:49:06.467122 | 2021-04-29T18:48:49 | 2021-04-29T18:48:49 | 362,914,114 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,213 | java | package StepDefination;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import cucumber.api.java.en.Given;
import cucumber.api.java.en.Then;
import cucumber.api.java.en.When;
import utilities.hooks;
public class stepdefination {
WebDriver driver = hooks.driver;
@Given("^user should launch browser$")
public void user_should_launch_browser() {
System.out.println("hello");
}
@Given("^click on signup link$")
public void click_on_signup_link() throws InterruptedException {
driver.findElement(By.partialLinkText( "Sign up" ) ).click();
Thread.sleep(3000);
}
@When("^enter mandaroty signup details$")
public void enter_mandaroty_signup_details() {
driver.findElement(By.xpath("//input[@id= 'registration_firstname']")).click();
driver.findElement(By.xpath("//input[@id= 'registration_firstname']")).sendKeys("Apple");
driver.findElement(By.xpath("//input[@id= 'registration_lastname']")).click();
driver.findElement(By.xpath("//input[@id='registration_lastname']")).sendKeys("Apple");
driver.findElement(By.xpath("//input[@id='registration_email']")).sendKeys("Apple@mail.com");
driver.findElement(By.xpath("//input[@id='username']")).sendKeys("App");
driver.findElement(By.xpath("//input[@name ='pass1']")).sendKeys("123134");
driver.findElement(By.xpath("//input[@name ='pass2']")).sendKeys("123134");
driver.findElement(By.xpath("//button[@id='registration_submit']")).submit();
}
@When("^click on Register button$")
public void click_on_Register_button() {
driver.findElement(By.xpath("//button[@id = 'registration_submit' ] ")).submit();
}
@Then("^confirmation message displays$")
public void confirmation_message_displays() {
System.out.println(driver.findElement(By.xpath("//div[@class ='col-xs-12 col-md-12']")).getText());
}
@Given("^: click on Drop dron$")
public void click_on_Drop_dron() {
driver.findElement(By.xpath("//a[@class ='dropdown-toggle']")).click();
}
@Given("^Verify Name$")
public void verify_Name() {
}
@Given("^Click on Inbox$")
public void click_on_Inbox() {
}
@Then("^Indox will be opened$")
public void indox_will_be_opened() {
}
}
| [
"prbegar1@in.ibm.com"
] | prbegar1@in.ibm.com |
675c2a6e98c25d5226f30cdde95ff3598e4476b5 | d03142402e2e050d68d083fa84b25cb8223221fb | /topcoder/tco2020/round4/CovidCinema.java | 03a45abace5ff2f71b8ade5ac5e33bc682f054ea | [
"Unlicense"
] | permissive | mikhail-dvorkin/competitions | b859028712d69d6a14ac1b6194e43059e262d227 | 4e781da37faf8c82183f42d2789a78963f9d79c3 | refs/heads/master | 2023-09-01T03:45:21.589421 | 2023-08-24T20:24:58 | 2023-08-24T20:24:58 | 93,438,157 | 10 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,452 | java | package topcoder.tco2020.round4;
import java.util.Arrays;
public class CovidCinema {
public String[] seat(int h, int w, int a, int b) {
String[] r;
r = seat(h, w, a, b, 'A', 'B');
if (r != null) return r;
r = seat(h, w, b, a, 'B', 'A');
if (r != null) return r;
return new String[0];
}
public String[] seat(int h, int w, int a, int b, char ca, char cb) {
char[][] ans = new char[h][w];
for (int d = 1; d <= h; d++) {
for (int i = 0; i < h; i++) {
Arrays.fill(ans[i], cb);
}
int count = a;
for (int j = 0; j < w; j++) {
for (int i = 0; i < d; i++) {
ans[i][j] = ca;
if (i + 1 < h) ans[i + 1][j] = '.';
if (j + 1 < w) ans[i][j + 1] = '.';
count--;
if (count == 0) break;
}
if (count == 0) break;
}
if (count > 0) continue;
count = b;
for (int i = 0; i < h; i++) {
for (int j = 0; j < w; j++) {
if (ans[i][j] == cb) {
if (count == 0) ans[i][j] = '.'; else count--;
}
}
}
if (count == 0) {
String[] answer = new String[h];
for (int i = 0; i < h; i++) {
answer[i] = new String(ans[i]);
}
return answer;
}
}
return null;
}
public static void main(String[] args) {
String[] r;
// r = new CovidCinema().seat(5, 5, 1, 1);
// r = new CovidCinema().seat(5, 5, 1, 12);
r = new CovidCinema().seat(5, 5, 12, 1);
r = new CovidCinema().seat(5, 5, 13, 7);
for (String s : r) {
System.out.println(s);
}
}
}
| [
"mikhail.dvorkin@gmail.com"
] | mikhail.dvorkin@gmail.com |
bce36c923184c38d115429ba5c7b8599fe087209 | bcc3362265ed71231e0189019947afc59655b238 | /src/main/java/com/detroitlabs/rainforest/model/Cart.java | 8a21ed8534ec9ea5d070bf106f31e8e0d6387b4c | [] | no_license | kareemjames/RainForest | 8b9761b2b0eaee791520eafdd84550a9135064a1 | 0717c60275ab12b7ad4336d196c63de5e3b18ae8 | refs/heads/master | 2020-04-26T19:16:50.266809 | 2019-03-06T20:53:43 | 2019-03-06T20:53:43 | 173,769,435 | 0 | 0 | null | 2019-03-06T20:53:44 | 2019-03-04T15:20:38 | Java | UTF-8 | Java | false | false | 1,190 | java | package com.detroitlabs.rainforest.model;
import java.util.ArrayList;
import java.util.List;
public class Cart {
private List<Product> cart;
public Cart() {
cart = new ArrayList<>();
}
public List<Product> viewAllItemsInCart() {
return cart;
}
public void addItemToCart(Product product) {
cart.add(product);
}
public void removeItemFromCart(int id) {
int initialCartSize = cart.size();
for (int i = 0; i < initialCartSize; i++) {
if (cart.get(i).getUniqueId() == id) {
cart.remove(i);
break;
}
}
}
public int getSizeOfCart() {
return cart.size();
}
public void setCart(List<Product> cart) {
this.cart = cart;
}
public double totalPriceOfProductInCart() {
double checkoutTotal = 0;
List<Double> pricesOfItemsInCart = new ArrayList<>();
for(Product product : cart){
pricesOfItemsInCart.add(product.getPrice());
}
for(Double priceOfItem : pricesOfItemsInCart){
checkoutTotal += priceOfItem;
}
return checkoutTotal;
}
}
| [
"mikaylaclemons@Mikaylas-MacBook-Pro.local"
] | mikaylaclemons@Mikaylas-MacBook-Pro.local |
4269a6ac5008aba34a166cda9ed86ffd968c13cf | 6ce3b4a9270707a93ab5f0e5ec526bff0407dac7 | /comun/src/main/java/net/ramptors/si/ModeloFormAbc.java | 77aa3eb183a50efc83b3fb84b91fb10eccfd6818 | [] | no_license | jkrad/ReservAndEat | 23eecd7f22dda5cc920ae365f168db13b80a8402 | 991a508ab59a3352843a9d0f1676e1ee079b6b1f | refs/heads/master | 2021-01-01T04:27:41.587493 | 2017-07-22T02:11:07 | 2017-07-22T02:11:07 | 97,176,509 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,580 | java | /*
* Copyright 2017 Gilberto Pacheco Gallegos.
*
* 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 net.ramptors.si;
import java.util.List;
/**
* @author Gilberto Pacheco Gallegos
*/
@SuppressWarnings("unused")
public class ModeloFormAbc extends ModeloForm {
private List<Renglon> lista;
private String detalleTitulo;
private String nuevo;
private String eliminarMuestra;
public List<Renglon> getLista() {
return lista;
}
public void setLista(List<Renglon> lista) {
this.lista = lista;
}
public String getDetalleTitulo() {
return detalleTitulo;
}
public void setDetalleTitulo(String detalleTitulo) {
this.detalleTitulo = detalleTitulo;
}
public String getNuevo() {
return nuevo;
}
public void setNuevo(String nuevo) {
this.nuevo = nuevo;
}
public String getEliminarMuestra() {
return eliminarMuestra;
}
public void setEliminarMuestra(String eliminarMuestra) {
this.eliminarMuestra = eliminarMuestra;
}
}
| [
"reservaenproyecto@gmail.com"
] | reservaenproyecto@gmail.com |
3c541d61f3b3a956fef194c5b3af1e0eb96c52a3 | 5fd64cf69be8dc23411794259265847bcad200b3 | /src/main/java/com/maraphon/maraphonskills/domain/Authorities.java | 987ac2259421c84ec1aa4d4c9dd51d7ebc7c13f2 | [] | no_license | Maximko17/maraphon-skills | f81ef92d371090cc2a46f9ce4d16560de3393143 | 3548e8f2fd6c1d1021443c650f8d2f95df196e3e | refs/heads/master | 2020-08-09T14:07:24.323646 | 2019-10-10T06:27:56 | 2019-10-10T06:27:56 | 214,103,736 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 568 | java | package com.maraphon.maraphonskills.domain;
import lombok.Getter;
import lombok.Setter;
import org.springframework.security.core.GrantedAuthority;
import javax.persistence.*;
@Entity
@Getter
@Setter
public class Authorities implements GrantedAuthority {
private static final long serialVersionUID = -8123526131047887755L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private String authority;
@ManyToOne
private User user;
@Override
public String getAuthority() {
return authority;
}
}
| [
"maxim06122000@mail.ru"
] | maxim06122000@mail.ru |
fbb1db6cc46752b29395cd4f744d67cee85d811f | 179760edfbd221a02cec6098a5777ce3a2c140cb | /Android/Ejercicios_Victor/NuevasPlantillas/app/src/main/java/longui/nuevasplantillas/MainActivity.java | fb94ee18514bba2c36bf49527b4d4b133a5d65ea | [] | no_license | santii810/Dam209 | e5f1fee9b0e28eec9442de40cde3521c2f5981ab | 8b4e5a12762cb4b97f0b00593423d614c6250310 | refs/heads/master | 2021-01-10T03:58:55.799112 | 2016-03-04T11:08:11 | 2016-03-04T11:08:11 | 49,642,577 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,295 | java | package longui.nuevasplantillas;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.view.Menu;
import android.view.MenuItem;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
}
| [
"santii810@hotmail.com"
] | santii810@hotmail.com |
3702ff39b06741f4f2f486180a1cd9e12b2bce97 | dad1e8f3f204ade41769efe435e464d5cd6f8d69 | /handling/src/main/java/by/kononov/handling/interpreter/BitwiseInterpreter.java | fcb8c657c163782d3de49332da6b6883c4ebc7e2 | [] | no_license | unicorn2828/epam_task2_handling | 7db44f103a45700e105c5468be5743b903a062ee | 383be9c8d79e684e6e3e999b4327d79b409776e7 | refs/heads/master | 2021-12-30T20:03:21.722663 | 2019-12-26T19:07:47 | 2019-12-26T19:07:47 | 230,314,526 | 0 | 0 | null | 2021-12-14T21:38:25 | 2019-12-26T19:05:54 | Java | UTF-8 | Java | false | false | 1,876 | java | package by.kononov.handling.interpreter;
import static by.kononov.handling.interpreter.BitwiseType.AND;
import static by.kononov.handling.interpreter.BitwiseType.COMPLEMENT;
import static by.kononov.handling.interpreter.BitwiseType.LEFT_SHIFT;
import static by.kononov.handling.interpreter.BitwiseType.NUMBER_REGEX;
import static by.kononov.handling.interpreter.BitwiseType.OR;
import static by.kononov.handling.interpreter.BitwiseType.RIGHT_SHIFT;
import static by.kononov.handling.interpreter.BitwiseType.XOR;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class BitwiseInterpreter{
private static final String SPLIT_REGEX = "\\p{Blank}+";
public List<MathExpression> parse(String bitExpression) {
PolishNotation notation = new PolishNotation();
bitExpression = notation.convertToPolishNotation(bitExpression);
String[] operators =
Arrays.stream(bitExpression.split(SPLIT_REGEX)).filter(o -> !o.isEmpty()).toArray(String[]::new);
List<MathExpression> expression = new ArrayList<>();
for (String element : operators) {
switch (element) {
case COMPLEMENT:
expression.add(o -> o.push(~o.pop()));
break;
case AND:
expression.add(o -> o.push(o.pop() & o.pop()));
break;
case XOR:
expression.add(o -> o.push(o.pop() ^ o.pop()));
break;
case OR:
expression.add(o -> o.push(o.pop() | o.pop()));
break;
case RIGHT_SHIFT:
expression.add(o -> o.push(o.pop() >> o.pop()));
break;
case LEFT_SHIFT:
expression.add(o -> o.push(o.pollLast() << o.pollLast()));
break;
default:
if (isNumber(element)) {
expression.add(o -> o.push(Integer.parseInt(element)));
}
}
}
return expression;
}
private boolean isNumber(String element) {
if (element == null) {
return false;
}
return element.matches(NUMBER_REGEX);
}
} | [
"260v2602gmail.com"
] | 260v2602gmail.com |
1d443749e98198fb898fb2c5a1129a7df0c9cf88 | f621b02068a12ec4af7e0dd3d185046919efcc5e | /src/main/java/com/udacity/cloudstorage/mappers/FilesMapper.java | 91bf189a5d9a4f9be503f9b39990055fd69420f8 | [] | no_license | carlshi12r44/super-duper-drive | 175aa9ede317e46678e6be7659ec580dd0a40a5b | 3ae900f96133933a31852b02a4ca6b7bc4a51a36 | refs/heads/master | 2022-11-07T23:14:02.839576 | 2020-06-27T15:57:19 | 2020-06-27T15:57:19 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 957 | java | package com.udacity.cloudstorage.mappers;
import com.udacity.cloudstorage.models.Files;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
@Repository
@Mapper
public interface FilesMapper {
@Select("SELECT * FROM FILES")
List<Files> findAll();
@Select("SELECT * FROM FILES WHERE fileid = #{fileid}")
Files findOne(int fileid);
@Select("SELECT * FROM FILES WHERE userid = #{userid}")
List<Files> findByUserId(int userid);
@Insert(
"INSERT INTO FILES (filename, contenttype, filesize, filedata, userid) VALUES (#{file.filename}, #{file.contenttype}, #{file.filesize}, #{file.filedata}, #{userid})")
int insertFile(Files file, int userid);
@Delete("DELETE FROM FILES WHERE fileid = #{fileid}")
int deleteFile(int fileid);
}
| [
"suryakantbansal97@gmail.com"
] | suryakantbansal97@gmail.com |
251d17db17ff365abab455a65a8552807646111e | 6c0f45c4b110fcbba7c68e3d1b39e1e99bfd30a1 | /Android Applications/GoTracker/app/src/main/java/se/mah/af6260/gotracker/SessionAdapter.java | 84f089c39935715b209be3bb806a554a9fb0ab8a | [] | no_license | KristoferSvensson/University-Assignments | 80f768003a7a5488e66226d30e410b583dde5b17 | 8bba1381585ead9a281ea607112db3ae27e0881e | refs/heads/master | 2020-03-30T12:49:09.120670 | 2018-10-02T11:19:27 | 2018-10-02T11:19:27 | 151,242,402 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,110 | java | package se.mah.af6260.gotracker;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import java.util.ArrayList;
/**
* Created by oskar on 2017-03-14.
*/
public class SessionAdapter extends ArrayAdapter<Session> {
private LayoutInflater inflater;
public SessionAdapter(Context context, ArrayList<Session> sessionList) {
super(context, R.layout.cursor_adapter_sessions , sessionList);
inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
}
public View getView(int position, View convertView, ViewGroup parent){
ViewHolder holder;
if(convertView == null){
convertView = (LinearLayout)inflater.inflate( R.layout.cursor_adapter_sessions,parent,false);
holder = new ViewHolder();
holder.ivActivity = (ImageView)convertView.findViewById(R.id.ivActivity);
holder.tvStarTime = (TextView)convertView.findViewById(R.id.tvStartTime);
holder.tvDuration = (TextView)convertView.findViewById(R.id.tvDuration);
convertView.setTag(holder);
} else {
holder = (ViewHolder)convertView.getTag();
}
if(getItem(position).getActivityType().equals("running")){
holder.ivActivity.setImageResource(R.drawable.running);
} else if(getItem(position).getActivityType().equals("cycling")){
holder.ivActivity.setImageResource(R.drawable.bicycling);
} else if(getItem(position).getActivityType().equals("walking")){
holder.ivActivity.setImageResource(R.drawable.walking);
}
holder.tvStarTime.setText(getItem(position).getStartTime());
holder.tvDuration.setText(getItem(position).getDuration());
return convertView;
}
private class ViewHolder{
ImageView ivActivity;
TextView tvStarTime;
TextView tvDuration;
}
} | [
"kristofer87sv@gmail.com"
] | kristofer87sv@gmail.com |
507d49b23c22550467b2cce63ddfe6af7135b8a0 | 6a074c4114ee1ea953e68cdfe1d3af23ab71de4c | /Layout_Master_Detail_Flow/src/com/acastor/layout_master_detail_flow/ItemListFragment.java | 1f9baeeaf401f2494fd1b1153fb874b8079fd6ca | [] | no_license | casterfile/AndroidProject | 570ef5716e818be98f12eb09668bdec8ad9f30c8 | 901529d9e4d9b8f0dfe4e852afde178ded9d83da | refs/heads/master | 2018-12-29T15:01:58.676658 | 2015-02-02T06:55:41 | 2015-02-02T06:55:41 | 28,067,388 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 5,051 | java | package com.acastor.layout_master_detail_flow;
import android.app.Activity;
import android.os.Bundle;
import android.app.ListFragment;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import com.acastor.layout_master_detail_flow.dummy.DummyContent;
/**
* A list fragment representing a list of Items. This fragment
* also supports tablet devices by allowing list items to be given an
* 'activated' state upon selection. This helps indicate which item is
* currently being viewed in a {@link ItemDetailFragment}.
* <p>
* Activities containing this fragment MUST implement the {@link Callbacks}
* interface.
*/
public class ItemListFragment extends ListFragment {
/**
* The serialization (saved instance state) Bundle key representing the
* activated item position. Only used on tablets.
*/
private static final String STATE_ACTIVATED_POSITION = "activated_position";
/**
* The fragment's current callback object, which is notified of list item
* clicks.
*/
private Callbacks mCallbacks = sDummyCallbacks;
/**
* The current activated item position. Only used on tablets.
*/
private int mActivatedPosition = ListView.INVALID_POSITION;
/**
* A callback interface that all activities containing this fragment must
* implement. This mechanism allows activities to be notified of item
* selections.
*/
public interface Callbacks {
/**
* Callback for when an item has been selected.
*/
public void onItemSelected(String id);
}
/**
* A dummy implementation of the {@link Callbacks} interface that does
* nothing. Used only when this fragment is not attached to an activity.
*/
private static Callbacks sDummyCallbacks = new Callbacks() {
@Override
public void onItemSelected(String id) {
}
};
/**
* Mandatory empty constructor for the fragment manager to instantiate the
* fragment (e.g. upon screen orientation changes).
*/
public ItemListFragment() {
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// TODO: replace with a real list adapter.
setListAdapter(new ArrayAdapter<DummyContent.DummyItem>(
getActivity(),
android.R.layout.simple_list_item_activated_1,
android.R.id.text1,
DummyContent.ITEMS));
}
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
// Restore the previously serialized activated item position.
if (savedInstanceState != null
&& savedInstanceState.containsKey(STATE_ACTIVATED_POSITION)) {
setActivatedPosition(savedInstanceState.getInt(STATE_ACTIVATED_POSITION));
}
}
@Override
public void onAttach(Activity activity) {
super.onAttach(activity);
// Activities containing this fragment must implement its callbacks.
if (!(activity instanceof Callbacks)) {
throw new IllegalStateException("Activity must implement fragment's callbacks.");
}
mCallbacks = (Callbacks) activity;
}
@Override
public void onDetach() {
super.onDetach();
// Reset the active callbacks interface to the dummy implementation.
mCallbacks = sDummyCallbacks;
}
@Override
public void onListItemClick(ListView listView, View view, int position, long id) {
super.onListItemClick(listView, view, position, id);
// Notify the active callbacks interface (the activity, if the
// fragment is attached to one) that an item has been selected.
mCallbacks.onItemSelected(DummyContent.ITEMS.get(position).id);
}
@Override
public void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
if (mActivatedPosition != ListView.INVALID_POSITION) {
// Serialize and persist the activated item position.
outState.putInt(STATE_ACTIVATED_POSITION, mActivatedPosition);
}
}
/**
* Turns on activate-on-click mode. When this mode is on, list items will be
* given the 'activated' state when touched.
*/
public void setActivateOnItemClick(boolean activateOnItemClick) {
// When setting CHOICE_MODE_SINGLE, ListView will automatically
// give items the 'activated' state when touched.
getListView().setChoiceMode(activateOnItemClick
? ListView.CHOICE_MODE_SINGLE
: ListView.CHOICE_MODE_NONE);
}
private void setActivatedPosition(int position) {
if (position == ListView.INVALID_POSITION) {
getListView().setItemChecked(mActivatedPosition, false);
} else {
getListView().setItemChecked(position, true);
}
mActivatedPosition = position;
}
}
| [
"dev.anthonycastor@gmail.com"
] | dev.anthonycastor@gmail.com |
99c2a3d6b83166db050ff3da274c7b28211689a0 | ea03c0eff8dbdceaab3fc1c3c9e843fadf3018a2 | /modules/jaxws/test/org/apache/axis2/jaxws/nonanonymous/complextype/NonAnonymousComplexTypeTests.java | b376debfe17d128f6cc3b895afd96701b5f914a7 | [
"Apache-2.0"
] | permissive | cranelab/axis1_3 | 28544dbcf3bf0c9bf59a59441ad8ef21143f70f0 | 1754374507dee9d1502478c454abc1d13bcf15b9 | refs/heads/master | 2022-12-28T05:17:18.894411 | 2020-04-22T17:50:05 | 2020-04-22T17:50:05 | 257,970,632 | 0 | 0 | Apache-2.0 | 2020-10-13T21:25:37 | 2020-04-22T17:21:46 | Java | UTF-8 | Java | false | false | 2,008 | java | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
/**
*
*/
package org.apache.axis2.jaxws.nonanonymous.complextype;
import javax.xml.ws.WebServiceException;
import junit.framework.TestCase;
import org.apache.axis2.jaxws.nonanonymous.complextype.sei.EchoMessagePortType;
import org.apache.axis2.jaxws.nonanonymous.complextype.sei.EchoMessageService;
import org.apache.axis2.jaxws.TestLogger;
public class NonAnonymousComplexTypeTests extends TestCase {
/**
*
*/
public NonAnonymousComplexTypeTests() {
super();
// TODO Auto-generated constructor stub
}
/**
* @param arg0
*/
public NonAnonymousComplexTypeTests(String arg0) {
super(arg0);
// TODO Auto-generated constructor stub
}
public void testSimpleProxy() {
TestLogger.logger.debug("------------------------------");
TestLogger.logger.debug("Test : " + getName());
try {
String msg = "Hello Server";
EchoMessagePortType myPort = (new EchoMessageService()).getEchoMessagePort();
String response = myPort.echoMessage(msg);
TestLogger.logger.debug(response);
TestLogger.logger.debug("------------------------------");
} catch (WebServiceException webEx) {
webEx.printStackTrace();
fail();
}
}
}
| [
"45187319+cranelab@users.noreply.github.com"
] | 45187319+cranelab@users.noreply.github.com |
6dc83d6592fcf0191b049d00023fba8c0f93aafc | 89723541f3a2cc7087d49dcee592694c5c0513c3 | /hapi-fhir-structures-r4/src/main/java/org/hl7/fhir/r4/model/codesystems/AuditEntityTypeEnumFactory.java | aec8a2c899e8942de8453abc4af74037ff4d91c1 | [
"Apache-2.0",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | rkorytkowski/hapi-fhir | 7207ae68ff8ef6e876f53b51bbdbd0312ae0daa7 | 9f45c2bcfa00349ce17e191899581f4fc6e8c0d6 | refs/heads/master | 2021-07-13T01:06:12.674713 | 2020-06-16T09:11:38 | 2020-06-16T09:12:23 | 145,406,752 | 0 | 2 | Apache-2.0 | 2018-08-20T11:08:35 | 2018-08-20T11:08:35 | null | UTF-8 | Java | false | false | 2,745 | java | package org.hl7.fhir.r4.model.codesystems;
/*
Copyright (c) 2011+, HL7, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of HL7 nor the names of its contributors may be used to
endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
// Generated on Sun, May 6, 2018 17:51-0400 for FHIR v3.4.0
import org.hl7.fhir.r4.model.EnumFactory;
public class AuditEntityTypeEnumFactory implements EnumFactory<AuditEntityType> {
public AuditEntityType fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("1".equals(codeString))
return AuditEntityType._1;
if ("2".equals(codeString))
return AuditEntityType._2;
if ("3".equals(codeString))
return AuditEntityType._3;
if ("4".equals(codeString))
return AuditEntityType._4;
throw new IllegalArgumentException("Unknown AuditEntityType code '"+codeString+"'");
}
public String toCode(AuditEntityType code) {
if (code == AuditEntityType._1)
return "1";
if (code == AuditEntityType._2)
return "2";
if (code == AuditEntityType._3)
return "3";
if (code == AuditEntityType._4)
return "4";
return "?";
}
public String toSystem(AuditEntityType code) {
return code.getSystem();
}
}
| [
"jamesagnew@gmail.com"
] | jamesagnew@gmail.com |
f73a5f0317fde22f0b125b74a7cb33cf45da1ebe | 72ba968fe4501c806d6309a6bc8fc4543de43d74 | /threes/mutantesSecondRun/generation-1/mutant-0/threes/ThreesController/move_up/AOIS/86/threes/ThreesController.java | 1aa38c5e7c52013ce5e5fe5bfc0b9ec07576cbc2 | [] | no_license | cesarcorne/threes | 010c0ef7e1760531e99be1d331269f35489b17e2 | b7d56d9bdb149292decf7fa6c5d1f30726e445ae | refs/heads/master | 2021-01-01T04:35:22.141150 | 2016-05-20T15:10:12 | 2016-05-20T15:10:12 | 58,375,189 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 13,374 | java | package threes;
import java.io.IOException;
import java.util.LinkedList;
import java.util.Map;
public class ThreesController {
//Stores the Threes board
private ThreesBoard board;
//Stores the next tile that will appear in the board.
private int nextTileValue;
//Stores the rows that move during the last movement
private LinkedList<Integer> movedRows;
//Stores the columns that move during the last movement
private LinkedList<Integer> movedColumns;
public ThreesController() {
//Create the initial board.
//9 random tails set with 1, 2 or 3.
board = new ThreesBoard( 9 );
//Set randomly the next tile to appear in the board.
nextTileValue = board.getRandom( 3 ) + 1;
//initially no row or column has been moved.
movedRows = new LinkedList<Integer>();
movedColumns = new LinkedList<Integer>();
}
public ThreesController( ThreesBoard b ) {
this.board = b;
//Set randomly the next tile to appear in the board.
nextTileValue = board.getRandom( 3 ) + 1;
//initially no row or column has been moved.
movedRows = new LinkedList<Integer>();
movedColumns = new LinkedList<Integer>();
}
public ThreesBoard getBoard() {
return board;
}
public int getNextTileValue() {
return nextTileValue;
}
//command move up
public boolean move_up() {
//clear last movements lists
movedRows.clear();
movedColumns.clear();
if (!board.can_move_up()) {
return false;
}
boolean modified = false;
for (int j = 0; j < ThreesBoard.COLUMNS; j++) {
//can_combine iff the last two tiles are not free and there is no free tile in the middle.
boolean can_combine = !board.get_tile( 0, j ).isFree() && !board.get_tile( 1, j ).isFree() && !(board.get_tile( 2, j ).isFree() && !board.get_tile( 3, j ).isFree());
if (!can_combine) {
//move the tile to fill the free spaces
int i = 0;
while (!board.get_tile( i, j ).isFree()) {
i++;
}
for (int k = i + 1; k < ThreesBoard.ROWS; k++) {
if (!board.get_tile( k, j ).isFree()) {
movedColumns.add( j );
}
board.set_tile( k - 1, j, board.get_tile( --k, j ).getValue() );
}
board.set_tile( ThreesBoard.ROWS - 1, j, 0 );
//empty the last position
modified = true;
//fix bug
} else {
//combine just once. Here there is no free tile in the middle
boolean updated = false;
for (int i = 0; i < ThreesBoard.ROWS - 1 && !updated; i++) {
if (board.tiles_can_combine( board.get_tile( i, j ), board.get_tile( i + 1, j ) )) {
//produce first combination
threes.ThreesTile t = board.get_tile( i, j ).combine_tile( board.get_tile( i + 1, j ) );
board.set_tile( i, j, t.getValue() );
//move anything else up in the same row
for (int k = i + 1; k < ThreesBoard.ROWS - 1; k++) {
board.set_tile( k, j, board.get_tile( k + 1, j ).getValue() );
}
movedColumns.add( j );
board.set_tile( ThreesBoard.ROWS - 1, j, 0 );
//empty the last position
modified = true;
updated = true;
}
}
}
}
loadNextTileOnColumns( true );
return modified;
}
//command move down
public boolean move_down() {
//clear last movements lists
movedRows.clear();
movedColumns.clear();
if (!board.can_move_down()) {
return false;
}
boolean modified = false;
for (int j = 0; j < ThreesBoard.COLUMNS; j++) {
//can_combine iff the last two tiles are not free and there is no free tile in the middle.
boolean can_combine = !board.get_tile( 3, j ).isFree() && !board.get_tile( 2, j ).isFree() && !(board.get_tile( 1, j ).isFree() && !board.get_tile( 0, j ).isFree());
if (!can_combine) {
//move the tile to fill the free spaces
int i = ThreesBoard.ROWS - 1;
while (!board.get_tile( i, j ).isFree()) {
i--;
}
for (int k = i - 1; k >= 0; k--) {
if (!board.get_tile( k, j ).isFree()) {
movedColumns.add( j );
}
board.set_tile( k + 1, j, board.get_tile( k, j ).getValue() );
}
board.set_tile( 0, j, 0 );
modified = true;
} else {
//combine just once. Here there is no free tile in the middle
boolean updated = false;
for (int i = ThreesBoard.ROWS - 1; i > 0 && !updated; i--) {
if (board.tiles_can_combine( board.get_tile( i, j ), board.get_tile( i - 1, j ) )) {
//produce first combination
threes.ThreesTile t = board.get_tile( i, j ).combine_tile( board.get_tile( i - 1, j ) );
board.set_tile( i, j, t.getValue() );
//move anything else to left in the same row
for (int k = i - 2; k >= 0; k--) {
board.set_tile( k + 1, j, board.get_tile( k, j ).getValue() );
}
movedColumns.add( j );
board.set_tile( 0, j, 0 );
//empty the last position
//no actualiza la variable updated lo cual permitiria hacer dos cambios en la misma columna
updated = true;
modified = true;
}
}
}
}
loadNextTileOnColumns( false );
return modified;
}
//command move left
public boolean move_left() {
//clear last movements lists
movedRows.clear();
movedColumns.clear();
if (!board.can_move_left()) {
return false;
}
boolean modified = false;
for (int i = 0; i < ThreesBoard.ROWS; i++) {
//can_combine iff the first two tiles are not free and there is no free tile in the middle.
boolean can_combine = !board.get_tile( i, 0 ).isFree() && !board.get_tile( i, 1 ).isFree() && !(board.get_tile( i, 2 ).isFree() && !board.get_tile( i, 3 ).isFree());
if (!can_combine) {
//move the tile to fill the free spaces
int j = 0;
while (!board.get_tile( i, j ).isFree()) {
j++;
}
for (int k = j + 1; k < ThreesBoard.COLUMNS; k++) {
if (!board.get_tile( i, k ).isFree()) {
movedRows.add( i );
}
board.set_tile( i, k - 1, board.get_tile( i, k ).getValue() );
}
board.set_tile( i, ThreesBoard.COLUMNS - 1, 0 );
//empty the last position
modified = true;
} else {
//combine just once. Here there is no free tile in the middle
boolean updated = false;
for (int j = 0; j < ThreesBoard.COLUMNS - 1 && !updated; j++) {
if (board.tiles_can_combine( board.get_tile( i, j ), board.get_tile( i, j + 1 ) )) {
//produce first combination
threes.ThreesTile t = board.get_tile( i, j ).combine_tile( board.get_tile( i, j + 1 ) );
board.set_tile( i, j, t.getValue() );
//move anything else to left in the same row
for (int k = j + 1; k < ThreesBoard.COLUMNS - 1; k++) {
board.set_tile( i, k, board.get_tile( i, k + 1 ).getValue() );
}
movedRows.add( i );
board.set_tile( i, ThreesBoard.COLUMNS - 1, 0 );
//empty the last position
updated = true;
modified = true;
}
}
}
}
loadNextTileOnRows( true );
return modified;
}
//command move right
public boolean move_right() {
//clear last movements lists
movedRows.clear();
movedColumns.clear();
if (!board.can_move_right()) {
return false;
}
boolean modified = false;
for (int i = 0; i < ThreesBoard.ROWS; i++) {
//can_combine iff the first two tiles are not free and there is no free tile in the middle.
boolean can_combine = !board.get_tile( i, 3 ).isFree() && !board.get_tile( i, 2 ).isFree() && !(board.get_tile( i, 1 ).isFree() && !board.get_tile( i, 0 ).isFree());
if (!can_combine) {
//move the tile to fill the free spaces
int j = ThreesBoard.COLUMNS - 1;
while (!board.get_tile( i, j ).isFree()) {
j--;
}
for (int k = j - 1; k >= 0; k--) {
if (!board.get_tile( i, k ).isFree()) {
movedRows.add( i );
}
board.set_tile( i, k + 1, board.get_tile( i, k ).getValue() );
}
board.set_tile( i, 0, 0 );
//empty the first position
modified = true;
} else {
//combine just once. Here there is no free tile in the middle
boolean updated = false;
for (int j = ThreesBoard.COLUMNS - 1; j > 0 && !updated; j--) {
if (board.tiles_can_combine( board.get_tile( i, j ), board.get_tile( i, j - 1 ) )) {
//produce first combination
threes.ThreesTile t = board.get_tile( i, j ).combine_tile( board.get_tile( i, j - 1 ) );
board.set_tile( i, j, t.getValue() );
//move anything else to left in the same row
for (int k = j - 2; k >= 0; k--) {
board.set_tile( i, k + 1, board.get_tile( i, k ).getValue() );
}
movedRows.add( i );
board.set_tile( i, 0, 0 );
//empty the last position
updated = true;
modified = true;
}
}
}
}
loadNextTileOnRows( false );
return modified;
}
private void loadNextTileOnColumns( boolean up ) {
//Assume an upward or downward was performed.
if (!movedColumns.isEmpty()) {
int pos = board.getRandom( movedColumns.size() );
if (up) {
board.set_tile( ThreesBoard.ROWS - 1, movedColumns.get( pos ), nextTileValue );
} else {
board.set_tile( 0, movedColumns.get( pos ), nextTileValue );
}
nextTileValue = board.getRandom( 3 ) + 1;
}
}
private void loadNextTileOnRows( boolean left ) {
//Assume an upward or downward was performed.
if (!movedRows.isEmpty()) {
int pos = board.getRandom( movedRows.size() );
if (left) {
board.set_tile( movedRows.get( pos ), ThreesBoard.COLUMNS - 1, nextTileValue );
} else {
board.set_tile( movedRows.get( pos ), 0, nextTileValue );
}
nextTileValue = board.getRandom( 3 ) + 1;
}
}
/* For mocking: */
private ISaveManager savemanager;
public void setSaveManager( ISaveManager m ) {
savemanager = m;
}
public boolean saveGame( String folderName, String fileName )
throws IOException {
try {
if (savemanager.setFolder( folderName ) && !fileName.contains( "." )) {
java.lang.String fileNameExt = fileName + ".ths";
return savemanager.saveToFile( board, nextTileValue, fileNameExt );
}
} catch ( IOException e ) {
System.out.println( "Save failed!" );
}
return false;
}
public boolean loadGame( String folderName, String fileName ) {
try {
if (savemanager.setFolder( folderName ) && fileName.endsWith( ".ths" )) {
java.util.Map.Entry<ThreesBoard, Integer> res = savemanager.loadFromFile( fileName );
if (res != null) {
board = res.getKey();
nextTileValue = res.getValue();
return true;
}
}
} catch ( IOException e ) {
System.out.println( "Save failed!" );
}
return false;
}
}
| [
"cesarmcornejo@gmail.com"
] | cesarmcornejo@gmail.com |
3038e184a4a09dff495a17d9f40288060ab11836 | f38cd838b4d41ed8a133c4308fd929e9d3ee2ce8 | /04-mongo/springboot-mongo/src/main/java/panfeng/pojo/Grade.java | 33f5e574da6575550f1d70784a17de61b40b8d68 | [] | no_license | fanv521314/case | 252f60d8540797d75ffaea416b9f3c708e763b28 | 25cea9df25097015454af6eede19979ba4c81c6e | refs/heads/master | 2022-02-24T01:09:25.465103 | 2019-09-30T09:02:20 | 2019-09-30T09:02:20 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 551 | java | package panfeng.pojo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import java.util.List;
@Document(collection = "grade")//对应表名
@Data//setter getter toString
@NoArgsConstructor//无参构造
@AllArgsConstructor//全参构造
public class Grade
{
@Id//主键
private String id;
private Integer grade_id;
private String grade_name;
private List<Student> student_list;
}
| [
"1801957499@qq.com"
] | 1801957499@qq.com |
2f3b58a913e853417e37b271f61e5e1e67f8e2ab | 1ae7030a6ccdcd9600deef81f67ec704ee56b9bc | /src/utils/DBUtil.java | c2349bd412e6f13d1159133874766ee7675513ce | [] | no_license | akane-senseki/original_applications | 7f3385a2e98a072a6a2bb5298ebdaa734c1c4e87 | c6259ac0f5a6d177d8e1919deaabad1ecca39005 | refs/heads/main | 2023-02-09T17:58:16.217921 | 2020-12-26T07:51:00 | 2020-12-26T07:51:00 | 319,858,632 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 631 | java | package utils;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
public class DBUtil {
private static final String PERSISTENCE_UNIT_NAME = "original_applications";
private static EntityManagerFactory emf;
public static EntityManager createEntityManager() {
return getEntityManagerFactory().createEntityManager();
}
private static EntityManagerFactory getEntityManagerFactory() {
if(emf == null) {
emf = Persistence.createEntityManagerFactory(PERSISTENCE_UNIT_NAME);
}
return emf;
}
} | [
"ajajggpw@gmail.com"
] | ajajggpw@gmail.com |
d360270b2187c5fc38e609798b122aad88006984 | bab84b699f214e5cafbae0162eda7cb98e8298c7 | /SpringMVC/src/com/demo/web/controllers/ValidateController.java | 896129d268c49b283165df9d7e58ab568cae2847 | [] | no_license | always-busy/SpringMVC | 99d7db2ee664fc6625aa4d41b8612f81fb53e5ba | 2be263e2713ae3d18947f19e2f06bb59c66ac0f5 | refs/heads/master | 2021-01-10T14:27:41.491393 | 2015-12-15T01:44:24 | 2015-12-15T01:44:24 | 47,452,709 | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 1,172 | java | package com.demo.web.controllers;
import javax.validation.Valid;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import com.demo.web.models.ValidateModel;
@Controller
@RequestMapping(value="/validate")
public class ValidateController {
@RequestMapping(value="/test",method={RequestMethod.GET})
public String test(Model model){
if(!model.containsAttribute("contentModel")){
model.addAttribute("contentModel", new ValidateModel());
}
return "validatetest";
}
//@Valid 意思是在把数据绑定到@ModelAttribute("contentModel") 后就进行验证。
@RequestMapping(value="/test",method={RequestMethod.POST})
public String test(Model model,@Valid @ModelAttribute("contentModel") ValidateModel validateModel,BindingResult bindingResult){
if(bindingResult.hasErrors()){
return test(model);
}
return "validatesuccess";
}
}
| [
"694924636@qq.com"
] | 694924636@qq.com |
a0191b63a554f56aa4f44c2f133c5bee1746eaf8 | e4eea00b50a7fa6d6f5b2e0a049ecd0433ee7897 | /src/main/java/others/MySQLHelper.java | 80f862c6062f3e3ef86d72eefb9ee9892145d32b | [] | no_license | andrew-pahomov/temp_test | c5dd7c8e031b93c2a2963aa2473fe1bf0f3fd067 | 086db582d2a314184fdb5e0a6da0f92eae8fc38f | refs/heads/master | 2023-04-03T15:25:10.338221 | 2021-04-25T06:50:49 | 2021-04-25T06:50:49 | 361,352,531 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 3,797 | java | package others;
import java.sql.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class MySQLHelper {
private static String hostName;
private static String dbName;
private static String userName;
private static String password;
public static void init(String hostName, String dbName, String userName,
String password) throws ClassNotFoundException, SQLException {
Class.forName("com.mysql.cj.jdbc.Driver");
MySQLHelper.hostName = hostName;
MySQLHelper.dbName = dbName;
MySQLHelper.userName = userName;
MySQLHelper.password = password;
Connection conn = getMySQLConnection();
Places[] places = Places.values();
List<String> sumQuery = new ArrayList<>();
for(int i = 0; i < places.length; i++){
String query = "SELECT * from states where id='" + i + "' AND codename='" + places[i].toString() + "';";
ResultSet set = conn.createStatement().executeQuery(query);
boolean foundFirst = set.next();
query = "SELECT * from states where id = '" + i +"';";
ResultSet setc = conn.createStatement().executeQuery(query);
boolean foundSecond = setc.next();
if(!foundFirst && !foundSecond){
sumQuery.add("INSERT INTO states (id, codename) VALUES ('" + i +"', '"+places[i].toString()+"');");
}else if(!foundFirst && foundSecond){
sumQuery.add("UPDATE states SET codename='"+places[i].toString()+"' WHERE id=" + i + ";");
}
}
for(String a : sumQuery){
conn.createStatement().execute(a);
}
conn.close();
}
private static Connection getMySQLConnection() throws SQLException, ClassNotFoundException, SQLException {
Class.forName("com.mysql.cj.jdbc.Driver");
String connectionURL = "jdbc:mysql://" + hostName + ":3306/" + dbName;
Connection conn = DriverManager.getConnection(connectionURL, userName, password);
return conn;
}
public static Map<Integer, ArrayList<Places>> loadVisits() throws SQLException, ClassNotFoundException {
Connection connection = getMySQLConnection();
Statement statement = connection.createStatement();
Map<Integer, ArrayList<Places>> ans = new HashMap<>();
String query = "Select * from dependencies";
ResultSet result = statement.executeQuery(query);
while (result.next()){
int userid = result.getInt("userid");
int stateid = result.getInt("state");
query = "Select * from states where id = " + stateid;
ResultSet resultSet = connection.createStatement().executeQuery(query);
resultSet.next();
Places place = Places.valueOf(resultSet.getString("codename"));
ArrayList<Places> tmp = ans.getOrDefault(userid, new ArrayList<>());
tmp.add(place);
ans.put(userid, tmp);
}
connection.close();
return ans;
}
public static void writeVisit(Integer userId, Places place) throws SQLException, ClassNotFoundException {
Connection connection = getMySQLConnection();
String query = "INSERT IGNORE INTO userslist (id) VALUES (" + userId + ");";
connection.createStatement().execute(query);
ResultSet tmp = connection.createStatement().executeQuery("Select * from states where codename='" + place.toString() + "'");
tmp.next();
int placeId = tmp.getInt("id");
query = "INSERT INTO dependencies (userid, state) VALUE (" + userId + ", '" + placeId + "');";
connection.createStatement().execute(query);
connection.close();
}
}
| [
"andrew-pahomov@yandex.ru"
] | andrew-pahomov@yandex.ru |
01c86c133ff70d5eecd7eab8ddc5330e8f841c4a | d47007faa77a7e721dad0779f92aeb11c78750bb | /billing-app/src/main/java/ru/yvzhelnin/otus/billing/service/impl/AccountServiceImpl.java | 4385c2362955eeb41f2d3670ad16d65a6b5b3ef3 | [] | no_license | yvzhelnin/otus-arch-2 | 8676e4d6feb607abfd4e08d5e6a62576d3464ad5 | 2bebf787c226f0717bd665c63bb739d25faa66b4 | refs/heads/master | 2023-01-06T12:24:42.442289 | 2020-09-13T11:17:20 | 2020-09-13T11:17:20 | 280,685,383 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,822 | java | package ru.yvzhelnin.otus.billing.service.impl;
import org.springframework.stereotype.Service;
import ru.yvzhelnin.otus.billing.enums.WithdrawResultType;
import ru.yvzhelnin.otus.billing.exception.AccountNotFoundException;
import ru.yvzhelnin.otus.billing.exception.ClientNotFoundException;
import ru.yvzhelnin.otus.billing.model.Account;
import ru.yvzhelnin.otus.billing.model.Client;
import ru.yvzhelnin.otus.billing.repository.AccountRepository;
import ru.yvzhelnin.otus.billing.repository.ClientRepository;
import ru.yvzhelnin.otus.billing.service.AccountService;
import java.math.BigDecimal;
import java.util.UUID;
@Service
public class AccountServiceImpl implements AccountService {
private final ClientRepository clientRepository;
private final AccountRepository accountRepository;
public AccountServiceImpl(ClientRepository clientRepository, AccountRepository accountRepository) {
this.clientRepository = clientRepository;
this.accountRepository = accountRepository;
}
@Override
public void createAccount(String clientId) throws ClientNotFoundException {
final Client client = clientRepository.findById(clientId)
.orElseThrow(() -> new ClientNotFoundException("Клиент с идентификатором " + clientId + " не найден"));
Account account = new Account(UUID.randomUUID().toString(), client, BigDecimal.ZERO);
accountRepository.save(account);
}
@Override
public BigDecimal deposit(String clientId, BigDecimal sum) throws ClientNotFoundException, AccountNotFoundException {
final Client client = clientRepository.findById(clientId)
.orElseThrow(() -> new ClientNotFoundException("Клиент с идентификатором " + clientId + " не найден"));
Account account = accountRepository.findByClient(client)
.orElseThrow(() -> new AccountNotFoundException("Для клиента с идентификатором " + clientId + " не найден лицевой счёт"));
final BigDecimal newBalance = account.getBalance().add(sum);
account.setBalance(newBalance);
accountRepository.save(account);
return newBalance;
}
@Override
public WithdrawResultType withdraw(String clientId, BigDecimal sum) throws ClientNotFoundException, AccountNotFoundException {
final Client client = clientRepository.findById(clientId)
.orElseThrow(() -> new ClientNotFoundException("Клиент с идентификатором " + clientId + " не найден"));
Account account = accountRepository.findByClient(client)
.orElseThrow(() -> new AccountNotFoundException("Для клиента с идентификатором " + clientId + " не найден лицевой счёт"));
final BigDecimal newBalance = account.getBalance().subtract(sum);
if (newBalance.compareTo(BigDecimal.ZERO) < 0) {
return WithdrawResultType.NOT_ENOUGH_MONEY;
}
account.setBalance(newBalance);
accountRepository.save(account);
return WithdrawResultType.OK;
}
@Override
public BigDecimal getBalance(String clientId) throws ClientNotFoundException, AccountNotFoundException {
final Client client = clientRepository.findById(clientId)
.orElseThrow(() -> new ClientNotFoundException("Клиент с идентификатором " + clientId + " не найден"));
Account account = accountRepository.findByClient(client)
.orElseThrow(() -> new AccountNotFoundException("Для клиента с идентификатором " + clientId + " не найден лицевой счёт"));
return account.getBalance();
}
}
| [
"yury.zhelnin@x5.ru"
] | yury.zhelnin@x5.ru |
ed3749d10213464469c17da1884aeff61b34f96a | cfc60fc1148916c0a1c9b421543e02f8cdf31549 | /src/testcases/CWE23_Relative_Path_Traversal/CWE23_Relative_Path_Traversal__connect_tcp_54c.java | dab50003d9e747c608ab482c7d7aed7eca0fa029 | [
"LicenseRef-scancode-public-domain"
] | permissive | zhujinhua/GitFun | c77c8c08e89e61006f7bdbc5dd175e5d8bce8bd2 | 987f72fdccf871ece67f2240eea90e8c1971d183 | refs/heads/master | 2021-01-18T05:46:03.351267 | 2012-09-11T16:43:44 | 2012-09-11T16:43:44 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,138 | java | /* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE23_Relative_Path_Traversal__connect_tcp_54c.java
Label Definition File: CWE23_Relative_Path_Traversal.label.xml
Template File: sources-sink-54c.tmpl.java
*/
/*
* @description
* CWE: 23 Relative Path Traversal
* BadSource: connect_tcp Read data using an outbound tcp connection
* GoodSource: A hardcoded string
* Sinks: readFile
* BadSink : no validation
* Flow Variant: 54 Data flow: data passed as an argument from one method through three others to a fifth; all five functions are in different classes in the same package
*
* */
package testcases.CWE23_Relative_Path_Traversal;
import testcasesupport.*;
import java.io.*;
import javax.servlet.http.*;
public class CWE23_Relative_Path_Traversal__connect_tcp_54c
{
public void bad_sink(String data ) throws Throwable
{
(new CWE23_Relative_Path_Traversal__connect_tcp_54d()).bad_sink(data );
}
/* goodG2B() - use goodsource and badsink */
public void goodG2B_sink(String data ) throws Throwable
{
(new CWE23_Relative_Path_Traversal__connect_tcp_54d()).goodG2B_sink(data );
}
}
| [
"amitf@chackmarx.com"
] | amitf@chackmarx.com |
bfbeb63d11c25f85853fb20ef823e46eb852bbd8 | 6a6d8a758479ce0791253a78088fe9678a6ad75b | /javapractice/src/javapractice/cook.java | 07ebe68ce888de83cd5fc3dbc3ace1a6a02a33a6 | [] | no_license | jianjie1314/javalearning | f4be342bb629555d7c1aa554346f0e2ceac8cd1e | 4d29c09edbc93eacc7daf2f91b5092a5ca3a0443 | refs/heads/master | 2021-01-11T12:15:52.104223 | 2016-12-18T09:12:04 | 2016-12-18T09:12:04 | 76,471,735 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 143 | java | package javapractice;
public interface cook {
public static void fee(double a){
}
public static void way(String b){
}
}
| [
"18398787619@qq.com"
] | 18398787619@qq.com |
32cdfc98becee9202ea2342ded2855489e4e8c4a | 48e54c4c45e41aab0a4f0ea679f6d445d21292f3 | /test/com/twu/biblioteca/entity/MovieTest.java | 022bea597f0386212184b3d19e98c8d3d9100350 | [
"Apache-2.0"
] | permissive | isabellyfd/twu-biblioteca-isabelly | f6df0ef0fb6adb74e2025c85d37aaeb86478350f | c2b0bed7ef66254ef024fef221be09713467656c | refs/heads/master | 2021-09-03T14:13:26.649740 | 2018-01-09T17:44:29 | 2018-01-09T17:44:29 | 116,144,301 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,040 | java | package com.twu.biblioteca.entity;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
public class MovieTest {
private Movie movie;
@Before
public void setup() {
this.movie = new Movie("Little Miss Sunshine", "Jonathan Dayton, Valerie Faris", 2006, 5.0);
}
@Test
public void testMovieCreation() {
Assert.assertEquals("Little Miss Sunshine", movie.getName());
Assert.assertEquals("Jonathan Dayton, Valerie Faris", movie.getDirector());
Assert.assertEquals(2006, movie.getYear());
Assert.assertEquals(5.0, movie.getRating(), 0.0);
}
@Test
public void testingToStringReturn(){
Assert.assertEquals("Little Miss Sunshine directed by Jonathan Dayton, Valerie Faris, 2006 - 5.0", movie.toString());
}
@Test
public void testingEqualityOfObjectsr() {
Movie anotherMovie = new Movie("Little Miss Sunshine", "Jonathan Dayton, Valerie Faris", 2006, 5.0);
Assert.assertTrue(anotherMovie.equals(movie));
}
}
| [
"icfd@cin.ufpe.br"
] | icfd@cin.ufpe.br |
3e9db380b6e7eb4b05386b6d780ca645db5dbfdc | 945219a404422e860b09040bbdfc16ddd4a5d236 | /BookTrading/src/logic/sql_instruction/Exists.java | f68b99f067dc7587483163fd87a0ef79e931ab00 | [] | no_license | newsha1998/DB_Project | 1c5fa2020f265fa502550f4d197808d09146b89f | e5ae0ee6ba446ae86df5f69f2a79f6409c7a2681 | refs/heads/master | 2023-06-27T14:24:29.412533 | 2021-07-24T18:30:39 | 2021-07-24T18:30:39 | 386,684,995 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 806 | java | package logic.sql_instruction;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
public class Exists extends Instruction {
public Exists(Connection connection) {
super(connection);
}
public boolean existUser(String username) {
PreparedStatement preparedStatement = null;
try {
preparedStatement = connection.prepareStatement("SELECT * FROM User " +
"WHERE Username = ?");
preparedStatement.setString(1, username);
ResultSet resultSet = preparedStatement.executeQuery();
if (resultSet.next())
return true;
} catch (SQLException e) {
e.printStackTrace();
}
return false;
}
}
| [
"newsha1998s@gmail.com"
] | newsha1998s@gmail.com |
872fb31fc69f847d2a717bcba871c207066e2873 | e01e9a4517463f34ebb822c35cdb312d6ad7ecb4 | /testing/testutil/src/test/java/com/composum/sling/platform/testing/testutil/misc/ValueMapTest.java | 0d6c7cb5ae2dfe052594ff5ffc730089d7c3a5f2 | [
"MIT"
] | permissive | ist-dresden/composum-platform | a3af917f8a6fbcd7e1d5b3eab63358fef3af85b9 | e225934b0fc8c6c30511479eafcad7f73d851c84 | refs/heads/develop | 2023-04-08T12:17:16.010200 | 2023-03-23T14:56:46 | 2023-03-23T14:56:46 | 99,404,867 | 5 | 0 | MIT | 2023-03-22T15:38:03 | 2017-08-05T06:46:24 | Java | UTF-8 | Java | false | false | 3,195 | java | package com.composum.sling.platform.testing.testutil.misc;
import com.composum.sling.core.util.ResourceUtil;
import com.composum.sling.platform.testing.testutil.ErrorCollectorAlwaysPrintingFailures;
import com.composum.sling.platform.testing.testutil.JcrTestUtils;
import org.apache.commons.beanutils.converters.CalendarConverter;
import org.apache.sling.api.resource.ModifiableValueMap;
import org.apache.sling.api.resource.Resource;
import org.apache.sling.api.resource.ValueMap;
import org.apache.sling.testing.mock.sling.ResourceResolverType;
import org.apache.sling.testing.mock.sling.junit.SlingContext;
import org.junit.Rule;
import org.junit.Test;
import java.io.InputStream;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import static org.hamcrest.Matchers.instanceOf;
import static org.hamcrest.Matchers.is;
/**
* Some tests demonstrating how {@link org.apache.sling.api.resource.ValueMap} behaves.
*/
public class ValueMapTest {
@Rule
public final ErrorCollectorAlwaysPrintingFailures ec = new ErrorCollectorAlwaysPrintingFailures();
@Rule
public final SlingContext context = new SlingContext(ResourceResolverType.JCR_OAK);
@Test
public void testCalenderConversions() throws Exception {
String path = context.uniqueRoot().content();
Resource resource = context.build().resource(path,
ResourceUtil.PROP_PRIMARY_TYPE, ResourceUtil.TYPE_UNSTRUCTURED).commit().getCurrentParent();
ModifiableValueMap mvm = resource.adaptTo(ModifiableValueMap.class);
long time = System.currentTimeMillis();
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(time);
mvm.put("cal", calendar);
mvm.put("date", new Date(time)); // this is actually written as binary property. Do not use!
context.resourceResolver().commit();
context.resourceResolver().refresh();
ValueMap vm = context.resourceResolver().getResource(path).getValueMap();
Object calNatural = vm.get("cal");
long calAsLong = vm.get("cal", Long.class);
Date calAsDate = vm.get("cal", Date.class);
Calendar calAsCalendar = vm.get("cal", Calendar.class);
ec.checkThat(calNatural, instanceOf(GregorianCalendar.class));
ec.checkThat(calAsLong, is(time));
ec.checkThat(calAsDate.getTime(), is(time));
ec.checkThat(calAsCalendar.getTimeInMillis(), is(time));
Object natural = vm.get("date");
ec.checkThat(natural, instanceOf(InputStream.class)); // ouch.
long dateAsLong = vm.get("date", Long.class); // completely broken. = 46 , no idea why. 8-}
Date dateAsDate = vm.get("date", Date.class);
Calendar dateAsCalendar = vm.get("date", Calendar.class);
ec.checkThat(dateAsDate.getTime(), is(time) );
ec.checkThat(dateAsCalendar.getTimeInMillis(), is(time) );
JcrTestUtils.printResourceRecursivelyAsJson(context.resourceResolver().getResource(path));
// one way to convert a time in milliseconds
ec.checkThat(new CalendarConverter().convert(Calendar.class, new Date(time)).getTimeInMillis(), is(time));
}
}
| [
"hp.stoerr@ist-software.com"
] | hp.stoerr@ist-software.com |
ec468c12fcbf74b5cbc9d1b0037203b57c1c535d | 050ff7f17222ea65cfe6f04ee2d8c11369223945 | /src/test/java/utilities/TestUtil.java | 04692e424dc9ad2ee8b6088105ceb8ec6b9f2c5a | [] | no_license | shanzee06/PetSpringAutomation | 6dd41a45b9d2be7390aa82359915f8634ca84b10 | bd3b87959a67f1343385c195fffe57dbd9bc813e | refs/heads/master | 2020-04-05T05:56:59.608932 | 2018-11-07T23:01:13 | 2018-11-07T23:01:13 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,145 | java | package utilities;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import org.apache.commons.io.FileUtils;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.Font;
import org.apache.poi.ss.usermodel.IndexedColors;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.usermodel.WorkbookFactory;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.openqa.selenium.OutputType;
import org.openqa.selenium.TakesScreenshot;
import testbase.TestBase;
public class TestUtil extends TestBase {
public static long PAGE_LOAD_TIMEOUT = 20;
public static long IMPLICIT_WAIT = 20;
static Class noparams[] = {};
public static String INPUT_SHEET_PATH = TestUtil.resourceFolder + "/inputData/" + "InputDataSheet.xlsx";
static Workbook book;
static Sheet sheet;
public static void takeScreenshotAtEndOfTest() throws IOException {
File scrFile = ((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE);
FileUtils.copyFile(scrFile,
new File(TestUtil.resourceFolder + "/shotsAndImages/" + +System.currentTimeMillis() + ".png"));
}
/* Method to write in Excel */
public static void createwriteExcel(List<?> instances, String fileName) throws IOException, NoSuchMethodException,
SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Workbook workbook = new XSSFWorkbook();
Field[] fields = instances.get(0).getClass().getDeclaredFields();
// Create a Sheet
Sheet sheet = workbook.createSheet(instances.get(0).getClass().getName());
// Create a Font for styling header cells
Font headerFont = workbook.createFont();
headerFont.setBoldweight(Font.BOLDWEIGHT_BOLD);
headerFont.setFontHeightInPoints((short) 14);
headerFont.setColor(IndexedColors.RED.getIndex());
// Create a CellStyle with the font
CellStyle headerCellStyle = workbook.createCellStyle();
headerCellStyle.setFont(headerFont);
Row headerRow = sheet.createRow(0);
// Create cells
for (int i = 0; i < fields.length; i++) {
Cell cell = headerRow.createCell(i);
cell.setCellValue(fields[i].getName());
cell.setCellStyle(headerCellStyle);
}
// Create Other rows and cells with data
int rowNum = 1;
for (Object instance : instances) {
Row row = sheet.createRow(rowNum++);
for (int i = 0; i < fields.length; i++) {
String varName = fields[i].getName();
String correctMethodNAme = varName.substring(0, 1).toUpperCase() + varName.substring(1);
Method m = instance.getClass().getMethod("get" + correctMethodNAme, noparams);
Object valInvoked = m.invoke(instance);
row.createCell(i).setCellValue(valInvoked.toString());
}
}
// Resize all columns to fit the content size
for (int i = 0; i < fields.length; i++) {
sheet.autoSizeColumn(i);
}
// Write the output to a file
FileOutputStream fileOut = new FileOutputStream(TestUtil.resourceFolder + "/dataSheets/" + fileName + ".xlsx");
workbook.write(fileOut);
fileOut.close();
// Closing the workbook
}
public static Object[][] getTestData(String sheetName) {
FileInputStream file = null;
try {
file = new FileInputStream(INPUT_SHEET_PATH);
} catch (FileNotFoundException e) {
e.printStackTrace();
}
try {
book = WorkbookFactory.create(file);
} catch (InvalidFormatException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
sheet = book.getSheet(sheetName);
Object[][] data = new Object[sheet.getLastRowNum()][sheet.getRow(0).getLastCellNum()];
for (int i = 0; i < sheet.getLastRowNum(); i++) {
for (int k = 0; k < sheet.getRow(0).getLastCellNum(); k++) {
data[i][k] = sheet.getRow(i + 1).getCell(k).toString();
System.out.println(data[i][k]);
}
}
return data;
}
public static List<Map<String, String>> getPetInfotoAdd(String s) {
List<Map<String, String>> petInfo = new LinkedList<>();
Map<String, String> pet = new HashMap<>();
String[] split = s.split("\n");
for (String s1 : split) {
String[] split2 = s1.split("\\|");
pet.put("petName", split2[0]);
pet.put("petBirthDate", split2[1]);
pet.put("typePet", split2[2]);
petInfo.add(pet);
pet = new HashMap<>();
}
return petInfo;
}
public static void deleteFile(String fName) {
{
File file = new File(fName);
if(file.delete())
{
System.out.println("File deleted successfully");
}
else
{
System.out.println("Failed to delete the file");
}
}
}
}
| [
"zee@Zeeshans-MacBook-Air.local"
] | zee@Zeeshans-MacBook-Air.local |
bf822e5cd1b67d2dd18a886dff9b257d996e0f85 | 6458ce7674cb25c992badb924cc895744a79f44c | /src/main/java/org/merit/securityjwt/assignment7/models/SavingsAccount.java | 24d1732c249dbc685a0dbcda9b519e8a1a40cfe8 | [] | no_license | ibabkina/assignment7 | e4b8483b287a8bb1734d01499b10e19c52b54547 | f95eeac62e82cf88b0e61c3c2a39d05954580fe6 | refs/heads/master | 2023-06-30T08:53:34.917742 | 2021-08-02T20:28:46 | 2021-08-02T20:28:46 | 383,271,496 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,681 | java | package org.merit.securityjwt.assignment7.models;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
* This program creates a savings account for a client.
*
* @author Irina Babkina
*
*/
@Entity
@Table(name = "savings_accounts")
public class SavingsAccount extends BankAccount {
private static final double INTEREST_RATE = 0.01;
// private double interestRate = 0.01;
/**
* Default constructor
*/
public SavingsAccount() { super(0, INTEREST_RATE); }
/**
* @param openingBalance
*/
public SavingsAccount(double openingBalance) {
super(openingBalance, INTEREST_RATE);
}
/**
* @param openingBalance
* @param interestRate
*/
public SavingsAccount(double openingBalance, double interestRate){
super(openingBalance, interestRate);
}
/**
* @param accNumber
* @param openingBalance
* @param interestRate
*/
public SavingsAccount(long accNumber, double openingBalance, double interestRate, java.util.Date accountOpenedOn){
super(accNumber, openingBalance, interestRate, accountOpenedOn);
}
// Should throw a java.lang.NumberFormatException if String cannot be correctly parsed
public static SavingsAccount readFromString(String accountData)
throws NumberFormatException, ParseException {
String[] args = accountData.split(",");
SavingsAccount acc = new SavingsAccount(Long.parseLong(args[0]), Double.parseDouble(args[1]),
Double.parseDouble(args[2]), new SimpleDateFormat("MM/dd/yyyy").parse(args[3]));
return acc;
}
// /**
// * @return the interestRate
// */
// public double getInterestRate() { return INTEREST_RATE; }
// /**
// * Calculates the future value of the account balance based on the interest
// * and number of years
// * @param years: number of periods in years
// * @return the future value
// */
// double futureValue(int years){ return this.balance * pow(1 + interestRate, years); }
@Override
public String toString() {
return "\nSavings Account Number: " + this.getAccountNumber()
+ "\nSavings Account Balance: $" + String.format("%.2f", this.getBalance())
+ "\nSavings Account Interest Rate: " + String.format("%.4f", this.getInterestRate())
+ "\nSavings Account Balance in 3 years: " + String.format("%.2f", this.futureValue(3))
+ "\nSavings Account Opened Date " + this.getOpenedOn();
}
@Override
public String writeToString() {
return Long.toString(this.getAccountNumber()) + ","
+ String.format("%.0f", this.getBalance()) + ","
+ String.format("%.2f", this.getInterestRate()) + ","
+ new SimpleDateFormat("MM/dd/yyyy").format(this.openedOn);
}
} | [
"i.babkina700@gmail.com"
] | i.babkina700@gmail.com |
5dfc08ba40afe07d4aafe741472f375833610822 | e3e2f98a5aa5f3837f3007cf62ee5ac5e6f5b8a4 | /src/io/bvzx/gene/type/DirGenrator.java | e190342d3e5f55bba42825de8cdb60f3c57f4e0f | [] | no_license | ruyun325/codeGen | 90c3bc1635aaffda256eff258730edd815c190ec | 8673fd6776a21d87235b4e464bcbf92c05b53178 | refs/heads/master | 2022-04-30T13:52:00.112994 | 2016-08-01T02:22:44 | 2016-08-01T02:22:44 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,164 | java | package io.bvzx.gene.type;
import io.bvzx.gene.Generator;
import java.io.File;
import java.util.List;
import java.util.Objects;
/**
* Created by lss on 16-7-29.
*/
public class DirGenrator implements Generator {
private String dirName;
private String dirPath;
private List<Generator> generatorList;
public static DirGenrator newIntance(){
return new DirGenrator();
}
private DirGenrator() {
}
public DirGenrator(String dirName, String dir, List<Generator> generatorList) {
this.dirName = dirName;
this.dirPath = dir;
this.generatorList = generatorList;
}
public DirGenrator(String dirName, String dir) {
this(dirName, dir, null);
}
public boolean checkParameters(){
Objects.requireNonNull(dirName);
Objects.requireNonNull(dirPath);
return true;
}
@Override
public void generate() {
checkParameters();
File f = new File(dirPath + File.separator + dirName);
if (!f.exists()) {
f.mkdirs();
}
generatorList.forEach((val)->{
if (val.getPath()==null&&val.getPath().equals("")){
val.setPath(dirPath+dirName);
}
val.generate();
});
}
@Override
public String getName() {
return dirName;
}
@Override
public String getPath() {
return dirPath;
}
@Override
public void setPath(String path) {
this.dirPath=path;
}
public String getDirName() {
return dirName;
}
public void setDirName(String dirName) {
this.dirName = dirName;
}
public String getDirPath() {
return dirPath;
}
public void setDirPath(String dirPath) {
this.dirPath = dirPath;
}
public List<Generator> getGeneratorList() {
return generatorList;
}
public void setGeneratorList(List<Generator> generatorList) {
this.generatorList = generatorList;
}
public static void main(String[] args) {
Generator g = new DirGenrator("mycode", "/home/lss/Notes");
g.generate();
}
}
| [
"wugaoda@caitu99.com"
] | wugaoda@caitu99.com |
e27465e23046b0cc70ae564ad3bffb0a3f46a691 | 5f43f4274bc035dec1e39ffd196ad0012ea49716 | /app/src/main/java/software/ecenter/study/activity/StudyreportActivity.java | dee62d8e832f061a50651cbc3556b7de72d6eef8 | [] | no_license | heyinlonga/DaProject | 5f9852eed60efd7f27c1e7f7aeb67d1da2f4fdda | 4886b617c63e08fd67dfb7d5353ab7f4300223ad | refs/heads/master | 2023-02-17T00:40:50.590001 | 2021-01-12T11:12:27 | 2021-01-12T11:12:27 | 328,960,978 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,857 | java | package software.ecenter.study.activity;
import android.content.Intent;
import android.os.Bundle;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import software.ecenter.study.Adapter.StudyReportAdapter;
import software.ecenter.study.Interface.OnItemListener;
import software.ecenter.study.R;
import software.ecenter.study.bean.ReportList;
import software.ecenter.study.net.RetroFactory;
import software.ecenter.study.utils.ParseUtil;
import software.ecenter.study.utils.ToastUtils;
/**
* Message 学情报告
* Create by Administrator
* Create by 2019/11/5
*/
public class StudyreportActivity extends BaseActivity {
@BindView(R.id.iv_back)
ImageView iv_back;
@BindView(R.id.tv_bao)
TextView tv_bao;
@BindView(R.id.rv_list)
RecyclerView rv_list;
@BindView(R.id.ll_error)
LinearLayout ll_error;
@BindView(R.id.ll_no_data)
LinearLayout ll_no_data;
private StudyReportAdapter adapter;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_studyreport);
ButterKnife.bind(this);
rv_list.setLayoutManager(new LinearLayoutManager(this));
adapter = new StudyReportAdapter(mContext, new OnItemListener() {
@Override
public void onItemClick(int poc) {
ReportList.DataBean chose = adapter.getChose(poc);
if (chose != null) {
startActivity(new Intent(mContext, ReportDetailActivity.class).putExtra("isBuy", chose.isBuy()).putExtra("reportYear", chose.getReportYear()).putExtra("reportMonth", chose.getReportMonth()));
}
}
});
rv_list.setAdapter(adapter);
}
@Override
protected void onResume() {
super.onResume();
getData();
}
//获取数据
private void getData() {
// if (!showNetWaitLoding()) {
// return;
// }
new RetroFactory(mContext, RetroFactory.getRetroFactory(mContext).getReportList())
.handleResponse(new RetroFactory.ResponseListener<String>() {
@Override
public void onSuccess(String response) {
dismissNetWaitLoging();
ll_error.setVisibility(View.GONE);
ReportList bean = ParseUtil.parseBean(response, ReportList.class);
if (bean != null) {
List<ReportList.DataBean> data = bean.getData();
adapter.setData(data);
ll_no_data.setVisibility(adapter.getItemCount() > 0 ? View.GONE : View.VISIBLE);
}
}
@Override
public void onFail(int type, String msg) {
dismissNetWaitLoging();
ll_error.setVisibility(View.VISIBLE);
ll_no_data.setVisibility(View.GONE);
ToastUtils.showToastLONG(mContext, msg);
}
});
}
@OnClick({R.id.iv_back, R.id.tv_bao})
public void onViewClicked(View view) {
switch (view.getId()) {
case R.id.iv_back:
finish();
break;
case R.id.tv_bao://样例
startActivity(new Intent(mContext, ReportDetailActivity.class).putExtra("type", 1));
break;
}
}
}
| [
"2022501519@qq.com"
] | 2022501519@qq.com |
2924d4c84ba505967ba91afa0c7bd0aef456d4e8 | c822581c208b032459824516bc995ea70d56ed54 | /src/main/java/behavioral/chainOfResponisibilityPattern/Dollar20Dispenser.java | 9462498ba0ac0bede31c28d4529c9d7482bdf153 | [] | no_license | peinbill/designPattern_learning | fd8709041b54035dea7f6ac3a42bad08d8bef677 | 43288808b1d1e5b1855f1d1d3af8e3173d32844d | refs/heads/master | 2023-02-01T15:04:45.632478 | 2020-12-19T14:41:46 | 2020-12-19T14:41:46 | 272,465,012 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 669 | java | package behavioral.chainOfResponisibilityPattern;
public class Dollar20Dispenser implements DispenseChain{
private DispenseChain chain;
@Override
public void setNextChain(DispenseChain nextChain){
this.chain = nextChain;
}
@Override
public void dispense(Currency cur){
if(cur.getAmount()>20){
int num = cur.getAmount()/20;
int remainder = cur.getAmount()%20;
System.out.println("Dispensing "+num+" 20$ note");
if(remainder != 0){
this.chain.dispense(new Currency(remainder));
}
}else {
this.chain.dispense(cur);
}
}
}
| [
"jinyuhuangtop@gmail.com"
] | jinyuhuangtop@gmail.com |
cbc29152e5b33a199c140f42eed1cd82758cf44d | b50782a86abb5d24282777fb0885a789f6412d31 | /model/springcloud/zuul-server/src/main/java/com/protocol/impl/habit/MoodDetailServiceProtocol.java | f6a1841aaa6f8aea7e50cf935adb1965e64223db | [] | no_license | wikerx/SpringCloud | e53006172f956f96b4da123170a9cfa4b45032ee | 1da85d1ced395b1e5552bd6b65964aebf078d3fe | refs/heads/master | 2022-12-15T10:48:38.452805 | 2019-06-01T05:06:26 | 2019-06-01T05:06:26 | 171,824,177 | 0 | 0 | null | 2022-12-09T02:42:07 | 2019-02-21T07:42:06 | JavaScript | UTF-8 | Java | false | false | 1,649 | java | package com.protocol.impl.habit;
import com.constant.EnumError;
import com.protocol.ProtocolUtilService;
import com.protocol.impl.user.SignInServiceProtocol;
import com.utils.VerifyUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.Map;
/**
* 小习惯,心情详情
*/
@Service("MoodDetailServiceProtocol")
public class MoodDetailServiceProtocol implements ProtocolUtilService {
protected final Logger logger = LoggerFactory.getLogger(SignInServiceProtocol.class);
private final static String interfaceDesc = "小习惯,心情详情";
/**
* @param code
* @param inputMap
* @return
*/
@Override
public Map service(String code, Map inputMap) {
HashMap<String, Object> outMap = new HashMap<>();
try {
String id = String.valueOf(inputMap.get("id"));
if (VerifyUtils.isEmpty(code, outMap, id,"id",logger,interfaceDesc))
return outMap;
//校验version,reqtime,sign是否为空,校验sign是否正确
if (VerifyUtils.checkVersionAndReqTimeAndSign(code, inputMap, outMap, id, logger, interfaceDesc))
return outMap;
//签名正确,放过请求
} catch (Exception e) {
logger.error(e.getMessage(), e);
outMap.put("code", EnumError.ERROR_CODE.getCode());
outMap.put("msg", EnumError.ERROR_CODE.getDesc());
logger.info("{} 接口业务逻辑处理结果:{}", interfaceDesc, outMap.get("msg"));
}
return outMap;
}
}
| [
"18772101110@163.com"
] | 18772101110@163.com |
310b1af23147d8f3647026a5eb80ba3bed3eaa2e | d7378ddf8391b7bdf402a97ac0d482cc4583cad9 | /CardapioAndroid/src/com/login/android/cardapio/util/JSONPedidoUtil.java | 6711f956d1b46abb53c174566107d0bfe0f47b32 | [] | no_license | laboratoriologin/cardapio | 68f70b6bec6d8b6d695fe0e9244edc6413e03ff4 | 4519a49a5ee4b9f80052102e56a87e6072e4735d | refs/heads/master | 2021-01-16T20:34:13.755465 | 2015-04-10T12:34:42 | 2015-04-10T12:34:42 | 33,688,478 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,876 | java | package com.login.android.cardapio.util;
import java.util.ArrayList;
import java.util.List;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import android.os.AsyncTask;
import com.login.android.cardapio.business.Observable;
import com.login.android.cardapio.model.Pedido;
import com.login.android.cardapio.model.PedidoItem;
import com.login.android.cardapio.model.ServerResponse;
public class JSONPedidoUtil extends AsyncTask<Pedido, Void, ServerResponse> {
private Observable observable;
public JSONPedidoUtil(Observable observable) {
this.observable = observable;
}
@Override
protected ServerResponse doInBackground(Pedido... params) {
Pedido pedido = params == null || params.length == 0 ? null : params[0];
return new HttpUtil().getJSONFromURLPost(getUrl(), parseToNameValuePair(pedido));
}
private List<NameValuePair> parseToNameValuePair(Pedido pedido) {
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
nameValuePairs.add(new BasicNameValuePair("observacao", pedido.getObservacao()));
nameValuePairs.add(new BasicNameValuePair("conta.id", pedido.getIdConta().toString()));
PedidoItem pedidoItem;
for (int i = 0; i < pedido.getListPedidoItem().size(); i++) {
pedidoItem = pedido.getListPedidoItem().get(i);
nameValuePairs.add(new BasicNameValuePair("listPedidoSubItem[" + i + "].quantidade", pedidoItem.getQuantidade().toString()));
nameValuePairs.add(new BasicNameValuePair("listPedidoSubItem[" + i + "].subitem", pedidoItem.getIdSubItem().toString()));
}
return nameValuePairs;
}
private String getUrl() {
return Constantes.URL_WS + "/pedidos";
}
@Override
protected void onPostExecute(ServerResponse result) {
try {
observable.observe(result);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
| [
"marcelomagalhaes31@gmail.com"
] | marcelomagalhaes31@gmail.com |
12b05bd172eb83843501df13c41cdb6123779628 | dee086c126b676fc6b0f9c84d7d36d65a8b999b2 | /Coding Projects/Java/Misc. Projects/Hearts/src/DeckTester.java | dbc2912c9c918d868dcf757b4f887693a5ef72df | [] | no_license | pokedart9001/Projects-and-Snippets | 39396ac7de8f1c6056f5d85fe5015279844fbcc1 | a85421c7dceb0cc2b07ca662e19a6073857884c1 | refs/heads/main | 2023-01-31T03:29:10.784606 | 2020-12-11T21:06:22 | 2020-12-11T21:06:22 | 320,661,605 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 740 | java | /**
* This is a class that tests the Deck class.
*/
public class DeckTester {
/**
* The main method in this class checks the Deck operations for consistency.
* @param args is not used.
*/
public static void main(String[] args) {
String[] suits = {"Clubs", "Spades", "Hearts", "Diamonds"};
int[] valuesLow = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13};
int[] valuesHigh = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14};
String[] ranks = {"Test1", "Test2", "Test3", "Test4", "Test5"};
Deck standardDeck = new Deck(suits, valuesHigh);
Deck testDeck = new Deck(suits, valuesLow, ranks);
standardDeck.shuffle(1);
System.out.println(standardDeck);
}
}
| [
"example@example.com"
] | example@example.com |
c66c6a908be626e4d884f21f0fe45b6ae7fd1b4b | 6635387159b685ab34f9c927b878734bd6040e7e | /src/javax/validation/bootstrap/GenericBootstrap.java | 07699f069f4dde5c835ca1f8d9de2d398f8036cd | [] | no_license | RepoForks/com.snapchat.android | 987dd3d4a72c2f43bc52f5dea9d55bfb190966e2 | 6e28a32ad495cf14f87e512dd0be700f5186b4c6 | refs/heads/master | 2021-05-05T10:36:16.396377 | 2015-07-16T16:46:26 | 2015-07-16T16:46:26 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 485 | java | package javax.validation.bootstrap;
import javax.validation.Configuration;
import javax.validation.ValidationProviderResolver;
public abstract interface GenericBootstrap
{
public abstract Configuration<?> configure();
public abstract GenericBootstrap providerResolver(ValidationProviderResolver paramValidationProviderResolver);
}
/* Location:
* Qualified Name: javax.validation.bootstrap.GenericBootstrap
* Java Class Version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | [
"reverseengineeringer@hackeradmin.com"
] | reverseengineeringer@hackeradmin.com |
67868517c0c4fa5b61c082bf5e2617a63ae8115b | 5e1f2aadc94e651174f2cbda413054a9f6a62008 | /app/src/main/java/com/moneytap/mediawiki/util/RecyclerViewEvents.java | b2adfff3db8b44f58ffc9bde80fcc6c71b559db9 | [] | no_license | snishant593/Moneytap | d64738e5d6950eb39faea5255496c22b09f6bfe3 | ac00d4f12b170746adf18828f62d8b847e7cee3c | refs/heads/master | 2020-04-02T05:07:29.597537 | 2018-10-21T21:21:12 | 2018-10-21T21:21:12 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 423 | java | package com.moneytap.mediawiki.util;
import android.view.View;
public class RecyclerViewEvents {
/**
* Callback interface for delivering item clicks.
*/
public interface Listener<T> {
/**
* Called when a item is clicked.
*/
public void onItemClick(T item, View v, int position);
}
public static final int ITEM = 0;
public static final int FOOTER = 1;
}
| [
"snishant593@gmail.com"
] | snishant593@gmail.com |
07393ddaf504caaa06261ede2bfa9b04cb6146f0 | 1fb67720d9d6b01bde14798ff52c06a45f6195e6 | /ForeverBikeClient/src/com/forever/weibo/WeiboAuthorizeActivity.java | 4710a334bb83fec8fc2346cac916262dd89a4101 | [] | no_license | akarism/prpprojectdocs | 8ea8a27ef3e5c6e1accf5546c6733d7fee2af8bc | 04baf9fce263d3db61453b76e4d35bb01cba2579 | refs/heads/master | 2021-03-12T20:25:36.631659 | 2012-07-08T06:58:14 | 2012-07-08T06:58:14 | 34,195,914 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,161 | java | package com.forever.weibo;
import java.util.List;
import com.forever.bike.R;
import com.utl.ConfigHelper;
import com.utl.DataHelper;
import com.utl.OAuth;
import com.utl.UserInfo;
import android.app.Activity;
import android.app.Dialog;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.Toast;
public class WeiboAuthorizeActivity extends Activity {
private Dialog dialog;
private OAuth auth;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.weiboauthorizee);
View diaView = View.inflate(this, R.layout.weibodialog, null);
dialog = new Dialog(WeiboAuthorizeActivity.this, R.style.dialog);
dialog.setContentView(diaView);
dialog.show();
ImageButton startBtn = (ImageButton) diaView
.findViewById(R.id.btn_start);
startBtn.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
Toast.makeText(WeiboAuthorizeActivity.this, "正在与新浪微博连接,请稍后", Toast.LENGTH_LONG)
.show();
auth = new OAuth();
String CallBackUrl = "myapp://WeiboAuthorizeActivity";
auth.RequestAccessToken(WeiboAuthorizeActivity.this,
CallBackUrl);
}
});
}
@Override
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
UserInfo user = auth.GetAccessToken(intent);
if (user != null) {
DataHelper helper = new DataHelper(this);
String uid = user.getUserId();
if (helper.HaveUserInfo(uid)) {
helper.UpdateUserInfo(user);
Log.e("UserInfo", "update");
} else {
helper.SaveUserInfo(user);
Log.e("UserInfo", "add");
}
Log.e("will go to login aci", "gogogo");
try {
Intent intent_go = new Intent();
intent_go.setClass(WeiboAuthorizeActivity.this,
WeiboMainActivity.class);
startActivity(intent_go);
} catch (Exception e) {
}
}
}
} | [
"bjggzxb@gmail.com@562ce3d8-9706-26e4-85e8-ea821f829efe"
] | bjggzxb@gmail.com@562ce3d8-9706-26e4-85e8-ea821f829efe |
2beb04b9754057aee37d99d43047d5f626f63d3c | 3143113361b4c6578556b1d91307dbc6e6a3bd88 | /src/main/java/com/ct/modules/sys/entity/Csr.java | 8f7ed431da4b5f1d4727d6665c6d1d6d81435fea | [] | no_license | maxiaopao/mf_web_new | d38a218d41fc8bffa991493ddf51640f3a37894c | a46aab78ecc059a2550ff5630a03204cea652fbf | refs/heads/master | 2021-08-28T05:32:39.770505 | 2017-12-11T09:32:40 | 2017-12-11T09:32:40 | 113,838,985 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,054 | java | package com.ct.modules.sys.entity;
import com.ct.common.entity.BaseEntity;
public class Csr extends BaseEntity {
private String csrid;
private String agentid;
private String csrname;
private String passwd;
private String passwdnew;
private Short assignflag;
private String departid;
private String groupid;
private String groupname;
private Short status;
private String bak1;
private String bak2;
private String bak3;
private String bak4;
private String bak5;
private Short postion;
private String departname;
private String user_id;
private String account_info;
private String sex;
private String phone;
private String provense;
private String city;
private String hospitalname;
private String department;
private String job;
private String cs;//拼接后的csrid 和name
public String getGroupid() {
return groupid;
}
public void setGroupid(String groupid) {
this.groupid = groupid;
}
public String getGroupname() {
return groupname;
}
public void setGroupname(String groupname) {
this.groupname = groupname;
}
public String getCs() {
return cs;
}
public void setCs(String cs) {
this.cs = cs;
}
public String getPasswdnew() {
return passwdnew;
}
public void setPasswdnew(String passwdnew) {
this.passwdnew = passwdnew;
}
public String getSex() {
return sex;
}
public void setSex(String sex) {
this.sex = sex;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getProvense() {
return provense;
}
public void setProvense(String provense) {
this.provense = provense;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getHospitalname() {
return hospitalname;
}
public void setHospitalname(String hospitalname) {
this.hospitalname = hospitalname;
}
public String getDepartment() {
return department;
}
public void setDepartment(String department) {
this.department = department;
}
public String getJob() {
return job;
}
public void setJob(String job) {
this.job = job;
}
public String getUser_id() {
return user_id;
}
public void setUser_id(String userId) {
user_id = userId;
}
public String getAccount_info() {
return account_info;
}
public void setAccount_info(String accountInfo) {
account_info = accountInfo;
}
public Short getPostion() {
return postion;
}
public void setPostion(Short postion) {
this.postion = postion;
}
public String getDepartname() {
return departname;
}
public void setDepartname(String departname) {
this.departname = departname;
}
public String getCsrid() {
return csrid;
}
public void setCsrid(String csrid) {
this.csrid = csrid == null ? null : csrid.trim();
}
public String getAgentid() {
return agentid;
}
public void setAgentid(String agentid) {
this.agentid = agentid == null ? null : agentid.trim();
}
public String getCsrname() {
return csrname;
}
public void setCsrname(String csrname) {
this.csrname = csrname == null ? null : csrname.trim();
}
public String getPasswd() {
return passwd;
}
public void setPasswd(String passwd) {
this.passwd = passwd == null ? null : passwd.trim();
}
public Short getAssignflag() {
return assignflag;
}
public void setAssignflag(Short assignflag) {
this.assignflag = assignflag;
}
public String getDepartid() {
return departid;
}
public void setDepartid(String departid) {
this.departid = departid == null ? null : departid.trim();
}
public Short getStatus() {
return status;
}
public void setStatus(Short status) {
this.status = status;
}
public String getBak1() {
return bak1;
}
public void setBak1(String bak1) {
this.bak1 = bak1 == null ? null : bak1.trim();
}
public String getBak2() {
return bak2;
}
public void setBak2(String bak2) {
this.bak2 = bak2 == null ? null : bak2.trim();
}
public String getBak3() {
return bak3;
}
public void setBak3(String bak3) {
this.bak3 = bak3 == null ? null : bak3.trim();
}
public String getBak4() {
return bak4;
}
public void setBak4(String bak4) {
this.bak4 = bak4 == null ? null : bak4.trim();
}
public String getBak5() {
return bak5;
}
public void setBak5(String bak5) {
this.bak5 = bak5 == null ? null : bak5.trim();
}
} | [
"373009546@qq.com"
] | 373009546@qq.com |
304a7104c3e5a995a06e58f8249ab2bd8313a25e | 84558f121a6619078c1a88ad2d54a8261f4d47db | /Virgin/src/test/java/com/itson/operatorplatform/FeeTestSuite.java | 80dc56808bebca7c321e1587f98419b53fad33a7 | [] | no_license | savvy1011/abc | 928be9b9c62263d9c39d2ad19bd7dfa39ddac394 | 9c52070a96e02c4bc7d59afc25fa7f8f2c5c4bf5 | refs/heads/master | 2021-01-10T04:08:08.680501 | 2015-05-22T10:10:36 | 2015-05-22T10:10:36 | 36,062,756 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,084 | java | /*
/**BroadleafTestSuite Testing creating and deleting plans
*
* @author gurtejphangureh
*/
package com.itson.operatorplatform;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
public class FeeTestSuite extends AbstractMethod {
protected String section = "fee";
@BeforeMethod
protected void logInSetUp() {
adminUser = adminUser + "+" + section;
logIn();
}
@Test(dataProviderClass = com.itson.operatorplatform.FileDataProvider.class, dataProvider = "getDataFromFile")
@DataProviderArguments("filePath=../plans/fee.csv")
public void createFee(String givendata) throws Exception {
//Get Data
setData(givendata, "fee");
productName = browser.randomName() + "FEE";
browser.reportLinkLog(productName);
browser.logAction("*****Starting Fee Create Plan****");
//set random name for product
browser.logAction("Creating Plan with " + productName);
feePages.createFee(productName);
}
@AfterMethod
protected void planCleanUp() {
blCleanUp();
}
}
| [
"thanhha.nguyen@evizi.com"
] | thanhha.nguyen@evizi.com |
52e712ec9827f22882ea22d36a98ccd31dd6d38c | fca6b109f78353cb95c4c99b413037c33fe1af5d | /Draw3D115/src/org/edisonwj/draw3dtest/TestCircle.java | e2742419e0212b2fca8d43a34b117722ae410c38 | [] | no_license | edisonwj/Draw3D | 5599068731feefb70752c8938b78da27197b1bbc | f579d8d5a48c7428757cb854dc64a9ca95675676 | refs/heads/main | 2021-01-10T12:30:34.173255 | 2020-12-30T20:36:02 | 2020-12-30T20:36:02 | 43,826,640 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 865 | java | package org.edisonwj.draw3dtest;
import org.edisonwj.draw3d.Draw3D;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.paint.Color;
import javafx.stage.Stage;
/**
*
* @author William Edison
* @version 1.05 February 2016
*
*/
public class TestCircle extends Application {
private Draw3D dt;
@Override
public void start(Stage primaryStage) {
dt = new Draw3D();
Scene scene = dt.buildScene();
buildData();
dt.setStart();
primaryStage.setScene(scene);
primaryStage.setTitle("TestCircle");
primaryStage.show();
}
private void buildData() {
dt.setAmbientLight(true);
dt.setPointLight(true);
dt.setDrawColor(Color.CRIMSON);
dt.drawCircle(4,4,0,3,90,0,0);
dt.drawCircle(-4,4,0,3,45,0,0);
}
public static void main(String[] args) {
launch(args);
}
} | [
"edisonwj@verizon.net"
] | edisonwj@verizon.net |
0124a70da06a810f72d5687242ab687383d4b455 | 9f34ae977a23be35576302f0e12d1cb1fc13fdd2 | /handywedge-master/handywedge-core/src/main/java/com/handywedge/util/FWInternalUtil.java | aa5b8ee11f2a5e99d07a9bfdabcf8bc68597dfdc | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | cstudioteam/handywedge | 388bc7627bccc0661dc9ee4fc76149c2c10fb03a | aa49c32f7ec42e1784c750cd99cbf087fae584b4 | refs/heads/main | 2023-06-24T13:08:03.094119 | 2022-10-28T07:56:52 | 2022-10-28T07:56:52 | 50,116,787 | 2 | 1 | MIT | 2023-06-14T22:43:09 | 2016-01-21T15:32:15 | JavaScript | UTF-8 | Java | false | false | 4,975 | java | /*
* Copyright (c) 2019 Handywedge Co.,Ltd.
*
* This software is released under the MIT License.
*
* http://opensource.org/licenses/mit-license.php
*/
package com.handywedge.util;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.List;
import java.util.Random;
import java.util.ResourceBundle;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.inject.Inject;
import com.handywedge.common.FWConstantCode;
import com.handywedge.common.FWRuntimeException;
import com.handywedge.common.FWStringUtil;
import com.handywedge.context.FWApplicationContext;
import com.handywedge.db.FWInternalConnectionManager;
import com.handywedge.log.FWLogger;
import com.handywedge.role.FWRoleAcl;
@ApplicationScoped
public class FWInternalUtil {
@Inject
private FWApplicationContext appCtx;
@Inject
private FWLogger logger;
private static final String NO_USE_ROLE_ACL = "fw.no.use.role.acl";
private static final String NO_USE_USER_MANAGEMENT = "fw.no.use.user.management";
public void cacheRoleAcl() {
String use = getResource(NO_USE_ROLE_ACL);
if (FWStringUtil.isEmpty(use) || Boolean.parseBoolean(use)) {
long start = logger.perfStart("cacheRoleAcl");
List<FWRoleAcl> acl = appCtx.getRoleAcl();
// Requestスコープインスタンスが注入されていない段階なので例外的に生のConnectionを操作する。
try (Connection con = FWInternalConnectionManager.getConnection();
Statement st = con.createStatement();
ResultSet rs = st.executeQuery("SELECT role, url_pattern FROM fw_role_acl");) {
while (rs.next()) {
acl.add(new FWRoleAcl(rs.getString("role"), rs.getString("url_pattern")));
}
logger.info("role acl設定数={}", acl.size());
} catch (SQLException e) {
logger.debug(e.toString());
logger.warn("ロールACLテーブルのアクセスでエラーが発生しました。ロールACL機能は無効化されます。");
}
logger.perfEnd("cacheRoleAcl", start);
} else {
logger.info("ロールACL機能は無効です。");
}
}
/*
* v.0.4.0からの新機能
*/
public void checkUserManagement() {
String use = getResource(NO_USE_USER_MANAGEMENT);
if (FWStringUtil.isEmpty(use) || Boolean.parseBoolean(use)) {
long start = logger.perfStart("checkUserManagement");
try (Connection con = FWInternalConnectionManager.getConnection();
Statement st = con.createStatement();
ResultSet rs = st.executeQuery("SELECT count(*) FROM fw_user_management");) {
rs.next();
appCtx.setUserManagementEnable(true);
} catch (SQLException e) {
logger.debug(e.toString());
logger.warn("ユーザー管理テーブルが存在しません。");
appCtx.setUserManagementEnable(false);
}
logger.perfEnd("checkUserManagement", start);
} else {
logger.info("ユーザー管理テーブルは無効です。");
appCtx.setUserManagementEnable(false);
}
}
public static String generateToken() {
try {
SecureRandom sr = SecureRandom.getInstanceStrong();
byte[] b = new byte[16];
sr.nextBytes(b);
StringBuilder buf = new StringBuilder();
for (int i = 0; i < b.length; i++) {
buf.append(String.format("%02x", b[i]));
}
return buf.toString();
} catch (NoSuchAlgorithmException e) {
throw new FWRuntimeException(FWConstantCode.FATAL, e);
}
}
public static String generatePassword(int length, boolean digit, boolean upper, boolean lower,
boolean symbol) {
// 生成処理
StringBuilder result = new StringBuilder();
// パスワードに使用する文字を格納
StringBuilder source = new StringBuilder();
// 数字
if (digit) {
for (int i = 0x30; i < 0x3A; i++) {
source.append((char) i);
}
}
// 記号
if (symbol) {
for (int i = 0x21; i < 0x30; i++) {
source.append((char) i);
}
}
// アルファベット小文字
if (lower) {
for (int i = 0x41; i < 0x5b; i++) {
source.append((char) i);
}
}
// アルファベット大文字
if (upper) {
for (int i = 0x61; i < 0x7b; i++) {
source.append((char) i);
}
}
int sourceLength = source.length();
Random random = new Random();
while (result.length() < length) {
result.append(source.charAt(Math.abs(random.nextInt()) % sourceLength));
}
return result.toString();
}
private String getResource(String key) {
ResourceBundle rb = ResourceBundle.getBundle(appCtx.getApplicationId());
if (!rb.containsKey(key)) {
return null;
} else {
String value = rb.getString(key);
return value;
}
}
}
| [
"yamamoto@cstudio.jp"
] | yamamoto@cstudio.jp |
835a8d4bb5096d49c665346311d3e556846ca29f | 5a95278087efa12950600c3a7ee0b8253a18b63a | /src/main/java/theSleuth/util/RelicRapidFireEffect.java | e31e4fc37ce6ad78a864030898d3fbeaaa05fa0b | [] | no_license | BadVexon/ProblemSleuthMod | d7ca84d9ddb6944d247069fa524adb6af54ab28f | 8aaa7bc91f534d8823641b13b1e36e0ed4762eb8 | refs/heads/main | 2023-02-20T02:42:57.188474 | 2021-01-24T23:18:29 | 2021-01-24T23:18:29 | 332,578,207 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,691 | java | package theSleuth.util;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.math.MathUtils;
import com.megacrit.cardcrawl.core.AbstractCreature;
import com.megacrit.cardcrawl.core.Settings;
import com.megacrit.cardcrawl.dungeons.AbstractDungeon;
import com.megacrit.cardcrawl.monsters.AbstractMonster;
import com.megacrit.cardcrawl.relics.AbstractRelic;
import com.megacrit.cardcrawl.vfx.AbstractGameEffect;
public class RelicRapidFireEffect extends AbstractGameEffect {
public static int flighttime;
public static final float gravity = 0.5F * Settings.scale;
public static final float frictionX = 0.1F * Settings.scale;
public static final float frictionY = 0.2F * Settings.scale;
public static final int dispersalspeed = 1;
public boolean finishedAction;
private RelicInfo letsago;
public RelicRapidFireEffect(AbstractRelic relic, AbstractMonster target) {
letsago = new RelicInfo(relic, target);
flighttime = 15;
}
public RelicRapidFireEffect(AbstractRelic relic, AbstractMonster target, int flight) {
letsago = new RelicInfo(relic, target);
flighttime = flight;
}
@Override
public void render(SpriteBatch sb) {
letsago.render(sb);
sb.setColor(Color.WHITE);
}
public void update() {
boolean finishedEffect = true;
int wahoo = letsago.update();
if (wahoo != 3) {
finishedEffect = false;
}
if (wahoo == 1) {
finishedAction = true;
}
if (finishedEffect) {
this.isDone = true;
}
}
public void dispose() {
}
class RelicInfo {
private float x;
private float y;
private float targetX;
private float targetY;
private float rotation;
private float radialvelocity;
private float bounceplane;
private float opacity;
private int hit;
private int frames;
private AbstractCreature ac;
private AbstractRelic ar;
public RelicInfo(AbstractRelic ar, AbstractCreature ac) {
targetX = ac.hb.cX + MathUtils.random(ac.hb.width) - ac.hb.width * 1 / 4;
targetY = ac.hb.cY + MathUtils.random(ac.hb.height) - ac.hb.height * 1 / 4;
x = AbstractDungeon.player.hb.cX;
y = AbstractDungeon.player.hb.cY;
this.ar = ar;
this.ac = ac;
hit = 0;
frames = 0;
bounceplane = ac.hb.y + MathUtils.random(ac.hb.height / 4, ac.hb.height / 4);
opacity = 1F;
rotation = 0;
radialvelocity = 0;
}
public void render(SpriteBatch sb) {
sb.setColor(1F, 1F, 1F, opacity);
sb.draw(ar.img, this.x - 64.0F, this.y - 64.0F, 64.0F, 64.0F, 128.0F, 128.0F, Settings.scale, Settings.scale, this.rotation, 0, 0, 128, 128, false, false);
}
public int update() {
if (hit == 0) {
x = AbstractDungeon.player.hb.cX + (targetX - AbstractDungeon.player.hb.cX) / (float) flighttime * frames;
y = AbstractDungeon.player.hb.cY + (targetY - AbstractDungeon.player.hb.cY) / (float) flighttime * frames;
if (frames++ == flighttime) {
frames = 0;
hit = 1;
radialvelocity = MathUtils.random(-30, 30);
targetX = (targetX - ac.hb.cX - ac.hb.width / 4) / 4;
targetY = (targetY - ac.hb.cY) / 4;
}
} else {
this.targetX += (this.targetX > 0 ? -frictionX : frictionX);
if (y + this.targetY <= bounceplane) {
this.targetY = Math.abs(this.targetY);
if (this.targetY > 1 * Settings.scale) {
this.radialvelocity = MathUtils.random(-30, 30);
} else {
this.radialvelocity = 0;
}
hit = 2;
} else {
this.targetY -= (this.targetY > 0 ? frictionY : -frictionY);
this.targetY -= gravity;
}
x += targetX;
y += targetY;
rotation += radialvelocity;
if (hit > 1) {
if (opacity <= 0F) {
opacity = 0F;
hit = 3;
} else {
opacity -= dispersalspeed / 300F;
}
}
}
return hit;
}
}
}
| [
"varkdexon@gmail.com"
] | varkdexon@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.