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.210754 | 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.331679 | 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.675295 | 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.525859 | 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.058223 | 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.252924 | 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.319360 | 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.187272 | 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.769218 | 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.562575 | 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.838260 | 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.016102 | 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.023759 | 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.496376 | 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.500050 | 2022-10-06T05:38:49 | 2022-10-06T05:38:49 | 233,979,996 | 2 | 2 | null | 2022-10-06T05:41:46 | 2020-01-15T02:24:16 | Java | UTF-8 | Java | false | false | 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.940614 | 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.023888 | 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.878314 | 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.787544 | 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.389234 | 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.439106 | 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.548554 | 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.201996 | 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.947207 | 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.631426 | 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.072429 | 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.150521 | 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.500907 | 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.642586 | 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.915715 | 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.015986 | 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.129639 | 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.388914 | 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.592861 | 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.836824 | 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.994928 | 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.575567 | 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.227897 | 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.755934 | 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.606717 | 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.028514 | 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.278686 | 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.084651 | 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.557254 | 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.070970 | 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.808068 | 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.087945 | 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.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 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.947931 | 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.941612 | 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.101719 | 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.541204 | 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.036297 | 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.985863 | 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.172175 | 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.995879 | 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.305407 | 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.583737 | 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.442129 | 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.843125 | 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 |
6c9212295ab2c6d539554509d182e8a5b4149dc6 | e28a84d2bbf42ee6f4c4316914cef5c7a5df4bca | /src/test/java/io/lightningbug/domain/CodeInfoTest.java | 7d6158783fd1fa3bc5f15e222693168af5a67fe8 | [
"MIT"
] | permissive | lightningbug-io/lightningbug-maven-plugin | 6f3d8ad0ba5fd7c9b777923d13d989c35b73d178 | 9945b17e3212e779a91e57158efb2742bd78c15f | refs/heads/master | 2023-08-02T11:10:39.436416 | 2021-01-12T22:19:00 | 2021-01-12T22:19:00 | 238,044,387 | 0 | 0 | MIT | 2023-07-21T15:49:59 | 2020-02-03T19:30:01 | Java | UTF-8 | Java | false | false | 4,149 | java | package io.lightningbug.domain;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.mock;
import org.junit.Assert;
import org.junit.Test;
/**
* @author Mike Krolak
* @since 1.0
*/
public class CodeInfoTest {
@Test(expected = IllegalArgumentException.class)
public void createNewCodeInfoWithNull() {
new CodeInfo(null);
Assert.fail();
}
@Test(expected = IllegalArgumentException.class)
public void createNewCodeInfoWithEmpty() {
new CodeInfo("");
Assert.fail();
}
@Test
public void testCreateNewCodeNonEmpty() {
CodeInfo ci = new CodeInfo("test");
Assert.assertNotNull(ci);
}
@Test(expected = IllegalArgumentException.class)
public void testAddContributorNull() {
CodeInfo ci = new CodeInfo("test");
ci.addContributor(null);
Assert.fail();
}
@Test
public void testAddContributor() {
ContributorInfo contributor = mock(ContributorInfo.class);
CodeInfo ci = new CodeInfo("test");
assertTrue(ci.addContributor(contributor));
Assert.assertEquals(ci.getCurrentContributors().size(), 1);
}
@Test
public void testAddContributorTwice() {
ContributorInfo contributor = mock(ContributorInfo.class);
CodeInfo ci = new CodeInfo("test");
assertTrue(ci.addContributor(contributor));
assertFalse(ci.addContributor(contributor));
Assert.assertEquals(ci.getCurrentContributors().size(), 1);
}
@Test
public void testAddCyclotomicComplexity() {
CodeInfo ci = new CodeInfo("test");
Assert.assertEquals(ci.getCyclotomicComplexity().get(), 0);
ci.addCyclotomicComplexiy(1);
Assert.assertEquals(ci.getCyclotomicComplexity().get(), 1);
}
@Test(expected = IllegalArgumentException.class)
public void testAddExternalDependecyNull() {
CodeInfo ci = new CodeInfo("test");
ci.addExternalDependencies(null);
Assert.fail();
}
@Test(expected = IllegalArgumentException.class)
public void testAddExternalDependecyEmpty() {
CodeInfo ci = new CodeInfo("test");
ci.addExternalDependencies("");
Assert.fail();
}
@Test
public void testAddExternalDependecy() {
CodeInfo ci = new CodeInfo("test");
Assert.assertEquals(ci.getExternalDependencies().size(), 0);
ci.addExternalDependencies("tester");
Assert.assertEquals(ci.getExternalDependencies().size(), 1);
}
@Test
public void testIsReflexive() {
CodeInfo ci1 = new CodeInfo("test");
Assert.assertEquals(ci1, ci1);
Assert.assertEquals(ci1.hashCode(), ci1.hashCode());
}
@Test
public void testIsReflexiveWithOtherNull() {
CodeInfo ci1 = new CodeInfo("test");
Assert.assertNotEquals(ci1, null);
}
@Test
public void testIsReflexiveWithNull() {
CodeInfo ci1 = new CodeInfo("test");
Assert.assertNotEquals(null, ci1);
}
@Test
public void testIsEqual() {
CodeInfo ci1 = new CodeInfo("test");
CodeInfo ci2 = new CodeInfo("test");
Assert.assertEquals(ci1, ci2);
Assert.assertEquals(ci1.hashCode(), ci2.hashCode());
}
@Test
public void testIsNotSameClass() {
CodeInfo ci1 = new CodeInfo("test");
Assert.assertNotEquals(ci1, "Test");
Assert.assertNotEquals(ci1.hashCode(), "Test".hashCode());
}
@Test
public void testIsNotEqual() {
CodeInfo ci1 = new CodeInfo("test");
CodeInfo ci2 = new CodeInfo("test1");
Assert.assertNotEquals(ci1, ci2);
Assert.assertNotEquals(ci1.hashCode(), ci2.hashCode());
}
@Test
public void testIsNotEqualContributor() {
CodeInfo ci1 = new CodeInfo("test");
ci1.addContributor(mock(ContributorInfo.class));
CodeInfo ci2 = new CodeInfo("test");
Assert.assertNotEquals(ci1, ci2);
Assert.assertNotEquals(ci1.hashCode(), ci2.hashCode());
}
@Test
public void testIsNotEqualFunction() {
CodeInfo ci1 = new CodeInfo("test");
ci1.addFunction(mock(FunctionInfo.class));
CodeInfo ci2 = new CodeInfo("test");
Assert.assertNotEquals(ci1, ci2);
Assert.assertNotEquals(ci1.hashCode(), ci2.hashCode());
}
@Test
public void testIsNotEqualDependecy() {
CodeInfo ci1 = new CodeInfo("test");
ci1.addExternalDependencies("Test");
CodeInfo ci2 = new CodeInfo("test");
Assert.assertNotEquals(ci1, ci2);
Assert.assertNotEquals(ci1.hashCode(), ci2.hashCode());
}
}
| [
"mike.krolak@pearson.com"
] | mike.krolak@pearson.com |
02d73ba21330d56e238363ff4fc71afd939d13b9 | 9bab878f93005659f111be3f52f10f795add4e6a | /src/Servlet/UploadHandleServlet.java | e2668abaa9206ca249ad16416c7099c04ab39edf | [] | no_license | RCBOY/newpostgraduate | 37d434aa063cfc0ca67b534a2f5c8b0dd770c76b | 699b8b4a2c63a92f0a9c89ab7fcfa29b0caddea4 | refs/heads/master | 2020-07-21T14:58:42.150143 | 2016-09-15T05:40:59 | 2016-09-15T05:40:59 | 67,968,965 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,208 | java | package Servlet;
import org.apache.commons.fileupload.FileItem;
import org.apache.commons.fileupload.FileUploadBase;
import org.apache.commons.fileupload.ProgressListener;
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.apache.commons.fileupload.servlet.ServletFileUpload;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import javax.swing.*;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.List;
import java.util.UUID;
/**
* Created by 1234ztc on 2016/7/3.
*/
public class UploadHandleServlet extends HttpServlet {
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
request.setCharacterEncoding("UTF-8");
response.setCharacterEncoding("UTF-8");
HttpSession httpSession=request.getSession();
String savepath = this.getServletContext().getRealPath("/WEB-INF/upload");
String tempath = this.getServletContext().getRealPath("/WEB-INF/temp");
System.out.print(tempath);
File tempfile = new File(tempath);
if (!tempfile.exists()) {
tempfile.mkdir();
}
try {
DiskFileItemFactory diskFileItemFactory = new DiskFileItemFactory();
diskFileItemFactory.setSizeThreshold(1024 * 100);
diskFileItemFactory.setRepository(tempfile);
ServletFileUpload servletFileUpload = new ServletFileUpload(diskFileItemFactory);
servletFileUpload.setProgressListener(new ProgressListener() {
@Override
public void update(long pBytesRead, long pContentLength, int arg2) {
System.out.println("文件大小为:" + pContentLength + ",当前已处理:" + pBytesRead);
}
});
servletFileUpload.setHeaderEncoding("UTF-8");
if (!ServletFileUpload.isMultipartContent(request)) {
return;
}
servletFileUpload.setFileSizeMax(1024 * 1024);
servletFileUpload.setSizeMax(1024 * 1024 * 10);
List<FileItem> list = servletFileUpload.parseRequest(request);
for(FileItem iterm:list){
if (iterm.isFormField()){
String name=iterm.getFieldName();
String value=iterm.getString("UTF-8");
System.out.println(name+"="+value);
}else {
String filename=iterm.getName();
// System.out.println(filename);
if (filename==null||filename.trim().equals("")){
continue;
}
String username=(String)httpSession.getAttribute("username");
filename=username+filename.substring(filename.lastIndexOf("\\")+1);
System.out.println("++"+filename);
String fileExname=filename.substring(filename.lastIndexOf(".")+1);
System.out.println("上传文件的扩展名为:"+fileExname);
InputStream inputStream=iterm.getInputStream();
String saveFilename=makeFileName(filename);
String realSavePath=makePath(filename,savepath);
FileOutputStream out = new FileOutputStream(realSavePath + "\\" + saveFilename);
byte buffer[]=new byte[1024];
int len=0;
while((len=inputStream.read(buffer))>0){
out.write(buffer,0,len);
}
inputStream.close();
out.close();
}
}
JOptionPane.showMessageDialog(null, "上传成功!", "提示", JOptionPane.PLAIN_MESSAGE);
// request.getRequestDispatcher("/AboutStudentJsp/StudentUpload.jsp").forward(request, response);
} catch (FileUploadBase.FileSizeLimitExceededException e) {
e.printStackTrace();
JOptionPane.showMessageDialog(null, "单个文件超出最大值!", "提示", JOptionPane.ERROR_MESSAGE);
request.getRequestDispatcher("/Student.jsp").forward(request, response);
return;
}catch (FileUploadBase.SizeLimitExceededException e){
e.printStackTrace();
JOptionPane.showMessageDialog(null, "上传文件的总的大小超出限制的最大值!", "提示", JOptionPane.ERROR_MESSAGE);
request.getRequestDispatcher("/Student.jsp").forward(request, response);
return;
}catch (Exception e){
e.printStackTrace();
JOptionPane.showMessageDialog(null, "上传文件失败!", "提示", JOptionPane.ERROR_MESSAGE);
request.getRequestDispatcher("/Student.jsp").forward(request, response);
return;
}
request.getRequestDispatcher("/Student.jsp").forward(request, response);
}
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doGet(request, response);
}
private String makeFileName(String filename){
//为防止文件覆盖的现象发生,要为上传文件产生一个唯一的文件名
return UUID.randomUUID().toString() + "_" + filename;
}
private String makePath(String filename,String savePath){
//得到文件名的hashCode的值,得到的就是filename这个字符串对象在内存中的地址
int hashcode = filename.hashCode();
int dir1 = hashcode&0xf; //0--15
int dir2 = (hashcode&0xf0)>>4; //0-15
// 构造新的保存目录
String dir = savePath + "\\" + dir1 + "\\" + dir2; //upload\2\3 upload\3\5
//File既可以代表文件也可以代表目录
File file = new File(dir);
//如果目录不存在
if(!file.exists()){
//创建目录
file.mkdirs();
}
return dir;
}
}
| [
"329942954@qq.com"
] | 329942954@qq.com |
054cb05a69bc2e70308ba315d4cba2f7509f5447 | c0cbad908e8418ee316a7b68b7bb24829102a452 | /src/main/java/de/master/manager/ui/events/RemoveCourseEvent.java | a3c9a9dee07fc0a883b249185fd5f12461e40608 | [
"MIT"
] | permissive | uucly/mastermanager | e0ac3d187a0cc2f6e447b8bd6916984d85f60476 | 9af8050869b14b1b6966e6404d285e0e5d1cdde6 | refs/heads/master | 2021-01-10T02:04:42.114944 | 2015-12-21T04:43:40 | 2015-12-21T04:43:40 | 45,619,196 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 311 | java | package de.master.manager.ui.events;
import org.apache.wicket.ajax.AjaxRequestTarget;
public class RemoveCourseEvent {
private final AjaxRequestTarget target;
public RemoveCourseEvent(AjaxRequestTarget target) {
this.target = target;
}
public AjaxRequestTarget getTarget() {
return target;
}
}
| [
"uucly@student.kit.edu"
] | uucly@student.kit.edu |
e3f9951921301f60527c40eb037c25c66f5a85e4 | b6cd35734b3dc24ee5bcd3c85f8feb4c5369a91f | /main/java/com/pringlebeaver/pcp/effects/StuffedEffect.java | aeb5ec768e0d3e8e296132936b85cfbad8749871 | [] | no_license | PringleBeaver/PCP1.15.2 | 8c1610a8637e6889c5d7a0e7ccb1f81586d56fae | 1c82671342523e335dd1307d83724185683af32d | refs/heads/master | 2022-12-07T01:35:31.874910 | 2020-09-06T00:37:44 | 2020-09-06T00:37:44 | 289,822,800 | 0 | 0 | null | 2020-08-25T03:35:46 | 2020-08-24T03:54:10 | Java | UTF-8 | Java | false | false | 1,107 | java | package com.pringlebeaver.pcp.effects;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.attributes.AttributeModifier;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.potion.Effect;
import net.minecraft.potion.EffectType;
import net.minecraft.potion.Effects;
import net.minecraft.util.DamageSource;
public class StuffedEffect extends Effect {
public StuffedEffect() {
super(EffectType.NEUTRAL, 12557429);
addAttributesModifier(SharedMonsterAttributes.MOVEMENT_SPEED, "ca1687e2-ed71-11ea-adc1-0242ac120002", (double)-0.4F, AttributeModifier.Operation.MULTIPLY_TOTAL);
}
@Override
public boolean isReady(int duration, int amplifier) {
return true;
}
public void performEffect(LivingEntity entityLivingBaseIn, int amplifier) {
((PlayerEntity)entityLivingBaseIn).getFoodStats().setFoodSaturationLevel(5.0F);
System.out.println(((PlayerEntity) entityLivingBaseIn).getFoodStats().getSaturationLevel());
}
}
| [
"noreply@github.com"
] | noreply@github.com |
521875b03b65e677d6e3e42c0a314cf31645620e | a80b9a901b662fc0af102daaedbea90af48d6405 | /SystemsLabFinal/src/src_client/ch/ethz/rama/asl/logging/MyLogger.java | f1efe1ae01dc13d2e3cee1841641905fcdf8ff84 | [
"MIT"
] | permissive | GHrama/ameowsmeowl-2015 | 3ebb15080a4d47e705972f7656e9c381e23e6695 | d77c3b0060ee7095ea7cd3ce571194172a10d684 | refs/heads/master | 2016-08-12T22:56:11.646683 | 2015-10-30T14:44:50 | 2015-10-30T14:44:50 | 43,649,753 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,971 | java | package ch.ethz.rama.asl.logging;
import java.io.IOException;
import java.util.concurrent.TimeUnit;
import java.util.logging.ConsoleHandler;
import java.util.logging.FileHandler;
import java.util.logging.Handler;
import java.util.logging.Level;
import java.util.logging.Logger;
public class MyLogger {
static MyFormatter formatter = null;
static FileHandler fileHandler = null;
static ConsoleHandler consoleHandler = null;
static String preName = "";
static Long time = System.currentTimeMillis();
//static String file_path = "/tmp/rsridhar-"+preName+time+".log";
static String file_path = "/tmp/rsridhar-"+preName+time+".log";
// setup method
static public void setup() throws SecurityException, IOException {
// if(fileHandler == null)
fileHandler = new FileHandler(file_path, true);
if(consoleHandler == null)
consoleHandler = new ConsoleHandler();
if(formatter == null)
formatter = new MyFormatter();
}
static public Logger classLogger(String className){
Logger logger = Logger.getLogger(className);
logger.setUseParentHandlers(false);
try {
setup();
fileHandler.setFormatter(formatter);
if(consoleHandler == null || formatter == null)
consoleHandler.setFormatter(formatter);
// Handler[] handlers = logger.getHandlers();
// //array of registered handlers
// for (int i = 0; i < handlers.length; i++)
// logger.removeHandler(handlers[i]);
//
logger.setLevel(Level.INFO);
logger.addHandler(fileHandler);
} catch (SecurityException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return logger;
}
static public Logger classLogger(String className,
String log_prefix) {
preName = log_prefix;
//file_path = "/tmp/rsridhar-"+preName+time+".log";
file_path = "/tmp/rsridhar-"+preName+time+".log";
return classLogger(className);
}
}
| [
"rsridhar@student.ethz.ch"
] | rsridhar@student.ethz.ch |
085a7b80449d131f804d4e9dd2b03a226fb423e6 | 4312a71c36d8a233de2741f51a2a9d28443cd95b | /RawExperiments/Math/math98/1/AstorMain-math_98/src/variant-208/org/apache/commons/math/linear/RealMatrixImpl.java | 0b3b3353d792d3d7cb0490c687ef3efd007a494f | [] | no_license | SajjadZaidi/AutoRepair | 5c7aa7a689747c143cafd267db64f1e365de4d98 | e21eb9384197bae4d9b23af93df73b6e46bb749a | refs/heads/master | 2021-05-07T00:07:06.345617 | 2017-12-02T18:48:14 | 2017-12-02T18:48:14 | 112,858,432 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 30,314 | java | package org.apache.commons.math.linear;
public class RealMatrixImpl implements java.io.Serializable , org.apache.commons.math.linear.RealMatrix {
private static final long serialVersionUID = -4828886979278117018L;
protected double[][] data = null;
protected double[][] lu = null;
protected int[] permutation = null;
protected int parity = 1;
private static final double TOO_SMALL = 1.0E-11;
public RealMatrixImpl() {
}
public RealMatrixImpl(int rowDimension ,int columnDimension) {
if ((rowDimension <= 0) || (columnDimension <= 0)) {
throw new java.lang.IllegalArgumentException("row and column dimensions must be postive");
}
data = new double[rowDimension][columnDimension];
lu = null;
}
public RealMatrixImpl(double[][] d) {
copyIn(d);
lu = null;
}
public RealMatrixImpl(double[][] d ,boolean copyArray) {
if (copyArray) {
copyIn(d);
} else {
if (d == null) {
throw new java.lang.NullPointerException();
}
final int nRows = d.length;
if (nRows == 0) {
throw new java.lang.IllegalArgumentException("Matrix must have at least one row.");
}
final int nCols = d[0].length;
if (nCols == 0) {
throw new java.lang.IllegalArgumentException("Matrix must have at least one column.");
}
for (int r = 1 ; r < nRows ; r++) {
if ((d[r].length) != nCols) {
throw new java.lang.IllegalArgumentException("All input rows must have the same length.");
}
}
data = d;
}
lu = null;
}
public RealMatrixImpl(double[] v) {
final int nRows = v.length;
data = new double[nRows][1];
for (int row = 0 ; row < nRows ; row++) {
data[row][0] = v[row];
}
}
public org.apache.commons.math.linear.RealMatrix copy() {
return new org.apache.commons.math.linear.RealMatrixImpl(copyOut() , false);
}
public org.apache.commons.math.linear.RealMatrix add(org.apache.commons.math.linear.RealMatrix m) throws java.lang.IllegalArgumentException {
try {
return add(((org.apache.commons.math.linear.RealMatrixImpl)(m)));
} catch (java.lang.ClassCastException cce) {
final int rowCount = getRowDimension();
final int columnCount = getColumnDimension();
if ((columnCount != (m.getColumnDimension())) || (rowCount != (m.getRowDimension()))) {
throw new java.lang.IllegalArgumentException("matrix dimension mismatch");
}
final double[][] outData = new double[rowCount][columnCount];
for (int row = 0 ; row < rowCount ; row++) {
final double[] dataRow = data[row];
final double[] outDataRow = outData[row];
for (int col = 0 ; col < columnCount ; col++) {
outDataRow[col] = (dataRow[col]) + (m.getEntry(row, col));
}
}
return new org.apache.commons.math.linear.RealMatrixImpl(outData , false);
}
}
public org.apache.commons.math.linear.RealMatrixImpl add(org.apache.commons.math.linear.RealMatrixImpl m) throws java.lang.IllegalArgumentException {
final int rowCount = getRowDimension();
final int columnCount = getColumnDimension();
if ((columnCount != (m.getColumnDimension())) || (rowCount != (m.getRowDimension()))) {
throw new java.lang.IllegalArgumentException("matrix dimension mismatch");
}
final double[][] outData = new double[rowCount][columnCount];
for (int row = 0 ; row < rowCount ; row++) {
final double[] dataRow = data[row];
final double[] mRow = m.data[row];
final double[] outDataRow = outData[row];
for (int col = 0 ; col < columnCount ; col++) {
outDataRow[col] = (dataRow[col]) + (mRow[col]);
}
}
return new org.apache.commons.math.linear.RealMatrixImpl(outData , false);
}
public org.apache.commons.math.linear.RealMatrix subtract(org.apache.commons.math.linear.RealMatrix m) throws java.lang.IllegalArgumentException {
try {
return subtract(((org.apache.commons.math.linear.RealMatrixImpl)(m)));
} catch (java.lang.ClassCastException cce) {
final int rowCount = getRowDimension();
final int columnCount = getColumnDimension();
if ((columnCount != (m.getColumnDimension())) || (rowCount != (m.getRowDimension()))) {
throw new java.lang.IllegalArgumentException("matrix dimension mismatch");
}
final double[][] outData = new double[rowCount][columnCount];
for (int row = 0 ; row < rowCount ; row++) {
final double[] dataRow = data[row];
final double[] outDataRow = outData[row];
for (int col = 0 ; col < columnCount ; col++) {
outDataRow[col] = (dataRow[col]) - (m.getEntry(row, col));
}
}
return new org.apache.commons.math.linear.RealMatrixImpl(outData , false);
}
}
public org.apache.commons.math.linear.RealMatrixImpl subtract(org.apache.commons.math.linear.RealMatrixImpl m) throws java.lang.IllegalArgumentException {
final int rowCount = getRowDimension();
final int columnCount = getColumnDimension();
if ((columnCount != (m.getColumnDimension())) || (rowCount != (m.getRowDimension()))) {
throw new java.lang.IllegalArgumentException("matrix dimension mismatch");
}
final double[][] outData = new double[rowCount][columnCount];
for (int row = 0 ; row < rowCount ; row++) {
final double[] dataRow = data[row];
final double[] mRow = m.data[row];
final double[] outDataRow = outData[row];
for (int col = 0 ; col < columnCount ; col++) {
outDataRow[col] = (dataRow[col]) - (mRow[col]);
}
}
return new org.apache.commons.math.linear.RealMatrixImpl(outData , false);
}
public org.apache.commons.math.linear.RealMatrix scalarAdd(double d) {
final int rowCount = getRowDimension();
final int columnCount = getColumnDimension();
final double[][] outData = new double[rowCount][columnCount];
for (int row = 0 ; row < rowCount ; row++) {
final double[] dataRow = data[row];
final double[] outDataRow = outData[row];
for (int col = 0 ; col < columnCount ; col++) {
outDataRow[col] = (dataRow[col]) + d;
}
}
return new org.apache.commons.math.linear.RealMatrixImpl(outData , false);
}
public org.apache.commons.math.linear.RealMatrix scalarMultiply(double d) {
final int rowCount = getRowDimension();
final int columnCount = getColumnDimension();
final double[][] outData = new double[rowCount][columnCount];
for (int row = 0 ; row < rowCount ; row++) {
final double[] dataRow = data[row];
final double[] outDataRow = outData[row];
for (int col = 0 ; col < columnCount ; col++) {
outDataRow[col] = (dataRow[col]) * d;
}
}
return new org.apache.commons.math.linear.RealMatrixImpl(outData , false);
}
public org.apache.commons.math.linear.RealMatrix multiply(org.apache.commons.math.linear.RealMatrix m) throws java.lang.IllegalArgumentException {
try {
return multiply(((org.apache.commons.math.linear.RealMatrixImpl)(m)));
} catch (java.lang.ClassCastException cce) {
if ((org.apache.commons.math.linear.RealMatrixImpl.this.getColumnDimension()) != (m.getRowDimension())) {
throw new java.lang.IllegalArgumentException("Matrices are not multiplication compatible.");
}
final int nRows = org.apache.commons.math.linear.RealMatrixImpl.this.getRowDimension();
final int nCols = m.getColumnDimension();
final int nSum = org.apache.commons.math.linear.RealMatrixImpl.this.getColumnDimension();
final double[][] outData = new double[nRows][nCols];
for (int row = 0 ; row < nRows ; row++) {
final double[] dataRow = data[row];
final double[] outDataRow = outData[row];
for (int col = 0 ; col < nCols ; col++) {
double sum = 0;
for (int i = 0 ; i < nSum ; i++) {
sum += (dataRow[i]) * (m.getEntry(i, col));
}
outDataRow[col] = sum;
}
}
return new org.apache.commons.math.linear.RealMatrixImpl(outData , false);
}
}
public org.apache.commons.math.linear.RealMatrixImpl multiply(org.apache.commons.math.linear.RealMatrixImpl m) throws java.lang.IllegalArgumentException {
if ((org.apache.commons.math.linear.RealMatrixImpl.this.getColumnDimension()) != (m.getRowDimension())) {
throw new java.lang.IllegalArgumentException("Matrices are not multiplication compatible.");
}
final int nRows = org.apache.commons.math.linear.RealMatrixImpl.this.getRowDimension();
final int nCols = m.getColumnDimension();
final int nSum = org.apache.commons.math.linear.RealMatrixImpl.this.getColumnDimension();
final double[][] outData = new double[nRows][nCols];
for (int row = 0 ; row < nRows ; row++) {
final double[] dataRow = data[row];
final double[] outDataRow = outData[row];
for (int col = 0 ; col < nCols ; col++) {
double sum = 0;
for (int i = 0 ; i < nSum ; i++) {
sum += (dataRow[i]) * (m.data[i][col]);
}
outDataRow[col] = sum;
}
}
return new org.apache.commons.math.linear.RealMatrixImpl(outData , false);
}
public org.apache.commons.math.linear.RealMatrix preMultiply(org.apache.commons.math.linear.RealMatrix m) throws java.lang.IllegalArgumentException {
return m.multiply(org.apache.commons.math.linear.RealMatrixImpl.this);
}
public double[][] getData() {
return copyOut();
}
public double[][] getDataRef() {
return data;
}
public double getNorm() {
double maxColSum = 0;
for (int col = 0 ; col < (org.apache.commons.math.linear.RealMatrixImpl.this.getColumnDimension()) ; col++) {
double sum = 0;
for (int row = 0 ; row < (org.apache.commons.math.linear.RealMatrixImpl.this.getRowDimension()) ; row++) {
sum += java.lang.Math.abs(data[row][col]);
}
maxColSum = java.lang.Math.max(maxColSum, sum);
}
return maxColSum;
}
public org.apache.commons.math.linear.RealMatrix getSubMatrix(int startRow, int endRow, int startColumn, int endColumn) throws org.apache.commons.math.linear.MatrixIndexException {
if ((((((startRow < 0) || (startRow > endRow)) || (endRow > (data.length))) || (startColumn < 0)) || (startColumn > endColumn)) || (endColumn > (data[0].length))) {
throw new org.apache.commons.math.linear.MatrixIndexException("invalid row or column index selection");
}
final double[][] subMatrixData = new double[(endRow - startRow) + 1][(endColumn - startColumn) + 1];
for (int i = startRow ; i <= endRow ; i++) {
java.lang.System.arraycopy(data[i], startColumn, subMatrixData[(i - startRow)], 0, ((endColumn - startColumn) + 1));
}
return new org.apache.commons.math.linear.RealMatrixImpl(subMatrixData , false);
}
public org.apache.commons.math.linear.RealMatrix getSubMatrix(int[] selectedRows, int[] selectedColumns) throws org.apache.commons.math.linear.MatrixIndexException {
if (((selectedRows.length) * (selectedColumns.length)) == 0) {
throw new org.apache.commons.math.linear.MatrixIndexException("selected row and column index arrays must be non-empty");
}
final double[][] subMatrixData = new double[selectedRows.length][selectedColumns.length];
try {
for (int i = 0 ; i < (selectedRows.length) ; i++) {
final double[] subI = subMatrixData[i];
final double[] dataSelectedI = data[selectedRows[i]];
for (int j = 0 ; j < (selectedColumns.length) ; j++) {
subI[j] = dataSelectedI[selectedColumns[j]];
}
}
} catch (java.lang.ArrayIndexOutOfBoundsException e) {
throw new org.apache.commons.math.linear.MatrixIndexException("matrix dimension mismatch");
}
return new org.apache.commons.math.linear.RealMatrixImpl(subMatrixData , false);
}
public void setSubMatrix(double[][] subMatrix, int row, int column) throws org.apache.commons.math.linear.MatrixIndexException {
if ((row < 0) || (column < 0)) {
throw new org.apache.commons.math.linear.MatrixIndexException("invalid row or column index selection");
}
final int nRows = subMatrix.length;
if (nRows == 0) {
throw new java.lang.IllegalArgumentException("Matrix must have at least one row.");
}
final int nCols = subMatrix[0].length;
if (nCols == 0) {
throw new java.lang.IllegalArgumentException("Matrix must have at least one column.");
}
for (int r = 1 ; r < nRows ; r++) {
if ((subMatrix[r].length) != nCols) {
throw new java.lang.IllegalArgumentException("All input rows must have the same length.");
}
}
if ((data) == null) {
if ((row > 0) || (column > 0)) {
throw new org.apache.commons.math.linear.MatrixIndexException("matrix must be initialized to perfom this method");
}
data = new double[nRows][nCols];
java.lang.System.arraycopy(subMatrix, 0, data, 0, subMatrix.length);
}
if (((nRows + row) > (org.apache.commons.math.linear.RealMatrixImpl.this.getRowDimension())) || ((nCols + column) > (org.apache.commons.math.linear.RealMatrixImpl.this.getColumnDimension()))) {
throw new org.apache.commons.math.linear.MatrixIndexException("invalid row or column index selection");
}
for (int i = 0 ; i < nRows ; i++) {
java.lang.System.arraycopy(subMatrix[i], 0, data[(row + i)], column, nCols);
}
lu = null;
}
public org.apache.commons.math.linear.RealMatrix getRowMatrix(int row) throws org.apache.commons.math.linear.MatrixIndexException {
if (!(isValidCoordinate(row, 0))) {
throw new org.apache.commons.math.linear.MatrixIndexException("illegal row argument");
}
final int ncols = org.apache.commons.math.linear.RealMatrixImpl.this.getColumnDimension();
final double[][] out = new double[1][ncols];
java.lang.System.arraycopy(data[row], 0, out[0], 0, ncols);
return new org.apache.commons.math.linear.RealMatrixImpl(out , false);
}
public org.apache.commons.math.linear.RealMatrix getColumnMatrix(int column) throws org.apache.commons.math.linear.MatrixIndexException {
if (!(isValidCoordinate(0, column))) {
throw new org.apache.commons.math.linear.MatrixIndexException("illegal column argument");
}
final int nRows = org.apache.commons.math.linear.RealMatrixImpl.this.getRowDimension();
final double[][] out = new double[nRows][1];
for (int row = 0 ; row < nRows ; row++) {
out[row][0] = data[row][column];
}
return new org.apache.commons.math.linear.RealMatrixImpl(out , false);
}
public double[] getRow(int row) throws org.apache.commons.math.linear.MatrixIndexException {
if (!(isValidCoordinate(row, 0))) {
throw new org.apache.commons.math.linear.MatrixIndexException("illegal row argument");
}
final int ncols = org.apache.commons.math.linear.RealMatrixImpl.this.getColumnDimension();
final double[] out = new double[ncols];
java.lang.System.arraycopy(data[row], 0, out, 0, ncols);
return out;
}
public double[] getColumn(int col) throws org.apache.commons.math.linear.MatrixIndexException {
if (!(isValidCoordinate(0, col))) {
throw new org.apache.commons.math.linear.MatrixIndexException("illegal column argument");
}
final int nRows = org.apache.commons.math.linear.RealMatrixImpl.this.getRowDimension();
final double[] out = new double[nRows];
for (int row = 0 ; row < nRows ; row++) {
out[row] = data[row][col];
}
return out;
}
public double getEntry(int row, int column) throws org.apache.commons.math.linear.MatrixIndexException {
try {
return data[row][column];
} catch (java.lang.ArrayIndexOutOfBoundsException e) {
throw new org.apache.commons.math.linear.MatrixIndexException("matrix entry does not exist");
}
}
public org.apache.commons.math.linear.RealMatrix transpose() {
final int nRows = getRowDimension();
final int nCols = getColumnDimension();
final double[][] outData = new double[nCols][nRows];
for (int row = 0 ; row < nRows ; row++) {
final double[] dataRow = data[row];
for (int col = 0 ; col < nCols ; col++) {
outData[col][row] = dataRow[col];
}
}
return new org.apache.commons.math.linear.RealMatrixImpl(outData , false);
}
public org.apache.commons.math.linear.RealMatrix inverse() throws org.apache.commons.math.linear.InvalidMatrixException {
return solve(org.apache.commons.math.linear.MatrixUtils.createRealIdentityMatrix(getRowDimension()));
}
public double getDeterminant() throws org.apache.commons.math.linear.InvalidMatrixException {
if (!(isSquare())) {
throw new org.apache.commons.math.linear.InvalidMatrixException("matrix is not square");
}
if (isSingular()) {
return 0.0;
} else {
double det = parity;
for (int i = 0 ; i < (org.apache.commons.math.linear.RealMatrixImpl.this.getRowDimension()) ; i++) {
det *= lu[i][i];
}
return det;
}
}
public boolean isSquare() {
return (org.apache.commons.math.linear.RealMatrixImpl.this.getColumnDimension()) == (org.apache.commons.math.linear.RealMatrixImpl.this.getRowDimension());
}
public boolean isSingular() {
if ((lu) == null) {
try {
luDecompose();
return false;
} catch (org.apache.commons.math.linear.InvalidMatrixException ex) {
return true;
}
} else {
return false;
}
}
public int getRowDimension() {
return data.length;
}
public int getColumnDimension() {
return data[0].length;
}
public double getTrace() throws java.lang.IllegalArgumentException {
if (!(isSquare())) {
throw new java.lang.IllegalArgumentException("matrix is not square");
}
double trace = data[0][0];
for (int i = 1 ; i < (org.apache.commons.math.linear.RealMatrixImpl.this.getRowDimension()) ; i++) {
trace += data[i][i];
}
return trace;
}
public double[] operate(double[] v) throws java.lang.IllegalArgumentException {
final int nRows = org.apache.commons.math.linear.RealMatrixImpl.this.getRowDimension();
final int nCols = org.apache.commons.math.linear.RealMatrixImpl.this.getColumnDimension();
if ((v.length) != nCols) {
throw new java.lang.IllegalArgumentException("vector has wrong length");
}
final double[] out = new double[v.length];
for (int row = 0 ; row < nRows ; row++) {
final double[] dataRow = data[row];
double sum = 0;
for (int row = 0 ; row < nRows ; row++) {
permutation[row] = row;
}
out[row] = sum;
}
return out;
}
public double[] preMultiply(double[] v) throws java.lang.IllegalArgumentException {
final int nRows = org.apache.commons.math.linear.RealMatrixImpl.this.getRowDimension();
if ((v.length) != nRows) {
throw new java.lang.IllegalArgumentException("vector has wrong length");
}
final int nCols = org.apache.commons.math.linear.RealMatrixImpl.this.getColumnDimension();
final double[] out = new double[nCols];
for (int col = 0 ; col < nCols ; col++) {
double sum = 0;
for (int i = 0 ; i < nRows ; i++) {
sum += (data[i][col]) * (v[i]);
}
out[col] = sum;
}
return out;
}
public double[] solve(double[] b) throws java.lang.IllegalArgumentException, org.apache.commons.math.linear.InvalidMatrixException {
final int nRows = org.apache.commons.math.linear.RealMatrixImpl.this.getRowDimension();
if ((b.length) != nRows) {
throw new java.lang.IllegalArgumentException("constant vector has wrong length");
}
final org.apache.commons.math.linear.RealMatrix bMatrix = new org.apache.commons.math.linear.RealMatrixImpl(b);
final double[][] solution = ((org.apache.commons.math.linear.RealMatrixImpl)(solve(bMatrix))).getDataRef();
final double[] out = new double[nRows];
for (int row = 0 ; row < nRows ; row++) {
out[row] = solution[row][0];
}
return out;
}
public org.apache.commons.math.linear.RealMatrix solve(org.apache.commons.math.linear.RealMatrix b) throws java.lang.IllegalArgumentException, org.apache.commons.math.linear.InvalidMatrixException {
if ((b.getRowDimension()) != (org.apache.commons.math.linear.RealMatrixImpl.this.getRowDimension())) {
throw new java.lang.IllegalArgumentException("Incorrect row dimension");
}
if (!(org.apache.commons.math.linear.RealMatrixImpl.this.isSquare())) {
throw new org.apache.commons.math.linear.InvalidMatrixException("coefficient matrix is not square");
}
if (org.apache.commons.math.linear.RealMatrixImpl.this.isSingular()) {
throw new org.apache.commons.math.linear.InvalidMatrixException("Matrix is singular.");
}
final int nCol = org.apache.commons.math.linear.RealMatrixImpl.this.getColumnDimension();
final int nColB = b.getColumnDimension();
final int nRowB = b.getRowDimension();
final double[][] bp = new double[nRowB][nColB];
for (int row = 0 ; row < nRowB ; row++) {
final double[] bpRow = bp[row];
for (int col = 0 ; col < nColB ; col++) {
bpRow[col] = b.getEntry(permutation[row], col);
}
}
for (int col = 0 ; col < nCol ; col++) {
for (int i = col + 1 ; i < nCol ; i++) {
final double[] bpI = bp[i];
final double[] luI = lu[i];
for (int j = 0 ; j < nColB ; j++) {
bpI[j] -= (bp[col][j]) * (luI[col]);
}
}
}
for (int col = nCol - 1 ; col >= 0 ; col--) {
final double[] bpCol = bp[col];
final double luDiag = lu[col][col];
for (int j = 0 ; j < nColB ; j++) {
bpCol[j] /= luDiag;
}
for (int i = 0 ; i < col ; i++) {
final double[] bpI = bp[i];
final double[] luI = lu[i];
for (int j = 0 ; j < nColB ; j++) {
bpI[j] -= (bp[col][j]) * (luI[col]);
}
}
}
return new org.apache.commons.math.linear.RealMatrixImpl(bp , false);
}
public void luDecompose() throws org.apache.commons.math.linear.InvalidMatrixException {
final int nRows = org.apache.commons.math.linear.RealMatrixImpl.this.getRowDimension();
final int nCols = org.apache.commons.math.linear.RealMatrixImpl.this.getColumnDimension();
if (nRows != nCols) {
throw new org.apache.commons.math.linear.InvalidMatrixException("LU decomposition requires that the matrix be square.");
}
lu = getData();
permutation = new int[nRows];
for (int row = 0 ; row < nRows ; row++) {
permutation[row] = row;
}
parity = 1;
for (int col = 0 ; col < nCols ; col++) {
double sum = 0;
for (int row = 0 ; row < col ; row++) {
final double[] luRow = lu[row];
sum = luRow[col];
for (int i = 0 ; i < row ; i++) {
sum -= (luRow[i]) * (lu[i][col]);
}
luRow[col] = sum;
}
int max = col;
double largest = 0.0;
for (int row = col ; row < nRows ; row++) {
final double[] luRow = lu[row];
sum = luRow[col];
for (int i = 0 ; i < col ; i++) {
sum -= (luRow[i]) * (lu[i][col]);
}
luRow[col] = sum;
if ((java.lang.Math.abs(sum)) > largest) {
largest = java.lang.Math.abs(sum);
max = row;
}
}
if ((java.lang.Math.abs(lu[max][col])) < (org.apache.commons.math.linear.RealMatrixImpl.TOO_SMALL)) {
lu = null;
throw new org.apache.commons.math.linear.InvalidMatrixException("matrix is singular");
}
if (max != col) {
double tmp = 0;
for (int i = 0 ; i < nCols ; i++) {
tmp = lu[max][i];
lu[max][i] = lu[col][i];
lu[col][i] = tmp;
}
int temp = permutation[max];
permutation[max] = permutation[col];
permutation[col] = temp;
parity = -(parity);
}
final double luDiag = lu[col][col];
for (int row = col + 1 ; row < nRows ; row++) {
lu[row][col] /= luDiag;
}
}
}
public java.lang.String toString() {
java.lang.StringBuffer res = new java.lang.StringBuffer();
res.append("RealMatrixImpl{");
if ((data) != null) {
for (int i = 0 ; i < (data.length) ; i++) {
if (i > 0) {
res.append(",");
}
res.append("{");
for (int j = 0 ; j < (data[0].length) ; j++) {
if (j > 0) {
res.append(",");
}
res.append(data[i][j]);
}
res.append("}");
}
}
res.append("}");
return res.toString();
}
public boolean equals(java.lang.Object object) {
if (object == (org.apache.commons.math.linear.RealMatrixImpl.this)) {
return true;
}
if ((object instanceof org.apache.commons.math.linear.RealMatrixImpl) == false) {
return false;
}
org.apache.commons.math.linear.RealMatrix m = ((org.apache.commons.math.linear.RealMatrix)(object));
final int nRows = getRowDimension();
final int nCols = getColumnDimension();
if (((m.getColumnDimension()) != nCols) || ((m.getRowDimension()) != nRows)) {
return false;
}
for (int row = 0 ; row < nRows ; row++) {
final double[] dataRow = data[row];
for (int col = 0 ; col < nCols ; col++) {
if ((java.lang.Double.doubleToLongBits(dataRow[col])) != (java.lang.Double.doubleToLongBits(m.getEntry(row, col)))) {
return false;
}
}
}
return true;
}
public int hashCode() {
int ret = 7;
final int nRows = getRowDimension();
final int nCols = getColumnDimension();
ret = (ret * 31) + nRows;
ret = (ret * 31) + nCols;
for (int row = 0 ; row < nRows ; row++) {
final double[] dataRow = data[row];
for (int col = 0 ; col < nCols ; col++) {
ret = (ret * 31) + (((11 * (row + 1)) + (17 * (col + 1))) * (org.apache.commons.math.util.MathUtils.hash(dataRow[col])));
}
}
return ret;
}
protected org.apache.commons.math.linear.RealMatrix getLUMatrix() throws org.apache.commons.math.linear.InvalidMatrixException {
if ((lu) == null) {
luDecompose();
}
return new org.apache.commons.math.linear.RealMatrixImpl(lu);
}
protected int[] getPermutation() {
final int[] out = new int[permutation.length];
java.lang.System.arraycopy(permutation, 0, out, 0, permutation.length);
return out;
}
private double[][] copyOut() {
final int nRows = org.apache.commons.math.linear.RealMatrixImpl.this.getRowDimension();
final double[][] out = new double[nRows][org.apache.commons.math.linear.RealMatrixImpl.this.getColumnDimension()];
for (int i = 0 ; i < nRows ; i++) {
java.lang.System.arraycopy(data[i], 0, out[i], 0, data[i].length);
}
return out;
}
private void copyIn(double[][] in) {
setSubMatrix(in, 0, 0);
}
private boolean isValidCoordinate(int row, int col) {
final int nRows = getRowDimension();
final int nCols = getColumnDimension();
return !((((row < 0) || (row > (nRows - 1))) || (col < 0)) || (col > (nCols - 1)));
}
}
| [
"sajjad.syed@ucalgary.ca"
] | sajjad.syed@ucalgary.ca |
6db0c36da0dab5f362b22932f7d4da88250eb744 | 7afdfe4c3876a50cf256c16fdca5ad3e0bc3a885 | /jerry-buy/jerry-buy-client/src/main/java/io/luan/jerry/buy/dto/creating/CreatingOrderRequest.java | 40dc7dde2d1081f3e3ad0448756afd30271bd101 | [
"Apache-2.0"
] | permissive | luangm/jerry-old | ebc3c6ee01b5f30524e529bc9ae892ad39b480ef | ffa94807f41657c0d04e8ec610bb8d516b34b061 | refs/heads/master | 2021-06-01T04:42:52.719696 | 2016-07-24T15:30:05 | 2016-07-24T15:30:05 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,039 | java | package io.luan.jerry.buy.dto.creating;
import io.luan.jerry.buy.dto.DeliveryAddressDTO;
import io.luan.jerry.buy.dto.OrderDTO;
import io.luan.jerry.common.dto.BaseDTO;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.base.Preconditions.checkState;
/**
* Request sent by either frontend or another service
* Containing minimal information required to create a new order
*
* @author Guangmiao Luan
* @since 7/3/2016
*/
@Data
public class CreatingOrderRequest extends BaseDTO {
private long buyerId;
private String buyerNick;
private List<OrderDTO> orders = new ArrayList<>();
private DeliveryAddressDTO deliveryAddress;
@Override
public void validate() {
checkState(buyerId > 0);
checkNotNull(orders);
checkState(orders.size() > 0);
checkNotNull(deliveryAddress);
orders.forEach(OrderDTO::validate);
deliveryAddress.validate();
}
}
| [
"luangm@users.noreply.github.com"
] | luangm@users.noreply.github.com |
b2fcf7667fa631441e8ff63490b800fc1a5a2b02 | ad3572b6f027b2faca3cd38cbf942969f6e2ee29 | /src/entities/Curso.java | 81d81c2c9e21c150f9ae419272e42e9e2464b896 | [] | no_license | seminarioumg20188102/PersistenciaWsescuela | 4bbaad0d79caf399bc69f3bef6d41a33626f87a4 | c3a0a8e443cb377232d40db32ef5e12c535a153e | refs/heads/master | 2020-04-01T16:42:25.277518 | 2018-10-17T04:17:17 | 2018-10-17T04:17:17 | 153,394,133 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,495 | 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 entities;
import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
/**
*
* @author EstelaChayoMonse
*/
@Entity
@Table(name = "curso", catalog = "escuela", schema = "")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "Curso.findAll", query = "SELECT c FROM Curso c")
, @NamedQuery(name = "Curso.findByIdcurso", query = "SELECT c FROM Curso c WHERE c.idcurso = :idcurso")
, @NamedQuery(name = "Curso.findByNombre", query = "SELECT c FROM Curso c WHERE c.nombre = :nombre")
, @NamedQuery(name = "Curso.findByTipo", query = "SELECT c FROM Curso c WHERE c.tipo = :tipo")})
public class Curso implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "IDCURSO")
private Integer idcurso;
@Basic(optional = false)
@Column(name = "NOMBRE")
private String nombre;
@Basic(optional = false)
@Column(name = "TIPO")
private String tipo;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "idcurso")
private Collection<Asignacion> asignacionCollection;
public Curso() {
}
public Curso(Integer idcurso) {
this.idcurso = idcurso;
}
public Curso(Integer idcurso, String nombre, String tipo) {
this.idcurso = idcurso;
this.nombre = nombre;
this.tipo = tipo;
}
public Integer getIdcurso() {
return idcurso;
}
public void setIdcurso(Integer idcurso) {
this.idcurso = idcurso;
}
public String getNombre() {
return nombre;
}
public void setNombre(String nombre) {
this.nombre = nombre;
}
public String getTipo() {
return tipo;
}
public void setTipo(String tipo) {
this.tipo = tipo;
}
@XmlTransient
public Collection<Asignacion> getAsignacionCollection() {
return asignacionCollection;
}
public void setAsignacionCollection(Collection<Asignacion> asignacionCollection) {
this.asignacionCollection = asignacionCollection;
}
@Override
public int hashCode() {
int hash = 0;
hash += (idcurso != null ? idcurso.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Curso)) {
return false;
}
Curso other = (Curso) object;
if ((this.idcurso == null && other.idcurso != null) || (this.idcurso != null && !this.idcurso.equals(other.idcurso))) {
return false;
}
return true;
}
@Override
public String toString() {
return "entities.Curso[ idcurso=" + idcurso + " ]";
}
}
| [
"josfischmann@gmail.com"
] | josfischmann@gmail.com |
8d99f3fe1f85e0e1a2d89c46f138a7c82fe57224 | 9d1d4e031c6c3f53fea30021b34e4c6c37577148 | /src/main/java/com/MNTDemo/Consumer/service/LogService.java | 798ba8eb058fd3c77ebf519c2a1227e2fc646d69 | [] | no_license | jmartinez059/kafka-consumer | 98a2c73cc960005c21e11e3b9f3d3b66c70a108a | abac5c1a303a8dee8879824f455a75e649435ca2 | refs/heads/master | 2023-03-03T10:36:06.221786 | 2021-02-11T20:19:16 | 2021-02-11T20:19:16 | 338,143,440 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,224 | java | package com.MNTDemo.Consumer.service;
import com.MNTDemo.Consumer.model.LogObject;
import com.MNTDemo.Consumer.model.LogType;
import com.MNTDemo.Consumer.repository.LogRepository;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
@Service
public class LogService {
private static final Logger logger = LoggerFactory.getLogger(LogService.class);
@Autowired
private LogRepository logRepository;
public List<LogObject> getLogs() {
logger.info("LogService called, making call to LogRepository");
List<LogObject> logs = new ArrayList<>();
try {
logs = logRepository.findAll();
logger.info("Response from logRepository:\n" + logs);
} catch (Exception e) {
logger.error("LogService caught exception calling LogRepository.getLogs():\n", e.getMessage());
}
logger.info("Received response from LogRepository, returning logs to LogController");
return logs;
}
public List<LogObject> getLogsByService(String service) {
logger.info("LogService called, making call to LogRepository");
List<LogObject> logs = new ArrayList<>();
try {
logs = logRepository.findByService(service);
} catch (Exception e) {
logger.error("LogService caught exception calling LogRepository.getLogs():\n", e.getStackTrace());
e.printStackTrace();
}
logger.info("Received response from LogRepository, returning logs to LogController");
return logs;
}
public List<LogObject> getLogsByType(LogType logType) {
logger.info("LogService called, making call to LogRepository");
List<LogObject> logs = new ArrayList<>();
try {
logs = logRepository.findByType(logType);
} catch (Exception e) {
logger.error("LogService caught exception calling LogRepository.getLogs():\n", e.getMessage());
}
logger.info("Received response from LogRepository, returning logs to LogController");
return logs;
}
}
| [
"jmartinez059@yahoo.com"
] | jmartinez059@yahoo.com |
00be17607e1103c67559119f9105fc3293d3531d | ce2a3a91f61cd651855b95ca77ab166e7350b380 | /GenericsAbstractAssignment/src/Department.java | c54d66b9b68d749b595b4966b05ce06e718773ca | [] | no_license | Noahmahi2019/ClassesAndObjects | badcea0bb832f95cd0f329200b4a4b97df38e56a | 11f342d5334f0ccc5668ac52bae0636265e9eeb2 | refs/heads/main | 2023-02-21T02:16:34.825570 | 2021-01-12T03:41:24 | 2021-01-12T03:41:24 | 295,979,401 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 49 | java | package PACKAGE_NAME;public class Department {
}
| [
"mahinoah_2019@yahoo.com"
] | mahinoah_2019@yahoo.com |
05bb9869cd9ba47b32c010aeae485661596cc1f8 | 5b7be9f7c5cd03c5119472ec07b025ef9bb23bae | /src/com/example/todolist/model/Task.java | 19ac944854c2c49d871e652d6faefea46eba461f | [] | no_license | SandeepDhull1990/Android-TodoList | 8e3166e90f67f3d150a380860d0da40ab3ec12d9 | 5807eecf23140ab674a7900b3ff078e52f7cb892 | refs/heads/master | 2021-01-21T12:43:39.445233 | 2013-02-01T07:06:43 | 2013-02-01T07:06:43 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,049 | java | package com.example.todolist.model;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import android.os.Parcel;
import android.os.Parcelable;
public class Task implements Parcelable {
private String mTaskText;
private Date mCompletionDate;
private long mTaskId;
public final static String mSchemaType = "tasks";
public String getTaskText() {
return mTaskText;
}
public void setTaskText(String mTaskText) {
this.mTaskText = mTaskText;
}
public long getTaskId() {
return mTaskId;
}
public void setTaskId(long mTaskId) {
this.mTaskId = mTaskId;
}
public Date getCompletionDate() {
return mCompletionDate;
}
public void setCompletionDate(Date mCompletionDate) {
this.mCompletionDate = mCompletionDate;
}
public void setCompletionDate(String mCompletionDate) {
DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
Date date;
try {
date = df.parse(mCompletionDate);
this.mCompletionDate = date;
} catch (ParseException e) {
e.printStackTrace();
}
}
@Override
public String toString() {
return "Task [mTaskText=" + mTaskText + ", mCompletionDate="
+ mCompletionDate + ", mTaskId=" + mTaskId + "]";
}
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeLong(mTaskId);
dest.writeString(mTaskText);
if(mCompletionDate != null) {
DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
dest.writeString(df.format(mCompletionDate));
}
}
public static final Parcelable.Creator<Task> CREATOR = new Parcelable.Creator<Task>() {
@Override
public Task createFromParcel(Parcel source) {
Task task = new Task();
task.setTaskId(source.readLong());
task.setTaskText(source.readString());
String date = source.readString();
if(date != null) {
task.setCompletionDate(date);
}
return task;
}
@Override
public Task[] newArray(int size) {
return null;
}
};
}
| [
"sdhull@tavisca.com"
] | sdhull@tavisca.com |
72da4bfdbee2feadacf91fdf33a52fa4b4fc90e2 | c3d81e4c75959c8362756fd3c184bc5820d3aec9 | /LBridge/MVCdemo/src/java/DAO/DetailsDAO.java | 13bccb2f50646c504cd2f29b7ce7d6137305cafc | [] | no_license | Badoni/Lalit-Badoni | 2f4ea9d70f800bb64bc40183c19ffb6066613c04 | 68ee2ef368aeb5d55a6fb2835f3e2a304e2aa0c0 | refs/heads/master | 2021-01-20T08:09:46.419773 | 2017-07-17T08:53:46 | 2017-07-17T08:53:46 | 90,107,640 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,003 | java |
package DAO;
import Model.DetailsModel;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
/**
*
* @author badoni
*/
public class DetailsDAO
{
public boolean add(DetailsModel s)
{
try
{
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection conn=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","system","pass");
PreparedStatement pmt=conn.prepareStatement("insert into Details values (?,?,?,?,?)");
pmt.setString(1,s.getCname());
pmt.setString(2,s.getIntro());
pmt.setString(3,s.getHeading1());
pmt.setString(4,s.getHeading2());
pmt.setString(5,s.getExample());
int a=pmt.executeUpdate();
if(a==1)
{
System.out.println("Complete");
}
}
catch(Exception e)
{
System.out.println(e);
}
return true;
}
}
| [
"badonilalit@gmail.com"
] | badonilalit@gmail.com |
ccbf34d2fbf8e8d8826539e99c44be782c74cadc | 127c87f644d4b3ae6edcb3dcdf879cb98682825c | /app/src/main/java/com/bytebazar/toocold2/model/ApiModule.java | 668fde81fb3d91f27169d337aa537744fa8c2224 | [] | no_license | MKSMV/TooCold2 | 80cb2130e45fa376d2322c69cabfbb37dca1c453 | 928506060f773a6cfab0b052239b627ed826e526 | refs/heads/master | 2021-07-07T04:14:42.351533 | 2017-10-03T21:19:12 | 2017-10-03T21:19:12 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,023 | java | package com.bytebazar.toocold2.model;
import okhttp3.OkHttpClient;
import okhttp3.logging.HttpLoggingInterceptor;
import retrofit2.Retrofit;
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;
import retrofit2.converter.gson.GsonConverterFactory;
final class ApiModule {
private final static String BASE_URL = "http://api.openweathermap.org/data/2.5/";
static RetrofitInterface getApiWeather() {
final HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor();
interceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
final OkHttpClient client = new OkHttpClient.Builder().addInterceptor(interceptor).build();
final Retrofit retrofit = new Retrofit.Builder()
.client(client)
.baseUrl(BASE_URL)
.addConverterFactory(GsonConverterFactory.create())
.addCallAdapterFactory(RxJava2CallAdapterFactory.create())
.build();
return retrofit.create(RetrofitInterface.class);
}
}
| [
"mail"
] | mail |
890eaa62032da16234b6d8b6cf3d55345466d668 | 4dc134175f090e78bd9d84453764342b1e790450 | /homework/hw14/hw14-2_direct_code.java | 697ced1e2711de11f792a5657ce3b09b7fc0fc53 | [] | no_license | 2014-sed-team3/term-project | 8cfe4d5f2ffc6abcf992f1af74e12bf9e0518bd8 | 9c222829c2afa6db49d5abbcf1ffb423d457776b | refs/heads/master | 2021-01-10T19:54:22.993916 | 2014-06-17T04:00:11 | 2014-06-17T04:00:11 | 17,639,015 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 548 | java | class Scanner{
public void work(){
}
}
class Parser{
public void work(){
}
}
class ProgramNode{
public void work(){
}
}
class BytecodeStream{
public void work(){
}
}
class client{
private Scanner scanner;
private Parser parser;
private ProgramNode programnode;
private BytecodeStream bytecodestream;
private String code;
public client(Scanner s,Parser p, ProgramNode n, BytecodeStream b){
scanner = s;
parser = p;
programnode = n;
bytecodestream = b;
}
public void compile(){
}
} | [
"bingo4508@gmail.com"
] | bingo4508@gmail.com |
352e4a704ee3ea07fe6efaf57b4c15da670fbe0f | 59327b7b0d91e73212e72afb71b8b2d0f79bcc97 | /Compra.java | 198cb7e5d27fa79e7682e796f41b9f6d5f0d13ce | [] | no_license | TADebastiani/Prog1-java | 639667c09db5c36fe21680bd64820c6abb104af1 | e40f40b582887a93fb10ae05237ab85190b0fa5e | refs/heads/master | 2021-01-10T18:31:28.109837 | 2014-09-21T01:12:29 | 2014-09-21T01:12:29 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,010 | java | class Compra {
private String nomeProduto;
private float preco;
private int quantidade;
public Compra(String produto, float preco, int quantidade) {
this.nomeProduto = produto;
this.preco = preco;
this.quantidade = quantidade;
}
public void setNomeProduto(String novo) {
this.nomeProduto = novo;
}
public String getNomeProduto() {
return nomeProduto;
}
public void setPreco(float preco) {
this.preco = preco;
}
public float getPreco() {
return preco;
}
public void setQuantidade(int quantidade) {
this.quantidade = quantidade;
}
public int getQuantidade() {
return quantidade;
}
// Imprime todas as propriedades da classe
public void imprimeResumo() {
float total = preco * quantidade;
System.out.println();
System.out.println("-- RESUMO DA COMPRA --");
System.out.println("Produto: "+ getNomeProduto());
System.out.println("Valor: R$"+ getPreco());
System.out.println("Quantidade: "+ getQuantidade());
System.out.println("Total: R$"+ total);
}
} | [
"debastianister@gmail.com"
] | debastianister@gmail.com |
a6c6f415a30c45f8760b0b8f625917a18651f329 | 9d0517091fe2313c40bcc88a7c82218030d2075c | /apis/ec2/src/test/java/org/jclouds/ec2/features/KeyPairApiTest.java | 532d2c61772ca8fad19de6b1a3bd158e4e3df5d4 | [
"Apache-2.0"
] | permissive | nucoupons/Mobile_Applications | 5c63c8d97f48e1051049c5c3b183bbbaae1fa6e6 | 62239dd0f17066c12a86d10d26bef350e6e9bd43 | refs/heads/master | 2020-12-04T11:49:53.121041 | 2020-01-04T12:00:04 | 2020-01-04T12:00:04 | 231,754,011 | 0 | 0 | Apache-2.0 | 2020-01-04T12:02:30 | 2020-01-04T11:46:54 | Java | UTF-8 | Java | false | false | 4,249 | java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jclouds.ec2.features;
import static org.jclouds.reflect.Reflection2.method;
import java.io.IOException;
import org.jclouds.Fallbacks.EmptySetOnNotFoundOr404;
import org.jclouds.ec2.xml.DescribeKeyPairsResponseHandler;
import org.jclouds.http.functions.ParseSax;
import org.jclouds.http.functions.ReleasePayloadAndReturn;
import org.jclouds.rest.internal.GeneratedHttpRequest;
import org.testng.annotations.Test;
import com.google.common.collect.Lists;
import com.google.common.reflect.Invokable;
/**
* Tests behavior of {@code KeyPairApi}
*/
// NOTE:without testName, this will not call @Before* and fail w/NPE during surefire
@Test(groups = "unit", testName = "KeyPairApiTest")
public class KeyPairApiTest extends BaseEC2ApiTest<KeyPairApi> {
public void testDeleteKeyPair() throws SecurityException, NoSuchMethodException, IOException {
Invokable<?, ?> method = method(KeyPairApi.class, "deleteKeyPairInRegion", String.class, String.class);
GeneratedHttpRequest request = processor.createRequest(method, Lists.<Object> newArrayList(null, "mykey"));
assertRequestLineEquals(request, "POST https://ec2.us-east-1.amazonaws.com/ HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n");
assertPayloadEquals(request, "Action=DeleteKeyPair&KeyName=mykey",
"application/x-www-form-urlencoded", false);
assertResponseParserClassEquals(method, request, ReleasePayloadAndReturn.class);
assertSaxResponseParserClassEquals(method, null);
assertFallbackClassEquals(method, null);
checkFilters(request);
}
public void testDescribeKeyPairs() throws SecurityException, NoSuchMethodException, IOException {
Invokable<?, ?> method = method(KeyPairApi.class, "describeKeyPairsInRegion", String.class, String[].class);
GeneratedHttpRequest request = processor.createRequest(method, Lists.<Object> newArrayList((String) null));
assertRequestLineEquals(request, "POST https://ec2.us-east-1.amazonaws.com/ HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n");
assertPayloadEquals(request, "Action=DescribeKeyPairs", "application/x-www-form-urlencoded",
false);
assertResponseParserClassEquals(method, request, ParseSax.class);
assertSaxResponseParserClassEquals(method, DescribeKeyPairsResponseHandler.class);
assertFallbackClassEquals(method, EmptySetOnNotFoundOr404.class);
checkFilters(request);
}
public void testDescribeKeyPairsArgs() throws SecurityException, NoSuchMethodException, IOException {
Invokable<?, ?> method = method(KeyPairApi.class, "describeKeyPairsInRegion", String.class, String[].class);
GeneratedHttpRequest request = processor.createRequest(method, Lists.<Object> newArrayList(null, "1", "2"));
assertRequestLineEquals(request, "POST https://ec2.us-east-1.amazonaws.com/ HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n");
assertPayloadEquals(request, "Action=DescribeKeyPairs&KeyName.1=1&KeyName.2=2",
"application/x-www-form-urlencoded", false);
assertResponseParserClassEquals(method, request, ParseSax.class);
assertSaxResponseParserClassEquals(method, DescribeKeyPairsResponseHandler.class);
assertFallbackClassEquals(method, EmptySetOnNotFoundOr404.class);
checkFilters(request);
}
}
| [
"Administrator@fdp"
] | Administrator@fdp |
a6bef3dfb6c060a6447f18577eb4bc195bb11b0e | 33586bebb037e540008329bdc5f8e1263f6337b4 | /J2EE/src/main/java/xmu/mystore/ordersmgt/cdd/model/Page.java | 18180c62cf6e68fbbd713a1e835e1a205655a4a4 | [] | no_license | codeinmyself/Velocity | 039100f1c3f09bdf88a40b09f5dc3ae9a9aeaf7a | f68c3ebb72e6c1d224532de03daa4054638d6970 | refs/heads/master | 2021-01-02T22:48:14.525194 | 2017-08-04T18:49:34 | 2017-08-04T18:49:34 | 99,394,441 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,705 | java | package xmu.mystore.ordersmgt.cdd.model;
public class Page {
private int everypage;//每页显示记录数
private int totalCount;//总记录数
private int totalPage;//总页数
private int currentPage;//当前页
//private int beginIndex;//查询起始点
private boolean hasPrePage;//是否有上一页
private boolean hasNextPage;//是否有下一页
public Page(){
}
public Page(int everypage, int totalCount, int totalPage, int currentPage, boolean hasPrePage,
boolean hasNextPage) {
super();
this.everypage = everypage;
this.totalCount = totalCount;
this.totalPage = totalPage;
this.currentPage = currentPage;
//this.beginIndex = beginIndex;
this.hasPrePage = hasPrePage;
this.hasNextPage = hasNextPage;
}
public int getEverypage() {
return everypage;
}
public void setEverypage(int everypage) {
this.everypage = everypage;
}
public int getTotalCount() {
return totalCount;
}
public void setTotalCount(int totalCount) {
this.totalCount = totalCount;
}
public int getTotalPage() {
return totalPage;
}
public void setTotalPage(int totalPage) {
this.totalPage = totalPage;
}
public int getCurrentPage() {
return currentPage;
}
public void setCurrentPage(int currentPage) {
this.currentPage = currentPage;
}
/*public int getBeginIndex() {
return beginIndex;
}
public void setBeginIndex(int beginIndex) {
this.beginIndex = beginIndex;
}*/
public boolean isHasPrePage() {
return hasPrePage;
}
public void setHasPrePage(boolean hasPrePage) {
this.hasPrePage = hasPrePage;
}
public boolean isHasNextPage() {
return hasNextPage;
}
public void setHasNextPage(boolean hasNextPage) {
this.hasNextPage = hasNextPage;
}
}
| [
"1344863189@qq.com"
] | 1344863189@qq.com |
7be57ce8853580c04c6aeafd79e4af5b0b84f1a3 | 486bf2978501b46c47653a5083e343d6e09469ba | /hello-btrace/src/main/java/samples/SocketTracker1.java | 67e60375926f6b609698602338e0c10d1119bfc4 | [
"MIT"
] | permissive | HenryChenV/hello-java | 5b6f0b56e55dee262f7a22171981093a2f02f332 | d71bce1cd5ff717a01eb2e95e38028c195434a4c | refs/heads/master | 2023-01-11T23:12:23.622700 | 2022-12-25T03:58:05 | 2022-12-25T03:58:05 | 157,085,535 | 0 | 0 | MIT | 2022-12-25T03:59:02 | 2018-11-11T14:06:19 | Java | UTF-8 | Java | false | false | 4,089 | java | package samples;/*
* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the Classpath exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
import org.openjdk.btrace.core.types.AnyType;
import org.openjdk.btrace.core.annotations.BTrace;
import org.openjdk.btrace.core.annotations.Kind;
import org.openjdk.btrace.core.annotations.Location;
import org.openjdk.btrace.core.annotations.OnMethod;
import org.openjdk.btrace.core.annotations.OnProbe;
import org.openjdk.btrace.core.annotations.Return;
import org.openjdk.btrace.core.annotations.Self;
import org.openjdk.btrace.core.annotations.TLS;
import java.net.InetAddress;
import java.net.ServerSocket;
import java.net.SocketAddress;
import static org.openjdk.btrace.core.BTraceUtils.println;
/**
* This example tracks all server socket creations
* and client socket accepts. Unlike SockerTracker.java,
* this script uses only public API classes and @OnProbe
* probes - which would be mapped to internal implementation
* classes by a XML descriptor at BTrace agent. For this
* sample, XML probe descriptor is "java.net.socket.xml".
*/
@BTrace
public class SocketTracker1 {
@TLS
private static int port = -1;
@TLS
private static InetAddress inetAddr;
@TLS
private static SocketAddress sockAddr;
@OnMethod(
clazz = "java.net.ServerSocket",
method = "<init>"
)
public static void onServerSocket(@Self ServerSocket self,
int p, int backlog, InetAddress bindAddr) {
port = p;
inetAddr = bindAddr;
}
@OnMethod(
clazz = "java.net.ServerSocket",
method = "<init>",
type = "void (int, int, java.net.InetAddress)",
location = @Location(Kind.RETURN)
)
public static void onSockReturn() {
if (port != -1) {
println("server socket at " + port);
port = -1;
}
if (inetAddr != null) {
println("server socket at " + inetAddr);
inetAddr = null;
}
}
@OnProbe(
namespace = "java.net.socket",
name = "server-socket-creator"
)
public static void onSocket(@Return ServerSocket ssock) {
println("server socket at " + ssock);
}
@OnProbe(
namespace = "java.net.socket",
name = "bind"
)
public static void onBind(@Self Object self, SocketAddress addr, int backlog) {
sockAddr = addr;
}
@OnProbe(
namespace = "java.net.socket",
name = "bind-return"
)
public static void onBindReturn() {
if (sockAddr != null) {
println("server socket bind " + sockAddr);
sockAddr = null;
}
}
@OnProbe(
namespace = "java.net.socket",
name = "accept-return"
)
public static void onAcceptReturn(AnyType sock) {
if (sock != null) {
println("client socket accept " + sock);
}
}
}
| [
"chenhanli@bigo.sg"
] | chenhanli@bigo.sg |
3915a88d2d166cc1d435e9f5ba8a4419bd1d4441 | 1f7f8bb02b1355528b3260891df3eefea6cdfa26 | /cms-admin/src/main/java/com/xasz/cms/mapper/UserRoleMapper.java | e1176348ce1d26254e35752bf6584536770fa64d | [] | no_license | honj51/cms-admin | 2bd669cd4092ccb68bcfbdf3621f3daf5bc962f7 | 65d684727496b99d9790524ab428ef9314bab652 | refs/heads/master | 2020-07-26T07:23:01.672076 | 2019-04-03T01:39:49 | 2019-04-03T01:39:49 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 178 | java | package com.xasz.cms.mapper;
public interface UserRoleMapper {
/**
* 根据用户id删除
*
* @param userId
*/
public void deleteByUserId(String userId);
}
| [
"rod@DESKTOP-5SF8E0J"
] | rod@DESKTOP-5SF8E0J |
879db74fef7910619e03eee7a49a5dfeedbea131 | 782b7b40bcdd1458bc8d19ca5b073c94d9610bb7 | /src/tzhai/euler/Problem13.java | 160b1580d9397b08702fc9e22eb58ec1995953eb | [
"MIT"
] | permissive | zhaitengfei/ProjetEuler | c33bbb0413aa59728d47312207fce78ec742bc12 | 70b2213474cf6687257dd9d8ac40194181e1bb91 | refs/heads/master | 2021-01-25T05:23:02.741716 | 2015-02-10T12:58:40 | 2015-02-10T12:58:40 | 29,164,083 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,814 | java | package tzhai.euler;
import java.util.ArrayList;
import tzhai.euler.lib.FileLib;
/**
* Problem 13 Large sum
*
* Work out the first ten digits of the sum of the following one-hundred
* 50-digit numbers.
*
* 37107287533902102798797998220837590246510135740250
* 46376937677490009712648124896970078050417018260538
* 74324986199524741059474233309513058123726617309629
* 91942213363574161572522430563301811072406154908250
* 23067588207539346171171980310421047513778063246676
* 89261670696623633820136378418383684178734361726757
* 28112879812849979408065481931592621691275889832738
* 44274228917432520321923589422876796487670272189318
* 47451445736001306439091167216856844588711603153276
* 70386486105843025439939619828917593665686757934951
* 62176457141856560629502157223196586755079324193331
* 64906352462741904929101432445813822663347944758178
* 92575867718337217661963751590579239728245598838407
* 58203565325359399008402633568948830189458628227828
* 80181199384826282014278194139940567587151170094390
* 35398664372827112653829987240784473053190104293586
* 86515506006295864861532075273371959191420517255829
* 71693888707715466499115593487603532921714970056938
* 54370070576826684624621495650076471787294438377604
* 53282654108756828443191190634694037855217779295145
* 36123272525000296071075082563815656710885258350721
* 45876576172410976447339110607218265236877223636045
* 17423706905851860660448207621209813287860733969412
* 81142660418086830619328460811191061556940512689692
* 51934325451728388641918047049293215058642563049483
* 62467221648435076201727918039944693004732956340691
* 15732444386908125794514089057706229429197107928209
* 55037687525678773091862540744969844508330393682126
* 18336384825330154686196124348767681297534375946515
* 80386287592878490201521685554828717201219257766954
* 78182833757993103614740356856449095527097864797581
* 16726320100436897842553539920931837441497806860984
* 48403098129077791799088218795327364475675590848030
* 87086987551392711854517078544161852424320693150332
* 59959406895756536782107074926966537676326235447210
* 69793950679652694742597709739166693763042633987085
* 41052684708299085211399427365734116182760315001271
* 65378607361501080857009149939512557028198746004375
* 35829035317434717326932123578154982629742552737307
* 94953759765105305946966067683156574377167401875275
* 88902802571733229619176668713819931811048770190271
* 25267680276078003013678680992525463401061632866526
* 36270218540497705585629946580636237993140746255962
* 24074486908231174977792365466257246923322810917141
* 91430288197103288597806669760892938638285025333403
* 34413065578016127815921815005561868836468420090470
* 23053081172816430487623791969842487255036638784583
* 11487696932154902810424020138335124462181441773470
* 63783299490636259666498587618221225225512486764533
* 67720186971698544312419572409913959008952310058822
* 95548255300263520781532296796249481641953868218774
* 76085327132285723110424803456124867697064507995236
* 37774242535411291684276865538926205024910326572967
* 23701913275725675285653248258265463092207058596522
* 29798860272258331913126375147341994889534765745501
* 18495701454879288984856827726077713721403798879715
* 38298203783031473527721580348144513491373226651381
* 34829543829199918180278916522431027392251122869539
* 40957953066405232632538044100059654939159879593635
* 29746152185502371307642255121183693803580388584903
* 41698116222072977186158236678424689157993532961922
* 62467957194401269043877107275048102390895523597457
* 23189706772547915061505504953922979530901129967519
* 86188088225875314529584099251203829009407770775672
* 11306739708304724483816533873502340845647058077308
* 82959174767140363198008187129011875491310547126581
* 97623331044818386269515456334926366572897563400500
* 42846280183517070527831839425882145521227251250327
* 55121603546981200581762165212827652751691296897789
* 32238195734329339946437501907836945765883352399886
* 75506164965184775180738168837861091527357929701337
* 62177842752192623401942399639168044983993173312731
* 32924185707147349566916674687634660915035914677504
* 99518671430235219628894890102423325116913619626622
* 73267460800591547471830798392868535206946944540724
* 76841822524674417161514036427982273348055556214818
* 97142617910342598647204516893989422179826088076852
* 87783646182799346313767754307809363333018982642090
* 10848802521674670883215120185883543223812876952786
* 71329612474782464538636993009049310363619763878039
* 62184073572399794223406235393808339651327408011116
* 66627891981488087797941876876144230030984490851411
* 60661826293682836764744779239180335110989069790714
* 85786944089552990653640447425576083659976645795096
* 66024396409905389607120198219976047599490197230297
* 64913982680032973156037120041377903785566085089252
* 16730939319872750275468906903707539413042652315011
* 94809377245048795150954100921645863754710598436791
* 78639167021187492431995700641917969777599028300699
* 15368713711936614952811305876380278410754449733078
* 40789923115535562561142322423255033685442488917353
* 44889911501440648020369068063960672322193204149535
* 41503128880339536053299340368006977710650566631954
* 81234880673210146739058568557934581403627822703280
* 82616570773948327592232845941706525094512325230608
* 22918802058777319719839450180888072429661980811197
* 77158542502016545090413245809786882778948721859617
* 72107838435069186155435662884062257473692284509516
* 20849603980134001723930671666823555245252804609722
* 53503534226472524250874054075591789781264330331690
*
* @author Zhai Tengfei
*
*/
public class Problem13 {
private static ArrayList<Integer> largeSum() {
ArrayList<String> arrayList = new ArrayList<>();
arrayList = FileLib
.readFileByLines("E:\\Code\\Euler\\src\\tzhai\\euler\\inputProblem13.txt");
int[][] array = new int[100][50];
for (int i = 0; i < arrayList.size(); i++) {
String stringTemp = arrayList.get(i);
for (int j = 0; j < stringTemp.length(); j++) {
char charTemp = stringTemp.charAt(j);
array[i][j] = Character.getNumericValue(charTemp);
}
}
ArrayList<Integer> sumArray = new ArrayList<>();
int carry = 0;
int rest = 0;
int sum;
for (int j = 49; j >= 0; j--) {
sum = 0;
for (int i = 0; i < 100; i++) {
sum += array[i][j];
}
sum += carry;
rest = sum % 10;
carry = sum / 10;
sumArray.add(rest);
}
String s = String.valueOf(carry);
for (int i = s.length() - 1; i >= 0; i--) {
sumArray.add(Character.getNumericValue(s.charAt(i)));
}
return sumArray;
}
public static void main(String[] args) {
ArrayList<Integer> sumArray = Problem13.largeSum();
for (int i = 0; i < 10; i++) {
System.out.print(sumArray.get(sumArray.size() - i - 1));
}
}
}
| [
"tengfeizhai@gmail.com"
] | tengfeizhai@gmail.com |
467d8a7f0fc4753f99eff225c931ec1014df7f87 | 3e7fb041c9f204633334d2b76262739ba3cdec12 | /app/src/main/java/com/example/cameratest01/RC_Adapters/RC_CameraButton_Adapter.java | 8add03c728d3d4c2dcb9e87e052ee3a764886e71 | [] | no_license | wjsthd10/CameraTest01_git | fc6b60bf40065e6e32077463f5bb4254f6bfc696 | f7880698508bc35f4dfeeddb0ba3be56f5691887 | refs/heads/main | 2023-03-26T16:31:51.416169 | 2021-03-24T09:06:04 | 2021-03-24T09:06:04 | 325,696,765 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,149 | java | package com.example.cameratest01.RC_Adapters;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.OrientationEventListener;
import android.view.Surface;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.bumptech.glide.Glide;
import com.example.cameratest01.R;
import com.example.cameratest01.RC_Items.RC_CameraButton_items;
import java.util.ArrayList;
public class RC_CameraButton_Adapter extends RecyclerView.Adapter {
Context context;
ArrayList<RC_CameraButton_items> items;
OrientationEventListener orientationEventListener;// 안먹음
public RC_CameraButton_Adapter(Context context, ArrayList<RC_CameraButton_items> items) {
this.context = context;
this.items = items;
}
@NonNull
@Override
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View itemView= LayoutInflater.from(context).inflate(R.layout.rc_camera_button_item, parent, false);
VH_camera holder=new VH_camera(itemView);
return holder;
}
@Override
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
VH_camera vh= (VH_camera) holder;
Glide.with(context).load(items.get(position).image).into(vh.iv);
vh.tv.setText(items.get(position).name);
vh.layout.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(context, "클릭시 해당하는 데이터 받아와서 촬영리스트에 추가하기", Toast.LENGTH_SHORT).show();
}
});
}
@Override
public int getItemCount() {
return items.size();
}
class VH_camera extends RecyclerView.ViewHolder{
LinearLayout layout;
ImageView iv;
TextView tv;
public VH_camera(@NonNull View itemView) {
super(itemView);
layout=itemView.findViewById(R.id.rc_cameraButton_lay);
iv=itemView.findViewById(R.id.rc_cameraButton_image);
tv=itemView.findViewById(R.id.rc_cameraButton_text);
orientationEventListener=new OrientationEventListener(itemView.getContext()) {// 화면 회전될때 레이아웃 회전
@Override
public void onOrientationChanged(int orientation) {
if (orientation >=45 && orientation <135){
layout.setRotation(270);
}else if (orientation>= 135 && orientation<225){
layout.setRotation(180);
}else if (orientation>=225 && orientation<315){
layout.setRotation(90);
}else {
layout.setRotation(0);
}
}
};
orientationEventListener.enable();
}
}
}
| [
"wjsthd10@naver.com"
] | wjsthd10@naver.com |
9571e085abc4af0a8abb050858d5b180175a8f6b | eedb7f9f2a943b0b55ca783a3cf90968f27ef7e3 | /src/main/java/com/chf/example/jdk/net/tcp/TcpServer.java | e55545850ea755a4f5ea6cb4d3fcca83dfb3896e | [] | no_license | HiPhone-Chan/jdk-example | 6d1f8d54267ee2addc5a4a0cb3379362526106f0 | 3b23be46950a309d8cf4aae68ac2601c435cc111 | refs/heads/master | 2021-01-10T17:49:37.563952 | 2016-12-15T03:38:21 | 2016-12-15T03:38:21 | 42,982,820 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,415 | java | package com.chf.example.jdk.net.tcp;
import java.io.DataInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.ServerSocket;
import java.net.Socket;
public class TcpServer {
private int port;
public TcpServer(int port) {
this.port = port;
}
public void start() {
System.out.println("listening : " + port);
new Thread(() -> {
try (ServerSocket server = new ServerSocket(port);) {
while (true) {
Socket client = server.accept();
System.out.println("get client : " + client);
new Thread(new ServerThread(client)).start();
}
} catch (IOException e) {
e.printStackTrace();
}
}).start();
}
public class ServerThread implements Runnable {
private Socket client;
public ServerThread(Socket client) {
this.client = client;
}
public void run() {
try (InputStream is = client.getInputStream(); DataInputStream dis = new DataInputStream(is);) {
while (true) {
System.out.println("Server get : " + dis.readUTF());
}
} catch (Exception e) {
e.printStackTrace();
}
System.out.println("end client : " + client);
}
}
}
| [
"hi.phone.chan@gmail.com"
] | hi.phone.chan@gmail.com |
2c24572ee281af68fb3cd43fbe959f7efad9b6e3 | c27c6da288c02d3837ea8b7e416749ea7b9340c9 | /src/ices/sh/mbs/bean/Location.java | ef11efb1e3425962d4abaacc1fe8416e189ce7d6 | [] | no_license | 6ucky/Eshopping-system-Flex | 9bcbc6f6627ae1571a01eac2e55a981c899c8c9f | cbac4e00edb5621094891661e69ffef85bf3e3b8 | refs/heads/master | 2020-04-07T08:40:37.705411 | 2018-11-19T13:37:38 | 2018-11-19T13:37:38 | 158,223,207 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,141 | java | package ices.sh.mbs.bean;
public class Location {
private String locationID;
private String locationName;
private double minX;
private double maxX;
private double minY;
private double maxY;
private String locationDescription;
public String getLocationID() {
return locationID;
}
public void setLocationID(String locationID) {
this.locationID = locationID;
}
public String getLocationName() {
return locationName;
}
public void setLocationName(String locationName) {
this.locationName = locationName;
}
public double getMinX() {
return minX;
}
public void setMinX(double minX) {
this.minX = minX;
}
public double getMaxX() {
return maxX;
}
public void setMaxX(double maxX) {
this.maxX = maxX;
}
public double getMinY() {
return minY;
}
public void setMinY(double minY) {
this.minY = minY;
}
public double getMaxY() {
return maxY;
}
public void setMaxY(double maxY) {
this.maxY = maxY;
}
public String getLocationDescription() {
return locationDescription;
}
public void setLocationDescription(String locationDescription) {
this.locationDescription = locationDescription;
}
}
| [
"hrbwy0451@gmail.com"
] | hrbwy0451@gmail.com |
735bb44d65004a4ee867c7876eefee0ef2d7e009 | f2fc9daad3bc12a0e7e457df936953bc4534a11d | /18-02-21-Spring整合jdbc模板对象/src/shun/_3_Spring事务管理演示/service/AccountServiceImpl.java | 72921cb55809e942d234f13b9b60f6c07364c250 | [] | no_license | chenzongshun/Spring-Struts-Hibernate | 06d4861f1c3fd1da5c9434aa7e90cd158c22b3f3 | df2025dcae634e94efeee2c35ecc428bdd1b2e20 | refs/heads/master | 2020-03-21T10:24:28.747175 | 2018-06-24T03:07:17 | 2018-06-24T03:07:17 | 138,449,283 | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 552 | java | package shun._3_Spring事务管理演示.service;
import shun._3_Spring事务管理演示.dao.AccountDao;
/**
* @author czs
* @version 创建时间:2018年2月21日 下午10:52:28
*/
public class AccountServiceImpl implements AccountService {
private AccountDao dao;
public void setDao(AccountDao dao) {
this.dao = dao;
}
@Override
public void transfer(Integer from, Integer to, double money) {
// 减钱
dao.jianMoney(from, money);
// @SuppressWarnings("unused")
// int i = 1/0;
// 加钱
dao.jiaMoney(to, money);
}
}
| [
"you@example.com"
] | you@example.com |
e73c1510c9c778d4ae052378e3f88b8dbc3deb39 | cfb306a27c754f0152f2fa379f7f5ef7d5ad258d | /src/com/mongoprocessor/types/CollectionPOJODescriptor.java | 3ea2fe11599142b781eaa6b78c94612a2e76ef82 | [] | no_license | ops-gaurav/Mongo-Schema-to-POJO | 345e2e0bb73b8ff33b5efe042566318d7b0d5d5b | 4754f3bd986e42a2bfc268d697b8f59906792ad2 | refs/heads/master | 2022-11-11T02:47:12.258167 | 2016-06-26T13:48:57 | 2016-06-26T13:48:57 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,149 | java | package com.mongoprocessor.types;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* a simple plain old java object representing the Collection Description to be used by the
* <code>CollectionCodeGenerator</code> to easily generate the java code
* @author gaurav
*/
public class CollectionPOJODescriptor {
public int rootPropertyCounter = 0;
public int totalPropertyCounter = 0;
public List<MongoElement> rootElementNames = new ArrayList<>();
public Map<MongoElement, List<MongoElement>> nestedDocuments = new HashMap<>();
public Map<MongoElement, List<MongoElement>> nestedArrays = new HashMap<>();
@Override
public String toString () {
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append("Total "+ totalPropertyCounter +" properties in this collection\n");
stringBuilder.append("Root contains "+ rootPropertyCounter + " properties\n");
stringBuilder.append("Collection Structure\n");
stringBuilder.append("root\n");
rootElementNames.forEach(consumer -> {
if (consumer.type != DocumentTypes.DOC_ARRAY || consumer.type != DocumentTypes.NESTED_DOCUMENT ||
consumer.type != DocumentTypes.RAW_ARRAY)
stringBuilder.append("\t"+ consumer.name+"\n");
});
rootElementNames.forEach(consumer -> {
if (consumer.type == DocumentTypes.NESTED_DOCUMENT) {
stringBuilder.append("\t"+ consumer.name +"\n");
nestedDocuments.get(consumer).forEach (consumer2 -> {
stringBuilder.append("\t\t"+ consumer2.name);
}) ;
stringBuilder.append("\n");
} else if (consumer.type == DocumentTypes.DOC_ARRAY) {
stringBuilder.append("\t"+ consumer.name +"\n");
nestedArrays.get(consumer).forEach(consumer2 -> {
stringBuilder.append("\t\t"+ consumer2.name);
});
stringBuilder.append("\n");
}
});
return stringBuilder.toString();
}
}
| [
"sharma02gaurav@icloud.com"
] | sharma02gaurav@icloud.com |
417693177d70d344214871ff9df2fb68329fe75e | 793c5187d794dc73b17c6a4c5ad56ec9f665b8e4 | /android/experiments/SpaceMermaid/src/com/toymoon/game/state/PlayState.java | a0ac8601d24ca5b4939625dc29b7d11f74cfba12 | [] | no_license | wcmaclean/home-repo | cb483a1aaac206a42fa20b6de9c0c7d533604c2a | ce8566abaa9dbc327059dc62eaea937a299fbc32 | refs/heads/master | 2020-05-15T20:09:09.580480 | 2019-04-23T18:57:30 | 2019-04-23T18:57:30 | 182,472,714 | 0 | 0 | null | 2019-04-21T01:56:34 | 2019-04-21T01:50:15 | null | UTF-8 | Java | false | false | 4,694 | java | package com.toymoon.game.state;
import java.util.ArrayList;
import java.util.Random;
import android.graphics.Color;
import android.graphics.Rect;
import android.graphics.Typeface;
import android.util.Log;
import android.view.MotionEvent;
import com.toymoon.framework.util.Painter;
import com.toymoon.model.Star;
import com.toymoon.simplegdf.Assets;
import com.toymoon.model.Bubbloid;
import com.toymoon.model.GamePiece;
import com.toymoon.model.Spider;
import com.toymoon.model.Eyefrown;
import com.toymoon.model.Mermaid;
import com.toymoon.framework.util.RandomNumberGenerator;
public class PlayState extends State{
private Mermaid mermaid;
//private Eyefrown eyefrown;
//private Bubbloid bubbloid;
//private Spider spider;
private ArrayList<Star> stars;
private int maxStars = 100;
Star star;
private ArrayList<GamePiece> gamePieces;
private int stage = 1;
private int playerScore = 0;
private int strikeout = 0;
private Random random = new Random();
@Override
public void init() {
mermaid = new Mermaid(0, 480-156, 71, 156);
star = new Star(23, 300);
stars = new ArrayList<Star>();
for (int i = 0; i<maxStars; i++){
stars.add(new Star(random.nextInt(380), random.nextInt(420)));
}
gamePieces = new ArrayList<GamePiece>();
//eyefrown = new Eyefrown(300, 140-34, 83, 34);
gamePieces.add(new Eyefrown(300, 140-34, 83, 34));
}
@Override
public void update(float delta) {
if (strikeout>=3) {
setCurrentState(new GameOverState(playerScore));
}
updateStars(delta);
Assets.mermaidAnimation.update(delta);
mermaid.update(delta);
//Assets.eyefrownAnimation.update(delta);
//if(eyefrown.update(delta)==false){
// playerScore++;
//}
updateGamePieces(delta);
checkForCollisions();
//checkForScores();
}
public void checkForCollisions(){
//if((Rect.intersects(mermaid.getRect(), eyefrown.getRect()))
// && (eyefrown.getGotHit()==false)){
// strikeout++;
// eyefrown.setGotHit();
//}
for(GamePiece g: gamePieces){
if((Rect.intersects(mermaid.getRect(), g.getRect()))
&& (g.getGotHit()==false)){
strikeout++;
Assets.playSound(Assets.dropSound);
g.setGotHit();
}
}
}
//public void checkForScores(){
// for(GamePiece g: gamePieces){
// if((g.getY()>=g.maxY)&&(g.getGotHit()!=true)){
// Assets.playSound(Assets.popSound);
// playerScore++;
// }
// }
// if((eyefrown.getX()>=eyefrown.maxY)&&
// (eyefrown.getGotHit()==false)){
// playerScore++;
// }
//}
@Override
public void render(Painter g) {
g.drawImage(Assets.background_blank, 0, 0);
renderStars(g);
renderMermaid(g);
//renderEyefrown(g);
renderScore(g);
renderStrikes(g);
renderGamePieces(g);
}
public boolean onTouch(MotionEvent e, int scaledX, int scaledY) {
if(e.getAction() == MotionEvent.ACTION_MOVE) {
if(mermaid.getRect().contains(scaledX, scaledY)){
mermaid.moveX(scaledX);
}
}
return true;
}
private void updateStars(float delta){
star.update(delta);
// iterate the array of bubbles
for(Star s: stars){
s.update(delta);
}
}
private void updateGamePieces(float delta){
for(GamePiece g: gamePieces){
g.updateAnimation(delta);
// and check for score
g.update(delta);
// check if there is a score
if((g.getY()>=g.maxY)&&(g.getGotHit()!=true)){
Assets.playSound(Assets.popSound);
playerScore++;
//g.reset();
}
if(g.getY()>=g.maxY){
g.reset();
}
}
if((playerScore==10)&&(stage==1)){
//spider = new Spider(120, 0, 87, 121);
gamePieces.add(new Spider(120, 0, 87, 121));
stage++;
}
if((playerScore==20)&&(stage==2)){
//bubbloid = new Bubbloid(160, 0, 93, 96);
gamePieces.add(new Bubbloid(160, 0, 93, 96));
stage++;
}
}
private void renderGamePieces(Painter g){
for(GamePiece gp: gamePieces){
gp.renderGamePiece(g);
}
}
// for some reason, Bubble.getRect() seems to have rect from spider instead of Bubble
private void renderStars(Painter g){
g.drawImage(Assets.star1, (int) star.getX(), (int) star.getY(), 10, 10);
for (Star s: stars){
g.drawImage(Assets.star1, (int) s.getX(), (int) s.getY(), 10, 10);
}
}
private void renderScore(Painter g){
g.setFont(Typeface.SANS_SERIF, 25);
g.setColor(Color.GREEN);
g.drawString(""+playerScore, 20, 30);
}
private void renderStrikes(Painter g){
g.setFont(Typeface.SANS_SERIF, 25);
g.setColor(Color.RED); // hor ver
g.drawString(""+strikeout, 280, 30);
}
private void renderMermaid(Painter g){
Assets.mermaidAnimation.render(g, (int)mermaid.getX(),
(int)mermaid.getY(), mermaid.getWidth(), mermaid.getHeight());
}
}
| [
"47467977+wcmaclean@users.noreply.github.com"
] | 47467977+wcmaclean@users.noreply.github.com |
29eb86d504c96d84fa821457ab923420a995d30c | 50eeacf730c67bfc5f989281e19d52f865a294c9 | /trunk/myfaces-impl-2021override/src/main/java/org/apache/myfaces/ov2021/view/facelets/tag/ui/UIDebug.java | f5c2fe0f239d41b353590ce879f46776d5228504 | [
"Apache-2.0"
] | permissive | lu4242/ext-myfaces-2.0.2-patch | 4dc5c2b49ce4a3cfc1261b78848bb3cea3b6d597 | 703d0dcf45469dbc69e84d8a607b913dd6be712a | refs/heads/master | 2021-01-10T19:09:03.293299 | 2014-04-04T13:03:06 | 2014-04-04T13:03:06 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,302 | java | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.myfaces.ov2021.view.facelets.tag.ui;
import java.io.IOException;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import javax.faces.component.UIComponent;
import javax.faces.component.UIComponentBase;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
import javax.servlet.http.HttpServletResponse;
import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFComponent;
import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFJspProperty;
import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFProperty;
import org.apache.myfaces.ov2021.renderkit.ErrorPageWriter;
import org.apache.myfaces.ov2021.view.facelets.util.FastWriter;
/**
* The debug tag will capture the component tree and variables when it is encoded,
* storing the data for retrieval later. You may launch the debug window at any time
* from your browser by pressing 'CTRL' + 'SHIFT' + 'D' (by default).
*
* The debug tag doesn't need to be used with the facelet.DEVELOPMENT parameter.
* The best place to put this tag is in your site's main template where it can be
* enabled/disabled across your whole application.
*
* If your application uses multiple windows, you might want to assign different
* hot keys to each one.
*
* @author Jacob Hookom
* @version $Id: UIDebug.java 1552845 2013-12-20 23:41:53Z lu4242 $
*/
@JSFComponent(name="ui:debug")
@JSFJspProperty(name = "binding", tagExcluded=true)
public final class UIDebug extends UIComponentBase
{
public static final String COMPONENT_TYPE = "facelets.ui.Debug";
public static final String COMPONENT_FAMILY = "facelets";
public static final String DEFAULT_HOTKEY = "D";
private static final String KEY = "facelets.ui.DebugOutput";
private static long nextId = System.currentTimeMillis();
private String _hotkey = DEFAULT_HOTKEY;
public UIDebug()
{
setTransient(true);
setRendered(true);
setRendererType(null);
}
public String getFamily()
{
return COMPONENT_FAMILY;
}
public List<UIComponent> getChildren()
{
return new ArrayList<UIComponent>()
{
public boolean add(UIComponent o)
{
throw new IllegalStateException("<ui:debug> does not support children");
}
public void add(int index, UIComponent o)
{
throw new IllegalStateException("<ui:debug> does not support children");
}
};
}
public void encodeBegin(FacesContext faces) throws IOException
{
boolean partialRequest = faces.getPartialViewContext().isPartialRequest();
String actionId = faces.getApplication().getViewHandler()
.getActionURL(faces, faces.getViewRoot().getViewId());
StringBuilder sb = new StringBuilder(512);
sb.append("<script language=\"javascript\" type=\"text/javascript\">\n");
if (!partialRequest)
{
sb.append("//<![CDATA[\n");
}
sb.append("function faceletsDebug(URL) { day = new Date(); id = day.getTime(); eval(\"page\" + id + \" = window.open(URL, '\" + id + \"', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=800,height=600,left = 240,top = 212');\"); };");
sb.append("var faceletsOrigKeyup = document.onkeyup; document.onkeyup = function(e) { if (window.event) e = window.event; if (String.fromCharCode(e.keyCode) == '"
+ this.getHotkey() + "' & e.shiftKey & e.ctrlKey) faceletsDebug('");
sb.append(actionId);
int index = actionId.indexOf ("?");
if (index != -1)
{
sb.append('&');
}
else
{
sb.append('?');
}
sb.append(KEY);
sb.append('=');
sb.append(writeDebugOutput(faces));
sb.append("'); else if (faceletsOrigKeyup) faceletsOrigKeyup(e); };\n");
if (!partialRequest)
{
sb.append("//]]>\n");
}
sb.append("</script>\n");
ResponseWriter writer = faces.getResponseWriter();
writer.write(sb.toString());
}
@SuppressWarnings("unchecked")
private static String writeDebugOutput(FacesContext faces) throws IOException
{
FastWriter fw = new FastWriter();
ErrorPageWriter.debugHtml(fw, faces);
Map<String, Object> session = faces.getExternalContext().getSessionMap();
Map<String, String> debugs = (Map<String, String>) session.get(KEY);
if (debugs == null)
{
debugs = new LinkedHashMap<String, String>()
{
protected boolean removeEldestEntry(Entry<String, String> eldest)
{
return (this.size() > 5);
}
};
session.put(KEY, debugs);
}
String id = String.valueOf(nextId++);
debugs.put(id, fw.toString());
return id;
}
@SuppressWarnings("unchecked")
private static String fetchDebugOutput(FacesContext faces, String id)
{
Map<String, Object> session = faces.getExternalContext().getSessionMap();
Map<String, String> debugs = (Map<String, String>) session.get(KEY);
if (debugs != null)
{
return debugs.get(id);
}
return null;
}
public static boolean debugRequest(FacesContext faces)
{
String id = (String) faces.getExternalContext().getRequestParameterMap().get(KEY);
if (id != null)
{
Object resp = faces.getExternalContext().getResponse();
if (!faces.getResponseComplete() && resp instanceof HttpServletResponse)
{
try
{
HttpServletResponse httpResp = (HttpServletResponse) resp;
String page = fetchDebugOutput(faces, id);
if (page != null)
{
httpResp.setContentType("text/html");
httpResp.getWriter().write(page);
}
else
{
httpResp.setContentType("text/plain");
httpResp.getWriter().write("No Debug Output Available");
}
httpResp.flushBuffer();
faces.responseComplete();
}
catch (IOException e)
{
return false;
}
return true;
}
}
return false;
}
@JSFProperty(tagExcluded=true)
@Override
public String getId()
{
// TODO Auto-generated method stub
return super.getId();
}
/**
* The hot key to use in combination with 'CTRL' + 'SHIFT' to launch the debug window.
* By default, when the debug tag is used, you may launch the debug window with
* 'CTRL' + 'SHIFT' + 'D'. This value cannot be an EL expression.
*
* @return
*/
@JSFProperty
public String getHotkey()
{
return _hotkey;
}
public void setHotkey(String hotkey)
{
_hotkey = (hotkey != null) ? hotkey.toUpperCase() : "";
}
}
| [
"lu4242@gmail.com"
] | lu4242@gmail.com |
3c34ff5a51ef470a3a8e6f4a2f08c4062cce9080 | 6bbc1eb746222ca7a35ec613247b82bc59d1c9f7 | /chat-server/src/main/java/com/timberliu/chat/server/bean/dto/AccessLogCreateDTO.java | 26e21a9237d0d222cc400965eeb513cf568f8eec | [
"Apache-2.0"
] | permissive | liujie0813/TChat | f111bbcfc2b98e0e3d117118f79069e81009cda8 | e0be5c6241ad9ef1bfe60ee81bfbe21f72e058fe | refs/heads/master | 2023-08-24T15:00:56.211129 | 2021-10-14T11:29:50 | 2021-10-14T11:29:50 | 395,593,275 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 616 | java | package com.timberliu.chat.server.bean.dto;
import lombok.Data;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.Date;
/**
* @author liujie
* @date 2021/9/28
*/
@Data
@Accessors(chain = true)
public class AccessLogCreateDTO implements Serializable {
private Long userId;
private String traceId;
private String applicationName;
private String uri;
private String queryString;
private String method;
private String userAgent;
private String ip;
private Date startTime;
private Integer responseTime;
private Integer errorCode;
private String errorMsg;
}
| [
"18220747087@163.com"
] | 18220747087@163.com |
a9959888278a7408c33e4c760dbb3fd1421613a9 | 90d6daa6111d6b88ba105457f097151ecb22c109 | /search insert position.java | 9f248614ee77410ed11bac2bd4c3a35d0afd2354 | [] | no_license | gongzitao/algorithm-problem | 3e6f7ae3a82eaf07c31cade64f5215a226fc204c | 882a03a8cc3dcface007f44224fc610327f4b6cf | refs/heads/master | 2021-01-10T20:06:47.575068 | 2015-02-04T19:31:06 | 2015-02-04T19:31:06 | 26,347,679 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 537 | java | public class Solution {
public int searchInsert(int[] A, int target) {
int res = 0;
if(A == null || A.length == 0) return 0;
//if(target < A[0]) return 0;
//if(target > A[A.length - 1]) return A.length;
int left = 0;
int right = A.length - 1;
while(left <= right){
int mid = (left + right) / 2;
if(A[mid] == target) return mid;
else if(A[mid] > target) right = mid - 1;
else left = mid + 1;
}
return left;
}
} | [
"gongzier@gmail.com"
] | gongzier@gmail.com |
8d1a9020e3b307b27c209cf9c17dd0bf3e8a23b1 | ef9a8ac330faa2c3fd2bdbcc554af070afb17fea | /qstool-common/src/main/java/com/qs/libs/qstoolcommon/enums/common/SystemCodeEnum.java | caceef641aacb81639ee14a2f21996f48e3a209b | [
"Apache-2.0"
] | permissive | qiansheng1987/springboot-family | 487bb4bb66d94c13b7ec490c2d1d7ad4a6ccb4be | 0bfda659072ca1ed35f6a30ff80a4a92c28ab60b | refs/heads/main | 2023-07-29T05:14:26.054837 | 2021-09-08T06:57:30 | 2021-09-08T06:57:30 | 402,035,372 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 909 | java | package com.qs.libs.qstoolcommon.enums.common;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* 系统代码枚举
*
* @author qiansheng
* @date 2021/8/9 11:12
*/
@Getter
@AllArgsConstructor
public enum SystemCodeEnum implements ICommonEnum<Integer, String>{
/**
* 成功
*/
SUCCESS(200, "成功!"),
SYSTEM_UNKNOWN_ERROR(10, "系统未知异常,请联系管理员!"),
SERVICE_ERROR(11, "服务异常!"),
SERVICE_NOT_AVAILABLE(12, "当前服务暂不可用!"),
SERVICE_UPGRADING(13, "服务升级中!"),
PERMISSION_QUERY_DENIED(14, "没有数据查询权限!"),
BIZ_LOGIC_ERROR(2000, "业务逻辑异常!");
private Integer code;
private String message;
@Override
public Integer code() {
return this.getCode();
}
@Override
public String message() {
return this.getMessage();
}
}
| [
"qiansheng@yunji.ai"
] | qiansheng@yunji.ai |
d28ba53315c36f215f8ada09283ab6ce165a6210 | 3427150e6c04c314d1affe1a0b411a8c1b56cad6 | /src/main/java/com/platzi/ereservation/negocio/repository/ReservaRepository.java | b2aa38e0eeaa38c0854537e4363cb86120e53f0d | [] | no_license | jfburgos55/ProyectoSpringBoot | 359a63af8b903f9eaff1106a71bf88952417fcc9 | ec06a578a76a3a9939e25e95d9ec7e6a717a523b | refs/heads/master | 2022-11-30T01:38:15.198363 | 2020-08-07T16:11:31 | 2020-08-07T16:11:31 | 285,862,163 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 636 | java | package com.platzi.ereservation.negocio.repository;
import java.util.Date;
import java.util.List;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import com.platzi.ereservation.modelo.Reserva;
public interface ReservaRepository extends JpaRepository<Reserva, String> {
@Query("Select r from Reserva r where r.fechaIngresoRes =: fechaInicio and r.fechaSalidaRes =: fechaSalida")
public List<Reserva> find(@Param("fechaInicio") Date fechaInicio, @Param("fechaSalida") Date fechaSalida);
}
| [
"jfburgos55@misena.edu.co"
] | jfburgos55@misena.edu.co |
7175f487d3cf4b3f277714e58946b704b201f9be | 942c2b838b86ab3d8ab54f41ec2b8f6b0147960c | /springboot-basic-util/src/test/java/com/liziyuan/hope/util/redis/RedisTest.java | 3f911877bf342334e3bcedfdc9eb24100c6dbc5f | [] | no_license | zhangqingzhou1024/springboot-basic | 1690f806400aa1e9c9792960a45f540d5dc68a7c | fdcc95af2492ba96155020bbb7d10fe3cc306f81 | refs/heads/master | 2022-11-20T17:09:11.492210 | 2020-04-22T14:17:24 | 2020-04-22T14:17:24 | 253,025,720 | 0 | 0 | null | 2022-11-16T09:00:25 | 2020-04-04T15:00:38 | Java | UTF-8 | Java | false | false | 933 | java | package com.liziyuan.hope.util.redis;
import com.liziyuan.hope.util.main.RunApp;
import lombok.extern.log4j.Log4j2;
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.ActiveProfiles;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.context.web.WebAppConfiguration;
/**
* redis 方法校验
*
* @author zqz
* @version 1.0
* @date 2020-04-02 22:19
*/
@RunWith(SpringRunner.class)
@SpringBootTest(classes = RunApp.class)
@WebAppConfiguration
@ActiveProfiles("dev")
public class RedisTest {
@Autowired
RedisUtil redisUtil;
@Test
public void addTest() {
redisUtil.set("test", "zqz");
String test = redisUtil.getStrVal("test");
System.out.println("val->" + test);
}
}
| [
"1421210148@qq.com"
] | 1421210148@qq.com |
91627a5c14bd3b58bef0a66d976bdeeb806bccb7 | a0caa255f3dbe524437715adaee2094ac8eff9df | /HOLD/sources/defpackage/oc.java | ad86b0483ccfc7302e7ccabbee8402f3ead0c4d7 | [] | no_license | AndroidTVDeveloper/com.google.android.tvlauncher | 16526208b5b48fd48931b09ed702fe606fe7d694 | 0f959c41bbb5a93e981145f371afdec2b3e207bc | refs/heads/master | 2021-01-26T07:47:23.091351 | 2020-02-26T20:58:19 | 2020-02-26T20:58:19 | 243,363,961 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 539 | java | package defpackage;
import android.util.Property;
/* renamed from: oc reason: default package */
/* compiled from: PG */
public final class oc extends Property {
public oc(Class cls, String str) {
super(cls, str);
}
public final /* bridge */ /* synthetic */ Object get(Object obj) {
blk blk = (blk) obj;
throw null;
}
public final /* bridge */ /* synthetic */ void set(Object obj, Object obj2) {
blk blk = (blk) obj;
((Float) obj2).floatValue();
throw null;
}
}
| [
"eliminater74@gmail.com"
] | eliminater74@gmail.com |
1f9fc89e3b6c77df32ba91ccf8ca6fbba5da9947 | 79b621f11ac9044226ea161e9db029bf1c02f714 | /src/main/java/main/repository/ManagerFacade.java | d229134a8fbe87662d6d71d7c7b1782f9a54251b | [] | no_license | MihaiFilipDud/Proict_PS | 96c30cb280753ce2c6c5e32b5698f4cb379db9b5 | 8ba44db75af208cba5c54f7af1c3e326991ee4b4 | refs/heads/master | 2022-12-13T06:53:21.571424 | 2020-08-26T20:58:00 | 2020-08-26T20:58:00 | 249,222,156 | 0 | 0 | null | 2022-11-24T07:12:49 | 2020-03-22T16:16:26 | Java | UTF-8 | Java | false | false | 678 | java | package main.repository;
import main.entity.Plane;
import main.entity.PlaneSchedule;
import org.springframework.stereotype.Component;
import java.util.Date;
import java.util.List;
/**
* Interfata de facade a backendului unui manager.
*/
@Component
public interface ManagerFacade {
public static ManagerFacade getManagerRepository (){
return new ManagerRepository();
}
Plane addPlane(Plane plane);
PlaneSchedule addFlight(String code, String airport, String destination, Date arrival, Date departure, String status, String plane);
List<Plane> getPlanes(String company);
String deletePlane(String id);
String deleteFlight(String code);
}
| [
"mihaifilipdud@gmail.com"
] | mihaifilipdud@gmail.com |
db8fc59c06b329edfd6255ff862e7950e11ac34e | 7cff15628d0817b683924fc58f7717024c535d9e | /SportsMatrix-Android/NFL_Sim_Game.java | 16bb9ebfcaa20dd4bb0607b7bea51d9a2b060de3 | [] | no_license | wkpescherine/Projects-2020 | 2871163699e340cc37926427c60487f12ea1c690 | 8d9148c9428350ee3ecb090df271c8546c603815 | refs/heads/master | 2023-02-04T04:58:28.766567 | 2020-12-26T04:07:26 | 2020-12-26T04:07:26 | 282,789,215 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,470 | java | package com.example.sportsmatrix_v2;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.text.Layout;
import android.widget.Button;
import android.view.View;
import android.os.Bundle;
import android.view.WindowManager;
import android.widget.LinearLayout;
import android.widget.TextView;
public class NFL_Sim_Game extends AppCompatActivity {
NFLPlayerStats nflPlayer = new NFLPlayerStats();
String [] playerTeam = {"None"};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_nfl__sim__game);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
getSupportActionBar().hide();
}
public void pickQB(View v){
setContentView(R.layout.nfl_pick_player);
PopulatePlayers("QB");
}
public void pickRB(View v){
setContentView(R.layout.nfl_pick_player);
PopulatePlayers("RB");
}
public void startGame(View v){
Button homeBTN = findViewById(R.id.homeBTN);
LinearLayout roster = findViewById(R.id.playerChoices);
roster.setVisibility(View.INVISIBLE);
homeBTN.setVisibility(View.INVISIBLE);
}
public void PopulatePlayers(String position){
for (int a =0; a<= 1; a++){
int playerToPopulate = a;
switch(position){
case "QB":
if(playerToPopulate == 0){
TextView p1 = findViewById(R.id.player1);
p1.setText(nflPlayer.Quarterback[a]);
};
break;
case "RB":
if(playerToPopulate == 0){
TextView p1 = findViewById(R.id.player1);
p1.setText(nflPlayer.RunningBack[a]);
};
break;
case "WR":
if(playerToPopulate == 0){
TextView p1 = findViewById(R.id.player1);
p1.setText(nflPlayer.WideReceiver[a]);
};
}
}
}
public void Return(View v){
setContentView(R.layout.activity_nfl__sim__game);
}
public void Home(View v){
Intent intent = new Intent(this, SportChoice.class);
startActivity(intent);
}
}//80 | [
"noreply@github.com"
] | noreply@github.com |
081892b25b6d815fd3130d67b8d27d060c23685a | c428fa269defa5b0d0e7f571e79b03b5a1f4aeb5 | /src/main/java/com/example/demo/dao/ApplicationDao.java | be009e4831f947a55217156a68ca1b48c9ad47b3 | [] | no_license | Carey6918/Learn. | e2979647b2dfd403d17a313c9f07c72b6d3ab3a3 | 682ff345f3ba3c077ca718098b4842e83b54f61e | refs/heads/master | 2020-03-20T04:22:50.558063 | 2018-06-29T12:42:46 | 2018-06-29T12:42:46 | 137,180,356 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 676 | java | package com.example.demo.dao;
import com.example.demo.model.InstitutionApplication;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import javax.transaction.Transactional;
import java.util.List;
public interface ApplicationDao extends JpaRepository<InstitutionApplication, Integer> {
InstitutionApplication save(InstitutionApplication institutionApplication);
@Query("select a from InstitutionApplication a ")
List<InstitutionApplication> getList();
InstitutionApplication findByApplicationID(int applicationID);
@Transactional
void deleteByApplicationID(int applicationID);
}
| [
"727929807@qq.com"
] | 727929807@qq.com |
eb1a8b7567a31fc27094fb082e025fe31d460343 | 872775d142e9269681d331844ce0d0892ef4ebce | /src/com/hm/effective_java/chapter_three/composition/Point.java | 2ea8235468f1c2bf3bedf4297f0b6307ba8a1f92 | [] | no_license | humanheima/JavaBase | b756274931b21040ca80a74ac00dc7a20ff7b92b | dba8fc5940f16795a0c2bad34d639f5e5713c8f6 | refs/heads/master | 2023-06-08T20:02:31.280986 | 2023-05-25T10:04:40 | 2023-05-25T10:04:40 | 88,835,885 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 479 | java | // Simple immutable two-dimensional integer point class - Page 37
package com.hm.effective_java.chapter_three.composition;
public class Point {
private final int x;
private final int y;
public Point(int x, int y) {
this.x = x;
this.y = y;
}
@Override
public boolean equals(Object o) {
if (!(o instanceof Point))
return false;
Point p = (Point) o;
return p.x == x && p.y == y;
}
// See Item 9
@Override
public int hashCode() {
return 31 * x + y;
}
}
| [
"humanheima@gmail.com"
] | humanheima@gmail.com |
3f7789da8d835d6a561ede1666a1c14959012bdf | 01ef5aafb745ca655f3a21e132854eab941e6153 | /src/main/java/org/apache/tomee/website/contributors/Github.java | 446944492efd9f71e04d1e89aa8253748c9beccc | [] | no_license | apache/tomee-site-generator | a8a9ac7940269354400bb07333ca08aaff6d338f | 0b028aaac820624aa6623fe9b222d78acb9300e1 | refs/heads/main | 2023-08-18T05:48:31.502044 | 2023-06-12T11:25:30 | 2023-06-12T11:25:30 | 96,287,283 | 10 | 48 | null | 2023-03-23T19:33:47 | 2017-07-05T07:00:07 | Java | UTF-8 | Java | false | false | 5,548 | java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.tomee.website.contributors;
import org.apache.johnzon.jaxrs.JohnzonProvider;
import org.apache.openejb.loader.IO;
import org.tomitribe.swizzle.stream.StreamBuilder;
import javax.json.bind.Jsonb;
import javax.json.bind.JsonbBuilder;
import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.Response;
import java.io.IOException;
import java.io.InputStream;
import java.io.UncheckedIOException;
import java.net.URI;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.logging.Logger;
import java.util.stream.Collectors;
import java.util.stream.Stream;
public class Github {
private static final Logger log = Logger.getLogger(Github.class.getName());
private final Client client = ClientBuilder.newClient().register(new JohnzonProvider<>());
public List<Contributor> getContributors() {
final List<URI> repositoryURIs = getRepositoryURIs();
final List<Contributor> list = repositoryURIs.stream()
.map(this::getContributorsForRepository)
.flatMap(Collection::stream)
.collect(Collectors.toList());
return Contributor.unique(list);
}
/**
* List all the repositories for Apache TomEE
*/
public List<URI> getRepositoryURIs() {
try {
final WebTarget github = client.target("https://github.com");
final String content = github.path("/apache").queryParam("q", "tomee").request().get(String.class);
final List<String> links = new ArrayList<String>();
StreamBuilder.create(IO.read(content))
.watch("href=\"/apache/tomee", "\"", links::add)
.run();
return links.stream()
.filter(s -> !s.contains("/"))
.filter(s -> !s.equals("-site-pub"))
.filter(s -> !s.equals("-site"))
.distinct()
.map(s -> "https://github.com/apache/tomee" + s)
.map(URI::create)
.collect(Collectors.toList());
} catch (IOException e) {
throw new UncheckedIOException("Unable to list TomEE repositories", e);
}
}
/**
* Get the contributor-data json for the specified repository
*/
private List<Contributor> getContributorsForRepository(final URI repositoryUri) {
final Response response = client.target(repositoryUri.toASCIIString())
.path("graphs/contributors-data")
.request()
.header("referer", repositoryUri.toASCIIString() + "/graphs/contributors")
.header("authority", "github.com")
.header("pragma", "no-cache")
.header("cache-control", "no-cache")
.header("sec-ch-ua", "\" Not A;Brand\";v=\"99\", \"Chromium\";v=\"90\", \"Google Chrome\";v=\"90\"")
.header("accept", "application/json")
.header("sec-ch-ua-mobile", "?0")
.header("user-agent", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36")
.header("sec-fetch-site", "same-origin")
.header("sec-fetch-mode", "cors")
.header("sec-fetch-dest", "empty")
.header("accept-language", "en-US,en;q=0.9,es;q=0.8")
.get();
if (response.getStatus() != 200) {
log.severe("Unexpected status from " + repositoryUri + ": " + response.getStatus());
return Collections.EMPTY_LIST;
}
if (!response.getHeaderString("content-type").startsWith("application/json")) {
log.severe("Unexpected content-type from " + repositoryUri + ": " + response.getHeaderString("content-type"));
return Collections.EMPTY_LIST;
}
final String json;
try {
json = IO.slurp((InputStream) response.getEntity());
} catch (IOException e) {
throw new UncheckedIOException("Unable to read response from " + repositoryUri, e);
}
final ContributorData[] data;
try {
final Jsonb jsonb = JsonbBuilder.create();
data = jsonb.fromJson(json, ContributorData[].class);
} catch (final Exception e) {
throw new IllegalStateException("Unable to unmarshal response from " + repositoryUri + "\n\n" + json, e);
}
return Stream.of(data)
.map(ContributorData::asContributor)
.collect(Collectors.toList());
}
}
| [
"david.blevins@gmail.com"
] | david.blevins@gmail.com |
c762cc415ed3a1b04bf3fbb66ae02b0535c0dbc9 | 39fc91a4734fea3c39fd1ddd6f65561e36b24d8c | /SmartPlugUDPServer/src/com/thingzdo/smartplug/udpserver/Function/UserRegisterMsgHandle.java | c5b0a88cc71a172584911103aee432c321b9a7b3 | [] | no_license | smli123/03thingzdo | c5035de4459e3d8c15b24a5c76803da85b2d668d | f04f88b8e51773011f6f66d255fd1f1996fb4062 | refs/heads/master | 2020-03-28T13:50:20.791068 | 2019-01-20T07:50:24 | 2019-01-20T07:50:24 | 148,432,718 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,037 | java | package com.thingzdo.smartplug.udpserver.Function;
import com.thingzdo.platform.LogTool.LogWriter;
import com.thingzdo.platform.PWDTool.PWDManagerTool;
import com.thingzdo.smartplug.udpserver.ServerWorkThread;
import com.thingzdo.smartplug.udpserver.commdef.ICallFunction;
import com.thingzdo.smartplug.udpserver.commdef.ServerCommDefine;
import com.thingzdo.smartplug.udpserver.commdef.ServerRetCodeMgr;
import com.thingzdo.smartplug.udpserver.db.ServerDBMgr;
import com.thingzdo.smartplug.udpserver.db.USER_INFO;
public class UserRegisterMsgHandle implements ICallFunction{
/**********************************************************************************************************
* @name RegisterMsgHandle 新用户注册
* @param strMsg: 命令字符串 格式:<cookie>,REG,<username>,<version>,<pwd>,<email>
* @RET <new_cookie>,REG, <username>,<moduleid>,<code>
* @return boolean 是否注册成功
* @author zxluan
* @date 2015/03/24
* **********************************************************************************************************/
public int call(Runnable thread_base, String strMsg)
{
String strRet[] = strMsg.split(ServerCommDefine.CMD_SPLIT_STRING);
String strMsgHeader = strRet[1].trim();
String strUserName = strRet[2].trim();
String strPass = strRet[4].trim();
String strEmail = strRet[5].trim();
ServerWorkThread thread = (ServerWorkThread)thread_base;
ServerDBMgr dbMgr = new ServerDBMgr();
try
{
//将用户密码MD5加密
String pass_md5 = PWDManagerTool.generatePassword(strPass);
if(dbMgr.IsUserNameExist(strUserName))
{
//APP用户名已注册
ResponseToAPPWithDefaultCookie(thread, strMsgHeader, strUserName,
ServerCommDefine.DEFAULT_MODULE_ID,
ServerRetCodeMgr.ERROR_CODE_USER_NAME_REGISTERED);
return ServerRetCodeMgr.ERROR_CODE_USER_NAME_REGISTERED;
}
if(dbMgr.IsEmailExist(strEmail))
{
//APP邮箱已注册
ResponseToAPPWithDefaultCookie(thread, strMsgHeader, strUserName,
ServerCommDefine.DEFAULT_MODULE_ID,
ServerRetCodeMgr.ERROR_CODE_EMAIL_REGISTERED);
return ServerRetCodeMgr.ERROR_CODE_EMAIL_REGISTERED;
}
//将用户名及密码写入数据库
dbMgr.InsertUserInfo(new USER_INFO(strUserName,pass_md5,strEmail,ServerCommDefine.DEFAULT_COOKIE));
ServerWorkThread.RegisterUserIP(strUserName, thread.getSrcIP(), thread.getSrcPort());
//通知APP注册成功
ResponseToAPP(strMsgHeader, strUserName, ServerRetCodeMgr.SUCCESS_CODE);
LogWriter.WriteTraceLog(LogWriter.SELF,
String.format("(%s:%d)\t Succeed to Register(%s). ",
thread.getSrcIP(),thread.getSrcPort(),strUserName));
return ServerRetCodeMgr.SUCCESS_CODE;
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
return ServerRetCodeMgr.ERROR_COMMON;
}
finally
{
dbMgr.Destroy();
}
}
@Override
public int resp(Runnable thread_base, String strMsg) {
// TODO Auto-generated method stub
return 0;
}
}
| [
"lishimin@gmail.com"
] | lishimin@gmail.com |
f8c37c55cc4132dae46cb8730458b50b8273ce92 | ef0c1514e9af6de3ba4a20e0d01de7cc3a915188 | /sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentsWhatIfAtSubscriptionScopeResponse.java | 69622a1be5d89568296ca6e8648c759db18ca6b9 | [
"MIT",
"LicenseRef-scancode-warranty-disclaimer",
"LicenseRef-scancode-unknown-license-reference",
"LGPL-2.1-or-later",
"CC0-1.0",
"BSD-3-Clause",
"UPL-1.0",
"Apache-2.0",
"LicenseRef-scancode-public-domain",
"BSD-2-Clause",
"LicenseRef-scancode-generic-cla"
] | permissive | Azure/azure-sdk-for-java | 0902d584b42d3654b4ce65b1dad8409f18ddf4bc | 789bdc6c065dc44ce9b8b630e2f2e5896b2a7616 | refs/heads/main | 2023-09-04T09:36:35.821969 | 2023-09-02T01:53:56 | 2023-09-02T01:53:56 | 2,928,948 | 2,027 | 2,084 | MIT | 2023-09-14T21:37:15 | 2011-12-06T23:33:56 | Java | UTF-8 | Java | false | false | 1,602 | java | // Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.resources.models;
import com.azure.core.http.HttpHeaders;
import com.azure.core.http.HttpRequest;
import com.azure.core.http.rest.ResponseBase;
import com.azure.resourcemanager.resources.fluent.models.WhatIfOperationResultInner;
/** Contains all response data for the whatIfAtSubscriptionScope operation. */
public final class DeploymentsWhatIfAtSubscriptionScopeResponse
extends ResponseBase<DeploymentsWhatIfAtSubscriptionScopeHeaders, WhatIfOperationResultInner> {
/**
* Creates an instance of DeploymentsWhatIfAtSubscriptionScopeResponse.
*
* @param request the request which resulted in this DeploymentsWhatIfAtSubscriptionScopeResponse.
* @param statusCode the status code of the HTTP response.
* @param rawHeaders the raw headers of the HTTP response.
* @param value the deserialized value of the HTTP response.
* @param headers the deserialized headers of the HTTP response.
*/
public DeploymentsWhatIfAtSubscriptionScopeResponse(
HttpRequest request,
int statusCode,
HttpHeaders rawHeaders,
WhatIfOperationResultInner value,
DeploymentsWhatIfAtSubscriptionScopeHeaders headers) {
super(request, statusCode, rawHeaders, value, headers);
}
/** @return the deserialized response body. */
@Override
public WhatIfOperationResultInner getValue() {
return super.getValue();
}
}
| [
"noreply@github.com"
] | noreply@github.com |