blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 4
410
| content_id
stringlengths 40
40
| detected_licenses
sequencelengths 0
51
| license_type
stringclasses 2
values | repo_name
stringlengths 5
132
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringlengths 4
80
| visit_date
timestamp[us] | revision_date
timestamp[us] | committer_date
timestamp[us] | github_id
int64 5.85k
689M
⌀ | star_events_count
int64 0
209k
| fork_events_count
int64 0
110k
| gha_license_id
stringclasses 22
values | gha_event_created_at
timestamp[us] | gha_created_at
timestamp[us] | gha_language
stringclasses 131
values | src_encoding
stringclasses 34
values | language
stringclasses 1
value | is_vendor
bool 1
class | is_generated
bool 2
classes | length_bytes
int64 3
9.45M
| extension
stringclasses 32
values | content
stringlengths 3
9.45M
| authors
sequencelengths 1
1
| author_id
stringlengths 0
313
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
b54d228d0fb3d24a135fa0141139ca03d8b1a23b | 30de109d18aafd966b46632187af64f6eaa81684 | /src/Day4/_03_ExtraExample.java | 9045adea4fd63f6374d4bd56f9d50568e4d154a4 | [] | no_license | albertLope/SeleniumPracticeClass | 7cbe31f65f7cddca2ea25b0388c07cb97b084e71 | a4946f63afcce4b6f99a8c4a89b33f5d22bd99c9 | refs/heads/master | 2022-11-19T05:38:28.932174 | 2020-07-09T17:24:52 | 2020-07-09T17:24:52 | 273,408,521 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,298 | java | package Day4;
import org.junit.Assert;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
public class _03_ExtraExample {
public static void main(String[] args) {
/*
There are 2 ways to find the elements
1) id
2) Css selector
We should not use Class because of the emailorPhoneNumber input and password input has same class Name that is why we can not use it.
First give them some time and let them solve it. Then we can show all of them all the ways.
NOTE: Code is not failing when we use the class name because when we use the class name. It is because if we dont have the password
I am still able to login to website. Password is typing in the EmailOrPassword input we can show it
*/
System.setProperty("webdriver.chrome.driver", "D:\\Selenium dependency\\drivers\\chromedriver.exe");
// open the browser
WebDriver driver = new ChromeDriver();
driver.get("http://demo.guru99.com/test/facebook.html");
driver.manage().window().maximize();
String email = "[email protected]";
// WebElement emailOrPhone = driver.findElement(By.id("email"));
WebElement emailOrPhone = driver.findElement(By.className("inputtext")); //check line 39 it has the same class name
// WebElement emailOrPhone = driver.findElement(By.cssSelector("input[name='email']"));
emailOrPhone.sendKeys(email);
String password = "thisIsValidPassword";
// WebElement passwordElement = driver.findElement(By.id("pass"));
WebElement passwordElement = driver.findElement(By.className("inputtext")); //HERE CODE WILL TYPE IN THE EMAILANDPASSWORD BEACUSE OF THE SAME CLASS NAME
// WebElement passwordElement = driver.findElement(By.cssSelector("input[name='pass']"));
passwordElement.sendKeys(password);
WebElement loginButton = driver.findElement(By.id("loginbutton"));
loginButton.click();
// Question: How to check URL contains the www.facebook or not
String url = driver.getCurrentUrl();
Assert.assertTrue(url.contains("www.facebook"));
}
}
| [
"[email protected]"
] | |
5ef3c1a32ded82623cdfdd5a4ec514330d0912e5 | 68a134243f6a4d8a7a971a6c7477b516c8a99ffb | /src/com/thread/dedlockexample/Account.java | cc39187a38df133665d8d619c14826b5ccca5c71 | [] | no_license | simran1991/BasicJavaExampes | e66eacaf43df054dbcb8e8d1b16bdcc719d00755 | f80333ada4f50993e6f11950bd5e282081883ba0 | refs/heads/master | 2021-01-25T08:14:09.444108 | 2017-06-08T11:15:38 | 2017-06-08T11:15:38 | 93,740,819 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 378 | java | package com.thread.dedlockexample;
public class Account {
private int balance=10000;
public void deposit(int amount){
balance += amount;
}
public void withdraw(int amount){
balance-=amount;
}
public int getBalance(){
return balance;
}
public static void transfer(Account acc1,Account acc2,int amount){
acc1.withdraw(amount);
acc2.deposit(amount);
}
}
| [
"[email protected]"
] | |
cd38767a8a211e8aa0f12ca1f4a3d35b1ca0fe85 | 2455a3a14c198769fb6fa4da5c7ea0a472b909be | /netty-heima/src/main/java/netty/enhance/chart/protocol/MessageCodecSharable.java | d29b7d79adc2a26be2217d33815d560233c01139 | [] | no_license | csliujw/netty-study | 6813add51c3057af89595995cfc4c594a1347a4a | 49ea952473a373db73a158b38bb144f48c902de0 | refs/heads/main | 2023-08-29T04:09:31.921500 | 2021-11-10T05:12:38 | 2021-11-10T05:12:38 | 426,492,534 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,096 | java | package netty.enhance.chart.protocol;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandler;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToMessageCodec;
import lombok.extern.slf4j.Slf4j;
import netty.enhance.chart.message.Message;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.util.List;
@Slf4j
@ChannelHandler.Sharable
// 必须和 LengthFieldBasedFrameDecoder 一起使用,确保街道的 ByteBuf 消息是完整的
public class MessageCodecSharable extends MessageToMessageCodec<ByteBuf, Message> {
@Override
protected void encode(ChannelHandlerContext ctx, Message msg, List<Object> outList) throws Exception {
ByteBuf out = ctx.alloc().buffer();
// 1. 加入四个字节的魔数字
out.writeBytes(new byte[]{1, 2, 3, 4});
// 2. 加入版本
out.writeByte(1);
// 3. 序列化算法,用 jdk 作为序列化算法。1 字节的序列化方式
out.writeByte(0);
// 4. 1 字节的指令类型。为什么指令类型是一个字节?
out.writeByte(msg.getMessageType());
// 5. 请求序号 四个字节
out.writeInt(msg.getSequenceId());
// 无意义,仅对齐填充
out.writeByte(0xff);
// 6. 长度
// 7. 读取内容的字节数组
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
ObjectOutputStream outputStream = new ObjectOutputStream(byteArrayOutputStream);
outputStream.writeObject(msg);
byte[] bytes = byteArrayOutputStream.toByteArray();
// 写入长度
out.writeInt(bytes.length);
// 写入内容
out.writeBytes(bytes);
}
@Override
// netty 约定了,解码的结果要存到 List 里面去,不然接下来的 handler 拿不到结果。
protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception {
// 拿到的一定是完整的数据
int magicNum = in.readInt();
byte version = in.readByte();
byte serializerType = in.readByte();
byte messageType = in.readByte();
int sequenceId = in.readInt();
in.readByte();
int len = in.readInt();
byte[] bytes = new byte[len];
ByteBuf buf = in.readBytes(bytes, 0, len);
Message msg = null;
System.out.println(serializerType);
if (serializerType == 0) {// jdk 序列化方式
// 把 bytes 数组读出来。
ObjectInputStream objectInputStream = new ObjectInputStream(new ByteArrayInputStream(bytes));
msg = (Message) objectInputStream.readObject();
// magicNum = 16909060 就是 十六进制的 01020304
log.debug("{} {} {} {} {} {}", magicNum, version, serializerType, messageType, sequenceId, len);
log.debug("{}", msg);
out.add(msg);// 确保后面的 handler 可以拿到数据。
}
}
}
| [
"[email protected]"
] | |
815873760eea3759b35ebd6510760f75f2b7bdbf | 7b0c804280e9159e13ed65fe15de897a3a11247b | /Lab5-main/src/exceptions/InvalidArgument.java | 700488a6549cce39884b0b1f65d6cc59e7581a8e | [] | no_license | Deadshotop/Lab6 | f9b0277478f95818644b3b8f9ecfb952a14d7ba2 | 1d6f9f0774d3a6b07eea9deb7a666a7e27f844d8 | refs/heads/main | 2023-09-01T04:42:55.003119 | 2021-11-06T12:12:17 | 2021-11-06T12:12:17 | 425,234,636 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 238 | java | package src.exceptions;
/**
* Исключение неправильных входных данных
*/
public class InvalidArgument extends Exception {
public InvalidArgument(String msg) {
super(msg);
}
}
| [
"[email protected]"
] | |
00b922c9764187658c6767a46edf09c08c1290c8 | ace75533b5be2b87ff35b434ae3b2011eea12984 | /ClassDocs/A05/Fraction/src/Fraction.java | 4f6cbf75da96ace36f489314b251a1d4d291ec71 | [] | no_license | ammuh/APCS_15_16 | 5dd81dc59ac8324262bb864cfaaf146d24501c9d | 72508e0449e52d9a5c6ac60658fef905550db12c | refs/heads/master | 2021-01-18T22:25:36.364429 | 2016-04-30T22:16:49 | 2016-04-30T22:16:49 | 64,608,385 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,927 | java |
public class Fraction {
private int numerator;
private int denominator;
public Fraction(){
numerator = 0;
denominator = 1;
}
public Fraction(int n){
numerator = n;
denominator = 1;
}
public Fraction(int n, int d){
numerator = n;
denominator = d;
}
public Fraction(Fraction other){
numerator = other.getNumerator();
denominator = other.getDenominator();
}
public int getNumerator(){
return numerator;
}
public int getDenominator(){
return denominator;
}
public double getValue(){
return ((double)numerator)/((double)denominator);
}
public void setNumerator(int n){
numerator = n;
}
public void setDenominator(int d){
denominator = d;
}
public void setFraction(Fraction other){
other.reduce();
numerator = other.getNumerator();
denominator = other.getDenominator();
}/*
public String toString(){
reduce();
return (numerator + "/" + denominator);
}
*/
public Fraction add(Fraction other){
Fraction addFrac = new Fraction((getNumerator()*other.getDenominator()+other.getNumerator()*getDenominator()), (getDenominator()*other.getDenominator()));
return addFrac;
}
public Fraction add(int m){
Fraction addFrac2 = new Fraction((getNumerator()+getDenominator()*m), getDenominator());
return addFrac2;
}
public Fraction multiply(Fraction other){
Fraction multFrac = new Fraction(getNumerator()*other.getNumerator(), getDenominator()*other.getDenominator());
return multFrac;
}
public Fraction multiply(int m){
Fraction multFrac2 = new Fraction(getNumerator()*m, getDenominator());
return multFrac2;
}
public void reduce(){
int factor = MyMathLib.gcf(getNumerator(), getDenominator());
setNumerator(getNumerator()/factor);
setDenominator(getDenominator() / factor);
}
}
| [
"[email protected]"
] | |
aa11c7c7fdc42f55df64a563453f37d448241735 | 1917652808d7469c51b06c6d602c1f4d59ed326d | /app/src/main/java/tw/mapper/MybatisConnectionFactory.java | fb522c20afb12df3886b76f18ccdc3a7f8666990 | [] | no_license | MuchContact/T2-FixedAsset | 4c1bc4e460f5092bd95c206efa3b70cabed24b41 | 348043de32254a4ab2041ecabd33a25dde871889 | refs/heads/master | 2021-01-10T16:30:07.276866 | 2015-11-09T14:22:58 | 2015-11-09T14:22:58 | 45,835,964 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 784 | java | package tw.mapper;
import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;
import java.io.Reader;
public class MybatisConnectionFactory {
private static SqlSessionFactory sqlSessionFactory;
static {
try {
String resource = "mybatis.xml";
Reader reader = Resources.getResourceAsReader(resource);
if (sqlSessionFactory == null) {
sqlSessionFactory = new SqlSessionFactoryBuilder().build(reader);
}
}
catch (Exception exception) {
exception.printStackTrace();
}
}
public static SqlSessionFactory getSqlSessionFactory() {
return sqlSessionFactory;
}
}
| [
"[email protected]"
] | |
67c72f254a8b992ff40652a8b4823a3f1f690cd7 | c81a6f7dc32d1e7dd28d4aed826a8b23c0c4f6ec | /src/main/java/FunFictionUserProject/funFictionUser/service/impl/ChapterServiceImpl.java | 315fe19929bbf05ad426ad5cd38358d8609e2dcd | [] | no_license | Limpopoo93/funFictionUser | 1c2e7559a8b38888261dd17ac9eb9cc1d33404ad | fa780f99c8f21d150cf78587bafb1926cb65f7cf | refs/heads/master | 2023-06-13T00:56:24.819795 | 2021-07-12T12:44:20 | 2021-07-12T12:44:20 | 377,760,366 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,802 | java | package FunFictionUserProject.funFictionUser.service.impl;
import FunFictionUserProject.funFictionUser.repository.ChapterRepository;
import FunFictionUserProject.funFictionUser.service.ChapterService;
import FunFictionUserProject.funFictionUser.view.Chapter;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.transaction.Transactional;
import java.util.List;
@Service
@Slf4j
public class ChapterServiceImpl implements ChapterService {
private final ChapterRepository chapterRepository;
public ChapterServiceImpl(ChapterRepository chapterRepository) {
this.chapterRepository = chapterRepository;
}
@Transactional
@Override
public Chapter save(Chapter chapter) {
log.info("chapter by save in chapterService");
return chapterRepository.save(chapter);
}
@Override
public Chapter findById(Long id) {
log.info("id by findById in chapterService");
return chapterRepository.findById(id).orElse(null);
}
@Transactional
@Override
public void delete(Chapter chapter) {
log.info("chapter by delete in chapterService");
chapterRepository.delete(chapter);
}
@Override
public List<Chapter> findAll() {
log.info("list chapter by findAll in chapterService");
return chapterRepository.findAll();
}
@Transactional
@Override
public Chapter saveAndFlush(Chapter chapter) {
log.info("chapter by saveAndFlush in chapterService");
return chapterRepository.saveAndFlush(chapter);
}
@Override
public List<Chapter> findChapterByFunFictionId(Long id) {
log.info("id by findChapterByFunFictionId in chapterService");
return chapterRepository.findChapterByFunFictionId(id);
}
}
| [
"[email protected]"
] | |
cd76984fe24cf9a6d103299921d522c6f60a7d72 | a38af2c6ad7350c0348e90ebef35a4d689a78af5 | /Tetrimino.java | b9afa5edadec0daab43b3971a56358ba80fddfbd | [] | no_license | liu746233077/Tetris | 8c2963278379d35652ab1ed4779cd0ecf1b1ee3b | 4eb271a77c2e8895368564511935b7eacdd89a17 | refs/heads/master | 2020-08-02T01:15:24.845149 | 2019-09-26T22:10:53 | 2019-09-26T22:10:53 | 211,189,419 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,098 | java |
/**
* Abstract class Tetrimino - write a description of the class here
*
* @author Greg Johnson, University of Connecticut
* @version 0.3
*/
public abstract class Tetrimino implements Animatable
{
// instance variables - replace the example below with your own
protected SmartRectangle _block1, _block2, _block3, _block4;
protected int _x, _y;
protected java.awt.Color _color;
protected GamePanel _panel;
public Tetrimino (java.awt.Color color, GamePanel panel){
_color = color;
_panel = panel;
_block1 = new SmartRectangle(_color);
_block1.setSize(TetrisConstants.BLOCK_SIZE,TetrisConstants.BLOCK_SIZE);
_block2 = new SmartRectangle(_color);
_block2.setSize(TetrisConstants.BLOCK_SIZE,TetrisConstants.BLOCK_SIZE);
_block3 = new SmartRectangle(_color);
_block3.setSize(TetrisConstants.BLOCK_SIZE,TetrisConstants.BLOCK_SIZE);
_block4 = new SmartRectangle(_color);
_block4.setSize(TetrisConstants.BLOCK_SIZE,TetrisConstants.BLOCK_SIZE);
_block1.setBorderColor(java.awt.Color.WHITE);
_block2.setBorderColor(java.awt.Color.WHITE);
_block3.setBorderColor(java.awt.Color.WHITE);
_block4.setBorderColor(java.awt.Color.WHITE);
}
public void draw(java.awt.Graphics2D aBrush)
{
_block1.draw(aBrush);
_block2.draw(aBrush);
_block3.draw(aBrush);
_block4.draw(aBrush);
}
public void fill(java.awt.Graphics2D aBrush)
{
_block1.fill(aBrush);
_block2.fill(aBrush);
_block3.fill(aBrush);
_block4.fill(aBrush);
}
/**
* Sets the location of the composite Tetrimino object
*
* @param x the x-coordinate in the JPanel to which to move this object
* @param y the y-coordinate in the JPanel to which to move this object
* @return Nothing
*/
public abstract void setLocation(int x, int y);
public boolean moveLeft()
{
int newX1, newY1, newX2, newY2, newX3, newY3, newX4, newY4;
newX1 = (int)_block1.getX()-TetrisConstants.BLOCK_SIZE;
newY1 = (int)_block1.getY();
newX2 = (int)_block2.getX()-TetrisConstants.BLOCK_SIZE;
newY2 = (int)_block2.getY();
newX3 = (int)_block3.getX()-TetrisConstants.BLOCK_SIZE;
newY3 = (int)_block3.getY();
newX4 = (int)_block4.getX()-TetrisConstants.BLOCK_SIZE;
newY4 = (int)_block4.getY();
// check if it can move
if ( _panel.canMove( (newX1 / TetrisConstants.BLOCK_SIZE), (newY1 / TetrisConstants.BLOCK_SIZE) ) &&
_panel.canMove( (newX2 / TetrisConstants.BLOCK_SIZE), (newY2 / TetrisConstants.BLOCK_SIZE) ) &&
_panel.canMove( (newX3 / TetrisConstants.BLOCK_SIZE), (newY3 / TetrisConstants.BLOCK_SIZE) ) &&
_panel.canMove( (newX4 / TetrisConstants.BLOCK_SIZE), (newY4 / TetrisConstants.BLOCK_SIZE) ) )
{
// sets new location
_block1.setLocation(newX1, newY1);
_block2.setLocation(newX2, newY2);
_block3.setLocation(newX3, newY3);
_block4.setLocation(newX4, newY4);
return true;
}
return false;
}
public boolean moveRight()
{
int newX1, newY1, newX2, newY2, newX3, newY3, newX4, newY4;
newX1 = (int)_block1.getX()+TetrisConstants.BLOCK_SIZE;
newY1 = (int)_block1.getY();
newX2 = (int)_block2.getX()+TetrisConstants.BLOCK_SIZE;
newY2 = (int)_block2.getY();
newX3 = (int)_block3.getX()+TetrisConstants.BLOCK_SIZE;
newY3 = (int)_block3.getY();
newX4 = (int)_block4.getX()+TetrisConstants.BLOCK_SIZE;
newY4 = (int)_block4.getY();
// check if it can move
if ( _panel.canMove( (newX1 / TetrisConstants.BLOCK_SIZE), (newY1 / TetrisConstants.BLOCK_SIZE) ) &&
_panel.canMove( (newX2 / TetrisConstants.BLOCK_SIZE), (newY2 / TetrisConstants.BLOCK_SIZE) ) &&
_panel.canMove( (newX3 / TetrisConstants.BLOCK_SIZE), (newY3 / TetrisConstants.BLOCK_SIZE) ) &&
_panel.canMove( (newX4 / TetrisConstants.BLOCK_SIZE), (newY4 / TetrisConstants.BLOCK_SIZE) ) )
{
// sets new location
_block1.setLocation(newX1, newY1);
_block2.setLocation(newX2, newY2);
_block3.setLocation(newX3, newY3);
_block4.setLocation(newX4, newY4);
return true;
}
return false;
}
public boolean moveDown()
{
int newX1, newY1, newX2, newY2, newX3, newY3, newX4, newY4;
newX1 = (int)_block1.getX();
newY1 = (int)_block1.getY()+TetrisConstants.BLOCK_SIZE;
newX2 = (int)_block2.getX();
newY2 = (int)_block2.getY()+TetrisConstants.BLOCK_SIZE;
newX3 = (int)_block3.getX();
newY3 = (int)_block3.getY()+TetrisConstants.BLOCK_SIZE;
newX4 = (int)_block4.getX();
newY4 = (int)_block4.getY()+TetrisConstants.BLOCK_SIZE;
// check if it can move
if ( _panel.canMove( (newX1 / TetrisConstants.BLOCK_SIZE), (newY1 / TetrisConstants.BLOCK_SIZE) ) &&
_panel.canMove( (newX2 / TetrisConstants.BLOCK_SIZE), (newY2 / TetrisConstants.BLOCK_SIZE) ) &&
_panel.canMove( (newX3 / TetrisConstants.BLOCK_SIZE), (newY3 / TetrisConstants.BLOCK_SIZE) ) &&
_panel.canMove( (newX4 / TetrisConstants.BLOCK_SIZE), (newY4 / TetrisConstants.BLOCK_SIZE) ) )
{
// sets new location
_block1.setLocation(newX1, newY1);
_block2.setLocation(newX2, newY2);
_block3.setLocation(newX3, newY3);
_block4.setLocation(newX4, newY4);
return true;
}
_panel.addToBoard(_block1);
_panel.addToBoard(_block2);
_panel.addToBoard(_block3);
_panel.addToBoard(_block4);
_panel.tetriminoFactory();
return false;
}
/**
* Attempts to move the Tetrimino object up on the game board. This is not a valid move in Tetris.
*
* @return boolean Always returns false since this move is not allowed
*/
public final boolean moveUp(){return false;}
public boolean turnLeft()
{
int newX1, newY1, newX2, newY2, newX3, newY3, newX4, newY4;
newX1 = (int)_block1.getX();
newY1 = (int)_block1.getY();
newX2 = (int)(newX1 + newY1 - _block2.getY());
newY2 = (int)(newY1 - newX1 + _block2.getX());
newX3 = (int)(newX1 + newY1 - _block3.getY());
newY3 = (int)(newY1 - newX1 + _block3.getX());
newX4 = (int)(newX1 + newY1 - _block4.getY());
newY4 = (int)(newY1 - newX1 + _block4.getX());
// check if it can move
if ( _panel.canMove( (newX1 / TetrisConstants.BLOCK_SIZE), (newY1 / TetrisConstants.BLOCK_SIZE) ) &&
_panel.canMove( (newX2 / TetrisConstants.BLOCK_SIZE), (newY2 / TetrisConstants.BLOCK_SIZE) ) &&
_panel.canMove( (newX3 / TetrisConstants.BLOCK_SIZE), (newY3 / TetrisConstants.BLOCK_SIZE) ) &&
_panel.canMove( (newX4 / TetrisConstants.BLOCK_SIZE), (newY4 / TetrisConstants.BLOCK_SIZE) ) )
{
// sets new location
_block1.setLocation(newX1, newY1);
_block2.setLocation(newX2, newY2);
_block3.setLocation(newX3, newY3);
_block4.setLocation(newX4, newY4);
return true;
}
return false;
}
/**
* Attempts to rotate the Tetrimino object clockwise on the game board. This method checks the GamePanel
*
* @return boolean Always returns false since this move is not allowed
*/
public boolean turnRight()
{
int newX1, newY1, newX2, newY2, newX3, newY3, newX4, newY4;
newX1 = (int)_block1.getX();
newY1 = (int)_block1.getY();
newX2 = (int)(newX1 - newY1 + _block2.getY());
newY2 = (int)(newY1 + newX1 - _block2.getX());
newX3 = (int)(newX1 - newY1 + _block3.getY());
newY3 = (int)(newY1 + newX1 - _block3.getX());
newX4 = (int)(newX1 - newY1 + _block4.getY());
newY4 = (int)(newY1 + newX1 - _block4.getX());
// check if it can move
if ( _panel.canMove( (newX1 / TetrisConstants.BLOCK_SIZE), (newY1 / TetrisConstants.BLOCK_SIZE) ) &&
_panel.canMove( (newX2 / TetrisConstants.BLOCK_SIZE), (newY2 / TetrisConstants.BLOCK_SIZE) ) &&
_panel.canMove( (newX3 / TetrisConstants.BLOCK_SIZE), (newY3 / TetrisConstants.BLOCK_SIZE) ) &&
_panel.canMove( (newX4 / TetrisConstants.BLOCK_SIZE), (newY4 / TetrisConstants.BLOCK_SIZE) ) )
{
// sets new location
_block1.setLocation(newX1, newY1);
_block2.setLocation(newX2, newY2);
_block3.setLocation(newX3, newY3);
_block4.setLocation(newX4, newY4);
return true;
}
return false;
}
}
| [
"[email protected]"
] | |
6863d6148ab9416f6c7319aac5c00f5d43afd4ba | 4e97ce1a2402233ff26aab8e9e56823a3d747780 | /src/xyz/urffer/urfquest/client/entities/mobs/NPCHuman.java | 300b12a8fb5a105bbb1fc0fe0b418ccf628d449c | [] | no_license | SimNine/UrfQuest | a76195693c1de0ab55154c8738d5c04d4860b9bc | 6e90239f1e2b722c333e425ee5f60726ca1dc35b | refs/heads/master | 2023-03-08T12:05:30.107440 | 2023-02-15T04:33:18 | 2023-02-15T04:33:18 | 164,575,110 | 3 | 0 | null | 2023-02-15T04:33:19 | 2019-01-08T06:04:15 | Java | UTF-8 | Java | false | false | 3,374 | java | package xyz.urffer.urfquest.client.entities.mobs;
import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage;
import xyz.urffer.urfquest.client.Client;
import xyz.urffer.urfquest.client.QuestPanel;
import xyz.urffer.urfquest.client.entities.items.ItemStack;
import xyz.urffer.urfquest.client.state.Inventory;
import xyz.urffer.urfquest.shared.Constants;
import xyz.urffer.urfquest.shared.ImageUtils;
public class NPCHuman extends Mob {
private final static String assetPath = QuestPanel.assetPath + "/entities/npc_human/";
// img[dir][frame]
// dir = right/left
// frame = idle/step1/step2/step3
// walk: 1 -> 2 -> 3 -> 2 -> 1 -> 2 etc...
private static BufferedImage[][] img = new BufferedImage[2][4];
static {
BufferedImage idle = ImageUtils.loadImage(assetPath + "new_0.png");
BufferedImage walk1 = ImageUtils.loadImage(assetPath + "new_1.png");
BufferedImage walk2 = ImageUtils.loadImage(assetPath + "new_2.png");
img[0][0] = idle;
img[0][1] = walk1;
img[0][2] = walk2;
img[0][3] = walk1;
img[1][0] = ImageUtils.flipImage(idle, true, false);
img[1][1] = ImageUtils.flipImage(walk1, true, false);
img[1][2] = ImageUtils.flipImage(walk2, true, false);
img[1][3] = ImageUtils.flipImage(walk1, true, false);
}
protected String name;
protected int statCounter = 200;
protected Inventory inventory;
protected ItemStack heldItem;
protected double pickupRange = 3.0;
public NPCHuman(Client c, int id, String name) {
super(c, id);
this.bounds = new Rectangle2D.Double(0, 0, 1, 1);
health = Constants.DEFAULT_HEALTH_MAX_PLAYER;
maxHealth = Constants.DEFAULT_HEALTH_MAX_PLAYER;
mana = Constants.DEFAULT_MANA_MAX_PLAYER;
maxMana = Constants.DEFAULT_MANA_MAX_PLAYER;
fullness = Constants.DEFAULT_FULLNESS_MAX_PLAYER;
maxFullness = Constants.DEFAULT_FULLNESS_MAX_PLAYER;
inventory = new Inventory(this, Constants.DEFAULT_PLAYER_INVENTORY_SIZE);
this.name = name;
}
@Override
public void update() {
// do nothing
}
/*
* Drawing methods
*/
protected void drawEntity(Graphics g) {
final int WALK_CYCLE_NUM_PHASES = 4;
final int WALK_CYCLE_STEP_LENGTH_MS = 220;
final int WALK_CYCLE_TOTAL_LENGTH = WALK_CYCLE_NUM_PHASES * WALK_CYCLE_STEP_LENGTH_MS;
int dirIndex;
if (this.movementVector.dirRadians < (Math.PI / 2) || this.movementVector.dirRadians > (Math.PI * 3.0 / 2.0)) {
dirIndex = 0;
} else {
dirIndex = 1;
}
int stepIndex;
if (this.movementVector.magnitude == 0) {
stepIndex = 0;
} else {
stepIndex = (int)(System.currentTimeMillis() % WALK_CYCLE_TOTAL_LENGTH) / WALK_CYCLE_STEP_LENGTH_MS;
}
g.drawImage(img[dirIndex][stepIndex],
client.getPanel().gameToWindowX(bounds.getX()),
client.getPanel().gameToWindowY(bounds.getY()),
null);
g.setColor(Color.BLACK);
g.setFont(new Font(Font.MONOSPACED, Font.BOLD, 15));
g.drawString(name,
client.getPanel().gameToWindowX(bounds.getX()) - 5*(name.length()/2),
client.getPanel().gameToWindowY(bounds.getY()));
drawHealthBar(g);
}
public void drawDebug(Graphics g) {
g.setColor(Color.BLACK);
g.drawString("direction: " + this.movementVector.dirRadians,
client.getPanel().gameToWindowX(bounds.getX()),
client.getPanel().gameToWindowY(bounds.getY()));
}
}
| [
"[email protected]"
] | |
2260a6ee255c26e3af7bd8ab07fe0f7f58160683 | 53330fdbf3ef129d8b8bee73a7c27b2da55f7612 | /src/leetcode竞赛/七月/sf7_19/换酒问题.java | f50325849239751570bbae30a43cfb77092f5d67 | [] | no_license | HuYaXing/DataStructures | a96c2c95c54abda75c88579989fb7ad1c4ccf65b | 08e24e4d60ee6d1b8e09c8c172703a169b8365bf | refs/heads/master | 2021-07-21T17:46:20.357646 | 2020-10-10T09:27:53 | 2020-10-10T09:27:53 | 220,730,480 | 0 | 0 | null | null | null | null | WINDOWS-1252 | Java | false | false | 692 | java | package leetcode¾ºÈü.ÆßÔÂ.sf7_19;
/**
* @Author HYStar
* @Date 2020/7/19 10:30
*/
public class »»¾ÆÎÊÌâ {
public static void main(String[] args) {
System.out.println(numWaterBottles(9, 3));
System.out.println(numWaterBottles(15, 4));
System.out.println(numWaterBottles(5, 5));
System.out.println(numWaterBottles(2, 3));
}
public static int numWaterBottles(int numBottles, int numExchange) {
int ans = numBottles;
while (numBottles >= numExchange) {
ans += numBottles / numExchange;
numBottles = numBottles % numExchange + numBottles / numExchange;
}
return ans;
}
}
| [
"[email protected]"
] | |
9d86a8ab6b92ad98ec1b926f866597e090dba3ae | 647ec12ce50f06e7380fdbfb5b71e9e2d1ac03b4 | /com.tencent.mobileqqi/classes.jar/PersonalState/ReqGetSameStateList.java | 077dea02fe78d00d2edb52c1376f290c94ca21d5 | [] | no_license | tsuzcx/qq_apk | 0d5e792c3c7351ab781957bac465c55c505caf61 | afe46ef5640d0ba6850cdefd3c11badbd725a3f6 | refs/heads/main | 2022-07-02T10:32:11.651957 | 2022-02-01T12:41:38 | 2022-02-01T12:41:38 | 453,860,108 | 36 | 9 | null | 2022-01-31T09:46:26 | 2022-01-31T02:43:22 | Java | UTF-8 | Java | false | false | 3,042 | java | package PersonalState;
import com.qq.taf.jce.JceInputStream;
import com.qq.taf.jce.JceOutputStream;
import com.qq.taf.jce.JceStruct;
public final class ReqGetSameStateList
extends JceStruct
{
static int cache_eFetchSex;
static int cache_eSelfSex;
static BusiReqHead cache_oHead;
static LBSInfo cache_oLbsInfo;
static stRishState cache_oSelfRishState;
static byte[] cache_vCookie;
public int eFetchSex = -1;
public int eSelfSex = 2;
public int iPageSize = -1;
public long lFriendUin = 0L;
public BusiReqHead oHead = null;
public LBSInfo oLbsInfo = null;
public stRishState oSelfRishState = null;
public byte[] vCookie = null;
public ReqGetSameStateList() {}
public ReqGetSameStateList(BusiReqHead paramBusiReqHead, byte[] paramArrayOfByte, stRishState paramstRishState, int paramInt1, LBSInfo paramLBSInfo, int paramInt2, int paramInt3, long paramLong)
{
this.oHead = paramBusiReqHead;
this.vCookie = paramArrayOfByte;
this.oSelfRishState = paramstRishState;
this.iPageSize = paramInt1;
this.oLbsInfo = paramLBSInfo;
this.eSelfSex = paramInt2;
this.eFetchSex = paramInt3;
this.lFriendUin = paramLong;
}
public void readFrom(JceInputStream paramJceInputStream)
{
if (cache_oHead == null) {
cache_oHead = new BusiReqHead();
}
this.oHead = ((BusiReqHead)paramJceInputStream.read(cache_oHead, 0, true));
if (cache_vCookie == null)
{
cache_vCookie = (byte[])new byte[1];
((byte[])cache_vCookie)[0] = 0;
}
this.vCookie = ((byte[])paramJceInputStream.read(cache_vCookie, 1, true));
if (cache_oSelfRishState == null) {
cache_oSelfRishState = new stRishState();
}
this.oSelfRishState = ((stRishState)paramJceInputStream.read(cache_oSelfRishState, 2, true));
this.iPageSize = paramJceInputStream.read(this.iPageSize, 3, false);
if (cache_oLbsInfo == null) {
cache_oLbsInfo = new LBSInfo();
}
this.oLbsInfo = ((LBSInfo)paramJceInputStream.read(cache_oLbsInfo, 4, false));
this.eSelfSex = paramJceInputStream.read(this.eSelfSex, 5, false);
this.eFetchSex = paramJceInputStream.read(this.eFetchSex, 6, false);
this.lFriendUin = paramJceInputStream.read(this.lFriendUin, 7, false);
}
public void writeTo(JceOutputStream paramJceOutputStream)
{
paramJceOutputStream.write(this.oHead, 0);
paramJceOutputStream.write(this.vCookie, 1);
paramJceOutputStream.write(this.oSelfRishState, 2);
paramJceOutputStream.write(this.iPageSize, 3);
if (this.oLbsInfo != null) {
paramJceOutputStream.write(this.oLbsInfo, 4);
}
paramJceOutputStream.write(this.eSelfSex, 5);
paramJceOutputStream.write(this.eFetchSex, 6);
paramJceOutputStream.write(this.lFriendUin, 7);
}
}
/* Location: L:\local\mybackup\temp\qq_apk\com.tencent.mobileqqi\classes2.jar
* Qualified Name: PersonalState.ReqGetSameStateList
* JD-Core Version: 0.7.0.1
*/ | [
"[email protected]"
] | |
a27469d0ee97a785f34647061f7e7de2e03a8664 | 121d59f1f7f6b3a23f3f227f726d1273dc7dd1da | /itcrowd/src/com/itcrowd/book/action/BookMainBestAction.java | 0d83d82b45e3b7def4f493c31d10638095d49bc6 | [] | no_license | tjoeun-pnj/itcrowd_project | 500fc41011f78e7ad9b0198008245fdb395a1d2a | 62284279367259ec1b04bf59833936cf287b5ca4 | refs/heads/master | 2021-05-09T07:08:51.995511 | 2018-03-01T13:00:31 | 2018-03-01T13:00:31 | 119,350,264 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 64,807 | java | package com.itcrowd.book.action;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.google.gson.Gson;
import com.google.gson.JsonObject;
import com.itcrowd.book.model.BookVO;
import com.itcrowd.util.url.Action;
import com.itcrowd.util.url.ActionForward;
public class BookMainBestAction implements Action {
@Override
public ActionForward execute(HttpServletRequest req, HttpServletResponse res) throws Exception {
ActionForward forward = null;
// String json = "http://www.aladin.co.kr/ttb/api/ItemList.aspx?ttbkey=ttbgsgod0906001&QueryType=Bestseller&MaxResults=10&start=1&SearchTarget=Book&&output=js&cover=midbig&Version=20131101";
String json = "{\"version\":\"20131101\",\"logo\":\"http://image.aladin.co.kr/img/header/2011/aladin_logo_new.gif\",\"title\":\"알라딘 베스트셀러 리스트 - 국내도서\",\"link\":\"http:\\/\\/www.aladin.co.kr\\/shop\\/common\\/wbest.aspx?BestType=Bestseller&BranchType=1&Year=2018&Month=2&Week=2&partner=openAPI\",\"pubDate\":\"Mon, 12 Feb 2018 02:13:11 GMT\",\"totalResults\":1000,\"startIndex\":1,\"itemsPerPage\":50,\"query\":\"QueryType=BESTSELLER;SearchTarget=Book;Year=2018;Month=2;Week=2\",\"searchCategoryId\":0,\"searchCategoryName\":\"국내도서\",\"item\":[{\"title\":\"좀비고등학교 코믹스 5\",\"link\":\"http:\\/\\/www.aladin.co.kr\\/shop\\/wproduct.aspx?ItemId=133494753&partner=openAPI&start=api\",\"author\":\"배아이 지음, 라임스튜디오 그림\",\"pubDate\":\"2018-02-15\",\"description\":\"교장 사무엘은 재단의 눈을 피해 가람에 대한 조사를 시작하고 가람은 동진과 함께 사라진 윤슬을 찾기 위해 계속 학교 안을 돌아다니지만 갑작스런 Dr.구의 등장으로 막혀버린다. 되풀이되어가는 것을 느낀 가람이 의문에 빠진 사이, 동석은 또 다시 알 수 없는 통증에 시달리는데….\",\"isbn\":\"K342532909\",\"isbn13\":\"9791188380169\",\"itemId\":133494753,\"priceSales\":8820,\"priceStandard\":9800,\"mallType\":\"BOOK\",\"stockStatus\":\"\",\"mileage\":34,\"cover\":\"http:\\/\\/image.aladin.co.kr\\/product\\/13349\\/47\\/cover150\\/k342532909_1.jpg\",\"categoryId\":49995,\"categoryName\":\"국내도서>어린이>TV\\/만화\\/영화>만화 일반\",\"publisher\":\"겜툰\",\"salesPoint\":132150,\"fixedPrice\":true,\"customerReviewRank\":10,\"bestRank\":1,\"seriesInfo\":{\"seriesId\":616649,\"seriesLink\":\"http://www.aladin.co.kr/shop/common/wseriesitem.aspx?SRID=616649&partner=openAPI\",\"seriesName\":\"좀비고등학교 코믹스 5\"},\"subInfo\":{}},{\"title\":\"82년생 김지영\",\"link\":\"http:\\/\\/www.aladin.co.kr\\/shop\\/wproduct.aspx?ItemId=94764887&partner=openAPI&start=api\",\"author\":\"조남주 지음\",\"pubDate\":\"2016-10-14\",\"description\":\"오늘의 젊은 작가 13권. 조남주 장편소설. 시사 교양 프로그램에서 10년 동안 일한 방송 작가답게 서민들의 일상에서 발생하는 비극을 사실적이고 공감대 높은 스토리로 표현하는 데 특출 난 재능을 보이는 작가는 <82년생 김지영>에서 30대를 살고 있는 한국 여성들의 보편적인 일상을 완벽하게 재현한다.\",\"isbn\":\"8937473135\",\"isbn13\":\"9788937473135\",\"itemId\":94764887,\"priceSales\":11700,\"priceStandard\":13000,\"mallType\":\"BOOK\",\"stockStatus\":\"\",\"mileage\":40,\"cover\":\"http:\\/\\/image.aladin.co.kr\\/product\\/9476\\/48\\/cover150\\/8937473135_1.jpg\",\"categoryId\":50993,\"categoryName\":\"국내도서>소설\\/시\\/희곡>한국소설>2000년대 이후 한국소설\",\"publisher\":\"민음사\",\"salesPoint\":511190,\"fixedPrice\":true,\"customerReviewRank\":9,\"bestDuration\":\"종합 1위 8주\",\"bestRank\":2,\"seriesInfo\":{\"seriesId\":60863,\"seriesLink\":\"http://www.aladin.co.kr/shop/common/wseriesitem.aspx?SRID=60863&partner=openAPI\",\"seriesName\":\"오늘의 젊은 작가 13\"},\"subInfo\":{}},{\"title\":\"하이큐!! 29\",\"link\":\"http:\\/\\/www.aladin.co.kr\\/shop\\/wproduct.aspx?ItemId=133726888&partner=openAPI&start=api\",\"author\":\"후루다테 하루이치 지음\",\"pubDate\":\"2018-02-08\",\"description\":\"전국대회 예선에 대비해 맹훈련을 실시하는 카라스노 배구부. 하지만 예선의 같은 블록 안에는 아오바조사이, 그리고 인연 깊은 ‘철벽’ 다테공고가 가로막고 있다. 상대가 누구든 눈앞의 일전을 잡기 위해 나간다. 신생 카라스노 배구부, 마침내 출진.\",\"isbn\":\"K032532007\",\"isbn13\":\"9791133471713\",\"itemId\":133726888,\"priceSales\":4500,\"priceStandard\":5000,\"mallType\":\"BOOK\",\"stockStatus\":\"\",\"mileage\":19,\"cover\":\"http:\\/\\/image.aladin.co.kr\\/product\\/13372\\/68\\/cover150\\/k032532007_1.jpg\",\"categoryId\":2561,\"categoryName\":\"국내도서>만화>스포츠만화\",\"publisher\":\"대원씨아이(만화)\",\"salesPoint\":59410,\"fixedPrice\":true,\"customerReviewRank\":10,\"bestRank\":3,\"subInfo\":{}},{\"title\":\"무례한 사람에게 웃으며 대처하는 법 - 인생자체는 긍정적으로, 개소리에는 단호하게!\",\"link\":\"http:\\/\\/www.aladin.co.kr\\/shop\\/wproduct.aspx?ItemId=127698684&partner=openAPI&start=api\",\"author\":\"정문정 지음\",\"pubDate\":\"2018-01-08\",\"description\":\"갑자기 선을 훅 넘는 사람들에게 감정의 동요 없이 \\\"금 밟으셨어요\\\" 하고 알려줄 방법은 없을까? 당연히 있다. 다만 그 방법을 실제로 사용하려면 연습이 좀 필요하다. 책에는 작가가 지금까지 시도한 훈련법 중 가장 효과적이었던 방법과 그 과정에서 깨달은 것들을 담았다.\",\"isbn\":\"8957369368\",\"isbn13\":\"9788957369364\",\"itemId\":127698684,\"priceSales\":12420,\"priceStandard\":13800,\"mallType\":\"BOOK\",\"stockStatus\":\"\",\"mileage\":40,\"cover\":\"http:\\/\\/image.aladin.co.kr\\/product\\/12769\\/86\\/cover150\\/8957369368_1.jpg\",\"categoryId\":51371,\"categoryName\":\"국내도서>에세이>한국에세이\",\"publisher\":\"가나출판사\",\"salesPoint\":153815,\"fixedPrice\":true,\"customerReviewRank\":8,\"bestDuration\":\"종합 10위 4주\",\"bestRank\":4,\"subInfo\":{}},{\"title\":\"아르테미스 (어나더커버 특별판, 양장)\",\"link\":\"http:\\/\\/www.aladin.co.kr\\/shop\\/wproduct.aspx?ItemId=132174243&partner=openAPI&start=api\",\"author\":\"앤디 위어 지음, 남명성 옮김\",\"pubDate\":\"2017-11-30\",\"description\":\"<마션>의 작가 앤디 위어가 이번엔 지구와 가장 가까운 천체 달을 무대로 한 <아르테미스>를 들고 우리에게 다시 돌아왔다. 작가 앤디 위어는 달에 생긴 최초이자 유일한 도시 아르테미스로의 잊지 못할 여정을 선사한다.\",\"isbn\":\"8925563126\",\"isbn13\":\"9788925563121\",\"itemId\":132174243,\"priceSales\":13500,\"priceStandard\":15000,\"mallType\":\"BOOK\",\"stockStatus\":\"\",\"mileage\":50,\"cover\":\"http:\\/\\/image.aladin.co.kr\\/product\\/13217\\/42\\/cover150\\/8925563126_1.jpg\",\"categoryId\":89481,\"categoryName\":\"국내도서>소설\\/시\\/희곡>과학소설(SF)>외국\",\"publisher\":\"알에이치코리아(RHK)\",\"salesPoint\":110730,\"fixedPrice\":true,\"customerReviewRank\":9,\"bestRank\":5,\"subInfo\":{}},{\"title\":\"연애의 행방\",\"link\":\"http:\\/\\/www.aladin.co.kr\\/shop\\/wproduct.aspx?ItemId=130560299&partner=openAPI&start=api\",\"author\":\"히가시노 게이고 지음, 양윤옥 옮김\",\"pubDate\":\"2018-01-31\",\"description\":\"히가시노 게이고의 첫 연애소설.‘연애’라는 낯선 소재에도 능숙하게 자기만의 색깔을 녹여내며, 흔히 볼 수 있는 평범한 사람들의 연애사를 스키장이라는 장소를 배경으로 맛깔나게 풀어낸다.\",\"isbn\":\"K532532897\",\"isbn13\":\"9791161903538\",\"itemId\":130560299,\"priceSales\":12420,\"priceStandard\":13800,\"mallType\":\"BOOK\",\"stockStatus\":\"\",\"mileage\":48,\"cover\":\"http:\\/\\/image.aladin.co.kr\\/product\\/13056\\/2\\/cover150\\/k532532897_1.jpg\",\"categoryId\":50998,\"categoryName\":\"국내도서>소설\\/시\\/희곡>일본소설>1950년대 이후 일본소설\",\"publisher\":\"㈜소미미디어\",\"salesPoint\":78890,\"fixedPrice\":true,\"customerReviewRank\":8,\"bestDuration\":\"종합 10위 2주\",\"bestRank\":6,\"subInfo\":{}},{\"title\":\"말 그릇 - 비울수록 사람을 더 채우는\",\"link\":\"http:\\/\\/www.aladin.co.kr\\/shop\\/wproduct.aspx?ItemId=117827715&partner=openAPI&start=api\",\"author\":\"김윤나 지음\",\"pubDate\":\"2017-09-21\",\"description\":\"SK, LG, 삼성을 비롯한 수많은 기업과 개인 코칭을 통해 얻은 말에 대한 근본적인 성찰. 사람마다 가지고 있는 자신의 말 그릇의 의미에 대해 생각해보고 어떻게 하면 나의 말 그릇을 보다 단단하고 깊이 있게 만들 수 있는지 알려준다.\",\"isbn\":\"K302531124\",\"isbn13\":\"9791185952987\",\"itemId\":117827715,\"priceSales\":13500,\"priceStandard\":15000,\"mallType\":\"BOOK\",\"stockStatus\":\"\",\"mileage\":48,\"cover\":\"http:\\/\\/image.aladin.co.kr\\/product\\/11782\\/77\\/cover150\\/k302531124_2.jpg\",\"categoryId\":70227,\"categoryName\":\"국내도서>자기계발>협상\\/설득\\/화술>화술\",\"publisher\":\"카시오페아\",\"salesPoint\":149986,\"fixedPrice\":true,\"customerReviewRank\":9,\"bestDuration\":\"종합 10위 8주\",\"bestRank\":7,\"subInfo\":{}},{\"title\":\"책을 지키려는 고양이\",\"link\":\"http:\\/\\/www.aladin.co.kr\\/shop\\/wproduct.aspx?ItemId=129141206&partner=openAPI&start=api\",\"author\":\"나쓰카와 소스케 지음, 이선희 옮김\",\"pubDate\":\"2018-01-12\",\"description\":\"희귀본이 가득한 고서점을 배경으로 책을 지키려는 고양이와 외톨이 소년의 기이한 모험을 담은 소설. 따뜻한 인간애를 그리는 의사 작가로 독자들의 큰 사랑을 받은 나쓰카와 소스케가 오랜만에 선보인 작품이다.\",\"isbn\":\"8950973022\",\"isbn13\":\"9788950973025\",\"itemId\":129141206,\"priceSales\":12600,\"priceStandard\":14000,\"mallType\":\"BOOK\",\"stockStatus\":\"\",\"mileage\":46,\"cover\":\"http:\\/\\/image.aladin.co.kr\\/product\\/12914\\/12\\/cover150\\/8950973022_1.jpg\",\"categoryId\":50998,\"categoryName\":\"국내도서>소설\\/시\\/희곡>일본소설>1950년대 이후 일본소설\",\"publisher\":\"arte(아르테)\",\"salesPoint\":58165,\"fixedPrice\":true,\"customerReviewRank\":9,\"bestDuration\":\"종합 10위 2주\",\"bestRank\":8,\"subInfo\":{}},{\"title\":\"나미야 잡화점의 기적\",\"link\":\"http:\\/\\/www.aladin.co.kr\\/shop\\/wproduct.aspx?ItemId=21753305&partner=openAPI&start=api\",\"author\":\"히가시노 게이고 지음, 양윤옥 옮김\",\"pubDate\":\"2012-12-19\",\"description\":\"히가시노 게이고 소설. 총 5장으로 구성된 <나미야 잡화점의 기적>은 시공간을 초월하여 편지를 주고받는다는 설정 때문에 판타지 색채가 두드러져 보일 수 있지만 이는 각각의 이야기와 등장인물을 하나의 연결 고리로 모으는 주요 장치로 작용한다.\",\"isbn\":\"8972756199\",\"isbn13\":\"9788972756194\",\"itemId\":21753305,\"priceSales\":13320,\"priceStandard\":14800,\"mallType\":\"BOOK\",\"stockStatus\":\"\",\"mileage\":42,\"cover\":\"http:\\/\\/image.aladin.co.kr\\/product\\/2175\\/33\\/cover150\\/8972756199_2.jpg\",\"categoryId\":50998,\"categoryName\":\"국내도서>소설\\/시\\/희곡>일본소설>1950년대 이후 일본소설\",\"publisher\":\"현대문학\",\"salesPoint\":284948,\"fixedPrice\":true,\"customerReviewRank\":9,\"bestDuration\":\"종합 1위 2주\",\"bestRank\":9,\"subInfo\":{}},{\"title\":\"나의 영어 사춘기 - 대한민국 영포자들의 8주 영어 완전정복 프로젝트\",\"link\":\"http:\\/\\/www.aladin.co.kr\\/shop\\/wproduct.aspx?ItemId=126882105&partner=openAPI&start=api\",\"author\":\"이시원 지음\",\"pubDate\":\"2017-12-22\",\"description\":\"영어초보자 또는 영어포기자들을 위해 영어말하기 학습 도서. 그동안 우리가 배웠던 시험을 위한 학습이 아닌 영어말하기 위한 학습을 통해 영어회화를 누구나 할 수 있도록 만들었다. 8주간의 커리큘럼을 통해 영어말하기에 대한 자신감을 가질 수 있다.\",\"isbn\":\"K812532177\",\"isbn13\":\"9791161500973\",\"itemId\":126882105,\"priceSales\":12150,\"priceStandard\":13500,\"mallType\":\"BOOK\",\"stockStatus\":\"\",\"mileage\":42,\"cover\":\"http:\\/\\/image.aladin.co.kr\\/product\\/12688\\/21\\/cover150\\/k812532177_1.jpg\",\"categoryId\":49849,\"categoryName\":\"국내도서>외국어>영어회화>생활영어\",\"publisher\":\"시원스쿨닷컴\",\"salesPoint\":153235,\"fixedPrice\":true,\"customerReviewRank\":9,\"bestDuration\":\"종합 1위 3주\",\"bestRank\":10,\"subInfo\":{}},{\"title\":\"신경 끄기의 기술 - 인생에서 가장 중요한 것만 남기는 힘\",\"link\":\"http:\\/\\/www.aladin.co.kr\\/shop\\/wproduct.aspx?ItemId=120057939&partner=openAPI&start=api\",\"author\":\"마크 맨슨 지음, 한재호 옮김\",\"pubDate\":\"2017-10-27\",\"description\":\"수많은 선택지와 기회비용 앞에서 인생의 목적을 잃어버린 채 가치관의 혼란을 겪는 현대인들에게 뜻밖의 깨달음을 전한다. 더 나은 삶으로 가기 위한 5가지 가치관을 제시하고, 수많은 선택지와 기회비용 앞에서 가치관의 혼란을 겪는 현대인들에게 뜻밖의 깨달음을 준다.\",\"isbn\":\"8901219948\",\"isbn13\":\"9788901219943\",\"itemId\":120057939,\"priceSales\":13500,\"priceStandard\":15000,\"mallType\":\"BOOK\",\"stockStatus\":\"\",\"mileage\":46,\"cover\":\"http:\\/\\/image.aladin.co.kr\\/product\\/12005\\/79\\/cover150\\/8901219948_1.jpg\",\"categoryId\":70216,\"categoryName\":\"국내도서>자기계발>성공>성공학\",\"publisher\":\"갤리온\",\"salesPoint\":199715,\"fixedPrice\":true,\"customerReviewRank\":8,\"bestDuration\":\"종합 1위 2주\",\"bestRank\":11,\"subInfo\":{}},{\"title\":\"오버로드 12 - 성왕국의 성기사, Novel Engine\",\"link\":\"http:\\/\\/www.aladin.co.kr\\/shop\\/wproduct.aspx?ItemId=133756248&partner=openAPI&start=api\",\"author\":\"마루야마 쿠가네 지음, 김완 옮김, so-bin 그림\",\"pubDate\":\"2018-02-27\",\"description\":\"거대한 성벽을 쌓고 오랫동안 평화를 자랑한 성왕국을 느닷없이 습격한 아인연합군. 연합군의 총대장은 마황 얄다바오트. 잔인하고도 냉혹한 마황에 의해 성왕국은 국가 붕괴의 위기에 직면한다.\",\"isbn\":\"K952532101\",\"isbn13\":\"9791131972304\",\"itemId\":133756248,\"priceSales\":10350,\"priceStandard\":11500,\"mallType\":\"BOOK\",\"stockStatus\":\"예약판매\",\"mileage\":45,\"cover\":\"http:\\/\\/image.aladin.co.kr\\/product\\/13375\\/62\\/cover150\\/k952532101_1.jpg\",\"categoryId\":54719,\"categoryName\":\"국내도서>소설\\/시\\/희곡>라이트 노벨>노블엔진(Novel Engine)\",\"publisher\":\"영상출판미디어(주)\",\"salesPoint\":37120,\"fixedPrice\":true,\"customerReviewRank\":10,\"bestRank\":12,\"subInfo\":{}},{\"title\":\"인생에서 너무 늦은 때란 없습니다 - 모지스 할머니 이야기\",\"link\":\"http:\\/\\/www.aladin.co.kr\\/shop\\/wproduct.aspx?ItemId=125407865&partner=openAPI&start=api\",\"author\":\"애나 메리 로버트슨 모지스 지음, 류승경 옮김\",\"pubDate\":\"2017-12-16\",\"description\":\"미국의 국민 화가, 애나 메리 로버트슨 모지스. 일명 '모지스 할머니'라 불리는 그녀가 그림을 그리기 시작한 건 그녀 나이 76세였다. 이 책은 92세에 출간한 자서전과 사랑 넘치는 그림 67점을 한데 모아 엮었다.\",\"isbn\":\"K482532464\",\"isbn13\":\"9791187498186\",\"itemId\":125407865,\"priceSales\":12420,\"priceStandard\":13800,\"mallType\":\"BOOK\",\"stockStatus\":\"\",\"mileage\":46,\"cover\":\"http:\\/\\/image.aladin.co.kr\\/product\\/12540\\/78\\/cover150\\/k482532464_1.jpg\",\"categoryId\":51376,\"categoryName\":\"국내도서>에세이>사진\\/그림 에세이\",\"publisher\":\"수오서재\",\"salesPoint\":110205,\"fixedPrice\":true,\"customerReviewRank\":9,\"bestDuration\":\"종합 10위 4주\",\"bestRank\":13,\"subInfo\":{}},{\"title\":\"91층 나무 집\",\"link\":\"http:\\/\\/www.aladin.co.kr\\/shop\\/wproduct.aspx?ItemId=131136285&partner=openAPI&start=api\",\"author\":\"앤디 그리피스 지음, 테리 덴톤 그림\",\"pubDate\":\"2018-02-20\",\"description\":\"456 Book 클럽 시리즈. ‘91층 나무 집’에 새로 생긴 점술가 ‘다알아’ 여사의 천막, 서브머린 샌드위치 가게, 트로피 방, 무인도, 정체불명의 커다란 빨간 버튼. 그런데 잠시 놀 새도 없이 큰코 사장님이 맡긴 세 아이를 돌보게 된 앤디와 테리.\",\"isbn\":\"8952786475\",\"isbn13\":\"9788952786470\",\"itemId\":131136285,\"priceSales\":10800,\"priceStandard\":12000,\"mallType\":\"BOOK\",\"stockStatus\":\"예약판매\",\"mileage\":41,\"cover\":\"http:\\/\\/image.aladin.co.kr\\/product\\/13113\\/62\\/cover150\\/8952786475_1.jpg\",\"categoryId\":48877,\"categoryName\":\"국내도서>어린이>동화\\/명작\\/고전>외국창작동화\",\"publisher\":\"시공주니어\",\"salesPoint\":56650,\"fixedPrice\":true,\"customerReviewRank\":0,\"bestDuration\":\"종합 100위 2주\",\"bestRank\":14,\"seriesInfo\":{\"seriesId\":26316,\"seriesLink\":\"http://www.aladin.co.kr/shop/common/wseriesitem.aspx?SRID=26316&partner=openAPI\",\"seriesName\":\"456 Book 클럽 \"},\"subInfo\":{}},{\"title\":\"라틴어 수업 - 지적이고 아름다운 삶을 위한\",\"link\":\"http:\\/\\/www.aladin.co.kr\\/shop\\/wproduct.aspx?ItemId=112173214&partner=openAPI&start=api\",\"author\":\"한동일 지음\",\"pubDate\":\"2017-06-30\",\"description\":\"한국인 최초, 동아시아 최초 바티칸 대법원 로타 로마나 변호사이자 가톨릭 사제인 한동일 교수가 2010년부터 2016년까지 서강대학교에서 진행했던 강의를 책으로 옮겼다. 책 말미에는 수업을 들었던 제자들이 책 출간을 기념해 보내온 편지를 함께 실었다.\",\"isbn\":\"896596220X\",\"isbn13\":\"9788965962205\",\"itemId\":112173214,\"priceSales\":13500,\"priceStandard\":15000,\"mallType\":\"BOOK\",\"stockStatus\":\"\",\"mileage\":48,\"cover\":\"http:\\/\\/image.aladin.co.kr\\/product\\/11217\\/32\\/cover150\\/896596220x_1.jpg\",\"categoryId\":51378,\"categoryName\":\"국내도서>인문학>교양 인문학\",\"publisher\":\"흐름출판\",\"salesPoint\":178798,\"fixedPrice\":true,\"customerReviewRank\":9,\"bestDuration\":\"종합 10위 4주\",\"bestRank\":15,\"subInfo\":{}},{\"title\":\"나는 나로 살기로 했다 (겨울 스페셜 에디션)\",\"link\":\"http:\\/\\/www.aladin.co.kr\\/shop\\/wproduct.aspx?ItemId=127620366&partner=openAPI&start=api\",\"author\":\"김수현 지음\",\"pubDate\":\"2016-11-25\",\"description\":\"우리가 온전한 '나'로 살아가기 위해 무엇이 필요한지 말해주는 책이다. 돈 많고 잘나가는 타인의 SNS를 훔쳐보며 비참해질 필요 없고, 스스로에게 변명하고 모두에게 이해받으려 애쓰지 말라고 이야기한다. 불안하다고 무작정 열심히 할 필요 없고, 세상의 정답에 굴복하지 말라고 응원한다.\",\"isbn\":\"K842532679\",\"isbn13\":\"9791187119845\",\"itemId\":127620366,\"priceSales\":12420,\"priceStandard\":13800,\"mallType\":\"BOOK\",\"stockStatus\":\"\",\"mileage\":47,\"cover\":\"http:\\/\\/image.aladin.co.kr\\/product\\/12762\\/3\\/cover150\\/k842532679_1.jpg\",\"categoryId\":51371,\"categoryName\":\"국내도서>에세이>한국에세이\",\"publisher\":\"마음의숲\",\"salesPoint\":139925,\"fixedPrice\":true,\"customerReviewRank\":9,\"bestDuration\":\"종합 100위 7주\",\"bestRank\":16,\"subInfo\":{}},{\"title\":\"2018 선재국어 약점 체크 반쪽 모의고사 - 유형별로 정리하는 전 범위 약점 체크 모의고사\",\"link\":\"http:\\/\\/www.aladin.co.kr\\/shop\\/wproduct.aspx?ItemId=128486637&partner=openAPI&start=api\",\"author\":\"이선재 지음\",\"pubDate\":\"2018-01-10\",\"description\":\"최종 모의고사 전에 다시 한 번 자신의 실력을 객관적으로 파악하고 약점을 보다 정확히 체크하여 이를 보완할 최종 전략을 세울 수 있게 하기 위해 기획한 유형별 문제집으로, 유형 정리, 약점 체크를 통한 자기 점검에 중점을 둔 교재다.\",\"isbn\":\"K312532081\",\"isbn13\":\"9791161314846\",\"itemId\":128486637,\"priceSales\":17100,\"priceStandard\":19000,\"mallType\":\"BOOK\",\"stockStatus\":\"\",\"mileage\":80,\"cover\":\"http:\\/\\/image.aladin.co.kr\\/product\\/12848\\/66\\/cover150\\/k312532081_1.jpg\",\"categoryId\":34613,\"categoryName\":\"국내도서>수험서\\/자격증>공무원 수험서>7\\/9급 공무원>국어>기출\\/문제집\\/모의고사\",\"publisher\":\"(주)에스티유니타스\",\"salesPoint\":59790,\"fixedPrice\":true,\"customerReviewRank\":10,\"bestDuration\":\"종합 100위 5주\",\"bestRank\":17,\"seriesInfo\":{\"seriesId\":614864,\"seriesLink\":\"http://www.aladin.co.kr/shop/common/wseriesitem.aspx?SRID=614864&partner=openAPI\",\"seriesName\":\"2018 선재국어 \"},\"subInfo\":{}},{\"title\":\"검사내전 - 생활형 검사의 사람 공부, 세상 공부\",\"link\":\"http:\\/\\/www.aladin.co.kr\\/shop\\/wproduct.aspx?ItemId=129003066&partner=openAPI&start=api\",\"author\":\"김웅 지음\",\"pubDate\":\"2018-01-19\",\"description\":\"저자 김웅은 2000년 사법연수원을 수료한 이래 18년간 검사 일을 해왔다. 그런데 굳이 스스로를 '생활형 검사'라고 지칭한다. 검사란 이 사회에서 권력의 중심에 있는 힘 있는 자들이라고 생각하는 사람들로서는 고개를 갸웃거릴 대목이다.\",\"isbn\":\"8960516171\",\"isbn13\":\"9788960516175\",\"itemId\":129003066,\"priceSales\":13500,\"priceStandard\":15000,\"mallType\":\"BOOK\",\"stockStatus\":\"\",\"mileage\":48,\"cover\":\"http:\\/\\/image.aladin.co.kr\\/product\\/12900\\/30\\/cover150\\/8960516171_1.jpg\",\"categoryId\":51348,\"categoryName\":\"국내도서>사회과학>법과 생활>법률이야기\\/법조인이야기\",\"publisher\":\"부키\",\"salesPoint\":40215,\"fixedPrice\":true,\"customerReviewRank\":9,\"bestDuration\":\"종합 100위 3주\",\"bestRank\":18,\"subInfo\":{}},{\"title\":\"모모요는 아직 아흔 살\",\"link\":\"http:\\/\\/www.aladin.co.kr\\/shop\\/wproduct.aspx?ItemId=129857150&partner=openAPI&start=api\",\"author\":\"무레 요코 지음, 권남희 옮김\",\"pubDate\":\"2018-01-17\",\"description\":\"<카모메 식당>의 작가 무레 요코, 그녀의 외할머니 모모요 이야기. 졸지에 일을 잃게 된 모모요는 하루 종일 집에만 있는 것이 답답해져서 도쿄로의 여행을 감행한다. 이 에세이는 90살이 된 모모요가 자신의 하루를 충만하게 보내려는 의지를 내뿜는 그 순간부터 시작된다.\",\"isbn\":\"K912532790\",\"isbn13\":\"9791188451098\",\"itemId\":129857150,\"priceSales\":13770,\"priceStandard\":15300,\"mallType\":\"BOOK\",\"stockStatus\":\"\",\"mileage\":50,\"cover\":\"http:\\/\\/image.aladin.co.kr\\/product\\/12985\\/71\\/cover150\\/k912532790_1.jpg\",\"categoryId\":51373,\"categoryName\":\"국내도서>에세이>외국에세이\",\"publisher\":\"이봄\",\"salesPoint\":36530,\"fixedPrice\":true,\"customerReviewRank\":10,\"bestDuration\":\"종합 100위 3주\",\"bestRank\":19,\"subInfo\":{}},{\"title\":\"시로 납치하다\",\"link\":\"http:\\/\\/www.aladin.co.kr\\/shop\\/wproduct.aspx?ItemId=128462799&partner=openAPI&start=api\",\"author\":\"류시화 지음\",\"pubDate\":\"2018-01-08\",\"description\":\"인생학교에서 시 읽기 1권. 노벨 문학상 수상 시인부터 프랑스의 무명 시인, 아일랜드의 음유시인, 노르웨이의 농부 시인과 일본의 동시 작가의 좋은 시들을 모았다. 마음의 무늬를 표현하기 위해 전 세계 시인들이 수없이 고쳐 쓴 시들. 몇 번을 다시 읽어도 새롭게 다가오는 시들의 향연이 펼쳐진다.\",\"isbn\":\"K392532080\",\"isbn13\":\"9791186900420\",\"itemId\":128462799,\"priceSales\":11700,\"priceStandard\":13000,\"mallType\":\"BOOK\",\"stockStatus\":\"\",\"mileage\":41,\"cover\":\"http:\\/\\/image.aladin.co.kr\\/product\\/12846\\/27\\/cover150\\/k392532080_1.jpg\",\"categoryId\":51168,\"categoryName\":\"국내도서>소설\\/시\\/희곡>시>외국시\",\"publisher\":\"더숲\",\"salesPoint\":65795,\"fixedPrice\":true,\"customerReviewRank\":10,\"bestDuration\":\"종합 100위 6주\",\"bestRank\":20,\"seriesInfo\":{\"seriesId\":628688,\"seriesLink\":\"http://www.aladin.co.kr/shop/common/wseriesitem.aspx?SRID=628688&partner=openAPI\",\"seriesName\":\"인생학교에서 시 읽기 1\"},\"subInfo\":{}},{\"title\":\"한 글자 사전\",\"link\":\"http:\\/\\/www.aladin.co.kr\\/shop\\/wproduct.aspx?ItemId=131864278&partner=openAPI&start=api\",\"author\":\"김소연 지음\",\"pubDate\":\"2018-01-30\",\"description\":\"김소연 시인의 첫 산문집 <마음사전>은 2008년 1월 출간되었다. 수많은 독자들의 마음을 채웠던 <마음사전> 출간 10년을 맞아 특별한 신작을 선보인다. <한 글자 사전>은 '감'에서 출발해 '힝'까지 310개에 달하는 '한 글자'로, 가장 섬세하게 삶을 가늠한 책이다.\",\"isbn\":\"8960903620\",\"isbn13\":\"9788960903623\",\"itemId\":131864278,\"priceSales\":12600,\"priceStandard\":14000,\"mallType\":\"BOOK\",\"stockStatus\":\"\",\"mileage\":47,\"cover\":\"http:\\/\\/image.aladin.co.kr\\/product\\/13186\\/42\\/cover150\\/8960903620_1.jpg\",\"categoryId\":51371,\"categoryName\":\"국내도서>에세이>한국에세이\",\"publisher\":\"마음산책\",\"salesPoint\":34140,\"fixedPrice\":true,\"customerReviewRank\":10,\"bestDuration\":\"종합 100위 2주\",\"bestRank\":21,\"subInfo\":{}},{\"title\":\"랩 걸 - 나무, 과학 그리고 사랑\",\"link\":\"http:\\/\\/www.aladin.co.kr\\/shop\\/wproduct.aspx?ItemId=101891199&partner=openAPI&start=api\",\"author\":\"호프 자렌 지음, 김희정 옮김\",\"pubDate\":\"2017-02-17\",\"description\":\"2016년 출간과 함께 베스트셀러에 오르며 뜨거운 관심을 받은 <랩걸-나무, 과학 그리고 사랑>이 출간되었다. 올리버 색스와 제이 굴드의 부재를 아쉬워하던 독자들에게 호프 자런이라는 ‘좋은 글을 쓰는 과학자의 등장’은 무엇보다 반가운 소식이다.\",\"isbn\":\"K852536383\",\"isbn13\":\"9791159920967\",\"itemId\":101891199,\"priceSales\":15750,\"priceStandard\":17500,\"mallType\":\"BOOK\",\"stockStatus\":\"\",\"mileage\":59,\"cover\":\"http:\\/\\/image.aladin.co.kr\\/product\\/10189\\/11\\/cover150\\/k852536383_2.jpg\",\"categoryId\":51002,\"categoryName\":\"국내도서>과학>기초과학\\/교양과학\",\"publisher\":\"알마\",\"salesPoint\":137000,\"fixedPrice\":true,\"customerReviewRank\":9,\"bestDuration\":\"종합 10위 6주\",\"bestRank\":22,\"subInfo\":{}},{\"title\":\"지저귀는 새는 날지 않는다 5 - 뉴 루비코믹스 2130\",\"link\":\"http:\\/\\/www.aladin.co.kr\\/shop\\/wproduct.aspx?ItemId=133714835&partner=openAPI&start=api\",\"author\":\"요네다 코우 지음\",\"pubDate\":\"2018-02-08\",\"description\":\"세력 다툼이 한창인 가운데 신세이회 간부 야시로는 도메키의 방에서 그와 마주하고 있었다. 두 사람은 서로를 강하게 의식하면서도 지금까지 선을 넘지 않도록 마음을 억눌러왔다. 하지만 궁지에 몰린 도메키가 야시로에게 마음을 고백했을 때 그때까지 유지해온 균형이 무너졌다.\",\"isbn\":\"8927058585\",\"isbn13\":\"9788927058588\",\"itemId\":133714835,\"priceSales\":5400,\"priceStandard\":6000,\"mallType\":\"BOOK\",\"stockStatus\":\"\",\"mileage\":23,\"cover\":\"http:\\/\\/image.aladin.co.kr\\/product\\/13371\\/48\\/cover150\\/8927058585_1.jpg\",\"categoryId\":6130,\"categoryName\":\"국내도서>만화>순정만화>그 남자들의 사랑\",\"publisher\":\"현대지능개발사\",\"salesPoint\":17920,\"fixedPrice\":true,\"customerReviewRank\":10,\"bestRank\":23,\"subInfo\":{}},{\"title\":\"언어의 온도 - 말과 글에는 나름의 따뜻함과 차가움이 있다\",\"link\":\"http:\\/\\/www.aladin.co.kr\\/shop\\/wproduct.aspx?ItemId=88957773&partner=openAPI&start=api\",\"author\":\"이기주 지음\",\"pubDate\":\"2016-08-19\",\"description\":\"언어에는 나름의 온도가 있다고 생각하는 저자가 일상에서 발견한 의미 있는 말과 글을 한 권의 책에 담았다. 저자는 단어의 어원과 유래, 그런 언어가 지닌 차가움과 따뜻함을 글감 삼아, 하찮아 보이는 것들의 소중함을 예찬한다.\",\"isbn\":\"K582535393\",\"isbn13\":\"9791195522125\",\"itemId\":88957773,\"priceSales\":12420,\"priceStandard\":13800,\"mallType\":\"BOOK\",\"stockStatus\":\"\",\"mileage\":39,\"cover\":\"http:\\/\\/image.aladin.co.kr\\/product\\/8895\\/77\\/cover150\\/k582535393_1.jpg\",\"categoryId\":51371,\"categoryName\":\"국내도서>에세이>한국에세이\",\"publisher\":\"말글터\",\"salesPoint\":321153,\"fixedPrice\":true,\"customerReviewRank\":6,\"bestDuration\":\"종합 10위 33주\",\"bestRank\":24,\"subInfo\":{}},{\"title\":\"시월의 저택\",\"link\":\"http:\\/\\/www.aladin.co.kr\\/shop\\/wproduct.aspx?ItemId=130955792&partner=openAPI&start=api\",\"author\":\"레이 브래드버리 지음, 조호근 옮김\",\"pubDate\":\"2018-01-22\",\"description\":\"지구의 작은 한 점에서 영원한 우주를 꿈꾼 작가, 환상문학의 음유시인 레이 브래드버리. 현대문학 폴라북스는 '엘리엇 가족'의 시작과 끝을 다룬 브래드버리의 연작소설 <시월의 저택>을 '폴라 데이 앤드 나이트'를 통해 선보인다.\",\"isbn\":\"8993094578\",\"isbn13\":\"9788993094572\",\"itemId\":130955792,\"priceSales\":10800,\"priceStandard\":12000,\"mallType\":\"BOOK\",\"stockStatus\":\"\",\"mileage\":38,\"cover\":\"http:\\/\\/image.aladin.co.kr\\/product\\/13095\\/57\\/cover150\\/8993094578_1.jpg\",\"categoryId\":89481,\"categoryName\":\"국내도서>소설\\/시\\/희곡>과학소설(SF)>외국\",\"publisher\":\"폴라북스(현대문학)\",\"salesPoint\":19670,\"fixedPrice\":true,\"customerReviewRank\":9,\"bestRank\":25,\"seriesInfo\":{\"seriesId\":27080,\"seriesLink\":\"http://www.aladin.co.kr/shop/common/wseriesitem.aspx?SRID=27080&partner=openAPI\",\"seriesName\":\"폴라 데이 앤 나이트 Polar Day & Night \"},\"subInfo\":{}},{\"title\":\"해커스 토익 보카 - 토익 최신 기출단어.적중 출제포인트 30일 완성, 신토익 필수 이디엄 표현 수록, 주제별 연상암기 30일 정복\",\"link\":\"http:\\/\\/www.aladin.co.kr\\/shop\\/wproduct.aspx?ItemId=83405075&partner=openAPI&start=api\",\"author\":\"데이빗 조 (David Cho) 지음\",\"pubDate\":\"2016-05-09\",\"description\":\"토익 최신 기출과 신토익을 완벽 반영한 교재. Part 5&6 빈출 단어부터 Part 7 및 리스닝 주요 단어까지 대비할 수 있도록 하였고, 개별학습 및 스터디 학습에 활용 가능한 맞춤형 학습방법을 제공한다.\",\"isbn\":\"8965421837\",\"isbn13\":\"9788965421832\",\"itemId\":83405075,\"priceSales\":11610,\"priceStandard\":12900,\"mallType\":\"BOOK\",\"stockStatus\":\"\",\"mileage\":54,\"cover\":\"http:\\/\\/image.aladin.co.kr\\/product\\/8340\\/50\\/cover150\\/s552532885_1.jpg\",\"categoryId\":49857,\"categoryName\":\"국내도서>외국어>토익>Vocabulary\",\"publisher\":\"해커스어학연구소(Hackers)\",\"salesPoint\":157227,\"fixedPrice\":true,\"customerReviewRank\":9,\"bestDuration\":\"종합 100위 77주\",\"bestRank\":26,\"seriesInfo\":{\"seriesId\":104379,\"seriesLink\":\"http://www.aladin.co.kr/shop/common/wseriesitem.aspx?SRID=104379&partner=openAPI\",\"seriesName\":\"해커스 신토익 \"},\"subInfo\":{}},{\"title\":\"2018 고종훈 한국사 동형모의고사 season 1 - 9급대비.7급대비.경찰직대비\",\"link\":\"http:\\/\\/www.aladin.co.kr\\/shop\\/wproduct.aspx?ItemId=132744234&partner=openAPI&start=api\",\"author\":\"고종훈 지음\",\"pubDate\":\"2018-02-06\",\"description\":\"\",\"isbn\":\"K072532702\",\"isbn13\":\"9791161010397\",\"itemId\":132744234,\"priceSales\":10800,\"priceStandard\":12000,\"mallType\":\"BOOK\",\"stockStatus\":\"\",\"mileage\":42,\"cover\":\"http:\\/\\/image.aladin.co.kr\\/product\\/13274\\/42\\/cover150\\/k072532702_1.jpg\",\"categoryId\":34631,\"categoryName\":\"국내도서>수험서\\/자격증>공무원 수험서>7\\/9급 공무원>한국사>기출\\/문제집\\/모의고사\",\"publisher\":\"발해북스\",\"salesPoint\":18590,\"fixedPrice\":true,\"customerReviewRank\":10,\"bestRank\":27,\"seriesInfo\":{\"seriesId\":631206,\"seriesLink\":\"http://www.aladin.co.kr/shop/common/wseriesitem.aspx?SRID=631206&partner=openAPI\",\"seriesName\":\"2018 고종훈 한국사 동형모의고사 \"},\"subInfo\":{}},{\"title\":\"현남 오빠에게 (어나더커버 특별판)\",\"link\":\"http:\\/\\/www.aladin.co.kr\\/shop\\/wproduct.aspx?ItemId=131792992&partner=openAPI&start=api\",\"author\":\"조남주 외 지음\",\"pubDate\":\"2017-11-15\",\"description\":\"다양한 문화 권역으로 '페미니즘' 이슈가 한창인 현재, 한국 사회에서 글을 쓰는 여성으로 살아가는 3-40대 작가들이 국내 최초로 '페미니즘'이라는 테마 아래 발표한 소설집이다. 조남주, 최은영, 김이설, 최정화, 손보미, 구병모, 김성중 등 여성 작가 7인이 함께했다.\",\"isbn\":\"K582532390\",\"isbn13\":\"9791130614779\",\"itemId\":131792992,\"priceSales\":12600,\"priceStandard\":14000,\"mallType\":\"BOOK\",\"stockStatus\":\"\",\"mileage\":45,\"cover\":\"http:\\/\\/image.aladin.co.kr\\/product\\/13179\\/29\\/cover150\\/k582532390_1.jpg\",\"categoryId\":50993,\"categoryName\":\"국내도서>소설\\/시\\/희곡>한국소설>2000년대 이후 한국소설\",\"publisher\":\"다산책방\",\"salesPoint\":85155,\"fixedPrice\":true,\"customerReviewRank\":8,\"bestDuration\":\"종합 100위 3주\",\"bestRank\":28,\"subInfo\":{}},{\"title\":\"마법천자문 41 - 내가 나아갈 길! 길 도 道!\",\"link\":\"http:\\/\\/www.aladin.co.kr\\/shop\\/wproduct.aspx?ItemId=131896138&partner=openAPI&start=api\",\"author\":\"올댓스토리 지음, 김성재 윤색, 홍거북 그림, 김창환 감수\",\"pubDate\":\"2018-01-25\",\"description\":\"손오공의 모험 이야기를 따라가면서 쓰기보다 뜻과 소리를 먼저 읽고 그림으로 한자를 보면서 학습할 수 있도록 한 한자학습만화다. 마법의 주문으로 음과 훈을 읽기 때문에 재미있게 한자를 배울 수 있다.\",\"isbn\":\"8950973227\",\"isbn13\":\"9788950973223\",\"itemId\":131896138,\"priceSales\":8820,\"priceStandard\":9800,\"mallType\":\"BOOK\",\"stockStatus\":\"\",\"mileage\":38,\"cover\":\"http:\\/\\/image.aladin.co.kr\\/product\\/13189\\/61\\/cover150\\/8950973227_1.jpg\",\"categoryId\":48941,\"categoryName\":\"국내도서>어린이>어린이 한자>학습만화\",\"publisher\":\"아울북\",\"salesPoint\":45810,\"fixedPrice\":true,\"customerReviewRank\":10,\"bestDuration\":\"종합 10위 2주\",\"bestRank\":29,\"seriesInfo\":{\"seriesId\":13717,\"seriesLink\":\"http://www.aladin.co.kr/shop/common/wseriesitem.aspx?SRID=13717&partner=openAPI\",\"seriesName\":\"마법천자문 41\"},\"subInfo\":{}},{\"title\":\"거실공부의 마법 - 우리 아이 평생 공부 저력을 키워주는 결정적 공부법\",\"link\":\"http:\\/\\/www.aladin.co.kr\\/shop\\/wproduct.aspx?ItemId=130951940&partner=openAPI&start=api\",\"author\":\"오가와 다이스케 지음, 정미현 옮김\",\"pubDate\":\"2018-02-19\",\"description\":\"총 1만 건 이상의 학습 및 진학 상담을 해온 일본의 실력파 입시 전문가이자 최고의 초등학습 전문가가 쓰고, 도서관 사서의 경험을 바탕으로 한 책육아를 통해 두 아이를 영재고, 민사고에 보낸 책쟁이엄마가 아이의 발달 단계를 고려하여 세심하게 고르고 고른 170여개의 추천 도서 리스트가 실렸다.\",\"isbn\":\"K182532092\",\"isbn13\":\"9791196012748\",\"itemId\":130951940,\"priceSales\":11700,\"priceStandard\":13000,\"mallType\":\"BOOK\",\"stockStatus\":\"\",\"mileage\":43,\"cover\":\"http:\\/\\/image.aladin.co.kr\\/product\\/13095\\/19\\/cover150\\/k182532092_1.jpg\",\"categoryId\":85853,\"categoryName\":\"국내도서>좋은부모>육아\\/교육>엄마 육아\",\"publisher\":\"키스톤\",\"salesPoint\":21120,\"fixedPrice\":true,\"customerReviewRank\":10,\"bestDuration\":\"좋은부모 1위 3주\",\"bestRank\":30,\"subInfo\":{}},{\"title\":\"당신과 나 사이 - 너무 멀어서 외롭지 않고 너무 가까워서 상처 입지 않는 거리를 찾는 법\",\"link\":\"http:\\/\\/www.aladin.co.kr\\/shop\\/wproduct.aspx?ItemId=131938867&partner=openAPI&start=api\",\"author\":\"김혜남 지음\",\"pubDate\":\"2018-01-30\",\"description\":\"무례한 사람들의 부당한 비난으로부터 우아하게 나를 지키면서, 소중한 사람들과 후회 없는 인생을 살아가게 해 주는 인간관계의 기술. <서른 살이 심리학에게 묻다>로 독자의 마음을 움직인 김혜남 정신분석 전문의가 펴낸 인간관계 심리학이다.\",\"isbn\":\"K272532493\",\"isbn13\":\"9791196067632\",\"itemId\":131938867,\"priceSales\":13500,\"priceStandard\":15000,\"mallType\":\"BOOK\",\"stockStatus\":\"\",\"mileage\":49,\"cover\":\"http:\\/\\/image.aladin.co.kr\\/product\\/13193\\/88\\/cover150\\/k272532493_1.jpg\",\"categoryId\":51514,\"categoryName\":\"국내도서>인문학>심리학\\/정신분석학>교양 심리학\",\"publisher\":\"메이븐\",\"salesPoint\":16670,\"fixedPrice\":true,\"customerReviewRank\":8,\"bestRank\":31,\"subInfo\":{}},{\"title\":\"해커스 토익 Reading (2018 최신개정판) - 본 교재 인강 + 실전모의고사 4회 + 단어암기장(별책) & 단어암기 MP3 무료 제공, 토익 RC리딩 문법 독해 어휘에서 실전까지! 신토익 최신경향 반영\",\"link\":\"http:\\/\\/www.aladin.co.kr\\/shop\\/wproduct.aspx?ItemId=125385185&partner=openAPI&start=api\",\"author\":\"데이빗 조 (David Cho) 지음\",\"pubDate\":\"2018-01-02\",\"description\":\"신토익 최신 출제경향 반영한 2018 최신판으로 Reading 최신경향에 맞춘 파트별 공략법을 제시한다. 한 권으로 기본부터 실전까지 토익 RC를 대비할 수 있고, 진단고사로 실력 점검하고 자신에게 맞는 수준별 학습플랜 선택이 가능하다.\",\"isbn\":\"8965422388\",\"isbn13\":\"9788965422389\",\"itemId\":125385185,\"priceSales\":16920,\"priceStandard\":18800,\"mallType\":\"BOOK\",\"stockStatus\":\"\",\"mileage\":87,\"cover\":\"http:\\/\\/image.aladin.co.kr\\/product\\/12538\\/51\\/cover150\\/s492532885_1.jpg\",\"categoryId\":49854,\"categoryName\":\"국내도서>외국어>토익>Reading\",\"publisher\":\"해커스어학연구소(Hackers)\",\"salesPoint\":140439,\"fixedPrice\":true,\"customerReviewRank\":9,\"bestDuration\":\"종합 100위 7주\",\"bestRank\":32,\"seriesInfo\":{\"seriesId\":92125,\"seriesLink\":\"http://www.aladin.co.kr/shop/common/wseriesitem.aspx?SRID=92125&partner=openAPI\",\"seriesName\":\"해커스 토익 기본서 \"},\"subInfo\":{}},{\"title\":\"산하엽 - 흘러간, 놓아준 것들\",\"link\":\"http:\\/\\/www.aladin.co.kr\\/shop\\/wproduct.aspx?ItemId=70139877&partner=openAPI&start=api\",\"author\":\"종현 (SHINee) 글.사진\",\"pubDate\":\"2015-11-19\",\"description\":\"샤이니 종현의 첫 소설책. 2015년 9월 발매돼 좋은 반응을 얻고 있는 종현의 첫 소품집 <이야기 Op.1>에 수록된 '하루의 끝', '산하엽', 'U&I', '내일쯤' 등은 물론 기존 샤이니의 곡까지 종현이 작사한 총 12곡의 비하인드 스토리를 모아 사랑과 이별에 관한 소설로 풀어낸 작품이다.\",\"isbn\":\"8996955485\",\"isbn13\":\"9788996955481\",\"itemId\":70139877,\"priceSales\":13000,\"priceStandard\":13000,\"mallType\":\"BOOK\",\"stockStatus\":\"\",\"mileage\":50,\"cover\":\"http:\\/\\/image.aladin.co.kr\\/product\\/7013\\/98\\/cover150\\/8996955485_1.jpg\",\"categoryId\":50993,\"categoryName\":\"국내도서>소설\\/시\\/희곡>한국소설>2000년대 이후 한국소설\",\"publisher\":\"SM 엔터테인먼트\",\"salesPoint\":122132,\"fixedPrice\":true,\"customerReviewRank\":10,\"bestDuration\":\"종합 10위 2주\",\"bestRank\":33,\"subInfo\":{}},{\"title\":\"그 겨울의 일주일\",\"link\":\"http:\\/\\/www.aladin.co.kr\\/shop\\/wproduct.aspx?ItemId=128664455&partner=openAPI&start=api\",\"author\":\"메이브 빈치 지음, 정연희 옮김\",\"pubDate\":\"2018-01-02\",\"description\":\"\\\"아일랜드인이 가장 사랑하는 작가\\\", \\\"타고난 이야기꾼\\\"이라는 평을 듣는 세계적인 베스트셀러 작가 메이브 빈치 소설. 사후에 발표된 그녀의 마지막 작품으로, 아일랜드 서부 해안에 위치한 작은 호텔 스톤하우스를 배경으로, 이곳에 모인 사람들의 이야기를 따뜻하고 위트 있게 그려냈다.\",\"isbn\":\"8954649890\",\"isbn13\":\"9788954649896\",\"itemId\":128664455,\"priceSales\":13320,\"priceStandard\":14800,\"mallType\":\"BOOK\",\"stockStatus\":\"\",\"mileage\":52,\"cover\":\"http:\\/\\/image.aladin.co.kr\\/product\\/12866\\/44\\/cover150\\/8954649890_1.jpg\",\"categoryId\":52652,\"categoryName\":\"국내도서>소설\\/시\\/희곡>세계의 소설>아일랜드소설\",\"publisher\":\"문학동네\",\"salesPoint\":46700,\"fixedPrice\":true,\"customerReviewRank\":9,\"bestDuration\":\"종합 100위 5주\",\"bestRank\":34,\"subInfo\":{}},{\"title\":\"이상한 정상가족 - 자율적 개인과 열린 공동체를 그리며\",\"link\":\"http:\\/\\/www.aladin.co.kr\\/shop\\/wproduct.aspx?ItemId=123707643&partner=openAPI&start=api\",\"author\":\"김희경 지음\",\"pubDate\":\"2017-11-21\",\"description\":\"가족은 사회를 반영하고, 가족 내에서 사회의 비극이 되풀이 된다는 지점에서 ‘정상가족 이데올로기’의 부조리를 다양한 사례들과 연구 결과를 통해 드러내는 책. 18년 경력의 기자 생활과 세이브더칠드런에서의 6년에 걸친 경력 활동가 생활을 바탕으로 사회 시스템 차원에서 원인을 분석하고 한국 사회가 나아가야할 지점에 대한 고민을 담았다.\",\"isbn\":\"8962622092\",\"isbn13\":\"9788962622096\",\"itemId\":123707643,\"priceSales\":13500,\"priceStandard\":15000,\"mallType\":\"BOOK\",\"stockStatus\":\"\",\"mileage\":47,\"cover\":\"http:\\/\\/image.aladin.co.kr\\/product\\/12370\\/76\\/cover150\\/s462532698_1.jpg\",\"categoryId\":51304,\"categoryName\":\"국내도서>사회과학>사회학>사회학 일반\",\"publisher\":\"동아시아\",\"salesPoint\":44965,\"fixedPrice\":true,\"customerReviewRank\":9,\"bestDuration\":\"종합 100위 5주\",\"bestRank\":35,\"subInfo\":{}},{\"title\":\"ETS 토익 정기시험 기출문제집 RC - 신토익 출제기관 최신기출 독점공개 \\/ 해설집 무료 제공\",\"link\":\"http:\\/\\/www.aladin.co.kr\\/shop\\/wproduct.aspx?ItemId=124830274&partner=openAPI&start=api\",\"author\":\"ETS 엮음\",\"pubDate\":\"2017-12-12\",\"description\":\"실제 토익을 경험해보고 감각을 익히는 데에 적합한 토익 실전서. 토익 중급자 이상의 학습자 뿐만 아니라 초급자도 쉽게 문제를 이해할 수 있도록 해설을 간략하고 쉽게 구성하여 실전서에 대한 부담이 있는 학습자의 편의를 배려하였다.\",\"isbn\":\"8917228852\",\"isbn13\":\"9788917228854\",\"itemId\":124830274,\"priceSales\":11250,\"priceStandard\":12500,\"mallType\":\"BOOK\",\"stockStatus\":\"\",\"mileage\":50,\"cover\":\"http:\\/\\/image.aladin.co.kr\\/product\\/12483\\/2\\/cover150\\/s502532668_1.jpg\",\"categoryId\":49854,\"categoryName\":\"국내도서>외국어>토익>Reading\",\"publisher\":\"(주)YBM(와이비엠)\",\"salesPoint\":52925,\"fixedPrice\":true,\"customerReviewRank\":10,\"bestDuration\":\"종합 100위 8주\",\"bestRank\":36,\"seriesInfo\":{\"seriesId\":625613,\"seriesLink\":\"http://www.aladin.co.kr/shop/common/wseriesitem.aspx?SRID=625613&partner=openAPI\",\"seriesName\":\"ETS 토익 정기시험 기출문제집 \"},\"subInfo\":{}},{\"title\":\"바깥은 여름\",\"link\":\"http:\\/\\/www.aladin.co.kr\\/shop\\/wproduct.aspx?ItemId=111454737&partner=openAPI&start=api\",\"author\":\"김애란 지음\",\"pubDate\":\"2017-06-28\",\"description\":\"<비행운> 이후 5년 만에 펴내는 김애란 소설집. 역대 최연소 수상으로 화제를 모은 이상문학상 수상작 '침묵의 미래'와 젊은작가상 수상작 '어디로 가고 싶으신가요'를 포함해 일곱 편의 단편이 실렸다.\",\"isbn\":\"8954646077\",\"isbn13\":\"9788954646079\",\"itemId\":111454737,\"priceSales\":11700,\"priceStandard\":13000,\"mallType\":\"BOOK\",\"stockStatus\":\"\",\"mileage\":42,\"cover\":\"http:\\/\\/image.aladin.co.kr\\/product\\/11145\\/47\\/cover150\\/8954646077_2.jpg\",\"categoryId\":50993,\"categoryName\":\"국내도서>소설\\/시\\/희곡>한국소설>2000년대 이후 한국소설\",\"publisher\":\"문학동네\",\"salesPoint\":164754,\"fixedPrice\":true,\"customerReviewRank\":9,\"bestDuration\":\"종합 10위 11주\",\"bestRank\":37,\"subInfo\":{}},{\"title\":\"세상을 바꾸는 언어 - 민주주의로 가는 말과 글의 힘\",\"link\":\"http:\\/\\/www.aladin.co.kr\\/shop\\/wproduct.aspx?ItemId=129854359&partner=openAPI&start=api\",\"author\":\"양정철 지음\",\"pubDate\":\"2018-01-25\",\"description\":\"언어로 세상을 바꿀 수 있을까. 저자 양정철은 언어학자도 사회학자도 정치학자도 아니지만 언어를 통해 우리 사회가 채워야 할 생활 속 민주주의가 무엇인지에 대해 오래전부터 고민해왔다. 참여정부 5년 내내 국내언론비서관과 홍보기획비서관을 지냈다.\",\"isbn\":\"K582532799\",\"isbn13\":\"9791157061105\",\"itemId\":129854359,\"priceSales\":13500,\"priceStandard\":15000,\"mallType\":\"BOOK\",\"stockStatus\":\"\",\"mileage\":47,\"cover\":\"http:\\/\\/image.aladin.co.kr\\/product\\/12985\\/43\\/cover150\\/k582532799_1.jpg\",\"categoryId\":51059,\"categoryName\":\"국내도서>사회과학>비평\\/칼럼>한국사회비평\\/칼럼\",\"publisher\":\"메디치미디어\",\"salesPoint\":42190,\"fixedPrice\":true,\"customerReviewRank\":9,\"bestDuration\":\"종합 100위 4주\",\"bestRank\":38,\"subInfo\":{}},{\"title\":\"검은 꽃 - 개정판\",\"link\":\"http:\\/\\/www.aladin.co.kr\\/shop\\/wproduct.aspx?ItemId=6428284&partner=openAPI&start=api\",\"author\":\"김영하 지음\",\"pubDate\":\"2010-02-16\",\"description\":\"'김영하적인'에서 '경쾌한 문체와 자유로운 상상력'만을 떠올렸던 사람이라면 그 수식어는 <검은 꽃> 이후 새롭게 정의되어야 한다. 이 소설은 이제까지 김영하가 발표했던 모든 책의 장점을 지닌 동시에 그것들과 완전히 다르다. \\\"무엇을 기대하든 그것과 다른 것을 보게 될 것\\\"이란 작가의 자신만만한 말은, 책을 펼쳐든 순간 현실이 된다.\",\"isbn\":\"8954610137\",\"isbn13\":\"9788954610131\",\"itemId\":6428284,\"priceSales\":9900,\"priceStandard\":11000,\"mallType\":\"BOOK\",\"stockStatus\":\"\",\"mileage\":40,\"cover\":\"http:\\/\\/image.aladin.co.kr\\/product\\/642\\/82\\/cover150\\/8954610137_1.jpg\",\"categoryId\":50993,\"categoryName\":\"국내도서>소설\\/시\\/희곡>한국소설>2000년대 이후 한국소설\",\"publisher\":\"문학동네\",\"salesPoint\":66302,\"fixedPrice\":true,\"customerReviewRank\":9,\"bestDuration\":\"종합 100위 3주\",\"bestRank\":39,\"seriesInfo\":{\"seriesId\":16911,\"seriesLink\":\"http://www.aladin.co.kr/shop/common/wseriesitem.aspx?SRID=16911&partner=openAPI\",\"seriesName\":\"김영하 컬렉션 \"},\"subInfo\":{}},{\"title\":\"가장 빨리 부자 되는 법\",\"link\":\"http:\\/\\/www.aladin.co.kr\\/shop\\/wproduct.aspx?ItemId=129324779&partner=openAPI&start=api\",\"author\":\"알렉스 베커 지음, 오지연 옮김\",\"pubDate\":\"2018-01-17\",\"description\":\"인생에서 가장 빨리 부자가 되는 방법이 들어 있다. 핵심은 부자가 되기로 결정하는 것이다. 그리고 부자들이 실제로 쓰는 방법들을 실천해야 한다. 책에는 ‘부자가 되겠다’는 생각이 멈추지 않도록 따라해 볼 구체적 사례와 방법이 들어 있다. 당신이 부자가 되도록 목표를 정하고 계획을 수립하는 방법을 친절하게 안내한다.\",\"isbn\":\"K902532480\",\"isbn13\":\"9791186665794\",\"itemId\":129324779,\"priceSales\":13050,\"priceStandard\":14500,\"mallType\":\"BOOK\",\"stockStatus\":\"\",\"mileage\":47,\"cover\":\"http:\\/\\/image.aladin.co.kr\\/product\\/12932\\/47\\/cover150\\/k902532480_1.jpg\",\"categoryId\":2225,\"categoryName\":\"국내도서>경제경영>재테크\\/투자>재테크\\/투자 일반\",\"publisher\":\"유노북스\",\"salesPoint\":23770,\"fixedPrice\":true,\"customerReviewRank\":10,\"bestDuration\":\"종합 100위 2주\",\"bestRank\":40,\"subInfo\":{}},{\"title\":\"운다고 달라지는 일은 아무것도 없겠지만\",\"link\":\"http:\\/\\/www.aladin.co.kr\\/shop\\/wproduct.aspx?ItemId=111556570&partner=openAPI&start=api\",\"author\":\"박준 지음\",\"pubDate\":\"2017-07-01\",\"description\":\"<당신의 이름을 지어다가 며칠은 먹었다>의 시인 박준, 그의 첫 산문집. 박준 시인이 그간 제 시를 함께 읽어주고 함께 느껴주고 함께 되새겨준 여러분들에게 보내는 한 권의 답서이자 연서이다. '시인 박준'이라는 '사람'을 정통으로 관통하는 글이 수록되어 있다.\",\"isbn\":\"K202531987\",\"isbn13\":\"9791196075170\",\"itemId\":111556570,\"priceSales\":10800,\"priceStandard\":12000,\"mallType\":\"BOOK\",\"stockStatus\":\"\",\"mileage\":38,\"cover\":\"http:\\/\\/image.aladin.co.kr\\/product\\/11155\\/65\\/cover150\\/k202531987_1.jpg\",\"categoryId\":51371,\"categoryName\":\"국내도서>에세이>한국에세이\",\"publisher\":\"난다\",\"salesPoint\":134514,\"fixedPrice\":true,\"customerReviewRank\":9,\"bestDuration\":\"종합 10위 8주\",\"bestRank\":41,\"subInfo\":{}},{\"title\":\"시원찮은 그녀를 위한 육성방법 13 - 완결, L Novel\",\"link\":\"http:\\/\\/www.aladin.co.kr\\/shop\\/wproduct.aspx?ItemId=132531030&partner=openAPI&start=api\",\"author\":\"마루토 후미아키 지음, 이승원 옮김, 미사키 쿠레히토 그림\",\"pubDate\":\"2018-02-10\",\"description\":\"시원찮은 그녀와의 러브스토리, 완결편. 기승전결의 『전』 이벤트를 극복하고「blessing software」의 신작 게임을 완성하기 위한 마지막 작업에 들어간 나는 큰 결심을 하고 메구미에게 고백했다. “내가 너를 모든 이들의 가슴을 두근거리게 하는 메인 히로인으로 만들어주겠어!”\",\"isbn\":\"K512532692\",\"isbn13\":\"9791127843830\",\"itemId\":132531030,\"priceSales\":6300,\"priceStandard\":7000,\"mallType\":\"BOOK\",\"stockStatus\":\"\",\"mileage\":26,\"cover\":\"http:\\/\\/image.aladin.co.kr\\/product\\/13253\\/10\\/cover150\\/k512532692_1.jpg\",\"categoryId\":51106,\"categoryName\":\"국내도서>소설\\/시\\/희곡>라이트 노벨>L 노벨\",\"publisher\":\"디앤씨미디어(주)(D&C미디어)\",\"salesPoint\":28840,\"fixedPrice\":true,\"customerReviewRank\":10,\"bestDuration\":\"종합 100위 2주\",\"bestRank\":42,\"subInfo\":{}},{\"title\":\"재즈 잇 업! Jazz It Up! - 남무성의 만화로 보는 재즈의 역사, 출간 15주년 특별 개정증보판\",\"link\":\"http:\\/\\/www.aladin.co.kr\\/shop\\/wproduct.aspx?ItemId=132200228&partner=openAPI&start=api\",\"author\":\"남무성 지음\",\"pubDate\":\"2018-02-10\",\"description\":\"1900년대부터 시작되는 장대한 재즈의 역사를 익살스럽고 위트 있는 만화로 펼쳐놓았다. 그간 3년 가까운 준비 기간을 거친 저자는 올해 드디어 전체적인 문장을 손보는 것은 물론, 70%의 그림을 다시 그리고 새로운 콘텐츠를 추가하여 ‘15주년 특별 개정판’으로 새롭게 펴냈다.\",\"isbn\":\"8974839148\",\"isbn13\":\"9788974839147\",\"itemId\":132200228,\"priceSales\":24300,\"priceStandard\":27000,\"mallType\":\"BOOK\",\"stockStatus\":\"\",\"mileage\":89,\"cover\":\"http:\\/\\/image.aladin.co.kr\\/product\\/13220\\/2\\/cover150\\/8974839148_2.jpg\",\"categoryId\":51018,\"categoryName\":\"국내도서>예술\\/대중문화>음악>재즈\",\"publisher\":\"서해문집\",\"salesPoint\":14910,\"fixedPrice\":true,\"customerReviewRank\":10,\"bestRank\":43,\"subInfo\":{}},{\"title\":\"김영철.타일러의 진짜 미국식 영어 - 한 마디를 해도 통하는\",\"link\":\"http:\\/\\/www.aladin.co.kr\\/shop\\/wproduct.aspx?ItemId=124412842&partner=openAPI&start=api\",\"author\":\"김영철.타일러 라쉬 지음\",\"pubDate\":\"2017-12-08\",\"description\":\"단 한순간도 영어를 놓은 적 없지만, 단 한 번도 통한 적 없었다면, 이게 다 한국식 영어 때문이다. 학교에서도, 학원에서도 알려주지 않는 진짜 미국식 영어 대공개. 영어가 서툴러도 미국식 영어라면 어디에서나 통하는 대화를 할 수 있다. 타일러가 알려주는, 현지인들이 매일같이 쓰는 찰진 영어 표현들로 이제 영어에 현장감을 더해보자.\",\"isbn\":\"K192531656\",\"isbn13\":\"9791162201510\",\"itemId\":124412842,\"priceSales\":13320,\"priceStandard\":14800,\"mallType\":\"BOOK\",\"stockStatus\":\"\",\"mileage\":53,\"cover\":\"http:\\/\\/image.aladin.co.kr\\/product\\/12441\\/28\\/cover150\\/k192531656_3.jpg\",\"categoryId\":49849,\"categoryName\":\"국내도서>외국어>영어회화>생활영어\",\"publisher\":\"위즈덤하우스\",\"salesPoint\":66240,\"fixedPrice\":true,\"customerReviewRank\":9,\"bestDuration\":\"종합 100위 8주\",\"bestRank\":44,\"subInfo\":{}},{\"title\":\"2018 전한길 한국사 합격생 필기노트 + 빵꾸노트 - 전2권\",\"link\":\"http:\\/\\/www.aladin.co.kr\\/shop\\/wproduct.aspx?ItemId=112903114&partner=openAPI&start=api\",\"author\":\"전한길 지음\",\"pubDate\":\"2017-07-10\",\"description\":\"전한길 교수의 한국사 20년 강의 노하우 공개! 2017 최신 공무원 기출문제까지 모두 반영한 필기노트와 더불어 필기노트 내용 중 반드시 외워야 하는 중요 개념은 빈칸 넣기를 통해 정리할 수 있도록 빵꾸노트를 함께 수록했다.\",\"isbn\":\"K092531999\",\"isbn13\":\"9791161312798\",\"itemId\":112903114,\"priceSales\":17100,\"priceStandard\":19000,\"mallType\":\"BOOK\",\"stockStatus\":\"\",\"mileage\":77,\"cover\":\"http:\\/\\/image.aladin.co.kr\\/product\\/11290\\/31\\/cover150\\/k092531999_1.jpg\",\"categoryId\":34630,\"categoryName\":\"국내도서>수험서\\/자격증>공무원 수험서>7\\/9급 공무원>한국사>강의노트\\/기타\",\"publisher\":\"(주)에스티유니타스\",\"salesPoint\":97998,\"fixedPrice\":true,\"customerReviewRank\":9,\"bestDuration\":\"종합 10위 2주\",\"bestRank\":45,\"seriesInfo\":{\"seriesId\":613002,\"seriesLink\":\"http://www.aladin.co.kr/shop/common/wseriesitem.aspx?SRID=613002&partner=openAPI\",\"seriesName\":\"2018 전한길 한국사 시리즈 \"},\"subInfo\":{}},{\"title\":\"ETS 토익 정기시험 기출문제집 LC - 신토익 출제기관 최신기출 독점공개 \\/ 해설집 무료 제공\",\"link\":\"http:\\/\\/www.aladin.co.kr\\/shop\\/wproduct.aspx?ItemId=124830071&partner=openAPI&start=api\",\"author\":\"ETS 엮음\",\"pubDate\":\"2017-12-12\",\"description\":\"출제기관 ETS의 실제 토익 기출문제를 접할 수 있는 유일한 토익 교재로 토익 학습에 적합하고 효율적이다. 정기시험의 유형과 난이도를 직접 체험하여 실전 감각을 최대치로 끌어올릴 수 있으며, 정기시험과 동일한 성우 음성으로 실제 시험장과 같은 분위기에서 학습이 가능하다.\",\"isbn\":\"8917228844\",\"isbn13\":\"9788917228847\",\"itemId\":124830071,\"priceSales\":11250,\"priceStandard\":12500,\"mallType\":\"BOOK\",\"stockStatus\":\"\",\"mileage\":48,\"cover\":\"http:\\/\\/image.aladin.co.kr\\/product\\/12483\\/0\\/cover150\\/s482532668_1.jpg\",\"categoryId\":49855,\"categoryName\":\"국내도서>외국어>토익>Listening\",\"publisher\":\"(주)YBM(와이비엠)\",\"salesPoint\":48535,\"fixedPrice\":true,\"customerReviewRank\":9,\"bestDuration\":\"종합 100위 8주\",\"bestRank\":46,\"seriesInfo\":{\"seriesId\":625613,\"seriesLink\":\"http://www.aladin.co.kr/shop/common/wseriesitem.aspx?SRID=625613&partner=openAPI\",\"seriesName\":\"ETS 토익 정기시험 기출문제집 \"},\"subInfo\":{}},{\"title\":\"2018 선재국어 한 권으로 정리하는 마무리 - 7.9급 공무원 시험 대비\",\"link\":\"http:\\/\\/www.aladin.co.kr\\/shop\\/wproduct.aspx?ItemId=122201601&partner=openAPI&start=api\",\"author\":\"이선재 지음\",\"pubDate\":\"2017-11-10\",\"description\":\"단기간에 방대한 국어의 주요 내용을 정리할 수 있도록 구성된 핵심 요약집. 시험에 꼭 나오는 핵심적인 이론을 압축 정리하여 짧은 시간 안에 전체 내용을 체계적으로 습득할 수 있고, 보조단에 최신 기출문제를 실어 공무원 시험의 출제 경향을 한눈에 파악할 수 있다.\",\"isbn\":\"K912531540\",\"isbn13\":\"9791161313900\",\"itemId\":122201601,\"priceSales\":18000,\"priceStandard\":20000,\"mallType\":\"BOOK\",\"stockStatus\":\"\",\"mileage\":78,\"cover\":\"http:\\/\\/image.aladin.co.kr\\/product\\/12220\\/16\\/cover150\\/k912531540_1.jpg\",\"categoryId\":34612,\"categoryName\":\"국내도서>수험서\\/자격증>공무원 수험서>7\\/9급 공무원>국어>7\\/9급 기본서 및 부교재\",\"publisher\":\"(주)에스티유니타스\",\"salesPoint\":70570,\"fixedPrice\":true,\"customerReviewRank\":8,\"bestDuration\":\"종합 100위 13주\",\"bestRank\":47,\"seriesInfo\":{\"seriesId\":614864,\"seriesLink\":\"http://www.aladin.co.kr/shop/common/wseriesitem.aspx?SRID=614864&partner=openAPI\",\"seriesName\":\"2018 선재국어 \"},\"subInfo\":{}},{\"title\":\"환생동물학교 1\",\"link\":\"http:\\/\\/www.aladin.co.kr\\/shop\\/wproduct.aspx?ItemId=132114043&partner=openAPI&start=api\",\"author\":\"엘렌 심 지음\",\"pubDate\":\"2018-02-08\",\"description\":\"『고양이 낸시』 엘렌 심 작가의 최신작으로, 제목 그대로 동물들이 인간으로 환생하기 전 인간에 대해 배우는 학교를 그려낸 만화이다. 악의라고는 찾아볼 수 없는 착한 동물 친구들이 종도 다르고 특성도 다른 서로를 포용하고 배려해 나가는 과정을 담은 아름다운 작품이다.\",\"isbn\":\"K912532599\",\"isbn13\":\"9791162334386\",\"itemId\":132114043,\"priceSales\":13500,\"priceStandard\":15000,\"mallType\":\"BOOK\",\"stockStatus\":\"\",\"mileage\":48,\"cover\":\"http:\\/\\/image.aladin.co.kr\\/product\\/13211\\/40\\/cover150\\/k912532599_1.jpg\",\"categoryId\":3936,\"categoryName\":\"국내도서>만화>애완동물\\/동물만화\",\"publisher\":\"북폴리오\",\"salesPoint\":21820,\"fixedPrice\":true,\"customerReviewRank\":9,\"bestDuration\":\"종합 100위 2주\",\"bestRank\":48,\"subInfo\":{}},{\"title\":\"우리는 언젠가 만난다 - 나, 타인, 세계를 이어주는 40가지 눈부신 이야기\",\"link\":\"http:\\/\\/www.aladin.co.kr\\/shop\\/wproduct.aspx?ItemId=125962044&partner=openAPI&start=api\",\"author\":\"채사장 지음\",\"pubDate\":\"2017-12-20\",\"description\":\"<지적 대화를 위한 넓고 얕은 지식>, <시민의 교양>, <열한 계단>의 저자 채사장이 이제 관계에 대하여 탐구한다. 우리는 나면서부터 관계를 맺는다. 아니, 정확히는, 원하지 않아도 탄생의 순간 그 즉시 타인과, 세계와의 관계가 생긴다.\",\"isbn\":\"K252532871\",\"isbn13\":\"9791188248124\",\"itemId\":125962044,\"priceSales\":12600,\"priceStandard\":14000,\"mallType\":\"BOOK\",\"stockStatus\":\"\",\"mileage\":43,\"cover\":\"http:\\/\\/image.aladin.co.kr\\/product\\/12596\\/20\\/cover150\\/k252532871_1.jpg\",\"categoryId\":51378,\"categoryName\":\"국내도서>인문학>교양 인문학\",\"publisher\":\"웨일북\",\"salesPoint\":69015,\"fixedPrice\":true,\"customerReviewRank\":9,\"bestDuration\":\"종합 100위 7주\",\"bestRank\":49,\"subInfo\":{}},{\"title\":\"변변찮은 마술강사와 금기교전 9 - L Novel\",\"link\":\"http:\\/\\/www.aladin.co.kr\\/shop\\/wproduct.aspx?ItemId=133742071&partner=openAPI&start=api\",\"author\":\"히츠지 타로 지음, 최승원 옮김, 미시마 쿠로네 그림\",\"pubDate\":\"2018-02-10\",\"description\":\"저번 사건 이후로 행방이 묘연해진 숙적 저티스 로우판. 그의 책략으로 루미아가 납치당하고 글렌은 시청 폭파 테러의 용의자로서 지명수배를 받는다. 글렌은 파트너로서 착실히 성장 중인 시스티나의 도움을 받으며 사건을 해결하려고 페지테를 헤집고 다니지만….\",\"isbn\":\"K862532108\",\"isbn13\":\"9791127843861\",\"itemId\":133742071,\"priceSales\":6300,\"priceStandard\":7000,\"mallType\":\"BOOK\",\"stockStatus\":\"\",\"mileage\":28,\"cover\":\"http:\\/\\/image.aladin.co.kr\\/product\\/13374\\/20\\/cover150\\/k862532108_1.jpg\",\"categoryId\":51106,\"categoryName\":\"국내도서>소설\\/시\\/희곡>라이트 노벨>L 노벨\",\"publisher\":\"디앤씨미디어(주)(D&C미디어)\",\"salesPoint\":18530,\"fixedPrice\":true,\"customerReviewRank\":10,\"bestRank\":50,\"subInfo\":{}}]}".replaceAll("\\\'", "\\u0027").replaceAll(";", "");
BookVO bVo = new Gson().fromJson(json, BookVO.class);
JsonObject jObj = new JsonObject();
res.setContentType("application/x-json;charset=utf-8");
if(bVo != null) {
jObj.addProperty("result", true);
jObj.addProperty("json", json);
} else {
jObj.addProperty("result", false);
}
res.getWriter().print(jObj);
return null;
}
/*@Override
public ActionForward execute(HttpServletRequest req, HttpServletResponse res) throws Exception {
URL url = new URL("http://www.aladin.co.kr/ttb/api/ItemList.aspx?ttbkey=ttbgsgod0906001&QueryType=Bestseller&MaxResults=10&start=1&SearchTarget=Book&&output=js&cover=midbig&Version=20131101");
HttpURLConnection connection = null;
String result = null;
try {
connection = (HttpURLConnection)url.openConnection();
connection.setRequestMethod("GET");
connection.connect();
int resCode = connection.getResponseCode();
if (resCode == HttpURLConnection.HTTP_OK) {
result = read(connection).replaceAll("\\\'", "\\u0027").replaceAll(";", "");
} else {
throw new IOException("ERROR : Communication Error\nMSG Code : " + resCode);
}
} catch (Exception e) {
e.printStackTrace();
} finally {
connection.disconnect();
}
BookVO bVo = new Gson().fromJson(result, BookVO.class);
JsonObject jObj = new JsonObject();
res.setContentType("application/x-json;charset=utf-8");
if(bVo != null) {
jObj.addProperty("result", true);
jObj.addProperty("json", result);
} else {
jObj.addProperty("result", false);
}
res.getWriter().print(jObj);
return null;
}
*/
/**
* 수신하는 부분
* @param p_con
* @throws IOException
*/
private String read(HttpURLConnection con) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(con.getInputStream()));
String strData = null;
StringBuffer sb = new StringBuffer();
while ((strData = br.readLine()) != null) {
sb.append(strData);
}
return new String(sb.toString().getBytes());
}
}
| [
"DELL@DESKTOP-RNVBF3L"
] | DELL@DESKTOP-RNVBF3L |
6859ec96b756fb7c675dd33354bc9a3428af8f80 | 507510c99254f3f75f3206c7292feffeaf129285 | /week3/Java Source File-20190927/ThreadPriorityDemo.java | e1f9042730cc7d6754e6bc3106236f8babaaf240 | [] | no_license | gulstein86/parallel_computing | 1805b7f9c2c4b9482931417c9056c47bbe962c4e | d77308e5b847a768e4ead7cb3bbbbba59f92a381 | refs/heads/master | 2020-07-29T11:50:03.732484 | 2019-10-14T12:31:51 | 2019-10-14T12:31:51 | 209,789,021 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,660 | 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 javaapplication1;
/**
*
* @author user
*/
class A extends Thread {
public void run() {
System.out.println("Thread A started");
for(int i = 1; i <= 4; i++) {
System.out.println("\t From ThreadA: i= " + i);
}
System.out.println("Exit from A");
}
}
class B extends Thread {
public void run() {
System.out.println("Thread B started");
for(int j = 1; j <= 4; j++) {
System.out.println("\t From ThreadB: j= " + j);
}
System.out.println("Exit from B");
}
}
class C extends Thread {
public void run() {
System.out.println("Thread C started");
for(int k = 1; k <= 4; k++) {
System.out.println("\t From ThreadC: k= " + k);
}
System.out.println("Exit from C");
}
}
public class ThreadPriorityDemo {
public static void main(String args[]) {
A threadA = new A();
B threadB = new B();
C threadC = new C();
threadC.setPriority(Thread.MAX_PRIORITY);
threadB.setPriority(threadA.getPriority() + 1);
threadA.setPriority(Thread.MIN_PRIORITY);
System.out.println("Started Thread A");
threadA.start();
System.out.println("Started Thread B");
threadB.start();
System.out.println("Started Thread C");
threadC.start();
System.out.println("End of main thread");
}
}
| [
"[email protected]"
] | |
9943c9f1f7ec8eef95cab3a3110355ba2aa0ce5a | 803acaf26dcb7a5030ad6a53b75c5b53b62c0e09 | /library/src/main/java/com/google/android/exoplayer2/source/MediaPeriod.java | 80424d445e99c564122f8df0d5d5ee075d4b92e1 | [
"Apache-2.0"
] | permissive | Ood-Tsen/ExoPlayer | fdf4a454c59f3ba0c6fc77ce7e1a9168043c08b8 | 43eea90d3c9102debfd8ae58fdf5d2f383235d2a | refs/heads/master | 2021-01-14T14:33:29.245223 | 2016-09-09T10:02:07 | 2016-09-09T10:02:07 | 35,490,811 | 2 | 5 | null | 2015-05-12T13:50:24 | 2015-05-12T13:50:23 | null | UTF-8 | Java | false | false | 5,082 | java | /*
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.android.exoplayer2.source;
import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.trackselection.TrackSelection;
import java.io.IOException;
/**
* A source of a single period of media.
*/
public interface MediaPeriod extends SequenceableLoader {
/**
* A callback to be notified of {@link MediaPeriod} events.
*/
interface Callback extends SequenceableLoader.Callback<MediaPeriod> {
/**
* Called when preparation completes.
* <p>
* May be called from any thread. After invoking this method, the {@link MediaPeriod} can expect
* for {@link #selectTracks(TrackSelection[], boolean[], SampleStream[], boolean[], long)} to be
* called with the initial track selection.
*
* @param mediaPeriod The prepared {@link MediaPeriod}.
*/
void onPrepared(MediaPeriod mediaPeriod);
}
/**
* Throws an error that's preventing the period from becoming prepared. Does nothing if no such
* error exists.
* <p>
* This method should only be called before the period has completed preparation.
*
* @throws IOException The underlying error.
*/
void maybeThrowPrepareError() throws IOException;
/**
* Returns the {@link TrackGroup}s exposed by the period.
* <p>
* This method should only be called after the period has been prepared.
*
* @return The {@link TrackGroup}s.
*/
TrackGroupArray getTrackGroups();
/**
* Performs a track selection.
* <p>
* The call receives track {@code selections} for each renderer, {@code mayRetainStreamFlags}
* indicating whether the existing {@code SampleStream} can be retained for each selection, and
* the existing {@code stream}s themselves. The call will update {@code streams} to reflect the
* provided selections, clearing, setting and replacing entries as required. If an existing sample
* stream is retained but with the requirement that the consuming renderer be reset, then the
* corresponding flag in {@code streamResetFlags} will be set to true. This flag will also be set
* if a new sample stream is created.
* <p>
* This method should only be called after the period has been prepared.
*
* @param selections The renderer track selections.
* @param mayRetainStreamFlags Flags indicating whether the existing sample stream can be retained
* for each selection. A {@code true} value indicates that the selection is unchanged, and
* that the caller does not require that the sample stream be recreated.
* @param streams The existing sample streams, which will be updated to reflect the provided
* selections.
* @param streamResetFlags Will be updated to indicate new sample streams, and sample streams that
* have been retained but with the requirement that the consuming renderer be reset.
* @param positionUs The current playback position in microseconds.
* @return The actual position at which the tracks were enabled, in microseconds.
*/
long selectTracks(TrackSelection[] selections, boolean[] mayRetainStreamFlags,
SampleStream[] streams, boolean[] streamResetFlags, long positionUs);
/**
* Attempts to read a discontinuity.
* <p>
* After this method has returned a value other than {@link C#TIME_UNSET}, all
* {@link SampleStream}s provided by the period are guaranteed to start from a key frame.
*
* @return If a discontinuity was read then the playback position in microseconds after the
* discontinuity. Else {@link C#TIME_UNSET}.
*/
long readDiscontinuity();
/**
* Returns an estimate of the position up to which data is buffered for the enabled tracks.
* <p>
* This method should only be called when at least one track is selected.
*
* @return An estimate of the absolute position in microseconds up to which data is buffered, or
* {@link C#TIME_END_OF_SOURCE} if the track is fully buffered.
*/
long getBufferedPositionUs();
/**
* Attempts to seek to the specified position in microseconds.
* <p>
* After this method has been called, all {@link SampleStream}s provided by the period are
* guaranteed to start from a key frame.
* <p>
* This method should only be called when at least one track is selected.
*
* @param positionUs The seek position in microseconds.
* @return The actual position to which the period was seeked, in microseconds.
*/
long seekToUs(long positionUs);
}
| [
"[email protected]"
] | |
bad203913c110e8491dde8d4b721eb8d23830045 | 2db38f2d3e374a1237b6d2dd36677a92e84710c8 | /Java/Modification.java | d234833c0db4dffe940512b84578a3b2188e63e8 | [] | no_license | bhavnavarshney/Algorithms-and-Data-Structures | 30ef04767f64ef3a7cb23585f4d5d084a22ab26a | d10e813cbaa8c06214eb4ac1d70c54c7323f9715 | refs/heads/master | 2021-08-09T01:22:07.245198 | 2021-06-30T17:28:48 | 2021-06-30T17:28:48 | 136,694,362 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 368 | java | class Modification{
public static void main(String s[]){
/*int a = 5;
modify(a);
System.out.println(a);
*/
Balloon b = new Balloon("red");
modify(b);
System.out.println(b.color);
}
public static void modify(Balloon c){
c.color="grey";
//c = new Balloon("grey");
}
}
class Balloon{
String color="blue";
Balloon(String y){
color=y;
}
} | [
"[email protected]"
] | |
625748b3f6c43bc71df59f7c9ecfc655188631e5 | 60c802362d16e10c433171fe5a19000f3dd5e0bb | /src/main/java/br/com/caelum/ingresso/model/descontos/DescontoEstudante.java | fdc0c63b8edf21418a717be960ea6f8e3c74d109 | [] | no_license | alessandraml/fj22-ingressos | e1c8b7ad351d3bbe832c253637b0abf4ee22320a | 375998bc915c12874bd37178c11f8462a6082993 | refs/heads/master | 2021-01-01T19:59:06.080873 | 2017-08-12T19:55:28 | 2017-08-12T19:55:28 | 98,739,077 | 0 | 0 | null | 2017-07-29T14:51:15 | 2017-07-29T14:51:15 | null | UTF-8 | Java | false | false | 369 | java | package br.com.caelum.ingresso.model.descontos;
import java.math.BigDecimal;
public class DescontoEstudante implements Desconto{
private BigDecimal metade = new BigDecimal("2.0");
public BigDecimal aplicarDescontoSobre (BigDecimal precoOriginal){
return precoOriginal.divide(metade);
}
@Override
public String getDescricao() {
return "Estudante";
}
}
| [
"[email protected]"
] | |
93209c32d5145e3a71243ad8e48ca5c4731b6160 | b7cb5a075a5d411090793b06d07236f1c1eee3d0 | /L_3_Collection/src/main/java/exampleOfTest/MyList.java | 15d3e54d69c80658f739f979641511f756ff5a28 | [] | no_license | Akumarou/Java-School-SBT-RnD | af429a7db799f759a081391b50912dd661b2ee94 | f7717dae098fc646229b7e12a02936edc7eaa12d | refs/heads/master | 2020-12-20T18:17:00.019931 | 2020-03-02T07:58:54 | 2020-03-02T07:58:54 | 236,167,369 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 51 | java | package exampleOfTest;
public class MyList<T>
{
} | [
"[email protected]"
] | |
b580be5392f72e3ed04dc211470157f0b843014b | bd6bca7e6418cb15caba46abffb0c283f4687cb6 | /app/src/main/java/com/example/csce490m3research/TipScreenActivity.java | 5ec141fb209bc89340b44bc0562970d80cccb3a8 | [] | no_license | SCCapstone/iTipper | 885cc6fff54979459060d98084a8420431a7df92 | befbe08b5bc508ae355519a668211ae92a5fdd8d | refs/heads/master | 2022-04-24T07:37:52.720750 | 2020-04-27T18:27:44 | 2020-04-27T18:27:44 | 205,369,815 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,746 | java | // coded by John Esco, iTipper
// Modified by @paolomilan
package com.example.csce490m3research;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
public class TipScreenActivity extends AppCompatActivity {
public static final String EXTRA_MESSAGE = "com.example.CSCE490M3Research.MESSAGE";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_tip_screen);
}
// redirects to google maps on button press
public void sendMessage(View view) {
// Do something in response to button
// create new intent object (Context, Class) this activity is subclass of context. Class is where system delivers Intent
//Intent intent = new Intent(this, DisplayMessageActivity.class);
Intent intent = new Intent(this, MapsActivity.class);
// this finds the plain text named editText
EditText editText = (EditText) findViewById(R.id.editText);
// retrieve text that was entered
String message = editText.getText().toString();
// put extra add the value of EditText to the intent. Intent can carry data types as key/val pairs called extras
intent.putExtra(EXTRA_MESSAGE,message);
startActivity(intent);
}
public void EnterTipScreenActivity(View view) {
Intent intent = new Intent(this, EnterTipScreenActivity.class);
EditText editText = (EditText) findViewById(R.id.editText);
String message = editText.getText().toString();
intent.putExtra(EXTRA_MESSAGE,message);
startActivity(intent);
}
}
| [
"[email protected]"
] | |
87928c077583c2ab2aa3ba5ad178e2198fe240a4 | 85645a5c78646759932752b4e72d0498b8171895 | /src/main/java/jagoclient/igs/InformationDistributor.java | ec396c00806e62a5b0dd311ae75e35b032d0e635 | [] | no_license | dantin/jago | e9e51cd4a9321b370079087d2e99266b00afcbc0 | 314be2d273d87ddb8d1db1c29f0f2317fe78e560 | refs/heads/master | 2021-01-10T12:45:39.499147 | 2016-03-18T06:31:08 | 2016-03-18T06:31:08 | 54,179,075 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,498 | java | package jagoclient.igs;
import jagoclient.Global;
import java.io.PrintWriter;
/**
* A Distributor to display informations from the server (type 9).
* It will open a new InformationDialog or append to an old one.
*/
public class InformationDistributor extends Distributor {
ConnectionFrame CF;
PrintWriter Out;
String S;
public InformationDialog infodialog;
int Lines;
public InformationDistributor
(ConnectionFrame cf, IgsStream in, PrintWriter out) {
super(in, 9, 0, false);
CF = cf;
Out = out;
S = new String("");
Lines = 0;
infodialog = null;
}
public void send(String C) {
if (Lines > 0) S = S + "\n" + C;
else S = S + C;
Lines++;
}
public void allsended() {
if (S.equals("")) return;
if (S.startsWith("Match") && S.indexOf("requested") > 0) {
new MatchDialog(CF, S, Out, this);
S = "";
Lines = 0;
return;
}
if (Global.blocks(S) != MessageFilter.BLOCK_COMPLETE)
CF.append(S);
if ((Global.blocks(S) == 0 && CF.wantsinformation())
|| Global.posfilter(S)) {
if (infodialog == null)
infodialog = new InformationDialog(CF, S + "\n", Out, this);
else
infodialog.append(S + "\n");
}
S = "";
Lines = 0;
}
public void remove() {
infodialog = null;
}
}
| [
"[email protected]"
] | |
10a22b9b2a33546dd4a0f28afbd60a1b94cc3f59 | ff52f7ccfa4418cc19d95dae13dc061ecfec9c91 | /FangdongWeb/app/controllers/gen/FundBackRecordController.java | 748c015e297f213ef405ed4901e49c10b3bf63a5 | [] | no_license | michael-luk/rent_financial_platform | 01b16427f86dc3ba2f10a364c717aae169ba0c29 | 22c4951dbe4ca0d12ecf3a16df4a2e435d734047 | refs/heads/master | 2021-05-16T21:46:24.528612 | 2020-03-28T10:42:25 | 2020-03-28T10:42:25 | 250,481,477 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 16,554 | java | package controllers.gen;
import controllers.*;
import controllers.biz.*;
import play.mvc.WebSocket;
import util.*;
import views.html.*;
import views.html.gen.*;
import LyLib.Interfaces.IConst;
import LyLib.Utils.DateUtil;
import LyLib.Utils.PageInfo;
import LyLib.Utils.StrUtil;
import LyLib.Utils.Msg;
import com.avaje.ebean.Ebean;
import com.avaje.ebean.Page;
import com.avaje.ebean.Query;
import com.avaje.ebean.Transaction;
import java.util.ArrayList;
import models.FundBackRecord;
import models.Host;
import models.Product;
import play.data.Form;
import play.libs.Json;
import play.mvc.Controller;
import play.mvc.Result;
import play.mvc.Security;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.util.List;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
import org.apache.poi.hssf.usermodel.HSSFFont;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.util.Region;
import java.io.File;
import java.io.FileOutputStream;
import play.Play;
import javax.persistence.PersistenceException;
import static controllers.Application.channels;
import static play.data.Form.form;
public class FundBackRecordController extends Controller implements IConst {
public static Result fundBackRecordPage(Integer status, Integer notStatus,
String fieldOn, String fieldValue, boolean isAnd,
String searchOn, String kw,
String startTime, String endTime,
String order, String sort,
Integer page, Integer size) {
Msg<List<FundBackRecord>> msg = BaseController.doGetAll("FundBackRecord",
status, notStatus,
fieldOn, fieldValue, isAnd,
searchOn, kw,
startTime, endTime,
order, sort,
page, size);
if (msg.flag) {
return ok(fund_back_record.render(msg.data));
} else {
msg.data = new ArrayList<>();
return ok(msg.message);
}
}
@Security.Authenticated(SecuredAdmin.class)
public static Result fundBackRecordBackendPage() {
return ok(fund_back_record_backend.render());
}
@Security.Authenticated(SecuredSuperAdmin.class)
@MethodName("新增_FundBackRecord")
@Role("create_fund_back_record")
public static Result add() {
Msg<FundBackRecord> msg = new Msg<>();
Form<FundBackRecordParser> httpForm = form(FundBackRecordParser.class).bindFromRequest();
if (!httpForm.hasErrors()) {
FundBackRecordParser formObj = httpForm.get();
FundBackRecord newObj = new FundBackRecord();
String uniqueFieldIssue = BaseController.checkFieldUnique("FundBackRecord", formObj);
if (StrUtil.isNotNull(uniqueFieldIssue)) {
msg.message = "字段[" + TableInfoReader.getFieldComment("FundBackRecord", uniqueFieldIssue)
+ "]存在同名数据";
return ok(Json.toJson(msg));
}
newObj.name = formObj.name;
newObj.amount = formObj.amount;
newObj.status = formObj.status;
newObj.comment = formObj.comment;
Host parentHost = Host.find.byId(formObj.refHostId);
newObj.host = parentHost;
newObj.refHostId = formObj.refHostId;
Product parentProduct = Product.find.byId(formObj.refProductId);
newObj.product = parentProduct;
newObj.refProductId = formObj.refProductId;
Transaction txn = Ebean.beginTransaction();
try{
SaveBiz.beforeSave(newObj);
Ebean.save(newObj);
txn.commit();
msg.flag = true;
msg.data = newObj;
play.Logger.info("result: " + CREATE_SUCCESS);
if (ConfigBiz.getBoolConfig("websocket"))
for (WebSocket.Out channel : channels) channel.write("new");
} catch (PersistenceException ex){
msg.message = CREATE_ISSUE + ", ex: " + ex.getMessage();
play.Logger.error(msg.message);
return ok(Json.toJson(msg));
} finally {
txn.end();
}
return ok(Json.toJson(msg));
} else {
if (httpForm.hasGlobalErrors())
msg.message = httpForm.globalError().message();
else {
if (httpForm.hasErrors())
msg.message = "输入数据不正确, 请重试";
}
play.Logger.error("result: " + msg.message);
}
return ok(Json.toJson(msg));
}
@Security.Authenticated(SecuredSuperAdmin.class)
@MethodName("修改_FundBackRecord")
@Role("update_fund_back_record")
public static Result update(long id) {
Msg<FundBackRecord> msg = new Msg<>();
FundBackRecord found = FundBackRecord.find.byId(id);
if (found == null) {
msg.message = NO_FOUND;
play.Logger.info("result: " + msg.message);
return ok(Json.toJson(msg));
}
Form<FundBackRecordParser> httpForm = form(FundBackRecordParser.class).bindFromRequest();
if (!httpForm.hasErrors()) {
FundBackRecordParser formObj = httpForm.get();
String uniqueFieldIssue = BaseController.checkFieldUnique("FundBackRecord", formObj, 1);
if (StrUtil.isNotNull(uniqueFieldIssue)) {
msg.message = "字段[" + TableInfoReader.getFieldComment("FundBackRecord", uniqueFieldIssue)
+ "]存在同名数据";
return ok(Json.toJson(msg));
}
Transaction txn = Ebean.beginTransaction();
try{
found = FundBackRecord.find.byId(id);
found.name = formObj.name;
found.amount = formObj.amount;
found.status = formObj.status;
found.comment = formObj.comment;
Host parentHost = Host.find.byId(formObj.refHostId);
found.refHostId = formObj.refHostId;
found.host = parentHost;
Product parentProduct = Product.find.byId(formObj.refProductId);
found.refProductId = formObj.refProductId;
found.product = parentProduct;
SaveBiz.beforeUpdate(found);
Ebean.update(found);
txn.commit();
msg.flag = true;
msg.data = found;
play.Logger.info("result: " + UPDATE_SUCCESS);
if (ConfigBiz.getBoolConfig("websocket"))
for (WebSocket.Out channel : channels) channel.write("update");
} catch (Exception ex){
msg.message = UPDATE_ISSUE + ", ex: " + ex.getMessage();
play.Logger.error(msg.message);
} finally {
txn.end();
}
return ok(Json.toJson(msg));
} else {
if (httpForm.hasGlobalErrors())
msg.message = httpForm.globalError().message();
else {
if (httpForm.hasErrors())
msg.message = "输入数据不正确, 请重试";
}
play.Logger.error("result: " + msg.message);
}
return ok(Json.toJson(msg));
}
public static class FundBackRecordParser {
public String name;
public long amount;
public int status;
public String comment;
public long refHostId;
public long refProductId;
public String validate() {
if (Host.find.byId(refHostId) == null) {
return "无法找到上级, 请重试.";
}
if (Product.find.byId(refProductId) == null) {
return "无法找到上级, 请重试.";
}
return null;
}
}
@Security.Authenticated(SecuredAdmin.class)
@MethodName("导出报表_FundBackRecord")
@Role("report_fund_back_record")
public static Result report(String startTime, String endTime) {
String fileName = TableInfoReader.getTableComment(FundBackRecord.class) + "报表_" + DateUtil.NowString("yyyy_MM_dd_HH_mm_ss") + ".xls";
// 创建工作薄对象
HSSFWorkbook workbook2007 = new HSSFWorkbook();
// 数据
Query<FundBackRecord> query = Ebean.find(FundBackRecord.class);
if (StrUtil.isNotNull(startTime) && StrUtil.isNotNull(endTime)){
query.where().between("createdAt", startTime, endTime);
}
query.orderBy("id desc");
List<FundBackRecord> list = query.findList();
if (list.size() == 0) {
if (StrUtil.isNotNull(startTime) && StrUtil.isNotNull(endTime)) {
return ok("日期: " + startTime + " 至 " + endTime + ", 报表" + NO_FOUND + ", 请返回重试!");
}
return ok(NO_FOUND);
}
// 创建单元格样式
HSSFCellStyle cellStyle = workbook2007.createCellStyle();
// 设置边框属性
cellStyle.setBorderLeft(HSSFCellStyle.BORDER_THIN);
cellStyle.setBorderBottom(HSSFCellStyle.BORDER_THIN);
cellStyle.setBorderRight(HSSFCellStyle.BORDER_THIN);
cellStyle.setBorderTop(HSSFCellStyle.BORDER_THIN);
// 指定单元格居中对齐
cellStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER);
// 指定单元格垂直居中对齐
cellStyle.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);
// 指定当单元格内容显示不下时自动换行
cellStyle.setWrapText(true);
// // 设置单元格字体
HSSFFont font = workbook2007.createFont();
font.setFontName("宋体");
// 大小
font.setFontHeightInPoints((short) 10);
// 加粗
font.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
cellStyle.setFont(font);
HSSFCellStyle style = workbook2007.createCellStyle();
// 指定单元格居中对齐
style.setAlignment(HSSFCellStyle.ALIGN_CENTER);
// 指定单元格垂直居中对齐
style.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);
HSSFFont font1 = workbook2007.createFont();
font1.setFontName("宋体");
font1.setFontHeightInPoints((short) 10);
// 加粗
font1.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
style.setFont(font1);
// 创建工作表对象,并命名
HSSFSheet sheet2 = workbook2007.createSheet(TableInfoReader.getTableComment(FundBackRecord.class) + "报表");
// 设置列
sheet2.setColumnWidth(0, 4000);
sheet2.setDefaultColumnStyle(0, cellStyle);//name
sheet2.setColumnWidth(1, 4000);
sheet2.setDefaultColumnStyle(1, cellStyle);//amount
sheet2.setColumnWidth(2, 4000);
sheet2.setDefaultColumnStyle(2, cellStyle);//status
sheet2.setColumnWidth(3, 4000);
sheet2.setDefaultColumnStyle(3, cellStyle);//created_at
sheet2.setColumnWidth(4, 4000);
sheet2.setDefaultColumnStyle(4, cellStyle);//last_update_time
sheet2.setColumnWidth(5, 4000);
sheet2.setDefaultColumnStyle(5, cellStyle);//comment
sheet2.setColumnWidth(6, 4000);
sheet2.setDefaultColumnStyle(6, cellStyle);//host_id
sheet2.setColumnWidth(7, 4000);
sheet2.setDefaultColumnStyle(7, cellStyle);//product_id
// 创建表头
HSSFRow title = sheet2.createRow(0);
title.setHeightInPoints(50);
title.createCell(0).setCellValue(TableInfoReader.getTableComment(FundBackRecord.class) + "报表");
title.createCell(1).setCellValue("");
title.createCell(2).setCellValue("");
title.createCell(3).setCellValue("");
title.createCell(4).setCellValue("");
title.createCell(5).setCellValue("");
title.createCell(6).setCellValue("");
title.createCell(7).setCellValue("");
sheet2.addMergedRegion(new Region(0, (short) 0, 0, (short) 7));
HSSFCell ce = title.createCell((short) 1);
HSSFRow titleRow = sheet2.createRow(1);
// 设置行高
titleRow.setHeightInPoints(30);
titleRow.createCell(0).setCellValue(TableInfoReader.getFieldComment(FundBackRecord.class, "name"));//name
titleRow.createCell(1).setCellValue(TableInfoReader.getFieldComment(FundBackRecord.class, "amount"));//amount
titleRow.createCell(2).setCellValue(TableInfoReader.getFieldComment(FundBackRecord.class, "status"));//status
titleRow.createCell(3).setCellValue(TableInfoReader.getFieldComment(FundBackRecord.class, "createdAt"));//created_at
titleRow.createCell(4).setCellValue(TableInfoReader.getFieldComment(FundBackRecord.class, "lastUpdateTime"));//last_update_time
titleRow.createCell(5).setCellValue(TableInfoReader.getFieldComment(FundBackRecord.class, "comment"));//comment
titleRow.createCell(6).setCellValue(TableInfoReader.getFieldComment(FundBackRecord.class, "host"));//host_id
titleRow.createCell(7).setCellValue(TableInfoReader.getFieldComment(FundBackRecord.class, "product"));//product_id
HSSFCell ce2 = title.createCell((short) 2);
ce2.setCellStyle(cellStyle); // 样式,居中
// 遍历集合对象创建行和单元格
for (int i = 0; i < list.size(); i++) {
// 取出对象
FundBackRecord item = list.get(i);
// 创建行
HSSFRow row = sheet2.createRow(i + 2);
// 创建单元格并赋值
HSSFCell cell0 = row.createCell(0);
if (item.name == null) {
cell0.setCellValue("");
} else {
cell0.setCellValue(item.name);
}
HSSFCell cell1 = row.createCell(1);
cell1.setCellValue(item.amount);
HSSFCell cell2 = row.createCell(2);
cell2.setCellValue(EnumInfoReader.getEnumName(FundBackRecord.class, "status", item.status));
HSSFCell cell3 = row.createCell(3);
cell3.setCellValue(DateUtil.Date2Str(item.createdAt));
HSSFCell cell4 = row.createCell(4);
cell4.setCellValue(DateUtil.Date2Str(item.lastUpdateTime));
HSSFCell cell5 = row.createCell(5);
if (item.comment == null) {
cell5.setCellValue("");
} else {
cell5.setCellValue(item.comment);
}
HSSFCell cell6 = row.createCell(6);
if (item.host == null) {
cell6.setCellValue("");
} else {
cell6.setCellValue(item.host.name);
}
HSSFCell cell7 = row.createCell(7);
if (item.product == null) {
cell7.setCellValue("");
} else {
cell7.setCellValue(item.product.name);
}
}
// 生成文件
String path = Play.application().path().getPath() + "/public/report/" + fileName;
File file = new File(path);
// 处理中文报表名
String agent = request().getHeader("USER-AGENT");
String downLoadName = null;
try {
if (null != agent && -1 != agent.indexOf("MSIE")) //IE
{
downLoadName = java.net.URLEncoder.encode(fileName, "UTF-8");
} else if (null != agent && -1 != agent.indexOf("Mozilla")) //Firefox
{
downLoadName = new String(fileName.getBytes("UTF-8"), "iso-8859-1");
} else {
downLoadName = java.net.URLEncoder.encode(fileName, "UTF-8");
}
} catch (UnsupportedEncodingException ex) {
play.Logger.error("导出报表处理中文报表名出错: " + ex.getMessage());
}
if (downLoadName != null) {
response().setHeader("Content-disposition", "attachment;filename="
+ downLoadName);
response().setContentType("application/vnd.ms-excel;charset=UTF-8");
}
FileOutputStream fos = null;
try {
fos = new FileOutputStream(file);
workbook2007.write(fos);
} catch (Exception e) {
play.Logger.error("生成报表出错: " + e.getMessage());
} finally {
if (fos != null) {
try {
fos.close();
} catch (Exception e) {
play.Logger.error("生成报表出错, 关闭流出错: " + e.getMessage());
}
}
}
return ok(file);
}
}
| [
"[email protected]"
] | |
f393c3b136c28ca6e45ed8d7862680487407b3eb | 71b9c6a47ac81b8414097e4cb61c384f337c597b | /ProjectApp/app/src/androidTest/java/com/example/alesdias/projectapp/ApplicationTest.java | c100e83a779ec42f1d49e91787f5db860113b9c1 | [] | no_license | alessandracdias/WorkLogger | 7677f8f90a02f5f31d9d5048c79372f4b2e7cb06 | a10623a3af32a39af147b09b49441fbeb637988f | refs/heads/master | 2021-01-20T17:19:46.398581 | 2016-07-25T01:33:08 | 2016-07-25T01:33:08 | 64,094,486 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 362 | java | package com.example.alesdias.projectapp;
import android.app.Application;
import android.test.ApplicationTestCase;
/**
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
*/
public class ApplicationTest extends ApplicationTestCase<Application> {
public ApplicationTest() {
super(Application.class);
}
} | [
"[email protected]"
] | |
bbef2fa912b7c62e911812376d495badc9bfcbee | 4a0f8e5f92d34bfb5bff0a3d59a6e70e9bbc78e0 | /src/CommonNumbers.java | 2bde2c638d7149237dda607da27d04258772a6e2 | [] | no_license | nilooy5/twoArrayCommons | eec4c34823cf9e80aa3b01e9802dafd81fa39d85 | 7de6d67cae9475011697fd58f896fd3ef38ca7c2 | refs/heads/master | 2022-12-17T21:34:30.986618 | 2020-08-29T23:57:45 | 2020-08-29T23:57:45 | 291,285,908 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 763 | java | import java.util.*;
public class CommonNumbers {
public static void main(String[] args) {
System.out.println("Common Distinctive Numbers by Munira Tabassum");
int[] numArray1 = {6, 34, 5, 1, 9, 1};
int[] numArray2 = {6, 1, 8, 34, 5};
HashSet<String> unique = new HashSet<>();
// int count = 0;
for (int j : numArray1) {
for (int k : numArray2) {
if (j == k) {
// System.out.println(j);
unique.add(Integer.toString(k));
// count++;
break;
}
}
}
// System.out.println(count);
System.out.println("total unique common integers: " + unique.size());
}
}
| [
"[email protected]"
] | |
279d456e43a75e808556f81d396469a487e8c1ae | 6a516b3939751b7c4ee1859280569151124dd2c2 | /src/com/javarush/test/level18/lesson10/bonus01/Solution.java | 67b279ee9187ce9564f63fd9b20d993e7cee2901 | [] | no_license | SirMatters/JavaRush-Solutions | 690d34b0680ca2f2b220ce3fce666937cb59050d | fe3592308428baac735fb3c443356b54e38a4f8d | refs/heads/master | 2020-12-24T11:45:45.233258 | 2018-04-14T18:50:25 | 2018-04-14T18:50:25 | 73,015,759 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,771 | java | package com.javarush.test.level18.lesson10.bonus01;
/* Шифровка
Придумать механизм шифровки/дешифровки
Программа запускается с одним из следующих наборов параметров:
-e fileName fileOutputName
-d fileName fileOutputName
где
fileName - имя файла, который необходимо зашифровать/расшифровать
fileOutputName - имя файла, куда необходимо записать результат шифрования/дешифрования
-e - ключ указывает, что необходимо зашифровать данные
-d - ключ указывает, что необходимо расшифровать данные
*/
import java.io.*;
public class Solution {
public static void main(String[] args) throws IOException {
BufferedReader r = new BufferedReader(new InputStreamReader(System.in));
String s = args[0];
FileInputStream in = new FileInputStream(args[1]);
FileOutputStream out = new FileOutputStream(args[2]);
if (s.equals("-e")){
while (in.available()>0) {
byte b = (byte) in.read();
if (b == Byte.MAX_VALUE) {
out.write(Byte.MIN_VALUE);
} else {
out.write(b + 1);
}
}
} else {
while (in.available() > 0) {
byte b = (byte) in.read();
if (b == Byte.MIN_VALUE) {
out.write(Byte.MAX_VALUE);
} else {
out.write(b - 1);
}
}
}
in.close();
out.close();
}
}
| [
"[email protected]"
] | |
b4dcf9bb91b33202090cc0156dc75a8adf44c440 | f963e80864749db5f14887b3c2e33151f90b82ba | /app/src/main/java/com/example/linxuan/myzxing/zxing/camera/CameraConfigurationManager.java | 9f79549adf8c34b3d53019f624103c59808e7170 | [] | no_license | linhaoyou/MyZXing | 3833930437e37e14b9bd0ec37c6ed3c451aea7fe | cf85976d94255153faff7a9cb7427c36c361f06e | refs/heads/master | 2021-05-07T08:39:15.019651 | 2017-11-03T10:16:50 | 2017-11-03T10:16:50 | 109,381,956 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,529 | java | /*
* Copyright (C) 2010 ZXing authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.example.linxuan.myzxing.zxing.camera;
import android.content.Context;
import android.content.SharedPreferences;
import android.graphics.Point;
import android.hardware.Camera;
import android.preference.PreferenceManager;
import android.util.Log;
import android.view.Display;
import android.view.WindowManager;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
/**
* A class which deals with reading, parsing, and setting the camera parameters
* which are used to configure the camera hardware.
*/
final class CameraConfigurationManager {
private static final String TAG = "CameraConfiguration";
// This is bigger than the size of a small screen, which is still supported.
// The routine
// below will still select the default (presumably 320x240) size for these.
// This prevents
// accidental selection of very low resolution on some devices.
private static final int MIN_PREVIEW_PIXELS = 470 * 320; // normal screen
private static final int MAX_PREVIEW_PIXELS = 1280 * 800;
private final Context context;
private Point screenResolution;
private Point cameraResolution;
CameraConfigurationManager(Context context) {
this.context = context;
}
/**
* Reads, one time, values from the camera that are needed by the app.
*/
@SuppressWarnings("deprecation")
void initFromCameraParameters(Camera camera) {
Camera.Parameters parameters = camera.getParameters();
WindowManager manager = (WindowManager) context
.getSystemService(Context.WINDOW_SERVICE);
Display display = manager.getDefaultDisplay();
int width = display.getWidth();
int height = display.getHeight();
// We're landscape-only, and have apparently seen issues with display
// thinking it's portrait
// when waking from sleep. If it's not landscape, assume it's mistaken
// and reverse them:
/* 竖屏修改 */
// if (width < height) {
// Log.i(TAG,
// "Display reports portrait orientation; assuming this is incorrect");
// int temp = width;
// width = height;
// height = temp;
// }
screenResolution = new Point(width, height);
Log.i(TAG, "Screen resolution: " + screenResolution);
/* 竖屏修改 ,图形拉伸处理*/
Point screenResolutionForCamera = new Point();
screenResolutionForCamera.x = screenResolution.x;
screenResolutionForCamera.y = screenResolution.y;
if (screenResolution.x < screenResolution.y) {
screenResolutionForCamera.x = screenResolution.y;
screenResolutionForCamera.y = screenResolution.x;
}
cameraResolution = findBestPreviewSizeValue(parameters,
screenResolutionForCamera);
Log.i(TAG, "Camera resolution: " + cameraResolution);
}
void setDesiredCameraParameters(Camera camera, boolean safeMode) {
Camera.Parameters parameters = camera.getParameters();
if (parameters == null) {
Log.w(TAG,
"Device error: no camera parameters are available. Proceeding without configuration.");
return;
}
Log.i(TAG, "Initial camera parameters: " + parameters.flatten());
if (safeMode) {
Log.w(TAG,
"In camera config safe mode -- most settings will not be honored");
}
SharedPreferences prefs = PreferenceManager
.getDefaultSharedPreferences(context);
initializeTorch(parameters, prefs, safeMode);
String focusMode = null;
/* 配置修改 */
focusMode = findSettableValue(parameters.getSupportedFocusModes(),
Camera.Parameters.FOCUS_MODE_AUTO);
// if (prefs.getBoolean(PreferencesActivity.KEY_AUTO_FOCUS, true)) {
// if (safeMode ||
// prefs.getBoolean(PreferencesActivity.KEY_DISABLE_CONTINUOUS_FOCUS,
// false)) {
// focusMode = findSettableValue(parameters.getSupportedFocusModes(),
// Camera.Parameters.FOCUS_MODE_AUTO);
// } else {
// focusMode = findSettableValue(parameters.getSupportedFocusModes(),
// "continuous-picture", //
// Camera.Parameters.FOCUS_MODE_CONTINUOUS_PICTURE in 4.0+
// "continuous-video", // Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO
// in 4.0+
// Camera.Parameters.FOCUS_MODE_AUTO);
// }
// }
// Maybe selected auto-focus but not available, so fall through here:
if (!safeMode && focusMode == null) {
focusMode = findSettableValue(parameters.getSupportedFocusModes(),
Camera.Parameters.FOCUS_MODE_MACRO, "edof"); // Camera.Parameters.FOCUS_MODE_EDOF
// in 2.2+
}
if (focusMode != null) {
parameters.setFocusMode(focusMode);
}
/* 配置修改 */
// 反向扫描
// if (prefs.getBoolean(PreferencesActivity.KEY_INVERT_SCAN, false)) {
// String colorMode =
// findSettableValue(parameters.getSupportedColorEffects(),
// Camera.Parameters.EFFECT_NEGATIVE);
// if (colorMode != null) {
// parameters.setColorEffect(colorMode);
// }
// }
parameters.setPreviewSize(cameraResolution.x, cameraResolution.y);
/* 竖屏修改 */
camera.setDisplayOrientation(90);
camera.setParameters(parameters);
}
Point getCameraResolution() {
return cameraResolution;
}
Point getScreenResolution() {
return screenResolution;
}
boolean getTorchState(Camera camera) {
if (camera != null) {
Camera.Parameters parameters = camera.getParameters();
if (parameters != null) {
String flashMode = camera.getParameters().getFlashMode();
return flashMode != null
&& (Camera.Parameters.FLASH_MODE_ON.equals(flashMode) || Camera.Parameters.FLASH_MODE_TORCH
.equals(flashMode));
}
}
return false;
}
void setTorch(Camera camera, boolean newSetting) {
Camera.Parameters parameters = camera.getParameters();
doSetTorch(parameters, newSetting, false);
camera.setParameters(parameters);
}
private void initializeTorch(Camera.Parameters parameters,
SharedPreferences prefs, boolean safeMode) {
boolean currentSetting = FrontLightMode.readPref(prefs) == FrontLightMode.ON;
doSetTorch(parameters, currentSetting, safeMode);
}
private void doSetTorch(Camera.Parameters parameters, boolean newSetting,
boolean safeMode) {
String flashMode;
if (newSetting) {
flashMode = findSettableValue(parameters.getSupportedFlashModes(),
Camera.Parameters.FLASH_MODE_TORCH,
Camera.Parameters.FLASH_MODE_ON);
} else {
flashMode = findSettableValue(parameters.getSupportedFlashModes(),
Camera.Parameters.FLASH_MODE_OFF);
}
if (flashMode != null) {
parameters.setFlashMode(flashMode);
}
/*
* SharedPreferences prefs =
* PreferenceManager.getDefaultSharedPreferences(context); if
* (!prefs.getBoolean(PreferencesActivity.KEY_DISABLE_EXPOSURE, false))
* { if (!safeMode) { ExposureInterface exposure = new
* ExposureManager().build(); exposure.setExposure(parameters,
* newSetting); } }
*/
}
private Point findBestPreviewSizeValue(Camera.Parameters parameters,
Point screenResolution) {
List<Camera.Size> rawSupportedSizes = parameters
.getSupportedPreviewSizes();
if (rawSupportedSizes == null) {
Log.w(TAG,
"Device returned no supported preview sizes; using default");
Camera.Size defaultSize = parameters.getPreviewSize();
return new Point(defaultSize.width, defaultSize.height);
}
// Sort by size, descending
List<Camera.Size> supportedPreviewSizes = new ArrayList<Camera.Size>(
rawSupportedSizes);
Collections.sort(supportedPreviewSizes, new Comparator<Camera.Size>() {
@Override
public int compare(Camera.Size a, Camera.Size b) {
int aPixels = a.height * a.width;
int bPixels = b.height * b.width;
if (bPixels < aPixels) {
return -1;
}
if (bPixels > aPixels) {
return 1;
}
return 0;
}
});
if (Log.isLoggable(TAG, Log.INFO)) {
StringBuilder previewSizesString = new StringBuilder();
for (Camera.Size supportedPreviewSize : supportedPreviewSizes) {
previewSizesString.append(supportedPreviewSize.width)
.append('x').append(supportedPreviewSize.height)
.append(' ');
}
Log.i(TAG, "Supported preview sizes: " + previewSizesString);
}
Point bestSize = null;
float screenAspectRatio = (float) screenResolution.x
/ (float) screenResolution.y;
float diff = Float.POSITIVE_INFINITY;
for (Camera.Size supportedPreviewSize : supportedPreviewSizes) {
int realWidth = supportedPreviewSize.width;
int realHeight = supportedPreviewSize.height;
int pixels = realWidth * realHeight;
if (pixels < MIN_PREVIEW_PIXELS || pixels > MAX_PREVIEW_PIXELS) {
continue;
}
boolean isCandidatePortrait = realWidth < realHeight;
int maybeFlippedWidth = isCandidatePortrait ? realHeight
: realWidth;
int maybeFlippedHeight = isCandidatePortrait ? realWidth
: realHeight;
if (maybeFlippedWidth == screenResolution.x
&& maybeFlippedHeight == screenResolution.y) {
Point exactPoint = new Point(realWidth, realHeight);
Log.i(TAG, "Found preview size exactly matching screen size: "
+ exactPoint);
return exactPoint;
}
float aspectRatio = (float) maybeFlippedWidth
/ (float) maybeFlippedHeight;
float newDiff = Math.abs(aspectRatio - screenAspectRatio);
if (newDiff < diff) {
bestSize = new Point(realWidth, realHeight);
diff = newDiff;
}
}
if (bestSize == null) {
Camera.Size defaultSize = parameters.getPreviewSize();
bestSize = new Point(defaultSize.width, defaultSize.height);
Log.i(TAG, "No suitable preview sizes, using default: " + bestSize);
}
Log.i(TAG, "Found best approximate preview size: " + bestSize);
return bestSize;
}
private static String findSettableValue(Collection<String> supportedValues,
String... desiredValues) {
Log.i(TAG, "Supported values: " + supportedValues);
String result = null;
if (supportedValues != null) {
for (String desiredValue : desiredValues) {
if (supportedValues.contains(desiredValue)) {
result = desiredValue;
break;
}
}
}
Log.i(TAG, "Settable value: " + result);
return result;
}
}
| [
"[email protected]"
] | |
beefc3b75f3f1112a22ff1bfc82e8742512311cf | cc93c941900a2fae24f727d8b2731e0472879e86 | /src/main/java/ui/template/ViewFactory.java | 3d9afd10e7aaeb8c230968df4bd72129b9261479 | [] | no_license | Erwerner/CoronaStats | f16c26c51ea04414eb46f2893602a60c7f46843a | fed553af1a5c8a568013964e146d5e0a780fd2fb | refs/heads/master | 2023-04-07T05:55:53.426158 | 2021-04-25T08:49:35 | 2021-04-25T08:49:35 | 265,845,675 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 109 | java | package ui.template;
public abstract class ViewFactory {
public abstract void makeViews(Model model);
}
| [
"[email protected]"
] | |
7a642b35b0f68ac7feed473ec257f387b1b0f4b5 | 4da6973cfeee839d4ee25c9c4e2719589ac7fca6 | /src/test/java/com/fruitsalesplatform/test/dao/TestDao.java | 36cb46ca7052fb0d0f72445f8ac384fce654456a | [] | no_license | css12345/Fruit-Sales-Platform | 9f7f903cc06657c94c5f85f7cc47fe376fa69a76 | 6beeb595a5088f69365ce08cb01f384c1f202471 | refs/heads/master | 2020-04-10T11:58:44.769962 | 2019-02-25T10:02:26 | 2019-02-25T10:02:26 | 161,008,171 | 5 | 1 | null | null | null | null | UTF-8 | Java | false | false | 190 | java | package com.fruitsalesplatform.test.dao;
import java.util.List;
import com.fruitsalesplatform.test.entity.User;
public interface TestDao {
public List<User> findUserByName(User user);
}
| [
"[email protected]"
] | |
6e9d285e6437caba2384344901bf8bcd134ebbb1 | a3321ebb1a2311367f763ea2395e9817083c43fe | /src/main/java/com/graduate/project/entity/User.java | 7a52b8c753ee50a819d3486f55df4935bad6b00a | [] | no_license | Jiayidong1996/graduate-project | c24642cd5c4638fb4f9eb2c1f1359d837b803410 | 2e1ad65d3781ed2c9adaefccfc9d1fb5b0c4e6a7 | refs/heads/master | 2020-03-15T16:19:36.489640 | 2018-05-25T08:51:42 | 2018-05-25T08:51:42 | 132,232,449 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 796 | java | package com.graduate.project.entity;
import java.sql.Date;
public class User {
private int id;
private String username;
private Date birthday;
public Date getBirthday() {
return birthday;
}
public void setBirthday(Date birthday) {
this.birthday = birthday;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
@Override
public String toString() {
return "User{" +
"id=" + id +
", username='" + username + '\'' +
", birthday=" + birthday +
'}';
}
}
| [
"[email protected]"
] | |
489269f6b24865ed8c941cc1fbcd7383d946c5d2 | b3c5cee7b3d3abac4c54e5b12e55530e81b95878 | /src/dev/ranieri/services/EmployeeService.java | 0ba896f1e8011847a824c54d7a1cf04c7be1bf3e | [] | no_license | adamranieri/EmployeeHourApp | 1ddeb1b01017d15f31542417b3aa73bb1e6b73a3 | 4096e86235f8ed2cc62ee79405510f84a5eb09b2 | refs/heads/master | 2022-12-31T16:49:36.015325 | 2020-10-19T18:39:28 | 2020-10-19T18:39:28 | 305,479,851 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 319 | java | package dev.ranieri.services;
import dev.ranieri.entities.Employee;
public interface EmployeeService {
public Employee enrollEmployee(String username);
public Employee login(String username);
public boolean addHoursWorked(Employee emp, double hours);
public boolean takePto(Employee emp, double hours);
}
| [
"[email protected]"
] | |
1b7889e37c0e79614c196c174d1c18047cfe5cd8 | f36276da2801f8859691525cbada7b8f792343bf | /src/com/yuol/smile/utils/FileUtils.java | 107a67e384b9ae5055c7beb040c5bf60d1dd58e2 | [] | no_license | RayWuBlue/CompusAnywhere-Eclipse | fb2443543e9e8b66973755e350e7c04bf75045ee | 6047c1496566c2418878087160610cc6140f0aa5 | refs/heads/master | 2021-01-01T05:27:18.000867 | 2016-05-21T05:25:01 | 2016-05-21T05:25:01 | 59,343,330 | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 4,140 | java | package com.yuol.smile.utils;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Random;
import android.os.Environment;
import android.util.Log;
public class FileUtils {
private String SDPATH;
private int FILESIZE = 4 * 1024;
public String getSDPATH(){
return SDPATH;
}
public FileUtils(){
//得到当前外部存储设备的目录( /SDCARD )
SDPATH = Environment.getExternalStorageDirectory() + "/";
}
/**
* 在SD卡上创建文件
* @param fileName
* @return
* @throws IOException
*/
public File createSDFile(String fileName) throws IOException{
File file = new File(SDPATH + fileName);
file.createNewFile();
return file;
}
/**
* 在SD卡上创建目录
* @param dirName
* @return
*/
public File createSDDir(String dirName){
File dir = new File(SDPATH + dirName);
dir.mkdir();
return dir;
}
/**
* 创建路径
* @param dirPath
* @return
*/
public static File createPath(String dirPath){
File dir = new File(dirPath);
if(!dir.exists()){
dir.mkdir();
}
return dir;
}
/**
* 判断SD卡上的文件夹是否存在
* @param fileName
* @return
*/
public boolean isFileExist(String fileName){
File file = new File(SDPATH + fileName);
return file.exists();
}
/**
* 将一个InputStream里面的数据写入到SD卡中
* @param path
* @param fileName
* @param input
* @return
*/
public File write2SDFromInput(String path,String fileName,InputStream input){
File file = null;
OutputStream output = null;
try {
createSDDir(path);
file = createSDFile(path + fileName);
output = new FileOutputStream(file);
byte[] buffer = new byte[FILESIZE];
while((input.read(buffer)) != -1){
output.write(buffer);
}
output.flush();
}
catch (Exception e) {
e.printStackTrace();
}
finally{
try {
output.close();
} catch (IOException e) {
e.printStackTrace();
}
}
return file;
}
public static String readInStream(FileInputStream inStream){
try {
ByteArrayOutputStream outStream = new ByteArrayOutputStream();
byte[] buffer = new byte[1024];
int length = -1;
while((length = inStream.read(buffer)) != -1 ){
outStream.write(buffer, 0, length); //每次读取到的数据往内存写入
}
outStream.close();
inStream.close();
return outStream.toString();
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
//随机生成图片文件名
public static String createImgFileName(){
Random rd=new Random();
int n=rd.nextInt(1000);
String temp= System.currentTimeMillis()+n+"";
return new Sha1Util().getDigestOfString(temp.getBytes())+".jpg";
}
}
| [
"[email protected]"
] | |
031406bf1c966a28f6be313df105a47c355e0daa | 53f1039f885e66fa89c90d059a8f52174b32578d | /artCode/aco15/src/test/java/garbage/contactListApp/InputString.java | 9359efe57e5d24c1c73dfe3d5f388d1208f32543 | [] | no_license | radchenkoVit/artCode | f258d7ec652330e7944866fd18e1376cf3487b70 | 2c6bfa40a87f54af723ea55d073721ba362bc93a | refs/heads/master | 2021-01-12T11:01:12.420703 | 2017-01-22T08:13:33 | 2017-01-22T08:13:33 | 72,791,726 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 624 | java | package garbage.contactListApp;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class InputString {
public static BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
private InputString(){}
/*
* Input action made, by user
* Enter String
* */
public static String enterString() throws IOException {
return reader.readLine();
}
/*
* Input action made, by user
* Enter int
* */
public static int enterInt() throws IOException {
return Integer.parseInt(enterString());
}
}
| [
"[email protected]"
] | |
f59c1d66f8af68b7b8385622d8409f47763fb57d | ead75c14cb1fbeea9881e103c0d833cf7bca69a5 | /NumberPalindrome.java | 4db9752d3d2fedd3a3ecc22de00d7a952d952847 | [] | no_license | NitishMhaske/Java-Programs | 0029f5184adc3794ce82db0e4aac490b4cbeaa80 | 06e8cb992615ed954a84863c78b78a68701d2b5b | refs/heads/master | 2021-11-21T20:20:13.795401 | 2021-09-24T11:09:40 | 2021-09-24T11:09:40 | 207,081,366 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 482 | java | public class NumberPalindrome {
public static boolean isPalindrome(int number){
int reversedInteger = 0, remainder, originalInteger;
originalInteger = number;
while( number != 0 )
{
remainder = number % 10;
reversedInteger = reversedInteger * 10 + remainder;
number /= 10;
}
if (originalInteger == reversedInteger)
return true;
else
return false;
}
}
| [
"[email protected]"
] | |
aed25a30cca8ebf42ecff504790f9696ceb32429 | 74b47b895b2f739612371f871c7f940502e7165b | /aws-java-sdk-ivs/src/main/java/com/amazonaws/services/ivs/model/transform/RecordingConfigurationMarshaller.java | 5aaff4f190ef08ab27720a3026adeebfbf35c133 | [
"Apache-2.0"
] | permissive | baganda07/aws-sdk-java | fe1958ed679cd95b4c48f971393bf03eb5512799 | f19bdb30177106b5d6394223a40a382b87adf742 | refs/heads/master | 2022-11-09T21:55:43.857201 | 2022-10-24T21:08:19 | 2022-10-24T21:08:19 | 221,028,223 | 0 | 0 | Apache-2.0 | 2019-11-11T16:57:12 | 2019-11-11T16:57:11 | null | UTF-8 | Java | false | false | 4,064 | java | /*
* Copyright 2017-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.ivs.model.transform;
import java.util.Map;
import javax.annotation.Generated;
import com.amazonaws.SdkClientException;
import com.amazonaws.services.ivs.model.*;
import com.amazonaws.protocol.*;
import com.amazonaws.annotation.SdkInternalApi;
/**
* RecordingConfigurationMarshaller
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
@SdkInternalApi
public class RecordingConfigurationMarshaller {
private static final MarshallingInfo<String> ARN_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
.marshallLocationName("arn").build();
private static final MarshallingInfo<StructuredPojo> DESTINATIONCONFIGURATION_BINDING = MarshallingInfo.builder(MarshallingType.STRUCTURED)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("destinationConfiguration").build();
private static final MarshallingInfo<String> NAME_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
.marshallLocationName("name").build();
private static final MarshallingInfo<Integer> RECORDINGRECONNECTWINDOWSECONDS_BINDING = MarshallingInfo.builder(MarshallingType.INTEGER)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("recordingReconnectWindowSeconds").build();
private static final MarshallingInfo<String> STATE_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
.marshallLocationName("state").build();
private static final MarshallingInfo<Map> TAGS_BINDING = MarshallingInfo.builder(MarshallingType.MAP).marshallLocation(MarshallLocation.PAYLOAD)
.marshallLocationName("tags").build();
private static final MarshallingInfo<StructuredPojo> THUMBNAILCONFIGURATION_BINDING = MarshallingInfo.builder(MarshallingType.STRUCTURED)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("thumbnailConfiguration").build();
private static final RecordingConfigurationMarshaller instance = new RecordingConfigurationMarshaller();
public static RecordingConfigurationMarshaller getInstance() {
return instance;
}
/**
* Marshall the given parameter object.
*/
public void marshall(RecordingConfiguration recordingConfiguration, ProtocolMarshaller protocolMarshaller) {
if (recordingConfiguration == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(recordingConfiguration.getArn(), ARN_BINDING);
protocolMarshaller.marshall(recordingConfiguration.getDestinationConfiguration(), DESTINATIONCONFIGURATION_BINDING);
protocolMarshaller.marshall(recordingConfiguration.getName(), NAME_BINDING);
protocolMarshaller.marshall(recordingConfiguration.getRecordingReconnectWindowSeconds(), RECORDINGRECONNECTWINDOWSECONDS_BINDING);
protocolMarshaller.marshall(recordingConfiguration.getState(), STATE_BINDING);
protocolMarshaller.marshall(recordingConfiguration.getTags(), TAGS_BINDING);
protocolMarshaller.marshall(recordingConfiguration.getThumbnailConfiguration(), THUMBNAILCONFIGURATION_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
}
}
| [
""
] | |
4cb76f703cdf695a6b5c979dff32b73031962f71 | fa3e354f03167f9417eccd4522e1dae5ba75e3b6 | /src/main/java/com/fsd/sba/entity/CompanyEntity.java | c188c529dcf89bcc05b3671cc2e11482a169a288 | [] | no_license | Amy-zhy/SBA-IPO | f0564d60bfa40542974c7e32bda6fc9c75043411 | fec3ba2b32f8a270b810d57eb3672157b47c6182 | refs/heads/master | 2022-06-25T15:38:51.780882 | 2019-12-14T14:11:00 | 2019-12-14T14:11:00 | 227,537,247 | 0 | 0 | null | 2022-06-17T02:45:59 | 2019-12-12T06:35:07 | Java | UTF-8 | Java | false | false | 2,839 | java | package com.fsd.sba.entity;
// import java.text.DecimalFormat;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
/**
* @ClassName CompanyEntity
* @Description TODO
* @Author HongYu Zhang
* @Date 12/9/2019 6:58 PM
* @Version 1.0
**/
@Entity
@Table(name = "company")
public class CompanyEntity extends AuditEntity {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Integer companyid;
@Column(name = "companycode")
private String companyCode;
@Column(name = "companyname")
private String companyName;
@Column(name = "turnover")
private String turnover;
@Column(name = "ceo")
private String ceo;
@Column(name = "boardofdirectors")
private String boardofdirectors;
@Column(name = "listedinskex")
private String listedinskex;
@Column(name = "sectorname")
private String sectorName;
@Column(name = "brifewriteup")
private String brifewriteup;
@Column(name = "stockcode")
private String stockCode;
@Column(name = "companystatus")
private String companyStatus;
public CompanyEntity() {
super();
// TODO Auto-generated constructor stub
}
public Integer getCompanyid() {
return companyid;
}
public void setCompanyid(Integer companyid) {
this.companyid = companyid;
}
public String getCompanyCode() {
return companyCode;
}
public void setCompanyCode(String companyCode) {
this.companyCode = companyCode;
}
public String getCompanyName() {
return companyName;
}
public void setCompanyName(String companyName) {
this.companyName = companyName;
}
public String getTurnover() {
return turnover;
}
public void setTurnover(String turnover) {
this.turnover = turnover;
}
public String getCeo() {
return ceo;
}
public void setCeo(String ceo) {
this.ceo = ceo;
}
public String getBoardofdirectors() {
return boardofdirectors;
}
public void setBoardofdirectors(String boardofdirectors) {
this.boardofdirectors = boardofdirectors;
}
public String getListedinskex() {
return listedinskex;
}
public void setListedinskex(String listedinskex) {
this.listedinskex = listedinskex;
}
public String getSectorName() {
return sectorName;
}
public void setSectorName(String sectorName) {
this.sectorName = sectorName;
}
public String getBrifewriteup() {
return brifewriteup;
}
public void setBrifewriteup(String brifewriteup) {
this.brifewriteup = brifewriteup;
}
public String getStockCode() {
return stockCode;
}
public void setStockCode(String stockCode) {
this.stockCode = stockCode;
}
public String getCompanyStatus() {
return companyStatus;
}
public void setCompanyStatus(String companyStatus) {
this.companyStatus = companyStatus;
}
}
| [
"“[email protected]”"
] | |
019edb9a99c7127bf6f8f95076828e2e861560ec | 5029132de6b7300440aac0114621c0f1308a7e6a | /src/programmers2/JadenCase.java | e399ad14991581f23c177450f6cc79600253bd5c | [] | no_license | minkeun428/Java-Algorithm | e69b483373981611dda93c4ba98a57e0d3f02dea | e5d950bb4c6679085d4e0887b88bdd2bcc32f6a7 | refs/heads/master | 2023-07-09T20:25:20.267914 | 2021-08-12T14:23:22 | 2021-08-12T14:23:22 | 370,940,098 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,688 | java | package programmers2;
public class JadenCase {
public void solution(String s) {
String[] str = s.split("");
StringBuilder sb = new StringBuilder();
if(Character.isLowerCase(str[0].charAt(0))) {
sb.append(str[0].toUpperCase());
}else {
sb.append(str[0]);
}
for(int i = 1; i < str.length; i++) {
if(str[i - 1].equals(" ") && Character.isLowerCase(str[i].charAt(0))) {
sb.append(str[i].toUpperCase());
}
else if(!str[i - 1].equals(" ") && Character.isUpperCase(str[i].charAt(0))) {
sb.append(str[i].toLowerCase());
}
else {
sb.append(str[i]);
}
}
System.out.println("sb::" + sb);
}
// 다른 풀이 -> 애초에 다 소문자로 변경 후, 앞 글자와 띄어쓰기 다음 글자만 대문자로 변경한다.
public void solution1(String s) {
String answer = "";
String[] str = s.toLowerCase().split("");
StringBuilder sb = new StringBuilder();
if(Character.isLowerCase(str[0].charAt(0))) {
sb.append(str[0].toUpperCase());
}else {
sb.append(str[0]);
}
for(int i = 1; i < str.length; i++) {
if(str[i - 1].equals(" ")) {
sb.append(str[i].toUpperCase());
}else {
sb.append(str[i]);
}
}
System.out.println("sb::" + sb);
}
public static void main(String[] args) {
String answer = "for the last week";
JadenCase jc = new JadenCase();
jc.solution(answer);
}
}
| [
"[email protected]"
] | |
ce34c162a96e98a563153ae986b783488e7ecdd2 | 3c31471271a94e952d2edde4a6689ef27ed93feb | /core/src/io/anuke/koru/traits/ConnectionTrait.java | 9792ba51e940849164297d2cc96421bac256bf2b | [] | no_license | Anuken/Koru | 129e4a8e730084bfa7b7afa5849b9e409d1ae817 | 4972659ffc223d50e200e782483d43b1698aae45 | refs/heads/master | 2020-04-13T22:12:21.051272 | 2020-01-21T14:48:41 | 2020-01-21T14:48:41 | 55,321,165 | 95 | 12 | null | 2017-07-22T23:23:38 | 2016-04-02T23:36:40 | Java | UTF-8 | Java | false | false | 288 | java | package io.anuke.koru.traits;
import io.anuke.koru.network.syncing.SyncData.Synced;
import io.anuke.ucore.ecs.Trait;
@Synced
public class ConnectionTrait extends Trait{
public boolean local; //whether this is the local player
public transient int connectionID;
public String name;
}
| [
"[email protected]"
] | |
c055309c0be150a1eb9c58daeae5bf27dfe883eb | 117fd4f2b1f04a24046d0c96a7003f6372b3584c | /app/src/main/java/com/aghagha/tagg/NilaiGuruAdapter.java | eae014492e533b759bfdb5d265074ac8e4567e72 | [] | no_license | aghagha/TUGAS_AKHIR_AWASI | 1a0ce918d3a5f9010159942f9b6f7aec3ca6bc0d | 37ba08c8b013428b5cde0ecc0991987f53316b0e | refs/heads/master | 2021-03-30T18:04:54.213675 | 2017-08-03T03:41:44 | 2017-08-03T03:41:44 | 91,204,067 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,186 | java | package com.aghagha.tagg;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AlertDialog;
import android.support.v7.widget.RecyclerView;
import android.text.Layout;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import com.aghagha.tagg.models.Nilai;
import com.aghagha.tagg.utilities.NetworkUtils;
import com.aghagha.tagg.utilities.VolleyUtil;
import com.android.volley.VolleyError;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Created by aghagha on 08/05/2017.
*/
public class NilaiGuruAdapter extends RecyclerView.Adapter<NilaiGuruAdapter.ViewHolder>{
private List<Nilai> listNilai;
private Context mContext;
private ProgressDialog progressDialog;
private AlertDialog alertbox;
NilaiGuruAdapter(List<Nilai> nilai){
this.listNilai = nilai;
}
@Override
public NilaiGuruAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View itemview = LayoutInflater.from(parent.getContext()).inflate(R.layout.nilai_item, parent, false);
return new NilaiGuruAdapter.ViewHolder(itemview);
}
@Override
public void onBindViewHolder(final NilaiGuruAdapter.ViewHolder holder, final int position) {
progressDialog = new ProgressDialog(mContext);
String no = String.valueOf(position);
final String id = listNilai.get(position).getId();
final String nama = listNilai.get(position).getNama();
String nilai = listNilai.get(position).getNilai();
String status = listNilai.get(position).getStatus();
holder.no.setText(no);
holder.nama.setText(nama);
if(nilai.equals("-")){
nilai = "0";
holder.nilai.setText("belum");
holder.nilai.setTextColor(ContextCompat.getColor(mContext,R.color.colorTextRed));
} else holder.nilai.setText(nilai);
if(id.equals("0")){
holder.no.setText("NO.");
holder.no.setTextColor(ContextCompat.getColor(mContext,R.color.colorTextGray));
holder.nama.setTextColor(ContextCompat.getColor(mContext,R.color.colorTextGray));
holder.nilai.setTextColor(ContextCompat.getColor(mContext,R.color.colorTextGray));
} else holder.nilai.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
setAlertBox(nama, holder.nilai, id, position);
alertbox.show();
}
});
}
private void setAlertBox(String nama, final TextView nilai, final String id, final int position) {
if(alertbox!=null)alertbox.dismiss();
LayoutInflater layoutInflater = LayoutInflater.from(mContext);
final View view = layoutInflater.inflate(R.layout.dialog_input_nilai,null);
alertbox = new AlertDialog.Builder(mContext).create();
alertbox.setTitle(nama);
final EditText et_nilai = (EditText) view.findViewById(R.id.et_nilai);
if(!nilai.getText().toString().equals("belum")) et_nilai.setText(nilai.getText());
alertbox.setButton(alertbox.BUTTON_POSITIVE, "SIMPAN", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
simpanNilai(et_nilai.getText().toString(),nilai,id,position);
}
});
alertbox.setButton(alertbox.BUTTON_NEGATIVE, "BATAL", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
}
});
alertbox.setView(view);
}
public void clear(){
listNilai.clear();
notifyDataSetChanged();
}
public void simpanNilai(final String s, final TextView nilai, String id, final int position){
progressDialog.setMessage("Sedang menyimpan...");
progressDialog.show();
VolleyUtil volleyUtil = new VolleyUtil("req_simpan_nilai",mContext, NetworkUtils.nilaGuru+"/"+id);
Map<String,String> params = new HashMap<>();
params.put("nilai",s);
volleyUtil.SendRequestPOST(params, new VolleyUtil.VolleyResponseListener() {
@Override
public void onError(VolleyError error) {
progressDialog.dismiss();
Toast.makeText(mContext, "Simpan nilai gagal...", Toast.LENGTH_SHORT).show();
}
@Override
public void onResponse(String response) {
progressDialog.dismiss();
try {
JSONObject j = new JSONObject(response);
String code = j.getString("code");
if(code.equals("1")){
listNilai.get(position).setNilai(s);
Toast.makeText(mContext, j.getString("message"), Toast.LENGTH_SHORT).show();
nilai.setText(s);
nilai.setTextColor(ContextCompat.getColor(mContext,android.R.color.black));
notifyItemChanged(position);
} else {
Toast.makeText(mContext, j.getString("message"), Toast.LENGTH_SHORT).show();
}
} catch (JSONException e) {
e.printStackTrace();
}
}
});
}
@Override
public int getItemCount() {
return listNilai.size();
}
public class ViewHolder extends RecyclerView.ViewHolder {
public TextView no, nama, nilai;
public ViewHolder(View itemView) {
super(itemView);
mContext = itemView.getContext();
no = (TextView) itemView.findViewById(R.id.no);
nama = (TextView) itemView.findViewById(R.id.nama);
nilai = (TextView) itemView.findViewById(R.id.nilai);
}
}
}
| [
"[email protected]"
] | |
70da7cfe4d799505d92be90b715de2fe979990f0 | 4aa7638557e3ec58243a0b83f0d9a0f97e5bc784 | /src/main/java/com/lapots/breed/platform/tpm/core/artifact/download/DownloadContext.java | fb40202d9ad2e65bfd18e200f578c594c47e9185 | [] | no_license | lapots/tpm | 60971562a0c2344001a8ad5aa6a6933e1049bc24 | 852e45521665cf41470f9d03c127e8eb634f7650 | refs/heads/master | 2021-07-05T06:14:53.630413 | 2017-09-28T14:53:20 | 2017-09-28T17:49:50 | 103,975,344 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 691 | java | package com.lapots.breed.platform.tpm.core.artifact.download;
import com.lapots.breed.platform.tpm.core.api.AbstractArtifactContext;
import com.lapots.breed.platform.tpm.core.artifact.consistency.Artifact;
public class DownloadContext extends AbstractArtifactContext {
private static DownloadContext instance;
public static synchronized DownloadContext getInstance() {
if (null == instance) {
instance = new DownloadContext();
}
return instance;
}
@Override
public void addArtifactToContext(Artifact artifact) {
DownloadThread th = new DownloadThread();
th.setArtifact(artifact);
executeThread(th);
}
}
| [
"[email protected]"
] | |
cab51cf57850b532f242831c71686b6b74543ff2 | 573a59e44990cf68cd057439534f73b297583751 | /src/main/java/ch/buhls/billmanager/gui/viewModel/wrappers/FinancialYearWrapper.java | 6a0a525dc6726aadfed99e19ba9edcdfad39ffbc | [] | no_license | sdbuehlmann/BillManager | c7515b5bf265ffe327119c9692492ca18348c816 | dfd6dcf8ab8a324eb519645d7f693d307dfe9785 | refs/heads/develop | 2023-05-25T22:22:49.924716 | 2019-11-27T18:01:34 | 2019-11-27T18:01:34 | 131,580,333 | 0 | 0 | null | 2023-05-23T20:18:32 | 2018-04-30T09:58:27 | Java | UTF-8 | Java | false | false | 435 | java |
package ch.buhls.billmanager.gui.viewModel.wrappers;
import ch.buhls.billmanager.gui.data.GUIFinancialYear;
import ch.buhls.billmanager.persistance.database.entities.FinancialYear;
/**
*
* @author simon
*/
public class FinancialYearWrapper implements IDataWrapper<FinancialYear, GUIFinancialYear>
{
@Override
public GUIFinancialYear wrapEntity(FinancialYear entity) {
return new GUIFinancialYear(entity);
}
}
| [
"[email protected]"
] | |
301b295651dacd7760dddd567a34aeee59e0490d | 7cb0d799781dee02c1653041fb71283593084c28 | /app/src/main/java/com/kongtiaoapp/xxhj/ui/view/Mf_Tools.java | 8cc1107d4f8b2cda0b9def55b080eff47e52f78d | [] | no_license | guochengabc/xxhj_project | 2a7a41f000dc7c6512d93c83a641e6dd7a531a87 | b6588be8e5c9436f88873e085a76c3241193a8c1 | refs/heads/master | 2020-09-21T13:09:44.562591 | 2020-01-19T09:17:05 | 2020-01-19T09:17:05 | 224,797,254 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 17,095 | java | package com.kongtiaoapp.xxhj.ui.view;
import android.app.Activity;
import android.content.Context;
import android.support.v4.app.Fragment;
import android.view.View;
import android.view.ViewGroup;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.kongtiaoapp.xxhj.R;
import com.kongtiaoapp.xxhj.ui.draws.AverageTemperatureChart;
import com.kongtiaoapp.xxhj.ui.draws.BarChart;
import com.kongtiaoapp.xxhj.ui.draws.BarChartCompare;
import com.kongtiaoapp.xxhj.ui.draws.BarChartH_String;
import com.kongtiaoapp.xxhj.ui.draws.CubicChart;
import com.kongtiaoapp.xxhj.ui.draws.LineChartNoRealTime;
import com.kongtiaoapp.xxhj.ui.draws.piechart.PieChart;
import com.kongtiaoapp.xxhj.utils.DensityUtils;
import com.kongtiaoapp.xxhj.utils.emoji.ToastUtils;
import org.achartengine.GraphicalView;
import java.util.List;
/**
* A simple {@link Fragment} subclass. 设置图表显示风格的一些相关操作
*/
public class Mf_Tools {
public static void setGraph(List<TextView> list, String[] titles) {
if (titles.length == 1) {
list.get(0).setVisibility(View.VISIBLE);
list.get(0).setText(titles[0]);
} else if (titles.length == 2) {
list.get(0).setVisibility(View.VISIBLE);
list.get(1).setVisibility(View.VISIBLE);
list.get(0).setText(titles[0]);
list.get(1).setText(titles[1]);
} else if (titles.length == 3) {
list.get(0).setVisibility(View.VISIBLE);
list.get(1).setVisibility(View.VISIBLE);
list.get(2).setVisibility(View.VISIBLE);
list.get(0).setText(titles[0]);
list.get(1).setText(titles[1]);
list.get(2).setText(titles[2]);
} else if (titles.length == 4) {
list.get(0).setVisibility(View.VISIBLE);
list.get(1).setVisibility(View.VISIBLE);
list.get(2).setVisibility(View.VISIBLE);
list.get(3).setVisibility(View.VISIBLE);
list.get(0).setText(titles[0]);
list.get(1).setText(titles[1]);
list.get(2).setText(titles[2]);
list.get(3).setText(titles[3]);
} else if (titles.length == 5) {
list.get(0).setVisibility(View.VISIBLE);
list.get(1).setVisibility(View.VISIBLE);
list.get(2).setVisibility(View.VISIBLE);
list.get(3).setVisibility(View.VISIBLE);
list.get(4).setVisibility(View.VISIBLE);
list.get(0).setText(titles[0]);
list.get(1).setText(titles[1]);
list.get(2).setText(titles[2]);
list.get(3).setText(titles[3]);
list.get(4).setText(titles[4]);
} else if (titles.length == 6) {
list.get(0).setVisibility(View.VISIBLE);
list.get(1).setVisibility(View.VISIBLE);
list.get(2).setVisibility(View.VISIBLE);
list.get(3).setVisibility(View.VISIBLE);
list.get(4).setVisibility(View.VISIBLE);
list.get(5).setVisibility(View.VISIBLE);
list.get(0).setText(titles[0]);
list.get(1).setText(titles[1]);
list.get(2).setText(titles[2]);
list.get(3).setText(titles[3]);
list.get(4).setText(titles[4]);
list.get(5).setText(titles[5]);
} else if (titles.length == 7) {
list.get(0).setVisibility(View.VISIBLE);
list.get(1).setVisibility(View.VISIBLE);
list.get(2).setVisibility(View.VISIBLE);
list.get(3).setVisibility(View.VISIBLE);
list.get(4).setVisibility(View.VISIBLE);
list.get(5).setVisibility(View.VISIBLE);
list.get(6).setVisibility(View.VISIBLE);
list.get(0).setText(titles[0]);
list.get(1).setText(titles[1]);
list.get(2).setText(titles[2]);
list.get(3).setText(titles[3]);
list.get(4).setText(titles[4]);
list.get(5).setText(titles[5]);
list.get(6).setText(titles[6]);
} else if (titles.length == 8) {
list.get(0).setVisibility(View.VISIBLE);
list.get(1).setVisibility(View.VISIBLE);
list.get(2).setVisibility(View.VISIBLE);
list.get(3).setVisibility(View.VISIBLE);
list.get(4).setVisibility(View.VISIBLE);
list.get(5).setVisibility(View.VISIBLE);
list.get(6).setVisibility(View.VISIBLE);
list.get(7).setVisibility(View.VISIBLE);
list.get(0).setText(titles[0]);
list.get(1).setText(titles[1]);
list.get(2).setText(titles[2]);
list.get(3).setText(titles[3]);
list.get(4).setText(titles[4]);
list.get(5).setText(titles[5]);
list.get(6).setText(titles[6]);
list.get(7).setText(titles[7]);
} else if (titles.length == 9) {
list.get(0).setVisibility(View.VISIBLE);
list.get(1).setVisibility(View.VISIBLE);
list.get(2).setVisibility(View.VISIBLE);
list.get(3).setVisibility(View.VISIBLE);
list.get(4).setVisibility(View.VISIBLE);
list.get(5).setVisibility(View.VISIBLE);
list.get(6).setVisibility(View.VISIBLE);
list.get(7).setVisibility(View.VISIBLE);
list.get(8).setVisibility(View.VISIBLE);
list.get(0).setText(titles[0]);
list.get(1).setText(titles[1]);
list.get(2).setText(titles[2]);
list.get(3).setText(titles[3]);
list.get(4).setText(titles[4]);
list.get(5).setText(titles[5]);
list.get(6).setText(titles[6]);
list.get(7).setText(titles[7]);
list.get(8).setText(titles[8]);
}
}
public static void hintAllView(List<TextView> list) {
for (TextView textView : list) {
textView.setVisibility(View.GONE);
}
}
public static void showToast(Context context, int type) {
if (type == 0) {
ToastUtils.showToast(context, "服务器请求失败");
} else if (type == 1) {
ToastUtils.showToast(context, "服务器请求错误");
}
}
/**
* 设置图例,分日和月份进行处理 曲线图
*/
public static void setData(String[] titles, List<double[]> listsY, List<double[]> listX, int maxX, double maxY, double minY, Activity mActivity, RelativeLayout rela_loading, boolean isMonth, long nowTime) {
GraphicalView executes = null;
if (isMonth) {
BarChart sensor = new BarChart();
executes = sensor.execute(mActivity, titles, listX, listsY, mActivity.getResources().getString(R.string.ismonth), maxX, maxY, minY, isMonth, nowTime);
} else if (isMonth == false) {
CubicChart sensor = new CubicChart();
executes = sensor.execute(mActivity, titles, listX, listsY, mActivity.getResources().getString(R.string.isday), maxX, maxY, minY, isMonth, nowTime);
}
rela_loading.removeView(executes);
if (executes != null) {
rela_loading.addView(executes);
}
}
/**
* 设置图例,分日和月份进行处理 曲线图
* isMonth 0 日 1 月 2 年
*/
public static void setData(String[] titles, List<double[]> listsY, List<double[]> listX, int maxX, double maxY, double minY, Activity mActivity, RelativeLayout rela_loading, int isMonth, long nowTime) {
GraphicalView executes = null;
if (isMonth==0) {//日
CubicChart sensor = new CubicChart();
executes = sensor.execute(mActivity, titles, listX, listsY, mActivity.getResources().getString(R.string.isday), maxX, maxY, minY, true, nowTime);
} else if (isMonth == 1) {//月
BarChart sensor = new BarChart();
executes = sensor.execute(mActivity, titles, listX, listsY, mActivity.getResources().getString(R.string.ismonth), maxX, maxY, minY, true, nowTime);
}else if (isMonth == 2) {//年
BarChart sensor = new BarChart();
executes = sensor.execute(mActivity, titles, listX, listsY, mActivity.getResources().getString(R.string.isyear), maxX, maxY, minY, true, nowTime);
}
rela_loading.removeView(executes);
if (executes != null) {
rela_loading.addView(executes);
}
}
/**
* 设置图例,月数据显示的是曲线图
*/
public static void setData(String[] titles, List<double[]> listsY, List<double[]> listX, int maxX, double maxY, double minY, Activity mActivity, RelativeLayout rela_loading, boolean isMonth, String type, long nowTime) {
GraphicalView executes = null;
CubicChart sensor = new CubicChart();
if (isMonth) {
executes = sensor.execute(mActivity, titles, listX, listsY, mActivity.getResources().getString(R.string.ismonth), maxX, maxY, minY, isMonth, nowTime);
} else if (isMonth == false) {
executes = sensor.execute(mActivity, titles, listX, listsY, mActivity.getResources().getString(R.string.isday), maxX, maxY, minY, isMonth, nowTime);
}
rela_loading.removeView(executes);
if (executes != null) {
rela_loading.addView(executes);
}
}
/*设置图例,分日和月份进行处理*/
public static void setData(String[] titles, List<double[]> listsY, List<double[]> listX, int maxX, double maxY, double minY, Activity mActivity, RelativeLayout rela_loading, String type, long nowTime) {
//type 0代表曲线图 1代表柱状图
GraphicalView executes = null;
if (type.equals("0")) {
AverageTemperatureChart sensor = new AverageTemperatureChart();
executes = sensor.execute(mActivity, titles, listX, listsY, mActivity.getResources().getString(R.string.isday), maxX, maxY, minY, true, nowTime);
} else if (type.equals("1")){
AverageTemperatureChart sensor = new AverageTemperatureChart();
executes = sensor.execute(mActivity, titles, listX, listsY, mActivity.getResources().getString(R.string.ismonth), maxX, maxY, minY, true, nowTime);
}else if (type.equals("2")){
AverageTemperatureChart sensor = new AverageTemperatureChart();
executes = sensor.execute(mActivity, titles, listX, listsY, mActivity.getResources().getString(R.string.isyear), maxX, maxY, minY, true, nowTime);
}
else {
BarChart sensor = new BarChart();
executes = sensor.execute(mActivity, titles, listX, listsY, mActivity.getResources().getString(R.string.ismonth), maxX, maxY, minY, true, nowTime);
}
if (executes != null) {
rela_loading.addView(executes);
}
}
public static void setDataMonthLine(String[] titles, List<double[]> listsY, List<double[]> listX, int maxX, double maxY, double minY, Activity mActivity, RelativeLayout rela_loading, long nowTime) {
AverageTemperatureChart sensor = new AverageTemperatureChart();
GraphicalView executes = sensor.execute(mActivity, titles, listX, listsY, mActivity.getResources().getString(R.string.isyear), maxX, maxY, minY, true, nowTime);
if (executes != null) {
rela_loading.addView(executes);
}
} public static void setDataMonthBar(String[] titles, List<double[]> listsY, List<double[]> listX, int maxX, double maxY, double minY, Activity mActivity, RelativeLayout rela_loading, long nowTime) {
BarChart sensor = new BarChart();
GraphicalView executes = sensor.execute(mActivity, titles, listX, listsY, mActivity.getResources().getString(R.string.ismonth), maxX, maxY, minY, false, nowTime);
if (executes != null) {
rela_loading.addView(executes);
}
}
/*设置图例,柱状图 单个对比*/
public static void setData(String[] titles, List<double[]> listsY, List<String> listX, int maxX, double maxY, double minY, Activity mActivity, RelativeLayout rela_loading, long nowTime) {
BarChartH_String sensor = new BarChartH_String();
GraphicalView executes = sensor.execute(mActivity, titles, listX, listsY, mActivity.getResources().getString(R.string.ismonth), maxX, maxY, minY, false, nowTime);
if (executes != null) {
rela_loading.addView(executes);
}
} /*设置图例,柱状图 多个对比*/
public static void setData(String[] titles, List<double[]> listsY, List<String[]> listX, int maxX, double maxY, double minY, Activity mActivity, RelativeLayout rela_loading, long nowTime, int sign) {
BarChartCompare sensor = new BarChartCompare();
GraphicalView executes = sensor.execute(mActivity, titles, listX, listsY, mActivity.getResources().getString(R.string.ismonth), maxX, maxY, minY, false, nowTime, sign);
if (executes != null) {
rela_loading.addView(executes);
}
}
/**
*
* 设置图例,柱状图 多个对比
* (Context context, String[] titles, List<String> x, List<double[]> yvalues, String xtitile, int xMax, double yMax, double minY, boolean isMonth, long nowTime)
* */
public static void setDataNoRealTime(String[] titles, List<double[]> listsY, List<String> listX, double maxX, double maxY, double minY, Activity mActivity, RelativeLayout rela_loading, long nowTime) {
//BarChartNoRealTime_String sensor = new BarChartNoRealTime_String();
LineChartNoRealTime sensor = new LineChartNoRealTime();
GraphicalView executes = sensor.execute(mActivity, titles, listX, listsY, "",maxX, maxY, minY, false, nowTime);
if (executes != null) {
rela_loading.addView(executes);
}
}
/**
* 更新展示层界面的高度 rela_loading:展示视图层 newConfig=1代表竖屏 2代表横屏
*/
public static void setLayoutHeight(Activity mActivity, ViewGroup frame, ViewGroup rela_loading, int newConfig) {
ViewGroup.LayoutParams params = rela_loading.getLayoutParams();
ViewGroup.LayoutParams frameParam = frame.getLayoutParams();
if (newConfig == 1) {
frameParam.height = DensityUtils.dp2px(mActivity, 300);
frame.setLayoutParams(frameParam);
frame.invalidate();
params.height = DensityUtils.dp2px(mActivity, 300);
rela_loading.setLayoutParams(params);
rela_loading.invalidate();
} else {
frameParam.height = DensityUtils.dp2px(mActivity, 330);
frame.setLayoutParams(frameParam);
frame.invalidate();
params.height = DensityUtils.dp2px(mActivity, 330);
rela_loading.setLayoutParams(params);
rela_loading.invalidate();
}
}
public static void setLayoutMatchHeight(Activity mActivity, ViewGroup frame, ViewGroup rela_loading, int newConfig) {
ViewGroup.LayoutParams params = rela_loading.getLayoutParams();
ViewGroup.LayoutParams frameParam = frame.getLayoutParams();
if (newConfig == 1) {
frameParam.height = DensityUtils.dp2px(mActivity, 330);
frame.setLayoutParams(frameParam);
frame.invalidate();
params.height = DensityUtils.dp2px(mActivity, 330);
rela_loading.setLayoutParams(params);
rela_loading.invalidate();
} else {
frameParam.height = DensityUtils.dp2px(mActivity, 380);
frame.setLayoutParams(frameParam);
frame.invalidate();
params.height = DensityUtils.dp2px(mActivity, 380);
rela_loading.setLayoutParams(params);
rela_loading.invalidate();
}
}
public static void setEvalLayoutHeight(Activity mActivity, ViewGroup frame, ViewGroup rela_loading, int newConfig) {
ViewGroup.LayoutParams params = rela_loading.getLayoutParams();
ViewGroup.LayoutParams frameParam = frame.getLayoutParams();
if (newConfig == 1) {
frameParam.height = DensityUtils.dp2px(mActivity, 150);
frame.setLayoutParams(frameParam);
frame.invalidate();
params.height = DensityUtils.dp2px(mActivity, 150);
rela_loading.setLayoutParams(params);
rela_loading.invalidate();
} else {
frameParam.height = DensityUtils.dp2px(mActivity, 210);
frame.setLayoutParams(frameParam);
frame.invalidate();
params.height = DensityUtils.dp2px(mActivity, 210);
rela_loading.setLayoutParams(params);
rela_loading.invalidate();
}
}
/**
* 对饼状图进行相关设置饼状图,做出一个中间层,方便后期调试和修改 2018-6-6
*/
public static void setDataPieChart(Context context, String title, double[] values, String[] name, ViewGroup rela_loading) {
rela_loading.removeAllViews();
PieChart chart = new PieChart();
chart.execute(context, title, values, name, rela_loading);
}
}
| [
"[email protected]"
] | |
a4c7b63887f7803f5c7cbc9920ad521d362c1347 | 96d459b12727f938dfd3182f3a870ea9c36d6771 | /Ribbon/RibbonClient/src/main/java/com/zgpeace/cloud/domain/CommonResult.java | 9eead287f3bfe9ee6ac452ab7c7d38668e278156 | [] | no_license | zgpeace/SpringCloudGreenwich | 91248718ef361bf954fd204f9b90c1050643d040 | edf8772efb98b36cfb6b2dd1f1a3e617e15f2c55 | refs/heads/master | 2021-01-01T23:45:54.222441 | 2020-03-06T01:54:07 | 2020-03-06T01:54:07 | 239,396,757 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 484 | java | package com.zgpeace.cloud.domain;
import lombok.*;
@Data
@NoArgsConstructor
public class CommonResult<T> {
private T data;
private String message;
private Integer code;
public CommonResult(T data, String message, Integer code) {
this.data = data;
this.message = message;
this.code = code;
}
public CommonResult(String message, Integer code) {
this(null, message, code);
}
public CommonResult(T data) {
this(data, "操作成功", 200);
}
}
| [
"[email protected]"
] | |
8c5b9bfc414b95117380a42e271417cd90b72356 | b21aa78f4df6ca9bac90e2726221114a41f2294a | /src/main/java/darkknight/jewelrycraft/block/BlockSmelter.java | db8e254f14ac1cb47852a992f78761504afc7ab6 | [] | no_license | sor1n/Jewelrycraft | 03db45d33498b24146cc7327e3994d454f67272c | 01c8701b68986ccfa83e902515716838d6829311 | refs/heads/1.7.10 | 2021-01-20T12:00:11.955555 | 2015-12-01T20:55:30 | 2015-12-01T20:55:30 | 15,147,767 | 10 | 8 | null | 2015-08-20T18:10:06 | 2013-12-12T21:21:27 | Java | UTF-8 | Java | false | false | 12,843 | java | package darkknight.jewelrycraft.block;
import java.util.Random;
import darkknight.jewelrycraft.config.ConfigHandler;
import darkknight.jewelrycraft.item.ItemList;
import darkknight.jewelrycraft.item.ItemMoltenMetalBucket;
import darkknight.jewelrycraft.tileentity.TileEntityMolder;
import darkknight.jewelrycraft.tileentity.TileEntitySmelter;
import darkknight.jewelrycraft.util.JewelryNBT;
import darkknight.jewelrycraft.util.JewelrycraftUtil;
import darkknight.jewelrycraft.util.Variables;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.MathHelper;
import net.minecraft.util.StatCollector;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
public class BlockSmelter extends BlockContainer {
Random rand = new Random();
public BlockSmelter() {
super(Material.rock);
}
@Override
public TileEntity createNewTileEntity(World world, int var2) {
return new TileEntitySmelter();
}
@Override
public boolean renderAsNormalBlock() {
return false;
}
public void dropItem(World world, double x, double y, double z, ItemStack stack) {
EntityItem entityitem = new EntityItem(world, x + 0.5D, y + 1.3D, z + 0.5D, stack);
entityitem.motionX = 0;
entityitem.motionZ = 0;
entityitem.motionY = 0.11000000298023224D;
entityitem.delayBeforeCanPickup = 0;
world.spawnEntityInWorld(entityitem);
}
@Override
public void breakBlock(World world, int i, int j, int k, Block block, int meta) {
TileEntitySmelter te = (TileEntitySmelter) world.getTileEntity(i, j, k);
if (te != null) {
if (te.hasMetal) dropItem(world, i, j, k, te.metal.copy());
if (te.hasMoltenMetal && te.moltenMetal != null && Item.getIdFromItem(te.moltenMetal.getItem()) > 0) {
int quant = (int) (te.quantity * 10);
ItemStack metalBucket = new ItemStack(ItemList.bucket);
JewelryNBT.addMetal(metalBucket, te.moltenMetal.copy());
if (quant == 9) {
dropItem(world, i, j, k, new ItemStack(Blocks.cobblestone, 6));
dropItem(world, i, j, k, new ItemStack(Items.lava_bucket));
dropItem(world, i, j, k, metalBucket);
}
}
world.removeTileEntity(i, j, k);
}
}
@Override
public boolean onBlockActivated(World world, int i, int j, int k, EntityPlayer entityPlayer, int par6, float par7, float par8, float par9) {
TileEntitySmelter te = (TileEntitySmelter) world.getTileEntity(i, j, k);
ItemStack item = entityPlayer.inventory.getCurrentItem();
if (te != null && te.hasMoltenMetal && te.quantity >= .9f && !te.pouring && item != null && item.getItem() == Items.bucket) {
te.quantity = 0f;
te.hasMoltenMetal = false;
ItemStack metalBucket = new ItemStack(ItemList.bucket, 1);
ItemStack ingot = te.moltenMetal.copy();
JewelryNBT.addMetal(metalBucket, ingot);
--item.stackSize;
entityPlayer.inventory.addItemStackToInventory(metalBucket);
te.isDirty = true;
return true;
}
if (te != null && !world.isRemote) {
if (te.hasMetal && entityPlayer.isSneaking()) {
dropItem(world, te.xCoord, te.yCoord, te.zCoord, te.metal.copy());
te.hasMetal = false;
te.melting = -1;
te.isDirty = true;
}
if (item != null && item.getItem() != null && !(item.getItem() instanceof ItemMoltenMetalBucket)) {
int index = -1;
for (int a = 0; a < JewelrycraftUtil.jamcraftPlayers.size(); a++)
if (entityPlayer.getUniqueID().toString().equals(JewelrycraftUtil.jamcraftPlayers.get(a))) index = a;
if (entityPlayer.capabilities.isCreativeMode) index = 1;
boolean canPlace = item != null && (JewelrycraftUtil.isMetal(item) || JewelrycraftUtil.isOre(item) || index >= 0 || JewelryNBT.ingot(item) != null);
boolean isOre = false, oreCoincidesWithMetal = false, itemCoincidesWithMetal = false, itemCoincidesWithMoltenMetal = false, overflow = false;
isOre = JewelrycraftUtil.isOre(item);
if (te.metal != null && te.metal.getItem() != null) {
if (JewelryNBT.ingot(item) == null) itemCoincidesWithMetal = item.getItem().equals(te.metal.getItem()) && item.getItemDamage() == te.metal.getItemDamage();
else itemCoincidesWithMetal = item.getItem().equals(te.metal.getItem()) && item.getItemDamage() == te.metal.getItemDamage() && JewelryNBT.ingot(item).getItem().equals(JewelryNBT.ingot(te.metal).getItem()) && JewelryNBT.ingot(item).getItemDamage() == JewelryNBT.ingot(te.metal).getItemDamage();
}
if (te.moltenMetal != null && te.moltenMetal.getItem() != null) {
if (JewelryNBT.ingot(item) == null) itemCoincidesWithMoltenMetal = item.getItem().equals(te.moltenMetal.getItem()) && item.getItemDamage() == te.moltenMetal.getItemDamage();
else itemCoincidesWithMoltenMetal = JewelryNBT.ingot(item).getItem().equals(te.moltenMetal.getItem()) && JewelryNBT.ingot(item).getItemDamage() == te.moltenMetal.getItemDamage();
if (isOre) oreCoincidesWithMetal = te.moltenMetal.getItem().equals(JewelrycraftUtil.getIngotFromOre(item).getItem()) && te.moltenMetal.getItemDamage() == JewelrycraftUtil.getIngotFromOre(item).getItemDamage();
}
overflow = isOre ? te.metal.stackSize * 0.2f + te.quantity < 0.8f : te.metal.stackSize * 0.1f + te.quantity < 0.9f;
boolean isValid = te.hasMoltenMetal ? isOre ? oreCoincidesWithMetal : itemCoincidesWithMoltenMetal : true;
if (te.quantity < 0.9f && !te.pouring && canPlace && isValid) {
boolean check = isOre ? oreCoincidesWithMetal && te.quantity < 0.8f : itemCoincidesWithMoltenMetal;
boolean check2 = isOre ? oreCoincidesWithMetal : itemCoincidesWithMetal;
if (!te.hasMetal && !te.hasMoltenMetal || !te.hasMetal && te.hasMoltenMetal && check) {
entityPlayer.addChatMessage(new ChatComponentText(StatCollector.translateToLocalFormatted("chatmessage." + Variables.MODID + ".smelter.nowsmeltingingot", item.getDisplayName())));
te.metal = item.copy();
te.metal.stackSize = 1;
te.hasMetal = true;
te.melting = ConfigHandler.INGOT_MELTING_TIME;
if (!entityPlayer.capabilities.isCreativeMode) --item.stackSize;
te.isDirty = true;
}
else if (te.hasMetal && te.hasMoltenMetal && check2 && overflow || te.hasMetal && !te.hasMoltenMetal && itemCoincidesWithMetal && overflow) {
entityPlayer.addChatMessage(new ChatComponentText(StatCollector.translateToLocalFormatted("Smelting extra " + (isOre ? "ores" : "ingots") + " (" + (te.metal.stackSize + 1) + ")")));
te.metal.stackSize++;
te.hasMetal = true;
te.melting += ConfigHandler.INGOT_MELTING_TIME;
if (!entityPlayer.capabilities.isCreativeMode) --item.stackSize;
te.isDirty = true;
}
te.isDirty = true;
}
else if (item != null && (te.hasMetal || te.hasMoltenMetal) && !itemCoincidesWithMoltenMetal && te.quantity < .9f) entityPlayer.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("chatmessage." + Variables.MODID + ".smelter.contentdoesnotmatch")));
else if (item != null && !item.getUnlocalizedName().toLowerCase().contains("ingot") && item.getDisplayName().toLowerCase().contains("ingot") && te.quantity < .9f) entityPlayer.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("chatmessage." + Variables.MODID + ".smelter.itemrenamedtoingot")));
else if (item != null && te.quantity >= .9f) entityPlayer.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("chatmessage." + Variables.MODID + ".smelter.full")));
else entityPlayer.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("chatmessage." + Variables.MODID + ".smelter.cannotsmelt")));
}
else if (item != null && item.getItem() != null && item.getItem() instanceof ItemMoltenMetalBucket && !te.hasMoltenMetal && !te.hasMetal) {
te.hasMoltenMetal = true;
ItemStack ingot = JewelryNBT.ingot(item);
te.moltenMetal = ingot;
te.quantity = .9f;
te.isDirty = true;
if (!entityPlayer.capabilities.isCreativeMode) {
--item.stackSize;
dropItem(world, entityPlayer.posX, entityPlayer.posY, entityPlayer.posZ, new ItemStack(Items.bucket));
}
}
else if (item == null && te.hasMoltenMetal && te.moltenMetal.getItem() != null) entityPlayer.addChatMessage(new ChatComponentText(StatCollector.translateToLocalFormatted("chatmessage." + Variables.MODID + ".smelter.hasmolteningot", te.moltenMetal.getDisplayName().replace(" Ingot", ""))));
world.setTileEntity(i, j, k, te);
}
return true;
}
@Override
public void onBlockClicked(World world, int i, int j, int k, EntityPlayer player) {
TileEntitySmelter te = (TileEntitySmelter) world.getTileEntity(i, j, k);
TileEntityMolder me = null;
if (world.getBlockMetadata(i, j, k) == 0 && world.getTileEntity(i, j, k - 1) != null && world.getTileEntity(i, j, k - 1) instanceof TileEntityMolder) me = (TileEntityMolder) world.getTileEntity(i, j, k - 1);
else if (world.getBlockMetadata(i, j, k) == 1 && world.getTileEntity(i + 1, j, k) != null && world.getTileEntity(i + 1, j, k) instanceof TileEntityMolder) me = (TileEntityMolder) world.getTileEntity(i + 1, j, k);
else if (world.getBlockMetadata(i, j, k) == 2 && world.getTileEntity(i, j, k + 1) != null && world.getTileEntity(i, j, k + 1) instanceof TileEntityMolder) me = (TileEntityMolder) world.getTileEntity(i, j, k + 1);
else if (world.getBlockMetadata(i, j, k) == 3 && world.getTileEntity(i - 1, j, k) != null && world.getTileEntity(i - 1, j, k) instanceof TileEntityMolder) me = (TileEntityMolder) world.getTileEntity(i - 1, j, k);
if (te != null && me != null && !world.isRemote) if (te.hasMoltenMetal && isConnectedToMolder(world, i, j, k) && me != null && me.hasMold && !me.hasMoltenMetal && !me.hasJewelBase) {
te.pouring = true;
te.isDirty = true;
}
else if (te.hasMetal && te.melting > 0) player.addChatMessage(new ChatComponentText(StatCollector.translateToLocalFormatted("chatmessage." + Variables.MODID + ".smelter.metalismelting", te.metal.getDisplayName()) + " (" + (ConfigHandler.INGOT_MELTING_TIME * te.metal.stackSize - te.melting) * 100 / (ConfigHandler.INGOT_MELTING_TIME * te.metal.stackSize) + "%)"));
else if (te.hasMoltenMetal && !isConnectedToMolder(world, i, j, k)) player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("chatmessage." + Variables.MODID + ".smelter.molderismissing")));
else if (!me.hasMold && te.hasMoltenMetal) player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("chatmessage." + Variables.MODID + ".smelter.molderhasnomold")));
else if (me.hasMoltenMetal && te.hasMoltenMetal) player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("chatmessage." + Variables.MODID + ".smelter.molderhasmoltenmetal")));
else if (me.hasJewelBase && te.hasMoltenMetal) player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("chatmessage." + Variables.MODID + ".smelter.modlerhasitem")));
else player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("chatmessage." + Variables.MODID + ".smelter.empty")));
}
public boolean isConnectedToMolder(World world, int i, int j, int k) {
int blockMeta = world.getBlockMetadata(i, j, k);
if (blockMeta == 0 && world.getBlock(i, j, k - 1) instanceof BlockMolder) return true;
else if (blockMeta == 1 && world.getBlock(i + 1, j, k) instanceof BlockMolder) return true;
else if (blockMeta == 2 && world.getBlock(i, j, k + 1) instanceof BlockMolder) return true;
else if (blockMeta == 3 && world.getBlock(i - 1, j, k) instanceof BlockMolder) return true;
return false;
}
@Override
public void onBlockPlacedBy(World world, int i, int j, int k, EntityLivingBase entityLiving, ItemStack par6ItemStack) {
int rotation = MathHelper.floor_double(entityLiving.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
world.setBlockMetadataWithNotify(i, j, k, rotation, 2);
}
@Override
public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l) {
return false;
}
@Override
public boolean isOpaqueCube() {
return false;
}
@Override
public int getRenderType() {
return -1;
}
@Override
public void registerBlockIcons(IIconRegister icon)
{
blockIcon = icon.registerIcon("minecraft:iron_block");
}
}
| [
"[email protected]"
] | |
be52b1092c61b17b0063d548ab0952570e65a2e4 | d2460001fa5c7f3c9538ed6f4c8257a7a5d5c1e3 | /src/main/java/io/github/vergl/currator/service/ExchangeRateService.java | 408bff5a753c70eb48bcfe68b8ebd67e72954a1b | [
"MIT"
] | permissive | vergl/currator | 1a63826bf34064d7da0e32758022c695aa7985d3 | 12028e16ea959ba54f85955b42448b7dec5256b7 | refs/heads/master | 2020-12-27T04:00:19.389256 | 2020-09-28T05:56:26 | 2020-09-28T05:56:26 | 237,757,391 | 0 | 0 | MIT | 2020-09-28T05:56:28 | 2020-02-02T10:59:27 | Java | UTF-8 | Java | false | false | 1,432 | java | package io.github.vergl.currator.service;
import io.github.vergl.currator.domain.ExchangeRate;
import io.github.vergl.currator.domain.ExchangeRateDto;
import io.github.vergl.currator.domain.ecb.EcbEnvelope;
import io.github.vergl.currator.domain.filter.ExchangeRateDateFilter;
import io.github.vergl.currator.domain.filter.ExchangeRateHistoryFilter;
import java.util.List;
public interface ExchangeRateService {
/**
* Get exchange rates for a chosen date
*
* @param filter includes date, base currency and list of currencies
* @return exchange Rate
*/
ExchangeRateDto getByDate(ExchangeRateDateFilter filter);
/**
* Save new or update existing Exchange rate
*
* @param rate exchange rate to update
* @return updated Exchange rate
*/
ExchangeRate saveOrUpdate(ExchangeRate rate);
/**
* Get a number of exchange rates in the database
*
* @return number of exchange rates
*/
Long count();
/**
* Write parsed data from European Central Bank to the database.
*
* @param envelope data from ECB
*/
void writeEcbRatesToDb(EcbEnvelope envelope);
/**
* Get exchange rates by history filter
*
* @param filter includes start date, end date, base currency and currencies
* @return list of exchange rates
*/
List<ExchangeRateDto> getHistoryRates(ExchangeRateHistoryFilter filter);
}
| [
"[email protected]"
] | |
c1dcc02bb0dac06be27f78fdf75f3c51c7049bf7 | 1f123f5eb319489dcd0c180bb2cce4da291372f4 | /app/src/main/java/com/example/headstart/MaintenanceSchedule/ScheduleHolder.java | 1b952c8f8874089f63080be1c6aa4fdc4d23cec1 | [] | no_license | skepquilian/HeadStart | 7f5149913b28841fb274efad67f78a9a7150123b | fe5a5d6e43e6a66b822fa963bdd525359e618d3b | refs/heads/master | 2023-07-02T21:36:31.523980 | 2021-08-12T13:43:43 | 2021-08-12T13:43:43 | 310,965,737 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,078 | java | package com.example.headstart.MaintenanceSchedule;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.example.headstart.R;
import androidx.annotation.NonNull;
import androidx.cardview.widget.CardView;
import androidx.recyclerview.widget.RecyclerView;
public class ScheduleHolder extends RecyclerView.ViewHolder {
TextView taskName, taskDate, taskDriverName;
CardView cardViewParent;
LinearLayout linearLayout;
RelativeLayout expandableLayout;
public ScheduleHolder(@NonNull View itemView) {
super(itemView);
this.taskName = itemView.findViewById(R.id.schedule_name);
this.taskDate = itemView.findViewById(R.id.schedule_date);
this.taskDriverName = itemView.findViewById(R.id.schedule_drv_name);
this.cardViewParent = itemView.findViewById(R.id.schedule_row);
this.linearLayout = itemView.findViewById(R.id.linear_layout_1);
this.expandableLayout = itemView.findViewById(R.id.expandable_layout);
}
}
| [
"[email protected]"
] | |
28d79e0674489e89fb10af116fabdfc3aa61efd0 | 024c56eba6b62afae84906b5bcedd6ae80ad8486 | /src/com/boa/training/receiver/MessageReceiverWithSpecificPartition.java | f21f8fb9b877eb6c1ec8367b5a8acc37489a67c3 | [] | no_license | pradeepatmuri/KafkaTrainingsDay2 | 6bbbc6b9c8a271373699ae1f0cb71a43a8463ec0 | d8298f1677e6c04387119d2ebaf9ccab855a0ab2 | refs/heads/master | 2020-04-24T01:27:56.016082 | 2019-02-21T10:06:31 | 2019-02-21T10:06:31 | 171,599,120 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,686 | java | package com.boa.training.receiver;
import java.time.Duration;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;
import org.apache.kafka.clients.consumer.Consumer;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.apache.kafka.clients.consumer.ConsumerRecords;
import org.apache.kafka.clients.consumer.KafkaConsumer;
import org.apache.kafka.common.TopicPartition;
public class MessageReceiverWithSpecificPartition {
public static void main(String[] args) {
Properties props = new Properties();
props.setProperty("bootstrap.servers", "localhost:9092");
props.setProperty("key.deserializer", "org.apache.kafka.common.serialization.StringDeserializer");
props.setProperty("value.deserializer", "org.apache.kafka.common.serialization.StringDeserializer");
props.setProperty("group.id", "test-group");
KafkaConsumer<String,String> consumer = new KafkaConsumer<>(props);
/*List<String> topicList = new ArrayList<>();
topicList.add("my-topic");
consumer.subscribe(topicList);*/
List<TopicPartition> partitionList = new ArrayList<>();
int partitionNumber = Integer.parseInt(args[0]);
partitionList.add(new TopicPartition("new-topic", partitionNumber));
consumer.assign(partitionList);
//consumer.seek(partition, 2);
System.out.println("Assigned to message topic");
while(true) {
ConsumerRecords<String, String> records = consumer.poll(Duration.ofSeconds(3));
for(ConsumerRecord<String,String> record: records) {
System.out.println("Message received with Key "+record.key()+" and value "+record.value()+" par "+record.partition());
}
}
}
}
| [
"Administrator@DESKTOP-UPRT1D1"
] | Administrator@DESKTOP-UPRT1D1 |
689cccdf9585d498273c4c490cef5f504f1a68d5 | 8724cb8764d3015ddb9b7d11fea325c06f6684c4 | /bitcoin-wallet/src/main/java/com/blackjade/wallet/BitcoinWalletApplication.java | f23fcf73aebf9a4b123084fff740fe981a0c890d | [] | no_license | hexiuya/bitcoinj-0.14.7 | 25bc39448bae072e0bd9ce1c355b03356f48bc37 | b931e1fddc3dfefbca8568824a43bb5719b6f7d1 | refs/heads/master | 2020-03-28T01:08:48.854368 | 2018-10-25T03:50:38 | 2018-10-25T03:50:38 | 147,480,679 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,491 | java | package com.blackjade.wallet;
import com.alibaba.druid.pool.DruidDataSource;
import com.blackjade.wallet.controller.MainController;
import com.blackjade.wallet.controller.SendBtcThread;
import com.blackjade.wallet.controller.WalletSetPasswordController;
import com.blackjade.wallet.utils.BitcoinModel;
import com.google.common.util.concurrent.Service;
import javafx.application.Application;
import javafx.application.Platform;
import javafx.stage.Stage;
import org.bitcoinj.core.NetworkParameters;
import org.bitcoinj.kits.WalletAppKit;
import org.bitcoinj.params.MainNetParams;
import org.bitcoinj.params.RegTestParams;
import org.bitcoinj.params.TestNet3Params;
import org.bitcoinj.utils.BriefLogFormatter;
import org.bitcoinj.wallet.DeterministicSeed;
import org.mybatis.spring.annotation.MapperScan;
import org.myutils.util.MybatisUtil;
import org.myutils.util.WebTools;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;
import javax.annotation.Nullable;
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import java.io.File;
import java.io.IOException;
@SpringBootApplication
@MapperScan("com.blackjade.wallet.dao")
@EnableDiscoveryClient
public class BitcoinWalletApplication extends Application {
private static final Logger log = LoggerFactory.getLogger(BitcoinWalletApplication.class);
// public static NetworkParameters params = MainNetParams.get();
public static NetworkParameters params = TestNet3Params.get();
// public static NetworkParameters params = RegTestParams.get();
public static final String APP_NAME = "SimpleWallet";
private static final String WALLET_FILE_NAME = APP_NAME.replaceAll("[^a-zA-Z0-9.-]", "_") + "-"
+ params.getPaymentProtocolId();
public static WalletAppKit bitcoin;
public MainController controller = new MainController();
public static BitcoinWalletApplication instance;
public static ApplicationContext applicationContext;
@Value("${btc-environment}")
public String btcEnvironment;
public static void main(String[] args) {
// 启动web
ApplicationContext ctx = SpringApplication.run(BitcoinWalletApplication.class, args);
applicationContext = ctx;
//启动线程
SendBtcThread sendBtcThread = new SendBtcThread();
sendBtcThread.start();
// 传输applicationContext到调用的包
// WebTools.setApplicationContext(applicationContext);
// 初始化restTemplate到调用的包
RestTemplate restTemplateParam = (RestTemplate) applicationContext.getBean("initRestTemplate");
WebTools.setRestTemplate(restTemplateParam);
// 初始化druidDataSource到调用的包
DruidDataSource druidDataSource = (DruidDataSource) applicationContext.getBean("dataSource");
MybatisUtil.setDataSource(druidDataSource);
// 启动wallet
launch(args);
}
private void realStart() throws IOException {
// 初始化待确认map
BitcoinModel.initVerifyingTx();
instance = this;
// Make log output concise.
BriefLogFormatter.init();
// Create the app kit. It won't do any heavyweight initialization until after we realStart it.
setupWalletKit(null);
if (bitcoin.isChainFileLocked()) {
log.info("Already running", "This application is already running and cannot be started twice.");
Platform.exit();
return;
}
WalletSetPasswordController.estimateKeyDerivationTimeMsec();
bitcoin.addListener(new Service.Listener() {
@Override
public void failed(Service.State from, Throwable failure) {
log.error(failure.getMessage(),failure);
}
}, Platform::runLater);
bitcoin.startAsync();
// 触发"Shortcut+F"时,停止下载节点
// scene.getAccelerators().put(KeyCombination.valueOf("Shortcut+F"), () -> bitcoin.peerGroup().getDownloadPeer().close());
}
public void setupWalletKit(@Nullable DeterministicSeed seed) {
// If seed is non-null it means we are restoring from backup.
bitcoin = new WalletAppKit(params, new File("./data/"), WALLET_FILE_NAME) {
@Override
protected void onSetupCompleted() {
// Don't make the user wait for confirmations for now, as the intention is they're sending it
// their own money!
bitcoin.wallet().allowSpendingUnconfirmedTransactions();
Platform.runLater(controller::onBitcoinSetup);
}
};
// Now configure and realStart the appkit. This will take a second or two - we could show a temporary splash screen
// or progress widget to keep the user engaged whilst we initialise, but we don't.
if (params == RegTestParams.get()) {
bitcoin.connectToLocalHost(); // You should run a regtest mode bitcoind locally.
} else if (params == TestNet3Params.get()) {
// As an example!
// bitcoin.useTor();
// bitcoin.setDiscovery(new HttpDiscovery(params, URI.create("http://localhost:8080/peers"), ECKey.fromPublicOnly(BaseEncoding.base16().decode("02cba68cfd0679d10b186288b75a59f9132b1b3e222f6332717cb8c4eb2040f940".toUpperCase()))));
}
bitcoin.setDownloadListener(controller.progressBarUpdater())
.setBlockingStartup(false)
.setUserAgent(APP_NAME, "1.0");
if (seed != null)
bitcoin.restoreWalletFromSeed(seed);
}
@PostConstruct
public void init(){
System.out.println("比特币连接的环境:"+btcEnvironment);
if ("test".equals(btcEnvironment)){
params = TestNet3Params.get();
}else if ("prod".equals(btcEnvironment)){
params = MainNetParams.get();
}
System.out.println("我被初始化了、、、、、我是用的@PostConstruct的方式、、、、、、");
}
@Override
public void start(Stage primaryStage) throws Exception {
realStart();
}
@Override
public void stop() throws Exception {
bitcoin.stopAsync();
bitcoin.awaitTerminated();
// Forcibly terminate the JVM because Orchid likes to spew non-daemon threads everywhere.
Runtime.getRuntime().exit(0);
}
@PreDestroy
public void destory() {
System.out.println("我被销毁了、、、、、我是用的@PreDestory的方式、、、、、、");
}
@Bean
@LoadBalanced
RestTemplate initRestTemplate() {
return new RestTemplate();
}
}
| [
"[email protected]"
] | |
78b4e3e3e49446e6490ac95b16381da0d2008b31 | a761aabe1761227e506282031b1221f9f3612c6f | /app/src/main/java/com/rrtutors/androidexoplayer/MainActivity.java | 0ead4846987e7c8eab11a1aa716218b37aaaff3b | [] | no_license | rrtutors/Exoplayer---Android | b2bf2fb9083601f0397e5e430aa4ca06b3e52407 | 37e971f571d47d345056472c6aa6ee73aeec053c | refs/heads/master | 2020-09-28T20:47:20.057298 | 2019-12-09T12:05:17 | 2019-12-09T12:05:17 | 226,861,627 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,606 | java | package com.rrtutors.androidexoplayer;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import android.content.pm.ActivityInfo;
import android.content.res.Configuration;
import android.net.Uri;
import android.os.Bundle;
import android.util.DisplayMetrics;
import android.view.View;
import android.view.WindowManager;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.DefaultLoadControl;
import com.google.android.exoplayer2.DefaultRenderersFactory;
import com.google.android.exoplayer2.ExoPlayerFactory;
import com.google.android.exoplayer2.SimpleExoPlayer;
import com.google.android.exoplayer2.offline.DownloadHelper;
import com.google.android.exoplayer2.source.ExtractorMediaSource;
import com.google.android.exoplayer2.source.MediaSource;
import com.google.android.exoplayer2.source.ProgressiveMediaSource;
import com.google.android.exoplayer2.source.SingleSampleMediaSource;
import com.google.android.exoplayer2.source.dash.DashMediaSource;
import com.google.android.exoplayer2.source.hls.HlsMediaSource;
import com.google.android.exoplayer2.source.smoothstreaming.SsMediaSource;
import com.google.android.exoplayer2.trackselection.DefaultTrackSelector;
import com.google.android.exoplayer2.ui.PlaybackControlView;
import com.google.android.exoplayer2.ui.PlayerView;
import com.google.android.exoplayer2.upstream.DataSource;
import com.google.android.exoplayer2.upstream.DefaultDataSourceFactory;
import com.google.android.exoplayer2.util.Util;
import java.util.Objects;
public class MainActivity extends AppCompatActivity {
PlayerView playerview;
DefaultTrackSelector trackselector;
DefaultLoadControl loadControl;
DefaultRenderersFactory defaultRenderersFactory;
SimpleExoPlayer exoPlayer;
DataSource.Factory dataSourceFactory;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
playerview=findViewById(R.id.playerview);
initializePlayer();
}
private void initializePlayer() {
trackselector = new DefaultTrackSelector();
loadControl = new DefaultLoadControl();
defaultRenderersFactory = new DefaultRenderersFactory(getApplicationContext());
exoPlayer = ExoPlayerFactory.newSimpleInstance(getApplicationContext(),
defaultRenderersFactory, trackselector, loadControl);
playerview.setPlayer(exoPlayer);
handlePlayBackControlls();
prepareMedia();
}
private void prepareMedia()
{
dataSourceFactory = new DefaultDataSourceFactory(getApplicationContext(),
Util.getUserAgent(getApplicationContext(), "Android Exoplayer"));
// This is the MediaSource representing the media to be played.
//MediaSource videoSource = new HlsMediaSource.Factory(dataSourceFactory).createMediaSource(Uri.parse("https://bitdash-a.akamaihd.net/content/MI201109210084_1/m3u8s/f08e80da-bf1d-4e3d-8899-f0f6155f6efa.m3u8"));
// Prepare the player with the source.
exoPlayer.prepare(buildMediaSource(Uri.parse("https://bitdash-a.akamaihd.net/content/MI201109210084_1/m3u8s/f08e80da-bf1d-4e3d-8899-f0f6155f6efa.m3u8")));
exoPlayer.setPlayWhenReady(true);
}
private void releasePlayer()
{
exoPlayer.stop();
exoPlayer.release();
}
@Override
protected void onPause() {
super.onPause();
releasePlayer();
}
@Override
protected void onStop() {
super.onStop();
releasePlayer();
}
private MediaSource buildMediaSource(Uri uri) {
return buildMediaSource(uri, null);
}
private MediaSource buildMediaSource(Uri uri, @Nullable String overrideExtension) {
@C.ContentType int type = Util.inferContentType(uri, overrideExtension);
switch (type) {
case C.TYPE_DASH:
return new DashMediaSource.Factory(dataSourceFactory).createMediaSource(uri);
case C.TYPE_SS:
return new SsMediaSource.Factory(dataSourceFactory).createMediaSource(uri);
case C.TYPE_HLS:
return new HlsMediaSource.Factory(dataSourceFactory).createMediaSource(uri);
case C.TYPE_OTHER:
return new ProgressiveMediaSource.Factory(dataSourceFactory).createMediaSource(uri);
default:
throw new IllegalStateException("Unsupported type: " + type);
}
}
private void handlePlayBackControlls()
{
playerview.requestFocus();
playerview.setLayoutParams(new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.MATCH_PARENT));
PlaybackControlView controlView = playerview.findViewById(R.id.exo_controller);
ImageView exo_full = controlView.findViewById(R.id.exo_full);
exo_full.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
int orientation = getResources().getConfiguration().orientation;
switch (orientation) {
case Configuration.ORIENTATION_LANDSCAPE:
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
break;
case Configuration.ORIENTATION_PORTRAIT:
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
break;
}
}
});
}
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) {
playerview.setLayoutParams(new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.MATCH_PARENT));
} else if (newConfig.orientation == Configuration.ORIENTATION_PORTRAIT) {
WindowManager wm = (WindowManager) getSystemService(WINDOW_SERVICE);
final DisplayMetrics displayMetrics = new DisplayMetrics();
Objects.requireNonNull(wm).getDefaultDisplay().getMetrics(displayMetrics);
int screenHeight = displayMetrics.heightPixels;
playerview.setLayoutParams(new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT,/*(int) convertDpToPixel(200f,getApplicationContext()*/screenHeight / 3));
}
}
}
| [
"[email protected]"
] | |
f999f2b17b7dc407a322baa13630cabcfeb10383 | 74781f596473dfd80e33d6c1fc4d19b4dc0409aa | /src/domain/DomainConsumer.java | c5d0c5210d2f81af9deb030b99de8be4ffb1f975 | [] | no_license | junknet/domain_hunter_pro | 6b2e44fc8825d15f1df6e42ec58787f738f53589 | c48afc85e4c5973a88121a3891ab519b73c58c3b | refs/heads/master | 2023-08-16T23:30:24.783173 | 2021-09-27T10:40:39 | 2021-09-27T10:40:39 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,865 | java | package domain;
import burp.BurpExtender;
import java.util.HashSet;
import java.util.Random;
import java.util.Set;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.CopyOnWriteArraySet;
//负责将收集的域名信息写入数据库
public class DomainConsumer extends Thread {
private int threadNo;
private volatile boolean stopflag;
public DomainConsumer(int threadNo) {
stopflag= false;
}
public void stopThread() {
stopflag = true;
}
@Override
public void run() {
while(true){
if (stopflag) {
break;
}
try {
QueueToResult();
int min=3;
int max=5;
Random random = new Random();
int minute = random.nextInt(max-min+1) + min;
sleep(minute*60*1000);
} catch (Exception error) {
error.printStackTrace(BurpExtender.getStderr());
}
}
}
/*
使用这种方法从Queue中取数据,一来避免了主动clear的操作,二来避免在使用数据后,clear操作之前加进来的数据的丢失。
*/
public static void moveQueueToSet(BlockingQueue<String> queue, Set<String> resultSet){
while (!queue.isEmpty()){
try {
String item = queue.take();
resultSet.add(item);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
public static void QueueToResult() {
//HashSet<String> oldSubdomains = new HashSet<String>();
CopyOnWriteArraySet<String> oldSubdomains = new CopyOnWriteArraySet<String>();
//java.util.ConcurrentModificationException 可能同时有其他线程在向subDomainSet中写数据,导致的这个错误。
//http://ifeve.com/java-copy-on-write/
//https://www.jianshu.com/p/c5b52927a61a
DomainManager result= DomainPanel.getDomainResult();
if (result != null) {
oldSubdomains.addAll(result.getSubDomainSet());
moveQueueToSet(BurpExtender.subDomainQueue,result.getSubDomainSet());//所有子域名还是都存在里面的,至少新发现的又单独存了一份,所以SubDomainSet一直都是最全的。
moveQueueToSet(BurpExtender.similarDomainQueue,result.getSimilarDomainSet());
moveQueueToSet(BurpExtender.relatedDomainQueue,result.getRelatedDomainSet());
moveQueueToSet(BurpExtender.emailQueue,result.getEmailSet());
moveQueueToSet(BurpExtender.packageNameQueue,result.getPackageNameSet());
HashSet<String> newSubdomains = new HashSet<String>();
newSubdomains.addAll(result.getSubDomainSet());
newSubdomains.removeAll(oldSubdomains);
result.getNewAndNotGetTitleDomainSet().addAll(newSubdomains);
if (newSubdomains.size()>0){
BurpExtender.getStdout().println(String.format("~~~~~~~~~~~~~%s subdomains added!~~~~~~~~~~~~~",newSubdomains.size()));
BurpExtender.getStdout().println(String.join(System.lineSeparator(), newSubdomains));
DomainPanel.autoSave();//进行一次主动保存
}
}
}
public static void main(String[] args) {
}
} | [
"[email protected]"
] | |
d1ffac7b945b3bf273d30497d2b626eda6631807 | 9756815dbd3c6e972db141f0a47f424adc3c10ce | /src/main/java/com/streetbuzz/microservices/utils/NamingServer.java | d57bd05b2e84c21d791fb3aeaacb32b0f267854a | [] | no_license | soumik-dutta/microservices | 2d1b9ae0370f3ff37a7aeb1ecac6395080e2dc83 | 56eaa63ee73c0a5dc11d2a36c7b3a3905b833050 | refs/heads/master | 2021-01-20T21:40:55.211460 | 2018-05-05T12:34:01 | 2018-05-05T12:34:01 | 101,778,525 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 570 | java | package com.streetbuzz.microservices.utils;
/**
* Naming server for microservices
* Created by duttas16 on 7/3/2017.
*/
public interface NamingServer {
//
public static final String BLOG_SERVICE_URL = "http://BLOG-SERVICE";
public static final String SOCIALMEDIA_SERVICE_URL = "http://SOCIAL-SERVICE";
public static final String INTERNAL_SERVICE_URL = "http://INTERNAL-SERVICE";
public static final String EXTERNAL_SERVICE_URL = "http://EXTERNAL-SERVICE";
public static final String REGISTRATION_SERVICE_URL = "http://INTERNAL-SERVICE";
}
| [
"[email protected]"
] | |
c0b43221b90f4dd64857ea114157312755a81717 | 4c076f94ab695a23aa342a9b12eefdcd8515b61d | /src/test/java/net/lliira/leetcode/r451/P453MinMoveTest.java | 9c45ce8a9067459952599ff981d97de94574f239 | [] | no_license | jerric/lliira-leetcode | 091948f753a7b9cd443748544a166ade49ee5071 | ce79c2bd6521886d36bd5b82ef6092572a74c2c8 | refs/heads/master | 2021-01-13T11:40:58.775775 | 2017-03-05T23:02:55 | 2017-03-05T23:02:55 | 77,765,989 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 572 | java | package net.lliira.leetcode.r451;
import net.lliira.leetcode.ListNode;
import org.testng.Assert;
import org.testng.annotations.Test;
import static net.lliira.leetcode.TestHelper.*;
/**
* Created by Jerric on 1/25/2017.
*/
public class P453MinMoveTest {
private final P453MinMove solution = new P453MinMove();
@Test
public void tests() {
test(new int[]{1,2,3}, 3);
}
private void test(final int[] input, final int expected) {
final int result = this.solution.minMoves(input);
Assert.assertEquals(result, expected);
}
} | [
"[email protected]"
] | |
b37c80de2bae6e2f34c480ea42cb84eb409c1dc0 | 04d9f6cfa2fd78283990a3936079c4bdcc8223f6 | /src/test/java/ioFundamentals/mainTask/analyzers/PathAnalyzer.java | ba7657651ae35b62db9f575b070e47f66f2b7a3d | [] | no_license | slask1807/EPAM2IOMain | 5c6729cd07c6877c284ee1a9f3a67c64f82a071c | e9bea5e62aa32e0cbe31428ab1dd5421fbec95c3 | refs/heads/master | 2023-06-28T14:09:22.143550 | 2020-06-10T19:27:35 | 2020-06-10T19:27:35 | 392,784,868 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,439 | java | package ioFundamentals.mainTask.analyzers;
import ioFundamentals.mainTask.fileStructureEntities.DirectoryHierarchy;
import ioFundamentals.mainTask.fileStructureEntities.DirectoryHierarchyItem;
import java.io.File;
import java.util.List;
import java.util.stream.Collectors;
public class PathAnalyzer {
private static final int PARENT_NESTING_LEVEL = 0;
public static String getParentPath(String fileName) {
return new File(fileName).getParent() + File.separator;
}
public static String getParentPath(DirectoryHierarchy directoryHierarchy, Integer nestingLevel) {
String parentPath = "";
if (nestingLevel == PARENT_NESTING_LEVEL) {
parentPath = directoryHierarchy.PARENT_PATH;
} else if (nestingLevel > PARENT_NESTING_LEVEL) {
int previousNestedLevel = nestingLevel - 1;
List<DirectoryHierarchyItem> parentItems = directoryHierarchy.stream().
filter(item -> (item.getNestedLevel() == previousNestedLevel) && (item.getFile().isDirectory())).
collect(Collectors.toList());
if (!parentItems.isEmpty()) {
int lastItemIndex = parentItems.size() - 1;
DirectoryHierarchyItem parentDirectory = parentItems.get(lastItemIndex);
parentPath = parentDirectory.getFile().getAbsolutePath() + File.separator;
}
}
return parentPath;
}
}
| [
"[email protected]"
] | |
9faf7c2b05cb4cb5ecf717665d27146b4e365900 | 5d76b555a3614ab0f156bcad357e45c94d121e2d | /src-v3/com/crumby/impl/danbooru/DanbooruPoolGalleryProducer.java | 338be4f6bf0e77c51c8d0b428363c0d9cefcef0c | [] | no_license | BinSlashBash/xcrumby | 8e09282387e2e82d12957d22fa1bb0322f6e6227 | 5b8b1cc8537ae1cfb59448d37b6efca01dded347 | refs/heads/master | 2016-09-01T05:58:46.144411 | 2016-02-15T13:23:25 | 2016-02-15T13:23:25 | 51,755,603 | 5 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,597 | java | package com.crumby.impl.danbooru;
import com.crumby.impl.crumby.UnsupportedUrlFragment;
import com.crumby.lib.GalleryImage;
import com.crumby.lib.fragment.producer.GalleryProducer;
import com.google.gson.JsonObject;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
public class DanbooruPoolGalleryProducer extends DanbooruGalleryProducer {
private String poolId;
protected GalleryImage getGalleryImage(JsonObject galleryImageObj) {
GalleryImage image = super.getGalleryImage(galleryImageObj);
image.setLinkUrl(deriveUrl(galleryImageObj.get("id"), "/posts/") + "?pool_id=" + this.poolId);
image.setImageUrl(deriveUrl(galleryImageObj.get("large_file_url"), UnsupportedUrlFragment.DISPLAY_NAME));
return image;
}
protected boolean fetchMetadata() throws IOException {
if (getHostImage().getTitle() != null || getHostImage().getDescription() != null) {
return false;
}
getHostImage().copy(DanbooruPoolProducer.getGalleryImage(JSON_PARSER.parse(GalleryProducer.fetchUrl("http://danbooru.donmai.us/pools/" + this.poolId + ".json")).getAsJsonObject()));
return true;
}
public URL convertUrlToApi(String url) {
String apiUrlString = DanbooruGalleryProducer.API_URL;
this.poolId = DanbooruPoolGalleryFragment.matchIdFromUrl(url.toString());
try {
return new URL(apiUrlString + "tags=pool:" + this.poolId);
} catch (MalformedURLException e) {
e.printStackTrace();
return null;
}
}
}
| [
"[email protected]"
] | |
eed8beb0369b8ff80a891419535831e3d6d97a15 | 9539aaca2bb6fe33653178f82fc7ebbdf38862eb | /src/MedianFinder.java | 02dc97531673b8ffe34fe4a278b000132273e042 | [] | no_license | wihoho/LeetCode | 53d9cab31c70c859a53c474fbcb1f353eaad6b67 | 6d7d05b42f11b4626df3fd3df98cc7668ded0d8a | refs/heads/master | 2020-12-24T06:03:44.232709 | 2016-07-25T12:05:12 | 2016-07-25T12:05:12 | 17,285,658 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,179 | java | import java.util.PriorityQueue;
public class MedianFinder {
PriorityQueue<Integer> maxHeap;
PriorityQueue<Integer> minHeap;
public MedianFinder() {
maxHeap = new PriorityQueue<>((a, b) -> {
return -a.compareTo(b);
});
minHeap = new PriorityQueue<>((a, b) -> {
return a.compareTo(b);
});
}
// Adds a number into the data structure.
public void addNum(int num) {
if (maxHeap.isEmpty()) {
maxHeap.add(num);
return;
}
int m = maxHeap.peek();
if (minHeap.isEmpty()) {
if (num < m) {
minHeap.add(maxHeap.poll());
maxHeap.add(num);
} else {
minHeap.add(num);
}
return;
}
int n = minHeap.peek();
if (num <= m) {
if (maxHeap.size() > minHeap.size()) {
maxHeap.poll();
maxHeap.add(num);
minHeap.add(m);
} else {
maxHeap.add(num);
}
} else if (num <= n) {
if (maxHeap.size() > minHeap.size()) {
minHeap.add(num);
} else {
maxHeap.add(num);
}
} else {
if (maxHeap.size() > minHeap.size()) {
minHeap.add(num);
} else {
maxHeap.add(minHeap.poll());
minHeap.add(num);
}
}
}
// Returns the median of current data stream
public double findMedian() {
if (maxHeap.size() > minHeap.size()) {
return maxHeap.peek();
} else {
int m = maxHeap.peek();
int n = minHeap.peek();
return (m + n) / 2.0;
}
}
public static void main(String[] args) {
MedianFinder medianFinder = new MedianFinder();
medianFinder.addNum(1);
System.out.println(medianFinder.findMedian());
medianFinder.addNum(2);
System.out.println(medianFinder.findMedian());
medianFinder.addNum(3);
System.out.println(medianFinder.findMedian());
}
}; | [
"[email protected]"
] | |
8b3e49f3b3e0d48db370f5df84789c8c96610781 | 558eea3653bb213a28ae9188f4bce56ca9113a28 | /commons-data/commons-data-base/src/main/java/cn/newphy/data/domain/PageRequest.java | 59119cd90fad26fa1b53336bd5f5218a441ab2c3 | [] | no_license | Newphy/newphy-commons | 12802906563d517ad680262fb40de1a097d71baa | 1422dd29b571c694bcc158271460fc7216c499cc | refs/heads/master | 2020-05-22T02:45:03.577060 | 2017-02-13T03:42:30 | 2017-02-13T03:42:30 | 62,269,506 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,200 | java | package cn.newphy.data.domain;
import java.io.Serializable;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.Map;
public class PageRequest implements Pageable, Serializable {
private static final long serialVersionUID = -4541509938956089562L;
private final int page;
private final int size;
private Sort sort;
private final PageMode pageMode;
private final Map<String, Object> paramMap = new LinkedHashMap<>();
public PageRequest(int page, int size) {
this(page, size, PageMode.TOTAL);
}
public PageRequest(int page, int size, PageMode pageMode) {
this(page, size, null, pageMode);
}
public PageRequest(int page, int size, Sort sort, PageMode pageMode) {
if (page < 0) {
throw new IllegalArgumentException("Page index must not be less than zero!");
}
if (size < 1) {
throw new IllegalArgumentException("Page size must not be less than one!");
}
this.sort = sort;
this.page = page;
this.size = size;
this.pageMode = pageMode;
}
@Override
public PageMode getPageMode() {
return this.pageMode;
}
@Override
public void setSort(Sort sort) {
this.sort = sort;
}
@Override
public Sort getSort() {
return sort;
}
@Override
public Pageable getNext() {
PageRequest next = new PageRequest(getPageNumber() + 1, getPageSize(), getSort(), getPageMode());
next.paramMap.putAll(this.paramMap);
return next;
}
public Pageable getPrevious() {
if(getPageNumber() == 0) {
return this;
} else {
PageRequest previous = new PageRequest(getPageNumber() - 1, getPageSize(), getSort(), getPageMode());
previous.paramMap.putAll(this.paramMap);
return previous;
}
}
@Override
public Pageable getFirst() {
PageRequest first = new PageRequest(0, getPageSize(), getSort(), getPageMode());
first.paramMap.putAll(this.paramMap);
return first;
}
@Override
public int getPageSize() {
return size;
}
@Override
public int getPageNumber() {
return page;
}
@Override
public int getOffset() {
return Math.max(0, (page-1) * size);
}
@Override
public boolean isHasPrevious() {
return page > 0;
}
public Pageable getPreviousOrFirst() {
return isHasPrevious() ? getPrevious() : getFirst();
}
@Override
public void addParameter(String key, Object value) {
this.paramMap.put(key, value);
}
@Override
public void addParameters(Map<String, ?> paramMap) {
this.paramMap.putAll(paramMap);
}
@Override
public Map<String, Object> getParamMap() {
return Collections.unmodifiableMap(paramMap);
}
@Override
public void orderBy(Direction direction, String property) {
this.sort = new Sort(direction, property).and(this.sort);
}
@Override
public void orderAsc(String property) {
orderBy(Direction.ASC, property);
}
@Override
public void orderDesc(String property) {
orderBy(Direction.DESC, property);
}
@Override
public String toString() {
return String.format("Page request [number: %d, size %d, sort: %s]", getPageNumber(), getPageSize(),
sort == null ? null : sort.toString());
}
}
| [
"[email protected]"
] | |
53900a47610dfe4504e608d26bb0acafae486626 | 2bdedcda705f6dcf45a1e9a090377f892bcb58bb | /src/main/output/school_reason_body/place/question_kind/man/guy_study/power_information.java | ce8c9fe3e34ac29d8b4737264e59e7342c67338f | [] | no_license | matkosoric/GenericNameTesting | 860a22af1098dda9ea9e24a1fc681bb728aa2d69 | 03f4a38229c28bc6d83258e5a84fce4b189d5f00 | refs/heads/master | 2021-01-08T22:35:20.022350 | 2020-02-21T11:28:21 | 2020-02-21T11:28:21 | 242,123,053 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,564 | java | 'use strict';
let https = require ('https');
// **********************************************
// *** Update or verify the following values. ***
// **********************************************
// Replace the subscriptionKey string value with your valid subscription key.
let subscriptionKey = '8851d7fd8f883f8ef9b37856cc77dba0';
let host = 'api.microsofttranslator.com';
let path = '/V2/Http.svc/TranslateArray';
let target = 'fr-fr';
let params = '';
let ns = "http://schemas.microsoft.com/2003/10/Serialization/Arrays";
let content =
'<TranslateArrayRequest>\n' +
// NOTE: AppId is required, but it can be empty because we are sending the Ocp-Apim-Subscription-Key header.
' <AppId />\n' +
' <Texts>\n' +
' <string xmlns=\"' + ns + '\">Hello</string>\n' +
' <string xmlns=\"' + ns + '\">Goodbye</string>\n' +
' </Texts>\n' +
' <To>' + target + '</To>\n' +
'</TranslateArrayRequest>\n';
let response_handler = function (response) {
let body = '';
response.on ('data', function (d) {
body += d;
});
response.on ('end', function () {
console.log (body);
});
response.on ('error', function (e) {
console.log ('Error: ' + e.message);
});
};
let TranslateArray = function () {
let request_params = {
method : 'POST',
hostname : host,
path : path + params,
headers : {
'Content-Type' : 'text/xml',
'c83332e0760008ee4ff91f6dd4722b0d' : subscriptionKey,
}
};
let req = https.request (request_params, response_handler);
req.write (content);
req.end ();
}
TranslateArray ();
| [
"[email protected]"
] | |
117fc8d2eef9a44a36f3ed7a5f52ff20e10e2686 | c4eeb8a08544d27a58c15b92b6a338763cffdda7 | /Object Oriented Programming/File Copier/NumberCopier.java | fda612398892b39f5cad27933a235989bd9e6974 | [] | no_license | giodude074/Academic-Work | d5fff285143a68559eef941177eae218cd504047 | 06b5aa2ee17e48dd278c397fa12fd5fee12496ba | refs/heads/master | 2021-08-31T23:01:31.599389 | 2017-12-23T08:59:38 | 2017-12-23T08:59:38 | 113,622,436 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 728 | java | package copierMidtermPrac;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Scanner;
public class NumberCopier extends FileCopier {
public NumberCopier(){
super();
}
@Override
public void copy(String fromtextfilepath, String totextfilepath)
throws FileNotFoundException {
File fromFile = new File(fromtextfilepath);
File toFile = new File(totextfilepath);
Scanner input = new Scanner(fromFile);
PrintWriter output = new PrintWriter(toFile);
while(input.hasNextLine()){
String next = input.nextLine();
next = next.replaceAll("[^0-9]", "");
output.println(next);
}
output.close();
}
} | [
"Gio G"
] | Gio G |
ad92a495695fa61133a177026789739be6fd9d99 | f21d8ac100839a04e26a0cb480a58ef7d5627dba | /spaghetti-api/src/main/java/com/prezi/spaghetti/ast/ExternInterfaceNode.java | c736650210c9700de8e3b96f0b6d1ff6b7c18783 | [
"Apache-2.0"
] | permissive | prezi/spaghetti | 0ecd8941d4cb7a8139094173034e753b9872fd0a | 5caac436563eb18fad7e6bab83f3d2cc98713a8a | refs/heads/master | 2023-05-15T08:25:14.685827 | 2023-04-27T07:29:15 | 2023-04-27T07:29:15 | 14,537,911 | 17 | 4 | NOASSERTION | 2023-09-05T12:08:32 | 2013-11-19T21:03:48 | Java | UTF-8 | Java | false | false | 117 | java | package com.prezi.spaghetti.ast;
public interface ExternInterfaceNode extends ExternTypeNode, InterfaceNodeBase {
}
| [
"[email protected]"
] | |
ac9a784d560d2739362409e0b308740c28bf8305 | 160c7dad71a91acc9e42a2bdb17df77747c6e6f0 | /②JAVA基础/JAVA-11.24数组/第三组/李佳康11.24/ST4.java | 6df316696161fa628f4fa8c70b4a2042d43ab6b6 | [] | no_license | qhit2017/GR1704_01 | 67ca82404422a9030ace96f10b76fdd150df0ede | e853df54fc91b819bd34c65382dd93f78a80c85e | refs/heads/master | 2021-09-05T00:57:49.269368 | 2018-01-23T06:26:43 | 2018-01-23T06:26:43 | 109,151,648 | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 550 | java | //4 定义一个整型数组{5,9,12,45,18,30},要求打印出数组中所有元素之和,并打印出最大值和最小值。
public class ST4 {
public static void main(String[] args) {
int x[]={5,9,12,45,18,30};
int sum = 0;
for(int i = 0;i<x.length;i++){
sum=sum+x[i];
}
System.out.println(sum);
int max=x[0];
int min=x[0];
for(int i = 1;i<x.length;i++){
if(max<x[i]){
max=x[i];
}
if(min>x[i]){
min=x[i];
}
}
System.out.println("最大值为:"+max+"\n最小值为:"+min);
}
}
| [
"[email protected]"
] | |
4bfc89c28efd199a27527d38234c20cd121637f4 | d04a294f0452f5b564855886cfef63b6d76f1a3c | /Algorithms/DynamicProgramming/Floyd_ShortestPath.java | 5a4db652990c21fb481de8f8fa1721e0da7648ba | [] | no_license | anshi31jagrawal/Algorithms-and-Data-Structures | 2eb967dbf0d866588f7716089c388870cdc2d5cd | 736307b18740cee233142ee40a204f6a7736d29e | refs/heads/master | 2021-01-11T21:22:30.843511 | 2017-01-12T18:26:19 | 2017-01-12T18:26:19 | 78,774,288 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 559 | java |
public class Floyd_ShortestPath {
final static int max = 100000;
static int[][] matrix = {{0,8,5},{3,0,max},{max,2,0}};
static int n = matrix.length;
public static void main(String[] args) {
for(int del=0;del<n;del++)
{
for(int i=0;i<n;i++)
{
for(int j=0;j<n;j++)
{
matrix[i][j] = Math.min(matrix[i][j], matrix[i][del]+matrix[del][j]);
}
}
}
for(int i=0;i<n;i++)
{
System.out.println();
for(int j=0;j<n;j++)
System.out.print(((matrix[i][j]==max)?"inf":matrix[i][j])+" ");
}
}
}
| [
"[email protected]"
] | |
cb3e6e5afb8ff0928824dddec15765dc4de150c1 | 7fe9ca53ee2af7f34ca81e6ae384fc8a92d89c69 | /src/main/java/org/jetlinks/core/codec/defaults/DeviceMessageCodec.java | 8a1a9581449f47f92cdd71717ede1e309c991f43 | [] | no_license | zhitom/jetlinks-core | 4ec7c0a7b70de512af122534f86df7a021ebc3c4 | 407b8ac9f5b475a9d43af52bd16269451f2330d2 | refs/heads/master | 2022-12-05T03:49:58.410497 | 2020-07-10T07:12:24 | 2020-07-10T07:12:24 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,182 | java | package org.jetlinks.core.codec.defaults;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import io.netty.buffer.Unpooled;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import org.jetlinks.core.Payload;
import org.jetlinks.core.codec.Codec;
import org.jetlinks.core.message.DeviceMessage;
import org.jetlinks.core.message.MessageType;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class DeviceMessageCodec implements Codec<DeviceMessage> {
public static DeviceMessageCodec INSTANCE = new DeviceMessageCodec();
@Nullable
@Override
public DeviceMessage decode(@Nonnull Payload payload) {
JSONObject json = JSON.parseObject(payload.bodyAsString());
return MessageType
.convertMessage(json)
.map(DeviceMessage.class::cast)
.orElseThrow(() -> new UnsupportedOperationException("unsupport device message : " + json));
}
@Override
public Payload encode(DeviceMessage body) {
return Payload.of(Unpooled.wrappedBuffer(body.toJson().toJSONString().getBytes()));
}
}
| [
"[email protected]"
] | |
0826c7ebf4e939b865b2b72d0a348a75086635e2 | f3b387157485817ff83b7b9aec112b183becd8a4 | /Chapter.8/areaTest.java | 96631448e04adb20be173d136444cef7b56677c1 | [] | no_license | BlueTeche/JAVA222 | 7428495997a6ae8caee415ae33426e5210cc0d85 | 31ab7b5fea6f94bcc0b75877a891912caf44191a | refs/heads/master | 2020-05-31T10:34:14.336009 | 2019-06-04T16:48:58 | 2019-06-04T16:48:58 | 190,243,254 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 711 | java | import java.util.Scanner;
public class areaTest{
public static void main(String[] args){
int wd, le;
double ra, ra1, hei;
Scanner in = new Scanner(System.in);
area ob = new area();
System.out.print("Enter a radius for area of circle :");
ra = in.nextDouble();
System.out.print("Enter a width and length for area of rectangle:");
wd = in.nextInt();
le = in.nextInt();
System.out.print("Enter a radius and height for area of cylinder:");
ra1 = in.nextDouble();
hei = in.nextDouble();
System.out.println("The area of circle is " + ob.area(ra));
System.out.println("The area of rectangle is " + ob.area(wd, le));
System.out.println("The area of cylinder is " + ob.area(ra1, hei));
}
} | [
"[email protected]"
] | |
7956d4bf57a19b0121d552f78d6fdde498553134 | 4a792164bb48551ca85fff85848ef10ec1cdd24f | /src/test/java/Chapter5/DecorateTest.java | 1f0020cf89cd17afa826575774d068896a05d60d | [] | no_license | JakoetTH/Chapter5 | aa0cc8daf3965f4ee5596a05b0cb393f20eed1ca | f4dd6198f9c2d0e9f14d849a2d61936cf683fedc | refs/heads/master | 2016-09-01T18:13:54.629559 | 2015-03-13T21:22:36 | 2015-03-13T21:22:36 | 32,147,745 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 783 | java | package Chapter5;
import Chapter5.Config.SpringConfig;
import Chapter5.Impl.Decorator.ColourAeroplane;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
public class DecorateTest {
private ApplicationContext ctx;
private ColourAeroplane flight;
@Before
public void setUp()
{
ctx = new AnnotationConfigApplicationContext(SpringConfig.class);
flight = (ColourAeroplane)ctx.getBean("DecorateBean");
}
@Test
public void testDecorate()
{
Assert.assertEquals("Purple",flight.Colour());
}
@After
public void tearDown()
{
}
} | [
"[email protected]"
] | |
c68dfaefb2c913030337332b59cc0f53a66f4048 | be73270af6be0a811bca4f1710dc6a038e4a8fd2 | /crash-reproduction-moho/results/XWIKI-12667-8-1-PESA_II-WeightedSum:TestLen:CallDiversity/com/xpn/xwiki/web/DownloadAction_ESTest_scaffolding.java | b3c8e3cdc54b48dd4cf7ba826de15ab5405243e9 | [] | no_license | STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application | cf118b23ecb87a8bf59643e42f7556b521d1f754 | 3bb39683f9c343b8ec94890a00b8f260d158dfe3 | refs/heads/master | 2022-07-29T14:44:00.774547 | 2020-08-10T15:14:49 | 2020-08-10T15:14:49 | 285,804,495 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 436 | java | /**
* Scaffolding file used to store all the setups needed to run
* tests automatically generated by EvoSuite
* Thu Apr 02 14:43:16 UTC 2020
*/
package com.xpn.xwiki.web;
import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
import org.junit.BeforeClass;
import org.junit.Before;
import org.junit.After;
@EvoSuiteClassExclude
public class DownloadAction_ESTest_scaffolding {
// Empty scaffolding for empty test suite
}
| [
"[email protected]"
] | |
e284a7fb5970b766c0337fc8d98259bff315d576 | 8ef2cecd392f43cc670ae8c6f149be6d71d737ba | /src/com/google/android/gms/internal/d$a.java | 243b5444d930d7349859cb939f73f4cfde91f6c1 | [] | no_license | NBchitu/AngelEyes2 | 28e563380be6dcf5ba5398770d66ebeb924a033b | afea424b70597c7498e9c6da49bcc7b140a383f7 | refs/heads/master | 2021-01-16T18:30:51.913292 | 2015-02-15T07:30:00 | 2015-02-15T07:30:00 | 30,744,510 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,441 | java | package com.google.android.gms.internal;
public final class d$a
extends qq<a>
{
private static volatile a[] o;
public int a;
public String b;
public a[] c;
public a[] d;
public a[] e;
public String f;
public String g;
public long h;
public boolean i;
public a[] j;
public int[] k;
public boolean l;
public d$a()
{
b();
}
public static a[] a()
{
if (o == null) {}
synchronized (qu.a)
{
if (o == null) {
o = new a[0];
}
return o;
}
}
public void a(qp paramqp)
{
paramqp.a(1, this.a);
if (!this.b.equals("")) {
paramqp.a(2, this.b);
}
if ((this.c != null) && (this.c.length > 0)) {
for (int i4 = 0; i4 < this.c.length; i4++)
{
a locala4 = this.c[i4];
if (locala4 != null) {
paramqp.a(3, locala4);
}
}
}
if ((this.d != null) && (this.d.length > 0)) {
for (int i3 = 0; i3 < this.d.length; i3++)
{
a locala3 = this.d[i3];
if (locala3 != null) {
paramqp.a(4, locala3);
}
}
}
if ((this.e != null) && (this.e.length > 0)) {
for (int i2 = 0; i2 < this.e.length; i2++)
{
a locala2 = this.e[i2];
if (locala2 != null) {
paramqp.a(5, locala2);
}
}
}
if (!this.f.equals("")) {
paramqp.a(6, this.f);
}
if (!this.g.equals("")) {
paramqp.a(7, this.g);
}
if (this.h != 0L) {
paramqp.a(8, this.h);
}
if (this.l) {
paramqp.a(9, this.l);
}
if ((this.k != null) && (this.k.length > 0)) {
for (int i1 = 0; i1 < this.k.length; i1++) {
paramqp.a(10, this.k[i1]);
}
}
if (this.j != null)
{
int m = this.j.length;
int n = 0;
if (m > 0) {
while (n < this.j.length)
{
a locala1 = this.j[n];
if (locala1 != null) {
paramqp.a(11, locala1);
}
n++;
}
}
}
if (this.i) {
paramqp.a(12, this.i);
}
super.a(paramqp);
}
public a b()
{
this.a = 1;
this.b = "";
this.c = a();
this.d = a();
this.e = a();
this.f = "";
this.g = "";
this.h = 0L;
this.i = false;
this.j = a();
this.k = qz.a;
this.l = false;
this.m = null;
this.n = -1;
return this;
}
protected int c()
{
int m = super.c() + qp.b(1, this.a);
if (!this.b.equals("")) {
m += qp.b(2, this.b);
}
if ((this.c != null) && (this.c.length > 0))
{
int i8 = m;
for (int i9 = 0; i9 < this.c.length; i9++)
{
a locala4 = this.c[i9];
if (locala4 != null) {
i8 += qp.c(3, locala4);
}
}
m = i8;
}
if ((this.d != null) && (this.d.length > 0))
{
int i6 = m;
for (int i7 = 0; i7 < this.d.length; i7++)
{
a locala3 = this.d[i7];
if (locala3 != null) {
i6 += qp.c(4, locala3);
}
}
m = i6;
}
if ((this.e != null) && (this.e.length > 0))
{
int i4 = m;
for (int i5 = 0; i5 < this.e.length; i5++)
{
a locala2 = this.e[i5];
if (locala2 != null) {
i4 += qp.c(5, locala2);
}
}
m = i4;
}
if (!this.f.equals("")) {
m += qp.b(6, this.f);
}
if (!this.g.equals("")) {
m += qp.b(7, this.g);
}
if (this.h != 0L) {
m += qp.b(8, this.h);
}
if (this.l) {
m += qp.b(9, this.l);
}
if ((this.k != null) && (this.k.length > 0))
{
int i2 = 0;
int i3 = 0;
while (i2 < this.k.length)
{
i3 += qp.b(this.k[i2]);
i2++;
}
m = m + i3 + 1 * this.k.length;
}
if (this.j != null)
{
int n = this.j.length;
int i1 = 0;
if (n > 0) {
while (i1 < this.j.length)
{
a locala1 = this.j[i1];
if (locala1 != null) {
m += qp.c(11, locala1);
}
i1++;
}
}
}
if (this.i) {
m += qp.b(12, this.i);
}
return m;
}
public boolean equals(Object paramObject)
{
boolean bool2;
if (paramObject == this) {
bool2 = true;
}
a locala;
label69:
do
{
String str2;
do
{
boolean bool5;
do
{
boolean bool4;
do
{
boolean bool3;
do
{
String str3;
do
{
int m;
int n;
do
{
boolean bool1;
do
{
return bool2;
bool1 = paramObject instanceof a;
bool2 = false;
} while (!bool1);
locala = (a)paramObject;
m = this.a;
n = locala.a;
bool2 = false;
} while (m != n);
if (this.b != null) {
break;
}
str3 = locala.b;
bool2 = false;
} while (str3 != null);
bool3 = qu.a(this.c, locala.c);
bool2 = false;
} while (!bool3);
bool4 = qu.a(this.d, locala.d);
bool2 = false;
} while (!bool4);
bool5 = qu.a(this.e, locala.e);
bool2 = false;
} while (!bool5);
if (this.f != null) {
break label303;
}
str2 = locala.f;
bool2 = false;
} while (str2 != null);
if (this.g != null) {
break label320;
}
str1 = locala.g;
bool2 = false;
} while (str1 != null);
label153:
label303:
label320:
while (this.g.equals(locala.g))
{
String str1;
boolean bool6 = this.h < locala.h;
bool2 = false;
if (bool6) {
break;
}
boolean bool7 = this.i;
boolean bool8 = locala.i;
bool2 = false;
if (bool7 != bool8) {
break;
}
boolean bool9 = qu.a(this.j, locala.j);
bool2 = false;
if (!bool9) {
break;
}
boolean bool10 = qu.a(this.k, locala.k);
bool2 = false;
if (!bool10) {
break;
}
boolean bool11 = this.l;
boolean bool12 = locala.l;
bool2 = false;
if (bool11 != bool12) {
break;
}
return a(locala);
if (this.b.equals(locala.b)) {
break label69;
}
return false;
if (this.f.equals(locala.f)) {
break label153;
}
return false;
}
return false;
}
public int hashCode()
{
int m = 1231;
int n = 31 * (527 + this.a);
int i1;
int i3;
label76:
int i5;
label100:
int i7;
label137:
int i8;
if (this.b == null)
{
i1 = 0;
int i2 = 31 * (31 * (31 * (31 * (i1 + n) + qu.a(this.c)) + qu.a(this.d)) + qu.a(this.e));
if (this.f != null) {
break label200;
}
i3 = 0;
int i4 = 31 * (i3 + i2);
String str = this.g;
i5 = 0;
if (str != null) {
break label212;
}
int i6 = 31 * (31 * (i4 + i5) + (int)(this.h ^ this.h >>> 32));
if (!this.i) {
break label224;
}
i7 = m;
i8 = 31 * (31 * (31 * (i7 + i6) + qu.a(this.j)) + qu.a(this.k));
if (!this.l) {
break label232;
}
}
for (;;)
{
return 31 * (i8 + m) + d();
i1 = this.b.hashCode();
break;
label200:
i3 = this.f.hashCode();
break label76;
label212:
i5 = this.g.hashCode();
break label100;
label224:
i7 = 1237;
break label137;
label232:
m = 1237;
}
}
}
/* Location: C:\DISKD\fishfinder\apktool-install-windows-r05-ibot\classes_dex2jar.jar
* Qualified Name: com.google.android.gms.internal.d.a
* JD-Core Version: 0.7.0.1
*/ | [
"[email protected]"
] | |
4d133c7528f00fb04cc7ba84d536ece17326625c | 49ff804d67fa591a8ce4a91ff3f3f37141ba2101 | /Map_View/app/src/test/java/com/example/map_view/ExampleUnitTest.java | 868fbc6462cb985e4af608efc4fed11f80e76bf9 | [] | no_license | jarishing/Map_View_Testing | f384a7b6d4c87941b37bbe90297d9376da5537ac | 1063a163981308b08628fd27decf79e9b6c9497d | refs/heads/master | 2020-12-02T22:54:55.563456 | 2017-08-24T07:12:52 | 2017-08-24T07:12:52 | 96,201,842 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 398 | java | package com.example.map_view;
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);
}
} | [
"[email protected]"
] | |
aac932dd893c7e4886eacd0175ac264b1364d3b4 | fc160694094b89ab09e5c9a0f03db80437eabc93 | /java-automl/samples/snippets/generated/com/google/cloud/automl/v1/automl/getmodel/SyncGetModelString.java | fff01d5be8cf62aa36267e540a4165268ac7eb92 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | googleapis/google-cloud-java | 4f4d97a145e0310db142ecbc3340ce3a2a444e5e | 6e23c3a406e19af410a1a1dd0d0487329875040e | refs/heads/main | 2023-09-04T09:09:02.481897 | 2023-08-31T20:45:11 | 2023-08-31T20:45:11 | 26,181,278 | 1,122 | 685 | Apache-2.0 | 2023-09-13T21:21:23 | 2014-11-04T17:57:16 | Java | UTF-8 | Java | false | false | 1,702 | java | /*
* Copyright 2023 Google LLC
*
* 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.cloud.automl.v1.samples;
// [START automl_v1_generated_AutoMl_GetModel_String_sync]
import com.google.cloud.automl.v1.AutoMlClient;
import com.google.cloud.automl.v1.Model;
import com.google.cloud.automl.v1.ModelName;
public class SyncGetModelString {
public static void main(String[] args) throws Exception {
syncGetModelString();
}
public static void syncGetModelString() throws Exception {
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
String name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString();
Model response = autoMlClient.getModel(name);
}
}
}
// [END automl_v1_generated_AutoMl_GetModel_String_sync]
| [
"[email protected]"
] | |
2a39d2beffd37398bb7a76f59865e7c591871274 | 65db6e5babef86d8573b4dc36a14dfb5f439d550 | /src/test/java/project/FizzBuzzQixTest.java | 1d9c1fb2d7fd53359ae6c4d0396e18283f26fbfd | [] | no_license | bdahal17/FizzBuzzQix | 13b2c6eaea319637de989a2c9cea9ddaae383316 | 18886824d95083dec600e2a1a81b037ede46990e | refs/heads/main | 2023-03-23T01:40:53.021056 | 2021-03-17T02:32:55 | 2021-03-17T02:32:55 | 348,535,828 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,662 | java | package project;
import org.junit.jupiter.api.Test;
import static org.assertj.core.api.Assertions.assertThat;
public class FizzBuzzQixTest {
@Test
public void oneShouldReturnOne() {
FizzBuzzQix underTest = new FizzBuzzQix();
String spokenWord = underTest.interpret(1);
assertThat(spokenWord).isEqualTo("1");
}
@Test
public void twoShouldReturnTwo() {
FizzBuzzQix underTest = new FizzBuzzQix();
String spokenWord = underTest.interpret(2);
assertThat(spokenWord).isEqualTo("2");
}
@Test
public void threeShouldReturnFizz() {
FizzBuzzQix underTest = new FizzBuzzQix();
String spokenWord = underTest.interpret(3);
assertThat(spokenWord).isEqualTo("Fizz");
}
@Test
public void fiveShouldReturnBuzz() {
FizzBuzzQix underTest = new FizzBuzzQix();
String spokenWord = underTest.interpret(5);
assertThat(spokenWord).isEqualTo("Buzz");
}
@Test
public void sevenShouldReturnQix() {
FizzBuzzQix underTest = new FizzBuzzQix();
String spokenWord = underTest.interpret(7);
assertThat(spokenWord).isEqualTo("Qix");
}
@Test
public void fifteenShouldReturnFizzBuzz() {
FizzBuzzQix underTest = new FizzBuzzQix();
String spokenWord = underTest.interpret(15);
assertThat(spokenWord).isEqualTo("FizzBuzz");
}
private FizzBuzzQix underTest;
private void assertSpokenWord(int numberToInterpret, String expectedWord) {
String spokenWord = underTest.interpret(numberToInterpret);
assertThat(spokenWord).isEqualTo(expectedWord);
}
}
| [
"[email protected]"
] | |
20e648360843a09e9f91f2e3f56eb68b1e249843 | 21fab31b836551b7ffcceea6c443eed369066486 | /WaBaoWangDemo/src/dao/TemplateDao.java | c5dd33fadce7ef81eabaff740043ee5a8d2d8a42 | [] | no_license | Harver/wabaowangDemo | 022deae943f79beb9f824bcbfff5c9bbca0e891d | fea39ee7da7964d0ee6d669aeac57c403780ad7a | refs/heads/master | 2020-04-09T11:00:57.511723 | 2018-09-06T13:13:35 | 2018-09-06T13:13:35 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 309 | java | package dao;
import java.sql.SQLException;
import java.util.List;
public interface TemplateDao<T> {
//取到所有数据
List<T> getAll(String sql) throws SQLException;
//取到对象数据
T getInfo(String sql,Object[]in)throws SQLException;
//添加对象
boolean add(T model);
}
| [
"[email protected]"
] | |
3b664cc77882e07bc8f350807400e7f50302915e | f28ca416b3335f215c66c7eb5e81ddeb88c5f3ed | /src/com/demo/util/_JFinalDemoGenerator.java | 225eb139afe93e6a84f8524b313887a3c6c4d1bd | [] | no_license | mickkong/JFinal-demo | af77571261fd2ca76f78b1f7a975653e8691fda6 | 09e8d83020d0eac9f1cb6b32e7afdf3e7eb8d6ba | refs/heads/master | 2021-07-23T21:31:02.112234 | 2017-11-02T12:49:36 | 2017-11-02T12:49:36 | 109,104,414 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,239 | java | package com.demo.util;
import javax.sql.DataSource;
import com.demo.common.SystemConfig;
import com.jfinal.kit.PathKit;
import com.jfinal.kit.PropKit;
import com.jfinal.plugin.activerecord.generator.Generator;
import com.jfinal.plugin.druid.DruidPlugin;
/**
* 本 demo 仅表达最为粗浅的 jfinal 用法,更为有价值的实用的企业级用法
* 详见 JFinal 俱乐部: http://jfinal.com/club
*
* 在数据库表有任何变动时,运行一下 main 方法,极速响应变化进行代码重构
*/
public class _JFinalDemoGenerator {
public static DataSource getDataSource() {
PropKit.use("dbconfig.properties");
DruidPlugin druidPlugin = SystemConfig.createDruidPlugin();
druidPlugin.start();
return druidPlugin.getDataSource();
}
public static void main(String[] args) {
// base model 所使用的包名
String baseModelPackageName = "com.demo.common.model.base";
//PathKit.getRootClassPath()==C:\Users\mickkong\Desktop\jfinal-3.2_demo - 副本\jfinal_demo_v1.0\WebRoot\WEB-INF\classes
// base model 文件保存路径
String baseModelOutputDir = PathKit.getWebRootPath() + "/../src/com/demo/common/model/base";
// model 所使用的包名 (MappingKit 默认使用的包名)
String modelPackageName = "com.demo.common.model";
// model 文件保存路径 (MappingKit 与 DataDictionary 文件默认保存路径)
String modelOutputDir = baseModelOutputDir + "/..";
// 创建生成器
Generator generator = new Generator(getDataSource(), baseModelPackageName, baseModelOutputDir, modelPackageName, modelOutputDir);
// 设置是否生成链式 setter 方法
generator.setGenerateChainSetter(false);
// 添加不需要生成的表名
generator.addExcludedTable("adv");
// 设置是否在 Model 中生成 dao 对象
generator.setGenerateDaoInModel(false);
// 设置是否生成链式 setter 方法
generator.setGenerateChainSetter(true);
// 设置是否生成字典文件
generator.setGenerateDataDictionary(false);
// 设置需要被移除的表名前缀用于生成modelName。例如表名 "osc_user",移除前缀 "osc_"后生成的model名为 "User"而非 OscUser
generator.setRemovedTableNamePrefixes("t_");
// 生成
generator.generate();
}
}
| [
"[email protected]"
] | |
9e5c4f94ce8a8296bcc1f3dce3943c1e4519b943 | 87f58cfeb7e4b10391baf6d40a3156bec9f38420 | /camera/app/src/main/java/com/leautolink/leautocamera/net/http/httpcallback/UploadFileCallBack.java | 69cf14cc5600d459011745fc58f8611b641f6a1b | [] | no_license | yangwei8/camera | a9e054cbdb45e30ffde715098bb23c9554578b15 | 5a7b930d50b976ca072fae63332ea54f1bae6bb3 | refs/heads/master | 2021-01-19T02:38:16.550986 | 2016-08-03T06:44:39 | 2016-08-03T06:44:39 | 64,728,101 | 10 | 9 | null | null | null | null | UTF-8 | Java | false | false | 862 | java | package com.leautolink.leautocamera.net.http.httpcallback;
import java.io.IOException;
import okhttp3.Call;
import okhttp3.Response;
/**
* Created by tianwei on 16/3/22.
*/
public interface UploadFileCallBack {
void onStart(long total);
void onLoading(long total, long current);
/**
* 上传完成回调
*/
void onFinish();
/**
* 上传完成,服务器返回数据回调
*
* @param call
* @param response
*/
void onResponse(Call call, Response response);
void onCancel();
/**
* 流读写超时回调
*/
void onTimeOut();
/**
* 请求出错回调
* @param call
* @param e
*/
void onFailure(Call call, IOException e);
/**
* IO出错或者请求返回码不在[200..300)回调
* @param e
*/
void onError(Object e);
}
| [
"[email protected]"
] | |
386013aed95fa2f9cccef18093bc1ad6923a0c1c | 806f1ae32f03429c21c01eeb0eb7002df3203baa | /delay-callback-interface/src/main/java/com/johnli/callback/param/CallbackParam.java | 0bf4c742124c329998fe1ef713e378fd7b854a52 | [
"Apache-2.0"
] | permissive | joooohnli/delay-callback | 62043d206147cf93b0af1a5f673fd730433bb575 | 90bcd95404ba2ca85338fbbdcc854d5771ca21f7 | refs/heads/master | 2023-03-11T06:10:13.903056 | 2022-03-29T07:27:15 | 2022-03-29T07:27:15 | 148,774,864 | 14 | 4 | Apache-2.0 | 2023-03-01T12:57:32 | 2018-09-14T10:40:25 | Java | UTF-8 | Java | false | false | 2,945 | java | package com.johnli.callback.param;
import com.johnli.callback.common.CallbackException;
import com.johnli.callback.common.Validator;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
import java.io.Serializable;
import java.util.List;
/**
* @author johnli 2018-08-06 13:52
*/
public class CallbackParam implements Serializable, Validator {
private static final long serialVersionUID = -6562599855623010686L;
/**
* arguments list
*/
private List<String> args;
/**
* seconds to delay
*/
private int delaySeconds;
/**
* retry strategy
*/
private RetryStrategy retryStrategy;
/**
* idempotent key<p></p>
* if this value is not empty, use it to ensure the registration is idempotent when same args under same alias are registered more than once;
* otherwise, will register callbacks for times.
*/
private String idempotentKey;
@Override
public void validate() throws CallbackException {
if (delaySeconds <= 0) {
throw new CallbackException("delaySeconds can not less than 1");
}
if (retryStrategy == null) {
throw new CallbackException("retryStrategy can not be null");
}
retryStrategy.validate();
}
private CallbackParam() {
}
public CallbackParam(List<String> args, int delaySeconds, String idempotentKey, RetryStrategy retryStrategy) {
this.args = args;
this.delaySeconds = delaySeconds;
this.retryStrategy = retryStrategy;
this.idempotentKey = idempotentKey;
}
public CallbackParam(List<String> args, int delaySeconds, String idempotentKey) {
this(args, delaySeconds, idempotentKey, new RetryStrategy());
}
public CallbackParam(List<String> args, int delaySeconds) {
this(args, delaySeconds, null);
}
public boolean needIdempotent() {
return StringUtils.isNoneEmpty(idempotentKey);
}
public List<String> getArgs() {
return args;
}
public CallbackParam setArgs(List<String> args) {
this.args = args;
return this;
}
public int getDelaySeconds() {
return delaySeconds;
}
public CallbackParam setDelaySeconds(int delaySeconds) {
this.delaySeconds = delaySeconds;
return this;
}
public RetryStrategy getRetryStrategy() {
return retryStrategy;
}
public CallbackParam setRetryStrategy(RetryStrategy retryStrategy) {
this.retryStrategy = retryStrategy;
return this;
}
public String getIdempotentKey() {
return idempotentKey;
}
public CallbackParam setIdempotentKey(String idempotentKey) {
this.idempotentKey = idempotentKey;
return this;
}
@Override
public String toString() {
return ReflectionToStringBuilder.toString(this);
}
}
| [
"[email protected]"
] | |
b3d2ef3596e897c76b51337e36a81f5f6de838ef | e1a155ed4f9bcbf4e0bc415996ded0dbf538245d | /src/InventoryProgram/Models/Product.java | 4619fdab8b2ee4674bb73537bccc69ab36461c01 | [] | no_license | markmurphycodes/Inventory-Manager | 105f52e2e25789ebf51819ebfeb5059575fd4096 | d764703ad6ec25e96a972897b6fa24f81ebb9b37 | refs/heads/main | 2023-01-30T17:26:49.404296 | 2020-12-13T23:15:23 | 2020-12-13T23:15:23 | 321,179,213 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,505 | java | package InventoryProgram.Models;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
public class Product implements Cloneable{
private ObservableList<Part> associatedParts = FXCollections.observableArrayList();
private int productID;
private String name;
private double price;
private int stock;
private int min;
private int max;
public Product(int id, String name, double price, int stock, int min, int max) {
this.productID = id;
this.name = name;
this.price = price;
this.stock = stock;
this.min = min;
this.max = max;
}
public Product() {
}
/*
SETTERS
*/
public void setID(int id) { this.productID = id; }
public void setName(String name) { this.name = name; }
public void setPrice(double price) { this.price = price; }
public void setStock(int stock) { this.stock = stock; }
public void setMin(int min) { this.min = min; }
public void setMax(int max) { this.max = max; }
/*
GETTERS
*/
public int getID() { return this.productID; }
public String getName() { return this.name; }
public double getPrice() { return this.price; }
public int getStock() { return this.stock; }
public int getMin() { return this.min; }
public int getMax() { return this.max; }
public ObservableList<Part> getAllAssociatedParts() { return this.associatedParts; }
/*
Add or delete an associated part
*/
public void addAssociatedPart(Part part) {
if (!this.associatedParts.contains(part))
this.associatedParts.add(part);
}
public boolean deleteAssociatedPart(Part selectedAssPart) {
if (this.associatedParts.contains(selectedAssPart))
{
associatedParts.remove(selectedAssPart);
return true;
}
return false;
}
@Override
public Object clone() throws CloneNotSupportedException {
Product prod = (Product) super.clone();
// deep cloning for immutable fields
prod.associatedParts = FXCollections.observableArrayList();
// Deep Copy of field by field
for (int i = 0; i < this.associatedParts.size(); i++) {
System.out.println(this.associatedParts.get(i));
prod.addAssociatedPart((Part)this.associatedParts.get(i).clone());
System.out.println(prod.associatedParts.get(i));
}
return prod;
}
}
| [
"[email protected]"
] | |
e1b056c7880ca06fa299f90afdccf57852634cc3 | 944f65574b57f9819294d7aed600915b9d484b9f | /src/main/java/global/coda/hms/exception/handler/BusinessExceptionHandler.java | 9fb053e4e0e4224294b9e09aefefea02716c2057 | [] | no_license | Nirmalmahesh/hms-boot | 62811a61cd03fe9658defba6aa70585d67a3d224 | e5d0d3f504aba9adb4e8993c8c2a53cb0fcd4f23 | refs/heads/master | 2020-12-21T20:00:17.863310 | 2020-02-04T11:24:17 | 2020-02-04T11:24:17 | 236,541,936 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 933 | java | package global.coda.hms.exception.handler;
import global.coda.hms.exception.BusinessException;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
/**
* The type Business exception handler.
*/
@ControllerAdvice
public class BusinessExceptionHandler {
private final Logger LOGGER = LogManager.getLogger(BusinessExceptionHandler.class);
/**
* Exception response entity.
*
* @param exception the exception
* @return the response entity
*/
@ExceptionHandler(value = BusinessException.class)
public ResponseEntity<?> exception(BusinessException exception) {
return new ResponseEntity<>(exception.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR);
}
}
| [
"[email protected]"
] | |
85fc3c3c286277a4c8950d8f9f62a11cde0e6aa0 | 9f004c3df4413eb826c229332d95130a1d5c8457 | /src/shraddha/Assignment46/RemoveDuplicateFromArrayListUsingSet.java | ab482466fb87ebf675953916be8ceb870d0e7f37 | [] | no_license | MayurSTechnoCredit/JAVATechnoJuly2021 | dd8575c800e8f0cac5bab8d5ea32b25f7131dd0d | 3a422553a0d09b6a99e528c73cc2b8efe260a07a | refs/heads/master | 2023-08-22T14:43:37.980748 | 2021-10-16T06:33:34 | 2021-10-16T06:33:34 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 648 | java | /*Programming Questions - Collections : 4th Oct'2021
Example 4:
Write a program to remove duplicate from ArrayList (using set).
Make sure element order remain same.
*/
package shraddha.Assignment46;
import java.util.ArrayList;
import java.util.LinkedHashSet;
public class RemoveDuplicateFromArrayListUsingSet {
public static void main(String[] args) {
ArrayList<Integer> al = new ArrayList<Integer>();
al.add(5);
al.add(15);
al.add(10);
al.add(20);
al.add(25);
al.add(53);
al.add(72);
al.add(10);
al.add(72);
System.out.println(al);
LinkedHashSet<Integer> set = new LinkedHashSet<>(al);
System.out.println(set);
}
}
| [
"[email protected]"
] | |
4e2a8efcd442a481db8b6ab763dd359bc3104c7e | a26ec63279caad0dd0f57120f10440bbd3645ba4 | /business-view/src/main/java/com/yunos/tvtaobao/biz/listener/WebviewClientListener.java | 63cc1b9a5e246bb8768cc5fd46368b86b63175f4 | [] | no_license | P79N6A/tvtao | 6b0af50a878e882ad2c0da399a0a8c0304394dff | 4943116ec8cfb946b85cbfea9641e87834e675ed | refs/heads/master | 2020-04-25T15:27:50.798979 | 2019-02-27T08:55:16 | 2019-02-27T08:55:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 452 | java | /** $
* PROJECT NAME: business-view
* PACKAGE NAME: com.yunos.tvtaobao.biz.listener
* FILE NAME: WebviewClientListener.java
* CREATED TIME: 2015年5月13日
* COPYRIGHT: Copyright(c) 2013 ~ 2015 All Rights Reserved.
*/
package com.yunos.tvtaobao.biz.listener;
public interface WebviewClientListener {
void onPageStarted();
void onPageFinished();
void onReceivedError(int errorCode, String description, String failingUrl);
}
| [
"[email protected]"
] | |
29ce5e9ca9a02a85118272107555c823f399c87e | cdd8cf6479e519ff18c71ccba529c0875e49169a | /src/main/java/top/dianmu/ccompiler/learn/day14/InputSystem/StdInHandler.java | 430dbc2ac44658136aa6ec002b5e2a90d91f001c | [] | no_license | hungry-game/CCompiler_for_learn | af3611bd636978d72df3e09399f144f1ac482c84 | 3f1d3c48dd229ce1eb265ae0d3c8f2051051418b | refs/heads/master | 2022-05-26T18:33:01.230199 | 2020-05-02T12:57:33 | 2020-05-02T12:57:33 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,020 | java | package top.dianmu.ccompiler.learn.day14.InputSystem;
import java.io.UnsupportedEncodingException;
import java.util.Scanner;
public class StdInHandler implements FileHandler{
private String input_buffer = "";
private int curPos = 0;
public void Open() {
Scanner s = new Scanner(System.in);
while (true) {
String line = s.nextLine();
if (line.equals("end")) {
break;
}
input_buffer += line;
input_buffer += '\n';
}
// s.close();
}
public int Close() {
return 0;
}
public int Read(byte[] buf, int begin, int len) {
if (curPos >= input_buffer.length()) {
return 0;
}
int readCnt = 0;
try {
byte[] inputBuf = input_buffer.getBytes("UTF8");
while (curPos + readCnt < input_buffer.length() && readCnt < len) {
buf[begin + readCnt] = inputBuf[curPos + readCnt];
readCnt++;
}
} catch (UnsupportedEncodingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return readCnt;
}
}
| [
"[email protected]"
] | |
91bf99c9ddf4f8f59ce558d7e77baea183a4f7ea | 42e0d3cbe6bd7e923204bd757a50c97eb84ddb58 | /Android/RHT_Logger/app/src/main/java/com/potemski/michal/rht_logger/gatt/operations/GattInitializeBluetooth.java | 54351e7a45b216e1db5218575d8bc049291ae176 | [] | no_license | Nemo94/RHT_Logger | da11a3ebc17aa091d56532a88a562a24b9f9ce7a | 47170fed0a21e1dfdeeb7aa48fa33e602b9e5763 | refs/heads/master | 2021-04-26T23:12:39.496027 | 2019-03-10T01:17:34 | 2019-03-10T01:17:34 | 123,947,643 | 0 | 0 | null | 2018-04-13T15:37:01 | 2018-03-05T16:33:30 | C | UTF-8 | Java | false | false | 450 | java | package com.potemski.michal.rht_logger.gatt.operations;
import android.bluetooth.BluetoothGatt;
public class GattInitializeBluetooth extends GattOperation {
@Override
public void execute(BluetoothGatt bluetoothGatt) {
// Do nothing
}
@Override
public boolean hasAvailableCompletionCallback() {
return false;
}
@Override
public String toString() {
return "GattInitializeBluetooth";
}
}
| [
"[email protected]"
] | |
a94841c3edc16f9e43d835307d778b1356c337e9 | ce26778a051d09b7b4c9ee86548b81f79c25dec2 | /abcPlayer/src/sound/Utilities.java | f40f344944ad38853e321ea65668d6ed1f831235 | [] | no_license | mladuke/ABC-Music-Player | 03fd431f71571b2f48eef3ba844b7170255c35c8 | 8f9fcfdbe0c022009fb790d16b38632b384c903a | refs/heads/master | 2021-04-29T09:43:25.562524 | 2013-01-06T10:49:27 | 2013-01-06T10:49:27 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,184 | java | package sound;
/**
* Represents a class providing helpful math utility functions.
* @author Arjun
*
*/
public class Utilities
{
/**
* Computes the greatest common divisor between two integers.
* @param a - must not be >= 0
* @param b must be > 0
* @return the greatest common divisor
*/
public static int GCD(int a, int b)
{
//Use Euclid's method.
if (a < 0 || b < 0)
{
throw new IllegalArgumentException("Parameters must be nonnegative integers");
}
if (b == 0)
{
return a;
}
else
{
return GCD(b, a % b);
}
}
/**
* Computes the least common multiple of two integers.
* @param a - must not be >= 0
* @param b must be > 0
* @return the least common multiple.
*/
public static int LCM(int a, int b)
{
if (a < 0 || b < 0)
{
throw new IllegalArgumentException("Parameters must be nonnegative integers");
}
int gcd = GCD(a,b);
return (a * b)/(gcd);
}
}
| [
"[email protected]"
] | |
e060af602aebb93ba51ebf9a510604bd8243191a | 4675fe1f11e9e6101ee719f19ce5215d75712aac | /src/main/java/kr/or/ddit/listener/LoginUserListener.java | ae5315bc94c004dbf5150d81f4aa77d9f357fabd | [] | no_license | YuSeungJong/jsp | f593fe76734625cee573378a99179f47fd40419b | 8306b0eb8a8e4bf7ad4a68a67795469e47a51b39 | refs/heads/master | 2023-03-11T14:34:03.112608 | 2021-03-02T12:07:25 | 2021-03-02T12:07:25 | 343,760,461 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,174 | java | package kr.or.ddit.listener;
import java.util.HashSet;
import java.util.Set;
import javax.servlet.http.HttpSessionAttributeListener;
import javax.servlet.http.HttpSessionBindingEvent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import kr.or.ddit.user.model.UserVO;
public class LoginUserListener implements HttpSessionAttributeListener{
private static final Logger logger = LoggerFactory.getLogger(LoginUserListener.class);
private Set<String> users = new HashSet<String>();
@Override
public void attributeAdded(HttpSessionBindingEvent event) {
if(event.getName().equals("S_USER")) {
UserVO user = (UserVO)event.getValue();
logger.debug("added user : {}", user.getUsernm());
users.add(user.getUsernm());
event.getSession().getServletContext().setAttribute("USER_SET", users);
}
}
@Override
public void attributeRemoved(HttpSessionBindingEvent event) {
if(event.getName().equals("S_USER")) {
UserVO user = (UserVO)event.getValue();
logger.debug("removed user : {}", user.getUsernm());
users.remove(user.getUsernm());
}
}
@Override
public void attributeReplaced(HttpSessionBindingEvent event) {
}
}
| [
"[email protected]"
] | |
9cae269f7a33f78f33d0afadc553ae87e550f4bd | 95e944448000c08dd3d6915abb468767c9f29d3c | /sources/com/bytedance/android/live/broadcast/preview/StartLiveEventViewModel.java | b8ec380f3301d2d66aa57cb89659e4cb900e1749 | [] | no_license | xrealm/tiktok-src | 261b1faaf7b39d64bb7cb4106dc1a35963bd6868 | 90f305b5f981d39cfb313d75ab231326c9fca597 | refs/heads/master | 2022-11-12T06:43:07.401661 | 2020-07-04T20:21:12 | 2020-07-04T20:21:12 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,835 | java | package com.bytedance.android.live.broadcast.preview;
import android.arch.lifecycle.C0063u;
import com.bytedance.ies.sdk.widgets.NextLiveData;
import kotlin.C7541d;
import kotlin.C7546e;
import kotlin.jvm.internal.C7571f;
import kotlin.jvm.internal.C7575l;
import kotlin.jvm.internal.Lambda;
import kotlin.jvm.internal.PropertyReference1;
import kotlin.jvm.internal.PropertyReference1Impl;
import kotlin.jvm.p357a.C7561a;
import kotlin.reflect.C7595j;
public final class StartLiveEventViewModel extends C0063u {
/* renamed from: a */
static final /* synthetic */ C7595j[] f8754a = {C7575l.m23602a((PropertyReference1) new PropertyReference1Impl(C7575l.m23595a(StartLiveEventViewModel.class), "closeStatus", "getCloseStatus()Lcom/bytedance/ies/sdk/widgets/NextLiveData;")), C7575l.m23602a((PropertyReference1) new PropertyReference1Impl(C7575l.m23595a(StartLiveEventViewModel.class), "selectTagEvent", "getSelectTagEvent()Lcom/bytedance/ies/sdk/widgets/NextLiveData;")), C7575l.m23602a((PropertyReference1) new PropertyReference1Impl(C7575l.m23595a(StartLiveEventViewModel.class), "selectGameEvent", "getSelectGameEvent()Lcom/bytedance/ies/sdk/widgets/NextLiveData;")), C7575l.m23602a((PropertyReference1) new PropertyReference1Impl(C7575l.m23595a(StartLiveEventViewModel.class), "selectCoverEvent", "getSelectCoverEvent()Lcom/bytedance/ies/sdk/widgets/NextLiveData;")), C7575l.m23602a((PropertyReference1) new PropertyReference1Impl(C7575l.m23595a(StartLiveEventViewModel.class), "broadcastPrepareEvent", "getBroadcastPrepareEvent()Lcom/bytedance/ies/sdk/widgets/NextLiveData;")), C7575l.m23602a((PropertyReference1) new PropertyReference1Impl(C7575l.m23595a(StartLiveEventViewModel.class), "hideView", "getHideView()Lcom/bytedance/ies/sdk/widgets/NextLiveData;"))};
/* renamed from: b */
public static final C2766a f8755b = new C2766a(null);
/* renamed from: c */
private final C7541d f8756c = C7546e.m23569a(C2768c.f8763a);
/* renamed from: d */
private final C7541d f8757d = C7546e.m23569a(C2772g.f8767a);
/* renamed from: e */
private final C7541d f8758e = C7546e.m23569a(C2771f.f8766a);
/* renamed from: f */
private final C7541d f8759f = C7546e.m23569a(C2770e.f8765a);
/* renamed from: g */
private final C7541d f8760g = C7546e.m23569a(C2767b.f8762a);
/* renamed from: h */
private final C7541d f8761h = C7546e.m23569a(C2769d.f8764a);
/* renamed from: com.bytedance.android.live.broadcast.preview.StartLiveEventViewModel$a */
public static final class C2766a {
private C2766a() {
}
public /* synthetic */ C2766a(C7571f fVar) {
this();
}
}
/* renamed from: com.bytedance.android.live.broadcast.preview.StartLiveEventViewModel$b */
static final class C2767b extends Lambda implements C7561a<NextLiveData<Integer>> {
/* renamed from: a */
public static final C2767b f8762a = new C2767b();
C2767b() {
super(0);
}
/* renamed from: a */
private static NextLiveData<Integer> m11049a() {
return new NextLiveData<>();
}
public final /* synthetic */ Object invoke() {
return m11049a();
}
}
/* renamed from: com.bytedance.android.live.broadcast.preview.StartLiveEventViewModel$c */
static final class C2768c extends Lambda implements C7561a<NextLiveData<Integer>> {
/* renamed from: a */
public static final C2768c f8763a = new C2768c();
C2768c() {
super(0);
}
/* renamed from: a */
private static NextLiveData<Integer> m11050a() {
return new NextLiveData<>();
}
public final /* synthetic */ Object invoke() {
return m11050a();
}
}
/* renamed from: com.bytedance.android.live.broadcast.preview.StartLiveEventViewModel$d */
static final class C2769d extends Lambda implements C7561a<NextLiveData<Integer>> {
/* renamed from: a */
public static final C2769d f8764a = new C2769d();
C2769d() {
super(0);
}
/* renamed from: a */
private static NextLiveData<Integer> m11051a() {
return new NextLiveData<>();
}
public final /* synthetic */ Object invoke() {
return m11051a();
}
}
/* renamed from: com.bytedance.android.live.broadcast.preview.StartLiveEventViewModel$e */
static final class C2770e extends Lambda implements C7561a<NextLiveData<Integer>> {
/* renamed from: a */
public static final C2770e f8765a = new C2770e();
C2770e() {
super(0);
}
/* renamed from: a */
private static NextLiveData<Integer> m11052a() {
return new NextLiveData<>();
}
public final /* synthetic */ Object invoke() {
return m11052a();
}
}
/* renamed from: com.bytedance.android.live.broadcast.preview.StartLiveEventViewModel$f */
static final class C2771f extends Lambda implements C7561a<NextLiveData<Integer>> {
/* renamed from: a */
public static final C2771f f8766a = new C2771f();
C2771f() {
super(0);
}
/* renamed from: a */
private static NextLiveData<Integer> m11053a() {
return new NextLiveData<>();
}
public final /* synthetic */ Object invoke() {
return m11053a();
}
}
/* renamed from: com.bytedance.android.live.broadcast.preview.StartLiveEventViewModel$g */
static final class C2772g extends Lambda implements C7561a<NextLiveData<Integer>> {
/* renamed from: a */
public static final C2772g f8767a = new C2772g();
C2772g() {
super(0);
}
/* renamed from: a */
private static NextLiveData<Integer> m11054a() {
return new NextLiveData<>();
}
public final /* synthetic */ Object invoke() {
return m11054a();
}
}
/* renamed from: a */
public final NextLiveData<Integer> mo9467a() {
return (NextLiveData) this.f8756c.getValue();
}
/* renamed from: b */
public final NextLiveData<Integer> mo9468b() {
return (NextLiveData) this.f8758e.getValue();
}
/* renamed from: c */
public final NextLiveData<Integer> mo9469c() {
return (NextLiveData) this.f8759f.getValue();
}
/* renamed from: d */
public final NextLiveData<Integer> mo9470d() {
return (NextLiveData) this.f8760g.getValue();
}
/* renamed from: e */
public final NextLiveData<Integer> mo9471e() {
return (NextLiveData) this.f8761h.getValue();
}
public final void onCleared() {
super.onCleared();
}
}
| [
"[email protected]"
] | |
879042b1c5756b8cbad50d9fbe60d5b08e8f2250 | 43ca534032faa722e206f4585f3075e8dd43de6c | /src/com/instagram/android/feed/a/g.java | 18fefadaa51b04a2ec03d98e713f6bb95078767e | [] | no_license | dnoise/IG-6.9.1-decompiled | 3e87ba382a60ba995e582fc50278a31505109684 | 316612d5e1bfd4a74cee47da9063a38e9d50af68 | refs/heads/master | 2021-01-15T12:42:37.833988 | 2014-10-29T13:17:01 | 2014-10-29T13:17:01 | 26,952,948 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,574 | java | // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/kpdus/jad.html
// Decompiler options: braces fieldsfirst space lnc
package com.instagram.android.feed.a;
import com.instagram.android.fragment.a;
import com.instagram.common.g.b.h;
import com.instagram.feed.d.l;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
// Referenced classes of package com.instagram.android.feed.a:
// a, h, f
final class g
{
final com.instagram.android.feed.a.a a;
private boolean b;
private final Map c;
private final ArrayList d;
private final ArrayList e;
private g(com.instagram.android.feed.a.a a1)
{
a = a1;
super();
b = false;
c = new HashMap();
d = new ArrayList();
e = new ArrayList();
}
g(com.instagram.android.feed.a.a a1, byte byte0)
{
this(a1);
}
static void a(g g1)
{
g1.h();
}
private void a(l l1)
{
if (a.o() == com.instagram.android.feed.a.h.a)
{
com.instagram.common.g.b.h.a().c(l1.b(a.a.n()));
return;
} else
{
com.instagram.common.g.b.h.a().c(l1.e());
return;
}
}
static Map b(g g1)
{
return g1.c;
}
static int c(g g1)
{
return g1.g();
}
private int f()
{
boolean flag = a.a.g();
int i = 0;
if (flag)
{
boolean flag1 = a.a.ag();
i = 0;
if (flag1)
{
i = e.size() % 3;
}
}
return i;
}
private int g()
{
return e.size();
}
private void h()
{
for (Iterator iterator = d.iterator(); iterator.hasNext(); a((l)iterator.next())) { }
}
public final l a(int i)
{
return (l)e.get(i);
}
public final void a()
{
e.clear();
Iterator iterator = d.iterator();
do
{
if (!iterator.hasNext())
{
break;
}
l l1 = (l)iterator.next();
if (a.b(l1))
{
e.add(l1);
}
} while (true);
}
public final void a(List list, boolean flag)
{
if (list != null)
{
Iterator iterator = list.iterator();
int i = 0;
do
{
if (!iterator.hasNext())
{
break;
}
l l1 = (l)iterator.next();
String s = l1.d();
if ((l)c.get(s) == null)
{
c.put(s, l1);
if (flag)
{
ArrayList arraylist = d;
int j = i + 1;
arraylist.add(i, l1);
i = j;
} else
{
d.add(l1);
}
a(l1);
}
} while (true);
}
if (b)
{
b = false;
if (com.instagram.android.feed.a.a.c(a) != null)
{
com.instagram.android.feed.a.a.c(a).a();
}
}
}
public final List b(int i)
{
ArrayList arraylist = new ArrayList();
int j = i * 3;
for (int k = 0; k < 3; k++)
{
int i1 = j + k;
if (i1 < g())
{
arraylist.add(a(i1));
}
}
return arraylist;
}
public final void b()
{
b = true;
c.clear();
d.clear();
e.clear();
}
public final int c()
{
if (com.instagram.android.feed.a.a.d(a) == com.instagram.android.feed.a.h.a)
{
return e.size() - f();
}
if (com.instagram.android.feed.a.a.d(a) == h.b)
{
if (a.a.g() || a.a.ah())
{
return (int)Math.floor((double)e.size() / 3D);
} else
{
return (int)Math.ceil((double)e.size() / 3D);
}
} else
{
throw new UnsupportedOperationException("View mode not handled");
}
}
public final boolean d()
{
return c() == 0;
}
public final boolean e()
{
return e.size() > 0;
}
}
| [
"[email protected]"
] | |
487f48220fc6e9c63daca68d2c17a3f37d76865c | 6d97c6e52a46e38285d861096a90567188a287e1 | /src/test/java/medium/LC419Test.java | a0e16dddbab1313e2881d6ef25066e8a12163238 | [] | no_license | liux0054/LCSolution | 6839fec24515bcb8cb8b304afdd2c7760ec19b90 | c0a8364e5591d635f60d96e91fe318de4b777316 | refs/heads/master | 2021-09-09T13:20:22.585135 | 2021-09-02T14:35:31 | 2021-09-02T14:35:31 | 143,372,519 | 0 | 0 | null | 2021-01-19T12:34:17 | 2018-08-03T03:23:09 | Java | UTF-8 | Java | false | false | 377 | java | package medium;
import org.junit.Assert;
import org.junit.Test;
import medium.LC419;
public class LC419Test {
@Test
public void testCase1(){
Assert.assertEquals(2, new LC419().countBattleships(
new char[][]{
{'X','.','.','X'},
{'.','.','.','X'},
{'.','.','.','X'}
}
));
}
}
| [
"[email protected]"
] | |
87bb76a6f130ace4f84a84694c53c2aa9e2f32ae | 31b7d2067274728a252574b2452e617e45a1c8fb | /jpa-connector-beehive-bdk/com_V2.0.1.4/oracle/beehive/ConnectionRequest.java | 6fee27d52b391c5a2426287ac7ce24898a5737f1 | [] | no_license | ericschan/open-icom | c83ae2fa11dafb92c3210a32184deb5e110a5305 | c4b15a2246d1b672a8225cbb21b75fdec7f66f22 | refs/heads/master | 2020-12-30T12:22:48.783144 | 2017-05-28T00:51:44 | 2017-05-28T00:51:44 | 91,422,338 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,157 | java | //
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.3-hudson-jaxb-ri-2.2.3-3-
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2011.05.18 at 04:52:34 PM PDT
//
package com.oracle.beehive;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.bind.annotation.XmlType;
import javax.xml.datatype.XMLGregorianCalendar;
/**
* <p>Java class for connectionRequest complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="connectionRequest">
* <complexContent>
* <extension base="{http://www.oracle.com/beehive}entity">
* <sequence>
* <element name="acceptedUsers" type="{http://www.oracle.com/beehive}actor" maxOccurs="unbounded" minOccurs="0"/>
* <element name="collaborationChannel" type="{http://www.oracle.com/beehive}connectionRequestCollaborationChannel" minOccurs="0"/>
* <element name="maxRequestsToBeSent" type="{http://www.w3.org/2001/XMLSchema}int"/>
* <element name="needResponseBy" type="{http://www.w3.org/2001/XMLSchema}dateTime" minOccurs="0"/>
* <element name="priority" type="{http://www.oracle.com/beehive}priority" minOccurs="0"/>
* <element name="requestMessageBody" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* <element name="requestMessageSubject" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* <element name="requestState" type="{http://www.oracle.com/beehive}connectionRequestState" minOccurs="0"/>
* <element name="resolutionStatus" type="{http://www.oracle.com/beehive}connectionRequestResolutionStatus" minOccurs="0"/>
* <element name="responseState" type="{http://www.oracle.com/beehive}connectionRequestResponseState" minOccurs="0"/>
* </sequence>
* </extension>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "connectionRequest", propOrder = {
"acceptedUsers",
"collaborationChannel",
"maxRequestsToBeSent",
"needResponseBy",
"priority",
"requestMessageBody",
"requestMessageSubject",
"requestState",
"resolutionStatus",
"responseState"
})
@XmlSeeAlso({
RelationshipConnectionRequest.class,
ExpertiseConnectionRequest.class
})
public abstract class ConnectionRequest
extends Entity
{
@XmlElement(nillable = true)
protected List<Actor> acceptedUsers;
protected ConnectionRequestCollaborationChannel collaborationChannel;
protected int maxRequestsToBeSent;
@XmlSchemaType(name = "dateTime")
protected XMLGregorianCalendar needResponseBy;
protected Priority priority;
protected String requestMessageBody;
protected String requestMessageSubject;
protected ConnectionRequestState requestState;
protected ConnectionRequestResolutionStatus resolutionStatus;
protected ConnectionRequestResponseState responseState;
/**
* Gets the value of the acceptedUsers property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the acceptedUsers property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getAcceptedUsers().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link Actor }
*
*
*/
public List<Actor> getAcceptedUsers() {
if (acceptedUsers == null) {
acceptedUsers = new ArrayList<Actor>();
}
return this.acceptedUsers;
}
/**
* Gets the value of the collaborationChannel property.
*
* @return
* possible object is
* {@link ConnectionRequestCollaborationChannel }
*
*/
public ConnectionRequestCollaborationChannel getCollaborationChannel() {
return collaborationChannel;
}
/**
* Sets the value of the collaborationChannel property.
*
* @param value
* allowed object is
* {@link ConnectionRequestCollaborationChannel }
*
*/
public void setCollaborationChannel(ConnectionRequestCollaborationChannel value) {
this.collaborationChannel = value;
}
/**
* Gets the value of the maxRequestsToBeSent property.
*
*/
public int getMaxRequestsToBeSent() {
return maxRequestsToBeSent;
}
/**
* Sets the value of the maxRequestsToBeSent property.
*
*/
public void setMaxRequestsToBeSent(int value) {
this.maxRequestsToBeSent = value;
}
/**
* Gets the value of the needResponseBy property.
*
* @return
* possible object is
* {@link XMLGregorianCalendar }
*
*/
public XMLGregorianCalendar getNeedResponseBy() {
return needResponseBy;
}
/**
* Sets the value of the needResponseBy property.
*
* @param value
* allowed object is
* {@link XMLGregorianCalendar }
*
*/
public void setNeedResponseBy(XMLGregorianCalendar value) {
this.needResponseBy = value;
}
/**
* Gets the value of the priority property.
*
* @return
* possible object is
* {@link Priority }
*
*/
public Priority getPriority() {
return priority;
}
/**
* Sets the value of the priority property.
*
* @param value
* allowed object is
* {@link Priority }
*
*/
public void setPriority(Priority value) {
this.priority = value;
}
/**
* Gets the value of the requestMessageBody property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getRequestMessageBody() {
return requestMessageBody;
}
/**
* Sets the value of the requestMessageBody property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setRequestMessageBody(String value) {
this.requestMessageBody = value;
}
/**
* Gets the value of the requestMessageSubject property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getRequestMessageSubject() {
return requestMessageSubject;
}
/**
* Sets the value of the requestMessageSubject property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setRequestMessageSubject(String value) {
this.requestMessageSubject = value;
}
/**
* Gets the value of the requestState property.
*
* @return
* possible object is
* {@link ConnectionRequestState }
*
*/
public ConnectionRequestState getRequestState() {
return requestState;
}
/**
* Sets the value of the requestState property.
*
* @param value
* allowed object is
* {@link ConnectionRequestState }
*
*/
public void setRequestState(ConnectionRequestState value) {
this.requestState = value;
}
/**
* Gets the value of the resolutionStatus property.
*
* @return
* possible object is
* {@link ConnectionRequestResolutionStatus }
*
*/
public ConnectionRequestResolutionStatus getResolutionStatus() {
return resolutionStatus;
}
/**
* Sets the value of the resolutionStatus property.
*
* @param value
* allowed object is
* {@link ConnectionRequestResolutionStatus }
*
*/
public void setResolutionStatus(ConnectionRequestResolutionStatus value) {
this.resolutionStatus = value;
}
/**
* Gets the value of the responseState property.
*
* @return
* possible object is
* {@link ConnectionRequestResponseState }
*
*/
public ConnectionRequestResponseState getResponseState() {
return responseState;
}
/**
* Sets the value of the responseState property.
*
* @param value
* allowed object is
* {@link ConnectionRequestResponseState }
*
*/
public void setResponseState(ConnectionRequestResponseState value) {
this.responseState = value;
}
}
| [
"[email protected]"
] | |
bf065823348e5552d9ebdd1c8a26d94ce8c6b305 | aa373bd1056d35a584bb59426bb55245b26d3616 | /mylibrary/src/main/java/so/bubu/ui/test/mylibrary/input/SingleCheckbox.java | 12f4d527c7651b6d2de6bc86562a52b2e8be369a | [] | no_license | zhenghengZN/Ui | c4544c7966e32e9c59db993eefdd8acf7489e759 | d1810e18c25c7aaffb2c72d2a9424687d29c4ef6 | refs/heads/master | 2021-04-26T23:28:33.486016 | 2018-04-17T02:53:03 | 2018-04-17T02:53:03 | 124,001,334 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,275 | java | package so.bubu.ui.test.mylibrary.input;
import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.RadioButton;
import android.widget.TextView;
import java.util.HashMap;
import Util.ResourceUtil;
import so.bubu.ui.test.mylibrary.R;
/**
* Created by zhengheng on 18/1/29.
*/
public class SingleCheckbox extends LinearLayout {
private TextView title;
private RadioButton checkImage;
private View view, parent;
private String titleName;
private boolean ischeck;
public SingleCheckbox(Context context) {
this(context, null);
}
public SingleCheckbox(Context context, AttributeSet attrs) {
super(context, attrs);
this.setOrientation(VERTICAL);
this.view = LayoutInflater.from(context).inflate(R.layout.singlecheckbox, this, true);
parent = view.findViewById(R.id.parent);
// parent.setOnClickListener(this);
title = (TextView) view.findViewById(R.id.title);
checkImage = (RadioButton) view.findViewById(R.id.check_img);
TypedArray ta = context.obtainStyledAttributes(attrs, R.styleable.SingleCheckbox);
titleName = ta.getString(R.styleable.SingleCheckbox_check_title);
title.setText(titleName);
View view = new View(context);
LayoutParams lp = new LayoutParams(LayoutParams.MATCH_PARENT, ResourceUtil.Dp2Px(0.5f));
lp.setMargins(ResourceUtil.Dp2Px(10f), 0, 0, 0);
view.setLayoutParams(lp);
view.setBackgroundColor(getResources().getColor(R.color.color_e2e2e2));
this.addView(view);
this.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
checkImage.setChecked(!ischeck);
}
});
}
public void init(HashMap<String,Object> map) {
title.setText((String)map.get("title"));
}
public void setTitle(String s) {
title.setText(s);
}
public void setCheckChage(boolean check) {
checkImage.setChecked(check);
}
public String getTtile() {
return title.getText().toString();
}
}
| [
"[email protected]"
] | |
f1c8fe56aa2eab61c2cfae7f266eef653808362e | 108dc17e407b69c4e0fe29801de3d0d919e00ea6 | /com.carrotgarden.m2e/com.carrotgarden.m2e.scr/com.carrotgarden.m2e.scr.testing/src/main/java/root00/branch13/DummyComp_03.java | 947f94b7ff15053bef9b9f26415fb0b56051eedf | [
"BSD-3-Clause"
] | permissive | barchart/carrot-eclipse | c017013e4913a1ba9b1f651778026be329802809 | 50f4433c0996646fd96593cabecaeeb1de798426 | refs/heads/master | 2023-08-31T05:54:26.725744 | 2013-06-23T21:18:15 | 2013-06-23T21:18:15 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,110 | java | /**
* Copyright (C) 2010-2012 Andrei Pozolotin <[email protected]>
*
* All rights reserved. Licensed under the OSI BSD License.
*
* http://www.opensource.org/licenses/bsd-license.php
*/
package root00.branch13;
import java.util.concurrent.Executor;
import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Property;
import org.osgi.service.component.annotations.Reference;
import org.osgi.service.component.annotations.ReferenceCardinality;
import org.osgi.service.component.annotations.ReferencePolicy;
// should ignore runnable
@Component
public class DummyComp_03 implements Cloneable, Runnable {
@Property
static final String VALUE= "hello";
@Reference(name = "1133")
void bind(final Executor executor) {
//
}
void unbind(final Executor executor) {
//
}
@Reference(name = "113311", policy=ReferencePolicy.DYNAMIC, cardinality=ReferenceCardinality.MULTIPLE)
void bind(final Runnable tasker) {
//
}
void unbind(final Runnable tasker) {
}
//
@Override
public void run() {
// TODO Auto-generated method stub
}
}
| [
"[email protected]"
] | |
286bd8576b97d61bad4378ef22b9accce6f62769 | 821ed0666d39420d2da9362d090d67915d469cc5 | /incubator/net/src/main/java/org/onosproject/incubator/net/config/impl/package-info.java | e1d8f3d6891daa1b9e15acca0c5eac3e32a3e7c4 | [
"Apache-2.0"
] | permissive | LenkayHuang/Onos-PNC-for-PCEP | 03b67dcdd280565169f2543029279750da0c6540 | bd7d201aba89a713f5ba6ffb473aacff85e4d38c | refs/heads/master | 2021-01-01T05:19:31.547809 | 2016-04-12T07:25:13 | 2016-04-12T07:25:13 | 56,041,394 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 746 | java | /*
* Copyright 2015 Open Networking Laboratory
*
* 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.
*/
/**
* Implementation of the network configuration subsystem.
*/
package org.onosproject.incubator.net.config.impl; | [
"[email protected]"
] | |
56204f4435678240afc3b2fbaa5000e18e2684bd | ab6c80e295c53dba3c75a2ed503242f60f9fbb9c | /src/main/java/soundsystem/autoconfig/CDPlayerConfig.java | ea1cfa73c76a2cf371e461e6e57635145e21f738 | [] | no_license | wangdesen/SpringSection2 | 68284b373bd8d7b8e4fca8d14934bd458665eaaf | 14a5a83a97f5ea112f9406c23f0d7bdb514ea64a | refs/heads/master | 2021-01-01T03:49:12.083730 | 2016-04-15T14:29:14 | 2016-04-15T14:29:14 | 56,148,551 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 300 | java | package soundsystem.autoconfig;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
/**
* Spring配置类
*
* 2016年04月13日20:39:00 扫描组件
*
* */
@Configuration
@ComponentScan
public class CDPlayerConfig {
}
| [
"[email protected]"
] | |
d9bf4dd75410ffed546e11ae0a59a34bac9f29ce | ff1c94519f9672fb26b31a97853774ba8c9016a8 | /src/RangeSumBST/Solution.java | 465ebe422189e184f8a02124b9de07f0151d2c01 | [] | no_license | wangyao2221/LeetCode | 0a796af620e9e6dfefb8c49f755b4f2b6ee8d6ba | 9ec81a60dcda022cf17cda14c1d373ffd28d8a72 | refs/heads/master | 2021-01-20T02:53:08.629877 | 2020-07-29T05:53:39 | 2020-07-29T05:53:39 | 89,457,428 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 332 | java | package RangeSumBST;
import common.BinaryTreeNode;
class Solution {
public int rangeSumBST(BinaryTreeNode root, int L, int R) {
if(root == null) return 0;
int val = root.val;
val = val >= L && val <= R ? val : 0;
return val + rangeSumBST(root.left,L,R) + rangeSumBST(root.right,L,R);
}
} | [
"[email protected]"
] | |
2c7958d79fc5b995e5a217f5c2e37187387852bb | b34266390c7ed49d667e1db04d0ea17bce02daf8 | /app/src/main/java/com/dimensiondata/jaxb/unmarshaller/JaxUnmarshaller.java | e5f5fbe3b45ef04617be60f5cda223284b113f64 | [] | no_license | marky-mark/OpsourceSimpleApp | c0904bf2e6e838e2118dc53d1ab958d614eda1f7 | 75004ae4fc68931df464140263e754a8d9f47aa0 | refs/heads/master | 2020-06-03T17:54:43.713144 | 2015-03-11T22:41:26 | 2015-03-11T22:41:26 | 28,567,229 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 588 | java | package com.dimensiondata.jaxb.unmarshaller;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;
import java.io.InputStream;
public class JaxUnmarshaller implements UnMarshaller {
public <T> T unMarshal(Class<T> docClass, InputStream inputStream) {
try {
JAXBContext jc = JAXBContext.newInstance(docClass);
Unmarshaller u = jc.createUnmarshaller();
return (T) u.unmarshal( inputStream );
} catch (JAXBException e) {
throw new UnMarshalException(e);
}
}
}
| [
"[email protected]"
] | |
4d09904cdfbc138654ac3e68e3eec1312722e94a | cab76c96a11c79bf90bc2401d303eaa0f4393ba5 | /app/src/main/java/com/nshane/designpattern/proxy/Ceyco.java | 49cf59a4aaf3fd8c704cb81ed46352870ab11d09 | [] | no_license | ceycochan/DesignPattern | 9fb51d5f093300682fbb1854a2ddb26cc855c1b6 | b708e8e4011e8a7a2e9d1fa3627cda47f457b7c3 | refs/heads/master | 2020-03-30T03:39:08.421306 | 2018-09-28T07:12:14 | 2018-09-28T07:12:14 | 150,700,362 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 733 | java | package com.nshane.designpattern.proxy;
import android.content.Context;
import android.widget.Toast;
/**
* Created by lbl on 2017/5/22.
*/
public class Ceyco implements Desired {
GF gf;
Context context;
public Ceyco(GF hb, Context context) {
this.gf = hb;
this.context = context;
}
@Override
public void goToHotel() {
Toast.makeText(context, gf.getName() + "hotel arrived", Toast.LENGTH_SHORT).show();
}
@Override
public void goShowering() {
Toast.makeText(context, gf.getName()+"is showering", Toast.LENGTH_SHORT).show();
}
@Override
public void blowJob() {
Toast.makeText(context, "blow job ing", Toast.LENGTH_SHORT).show();
}
}
| [
"[email protected]"
] | |
eb9988cee14e45c5d17c2baf1d8102bc4d71bdba | 0e32d749d36f9c889785ddcafe754f99b49eb29a | /src/main/java/com/wanxp/blog/dao/ContentMetaRelationshipRepository.java | 347fa5038acdfd777bbde54d8e51e0dc2999f72a | [] | no_license | ex-wangxiangchuan/blog | 29eff76888b7be68c5cc68098f327feaa1695f90 | ef0c403e069bc4e4344701d3ee98510375b5cf36 | refs/heads/master | 2020-04-23T14:39:11.829698 | 2019-01-30T10:14:48 | 2019-01-30T10:14:48 | 171,238,273 | 4 | 0 | null | 2019-02-18T07:49:06 | 2019-02-18T07:49:06 | null | UTF-8 | Java | false | false | 334 | java | package com.wanxp.blog.dao;
import com.wanxp.blog.model.ContentMetaRelationship;
import org.springframework.data.jpa.repository.JpaRepository;
/**
* ContentMetaRelationship数据库操作类
*
* @author John
*
*/
public interface ContentMetaRelationshipRepository extends JpaRepository<ContentMetaRelationship, Integer> {
}
| [
"[email protected]"
] | |
23c19339d1468a1f3539ff5050e9f7be93affa67 | b894561db2e40168600b6cd7656e00c8bb7787e1 | /src/funktioner/Funktioner3.java | de5c7617065c5cd6e044ae38003683be5b25448d | [
"MIT"
] | permissive | Akzuki01/Programering-1-Diego- | a6a96f9197a8c9be427e2586bb465ed8cb0c4a15 | 05adea7ac9fcad3af5bb20568cb99e46c1e22efb | refs/heads/master | 2020-03-27T17:44:08.580453 | 2018-11-05T10:32:30 | 2018-11-05T10:32:30 | 146,870,679 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 596 | java | package funktioner;
import java.util.Scanner;
public class Funktioner3 {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.print("Input a string: ");
String str = in.nextLine();
System.out.println("The middle charter in the string: " + middle(str)+"\n");
}
public static String middle(String str)
{
int position;
int length;
if (str.length() % 2 == 0)
{
position = str.length() / 2 - 1;
length = 2;
} else {
position = str.length() / 2;
length = 1;
}
return str.substring(position, position + length);
}
}
| [
"[email protected]"
] | |
620d3f84a661964c2d8fd74357dc3c980b14c409 | 8fb13e457207c4684a4205bbcc9ef572fc163ea9 | /src/main/java/com/blackmorse/hattrick/model/enums/HattrickType.java | ae434b89b3b9fb91bcb421853b21abe7f1f3960a | [
"Apache-2.0"
] | permissive | Blackmorse/hattrick-java-api | 4748168f008b2b0a8c2937eec0016bffc38d2816 | 1d8c222ef8c190f4cf01535bc0a38ddbaf7372f5 | refs/heads/master | 2020-11-29T02:51:50.221707 | 2020-08-04T15:44:35 | 2020-08-04T15:44:35 | 229,999,921 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 100 | java | package com.blackmorse.hattrick.model.enums;
public interface HattrickType {
int getValue();
}
| [
"[email protected]"
] | |
a3ddde5c65b05eb0cd8ae6fa518fc81eae4d632b | 67322142fcb2482b300373d1535b1b0f9805644d | /ShapeTest01/src/shape/Triangle.java | 1796b6f9ae4c18de142739da0ea7fb8b282aee27 | [] | no_license | bj730612/java_fundamental | cf52c3fca72bf7daa8d557776c4804d51aac3627 | ed9cad1b1b6fcaee4137945a7a2b2a9949256af8 | refs/heads/master | 2021-09-11T15:24:25.088379 | 2018-04-09T07:38:39 | 2018-04-09T07:38:39 | 127,361,781 | 0 | 0 | null | null | null | null | UHC | Java | false | false | 174 | java | package shape;
public class Triangle extends Shape {
int height;
@Override
public void draw() {
System.out.println("삼각형 그리기 메소드");
}
}
| [
"[email protected]"
] | |
73582fe09bd97862b98371c8f9a9920aa70049a7 | 28dcf95ac2507aad42ef1f448a68f7ff1fa99789 | /app/src/main/java/com/whatsapp/magazine/paulooliveira/usaralcoolougasolina/fragment/SobreFragment.java | a389fefa1ac0c2e98fb97d141a33f928c31a5acc | [] | no_license | PAULOFO/UsarAlcoolouGasolina | a1c37b6e6ce13395571c991a2ea8a50d9368e54d | 3fdecbb00d832a219a9cbe25ff1a70a7153b3e67 | refs/heads/master | 2020-04-13T00:38:28.344035 | 2018-12-24T15:34:00 | 2018-12-24T15:34:00 | 162,850,892 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 762 | java | package com.whatsapp.magazine.paulooliveira.usaralcoolougasolina.fragment;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.whatsapp.magazine.paulooliveira.usaralcoolougasolina.R;
/**
* A simple {@link Fragment} subclass.
*/
public class SobreFragment extends Fragment {
public SobreFragment() {
// Required empty public constructor
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_sobre, container, false);
}
}
| [
"[email protected]"
] | |
1e7d1d58122011aeb784c4028cf8f549a4c9eecd | c67006596eb2b1b9611dc99d36baba0a39e66630 | /src/main/java/com/zero/mapper/GoodsUseRecordMapper.java | c2342e9d754df9cdf98fad580c3737c2343704ed | [] | no_license | shcfighter/yukai | 8d575940e7a36cba5947aa1f1826981bce0fbe79 | c46f0fd811e869856e94c25a84eaafe98c71d19a | refs/heads/master | 2020-03-17T10:08:09.758051 | 2018-07-09T00:43:25 | 2018-07-09T00:43:25 | 133,501,561 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 947 | java | package com.zero.mapper;
import com.zero.model.GoodsUseRecord;
import com.zero.model.example.GoodsUseRecordExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface GoodsUseRecordMapper {
long countByExample(GoodsUseRecordExample example);
int deleteByExample(GoodsUseRecordExample example);
int deleteByPrimaryKey(Integer id);
int insert(GoodsUseRecord record);
int insertSelective(GoodsUseRecord record);
List<GoodsUseRecord> selectByExample(GoodsUseRecordExample example);
GoodsUseRecord selectByPrimaryKey(Integer id);
int updateByExampleSelective(@Param("record") GoodsUseRecord record, @Param("example") GoodsUseRecordExample example);
int updateByExample(@Param("record") GoodsUseRecord record, @Param("example") GoodsUseRecordExample example);
int updateByPrimaryKeySelective(GoodsUseRecord record);
int updateByPrimaryKey(GoodsUseRecord record);
} | [
"[email protected]"
] | |
33b7815f562a1e78d07a44d9a93839d06e942835 | 5b736dde9afb7fdf99b53f062ebfde730867365b | /src/test/java/com/annotation/hibernate/HibernateAnnotationsApplicationTests.java | 1340bcd8593dfa724e2d837ddccd9ffa899ad07b | [] | no_license | vasanthkalli/jpaentitymanager | 502e3f403a7eb8055607e7314f1e7554b0409f02 | 32ab747b6abe5548112ee83d643690f5b85fe4e3 | refs/heads/master | 2022-12-09T05:59:54.477543 | 2020-09-10T03:31:56 | 2020-09-10T03:31:56 | 289,926,643 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 230 | java | package com.annotation.hibernate;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class HibernateAnnotationsApplicationTests {
@Test
void contextLoads() {
}
}
| [
"[email protected]"
] | |
d1ea411dd06f126c6c8c00b99b7a31ca28b1ed5c | c1b333ac490cfff7b13b4c60cf8075a07a763ed4 | /src/main/java/com/postgres/fulltextsearch/repository/FtsGlobalRepository.java | 4456fc117b51ce6b944ce64a89ef6ca14a0af7e4 | [] | no_license | yendauvinh/fulltextsearch-project | ab809859028253cc8bdc099292f7c76fbeffa783 | 395da2f8c4d6a2e6ddac6be9d5a2e27a9cabe46c | refs/heads/main | 2023-09-05T01:41:43.563761 | 2021-11-17T09:51:48 | 2021-11-17T09:51:48 | 428,500,578 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 663 | java | package com.postgres.fulltextsearch.repository;
import com.postgres.fulltextsearch.entities.FtsGlobal;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;
import java.util.UUID;
public interface FtsGlobalRepository extends BaseRepository<FtsGlobal> {
@Transactional
@Modifying
@Query(value = "INSERT INTO fts_global(id, description, name, fts_one_id) VALUES " +
"(uuid_generate_v1() ,to_tsvector(?1), to_tsvector(?2), ?3)", nativeQuery = true)
void saveNewFts(String description, String name, UUID uuid);
}
| [
"yendauvinh"
] | yendauvinh |
71cf40cad2f476a488193cb724b705315d18ba87 | 0b302de7f1252390369a84c455c00a68a034e540 | /Parser/Daedalus Interpreter/daedalusExecution/intermediateObjects/DaedalusTypedList.java | 21be954f78dff857aed484073733ec7e4181ec5f | [] | no_license | Daedo/Djin | 7a2903d101510a165a4e38b132dfb980b76e3775 | f863cf0fd7daf31fdfbbaad6627887918da45748 | refs/heads/master | 2021-01-01T03:39:03.484160 | 2016-04-14T18:25:27 | 2016-04-14T18:25:27 | 56,258,619 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 307 | java | package daedalusExecution.intermediateObjects;
import java.util.Vector;
import daedalusCodeComponents.generic.type.DaedalusTypeLiteral;
public class DaedalusTypedList extends DaedalusTypedValue {
private DaedalusTypedList(DaedalusTypeLiteral type) {
super(type,new Vector<DaedalusTypedValue>());
}
}
| [
"[email protected]"
] | |
c9abbf248bbcbddc61a4da5ec39e24815d666cc1 | 674c31fb6ea4b0dfe38efbc71a15059c25f9c070 | /src/main/java/com/gachifarm/controller/MypageMyPostsController.java | c9c5d93fa3c7ede4887ed6da551f181953758ceb | [] | no_license | hiereit/Gachifarm_springboot | a739f366460c8386f311713cf5b2ed3494f88b1d | f8602f58feaadd2513357a0268e6cb303977b2bd | refs/heads/develop | 2023-06-05T02:52:52.675717 | 2021-06-21T13:11:57 | 2021-06-21T13:11:57 | 370,662,792 | 0 | 2 | null | 2021-06-21T13:11:58 | 2021-05-25T11:05:14 | HTML | UTF-8 | Java | false | false | 2,292 | java | package com.gachifarm.controller;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.SessionAttributes;
import org.springframework.web.util.WebUtils;
import com.gachifarm.domain.Account;
import com.gachifarm.domain.Board;
import com.gachifarm.domain.LineProduct;
import com.gachifarm.domain.Review;
import com.gachifarm.service.GachiFarmFacade;
@Controller
@SessionAttributes({"userSession", "myorders"})
public class MypageMyPostsController {
UserSession userSession;
GachiFarmFacade gachiFarm;
@Autowired
public void setGachiFarm(GachiFarmFacade gachiFarm) {
this.gachiFarm = gachiFarm;
}
@GetMapping("user/mypage/myposts")
public String myposts(HttpSession session, Model model, HttpServletRequest request) {
UserSession userSession =
(UserSession) WebUtils.getSessionAttribute(request, "userSession");
Account account = userSession.getAccount();
List<Board> boardList = gachiFarm.findBoardByUserId(account.getUserId());
System.out.println("myposts() - boardList: " + boardList);
String [] answerStatus = new String[boardList.size()];
if(boardList != null) {
for(int i = 0; i < boardList.size(); i++) {
if(boardList.get(i).getAnswer() == null) {
answerStatus[i] = "NO";
}
else {
answerStatus[i] = "YES";
}
}
model.addAttribute("boardList", boardList);
model.addAttribute("answerStatus", answerStatus);
}
List<Review> reviewList = gachiFarm.findReviewByUserId(account.getUserId());
List<LineProduct> lineProduct = new ArrayList<LineProduct>();
int [] linePrdtId = new int[reviewList.size()];
if(boardList != null) {
for(int i = 0; i < reviewList.size(); i++) {
linePrdtId[i] = reviewList.get(i).getLineProductId();
lineProduct.add(i, gachiFarm.findByLineProductId(linePrdtId[i]));
}
model.addAttribute("lineProduct", lineProduct);
model.addAttribute("reviewList", reviewList);
}
return "Account/MyPageMyBoardAndReview";
}
}
| [
"[email protected]"
] | |
664a3651c79dd62697d756689247325f3bda2590 | c2957297b3985b53bd4be8ab9257415abb1a6d35 | /src/main/java/com/lxm/design/pattern/obverser_pattern_self/DisplayElement.java | 6b865750ab3d56f17937dd5203862bcdde29afd1 | [] | no_license | hblixiaoming/edu | 3df1d9ac8633ae393f6c82b4b4f4b262e8985c2a | da456b4dc37f746ec551f513fc38ce817259127e | refs/heads/master | 2022-06-29T22:35:44.677289 | 2021-12-18T13:25:38 | 2021-12-18T13:25:38 | 127,425,893 | 8 | 1 | null | 2022-06-21T01:14:04 | 2018-03-30T12:29:04 | Java | UTF-8 | Java | false | false | 115 | java | package com.lxm.design.pattern.obverser_pattern_self;
public interface DisplayElement {
public void display();
}
| [
"[email protected]"
] |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.