blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 7
332
| content_id
stringlengths 40
40
| detected_licenses
sequencelengths 0
50
| license_type
stringclasses 2
values | repo_name
stringlengths 7
115
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringclasses 557
values | visit_date
timestamp[us] | revision_date
timestamp[us] | committer_date
timestamp[us] | github_id
int64 5.85k
684M
⌀ | star_events_count
int64 0
77.7k
| fork_events_count
int64 0
48k
| gha_license_id
stringclasses 17
values | gha_event_created_at
timestamp[us] | gha_created_at
timestamp[us] | gha_language
stringclasses 82
values | src_encoding
stringclasses 28
values | language
stringclasses 1
value | is_vendor
bool 1
class | is_generated
bool 2
classes | length_bytes
int64 7
5.41M
| extension
stringclasses 11
values | content
stringlengths 7
5.41M
| authors
sequencelengths 1
1
| author
stringlengths 0
161
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
71e9f2685ca7e2b4f7dc23b3caa7e9aa982c02a1 | f4c7ffaf6d9bffb07486f33a30e73a4b1e4e26bf | /test/junitTests/SyndicateTest.java | dd0fe7115104bbac2ad49a3f97044a585046cc0a | [] | no_license | Samuel0c/SyndicateCalculator | ad414053f8008864e3b768e57111d0bbd660ef39 | 98f0e5c8e0f91f332677245ce764ca9f3bc6d078 | refs/heads/master | 2020-03-27T15:51:58.210000 | 2018-08-30T12:45:39 | 2018-08-30T12:45:39 | 82,948,656 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,076 | 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 junitTests;
import fi.pageshare.simplesyndicatecalculator.logic.Product;
import fi.pageshare.simplesyndicatecalculator.logic.Syndicate;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;
public class SyndicateTest {
private Syndicate syndicate;
private Product stubProduct;
private Product anotherStubProduct;
// @Before
// public void setUp() {
// syndicate = new Syndicate();
// stubProduct = new Product("Photograph", 10.0);
// anotherStubProduct = new Product("Book", 15.0);
// }
@Test
public void addingMembersSuccessfullyToTheList() {
syndicate.addMember(stubProduct);
syndicate.addMember(anotherStubProduct);
assertEquals(2, syndicate.getMembers().size());
}
}
| [
"sleppiniemi@protonmail.com"
] | sleppiniemi@protonmail.com |
76aa1e60427e9ef118e2c608a9f76dc2cf553a7a | cd1a60b4ff0f1ec4665696cc5d60060110493922 | /src/day20/PalindromeTest.java | d5ab9db1a7d98ac47064f2b7a4fdf2e0a6cc2a28 | [] | no_license | Birnigar/AllProjects | c2edec42a965f560a254e43c89c41c62ceb2d624 | fcb6a38f953ba0fc48a9dbc1b617ca975462c5e9 | refs/heads/master | 2021-01-14T04:32:34.331000 | 2020-05-05T02:28:52 | 2020-05-05T02:28:52 | 242,600,846 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 619 | java | package day20;
public class PalindromeTest {
public static void main(String[] args) {
//level,kayak,elle,madam,aziza,
String name="kayak";
System.out.println("name ="+name);
String reversedName="";
for (int x =name.length()-1; x >=0 ; x--) {
reversedName=reversedName+name.charAt(x);
}
System.out.println("reversedName ="+reversedName);
if(name.equalsIgnoreCase(reversedName)){
System.out.println("PALINDROME TEST HAS PASSED");
}else{
System.out.println("PALINDROME TEST HAS PASSED");
}
}
}
| [
"farukgalatasaray34@gmail.com"
] | farukgalatasaray34@gmail.com |
0db1a63e61069a52a5910006eba2a51a4269dc8e | 23fbba09b810725f332453b5ee4cf95a0a0ca83e | /src/com/service/impl/UsersServiceImpl.java | 096397ee4990dedf8997e5303c09613419fe3849 | [] | no_license | swaggerduo/yongluocun1 | f3545f1ba362f0b0257a807b8c70ee75550b89cd | 800dad25f516ceb5249ddb74b2dbf4f13f793acb | refs/heads/master | 2021-08-20T02:43:02.675000 | 2017-11-28T01:56:06 | 2017-11-28T01:56:06 | 111,492,404 | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 1,820 | java | package com.service.impl;
import java.util.List;
import com.dao.UsersDao;
import com.dao.impl.UsersDaoDaoImpl;
import com.entity.Favorite;
import com.entity.Follower;
import com.entity.User;
import com.entity.Userinfo;
import com.service.UsersService;
import com.utils.BeFollower;
import com.utils.UsersRanking;
public class UsersServiceImpl implements UsersService {
private UsersDao dao;
public UsersServiceImpl() {
dao = new UsersDaoDaoImpl();
}
@Override
//查询所有的用户
public List<UsersRanking> getUsersRanking() {
try {
return dao.getUsersRanking();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return null;
}
@Override
//通过用户id获取此用户关注了谁
public List<Follower> getBeFollowerUserIdByuid(int uid) {
try {
return dao.getBeFollowerUserIdByuid(uid);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return null;
}
@Override
//通过用户id获取此用户发表的帖子
public List<Favorite> getFavoritePostByuid(int uid) {
try {
return dao.getFavoritePostByuid(uid);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return null;
}
@Override
//根据用户id在用户详细信息表中查到信息
public BeFollower getUserInfoByUid(Integer uid) {
BeFollower beFollower;
try {
beFollower=dao.getUserInfoByUid(uid);
return beFollower;
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return null;
}
@Override
//根据用户id查到用户信息
public User getUserbyUid(int uid) {
try {
return dao.getgetUserbyUid(uid);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return null;
}
}
| [
"s694911425d@qq.com"
] | s694911425d@qq.com |
377cf0b06a3c5ccefb774e5aeefb667618f46988 | 7d05e603eef7728255bc60eaf244882ac5ffd22c | /easy-spring-practice/07-init-destroy-bean/src/main/java/cn/duktig/springframework/core/io/ResourceLoader.java | 57f1b08d9f4f0e847b822b657379d634b8e0b8ba | [
"Apache-2.0"
] | permissive | duktig666/easy-spring | be620699c9044234ceef10cf64dfb0d8a53698ba | df973ae00b3b57447ef78c87bc521d434258ff39 | refs/heads/main | 2023-07-18T07:44:20.525000 | 2021-08-26T14:24:06 | 2021-08-26T14:24:06 | 399,673,002 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 620 | java | package cn.duktig.springframework.core.io;
/**
* description: 资源加载器 接口
* <p>
* 按照资源加载的不同方式,资源加载器可以把这些方式集中到统一的类服务下进行处理,外部用户只需要传递资源地址即可,简化使用。
*
* @author RenShiWei
* Date: 2021/8/25 19:28
**/
public interface ResourceLoader {
/**
* 资源默认前缀: "classpath:"
*/
String CLASSPATH_URL_PREFIX = "classpath:";
/**
* 获取资源
*
* @param location 资源位置
* @return 资源
*/
Resource getResource(String location);
}
| [
"1487660836@qq.com"
] | 1487660836@qq.com |
13b99689647ca7a5ae59bbf53615c2b015703479 | 5a8712119b32671e505d1f5f4830d7e2d01b1125 | /src/main/java/uz/almsoft/gateway/config/SecurityConfiguration.java | df818c4e7531803e61cea2653cf5df5d891df5ae | [] | no_license | anvar1/xb-gateway-application | 7502d0808593155d889a12246c5728f0d86e2bc7 | 8a1b18974ddb25f8262f15a5de50629209dd77f8 | refs/heads/master | 2020-09-07T00:55:14.058000 | 2019-11-09T07:41:47 | 2019-11-09T07:41:47 | 220,608,533 | 0 | 0 | null | 2020-07-18T18:21:59 | 2019-11-09T07:41:33 | TypeScript | UTF-8 | Java | false | false | 3,633 | java | package uz.almsoft.gateway.config;
import uz.almsoft.gateway.config.oauth2.OAuth2JwtAccessTokenConverter;
import uz.almsoft.gateway.config.oauth2.OAuth2Properties;
import uz.almsoft.gateway.security.oauth2.OAuth2SignatureVerifierClient;
import uz.almsoft.gateway.security.AuthoritiesConstants;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.cloud.client.loadbalancer.RestTemplateCustomizer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.http.SessionCreationPolicy;
import org.springframework.security.oauth2.config.annotation.web.configuration.EnableResourceServer;
import org.springframework.security.oauth2.config.annotation.web.configuration.ResourceServerConfigurerAdapter;
import org.springframework.security.oauth2.provider.token.TokenStore;
import org.springframework.security.oauth2.provider.token.store.JwtAccessTokenConverter;
import org.springframework.security.oauth2.provider.token.store.JwtTokenStore;
import org.springframework.security.web.csrf.CookieCsrfTokenRepository;
import org.springframework.security.web.csrf.CsrfFilter;
import org.springframework.web.filter.CorsFilter;
import org.springframework.web.client.RestTemplate;
@Configuration
@EnableResourceServer
@EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true)
public class SecurityConfiguration extends ResourceServerConfigurerAdapter {
private final OAuth2Properties oAuth2Properties;
private final CorsFilter corsFilter;
public SecurityConfiguration(OAuth2Properties oAuth2Properties, CorsFilter corsFilter) {
this.oAuth2Properties = oAuth2Properties;
this.corsFilter = corsFilter;
}
@Override
public void configure(HttpSecurity http) throws Exception {
http
.csrf()
.ignoringAntMatchers("/h2-console/**")
.csrfTokenRepository(CookieCsrfTokenRepository.withHttpOnlyFalse())
.and()
.addFilterBefore(corsFilter, CsrfFilter.class)
.headers()
.frameOptions()
.disable()
.and()
.sessionManagement()
.sessionCreationPolicy(SessionCreationPolicy.STATELESS)
.and()
.authorizeRequests()
.antMatchers("/api/**").authenticated()
.antMatchers("/management/health").permitAll()
.antMatchers("/management/info").permitAll()
.antMatchers("/management/prometheus").permitAll()
.antMatchers("/management/**").hasAuthority(AuthoritiesConstants.ADMIN);
}
@Bean
public TokenStore tokenStore(JwtAccessTokenConverter jwtAccessTokenConverter) {
return new JwtTokenStore(jwtAccessTokenConverter);
}
@Bean
public JwtAccessTokenConverter jwtAccessTokenConverter(OAuth2SignatureVerifierClient signatureVerifierClient) {
return new OAuth2JwtAccessTokenConverter(oAuth2Properties, signatureVerifierClient);
}
@Bean
@Qualifier("loadBalancedRestTemplate")
public RestTemplate loadBalancedRestTemplate(RestTemplateCustomizer customizer) {
RestTemplate restTemplate = new RestTemplate();
customizer.customize(restTemplate);
return restTemplate;
}
@Bean
@Qualifier("vanillaRestTemplate")
public RestTemplate vanillaRestTemplate() {
return new RestTemplate();
}
}
| [
"jhipster-bot@jhipster.tech"
] | jhipster-bot@jhipster.tech |
b994c86baa459696bd0d0dabec139fe6a620eda3 | c81011aab1a2c07946f0fbe96acd5bcff68b3c58 | /src/org/Course.java | d502cfb25be99020e50c0547ab24dc49705c514c | [] | no_license | JavaK2/JavaConcept | 6b0ddab5d8149597caaade39946d7ea82dc78dad | 8ed0778b379dbac698f5611aa3215c1cf8477091 | refs/heads/master | 2021-01-17T17:21:31.252000 | 2016-11-05T06:06:16 | 2016-11-05T06:06:16 | 66,184,923 | 0 | 0 | null | 2016-08-21T06:40:05 | 2016-08-21T06:40:05 | null | UTF-8 | Java | false | false | 556 | java | package org;
public class Course {
private String jCourse = "Java";
private void privateCourse() {
System.out.println("I am private " + jCourse);
}
public void publicCourse() {
System.out.println("I am public " + jCourse);
}
public static void main(String[] args) {
Course course = new Course();
System.out.println(course.jCourse);// Private variable can be access
// with in same Class Object.
course.privateCourse(); // Private method can be access with in same
// Class Object.
course.publicCourse();
}
}
| [
"kinshuk.ram@gmail.com"
] | kinshuk.ram@gmail.com |
0ee68c55459d03b0279e5b170636443c4dd9d241 | 20c25242d073d81a0bbfb16576ac576fc415156b | /aulas0912a1720/src/main/java/br/com/cleydsonjr/dsp20191/aulas1316/ap/persistencia/ddl/AdicionaFKLotacaoCargo.java | df21b087f9ada94e065b42b9d55db385426570fb | [] | no_license | cleydsonjr/UFG_DSP_20191_201602487_cleydson_junior | 626edd5e90e0f40fd7262468c2baa62188ce2424 | 8ff588ca752db838a6de6c0c01472484675fc1f8 | refs/heads/master | 2020-04-30T12:33:17.319000 | 2019-04-25T00:28:07 | 2019-04-25T00:28:07 | 176,829,637 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 666 | java | package br.com.cleydsonjr.dsp20191.aulas1316.ap.persistencia.ddl;
import br.com.cleydsonjr.dsp20191.aulas1316.ap.persistencia.base.PersistenciaJdbc;
public class AdicionaFKLotacaoCargo extends PersistenciaJdbc {
public boolean alteraTabela() throws Exception {
preparaPersistencia();
System.out.println("Adicionando FK lotacao -> cargo");
String sql = readSqlFile("/aulas1316/ddl/fk_lotacao_cargo.sql");
stmt.executeUpdate(sql);
System.out.println("FK lotacao -> cargo adicionada com sucesso!");
//STEP 4: Clean-up environment
stmt.close();
connection.close();
return true;
}
}
| [
"cleydsonjr@gmail.com"
] | cleydsonjr@gmail.com |
0342ea6937b56af0d22ab12d7d7cc3bd6f9bc04a | ff2f0013cb4259a13b5adbbe779b041b6a57e57a | /Java101/code/Inheritance/Elephant.java | da61d73aabd4b6448d8eb828f505d25a274d74cf | [] | no_license | Nohclu/Talks | 92d8042dad72b5f3f75da795416e312c0d541c25 | bf422490c41195c98cc4619518c3f87e224c0b6c | refs/heads/master | 2020-04-22T18:37:06.187000 | 2019-02-13T21:50:46 | 2019-02-13T21:50:46 | 170,583,080 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 324 | java | public class Elephant extends Mammal{
int tusks = 2;
boolean hasFangs = false;
boolean hasClaws = false;
public Elephant( String name) {
super(name);
}
public static void main(String[] args) {
Elephant myElephant = new Elephant("Dumbo");
myElephant.changeSpeed(10);
}
} | [
"connor.mulready2@mail.dcu.ie"
] | connor.mulready2@mail.dcu.ie |
65ffa8bf2663e0df203bfebb0fc2dc3c2f0336d0 | 847f1fe609080d08f69cce5555c01f2e119a7c1e | /org.eclipse.ufacekit.ui.swing.databinding/src/main/java/org/eclipse/ufacekit/ui/swing/databinding/internal/swing/properties/JListSingleSelectionIndexProperty.java | 3dbcea84bb2cfd0f9db116adda1dbd621fc888f1 | [] | no_license | davidtechcloud/emfdatabinding-tutorial | dc2ebdb13e84c9f6e06a9e4774142e4e18dcbe0e | 2ac547d271809364cccc0d63a925c6f0af6ed516 | refs/heads/master | 2021-05-27T07:36:46.769000 | 2011-06-10T08:19:19 | 2011-06-10T08:19:19 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,164 | java | /*******************************************************************************
* Copyright (c) 2008, 2009 Matthew Hall and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Matthew Hall - initial API and implementation (bug 194734)
******************************************************************************/
package org.eclipse.ufacekit.ui.swing.databinding.internal.swing.properties;
import javax.swing.JList;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import org.eclipse.ufacekit.ui.swing.databinding.internal.swing.EventType;
import org.eclipse.ufacekit.ui.swing.databinding.internal.swing.IDelegateRegistration;
import org.eclipse.ufacekit.ui.swing.databinding.internal.swing.properties.WidgetValueProperty.WidgetListener.Delegate;
/**
* @since 3.3
*
*/
public class JListSingleSelectionIndexProperty extends WidgetIntValueProperty<JListSingleSelectionIndexProperty.SelectionTypes, JList> {
public enum SelectionTypes implements EventType {
Selection;
public boolean isNone() {
return false;
}
}
/**
*
*/
public JListSingleSelectionIndexProperty() {
super(new SelectionTypes[] { SelectionTypes.Selection });
}
int doGetIntValue(Object source) {
return ((JList) source).getSelectedIndex();
}
void doSetIntValue(Object source, int value) {
((JList) source).setSelectedIndex(value);
}
public String toString() {
return "List.selectionIndex <int>"; //$NON-NLS-1$
}
@Override
protected IDelegateRegistration registerDelegate(final SelectionTypes type, final JList widget, final Delegate delegate) {
final ListSelectionListener l = new ListSelectionListener() {
public void valueChanged(ListSelectionEvent e) {
delegate.handle(type, widget);
}
};
widget.addListSelectionListener(l);
return new IDelegateRegistration() {
public void dispose() {
widget.removeListSelectionListener(l);
}
};
}
}
| [
"tom.schindl@bestsolution.at"
] | tom.schindl@bestsolution.at |
faf17d8a785305bd4601de21764e9dfba68b6c58 | d386bc18729c841147404cd17106f3735f577242 | /myjava/src/chapter12/section0201/BeepPrintExample1.java | bf133dd60afaee169935bbeabd3e12565afa51f1 | [] | no_license | sebaek/java20180620 | 6232cf8c81e96abb76e8bcd33c6004229d4b93b0 | 704a81b0620b44fb5a056c7d4d7ab0d51f34e8f6 | refs/heads/master | 2020-03-21T01:42:19.562000 | 2018-07-13T05:14:17 | 2018-07-13T05:14:17 | 137,957,724 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 543 | java | package chapter12.section0201;
public class BeepPrintExample1 {
public static void main(String[] args) {
for (int i = 0; i < 5; i++) {
System.err.println("소리");
try {
Thread.sleep(500);
} catch (Exception e) {
}
}
for (int i = 0; i < 5; i++) {
System.out.println("띵");
try {
Thread.sleep(500);
} catch (Exception e) {
}
}
}
}
| [
"choongang402@ca"
] | choongang402@ca |
7ed5954101983ee98af844c27d39a229bd408cdd | 62451f379cda397beea6f01fe4bdea0e771aa29b | /H. Games/src/fr/namu/hg/utils/ItemStackUtils.java | 1beb3ee9ce080af9450ff8f97cc1d6b6a888f853 | [] | no_license | namuuu/H.Games | 588ebea11045bc90c6a005f114ec9cdc1857c4e0 | 649717e4671ba31f1c9ba72a5bff4ac919e57914 | refs/heads/master | 2022-12-07T16:44:36.838000 | 2020-08-23T15:13:28 | 2020-08-23T15:13:28 | 274,909,234 | 2 | 0 | null | null | null | null | ISO-8859-1 | Java | false | false | 4,335 | java | package fr.namu.hg.utils;
import java.util.Arrays;
import org.bukkit.Color;
import org.bukkit.Material;
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemFlag;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.inventory.meta.LeatherArmorMeta;
import org.bukkit.inventory.meta.SkullMeta;
import fr.namu.hg.MainHG;
import net.minecraft.server.v1_8_R3.NBTTagCompound;
public class ItemStackUtils {
public ItemStackUtils(MainHG main) {
}
public ItemStack metaLeather(Material m, String ItemName, int Amount, Color color, String[] lore) {
ItemStack item = new ItemStack(m, Amount);
LeatherArmorMeta im = (LeatherArmorMeta)item.getItemMeta();
im.setDisplayName(ItemName);
im.setColor(color);
if(lore != null)
im.setLore(Arrays.asList(lore));
item.setItemMeta((ItemMeta)im);
return item;
}
public void setLeatherColored(Player p, Color color) {
p.getInventory().setHelmet(metaLeather(Material.LEATHER_HELMET, "§eCasque en cuir", 1, color, null));
p.getInventory().setChestplate(metaLeather(Material.LEATHER_CHESTPLATE, "§ePlastron en cuir", 1, color, null));
p.getInventory().setLeggings(metaLeather(Material.LEATHER_LEGGINGS, "§eJambières en cuir", 1, color, null));
p.getInventory().setBoots(metaLeather(Material.LEATHER_BOOTS, "§eBottes en cuir", 1, color, null));
}
public ItemStack metaLeatherFakeEnchanted(Material m, String ItemName, int Amount, Color color, String[] lore) {
ItemStack item = new ItemStack(m, Amount);
LeatherArmorMeta im = (LeatherArmorMeta)item.getItemMeta();
im.setDisplayName(ItemName);
im.addEnchant(Enchantment.DURABILITY, 1, Boolean.valueOf(true));
im.addItemFlags(ItemFlag.HIDE_ENCHANTS);
im.setColor(color);
if(lore != null)
im.setLore(Arrays.asList(lore));
item.setItemMeta((ItemMeta)im);
return item;
}
public ItemStack metaExtraUnbreakable(Material m, String ItemName, int Amount, String[] lore) {
ItemStack item = new ItemStack(m, Amount);
ItemMeta im = item.getItemMeta();
im.setDisplayName(ItemName);
im.addEnchant(Enchantment.DURABILITY, 1, Boolean.valueOf(true));
im.addItemFlags(ItemFlag.HIDE_ENCHANTS);
im.spigot().setUnbreakable(true);
if(lore != null)
im.setLore(Arrays.asList(lore));
item.setItemMeta(im);
return item;
}
public ItemStack metaExtra(Material m, String ItemName, int Amount, String[] lore) {
ItemStack item = new ItemStack(m, Amount);
ItemMeta im = item.getItemMeta();
im.setDisplayName(ItemName);
if(lore != null)
im.setLore(Arrays.asList(lore));
item.setItemMeta(im);
return item;
}
public ItemStack metaExtraFakeEnchanted(Material m, String ItemName, int Amount, String[] lore) {
ItemStack item = new ItemStack(m, Amount);
ItemMeta im = item.getItemMeta();
im.addEnchant(Enchantment.DURABILITY, 1, Boolean.valueOf(true));
im.addItemFlags(ItemFlag.HIDE_ENCHANTS);
im.setDisplayName(ItemName);
if(lore != null)
im.setLore(Arrays.asList(lore));
item.setItemMeta(im);
return item;
}
public ItemStack skullMeta(String ItemName, String PlayerName) {
ItemStack skull = new ItemStack(Material.SKULL_ITEM, 1, (short)3);
SkullMeta skullMeta = (SkullMeta)skull.getItemMeta();
skullMeta.setOwner(PlayerName);
skullMeta.setDisplayName(ItemName);
skull.setItemMeta((ItemMeta)skullMeta);
return skull;
} //skullMeta("", "")
public ItemStack metaVoid() {
ItemStack voidItem = new ItemStack(Material.AIR, 1);
return voidItem;
}
public static void removeAI(Entity entity) {
net.minecraft.server.v1_8_R3.Entity nmsEnt = ((CraftEntity) entity).getHandle();
NBTTagCompound tag = nmsEnt.getNBTTag();
if (tag == null) {
tag = new NBTTagCompound();
}
nmsEnt.c(tag);
tag.setInt("NoAI", 1);
nmsEnt.f(tag);
}
}
| [
"noreply@github.com"
] | noreply@github.com |
4fac82239560ba95ebffec2d9ef1bda6e979414a | af068fea8cca46d2e8eb099358cf7875e0cef97f | /wup_v1/src/TRom/EAPNTYPE.java | 8366d0e546fc75cf3d0a21d8d61f2d9b6400498e | [] | no_license | G5t4r/WupSource | d2ff35dbc8e25bc1a0aaf52f577c8f995dc03fd8 | 0802e65d8bc75e04120e0aa8cfd7045184e0aaf5 | refs/heads/master | 2020-03-16T17:34:49.016000 | 2017-01-24T10:04:14 | 2017-01-24T10:04:14 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,477 | java | // **********************************************************************
// This file was generated by a TAF parser!
// TAF version 3.1.1.2 by WSRD Tencent.
// Generated from `LoginQ.jce'
// **********************************************************************
package TRom;
public final class EAPNTYPE implements java.io.Serializable
{
private static EAPNTYPE[] __values = new EAPNTYPE[9];
private int __value;
private String __T = new String();
public static final int _APN_UNKNOWN = 0;
public static final EAPNTYPE APN_UNKNOWN = new EAPNTYPE(0,_APN_UNKNOWN,"APN_UNKNOWN");
public static final int _APN_CMWAP = 1;
public static final EAPNTYPE APN_CMWAP = new EAPNTYPE(1,_APN_CMWAP,"APN_CMWAP");
public static final int _APN_CMNET = 2;
public static final EAPNTYPE APN_CMNET = new EAPNTYPE(2,_APN_CMNET,"APN_CMNET");
public static final int _APN_UNWAP = 3;
public static final EAPNTYPE APN_UNWAP = new EAPNTYPE(3,_APN_UNWAP,"APN_UNWAP");
public static final int _APN_UNNET = 4;
public static final EAPNTYPE APN_UNNET = new EAPNTYPE(4,_APN_UNNET,"APN_UNNET");
public static final int _APN_CTWAP = 5;
public static final EAPNTYPE APN_CTWAP = new EAPNTYPE(5,_APN_CTWAP,"APN_CTWAP");
public static final int _APN_CTNET = 6;
public static final EAPNTYPE APN_CTNET = new EAPNTYPE(6,_APN_CTNET,"APN_CTNET");
public static final int _APN_3GWAP = 7;
public static final EAPNTYPE APN_3GWAP = new EAPNTYPE(7,_APN_3GWAP,"APN_3GWAP");
public static final int _APN_3GNET = 8;
public static final EAPNTYPE APN_3GNET = new EAPNTYPE(8,_APN_3GNET,"APN_3GNET");
public static EAPNTYPE convert(int val)
{
for(int __i = 0; __i < __values.length; ++__i)
{
if(__values[__i].value() == val)
{
return __values[__i];
}
}
assert false;
return null;
}
public static EAPNTYPE convert(String val)
{
for(int __i = 0; __i < __values.length; ++__i)
{
if(__values[__i].toString().equals(val))
{
return __values[__i];
}
}
assert false;
return null;
}
public int value()
{
return __value;
}
public String toString()
{
return __T;
}
private EAPNTYPE(int index, int val, String s)
{
__T = s;
__value = val;
__values[index] = this;
}
}
| [
"p_qingyuan@pacewear.cn"
] | p_qingyuan@pacewear.cn |
6cf12011eff5db635af7c0a8bfb0ceaf1e7df810 | d1054e0dca688cae5f47bc0653afd31dd6778553 | /chapter3/src/main/java/com/manning/pulsar/chapter3/consumers/BackAndForth.java | 250ce076329017796e73a372c4d3cdbaa1905cc9 | [] | no_license | chaitanyaphalak/pulsar-in-action | 2576162be7ef1990cbafea61584b3f9d79dd9fa3 | 9ebe01d4a0ac7a485cca35c6bd9404f160d33583 | refs/heads/master | 2022-12-04T23:59:56.023000 | 2020-08-24T23:35:24 | 2020-08-24T23:35:24 | 298,701,823 | 1 | 0 | null | 2020-09-25T23:46:51 | 2020-09-25T23:46:50 | null | UTF-8 | Java | false | false | 715 | java | package com.manning.pulsar.chapter3.consumers;
import org.apache.pulsar.client.api.Consumer;
import org.apache.pulsar.client.api.PulsarClientException;
import org.apache.pulsar.client.api.SubscriptionType;
public class BackAndForth extends PulsarConsumerDemoBase {
public static void main(String[] args) throws Exception {
BackAndForth sl = new BackAndForth();
sl.startConsumer();
sl.startProducer();
}
protected Consumer<byte[]> getConsumer() throws PulsarClientException {
if (consumer == null) {
consumer = getClient().newConsumer()
.topic(topic)
.subscriptionName(subscriptionName)
.subscriptionType(SubscriptionType.Shared)
.subscribe();
}
return consumer;
}
}
| [
"dkjerrumgaard@splunk.com"
] | dkjerrumgaard@splunk.com |
9156e9b72704dbf0766c2acc12729c8273cc5eba | 9696f474d91d7d05a95af26228f4d08608546601 | /app/src/main/java/com/example/blue/Menu2Activity5.java | b3604eefacfd15868022cf2b3e50d0f9bc8a5b64 | [] | no_license | choar816/blockchain-ux-app | c9aa9fdbade5c8025cc1fa4fb999e8d0173c2aa8 | c3ce767feaf59dfcd6eed3c4ab912a3203fb69bb | refs/heads/master | 2023-07-25T01:22:24.496000 | 2021-09-07T14:17:47 | 2021-09-07T14:17:47 | 380,180,350 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,912 | java | package com.example.blue;
import android.content.Intent;
import android.graphics.Paint;
import android.graphics.Typeface;
import android.os.Bundle;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.RadioGroup;
import android.widget.TextView;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.content.ContextCompat;
public class Menu2Activity5 extends AppCompatActivity {
int num_unchecked;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_menu2_5);
RadioGroup groups[] = new RadioGroup[8];
groups[0] = (RadioGroup) findViewById(R.id.rg_501);
groups[1] = (RadioGroup) findViewById(R.id.rg_502);
groups[2] = (RadioGroup) findViewById(R.id.rg_503);
groups[3] = (RadioGroup) findViewById(R.id.rg_504);
groups[4] = (RadioGroup) findViewById(R.id.rg_505);
groups[5] = (RadioGroup) findViewById(R.id.rg_506);
groups[6] = (RadioGroup) findViewById(R.id.rg_507);
groups[7] = (RadioGroup) findViewById(R.id.rg_508);
// action bar 설정 (제목, 뒤로가기버튼)
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setTitle("체크리스트(5/6)");
Intent intent = getIntent();
Bundle bundle = intent.getExtras();
int[] answer1 = bundle.getIntArray("answer1");
int[] answer2 = bundle.getIntArray("answer2");
int[] answer3 = bundle.getIntArray("answer3");
int[] answer4 = bundle.getIntArray("answer4");
int answer[] = new int[8];
for (int i=0; i<answer.length; ++i) {
answer[i] = -1;
}
CheckBox checkBox = (CheckBox) findViewById(R.id.checkbox5);
checkBox.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (((CheckBox)v).isChecked()) {
for (int i = 0; i < groups.length; ++i) {
groups[i].check(groups[i].getChildAt(5).getId());
answer[i] = 5;
}
} else {
for (int i = 0; i < groups.length; ++i) {
if (groups[i].getCheckedRadioButtonId() == groups[i].getChildAt(5).getId()) {
groups[i].clearCheck();
answer[i] = -1;
}
}
}
}
});
TextView texts[] = new TextView[8];
texts[0] = (TextView) findViewById(R.id.question_501);
texts[1] = (TextView) findViewById(R.id.question_502);
texts[2] = (TextView) findViewById(R.id.question_503);
texts[3] = (TextView) findViewById(R.id.question_504);
texts[4] = (TextView) findViewById(R.id.question_505);
texts[5] = (TextView) findViewById(R.id.question_506);
texts[6] = (TextView) findViewById(R.id.question_507);
texts[7] = (TextView) findViewById(R.id.question_508);
for (int i=0; i<groups.length; ++i) {
int finalI = i;
groups[i].setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(RadioGroup group, int checkedId) {
int index = group.indexOfChild(group.findViewById(checkedId));
if (index == 5) {
texts[finalI].setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.textOmitted));
} else {
texts[finalI].setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.textOriginal));
if (checkBox.isChecked()) {
checkBox.toggle();
}
}
answer[finalI] = index;
}
});
}
// 이전, 다음 버튼 click event 처리
Button prev = (Button) findViewById(R.id.btn5_prev);
Button next = (Button) findViewById(R.id.btn5_next);
prev.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
next.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
num_unchecked = 0;
for (int i=0; i<groups.length; ++i) {
if (groups[i].getCheckedRadioButtonId() == -1) {
++num_unchecked;
texts[i].setTypeface(null, Typeface.BOLD);
} else {
texts[i].setTypeface(null, Typeface.NORMAL);
}
}
if (num_unchecked != 0) {
Toast.makeText(getApplicationContext(), "모든 항목을 선택하세요", Toast.LENGTH_SHORT).show();
} else {
Intent intent = new Intent(getApplicationContext(), Menu2Activity6.class);
intent.putExtra("answer1", answer1);
intent.putExtra("answer2", answer2);
intent.putExtra("answer3", answer3);
intent.putExtra("answer4", answer4);
intent.putExtra("answer5", answer);
startActivity(intent);
}
}
});
}
public boolean onOptionsItemSelected(MenuItem item){
switch (item.getItemId()) {
case android.R.id.home:
finish();
return true;
}
return super.onOptionsItemSelected(item);
}
} | [
"choar816@postech.ac.kr"
] | choar816@postech.ac.kr |
8e310c09761638d96162bc98fb379a3f3236ae2f | 097df92ce1bfc8a354680725c7d10f0d109b5b7d | /com/amazon/ws/emr/hadoop/fs/guice/UserGroupMappingAWSSessionCredentialsProvider.java | b46b7ed98238253da1d1d84ab20233a481f6ca14 | [] | no_license | cozos/emrfs-hadoop | 7a1a1221ffc3aa8c25b1067cf07d3b46e39ab47f | ba5dfa631029cb5baac2f2972d2fdaca18dac422 | refs/heads/master | 2022-10-14T15:03:51.500000 | 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 | 2,189 | java | package com.amazon.ws.emr.hadoop.fs.guice;
import com.amazon.ws.emr.hadoop.fs.identity.HadoopFileSystemOwner;
import com.amazon.ws.emr.hadoop.fs.rolemapping.RoleMappings;
import com.amazon.ws.emr.hadoop.fs.util.AWSSessionCredentialsProviderFactory;
import com.amazonaws.auth.AWSSessionCredentials;
import com.amazonaws.auth.AWSSessionCredentialsProvider;
import java.io.IOException;
import java.util.Optional;
import org.apache.hadoop.security.UserGroupInformation;
import org.apache.hadoop.security.UserGroupInformation.AuthenticationMethod;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class UserGroupMappingAWSSessionCredentialsProvider
implements AWSSessionCredentialsProvider
{
private static final Logger LOG = LoggerFactory.getLogger(UserGroupMappingAWSSessionCredentialsProvider.class);
private final Optional<UserGroupInformation> ownerOptional;
public UserGroupMappingAWSSessionCredentialsProvider()
{
UserGroupInformation currentUser = null;
try
{
currentUser = UserGroupInformation.getCurrentUser();
}
catch (IOException localIOException) {}
ownerOptional = Optional.ofNullable(currentUser);
}
public AWSSessionCredentials getCredentials()
{
if (!ownerOptional.isPresent()) {
return null;
}
UserGroupInformation ugi = (UserGroupInformation)ownerOptional.get();
LOG.debug("retrieving credentials for {}, short name {}", ugi, ugi.getShortUserName());
if ((UserGroupInformation.isSecurityEnabled()) &&
(ugi.getAuthenticationMethod() == UserGroupInformation.AuthenticationMethod.SIMPLE)) {
return null;
}
AWSSessionCredentialsProvider sessionCredentialsProvider = AWSSessionCredentialsProviderFactory.getCredentialsProviderForRoleArn(
RoleMappings.getRoleArnForFileSystemOwner(new HadoopFileSystemOwner(ugi)));
if (sessionCredentialsProvider != null) {
return sessionCredentialsProvider.getCredentials();
}
return null;
}
public void refresh() {}
}
/* Location:
* Qualified Name: com.amazon.ws.emr.hadoop.fs.guice.UserGroupMappingAWSSessionCredentialsProvider
* Java Class Version: 8 (52.0)
* JD-Core Version: 0.7.1
*/ | [
"Arwin.tio@adroll.com"
] | Arwin.tio@adroll.com |
8d321ea19765f8491a2bd33029bcf9d2793ba7a8 | 53f6fe293c9c9f35612e9fcc63b7e446c45a42db | /rwge/src/com/dbylk/rwge/math/Angle.java | 524ced1cd6c3da1b13d900254f571f6d1bc32896 | [] | no_license | cnsuhao/RuneWordsGameEngine | e9b728b559e0d76cb43e93544fcda01e8c9db456 | df2d6f6336881c1f455b793a040025011b573a91 | refs/heads/master | 2021-05-31T17:20:41.940000 | 2015-07-29T04:02:10 | 2015-07-29T04:02:10 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 840 | java | package com.dbylk.rwge.math;
/** Euler Angle is ranged from 0 to 360. */
public class Angle {
public float value;
public Angle(float angle) {
this.value = angle;
}
public Angle(Radian radian) {
this.value = radian.value * 180f / (float) Math.PI;
}
/**
* The Standard Euler angle is represented by a float range from 0 to 360. If the value is not
* in this range, it will be transformed.
*/
public void correct() {
if (value >= 360f) {
int temp = (int) value;
value -= temp;
temp %= 360;
value += temp;
} else if (value < 0f) {
int temp = (int) value;
value -= temp;
temp %= 360;
value = value + temp + 360f;
}
}
public static float getAngleValue(Radian radian) {
return radian.value * 180f / (float) Math.PI;
}
public String toString() {
return "Euler Angle: " + value;
}
} | [
"dbylk@hotmail.com"
] | dbylk@hotmail.com |
5899d1f9da388f61582ec24baaf75e7150a81436 | bbfdd75558763c3e4ee813a6b9b89cbda8ea5f29 | /Sea-Life/src/main/java/com/revature/services/AnimalServiceImpl.java | b08de964bf9eb8b83b8f43c72a2887b45fa9a13e | [] | no_license | 1810Oct29SPARK/sea-life-team | fbc79f0998e0ffcad38c39baa9fd477939708466 | 0aa97aa94c2390e04db2e452ff2a6112689f8727 | refs/heads/master | 2020-04-13T15:51:45.023000 | 2019-01-10T15:37:19 | 2019-01-10T15:37:19 | 163,304,149 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,027 | java | package com.revature.services;
import java.util.List;
import org.springframework.stereotype.Service;
import com.revature.beans.Animal;
import com.revature.dao.FakeSeaLifeDAOImpl;
import com.revature.dao.SeaLifeDAO;
@Service(value="aquaService")
public class AnimalServiceImpl implements AquaService {
private SeaLifeDAO ad = new FakeSeaLifeDAOImpl();
public AnimalServiceImpl() {
}
public List<Animal> allAnimals() {
return ad.allAnimals();
}
@Override
public Animal getAnimalById(int id) {
// TODO Auto-generated method stub
return null;
}
@Override
public Animal updateAnimal(Animal fish) {
// TODO Auto-generated method stub
return null;
}
@Override
public void deleteAnimal(Animal fish) {
// TODO Auto-generated method stub
}
@Override
public void createAnimal(int id, String genus, String characteristics, String habitat, String species,
String diet) {
ad.createAnimals(id, genus, characteristics, habitat, species, diet);
System.out.println("method override");
}
} | [
"esteban.perez7391@hotmail.com"
] | esteban.perez7391@hotmail.com |
76a603e58477ac308bcba3a659d45e83037637a3 | 3ad8a22526ea6858ba354180ff72b5015d05b0e7 | /wizard-common/src/main/java/org/cobbzilla/wizard/model/entityconfig/EntityConfigFieldValidator.java | 58521fe16dfaf346e5aaee4a636463fdf8a28896 | [
"Apache-2.0"
] | permissive | cobbzilla/cobbzilla-wizard | d4df7d3dc132798d5720f9f5fd5d79a5128f90ba | 9792c0ac6d6a7cfde87c65a109cc239ab196f1f9 | refs/heads/master | 2022-12-23T04:54:07.878000 | 2020-12-11T15:46:15 | 2020-12-11T15:46:15 | 9,473,488 | 3 | 7 | Apache-2.0 | 2018-10-23T17:11:53 | 2013-04-16T13:48:22 | Java | UTF-8 | Java | false | false | 397 | java | package org.cobbzilla.wizard.model.entityconfig;
import org.cobbzilla.wizard.validation.ValidationResult;
import org.cobbzilla.wizard.validation.Validator;
import java.util.Locale;
public interface EntityConfigFieldValidator {
ValidationResult validate(Locale locale, Validator validator, EntityFieldConfig fieldConfig, Object value);
Object toObject(Locale locale, String value);
}
| [
"jonathan@kyuss.org"
] | jonathan@kyuss.org |
c49f34e8b9f9a642c9ce690849a6ed433b3ff1f7 | 2b3048a41ad801429504b0b2fc9e028d4f7e48ce | /main/java/com/example/gabri/tugasbesar2/Presenter/MyPresenter.java | 6eccc311fa8d67a54c168a857275d838b436a0f8 | [] | no_license | Bephometh/Tugas-Besar-2 | fe1d2a22b8f5ee9ad5dc481be4987ef7b8b19fd6 | 18eaea7802aa4d59dc4038e72e628c7078d6b419 | refs/heads/master | 2020-04-06T17:39:56.787000 | 2018-12-08T13:51:06 | 2018-12-08T13:51:06 | 157,668,473 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,899 | java | package com.example.gabri.tugasbesar2.Presenter;
import android.util.Log;
import com.example.gabri.tugasbesar2.View.FragmentStart;
import com.example.gabri.tugasbesar2.View.MainActivity;
import com.example.gabri.tugasbesar2.Model.BolaMoveable;
import com.example.gabri.tugasbesar2.Model.Hole;
import com.example.gabri.tugasbesar2.Model.SensorReader;
public class MyPresenter {
public MainActivity activity;
protected FragmentStart fragStart;
protected SensorReader sensorReader;
protected BolaMoveable moveable;
protected Hole hole;
public MyPresenter(MainActivity activity) {
this.activity = activity;
this.fragStart = this.fragStart.newInstance(activity);
this.hole = new Hole();
this.moveable = new BolaMoveable();
this.sensorReader = new SensorReader(activity);
}
public void startSensor(){
this.sensorReader.start();
}
public void stopSensor(){
this.sensorReader.stop();
}
public void drawCircles(int height, int width){
this.hole.posistion(height,width);
if(200 == this.holeX() &&100 == this.holeY()){
drawCircles(height, width);
}
else{
}
}
public void updateMoveable(int x, int y){
this.fragStart.drawMoveable(x,y);
}
public int moveableX(){return (int) this.moveable.getX();}
public int moveableY(){return (int) this.moveable.getY();}
public void setMoveableX(int x){
this.moveable.setX(x);
}
public void setMoveableY(int y){
this.moveable.setY(y);
}
public void setMoveable(int x, int y){
this.moveable.move(x,y);
}
public int holeX(){
return (int) this.hole.getX();
}
public int holeY(){
return (int) this.hole.getY();
}
}
| [
"noreply@github.com"
] | noreply@github.com |
954b65119e93fe1fb078e614a6f8b5d2dca73f75 | 2b1ea639059699312dfee28ed4a913ca70388bd9 | /rx-dagger-android-base-views/src/test/java/com/broliveira/rx_dagger_base_fragment/ExampleUnitTest.java | 55b76e085ff046b47f31a2c02e042c460f221655 | [
"MIT"
] | permissive | bmoliveira/base-views-protocols | 0adde24039d7de87edc0e32a2d226bb48f04a192 | ffe1ac513fd895d114ab63cf2959da49f6530c39 | refs/heads/master | 2021-05-10T22:46:34.389000 | 2018-02-19T16:56:36 | 2018-02-19T16:56:36 | 118,266,113 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 406 | java | package com.broliveira.rx_dagger_base_fragment;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
} | [
"bm.oliveira.dev@gmail.com"
] | bm.oliveira.dev@gmail.com |
118bffcf49976c7a9270ccc193943b2e39da5327 | 578a66c0d1a4394ee084c2b89c670ba4952c912e | /app/src/main/java/jain/myapplication/model/TrainAvailability.java | 1563af0a6da1dd14af7164e23c44b6735c1453b4 | [] | no_license | harshj94/MyApplication2 | 42a3aa2dda50013fb7dbc01f8187e0c2c4fb964b | bdd9aafe48925cc59a743ed364641ea35c35d7fd | refs/heads/master | 2020-09-16T10:02:46.439000 | 2016-09-03T07:24:07 | 2016-09-03T07:24:07 | 66,560,257 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,646 | java | package jain.myapplication.model;
import java.util.Arrays;
public class TrainAvailability {
private To to;
private String train_name;
private Quota quota;
private String error;
private String failure_rate;
private String response_code;
private String train_number;
private ClassType classType;
private Last_updated last_updated;
private From from;
private Availability[] availability;
public To getTo() {
return to;
}
public void setTo(To to) {
this.to = to;
}
public String getTrain_name() {
return train_name;
}
public void setTrain_name(String train_name) {
this.train_name = train_name;
}
public Quota getQuota() {
return quota;
}
public void setQuota(Quota quota) {
this.quota = quota;
}
public String getError() {
return error;
}
public void setError(String error) {
this.error = error;
}
public String getFailure_rate() {
return failure_rate;
}
public void setFailure_rate(String failure_rate) {
this.failure_rate = failure_rate;
}
public String getResponse_code() {
return response_code;
}
public void setResponse_code(String response_code) {
this.response_code = response_code;
}
public String getTrain_number() {
return train_number;
}
public void setTrain_number(String train_number) {
this.train_number = train_number;
}
public ClassType getClassType() {
return classType;
}
public void setClasss(ClassType classType) {
this.classType = classType;
}
public Last_updated getLast_updated() {
return last_updated;
}
public void setLast_updated(Last_updated last_updated) {
this.last_updated = last_updated;
}
public From getFrom() {
return from;
}
public void setFrom(From from) {
this.from = from;
}
public Availability[] getAvailability() {
return availability;
}
public void setAvailability(Availability[] availability) {
this.availability = availability;
}
@Override
public String toString() {
return "ClassPojo [to = " + to + ", train_name = " + train_name + ", quota = " + quota + ", error = " + error + ", failure_rate = " + failure_rate + ", response_code = " + response_code + ", train_number = " + train_number + ", class = " +
classType + ", last_updated = " + last_updated + ", from = " + from + ", availability = " + Arrays.toString(availability) + "]";
}
} | [
"harshkumarjain1994@gmail.com"
] | harshkumarjain1994@gmail.com |
8f646a28c78c2727ea6a87342cdea653ea0675ed | d7c6508a4c656128941a6e480b0512e4dc1d8ebb | /DataBus/src/Visuals/HMI/instrument/DirectionIndicatingLight.java | ee55a87ab00f2ae7b9b3c59270b4a4c0d4d4e794 | [] | no_license | RolandLevai/FJKKL | 08c55c170dd2d3d997278b2b37c744d2c7c5cd00 | 90c107757d2fc1e0561c8ff790f5f826df287ba0 | refs/heads/master | 2021-01-11T05:52:05.548000 | 2016-11-03T21:02:11 | 2016-11-03T21:02:11 | 69,097,207 | 0 | 0 | null | 2016-10-05T18:16:19 | 2016-09-24T11:04:05 | Java | UTF-8 | Java | false | false | 961 | java | package Visuals.HMI.instrument;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
/**
* Created by levair on 2016.10.12..
*/
public class DirectionIndicatingLight extends JPanel {
private Color lastColor = Color.YELLOW;
Timer timer;
public DirectionIndicatingLight()
{
timer = new Timer(1000, new AbstractAction() {
@Override
public void actionPerformed(ActionEvent e) {
//repaint();
}
});
}
public void on() {
timer.start();
}
public void off() {
timer.stop();
}
@Override
public void paintComponent(Graphics g)
{
super.paintComponents(g);
if(lastColor.equals(Color.YELLOW))
{
lastColor = Color.WHITE;
}
else
{
lastColor = Color.YELLOW;
}
g.setColor(lastColor);
g.fillOval(25, 25, 10, 10);
}
}
| [
"rav34@live.com"
] | rav34@live.com |
7dd599e8bdb82a47bb63d037708fe0cf8cff03b3 | a18808c881b7b45397a0f7cafbcaf03f8ea6a38b | /ElephantBike/src/com/xxn/servlet/BGetUnlockPass.java | 55c99e017aed8f91a93374094fdcc1d23ff1e739 | [] | no_license | xmuzhangshuai/ElephantBikeServer | fe6e65a7aa4342c6c1ce49997213a10e964b45ea | d35249ae1b9a99d5b79e7291cc0c75bef9c743ed | refs/heads/master | 2021-01-23T21:03:50.201000 | 2016-07-22T09:04:37 | 2016-07-22T09:04:37 | 52,760,223 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,567 | java | package com.xxn.servlet;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.xxn.butils.PassWordTool;
/**
* Servlet implementation class BGetUnlockPass
*/
@WebServlet("/bunlock")
public class BGetUnlockPass extends HttpServlet {
private static final long serialVersionUID = 1L;
/**
* @see HttpServlet#HttpServlet()
*/
public BGetUnlockPass() {
super();
}
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
doPost(request, response);
}
/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
request.setCharacterEncoding("utf-8");
response.setCharacterEncoding("UTF-8");
response.setContentType("text/html;Charset=UTF-8");
PrintWriter out = response.getWriter();
String bikeid = request.getParameter("bikeid");
String pass = PassWordTool.getUnlockPass(bikeid);
out.print(pass);
System.out.println("unlockpass:"+pass);
}
}
| [
"Lee@Lee-PC"
] | Lee@Lee-PC |
1c268e4099c0f503985075879bc3514f8d513f0f | 0809f9319f6d4bcffb8953884185011d308184bc | /data-management/dm-integration-helper/src/main/java/com/infoclinika/mssharing/platform/model/impl/entities/InstrumentCreationRequestDefault.java | 0a6a75487cd6f41f157366eca1ab6567dc4435bc | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | InfoClinika/chorus-opensource | 5bd624796fc6d99b4b5ff1335a56670808108977 | d0da23026aeaf3ac5c513b514224d537db98d551 | refs/heads/master | 2021-06-23T18:50:02.947000 | 2019-05-08T17:10:17 | 2019-05-08T17:10:17 | 115,448,491 | 1 | 3 | Apache-2.0 | 2019-05-08T17:10:18 | 2017-12-26T19:15:15 | Java | UTF-8 | Java | false | false | 342 | java | package com.infoclinika.mssharing.platform.model.impl.entities;
import com.infoclinika.mssharing.platform.entity.InstrumentCreationRequestTemplate;
import javax.persistence.Entity;
/**
* @author Herman Zamula
*/
@Entity
public class InstrumentCreationRequestDefault extends InstrumentCreationRequestTemplate<UserDefault, LabDefault> {
}
| [
"vladimir.moiseiev@teamdev.com"
] | vladimir.moiseiev@teamdev.com |
4ec6d6207d0efc96b678f9b50d7bf355ee2895c7 | 5ddcbd4d620adaf155422d592defacd2a40d413f | /src/persistent/abstractclass/Wishlist.java | 0f77465a762169cf3878794fac7a9e162f4230aa | [] | no_license | Isilin/PolyDiy-Manager | b74493945c614856e7d0b0f45165ff685175ad61 | be7c611845dcae13b5f50fc8f5c4050c8897dfff | refs/heads/master | 2021-01-17T13:47:59.631000 | 2016-04-11T02:18:12 | 2016-04-11T02:18:12 | 55,290,832 | 0 | 0 | null | 2016-04-02T11:18:25 | 2016-04-02T11:18:25 | null | UTF-8 | Java | false | false | 1,530 | java | package persistent.abstractclass;
import java.util.HashMap;
import java.util.Map;
import common.exception.dev.NotFoundParameter;
import persistent.common.InterfaceModel;
/**
* @author IsilinBN
*
*/
public abstract class Wishlist implements InterfaceModel {
protected int ID = -1;
protected String label = "";
protected int userID = -1;
protected Map<Integer, WishlistProduct> products = new HashMap<Integer, WishlistProduct>();
/**
* @return the iD
* @throws NotFoundParameter
*/
public int getID() throws NotFoundParameter {
if(this.ID == -1) {
throw new NotFoundParameter("ID", "Wishlist");
}
return this.ID;
}
/**
* @return the label
*/
public String getLabel() {
return this.label;
}
/**
* @return the userID
* @throws NotFoundParameter
*/
public int getUserID() throws NotFoundParameter {
if(this.userID == -1) {
throw new NotFoundParameter("userID", "Wishlist");
}
return this.userID;
}
/**
* @return the products
*/
public Map<Integer, WishlistProduct> getProducts() {
return this.products;
}
/**
* @param iD the iD to set
*/
public void setID(int iD) {
ID = iD;
}
/**
* @param label the label to set
*/
public void setLabel(String label) {
this.label = label;
}
/**
* @param userID the userID to set
*/
public void setUserID(int userID) {
this.userID = userID;
}
/**
* @param products the products to set
*/
public void setProducts(Map<Integer, WishlistProduct> products) {
this.products = products;
}
}
| [
"casa2pir@hotmail.fr"
] | casa2pir@hotmail.fr |
f02c5717ffa46ba50edcdf6a6f3417bd05e2b4bc | e31b8a00cecdbf2394c0e562691e5d253a329b58 | /QuizApp.v3/app/src/main/java/com/tunahantuna/quizapp/dummy/DummyContent.java | 0d0498da6f9cacca794b7056348e9f16a49c7c78 | [] | no_license | etuna/quizapp | c11b2aa213b3ed6f49a266bb97066c85078102f0 | 9ebb8f11c1e671966f02887fe63737798ca6257b | refs/heads/master | 2021-09-04T07:55:00.072000 | 2018-01-17T06:59:42 | 2018-01-17T06:59:42 | 117,797,679 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,944 | java | package com.tunahantuna.quizapp.dummy;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Helper class for providing sample content for user interfaces created by
* Android template wizards.
* <p>
* TODO: Replace all uses of this class before publishing your app.
*/
public class DummyContent {
/**
* An array of sample (dummy) items.
*/
public static final List<DummyItem> ITEMS = new ArrayList<DummyItem>();
/**
* A map of sample (dummy) items, by ID.
*/
public static final Map<String, DummyItem> ITEM_MAP = new HashMap<String, DummyItem>();
private static final int COUNT = 25;
static {
// Add some sample items.
for (int i = 1; i <= COUNT; i++) {
addItem(createDummyItem(i));
}
}
private static void addItem(DummyItem item) {
ITEMS.add(item);
ITEM_MAP.put(item.id, item);
}
private static DummyItem createDummyItem(int position) {
return new DummyItem(String.valueOf(position), "Item " + position, makeDetails(position));
}
private static String makeDetails(int position) {
StringBuilder builder = new StringBuilder();
builder.append("Details about Item: ").append(position);
for (int i = 0; i < position; i++) {
builder.append("\nMore details information here.");
}
return builder.toString();
}
/**
* A dummy item representing a piece of content.
*/
public static class DummyItem {
public final String id;
public final String content;
public final String details;
public DummyItem(String id, String content, String details) {
this.id = id;
this.content = content;
this.details = details;
}
@Override
public String toString() {
return content;
}
}
}
| [
"etuna@ku.edu.tr"
] | etuna@ku.edu.tr |
ea46769c5ca58a44afa5ea755d06da90f497304a | e034eadd636b4a43f6c7b97627af7d718dec58ff | /DSLEngineering/com.sap.furcas.metamodel/src/com/sap/furcas/metamodel/FURCAS/TCS/AndExp.java | 273965e0d0cb1dd3d404f7ab0007cfaacc6b2a37 | [] | no_license | FURCAS-dev/FURCAS | ed89b3152a56466fee04285fa02b09d3124adf8f | 1f5651283f45666792b4747c5ce97128807761f1 | refs/heads/master | 2020-06-03T21:46:35.150000 | 2017-08-09T10:20:45 | 2017-08-09T10:20:45 | 1,083,639 | 2 | 3 | null | null | null | null | UTF-8 | Java | false | false | 1,493 | java | /**
* <copyright>
* </copyright>
*
* $Id$
*/
package com.sap.furcas.metamodel.FURCAS.TCS;
import org.eclipse.emf.common.util.EList;
/**
* <!-- begin-user-doc -->
* A representation of the model object '<em><b>And Exp</b></em>'.
* <!-- end-user-doc -->
*
* <p>
* The following features are supported:
* <ul>
* <li>{@link com.sap.furcas.metamodel.FURCAS.TCS.AndExp#getExpressions <em>Expressions</em>}</li>
* </ul>
* </p>
*
* @see com.sap.furcas.metamodel.FURCAS.TCS.TCSPackage#getAndExp()
* @model
* @generated
*/
public interface AndExp extends Expression {
/**
* Returns the value of the '<em><b>Expressions</b></em>' containment reference list.
* The list contents are of type {@link com.sap.furcas.metamodel.FURCAS.TCS.AtomExp}.
* It is bidirectional and its opposite is '{@link com.sap.furcas.metamodel.FURCAS.TCS.AtomExp#getAndExp <em>And Exp</em>}'.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Expressions</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>Expressions</em>' containment reference list.
* @see com.sap.furcas.metamodel.FURCAS.TCS.TCSPackage#getAndExp_Expressions()
* @see com.sap.furcas.metamodel.FURCAS.TCS.AtomExp#getAndExp
* @model opposite="andExp" containment="true"
* @generated
*/
EList<AtomExp> getExpressions();
} // AndExp
| [
"stephan@dev.static-void.de"
] | stephan@dev.static-void.de |
2199d8e4ad9418f7eb5827f59265cf0d99a8f1d2 | 3b048f66060d647447d61a23a36931f1da062792 | /Java/corejava(Java核心技术)/src/v1ch03/bigIntegerTest/BigIntegerTest.java | 0975496722263af2920cb21f84a76ea7b4474fff | [] | no_license | rainyrun/practice | f5d68b11bb0e7fa870a7f4639851f8d6bd54a185 | f49c3a1cadf04fbdb262c46219a8e276edefb07c | refs/heads/master | 2021-03-01T15:01:13.500000 | 2020-03-08T04:14:22 | 2020-03-08T04:14:22 | 245,794,284 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 859 | java | package v1ch03.bigIntegerTest;
import java.util.Scanner;
import java.math.*;
/**
* 功能:对LotteryOdds的改进,可以使用大数值进行运算。如从 490 个可能的数值中抽取 60 个。
*/
public class BigIntegerTest {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
//询问从多少个数字中选
System.out.println("How many numbers you need?");
int nums = in.nextInt();
//中奖号码有多少个数字
System.out.println("How long the Lottery is?");
int len = in.nextInt();
//计算获奖概率(假设只有一个中奖号码)
BigInteger lotteryOdds = BigInteger.valueOf(1);
for(int i = 1; i <= len; i++) {
lotteryOdds = lotteryOdds.multiply(BigInteger.valueOf(nums - i + 1)).divide(BigInteger.valueOf(i));
}
System.out.println("Your odds is 1 in " + lotteryOdds);
}
}
| [
"runlei123@126.com"
] | runlei123@126.com |
dff1fefce83114b1805274f32f4439d611f941a1 | 118d37c3645d75e5535b08e05dcf7b1901e039f6 | /app/src/main/java/cn/kc/em/frag/common/FragmentFactory.java | 32f02826ecefbcd79aaa393e1759f9c84a6ee763 | [] | no_license | thankuandu/frag_and_bottom_navigation_pattern | 0eaa463353a112bea1e6640411bcc9852e87422d | f6f284a7f9813a7ea07542f604caf2b8834fe2db | refs/heads/master | 2020-04-08T07:24:41.642000 | 2018-11-26T09:22:18 | 2018-11-26T09:22:18 | 159,137,955 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,867 | java | package cn.kc.em.frag.common;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import java.util.LinkedList;
import java.util.List;
import cn.kc.em.MainActivity;
import cn.kc.em.R;
import cn.kc.em.frag.FirstFragment;
import cn.kc.em.frag.FourthFragment;
import cn.kc.em.frag.SecondFragment;
import cn.kc.em.frag.ThirdFragment;
/**
* 作者: 张卓嘉 .
* 日期: 2018/11/26
* 版本: V1.0
* 说明:
*/
public class FragmentFactory {
private static LinkedList<String> NAMES = new LinkedList<String>() {
{
add(0, FirstFragment.class.getName());
add(1, SecondFragment.class.getName());
add(2, ThirdFragment.class.getName());
add(3, FourthFragment.class.getName());
}
};
private static int showIndex = -1;
public static void show(MainActivity context, String clzName) {
FragmentManager supportFragmentManager = context.getSupportFragmentManager();
int currentIndex = NAMES.indexOf(clzName);
if (currentIndex == showIndex) {
return;
}
int enter = -1;
int exit = -1;
if (showIndex < currentIndex) {
//如果上一个页面的下标小于要显示的页面下标,动画从左向右
enter = R.anim.enter_from_right;
exit = R.anim.exit_to_left;
} else if (showIndex > currentIndex) {
//如果上一个页面的下标大于要显示的页面下标,动画从右向左
enter = R.anim.enter_from_left;
exit = R.anim.exit_to_right;
}
//隐藏非目标fragment
for (String name :
NAMES) {
Fragment f = supportFragmentManager.findFragmentByTag(name);
if (!name.equalsIgnoreCase(clzName)) {
if (f != null)
supportFragmentManager.beginTransaction().setCustomAnimations(enter, exit).hide(f).commit();
}
}
//获取目标fragment
Fragment fragmentByTag = supportFragmentManager.findFragmentByTag(clzName);
if (fragmentByTag == null) {
try {
fragmentByTag = (Fragment) Class.forName(clzName).newInstance();
supportFragmentManager.beginTransaction().setCustomAnimations(enter, exit).add(R.id.frame, fragmentByTag, clzName).commit();
} catch (InstantiationException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
} else {
supportFragmentManager.beginTransaction().setCustomAnimations(enter, exit).show(fragmentByTag).commit();
}
showIndex = NAMES.indexOf(clzName);
}
}
| [
"zhangzhuojia2167@dingtalk.com"
] | zhangzhuojia2167@dingtalk.com |
3305d3c0e9af925f56501cfe0c521c6b985091a9 | 755deeebc4795ce3b4470b0f9c0754e7e04fe022 | /impl/src/main/java/org/jboss/weld/interceptor/builder/MethodReference.java | 179e8e3fda70a8af17753791c63e5ed4b1f246ec | [] | no_license | dmlloyd/core | c10d0fe3bcd085bf6ba7e7ddbea580d409b12037 | 7592558ad65d09a82a9be3526ff9989b40eb2183 | refs/heads/master | 2023-07-22T19:42:57.915000 | 2013-03-29T09:26:03 | 2013-03-29T09:46:27 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,363 | java | /*
* JBoss, Home of Professional Open Source
* Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
* contributors by the @authors tag. See the copyright.txt in the
* distribution for a full listing of individual contributors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jboss.weld.interceptor.builder;
import java.io.Serializable;
import java.lang.reflect.Method;
import java.util.Arrays;
import org.jboss.weld.interceptor.spi.metadata.MethodMetadata;
/**
* Wrapper for a method. Allows serializing references to methods.
*
* @author <a href="mailto:mariusb@redhat.com">Marius Bogoevici</a>
*/
public class MethodReference implements Serializable {
private final String methodName;
private final Class<?>[] parameterTypes;
private final Class<?> declaringClass;
public static MethodReference of(Method method, boolean withDeclaringClass) {
return new MethodReference(method, withDeclaringClass);
}
public static MethodReference of(MethodMetadata method, boolean withDeclaringClass) {
return new MethodReference(method.getJavaMethod(), withDeclaringClass);
}
private MethodReference(Method method, boolean withDeclaringClass) {
this.methodName = method.getName();
this.parameterTypes = method.getParameterTypes();
if (withDeclaringClass) {
this.declaringClass = method.getDeclaringClass();
} else {
this.declaringClass = null;
}
}
private MethodReference(String methodName, Class<?>[] parameterTypes, Class<?> declaringClass) {
this.methodName = methodName;
this.parameterTypes = parameterTypes;
this.declaringClass = declaringClass;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
MethodReference that = (MethodReference) o;
if (declaringClass != null ? !declaringClass.equals(that.declaringClass) : that.declaringClass != null)
return false;
if (methodName != null ? !methodName.equals(that.methodName) : that.methodName != null) return false;
if (!Arrays.equals(parameterTypes, that.parameterTypes)) return false;
return true;
}
public String getMethodName() {
return methodName;
}
public Class<?>[] getParameterTypes() {
return parameterTypes;
}
public Class<?> getDeclaringClass() {
return declaringClass;
}
@Override
public int hashCode() {
int result = methodName != null ? methodName.hashCode() : 0;
result = 31 * result + (parameterTypes != null ? Arrays.hashCode(parameterTypes) : 0);
result = 31 * result + (declaringClass != null ? declaringClass.hashCode() : 0);
return result;
}
}
| [
"marko.luksa@gmail.com"
] | marko.luksa@gmail.com |
bf572af302f0a7e0c8d0bda8bd430e0bfd338acb | 8d03752fcb1ddc44395028ca2f850f3edd6127bf | /ruoyi-system/src/main/java/com/ruoyi/system/domain/SysPost.java | 66da9fcb455b9397edd64c8fd6a3e995b1df515f | [
"MIT"
] | permissive | renfeihn/RuoYi | 13ca46926cb264e16cdbaaa049450c3e9925f748 | d4bd8c2005b696a9c727ee949e09ffa76deac20e | refs/heads/master | 2020-03-31T08:47:58.015000 | 2018-10-08T12:13:13 | 2018-10-08T12:13:13 | 152,072,775 | 3 | 2 | null | null | null | null | UTF-8 | Java | false | false | 2,453 | java | package com.ruoyi.system.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.base.BaseEntity;
/**
* 岗位表 sys_post
*
* @author ruoyi
*/
public class SysPost extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 岗位序号 */
@Excel(name = "岗位序号")
private Long postId;
/** 岗位编码 */
@Excel(name = "岗位编码")
private String postCode;
/** 岗位名称 */
@Excel(name = "岗位名称")
private String postName;
/** 岗位排序 */
@Excel(name = "岗位排序")
private String postSort;
/** 状态(0正常 1停用) */
@Excel(name = "状态")
private String status;
/** 用户是否存在此岗位标识 默认不存在 */
private boolean flag = false;
public Long getPostId()
{
return postId;
}
public void setPostId(Long postId)
{
this.postId = postId;
}
public String getPostCode()
{
return postCode;
}
public void setPostCode(String postCode)
{
this.postCode = postCode;
}
public String getPostName()
{
return postName;
}
public void setPostName(String postName)
{
this.postName = postName;
}
public String getPostSort()
{
return postSort;
}
public void setPostSort(String postSort)
{
this.postSort = postSort;
}
public String getStatus()
{
return status;
}
public void setStatus(String status)
{
this.status = status;
}
public boolean isFlag()
{
return flag;
}
public void setFlag(boolean flag)
{
this.flag = flag;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("postId", getPostId())
.append("postCode", getPostCode())
.append("postName", getPostName())
.append("postSort", getPostSort())
.append("status", getStatus())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
}
}
| [
"renfei_hn@163.com"
] | renfei_hn@163.com |
4c22fdc4218a6c29848d8b886cb2036711cfb513 | 63153f5eb4e4ea4b57585bf170b53a53d29bda26 | /src/com/personal/taskmanager/parseobjects/Task.java | 2f58d5c1356be615f902b7f77965c5c00342b5d2 | [] | no_license | og7593/TaskManager | 4950dd55bebbf8d817abff01ea83d3aaa158f1a3 | dd04ddfcaeb0357884ea5bfddd53b0cdaa72b0a8 | refs/heads/master | 2021-01-15T10:18:13.129000 | 2014-09-20T05:55:49 | 2014-09-20T05:55:49 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,100 | java | package com.personal.taskmanager.parseobjects;
import com.parse.ParseClassName;
import com.parse.ParseObject;
@ParseClassName("Task")
public class Task extends ParseObject implements Comparable<Task> {
public Task() {
//Default Constructor
}
public String getAssignedTo() {
return getString("assignedTo");
}
public void setAssignedTo(String user) {
put("assignedTo", user);
}
public String getName() {
return getString("name");
}
public void setTaskName(String name) {
put("name", name);
}
public String getDescription() {
return getString("description");
}
public void setDescription(String description) {
put("description", description);
}
//If true, task completed
//If false, task in progress
public boolean getCompleted() {
return getBoolean("completed");
}
public void setCompleted(boolean status) {
put("completed", status);
}
public String getNotes() {
return getString("notes");
}
public void setNotes(String notes) {
put("notes", notes);
}
public String getDueDate() {
return getString ("dueDate");
}
public void setDueDate(String dueDate) {
put("dueDate", dueDate);
}
public String getProjectUID() {
return getString("projectUID");
}
public void setProjectUID(String projectUID) {
put("projectUID", projectUID);
}
public String getStatus() {
return getString("status");
}
public void setStatus(String status) {
put ("status", status);
if (status.compareTo("Completed") == 0) {
setCompleted(true);
}
else {
setCompleted(false);
}
}
public String getProjectAdmin() {
return getString("projectAdmin");
}
public void setProjectAdmin(String admin) {
put ("projectAdmin", admin);
}
public String getProjectName() {
return getString("projectName");
}
public void setProjectName(String name) {
put("projectName", name);
}
@Override
public int compareTo(Task task) {
return this.getName().compareTo(task.getName());
}
}
| [
"omidghomeshi@gmail.com"
] | omidghomeshi@gmail.com |
eb473247b8cd57d7241eb69e6aa5bac1c7ec3586 | 25e978504b69e2fce5d21de8f07e3523100b27ad | /app/src/main/java/com/example/yogi/gossipsbolo/ChatRoom/manager/operation/UserLoginOperation.java | 014e384a27f6fa6f96623108c1da4f16d021a881 | [] | no_license | ramkumartrk/GossipsBolo | 1ca155741439d316e3ada509685b77e248b87b6c | 04d36184bd9b462ce6c7e401a6f087858a554820 | refs/heads/master | 2021-01-19T13:05:46.388000 | 2017-02-18T05:43:31 | 2017-02-18T05:43:31 | 82,364,601 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,226 | java | package com.example.yogi.gossipsbolo.ChatRoom.manager.operation;
import android.util.Log;
import com.android.volley.Request;
import com.example.yogi.gossipsbolo.ChatRoom.model.LoginResponse;
import com.example.yogi.gossipsbolo.Config;
import com.example.yogi.gossipsbolo.constant.URLConstant;
import com.example.yogi.gossipsbolo.exception.GossipsBoloException;
import com.example.yogi.gossipsbolo.manager.operation.WebServiceOperation;
import java.util.Map;
public class UserLoginOperation extends WebServiceOperation
{
private IUserLoginOperation iUserLoginOperation;
public UserLoginOperation(Map<String, String> headers, String body, IUserLoginOperation listener) {
super(URLConstant.USER_LOGIN_URI, Request.Method.POST,headers,body,LoginResponse.class,UserLoginOperation.class.getSimpleName());
this.iUserLoginOperation = listener;
Log.d("check_gblogin","3.UserLoginOperation Constructor called");
}
@Override
public void addToRequestQueue() {
Log.d("check_gblogin","4.addToRequestQueue called");
if(Config.HARDCODED_ENABLE)
{
Log.d("check_gblogin","4.1.Configuration.hardcore enabled=true");
onSuccess(getFromAssetsFolder("loginresponse.json",LoginResponse.class));
}
else {
Log.d("check_gblogin","hardcorenot enabled!!! addTorequestqueue called");
super.addToRequestQueue();
Log.d("check_gblogin","request successfully added");
}
}
@Override
public void onError(GossipsBoloException exception) {
Log.d("check_gblogin","i.userloginoperation.onError_entered");
iUserLoginOperation.onUserLoginError(exception);
}
@Override
public void onSuccess(Object response) {
Log.d("check_gblogin","5.(login.json,loginresponse.class)");
LoginResponse loginResponse = (LoginResponse) response;
iUserLoginOperation.onUserLoginSuccess(loginResponse);
Log.d("check_gblogin","onUserLoginsucces_userloginoperation");
}
public interface IUserLoginOperation
{
void onUserLoginSuccess(LoginResponse loginResponse);
void onUserLoginError(GossipsBoloException exception);
}
} | [
"Yogi"
] | Yogi |
25679a79b2e038717913b42dbce2809a14032c00 | 50e934b06884cd9bd145bd6ab1a6aac4270e5fce | /SpringWebProgramming/src/main/java/com/mycompany/myapp/dao/sub/Exam10Dao3ImplA.java | 289c2d53931ec1b00c2b179be9db002fe0d0c56f | [] | no_license | Jangyukyung/TestRepository | 2e4c33769b20aa515e9bd96b381fd613aaa9d11b | 6d2d767d309ed28efbda591ba8dbdfe147182218 | refs/heads/master | 2021-01-20T00:45:41.592000 | 2017-06-30T09:01:10 | 2017-06-30T09:01:10 | 89,182,163 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 610 | java | package com.mycompany.myapp.dao.sub;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import com.mycompany.myapp.dao.Exam10Dao3;
@Component("")
public class Exam10Dao3ImplA implements Exam10Dao3{
private static final Logger LOGGER=LoggerFactory.getLogger(Exam10Dao3ImplA.class);
@Override
public void insert(){
LOGGER.info("회원가입");
//System.out.println("Exam10Dao3Impl insert() 실행 ! ");
}
@Override
public void select(){
LOGGER.info("회원가입검색");
//System.out.println("Exam10Dao3Impl select() 실행 ! ");
}
}
| [
"jyk602222@naver.com"
] | jyk602222@naver.com |
0cb4f385a9ee63338c6f32ceeba60c5c18bb4efb | 40a5a580864dea4b54d7a072bbdc039503081973 | /app/src/main/java/com/QQzzyy/bookreader/Bean.java | 6b09b6ba527546e32db2ca7724789f4f45aa805c | [] | no_license | jimodeniuren/BookReader | edda3a3e463d930c3e46fb1773f14a63d8b6feab | e3f0f83eeeb1ae85ff7951f6e198776dcd2a7f57 | refs/heads/master | 2020-08-28T21:01:44.836000 | 2019-10-27T07:18:33 | 2019-10-27T07:18:33 | 217,819,199 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 419 | java | package com.QQzzyy.bookreader;
public class Bean{
private ranking ranking;
private boolean ok;
public boolean isOk() {
return ok;
}
public void setOk(boolean ok) {
this.ok = ok;
}
public com.QQzzyy.bookreader.ranking getRanking() {
return ranking;
}
public void setRanking(com.QQzzyy.bookreader.ranking ranking) {
this.ranking = ranking;
}
}
| [
"634193463@qq.com"
] | 634193463@qq.com |
3abff1eb85e101b942a62e8761266e7b30345e98 | 8d5ce6ddbfa34e16cea11f7a5ec2fbc9db3a46df | /src/main/java/com/example/demo/controller/ProfileController.java | 82e16a80a4f3c9a23d4a1f490234198c6163a514 | [] | no_license | hhhhhyf/SD-Group8 | 39c45e50646f1331555479905b01f86e9d5335af | 053df47555cf7c761735815b8e9495a81aed2efc | refs/heads/master | 2023-04-05T12:18:43.994000 | 2020-07-10T05:33:39 | 2020-07-10T05:33:39 | 252,575,418 | 0 | 0 | null | 2023-03-23T20:38:36 | 2020-04-02T22:09:50 | HTML | UTF-8 | Java | false | false | 354 | java | package com.example.demo.controller;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
public class ProfileController {
@RequestMapping("/profile")
public String index() {
return "profile";
}
} | [
"y.hu-73@sms.ed.ac.uk"
] | y.hu-73@sms.ed.ac.uk |
372506909123fbd8ea7cae32d844394aa77b3128 | de613719bbd26b5ded8e3f214d6599b7c3cf23ea | /spring9/src/main/java/com/coderzoe/demo4/Tenant.java | f8641832fc76bff2fc153257df54d2c9f6d45a04 | [] | no_license | coderZoe/springlearn | d2b47ca09f26bb26a363572d3d008eb4472867d2 | e657134f544109fb46a1eaec7bd761b5baf18dca | refs/heads/master | 2022-10-06T22:31:04.575000 | 2020-06-07T12:55:07 | 2020-06-07T12:55:07 | 268,090,559 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 273 | java | package com.coderzoe.demo4;
/**
* @author yhs
* @date 2020/6/5 12:24
* @description
*/
public class Tenant {
public static void main(String[] args) {
MyProxy myProxy = new MyProxy();
myProxy.setRent(new Landlord());
myProxy.rent();
}
}
| [
"coder_yin@qq.com"
] | coder_yin@qq.com |
af9195901f9e3c942455996ff352844a4b2d946c | 0cb124460298bf95586009f3a539d63d00ec1e64 | /app/src/main/java/com/amanb/aman/feedreader/NavigationDrawerFragment.java | 616c31ca2764968b13f6be900edc4c9d9d74656b | [] | no_license | Aman-B/newsreader | 906b72dbdd365cb08cb1204be04cec66898ecbf5 | f418d190cfda0c54135ed3539ab68cd8fffdaf3e | refs/heads/master | 2021-01-17T07:08:24.227000 | 2016-06-21T20:48:58 | 2016-06-21T20:48:58 | 48,260,997 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,610 | java | package com.amanb.aman.feedreader;
import android.app.Activity;
import android.app.ActionBar;
import android.app.Fragment;
import android.support.v4.app.ActionBarDrawerToggle;
import android.support.v4.view.GravityCompat;
import android.support.v4.widget.DrawerLayout;
import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.Toast;
/**
* Fragment used for managing interactions for and presentation of a navigation drawer.
* See the <a href="https://developer.android.com/design/patterns/navigation-drawer.html#Interaction">
* design guidelines</a> for a complete explanation of the behaviors implemented here.
*/
public class NavigationDrawerFragment extends Fragment {
/**
* Remember the position of the selected item.
*/
private static final String STATE_SELECTED_POSITION = "selected_navigation_drawer_position";
/**
* Per the design guidelines, you should show the drawer on launch until the user manually
* expands it. This shared preference tracks this.
*/
private static final String PREF_USER_LEARNED_DRAWER = "navigation_drawer_learned";
/**
* A pointer to the current callbacks instance (the Activity).
*/
private NavigationDrawerCallbacks mCallbacks;
/**
* Helper component that ties the action bar to the navigation drawer.
*/
private ActionBarDrawerToggle mDrawerToggle;
private DrawerLayout mDrawerLayout;
private ListView mDrawerListView;
private View mFragmentContainerView;
private int mCurrentSelectedPosition = 0;
private boolean mFromSavedInstanceState;
private boolean mUserLearnedDrawer;
public NavigationDrawerFragment() {
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Read in the flag indicating whether or not the user has demonstrated awareness of the
// drawer. See PREF_USER_LEARNED_DRAWER for details.
SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(getActivity());
mUserLearnedDrawer = sp.getBoolean(PREF_USER_LEARNED_DRAWER, false);
if (savedInstanceState != null) {
mCurrentSelectedPosition = savedInstanceState.getInt(STATE_SELECTED_POSITION);
mFromSavedInstanceState = true;
}
// Select either the default item (0) or the last selected item.
selectItem(mCurrentSelectedPosition);
}
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
// Indicate that this fragment would like to influence the set of actions in the action bar.
setHasOptionsMenu(true);
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
mDrawerListView = (ListView) inflater.inflate(
R.layout.drawer_next, container, false);
mDrawerListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
selectItem(position);
}
});
mDrawerListView.setAdapter(new ArrayAdapter<String>(
getActionBar().getThemedContext(),
android.R.layout.simple_list_item_activated_1,
android.R.id.text1,
new String[]{
getString(R.string.title_section1),
getString(R.string.title_section2),
getString(R.string.title_section3),
}));
mDrawerListView.setItemChecked(mCurrentSelectedPosition, true);
return mDrawerListView;
}
public boolean isDrawerOpen() {
return mDrawerLayout != null && mDrawerLayout.isDrawerOpen(mFragmentContainerView);
}
/**
* Users of this fragment must call this method to set up the navigation drawer interactions.
*
* @param fragmentId The android:id of this fragment in its activity's layout.
* @param drawerLayout The DrawerLayout containing this fragment's UI.
*/
public void setUp(int fragmentId, DrawerLayout drawerLayout) {
mFragmentContainerView = getActivity().findViewById(fragmentId);
mDrawerLayout = drawerLayout;
// set a custom shadow that overlays the main content when the drawer opens
mDrawerLayout.setDrawerShadow(R.drawable.drawer_shadow, GravityCompat.START);
// set up the drawer's list view with items and click listener
ActionBar actionBar = getActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setHomeButtonEnabled(true);
// ActionBarDrawerToggle ties together the the proper interactions
// between the navigation drawer and the action bar app icon.
mDrawerToggle = new ActionBarDrawerToggle(
getActivity(), /* host Activity */
mDrawerLayout, /* DrawerLayout object */
R.drawable.ic_drawer, /* nav drawer image to replace 'Up' caret */
R.string.navigation_drawer_open, /* "open drawer" description for accessibility */
R.string.navigation_drawer_close /* "close drawer" description for accessibility */
) {
@Override
public void onDrawerClosed(View drawerView) {
super.onDrawerClosed(drawerView);
if (!isAdded()) {
return;
}
getActivity().invalidateOptionsMenu(); // calls onPrepareOptionsMenu()
}
@Override
public void onDrawerOpened(View drawerView) {
super.onDrawerOpened(drawerView);
if (!isAdded()) {
return;
}
if (!mUserLearnedDrawer) {
// The user manually opened the drawer; store this flag to prevent auto-showing
// the navigation drawer automatically in the future.
mUserLearnedDrawer = true;
SharedPreferences sp = PreferenceManager
.getDefaultSharedPreferences(getActivity());
sp.edit().putBoolean(PREF_USER_LEARNED_DRAWER, true).apply();
}
getActivity().invalidateOptionsMenu(); // calls onPrepareOptionsMenu()
}
};
// If the user hasn't 'learned' about the drawer, open it to introduce them to the drawer,
// per the navigation drawer design guidelines.
if (!mUserLearnedDrawer && !mFromSavedInstanceState) {
mDrawerLayout.openDrawer(mFragmentContainerView);
}
// Defer code dependent on restoration of previous instance state.
mDrawerLayout.post(new Runnable() {
@Override
public void run() {
mDrawerToggle.syncState();
}
});
mDrawerLayout.setDrawerListener(mDrawerToggle);
}
private void selectItem(int position) {
mCurrentSelectedPosition = position;
if (mDrawerListView != null) {
mDrawerListView.setItemChecked(position, true);
}
if (mDrawerLayout != null) {
mDrawerLayout.closeDrawer(mFragmentContainerView);
}
if (mCallbacks != null) {
mCallbacks.onNavigationDrawerItemSelected(position);
}
}
@Override
public void onAttach(Activity activity) {
super.onAttach(activity);
try {
mCallbacks = (NavigationDrawerCallbacks) activity;
} catch (ClassCastException e) {
throw new ClassCastException("Activity must implement NavigationDrawerCallbacks.");
}
}
@Override
public void onDetach() {
super.onDetach();
mCallbacks = null;
}
@Override
public void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
outState.putInt(STATE_SELECTED_POSITION, mCurrentSelectedPosition);
}
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
// Forward the new configuration the drawer toggle component.
mDrawerToggle.onConfigurationChanged(newConfig);
}
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
// If the drawer is open, show the global app actions in the action bar. See also
// showGlobalContextActionBar, which controls the top-left area of the action bar.
if (mDrawerLayout != null && isDrawerOpen()) {
inflater.inflate(R.menu.global, menu);
showGlobalContextActionBar();
}
super.onCreateOptionsMenu(menu, inflater);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
if (mDrawerToggle.onOptionsItemSelected(item)) {
return true;
}
/*if (item.getItemId() == R.id.action_example) {
Toast.makeText(getActivity(), "Example action.", Toast.LENGTH_SHORT).show();
return true;
}*/
return super.onOptionsItemSelected(item);
}
/**
* Per the navigation drawer design guidelines, updates the action bar to show the global app
* 'context', rather than just what's in the current screen.
*/
private void showGlobalContextActionBar() {
ActionBar actionBar = getActionBar();
actionBar.setDisplayShowTitleEnabled(true);
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
actionBar.setTitle(R.string.app_name);
}
private ActionBar getActionBar() {
return getActivity().getActionBar();
}
/**
* Callbacks interface that all activities using this fragment must implement.
*/
public static interface NavigationDrawerCallbacks {
/**
* Called when an item in the navigation drawer is selected.
*/
void onNavigationDrawerItemSelected(int position);
}
}
| [
"kingaman.bakshi4@gmail.com"
] | kingaman.bakshi4@gmail.com |
9f21d87101e4b73430f469eeb1d73f44c8fa30e4 | 7e4a7ac03602c5a5828a5f312f7576f2c4089f93 | /app/src/main/java/com/example/pspchaterbot/rest/Client.java | 9f76efae0ab0a24d28fb4f644ad86e27b904595d | [] | no_license | AlejandroFnV/PSPChaterBot | cbf9c94bed5b0068a0a8dfa44b66e1148c75d45a | 875a0fcf2599fa1abf09e3b598fb692a8037d123 | refs/heads/master | 2020-09-25T16:18:05.755000 | 2019-12-05T07:27:19 | 2019-12-05T07:27:19 | 226,041,863 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,487 | java | package com.example.pspchaterbot.rest;
import android.util.Log;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.URL;
import javax.net.ssl.HttpsURLConnection;
public class Client {
public String postHttp(String src, String body) {
StringBuffer buffer = new StringBuffer();
try {
URL url = new URL(src);
HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
connection.setDoInput(true);
connection.setDoOutput(true);
connection.setRequestMethod("POST");
connection.setRequestProperty("Accept", "application/x-www-form-urlencoded");
connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
connection.connect();
OutputStreamWriter out = new OutputStreamWriter(connection.getOutputStream(), "UTF-8");
out.write(body);
out.flush();
out.close();
BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
String line;
while ((line = in.readLine()) != null) {
buffer.append(line + "\n");
}
in.close();
} catch (IOException e) {
Log.v("client", e.getMessage());
}
return buffer.toString();
}
}
| [
"dam@iMac-de-Alejandro.local"
] | dam@iMac-de-Alejandro.local |
60e7bc7e0f80a085408c81507115f0eb3af52bb9 | 69a4f2d51ebeea36c4d8192e25cfb5f3f77bef5e | /methods/Method_10084.java | e2a12b29df2c945eb8c1c6e6b589d8acb2730843 | [] | no_license | P79N6A/icse_20_user_study | 5b9c42c6384502fdc9588430899f257761f1f506 | 8a3676bc96059ea2c4f6d209016f5088a5628f3c | refs/heads/master | 2020-06-24T08:25:22.606000 | 2019-07-25T15:31:16 | 2019-07-25T15:31:16 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 13,844 | java | /**
* Gets the user points with the specified user id, page number and page size.
* @param userId the specified user id
* @param currentPageNum the specified page number
* @param pageSize the specified page size
* @return result json object, for example, <pre>{ "paginationRecordCount": int, "rslts": java.util.List[{ Pointtransfer }, ....] } </pre>
*/
public JSONObject getUserPoints(final String userId,final int currentPageNum,final int pageSize){
final Query query=new Query().addSort(Keys.OBJECT_ID,SortDirection.DESCENDING).setPage(currentPageNum,pageSize);
final List<Filter> filters=new ArrayList<>();
filters.add(new PropertyFilter(Pointtransfer.FROM_ID,FilterOperator.EQUAL,userId));
filters.add(new PropertyFilter(Pointtransfer.TO_ID,FilterOperator.EQUAL,userId));
query.setFilter(new CompositeFilter(CompositeFilterOperator.OR,filters));
try {
final JSONObject ret=pointtransferRepository.get(query);
final JSONArray records=ret.optJSONArray(Keys.RESULTS);
for (int i=0; i < records.length(); i++) {
final JSONObject record=records.optJSONObject(i);
record.put(Common.CREATE_TIME,new Date(record.optLong(Pointtransfer.TIME)));
final String toId=record.optString(Pointtransfer.TO_ID);
final String fromId=record.optString(Pointtransfer.FROM_ID);
String typeStr=record.optString(Pointtransfer.TYPE);
if (("3".equals(typeStr) && userId.equals(toId)) || ("5".equals(typeStr) && userId.equals(fromId)) || ("9".equals(typeStr) && userId.equals(toId)) || ("14".equals(typeStr) && userId.equals(toId)) || ("22".equals(typeStr) && userId.equals(toId)) || ("34".equals(typeStr) && userId.equals(toId))) {
typeStr+="In";
}
if (fromId.equals(userId)) {
record.put(Common.BALANCE,record.optInt(Pointtransfer.FROM_BALANCE));
record.put(Common.OPERATION,"-");
}
else {
record.put(Common.BALANCE,record.optInt(Pointtransfer.TO_BALANCE));
record.put(Common.OPERATION,"+");
}
record.put(Common.DISPLAY_TYPE,langPropsService.get("pointType" + typeStr + "Label"));
final int type=record.optInt(Pointtransfer.TYPE);
final String dataId=record.optString(Pointtransfer.DATA_ID);
String desTemplate=langPropsService.get("pointType" + typeStr + "DesLabel");
switch (type) {
case Pointtransfer.TRANSFER_TYPE_C_DATA_EXPORT:
desTemplate=desTemplate.replace("{num}",record.optString(Pointtransfer.DATA_ID));
break;
case Pointtransfer.TRANSFER_TYPE_C_INIT:
desTemplate=desTemplate.replace("{point}",record.optString(Pointtransfer.SUM));
break;
case Pointtransfer.TRANSFER_TYPE_C_ADD_ARTICLE:
final JSONObject addArticle=articleRepository.get(dataId);
if (null == addArticle) {
desTemplate=langPropsService.get("removedLabel");
break;
}
final String addArticleLink="<a href=\"" + addArticle.optString(Article.ARTICLE_PERMALINK) + "\">" + Escapes.escapeHTML(addArticle.optString(Article.ARTICLE_TITLE)) + "</a>";
desTemplate=desTemplate.replace("{article}",addArticleLink);
break;
case Pointtransfer.TRANSFER_TYPE_C_UPDATE_ARTICLE:
final JSONObject updateArticle=articleRepository.get(dataId);
if (null == updateArticle) {
desTemplate=langPropsService.get("removedLabel");
break;
}
final String updateArticleLink="<a href=\"" + updateArticle.optString(Article.ARTICLE_PERMALINK) + "\">" + Escapes.escapeHTML(updateArticle.optString(Article.ARTICLE_TITLE)) + "</a>";
desTemplate=desTemplate.replace("{article}",updateArticleLink);
break;
case Pointtransfer.TRANSFER_TYPE_C_ADD_COMMENT:
final JSONObject comment=commentRepository.get(dataId);
if (null == comment) {
desTemplate=langPropsService.get("removedLabel");
break;
}
final String articleId=comment.optString(Comment.COMMENT_ON_ARTICLE_ID);
final JSONObject commentArticle=articleRepository.get(articleId);
final String commentArticleLink="<a href=\"" + commentArticle.optString(Article.ARTICLE_PERMALINK) + "\">" + Escapes.escapeHTML(commentArticle.optString(Article.ARTICLE_TITLE)) + "</a>";
desTemplate=desTemplate.replace("{article}",commentArticleLink);
if ("3In".equals(typeStr)) {
final JSONObject commenter=userRepository.get(fromId);
final String commenterLink=UserExt.getUserLink(commenter);
desTemplate=desTemplate.replace("{user}",commenterLink);
}
break;
case Pointtransfer.TRANSFER_TYPE_C_UPDATE_COMMENT:
final JSONObject comment32=commentRepository.get(dataId);
if (null == comment32) {
desTemplate=langPropsService.get("removedLabel");
break;
}
final String articleId32=comment32.optString(Comment.COMMENT_ON_ARTICLE_ID);
final JSONObject commentArticle32=articleRepository.get(articleId32);
final String commentArticleLink32="<a href=\"" + commentArticle32.optString(Article.ARTICLE_PERMALINK) + "\">" + Escapes.escapeHTML(commentArticle32.optString(Article.ARTICLE_TITLE)) + "</a>";
desTemplate=desTemplate.replace("{article}",commentArticleLink32);
break;
case Pointtransfer.TRANSFER_TYPE_C_ADD_ARTICLE_REWARD:
final JSONObject addArticleReword=articleRepository.get(dataId);
if (null == addArticleReword) {
desTemplate=langPropsService.get("removedLabel");
break;
}
final String addArticleRewordLink="<a href=\"" + addArticleReword.optString(Article.ARTICLE_PERMALINK) + "\">" + Escapes.escapeHTML(addArticleReword.optString(Article.ARTICLE_TITLE)) + "</a>";
desTemplate=desTemplate.replace("{article}",addArticleRewordLink);
break;
case Pointtransfer.TRANSFER_TYPE_C_ARTICLE_REWARD:
final JSONObject reward=rewardRepository.get(dataId);
String senderId=reward.optString(Reward.SENDER_ID);
if ("5In".equals(typeStr)) {
senderId=toId;
}
final String rewardArticleId=reward.optString(Reward.DATA_ID);
final JSONObject sender=userRepository.get(senderId);
final String senderLink=UserExt.getUserLink(sender);
desTemplate=desTemplate.replace("{user}",senderLink);
final JSONObject articleReward=articleRepository.get(rewardArticleId);
if (null == articleReward) {
desTemplate=langPropsService.get("removedLabel");
break;
}
final String articleRewardLink="<a href=\"" + articleReward.optString(Article.ARTICLE_PERMALINK) + "\">" + Escapes.escapeHTML(articleReward.optString(Article.ARTICLE_TITLE)) + "</a>";
desTemplate=desTemplate.replace("{article}",articleRewardLink);
break;
case Pointtransfer.TRANSFER_TYPE_C_COMMENT_REWARD:
final JSONObject reward14=rewardRepository.get(dataId);
JSONObject user14;
if ("14In".equals(typeStr)) {
user14=userRepository.get(fromId);
}
else {
user14=userRepository.get(toId);
}
final String userLink14=UserExt.getUserLink(user14);
desTemplate=desTemplate.replace("{user}",userLink14);
final String articleId14=reward14.optString(Reward.DATA_ID);
final JSONObject article14=articleRepository.get(articleId14);
if (null == article14) {
desTemplate=langPropsService.get("removedLabel");
break;
}
final String articleLink14="<a href=\"" + article14.optString(Article.ARTICLE_PERMALINK) + "\">" + Escapes.escapeHTML(article14.optString(Article.ARTICLE_TITLE)) + "</a>";
desTemplate=desTemplate.replace("{article}",articleLink14);
break;
case Pointtransfer.TRANSFER_TYPE_C_ARTICLE_THANK:
final JSONObject thank22=rewardRepository.get(dataId);
JSONObject user22;
if ("22In".equals(typeStr)) {
user22=userRepository.get(fromId);
}
else {
user22=userRepository.get(toId);
}
final String articleId22=thank22.optString(Reward.DATA_ID);
final JSONObject article22=articleRepository.get(articleId22);
if (null == article22) {
desTemplate=langPropsService.get("removedLabel");
break;
}
final String userLink22=UserExt.getUserLink(user22);
desTemplate=desTemplate.replace("{user}",userLink22);
final String articleLink22="<a href=\"" + article22.optString(Article.ARTICLE_PERMALINK) + "\">" + Escapes.escapeHTML(article22.optString(Article.ARTICLE_TITLE)) + "</a>";
desTemplate=desTemplate.replace("{article}",articleLink22);
break;
case Pointtransfer.TRANSFER_TYPE_C_INVITE_REGISTER:
final JSONObject newUser=userRepository.get(dataId);
final String newUserLink=UserExt.getUserLink(newUser);
desTemplate=desTemplate.replace("{user}",newUserLink);
break;
case Pointtransfer.TRANSFER_TYPE_C_INVITED_REGISTER:
final JSONObject referralUser=userRepository.get(dataId);
final String referralUserLink=UserExt.getUserLink(referralUser);
desTemplate=desTemplate.replace("{user}",referralUserLink);
break;
case Pointtransfer.TRANSFER_TYPE_C_INVITECODE_USED:
final JSONObject newUser1=userRepository.get(dataId);
final String newUserLink1=UserExt.getUserLink(newUser1);
desTemplate=desTemplate.replace("{user}",newUserLink1);
break;
case Pointtransfer.TRANSFER_TYPE_C_ACTIVITY_CHECKIN:
case Pointtransfer.TRANSFER_TYPE_C_ACTIVITY_YESTERDAY_LIVENESS_REWARD:
case Pointtransfer.TRANSFER_TYPE_C_ACTIVITY_1A0001:
case Pointtransfer.TRANSFER_TYPE_C_ACTIVITY_1A0001_COLLECT:
case Pointtransfer.TRANSFER_TYPE_C_ACTIVITY_CHARACTER:
case Pointtransfer.TRANSFER_TYPE_C_BUY_INVITECODE:
case Pointtransfer.TRANSFER_TYPE_C_ACTIVITY_EATINGSNAKE:
case Pointtransfer.TRANSFER_TYPE_C_ACTIVITY_EATINGSNAKE_COLLECT:
case Pointtransfer.TRANSFER_TYPE_C_ACTIVITY_GOBANG:
case Pointtransfer.TRANSFER_TYPE_C_ACTIVITY_GOBANG_COLLECT:
case Pointtransfer.TRANSFER_TYPE_C_REPORT_HANDLED:
break;
case Pointtransfer.TRANSFER_TYPE_C_AT_PARTICIPANTS:
final JSONObject comment20=commentRepository.get(dataId);
if (null == comment20) {
desTemplate=langPropsService.get("removedLabel");
break;
}
final String articleId20=comment20.optString(Comment.COMMENT_ON_ARTICLE_ID);
final JSONObject atParticipantsArticle=articleRepository.get(articleId20);
if (null == atParticipantsArticle) {
desTemplate=langPropsService.get("removedLabel");
break;
}
final String ArticleLink20="<a href=\"" + atParticipantsArticle.optString(Article.ARTICLE_PERMALINK) + "\">" + Escapes.escapeHTML(atParticipantsArticle.optString(Article.ARTICLE_TITLE)) + "</a>";
desTemplate=desTemplate.replace("{article}",ArticleLink20);
break;
case Pointtransfer.TRANSFER_TYPE_C_STICK_ARTICLE:
final JSONObject stickArticle=articleRepository.get(dataId);
if (null == stickArticle) {
desTemplate=langPropsService.get("removedLabel");
break;
}
final String stickArticleLink="<a href=\"" + stickArticle.optString(Article.ARTICLE_PERMALINK) + "\">" + Escapes.escapeHTML(stickArticle.optString(Article.ARTICLE_TITLE)) + "</a>";
desTemplate=desTemplate.replace("{article}",stickArticleLink);
break;
case Pointtransfer.TRANSFER_TYPE_C_ACCOUNT2ACCOUNT:
JSONObject user9;
if ("9In".equals(typeStr)) {
user9=userRepository.get(fromId);
}
else {
user9=userRepository.get(toId);
}
final String userLink=UserExt.getUserLink(user9);
desTemplate=desTemplate.replace("{user}",userLink);
final String memo=record.optString(Pointtransfer.MEMO);
if (StringUtils.isNotBlank(memo)) {
desTemplate=desTemplate.replace("{memo}",memo);
}
else {
desTemplate=desTemplate.replace("{memo}",langPropsService.get("noMemoLabel"));
}
break;
case Pointtransfer.TRANSFER_TYPE_C_ACTIVITY_CHECKIN_STREAK:
desTemplate=desTemplate.replace("{point}",record.optString(Pointtransfer.SUM));
break;
case Pointtransfer.TRANSFER_TYPE_C_CHARGE:
final String yuan=dataId.split("-")[0];
desTemplate=desTemplate.replace("{yuan}",yuan);
break;
case Pointtransfer.TRANSFER_TYPE_C_EXCHANGE:
final String exYuan=dataId;
desTemplate=desTemplate.replace("{yuan}",exYuan);
break;
case Pointtransfer.TRANSFER_TYPE_C_ABUSE_DEDUCT:
desTemplate=desTemplate.replace("{action}",dataId);
desTemplate=desTemplate.replace("{point}",record.optString(Pointtransfer.SUM));
break;
case Pointtransfer.TRANSFER_TYPE_C_ADD_ARTICLE_BROADCAST:
final JSONObject addArticleBroadcast=articleRepository.get(dataId);
if (null == addArticleBroadcast) {
desTemplate=langPropsService.get("removedLabel");
break;
}
final String addArticleBroadcastLink="<a href=\"" + addArticleBroadcast.optString(Article.ARTICLE_PERMALINK) + "\">" + Escapes.escapeHTML(addArticleBroadcast.optString(Article.ARTICLE_TITLE)) + "</a>";
desTemplate=desTemplate.replace("{article}",addArticleBroadcastLink);
break;
case Pointtransfer.TRANSFER_TYPE_C_PERFECT_ARTICLE:
final JSONObject perfectArticle=articleRepository.get(dataId);
if (null == perfectArticle) {
desTemplate=langPropsService.get("removedLabel");
break;
}
final String perfectArticleLink="<a href=\"" + perfectArticle.optString(Article.ARTICLE_PERMALINK) + "\">" + Escapes.escapeHTML(perfectArticle.optString(Article.ARTICLE_TITLE)) + "</a>";
desTemplate=desTemplate.replace("{article}",perfectArticleLink);
break;
case Pointtransfer.TRANSFER_TYPE_C_QNA_OFFER:
final JSONObject reward34=rewardRepository.get(dataId);
JSONObject user34;
if ("34In".equals(typeStr)) {
user34=userRepository.get(fromId);
}
else {
user34=userRepository.get(toId);
}
final String userLink34=UserExt.getUserLink(user34);
desTemplate=desTemplate.replace("{user}",userLink34);
final String articleId34=reward34.optString(Reward.DATA_ID);
final JSONObject article34=articleRepository.get(articleId34);
if (null == article34) {
desTemplate=langPropsService.get("removedLabel");
break;
}
final String articleLink34="<a href=\"" + article34.optString(Article.ARTICLE_PERMALINK) + "\">" + Escapes.escapeHTML(article34.optString(Article.ARTICLE_TITLE)) + "</a>";
desTemplate=desTemplate.replace("{article}",articleLink34);
break;
case Pointtransfer.TRANSFER_TYPE_C_CHANGE_USERNAME:
final String oldName=dataId.split("-")[0];
final String newName=dataId.split("-")[1];
desTemplate=desTemplate.replace("{oldName}",oldName).replace("{newName}",newName);
break;
default :
LOGGER.warn("Invalid point type [" + type + "]");
}
desTemplate=Emotions.convert(desTemplate);
record.put(Common.DESCRIPTION,desTemplate);
}
final int recordCnt=ret.optJSONObject(Pagination.PAGINATION).optInt(Pagination.PAGINATION_RECORD_COUNT);
ret.remove(Pagination.PAGINATION);
ret.put(Pagination.PAGINATION_RECORD_COUNT,recordCnt);
return ret;
}
catch (final RepositoryException e) {
LOGGER.log(Level.ERROR,"Gets user points failed",e);
return null;
}
}
| [
"sonnguyen@utdallas.edu"
] | sonnguyen@utdallas.edu |
93039b652f4b4cc36c7c020815c98a9f222605a1 | 22361430ab12e5a7c1eba4664293fc4a39051d9b | /QMRServer/src/com/game/guild/handler/ReqGuildAddDiplomaticToServerHandler.java | 07edc2e9828c66b2e12b75495a8ce8cd8875ecc2 | [] | no_license | liuziangexit/QMR | ab93a66623e670a7f276683d94188d1b627db853 | 91ea3bd35ee3a1ebf994fb3fd6ffdbaa6fbf4d22 | refs/heads/master | 2020-03-30T00:22:31.028000 | 2017-12-20T05:41:17 | 2017-12-20T05:41:17 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 719 | java | package com.game.guild.handler;
import org.apache.log4j.Logger;
import com.game.guild.message.ReqGuildAddDiplomaticToServerMessage;
import com.game.command.Handler;
import com.game.guild.manager.GuildServerManager;
import com.game.player.structs.Player;
public class ReqGuildAddDiplomaticToServerHandler extends Handler{
Logger log = Logger.getLogger(ReqGuildAddDiplomaticToServerHandler.class);
public void action(){
try{
ReqGuildAddDiplomaticToServerMessage msg = (ReqGuildAddDiplomaticToServerMessage)this.getMessage();
GuildServerManager.getInstance().reqGuildAddDiplomaticToServer((Player)this.getParameter(), msg);
}catch(ClassCastException e){
log.error(e);
}
}
} | [
"ctl70000@163.com"
] | ctl70000@163.com |
477a07437f136959657cce2b21cb98788adefde0 | 32630b4bd78e5a77cdfa27971112fa0e89b8248c | /src/test/java/mirea/geps/core/service/db/EducationalPlanCustomTest.java | 1aa2a480d0d0c2f0c8245b63a6d83e8866871a4c | [] | no_license | Lirveez/geps | 55f590e91a2f4eeb6c59e5f23672db8b155d9ab2 | d4cb993f459cd92eaecb0ea87b52308cb70a8b79 | refs/heads/master | 2022-06-24T11:47:13.278000 | 2019-08-19T21:30:42 | 2019-08-19T21:30:42 | 203,249,638 | 0 | 0 | null | 2022-05-25T23:22:02 | 2019-08-19T21:01:17 | Java | UTF-8 | Java | false | false | 2,773 | java | package mirea.geps.core.service.db;
import mirea.geps.core.dto.Competition;
import mirea.geps.core.dto.ControlForm;
import mirea.geps.core.dto.Discipline;
import mirea.geps.core.dto.EducationalPlan;
import org.assertj.core.util.Sets;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import java.util.Optional;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertThat;
@RunWith(SpringRunner.class)
@SpringBootTest
public class EducationalPlanCustomTest {
@Autowired
private EducationalPlanRepositoryCustom repository;
private Discipline discipline1;
private Discipline discipline2;
private EducationalPlan educationalPlan;
@Before
public void setUp() throws Exception {
repository.deleteAll();
Competition competition1 = new Competition("compCode1", "desc1", "type1");
ControlForm form1 = new ControlForm("cfname1");
discipline1 = new Discipline(
"code1",
"name1",
Sets.newLinkedHashSet(competition1),
Sets.newLinkedHashSet(form1),
"exam_units1",
"lec_hours1",
"lab_hours1",
"prc_hours1",
"self_hours1",
"1");
Competition competition2 = new Competition("compCode2", "desc2", "type2");
discipline2 = new Discipline(
"code2",
"name2",
Sets.newLinkedHashSet(competition1, competition2),
Sets.newLinkedHashSet(form1),
"exam_units2",
"lec_hours2",
"lab_hours2",
"prc_hour2",
"self_hours2",
"2");
educationalPlan = new EducationalPlan(
"customName",
"trDirection",
"profile",
"form",
"plan",
"department",
Sets.newLinkedHashSet(discipline1, discipline2)
);
repository.save(educationalPlan);
}
@Test
public void shouldFindEducationalPlan() {
EducationalPlan actual = repository.findPlanByCustomName("customName").get();
assertThat(actual, is(educationalPlan));
assertThat(actual.getDisciplines(),is(Sets.newLinkedHashSet(discipline1, discipline2)));
}
@Test
public void shouldReturnOptionalEmptyIfPlanIsNotFoud() {
Optional<EducationalPlan> empty = repository.findPlanByCustomName("123");
assertFalse(empty.isPresent());
}
} | [
"lirveez@gmail.com"
] | lirveez@gmail.com |
354b10e8e935d982ccf9357a42b706143c5229d8 | 3ef55e152decb43bdd90e3de821ffea1a2ec8f75 | /large/module1643_public/tests/unittests/src/java/module1643_public_tests_unittests/a/IFoo3.java | 7b1632d9a9556ceb08e055b1d5aae20ac718b8bb | [
"BSD-3-Clause"
] | permissive | salesforce/bazel-ls-demo-project | 5cc6ef749d65d6626080f3a94239b6a509ef145a | 948ed278f87338edd7e40af68b8690ae4f73ebf0 | refs/heads/master | 2023-06-24T08:06:06.084000 | 2023-03-14T11:54:29 | 2023-03-14T11:54:29 | 241,489,944 | 0 | 5 | BSD-3-Clause | 2023-03-27T11:28:14 | 2020-02-18T23:30:47 | Java | UTF-8 | Java | false | false | 890 | java | package module1643_public_tests_unittests.a;
import java.sql.*;
import java.util.logging.*;
import java.util.zip.*;
/**
* Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut
* labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.
* Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
*
* @see javax.management.Attribute
* @see javax.naming.directory.DirContext
* @see javax.net.ssl.ExtendedSSLSession
*/
@SuppressWarnings("all")
public interface IFoo3<J> extends module1643_public_tests_unittests.a.IFoo2<J> {
javax.rmi.ssl.SslRMIClientSocketFactory f0 = null;
java.awt.datatransfer.DataFlavor f1 = null;
java.beans.beancontext.BeanContext f2 = null;
String getName();
void setName(String s);
J get();
void set(J e);
}
| [
"gwagenknecht@salesforce.com"
] | gwagenknecht@salesforce.com |
0c4f497a1fb91c186303589d6e71d4ac336961ef | 37da54371a4ca1d538d74bafdf9345d76ff7a3eb | /src/main/java/com/residencia/dell/entities/Products.java | da9c4dfc2e5f6096dd8750333d2c8345858b078e | [] | no_license | DayaneRoson/Dell | ebafb2784cce38a799a78aef2042322a0bbbcf5c | 6d9f76eb1ffebb0ad23906e1d4d4ce3392c85c99 | refs/heads/main | 2023-05-22T16:23:54.557000 | 2021-06-11T19:24:44 | 2021-06-11T19:24:44 | 374,408,814 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,070 | java |
package com.residencia.dell.entities;
import java.math.BigDecimal;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
/**
*
* @author Dayane
*/
@Entity
@Table (name = "products")
public class Products {
@Id
@GeneratedValue (strategy = GenerationType.IDENTITY)
@Column (name = "prod_id")
private Integer prodId;
@ManyToOne
@JoinColumn (name = "category", referencedColumnName = "category")
private Categories category;
@Column (name = "title")
private String title;
@Column (name = "actor")
private String actor;
@Column (name = "price")
private BigDecimal price;
@Column (name = "special")
private Integer special;
@Column (name = "common_prod_id")
private Integer commonProdId;
public Integer getProdId() {
return prodId;
}
public void setProdId(Integer prodId) {
this.prodId = prodId;
}
public Categories getCategory() {
return category;
}
public void setCategory(Categories category) {
this.category = category;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getActor() {
return actor;
}
public void setActor(String actor) {
this.actor = actor;
}
public BigDecimal getPrice() {
return price;
}
public void setPrice(BigDecimal price) {
this.price = price;
}
public Integer getSpecial() {
return special;
}
public void setSpecial(Integer special) {
this.special = special;
}
public Integer getCommonProdId() {
return commonProdId;
}
public void setCommonProdId(Integer commonProdId) {
this.commonProdId = commonProdId;
}
}
| [
"dayane.roson@gmail.com"
] | dayane.roson@gmail.com |
2c2ab6a30c274f5d32b62c10f4aa9ae9437a34eb | c504a8216db6fc17bf66123766bad5a418a10bd8 | /diamang/src/shs/admin/dao/board/BoardReviewDao.java | c91c60227655e9b05a1e50b1de6d964117eda3b5 | [] | no_license | kms228/MyProject | 7d75bfc7ceeaf2f7bd20a218c211224c60346773 | 22680777ad64f530e5bd52f2e0dd95862c4f2124 | refs/heads/master | 2021-04-26T06:53:19.070000 | 2018-03-13T00:11:03 | 2018-03-13T00:11:03 | 121,358,975 | 0 | 0 | null | null | null | null | UHC | Java | false | false | 6,433 | java | package shs.admin.dao.board;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import diamang.dbcp.DbcpBean;
import shs.admin.vo.board.BoardReviewVo;
import shs.admin.vo.paging.PagingVo;
public class BoardReviewDao {
// 전체 글의 갯수 구하기
public int getCount() {
Connection con = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
try {
con = DbcpBean.getConn();
String sql = "SELECT NVL(COUNT(*),0) CNT FROM REVIEW WHERE MNUM != 10000 AND REGDATE >= SYSDATE -20";
pstmt = con.prepareStatement(sql);
rs = pstmt.executeQuery();
int cnt = -1;
if(rs.next()) {
cnt = rs.getInt("cnt");
}
return cnt;
} catch (SQLException e) {
e.printStackTrace();
return -1;
} finally {
DbcpBean.closeConn(con, pstmt, rs);
}
}
public ArrayList<BoardReviewVo> getTop5Today() {
Connection con = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
ArrayList<BoardReviewVo> list = new ArrayList<>();
try {
con = DbcpBean.getConn();
String sql = "SELECT RV_NUM, TITLE, HIT " +
"FROM REVIEW R " +
"WHERE TO_CHAR(R.REGDATE,'YYYYMMDD')=TO_CHAR(SYSDATE,'YYYYMMDD') AND ROWNUM <= 5 AND R.MNUM != 10000 " +
"ORDER BY HIT DESC";
pstmt = con.prepareStatement(sql);
rs = pstmt.executeQuery();
while(rs.next()) {
String title = rs.getString("title");
int rv_num = rs.getInt("rv_num");
int hit = rs.getInt("hit");
list.add(new BoardReviewVo(rv_num, title, hit));
};
return list;
} catch (SQLException e) {
e.printStackTrace();
return null;
} finally {
DbcpBean.closeConn(con, pstmt, rs);
}
}
public ArrayList<BoardReviewVo> getTop5Sevendays() {
Connection con = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
ArrayList<BoardReviewVo> list = new ArrayList<>();
try {
con = DbcpBean.getConn();
String sql = "SELECT RV_NUM, TITLE, HIT " +
"FROM REVIEW R " +
"WHERE R.REGDATE >= (SYSDATE-8) AND ROWNUM <= 5 AND R.MNUM != 10000 " +
"ORDER BY HIT DESC";
pstmt = con.prepareStatement(sql);
rs = pstmt.executeQuery();
while(rs.next()) {
String title = rs.getString("title");
int rv_num = rs.getInt("rv_num");
int hit = rs.getInt("hit");
list.add(new BoardReviewVo(rv_num, title, hit));
};
return list;
} catch (SQLException e) {
e.printStackTrace();
return null;
} finally {
DbcpBean.closeConn(con, pstmt, rs);
}
}
public ArrayList<BoardReviewVo> getTop5Reviewcnt(){
Connection con = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
ArrayList<BoardReviewVo> list = new ArrayList<>();
try {
con = DbcpBean.getConn();
String sql = "SELECT ID, R.RVCNT " +
"FROM MEMBERS M, (SELECT MNUM, COUNT(MNUM) RVCNT FROM REVIEW GROUP BY MNUM) R " +
"WHERE R.MNUM = M.MNUM AND ROWNUM <= 5 AND R.MNUM != 10000";
pstmt = con.prepareStatement(sql);
rs = pstmt.executeQuery();
while(rs.next()) {
String id = rs.getString("id");
int rvcnt = rs.getInt("rvcnt");
list.add(new BoardReviewVo(id, rvcnt));
};
return list;
} catch (SQLException e) {
e.printStackTrace();
return null;
} finally {
DbcpBean.closeConn(con, pstmt, rs);
}
}
public ArrayList<BoardReviewVo> getReview(PagingVo pagingVo) {
Connection con = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
ArrayList<BoardReviewVo> list = new ArrayList<>();
try {
con = DbcpBean.getConn();
String sql = "SELECT * " +
"FROM (SELECT R4.*, ROWNUM RNUM " +
" FROM (SELECT R.RV_NUM, TITLE, TO_CHAR(R.REGDATE, 'YYYY\"-\"MM\"-\"DD') REGDATE, STAR, ID, NVL(RVCNT,0) RVCNT, R.REF, R.LEV, R.STEP, R.CONTENT " +
" FROM REVIEW R, MEMBERS M, (SELECT R1.RV_NUM, COUNT(*) RVCNT " +
"FROM REVIEW R1, REVIEW R2 " +
"WHERE R1.RV_NUM = R2.REF AND R2.MNUM = 10000 " +
"GROUP BY R1.RV_NUM) R3 " +
"WHERE R.MNUM=M.MNUM AND R.RV_NUM=R3.RV_NUM(+) AND R.MNUM != 10000 AND REGDATE >= SYSDATE -20 " +
"ORDER BY REF DESC, STEP ASC"
+ ") R4 " +
") " +
"WHERE RNUM>=? AND RNUM<=?";
pstmt = con.prepareStatement(sql);
pstmt.setInt(1, pagingVo.getStartRow());
pstmt.setInt(2, pagingVo.getEndRow());
rs = pstmt.executeQuery();
while(rs.next()) {
int rv_num = rs.getInt("rv_num");
String title = rs.getString("title");
String content = rs.getString("content");
String regdate = rs.getString("regdate");
String id = rs.getString("id");
int star = rs.getInt("star");
int rvcnt = rs.getInt("rvcnt");
int ref = rs.getInt("ref");
int lev = rs.getInt("lev");
int step = rs.getInt("step");
//new BoardReviewVo(rv_num, title, content, regdate, hit, star, savename, id, item_name, rvcnt)
list.add(new BoardReviewVo(rv_num, title, content, regdate, 0, star, null, id, null, rvcnt, ref, lev, step));
};
return list;
} catch (SQLException e) {
e.printStackTrace();
return null;
} finally {
DbcpBean.closeConn(con, pstmt, rs);
}
}
public int fillupReview(BoardReviewVo vo) {
Connection con = null;
PreparedStatement pstmt1 = null;
PreparedStatement pstmt2 = null;
try {
con = DbcpBean.getConn();
String sql = "UPDATE REVIEW SET STEP=STEP+1 WHERE REF=? AND STEP>?";
pstmt1 = con.prepareStatement(sql);
pstmt1.setInt(1, vo.getRef());
pstmt1.setInt(2, vo.getStep());
pstmt1.executeUpdate();
int lev = vo.getLev()+1;
int step = vo.getStep()+1;
sql = "INSERT INTO REVIEW VALUES(REVIEW_SEQ.NEXTVAL,10000,?,?,SYSDATE,0,?,?,?,5,?,NULL)";
pstmt2 = con.prepareStatement(sql);
pstmt2.setString(1, vo.getTitle());
pstmt2.setString(2, vo.getContent());
pstmt2.setInt(3, vo.getRef());
pstmt2.setInt(4, lev);
pstmt2.setInt(5, step);
pstmt2.setString(6, vo.getPwd());
return pstmt2.executeUpdate();
}catch(SQLException se) {
System.out.println(se.getMessage());
return -1;
}finally {
DbcpBean.closeConn(null,pstmt1,null);
DbcpBean.closeConn(con, pstmt2, null);
}
}
}
| [
"zazuuka@gmail.com"
] | zazuuka@gmail.com |
b1e4adaba2a43d1234f5ebc53f92421221a6e542 | e754709fb9ee4f5ce28345b193ce1623f85579f9 | /src/cn/jsoup/JsoupTest.java | 852d60481d7957e0934223e7b4cfe5e26fe017f4 | [] | no_license | bjll/jsoup | c489fe20dc98b953d1ec36b799231dad9bbe8521 | 7d1f527b1f944b54f535df4562a4a5a8667a1826 | refs/heads/master | 2020-03-23T02:03:48.808000 | 2018-09-08T07:09:45 | 2018-09-08T07:09:45 | 140,953,943 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,772 | java | package cn.jsoup;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
/**
* 这是用知乎为例进行 测试的
* @author Chris
*
*/
public class JsoupTest {
public static void main(String[] args) throws IOException {
String s = null;
//assert s!=null?true:false;
assert false;
System.out.println("end");
/* try {
//获取编辑推荐页
Document document=Jsoup.connect("https://www.zhihu.com/explore/recommendations")
//模拟火狐浏览器
.userAgent("Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36")
.get();
Element main=document.getElementById("zh-recommend-list-full");
Elements es= main.select("div.zh-general-list");
for(Element e:es){
for(Element el:e.select("h2 > a[href]")){
System.err.println(el.attr("abs:href")); //在这里加入abs 选项是为了获取绝对路径
//这里就可以把得到的数据及进行处理
System.err.println(el.text());
}
}
// 提取易佰教程的 图片
Document doc = Jsoup.connect("http://www.yiibai.com").get();
Elements images = doc.select("img[src~=(?i)\\.(png|jpe?g|gif)]");
for (Element image : images) {
System.out.println("src : " + image.attr("src"));
System.out.println("height : " + image.attr("height"));
System.out.println("width : " + image.attr("width"));
System.out.println("alt : " + image.attr("alt"));
}
} catch (Exception e) {
e.printStackTrace();
} */
}
}
| [
"lil@dsgdata.com"
] | lil@dsgdata.com |
6057bd70875b28128136b7872da36e455b017c67 | 677b9e6c042ca6cf3657e3a7fea28bf344552d7e | /distributed-tx-sample-app-producer/src/main/java/com/github/distributed/tx/sample/app/producer/domain/User.java | 73301ae07297b027102faaf3aaf79121f067280c | [] | no_license | wanghui0101/distributed-tx-sample | 2deeee248a3ccd453618870c70fc7781c59b80d0 | e488e73a1f77694c1d4d9b8694a0c0f15f284997 | refs/heads/master | 2020-06-28T23:02:16.087000 | 2016-11-22T10:24:36 | 2016-11-22T10:24:36 | 74,460,836 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 523 | java | package com.github.distributed.tx.sample.app.producer.domain;
import java.sql.Timestamp;
public class User {
private String id;
private String name;
private Timestamp createAt;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Timestamp getCreateAt() {
return createAt;
}
public void setCreateAt(Timestamp createAt) {
this.createAt = createAt;
}
}
| [
"wanghui.tj.1987@gmail.com"
] | wanghui.tj.1987@gmail.com |
5949f165676becd25d232c66dd6e0abe168795f6 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/19/19_5fb2f00edba1f1f7c2c7a63a283131ac855da05a/WebFeatureServiceLayerTest2/19_5fb2f00edba1f1f7c2c7a63a283131ac855da05a_WebFeatureServiceLayerTest2_s.java | 55960d66c175c3d9cf7d37e3ff82decb7a336a89 | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516000 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 4,749 | java | package org.vaadin.vol.demo;
import org.vaadin.vol.AbstractAutoPopulatedVectorLayer.BeforeFeatureSelectedEvent;
import org.vaadin.vol.AbstractAutoPopulatedVectorLayer.BeforeFeatureSelectedListener;
import org.vaadin.vol.OpenLayersMap;
import org.vaadin.vol.OpenStreetMapLayer;
import org.vaadin.vol.Style;
import org.vaadin.vol.StyleMap;
import org.vaadin.vol.WebFeatureServiceLayer;
import com.vaadin.ui.Component;
/**
* Loads different feature types from a wfs use beforefeature select event
* to show messages.
* TODO - only the last added Listener catch the mouse clicks, seems to be a bug
* in mouse click handling
*/
public class WebFeatureServiceLayerTest2 extends AbstractVOLTest {
@Override
public String getDescription() {
return "Just another WFS example. Shows reclickable feature, and btw you can click on all layers :-D";
}
private WebFeatureServiceLayer createWfsLayer(String displayName,
String proxyUrl, String featureType) {
WebFeatureServiceLayer wfsLayer = new WebFeatureServiceLayer();
wfsLayer.setDisplayName(displayName);
wfsLayer.setUri(proxyUrl);
wfsLayer.setFeatureType(featureType);
wfsLayer.setFeatureNS("http://www.openplans.org/topp");
wfsLayer.setProjection("EPSG:4326");
wfsLayer.setSelectionCtrlId("1");
return wfsLayer;
}
private void setStyle(WebFeatureServiceLayer wfs, double opacity,
String fillColor, String strokeColor, double pointRadius,
double strokeWidth) {
Style style = new Style();
style.extendCoreStyle("default");
style.setFillColor(fillColor);
style.setStrokeColor(strokeColor);
style.setStrokeWidth(strokeWidth);
style.setPointRadius(pointRadius);
style.setFillOpacity(opacity);
StyleMap styleMap = new StyleMap(style);
styleMap.setExtendDefault(true);
wfs.setStyleMap(styleMap);
}
@Override
Component getMap() {
OpenLayersMap openLayersMap = new OpenLayersMap();
OpenStreetMapLayer osmLayer = new OpenStreetMapLayer();
osmLayer.setUrl("http://b.tile.openstreetmap.org/${z}/${x}/${y}.png");
osmLayer.setDisplayName("OSM");
String proxyUrl = getApplication().getURL()
+ "../WFSPROXY/demo.opengeo.org/geoserver/wfs";
WebFeatureServiceLayer wfsCities = createWfsLayer("Cities", proxyUrl,
"tasmania_cities");
setStyle(wfsCities, 1, "yellow", "red", 4, 2);
wfsCities.addListener(new BeforeFeatureSelectedListener() {
public boolean beforeFeatureSelected(BeforeFeatureSelectedEvent event) {
showNotification("I'm a city");
return false;
}
});
final WebFeatureServiceLayer wfsRoads = createWfsLayer("Roads", proxyUrl,
"tasmania_roads");
setStyle(wfsRoads, 1, "gray", "gray", 0, 4);
// don't use beforeselected and selected listener at the same time to show massages
wfsRoads.addListener(new BeforeFeatureSelectedListener() {
public boolean beforeFeatureSelected(BeforeFeatureSelectedEvent event) {
Object typeName = event.getAttributes().get("TYPE");
showNotification("Before feature Selected: Road type: " + typeName);
return false;
}
});
WebFeatureServiceLayer wfsBoundaries = createWfsLayer("Boundaries",
proxyUrl, "tasmania_state_boundaries");
wfsBoundaries.addListener(new BeforeFeatureSelectedListener() {
public boolean beforeFeatureSelected(BeforeFeatureSelectedEvent event) {
showNotification("No idea what I am :'-(");
return false;
}
});
WebFeatureServiceLayer wfsWater = createWfsLayer("Water", proxyUrl,
"tasmania_water_bodies");
setStyle(wfsWater, 0.5, "blue", "blue", 1, 2);
wfsWater.addListener(new BeforeFeatureSelectedListener() {
public boolean beforeFeatureSelected(BeforeFeatureSelectedEvent event) {
showNotification("I am water :-D");
return false;
}
});
openLayersMap.addLayer(osmLayer);
openLayersMap.addLayer(wfsCities);
openLayersMap.addLayer(wfsRoads);
openLayersMap.addLayer(wfsWater);
openLayersMap.addLayer(wfsBoundaries);
openLayersMap.setSizeFull();
openLayersMap.setCenter(146.9417, -42.0429);
openLayersMap.setZoom(7);
return openLayersMap;
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
f1e14409c7f916ceede88be09390e40b1f6bce12 | 9f2f167179223f97505a8ceaee073c2acefbb6d1 | /account-common/src/main/java/top/liuliyong/account/common/util/MD5Encoder.java | ecd9d1f82774c1488cce7f227c7d2e292d784816 | [] | no_license | ironfish1997/DocTool_account_server | f9915b00ebb48d48671b0867fd3cafc557554a56 | 0845ffc56e738d4fa8fd52bf4c84fddd954c14c1 | refs/heads/master | 2020-05-07T08:18:57.947000 | 2019-05-13T08:01:30 | 2019-05-13T08:01:30 | 180,320,524 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,275 | java | package top.liuliyong.account.common.util;
import java.math.BigInteger;
import java.security.MessageDigest;
/**
* @Author liyong.liu
* @Date 2019/3/21
**/
public class MD5Encoder {
public static String getMD5(String c_password) {
try {
// 生成一个MD5加密计算摘要
MessageDigest md = MessageDigest.getInstance("MD5");
// 调用update方法计算MD5函数(参数:将密码串转换为操作系统的字节编码)
md.update(c_password.getBytes());
// digest()最后返回md5的hash值,返回值为8位的字符串,但此方法要先调用update
// BigInteger函数则将8位的字符串转换成16位hex值,用字符串来表示;得到字符串形式的hash值,数值从1开始
// BigInteger会把0省略掉,需补全至32位,重写一个方法将16位数转换为32位数
String md5 = new BigInteger(1, md.digest()).toString(16);
return fillMD5(md5);
} catch (Exception e) {
throw new RuntimeException("MD5加密错误:" + e.getMessage(), e);
}
}
// 将16位数转为32位
public static String fillMD5(String md5) {
return md5.length() == 32 ? md5 : fillMD5("0" + md5);
}
}
| [
"1481980097@qq.com"
] | 1481980097@qq.com |
2e7c44ee32f309e2f3100f26922eafae928f0bd5 | d44c621cc456ab6eddbea73aa1088be7e0d9b038 | /app/src/main/java/com/dragoneye/wjjt/activity/base/ImageMulSelectedActivity.java | a6407e117ad9401807cd25929e156f7673dc1a95 | [] | no_license | l1000965431/moneyclient | fcbfd80e10b271b5d7a95125b3fdda76511f29ee | 102b8b065d710e32cfa2a8cbfb1ab4b946fd8347 | refs/heads/master | 2020-04-12T22:38:44.941000 | 2016-01-28T08:10:53 | 2016-01-28T08:10:53 | 41,911,488 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,993 | java | package com.dragoneye.wjjt.activity.base;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.CheckBox;
import android.widget.GridView;
import android.widget.ImageView;
import com.dragoneye.wjjt.R;
import com.dragoneye.wjjt.tool.ToolMaster;
import com.nostra13.universalimageloader.core.DisplayImageOptions;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.nostra13.universalimageloader.core.assist.ImageScaleType;
import java.io.File;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
public class ImageMulSelectedActivity extends ActionBarActivity {
public static String RESULT_IMAGE_PATH_ARRAY = "RESULT_IMAGE_PATH_ARRAY";
private GridView mGridView;
ArrayList<String> mDataArrays;
ImageSelectAdapter mAdapter;
HashSet<Integer> mSelectedImageIndex;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_image_select);
initView();
initData();
getAllImagesFromGallery();
}
private void initView(){
mGridView = (GridView)findViewById(R.id.image_select_main_grid_view);
}
private void initData(){
mSelectedImageIndex = new HashSet<>();
mDataArrays = new ArrayList<>();
mAdapter = new ImageSelectAdapter(this, mDataArrays);
mGridView.setAdapter(mAdapter);
}
private void getAllImagesFromGallery(){
mDataArrays.clear();
mDataArrays.addAll(ToolMaster.getAllShownImagesPath(this));
mAdapter.notifyDataSetChanged();
}
@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_image_select, 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.menu_image_select_finish) {
ArrayList<String> strings = new ArrayList<>();
for( Integer index : mSelectedImageIndex ){
strings.add( mDataArrays.get(index) );
}
Intent intent = new Intent();
intent.putStringArrayListExtra(RESULT_IMAGE_PATH_ARRAY, strings);
setResult( RESULT_OK, intent );
finish();
return true;
}
return super.onOptionsItemSelected(item);
}
public class ImageSelectAdapter extends BaseAdapter {
private List<String> data;
private Context context;
private LayoutInflater mInflater;
public ImageSelectAdapter(Context context, List<String> data){
this.context = context;
this.data = data;
mInflater = LayoutInflater.from(context);
}
@Override
public int getCount(){
return data.size();
}
@Override
public Object getItem(int position){
return data.get(position);
}
@Override
public long getItemId(int position){
return position;
}
@Override
public int getItemViewType(int position){
return 0;
}
@Override
public int getViewTypeCount(){
return 1;
}
@Override
public View getView(final int position, View convertView, ViewGroup parent){
// GalleryImage galleryImage = (GalleryImage)getItem(position);
String imagePath = (String)getItem(position);
ViewHolder viewHolder;
if(convertView == null){
viewHolder = new ViewHolder();
convertView = mInflater.inflate(R.layout.function_gallery_upload_grid_view_item_image, parent, false);
viewHolder.ivImage = (ImageView)convertView.findViewById(R.id.function_gallery_upload_grid_view_item_image_image);
viewHolder.ckSelected = (CheckBox)convertView.findViewById(R.id.function_gallery_upload_grid_view_item_image_check_box);
viewHolder.ckSelected.setVisibility(View.VISIBLE);
viewHolder.ckSelected.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(mSelectedImageIndex.contains(position)){
mSelectedImageIndex.remove(position);
}else {
mSelectedImageIndex.add(position);
}
}
});
convertView.setTag(viewHolder);
}else{
viewHolder = (ViewHolder)convertView.getTag();
}
viewHolder.ckSelected.setChecked( mSelectedImageIndex.contains(position) );
DisplayImageOptions options;
options = new DisplayImageOptions.Builder()
.showImageOnLoading(R.mipmap.icon_albums)
.imageScaleType(ImageScaleType.EXACTLY)
.build();
ImageLoader.getInstance().displayImage(Uri.fromFile(new File(imagePath)).toString(),
viewHolder.ivImage, options);
return convertView;
}
private class ViewHolder{
public ImageView ivImage;
public CheckBox ckSelected;
}
}
}
| [
"510424705@qq.com"
] | 510424705@qq.com |
aeb30d6c7eca899e68cc5aa58e7e6ea2943501b3 | 847015a24c701bb945ee72f9e1b6fc6ccc131ebf | /src/main/java/io/mrshannon/hexmek/views/MovementTypeSelectView.java | 1b4d5ff3a5923997253a7e0d762f6493182392d1 | [] | no_license | mrshannon/hexmek | 68eee00b4dc8746bf77e4c81f26bdac0ef2a483c | 5d7d91199d44413465baac8a9b624af96f46e939 | refs/heads/master | 2020-03-31T06:35:54.101000 | 2018-11-29T04:38:53 | 2018-11-29T04:38:53 | 151,988,022 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,563 | java | package io.mrshannon.hexmek.views;
import io.mrshannon.hexmek.models.Mech;
import io.mrshannon.hexmek.models.Unit;
/**
* Movement type select view, allows the user to select the type of movement.
*/
public class MovementTypeSelectView implements View {
private Unit unit;
/**
* Create the view.
*
* @param unit unit to display movement options for
*/
public MovementTypeSelectView(Unit unit) {
this.unit = unit;
}
/**
* Render the view
*/
@Override
public void render() {
System.out.println();
System.out.println(" halt = do not move at all");
if (unit instanceof Mech) {
printMechChoices();
} else {
printVehicleChoices();
}
System.out.println();
printPrompt();
}
/**
* Print mech movement choices.
*/
private void printMechChoices() {
System.out.printf(" walk = %d MP (+1 gunnery)\n", unit.getCruiseMovementPoints());
System.out.printf(" run = %d MP (+2 gunnery)\n", unit.getFlankMovementPoints());
}
/**
* Print vehicle movement choices.
*/
private void printVehicleChoices() {
System.out.printf(" cruise = %d MP (+1 gunnery)\n", unit.getCruiseMovementPoints());
System.out.printf(" flank = %d MP (+2 gunnery)\n", unit.getFlankMovementPoints());
}
/**
* Print the movement type prompt.
*/
private void printPrompt() {
System.out.print("Select movement type: ");
}
}
| [
"mrshannon.aerospace@gmail.com"
] | mrshannon.aerospace@gmail.com |
adabfd1885e85ed1faaace5d81db35fc512985ca | fe01eb4c8e016a3ab78ff8ac9203cc3f15b6d7f3 | /src/test/java/com/dnliu/pdms/PdmsApplicationTests.java | 045a63513cba5c94820e5051bfdf896ffd45cf59 | [] | no_license | ncdxliu/pdms | d54086b2074ac83ed5ca3101ec623fdd8b7d3b1c | 872b9e2ea4a6374ff63199afe92bcf944c5e9b2f | refs/heads/master | 2022-09-13T08:47:54.541000 | 2022-09-02T13:39:36 | 2022-09-02T13:39:36 | 405,641,164 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 204 | java | package com.dnliu.pdms;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class PdmsApplicationTests {
@Test
void contextLoads() {
}
}
| [
""
] | |
d22c2239911fe4e0fb06b19ccf1ff3a0634d7ac6 | 6b349b5c1a63676eb6737cfaa433d8cf11b420d7 | /src/main/java/spider/util/Translator.java | 53ecf5b5018b6bf0c4f5b02cfe058a6f2b461214 | [
"Apache-2.0"
] | permissive | Sicmatr1x/ZhiHuSpider | 29c94851ef87efd5372ede8c4d06f61c53e6c41c | 469535de4869b029fe2803520f3026b0fba1b683 | refs/heads/master | 2022-09-17T20:36:06.036000 | 2019-05-10T07:50:12 | 2019-05-10T07:50:12 | 164,087,345 | 0 | 0 | Apache-2.0 | 2022-09-01T23:01:12 | 2019-01-04T09:31:20 | Java | UTF-8 | Java | false | false | 126 | java | package spider.util;
import org.jsoup.nodes.Element;
public interface Translator {
Element translate(Element element);
}
| [
"joe.guo@oocl.com"
] | joe.guo@oocl.com |
b5a94a97a13de22ef7f588bd0d9cda0bf1fc1ae6 | 4ac0cefcfb5b8233bfc3d771a701fe415cd34807 | /.metadata/.plugins/org.eclipse.wst.server.core/tmp0/work/Catalina/localhost/teamW1/org/apache/jsp/index_jsp.java | 40a112bb721fac22148f68489e721e99fcfd2a32 | [] | no_license | eunb94/wego1 | 01ce7391b7845539125f8a3a782bc54c8a0d6f77 | 8b6aab6338664538b358dfa3c7a68d8481dbc3df | refs/heads/master | 2020-08-09T14:55:50.985000 | 2019-10-07T11:44:47 | 2019-10-07T11:44:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,039 | java | /*
* Generated by the Jasper component of Apache Tomcat
* Version: Apache Tomcat/9.0.24
* Generated at: 2019-10-07 11:28:17 UTC
* Note: The last modified time of this file was set to
* the last modified time of the source file after
* generation to assist with modification tracking.
*/
package org.apache.jsp;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
public final class index_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent,
org.apache.jasper.runtime.JspSourceImports {
private static final javax.servlet.jsp.JspFactory _jspxFactory =
javax.servlet.jsp.JspFactory.getDefaultFactory();
private static java.util.Map<java.lang.String,java.lang.Long> _jspx_dependants;
private static final java.util.Set<java.lang.String> _jspx_imports_packages;
private static final java.util.Set<java.lang.String> _jspx_imports_classes;
static {
_jspx_imports_packages = new java.util.HashSet<>();
_jspx_imports_packages.add("javax.servlet");
_jspx_imports_packages.add("javax.servlet.http");
_jspx_imports_packages.add("javax.servlet.jsp");
_jspx_imports_classes = null;
}
private volatile javax.el.ExpressionFactory _el_expressionfactory;
private volatile org.apache.tomcat.InstanceManager _jsp_instancemanager;
public java.util.Map<java.lang.String,java.lang.Long> getDependants() {
return _jspx_dependants;
}
public java.util.Set<java.lang.String> getPackageImports() {
return _jspx_imports_packages;
}
public java.util.Set<java.lang.String> getClassImports() {
return _jspx_imports_classes;
}
public javax.el.ExpressionFactory _jsp_getExpressionFactory() {
if (_el_expressionfactory == null) {
synchronized (this) {
if (_el_expressionfactory == null) {
_el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory();
}
}
}
return _el_expressionfactory;
}
public org.apache.tomcat.InstanceManager _jsp_getInstanceManager() {
if (_jsp_instancemanager == null) {
synchronized (this) {
if (_jsp_instancemanager == null) {
_jsp_instancemanager = org.apache.jasper.runtime.InstanceManagerFactory.getInstanceManager(getServletConfig());
}
}
}
return _jsp_instancemanager;
}
public void _jspInit() {
}
public void _jspDestroy() {
}
public void _jspService(final javax.servlet.http.HttpServletRequest request, final javax.servlet.http.HttpServletResponse response)
throws java.io.IOException, javax.servlet.ServletException {
if (!javax.servlet.DispatcherType.ERROR.equals(request.getDispatcherType())) {
final java.lang.String _jspx_method = request.getMethod();
if ("OPTIONS".equals(_jspx_method)) {
response.setHeader("Allow","GET, HEAD, POST, OPTIONS");
return;
}
if (!"GET".equals(_jspx_method) && !"POST".equals(_jspx_method) && !"HEAD".equals(_jspx_method)) {
response.setHeader("Allow","GET, HEAD, POST, OPTIONS");
response.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED, "JSP들은 오직 GET, POST 또는 HEAD 메소드만을 허용합니다. Jasper는 OPTIONS 메소드 또한 허용합니다.");
return;
}
}
final javax.servlet.jsp.PageContext pageContext;
javax.servlet.http.HttpSession session = null;
final javax.servlet.ServletContext application;
final javax.servlet.ServletConfig config;
javax.servlet.jsp.JspWriter out = null;
final java.lang.Object page = this;
javax.servlet.jsp.JspWriter _jspx_out = null;
javax.servlet.jsp.PageContext _jspx_page_context = null;
try {
response.setContentType("text/html; charset=UTF-8");
pageContext = _jspxFactory.getPageContext(this, request, response,
null, true, 8192, true);
_jspx_page_context = pageContext;
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out = out;
out.write("\r\n");
out.write("\r\n");
out.write("<script>\r\n");
out.write("location.assign('");
out.print(request.getContextPath());
out.write("/facade.do')\r\n");
out.write("</script>");
} catch (java.lang.Throwable t) {
if (!(t instanceof javax.servlet.jsp.SkipPageException)){
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
try {
if (response.isCommitted()) {
out.flush();
} else {
out.clearBuffer();
}
} catch (java.io.IOException e) {}
if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
else throw new ServletException(t);
}
} finally {
_jspxFactory.releasePageContext(_jspx_page_context);
}
}
}
| [
"hamuseco@gmail.com"
] | hamuseco@gmail.com |
bfd756b7d665bd606fc71cab0604e54153a91afb | 8cefcd801f8e9b69a93edbd1f75d99f77171c303 | /src/cn/year2019/thread/obj/ObjectMethodTest.java | 92283e6a6bc323343608b558dbdf2663f84d4008 | [
"MIT"
] | permissive | chywx/JavaSE-chy | 3219fe50df03ee1efb5dbdf26d3ea11d76929ee4 | 3f8ac7eaf2a1d87745f6eea996cf72f73450b05e | refs/heads/master | 2023-04-30T21:12:25.172000 | 2023-04-21T02:18:19 | 2023-04-21T02:18:19 | 166,914,146 | 5 | 4 | null | 2021-10-09T02:12:11 | 2019-01-22T02:35:30 | Java | UTF-8 | Java | false | false | 515 | java | package cn.year2019.thread.obj;
import org.junit.Test;
/**
* 功能描述
*
* @author chy
* @date 2019/11/28 0028
*/
public class ObjectMethodTest {
private static Object obj = new Object();
public static void main(String[] args) {
}
@Test
public void test1(){
Object o = new Object();
synchronized (obj){
try {
o.wait();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}
| [
"1559843332@qq.com"
] | 1559843332@qq.com |
2e95d371f2cfb7e5967ada253759b42dcbca4f0e | 13f02196ebc7ae1718788949bb25d582f0c9e68f | /src/com/ii/gis/mstalgorithms/AlgorithmFactory/KruskalAlgorithm.java | 2190486f555704de6c6ecd1316a50b0c070f6722 | [] | no_license | rj90/MSTAlgorithms | 3151cfab5bf9f204bbb685e320a68dec79c20f72 | 3fa7b99a6341b9ef97aebd7203a143b93f775fdd | refs/heads/master | 2021-01-01T18:29:20.995000 | 2014-12-27T15:53:54 | 2014-12-27T15:53:54 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,081 | java | package com.ii.gis.mstalgorithms.AlgorithmFactory;
import java.util.LinkedList;
import com.ii.gis.mstalgorithms.Graph.Graph;
import com.ii.gis.mstalgorithms.Graph.Graph.Edge;
import com.ii.gis.mstalgorithms.Graph.Tree;
public class KruskalAlgorithm extends MSTAlgorithm{
public KruskalAlgorithm(Graph graph) {
super(graph);
}
public KruskalAlgorithm() {
}
@Override
public void solve() {
sortEdges();
LinkedList<Tree> trees = prepareTrees();
while (trees.size()!=1){
Edge e = graph.getEdges().get(0);
LinkedList<Tree> toMerge = getTreeList(trees, e);
if(toMerge.get(0)!=toMerge.get(1)){
addLog(e.toString());
mergeTree(trees, toMerge.get(0), toMerge.get(1), e);
}
graph.getEdges().remove(0);
}
}
private LinkedList<Tree> getTreeList(LinkedList<Tree> trees, Edge e) {
LinkedList<Tree> toMerge = new LinkedList<Tree>();
for (Tree t : trees)
for (String s : t.getNodes()){
if (s.equals(e.getFirst()) || s.equals(e.getSecond()))
toMerge.add(t);
if (toMerge.size()==2)
return toMerge;
}
return null;
}
}
| [
"R.Jozwiak1@gmail.com"
] | R.Jozwiak1@gmail.com |
dcbdb1b74d77decff18f482c0d5e9e80942d2dfb | b8d93b491298e08a6f9834e7da9ad17c5f431af0 | /src/main/java/com/chlebek/library/Model/Form/UserForm.java | f9e8f989db418442533c64e171276ecb5b239ac8 | [] | no_license | chlebek-tomasz/library | 3c81b8cc395c364e2c1eda47e360e2c2ef63b575 | a0f3425056ddaadd1b0110490fa245c4cb374412 | refs/heads/master | 2022-08-27T21:18:38.305000 | 2020-05-27T19:01:21 | 2020-05-27T19:01:21 | 267,403,112 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,200 | java | package com.chlebek.library.Model.Form;
public class UserForm {
private String username;
private String email;
private String password;
private String passwordMatches;
private String firstName;
private String lastName;
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
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 getPasswordMatches() {
return passwordMatches;
}
public void setPasswordMatches(String passwordMatches) {
this.passwordMatches = passwordMatches;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
}
| [
"tom123ek@gmail.com"
] | tom123ek@gmail.com |
cbca09d4e5ceab7d624968491f77b59bc4aa15ca | bfffbc44cadb95342208b8cf5290dd04cd5a53b2 | /src/main/java/com/forgerock/openicf/xml/query/FunctionQuery.java | 218fc8f8f9051c3a7bd5f1c06c289c5071dc9645 | [] | no_license | ForgeRock/openicf-xml-connector-community-edition | 89f2e85cbdfcceb5cce89727eda353cb9edd80b8 | ce61a22b7597c1d695bac3126b0b1c530b39045f | refs/heads/fr/1.1.0.0 | 2023-01-24T07:07:29.583000 | 2017-04-03T17:55:56 | 2017-04-03T17:55:56 | 86,855,822 | 0 | 0 | null | 2023-01-23T10:33:34 | 2017-03-31T20:00:20 | Java | UTF-8 | Java | false | false | 2,350 | java | /*
*
* Copyright (c) 2010 ForgeRock Inc. All Rights Reserved
*
* The contents of this file are subject to the terms
* of the Common Development and Distribution License
* (the License). You may not use this file except in
* compliance with the License.
*
* You can obtain a copy of the License at
* http://www.opensource.org/licenses/cddl1.php or
* OpenIDM/legal/CDDLv1.0.txt
* See the License for the specific language governing
* permission and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* Header Notice in each file and include the License file
* at OpenIDM/legal/CDDLv1.0.txt.
* If applicable, add the following below the CDDL Header,
* with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted 2010 [name of copyright owner]"
*
* $Id$
*/
package com.forgerock.openicf.xml.query;
import com.forgerock.openicf.xml.query.abstracts.QueryPart;
public class FunctionQuery implements QueryPart {
private String [] args;
private String function;
private boolean not;
public FunctionQuery(String [] args, String function, boolean not) {
this.args = args;
this.function = function;
this.not = not;
}
// creates function-expression.
// all args have to be prefixed with $x/, '', etc
@Override
public String getExpression() {
if (not) {
return createFalseExpression();
}
else {
return createTrueExpression();
}
}
private String createTrueExpression() {
StringBuilder sb = new StringBuilder();
sb.append("fn:");
sb.append(this.function);
sb.append("(");
addArgs(sb);
sb.append(")");
return sb.toString();
}
private String createFalseExpression() {
StringBuilder sb = new StringBuilder();
sb.append("fn:");
sb.append("not(");
sb.append(this.function);
sb.append("(");
addArgs(sb);
sb.append("))");
return sb.toString();
}
private void addArgs(StringBuilder sb) {
// add args to function
for (int i = 0; i < args.length; i++) {
sb.append(args[i]);
if (i < args.length-1)
sb.append(", ");
}
}
} | [
"Laszlo.Hordos@forgerock.com"
] | Laszlo.Hordos@forgerock.com |
4e026c7c1d96387aab4abc16c82f661bc1ec3216 | 89fa2ee94b557bc38e39d152084a9856ae147dde | /src/main/java/org/kyojo/gson/internal/bind/TimeTypeAdapter.java | 6eb8a1ade16464c35b7abeaba0e3bc1e9136ebcd | [
"Apache-2.0"
] | permissive | nagaikenshin/minion | 1652816d73e9054765ffe4c4ef0cd9eb8b0d4150 | a89e3f62a0a0b4f182e55e649632dda7a65d3768 | refs/heads/master | 2020-03-17T22:39:05.442000 | 2018-12-03T09:39:06 | 2018-12-03T09:39:06 | 134,013,298 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,997 | java | /*
* Copyright 2017 NAGAI Kenshin
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* Copyright (C) 2011 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.kyojo.gson.internal.bind;
import org.kyojo.gson.Gson;
import org.kyojo.gson.JsonSyntaxException;
import org.kyojo.gson.TypeAdapter;
import org.kyojo.gson.TypeAdapterFactory;
import org.kyojo.gson.reflect.TypeToken;
import org.kyojo.gson.stream.JsonReader;
import org.kyojo.gson.stream.JsonToken;
import org.kyojo.gson.stream.JsonWriter;
import java.io.IOException;
import java.sql.Time;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
/**
* Adapter for Time. Although this class appears stateless, it is not.
* DateFormat captures its time zone and locale when it is created, which gives
* this class state. DateFormat isn't thread safe either, so this class has
* to synchronize its read and write methods.
*/
public final class TimeTypeAdapter extends TypeAdapter<Time> {
public static final TypeAdapterFactory FACTORY = new TypeAdapterFactory() {
@SuppressWarnings("unchecked") // we use a runtime check to make sure the 'T's equal
@Override public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> typeToken) {
return typeToken.getRawType() == Time.class ? (TypeAdapter<T>) new TimeTypeAdapter() : null;
}
};
private final DateFormat format = new SimpleDateFormat("hh:mm:ss a");
@Override public synchronized Time read(JsonReader in) throws IOException {
if (in.peek() == JsonToken.NULL) {
in.nextNull();
return null;
}
try {
Date date = format.parse(in.nextString());
return new Time(date.getTime());
} catch (ParseException e) {
throw new JsonSyntaxException(e);
}
}
@Override public synchronized void write(JsonWriter out, Time value) throws IOException {
out.value(value == null ? null : format.format(value));
}
}
| [
"nagai@nagaikenshin.com"
] | nagai@nagaikenshin.com |
d9a4122625d4bb3f1bdf8829d8792f4b8b37de4d | a8d2d505295c6a60c7100d91a358242c23408a68 | /src/com/cloudlewis/leetcode50/GenerateParentheses22.java | 7ea6537c3f4a1cb18abe805bae5433d3c4e92c7e | [] | no_license | liuxiao/LeetCodeExcercises | c4c252db956f535cf382907dbddcb635cad46061 | bae6502259a2612749b630ae3f0b601bd6f27896 | refs/heads/master | 2021-04-28T02:56:40.843000 | 2018-02-19T22:33:45 | 2018-02-19T22:33:45 | 122,127,866 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,142 | java | package com.cloudlewis.leetcode50;
import java.util.ArrayList;
import java.util.List;
/**
* Given n pairs of parentheses, write a function to generate all combinations
* of well-formed parentheses.
*
* For example, given n = 3, a solution set is:
*
* @formatter:off
*[
* "((()))",
* "(()())",
* "(())()",
* "()(())",
* "()()()"
*]
*
*@formatter:on
*
* @author xiao
*
*/
// tried to use iterative, but failed; hard to control the closing bracket
// switch to use recursive
public class GenerateParentheses22 {
public List<String> generateParenthesis(int n) {
List<String> rs = new ArrayList<String>();
generateParenthesis(rs, "", 0, 0, n);
return rs;
}
//backtracing
private void generateParenthesis(List<String> list, String s, int f, int b, int n) {
if (s.length() == n + n) {
list.add(s);
return;
}
if (f < n)
generateParenthesis(list, s + "(", f +1, b, n);
if (b < f)
generateParenthesis(list, s + ")", f, b+1, n);
}
public static void main(String[] args) {
GenerateParentheses22 t = new GenerateParentheses22();
System.out.println(t.generateParenthesis(3));
}
}
| [
"liu.xiao1988@gmail.com"
] | liu.xiao1988@gmail.com |
End of preview. Expand
in Dataset Viewer.
README.md exists but content is empty.
- Downloads last month
- 65