blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 332 | content_id stringlengths 40 40 | detected_licenses listlengths 0 50 | license_type stringclasses 2
values | repo_name stringlengths 7 115 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 557
values | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 684M ⌀ | star_events_count int64 0 77.7k | fork_events_count int64 0 48k | gha_license_id stringclasses 17
values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 82
values | src_encoding stringclasses 28
values | language stringclasses 1
value | is_vendor bool 1
class | is_generated bool 2
classes | length_bytes int64 7 5.41M | extension stringclasses 11
values | content stringlengths 7 5.41M | authors listlengths 1 1 | author stringlengths 0 161 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
31fa74e2a39d709be62cccd233f79393f861d699 | 5419a7b4142a1fedbee88d3f0e7f139040c0f513 | /two/src/chap15/four/one/HashMapExample.java | 10437ae9163c695c01e9fbf03f61e46852834b2d | [] | no_license | gkgk1375/Java_train_one | 2ba56e5551a760d47d7b531cb5e81aa379968026 | 767093f15a2c411d5352b846d576746434adb25a | refs/heads/master | 2023-07-04T03:25:02.531267 | 2021-08-06T09:05:05 | 2021-08-06T09:05:05 | 384,331,446 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,496 | java | package chap15.four.one;
import java.util.*;
public class HashMapExample {
public static void main(String[] args) {
//Map 컬렉션 생성
Map<String, Integer> map = new HashMap<String, Integer>();
//객체 저장
map.put("신용권", 85);
map.put("홍길동", 90);
map.put("동장군", 80);
map.put("홍길동", 95);
System.out.println("총 Entry 수: " + map.size());
//객체 찾기
System.out.println("\t홍길동 : " + map.get("홍길동"));
System.out.println();
//객체를 하나씩 처리
Set<String> keySet = map.keySet();
Iterator<String> keyIterator = keySet.iterator();
while(keyIterator.hasNext()) {
String key = keyIterator.next();
Integer value = map.get(key);
System.out.println("\t" + key + " : " + value);
}
System.out.println();
//객체 삭제
map.remove("홍길동");
System.out.println("총 Entry 수: " + map.size());
//객체를 하나씩 처리
Set<Map.Entry<String, Integer>> entrySet = map.entrySet();
Iterator<Map.Entry<String, Integer>> enIterator = entrySet.iterator();
//while(entryIterator.hasNext()) {
// Map.Entry<String, Integer> entry = entryIterator.next();
// String key = entry.getKey();
// Integer value = entry.getValue();
// System.out.println("\t" + key + " : " + value);
}
//System.out.println();
//객체 전체 삭제
// map.clear();
// System.out.println("총 Entry 수: " + map.size());
}
//}
| [
"504@DESKTOP-B0KVD9C"
] | 504@DESKTOP-B0KVD9C |
e6899428a9289d0567f0c466cf9227f0cf40edd1 | 57b2c2056ded675c5d60f3587267d814ef505856 | /src/main/java/com/razborka/service/KppService.java | b2e45febb84e09f175009782f15c82c056488bcf | [] | no_license | ManHunter/Razborka | c97cc86e652172de5f311067ef2b323f37dca780 | 174478b58879342106888db24bd7696edb9c9e66 | refs/heads/master | 2021-01-02T09:38:48.282743 | 2015-05-27T11:29:11 | 2015-05-27T11:29:11 | 34,308,867 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 341 | java | package com.razborka.service;
import com.razborka.model.Kpp;
import java.util.List;
/**
* Created by Admin on 14.04.2015.
*/
public interface KppService {
public void saveKpp(Kpp kpp);
public void updateKpp(Kpp kpp);
public void deleteKpp(int id);
public List<Kpp> getAllKpp();
public Kpp getKppById(int id);
}
| [
"bymotorsinfo@gmail.com"
] | bymotorsinfo@gmail.com |
7925b3d9553c56510352517c336c1211ccb6e8ee | 54b6f5185acd00bf659c37cf7405957c49074aa7 | /service-second-server/src/main/java/com/example/domain/shardingsphere/service/ShadowUserServiceImpl.java | d20c9b42579350ca8110c7ffc8eeb88a78c579a8 | [] | no_license | xieyufengbj/service-second | 87d3dd86c37d3eec89168908f676bed465281504 | 4553be86b29ec66bfbc335e8e8e28b151b61bc5a | refs/heads/master | 2022-12-22T10:06:01.297605 | 2020-09-29T03:36:36 | 2020-09-29T03:36:36 | 281,612,498 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,665 | java | package com.example.domain.shardingsphere.service;
import com.example.domain.shardingsphere.entity.ShadowUser;
import com.example.domain.shardingsphere.repository.MybatisShadowUserRepository;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
@Service("shadow")
public class ShadowUserServiceImpl implements ExampleService {
@Resource
private MybatisShadowUserRepository userRepository;
@Override
public void initEnvironment() throws SQLException {
userRepository.createTableIfNotExists();
userRepository.truncateTable();
}
@Override
public void cleanEnvironment() throws SQLException {
userRepository.dropTable();
}
@Override
public void processSuccess() throws SQLException {
System.out.println("-------------- Process Success Begin ---------------");
List<Long> userIds = insertData();
printData();
deleteData(userIds);
printData();
System.out.println("-------------- Process Success Finish --------------");
}
private List<Long> insertData() throws SQLException {
System.out.println("---------------------------- Insert Data ----------------------------");
List<Long> result = new ArrayList<>(10);
for (int i = 1; i <= 10; i++) {
ShadowUser user = new ShadowUser();
user.setUserId(i);
user.setUserName("test_mybatis_" + i);
user.setPwd("pwd_mybatis_" + i);
user.setShadow(i % 2 == 0);
userRepository.insert(user);
result.add((long) user.getUserId());
}
return result;
}
@Override
public void processFailure() throws SQLException {
System.out.println("-------------- Process Failure Begin ---------------");
insertData();
System.out.println("-------------- Process Failure Finish --------------");
throw new RuntimeException("Exception occur for transaction test.");
}
private void deleteData(final List<Long> userIds) throws SQLException {
System.out.println("---------------------------- Delete Data ----------------------------");
for (Long each : userIds) {
userRepository.delete(each);
}
}
@Override
public void printData() throws SQLException {
System.out.println("---------------------------- Print User Data -----------------------");
for (Object each : userRepository.selectAll()) {
System.out.println(each);
}
}
}
| [
"xieyufeng@ichangtou.com"
] | xieyufeng@ichangtou.com |
828f159972f853a81b46c4559c6b00356f43d09b | 2c9e0d44ef828ed0d5245589ffca06113ddcbef7 | /conRdf/src/conRdf/Partition.java | f4adf8f5787ab76f2a1c53bea943e8ed3791c12d | [] | no_license | soheilrk/RdfTypeParser | 3a6bb0b68d1d1e805b9fe9e70b23a7be6a268cf0 | ff862a83897cc55166a48147afa86dfe7c7f7a80 | refs/heads/master | 2020-04-05T14:06:16.575664 | 2017-08-18T19:23:16 | 2017-08-18T19:23:16 | 94,766,279 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 348 | java | package conRdf;
import java.util.ArrayList;
/**
*
* @author kenza Kellou-Menouer
*/
public class Partition {
public ArrayList<Instance> listObjets ; //object with classes
public ArrayList<ConceptType> listTypes;
public ArrayList<Property> listProperties;
}
| [
"rosha@DESKTOP-FCU4MC9"
] | rosha@DESKTOP-FCU4MC9 |
85dcd30adecbf9d554ddf9022ac5f3a120afd5c9 | 4b131d4c8ac00e09c4b3b5c5571b85d322a4a3da | /tapl/src/main/java/tapl/typed/arith/Bool.java | 29ecd03f15380f9478ebf786fbeb61ddd7cdd529 | [
"Apache-2.0"
] | permissive | JanBessai/ecoop2021artifacts | 856328da8ff86ed8db483bd65a7eba78e0e0febb | 3d203eda40758b327d4eada082c78bebd3166608 | refs/heads/main | 2023-04-13T17:10:37.851893 | 2021-05-13T10:17:11 | 2021-05-13T10:17:11 | 348,146,194 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 141 | java | package tapl.typed.arith;
public interface Bool<Elem, Tm, UNat, Ty> extends tapl.typed.bool.Bool<Elem, Tm, Ty>, Type<Elem, Tm, UNat, Ty> {}
| [
"heineman@cs.wpi.edu"
] | heineman@cs.wpi.edu |
7c4c5f1b23122dcfff4d2a2c70f5f49c8b3f5a0c | b0afdf181345bf6104b32dcb40bd03447e59aac0 | /src/main/java/crazypants/enderzoo/entity/EntityWitherCat.java | 7659df2bc1bb6a22b912d9c286356e8da2e8d943 | [
"CC0-1.0"
] | permissive | Vexatos/EnderZoo | 281239d5faf03573020dd2b219d052e738d7e0c1 | 6612f1a2cf45204b74933263065f3a2d4490c0d7 | refs/heads/master | 2021-01-21T06:18:00.895058 | 2014-11-06T15:56:57 | 2014-11-06T15:56:57 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,435 | java | package crazypants.enderzoo.entity;
import java.util.UUID;
import net.minecraft.client.Minecraft;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.EntityAILookIdle;
import net.minecraft.entity.ai.EntityAISwimming;
import net.minecraft.entity.ai.EntityAIWander;
import net.minecraft.entity.ai.EntityAIWatchClosest;
import net.minecraft.entity.ai.attributes.AttributeModifier;
import net.minecraft.entity.ai.attributes.IAttributeInstance;
import net.minecraft.entity.monster.EntityMob;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.DamageSource;
import net.minecraft.world.World;
import crazypants.enderzoo.config.Config;
import crazypants.enderzoo.entity.ai.EntityAIAttackOnCollideOwned;
import crazypants.enderzoo.entity.ai.EntityAIFollowOwner;
public class EntityWitherCat extends EntityMob implements IOwnable<EntityWitherCat, EntityWitherWitch>, IEnderZooMob {
public enum GrowthMode {
NONE,
GROW,
SHRINK
};
public static final String NAME = "enderzoo.WitherCat";
public static final int EGG_BG_COL = 0x303030;
public static final int EGG_FG_COL = 0xFFFFFF;
private static final float DEF_HEIGHT = 0.8F;
private static final float DEF_WIDTH = 0.6F;
private static final int SCALE_INDEX = 12;
private static final int GROWTH_MODE_INDEX = 13;
private static final float ANGRY_SCALE = 2;
private static final float SCALE_INC = 0.05f;
private static final UUID ATTACK_BOOST_MOD_UID = UUID.fromString("B9662B59-9566-4402-BC1F-2ED2B276D846");
private static final UUID HEALTH_BOOST_MOD_UID = UUID.fromString("B9662B29-9467-3302-1D1A-2ED2B276D846");
private float lastScale = 1f;
private boolean grow;
private boolean shrink;
private EntityWitherWitch owner;
private EntityAIFollowOwner followTask;
public EntityWitherCat(World world) {
super(world);
followTask = new EntityAIFollowOwner(this, 2.5, 5, 1);
EntityAIFollowOwner retreatTask = new EntityAIFollowOwner(this, 2.5, 5, 2.5);
tasks.addTask(1, new EntityAISwimming(this));
tasks.addTask(2, new EntityAIAttackOnCollideOwned(this, EntityPlayer.class, 2.5, false, retreatTask));
tasks.addTask(3, followTask);
tasks.addTask(4, new EntityAIWander(this, 1.0D));
tasks.addTask(5, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
tasks.addTask(6, new EntityAILookIdle(this));
setSize(DEF_WIDTH, DEF_HEIGHT);
}
@Override
protected void entityInit() {
super.entityInit();
getDataWatcher().addObject(SCALE_INDEX, 1f);
getDataWatcher().addObject(GROWTH_MODE_INDEX, (byte) GrowthMode.NONE.ordinal());
}
@Override
public EntityWitherWitch getOwner() {
return owner;
}
@Override
public void setOwner(EntityWitherWitch owner) {
this.owner = owner;
}
@Override
public EntityWitherCat asEntity() {
return this;
}
public void setScale(float scale) {
getDataWatcher().updateObject(12, scale);
}
public float getScale() {
return getDataWatcher().getWatchableObjectFloat(12);
}
public void setGrowthMode(GrowthMode mode) {
setGrowthMode(mode.ordinal());
}
private void setGrowthMode(int ordinal) {
getDataWatcher().updateObject(GROWTH_MODE_INDEX, (byte) ordinal);
}
public GrowthMode getGrowthMode() {
return GrowthMode.values()[getDataWatcher().getWatchableObjectByte(GROWTH_MODE_INDEX)];
}
public float getAngryScale() {
return ANGRY_SCALE;
}
public float getScaleInc() {
return SCALE_INC;
}
public boolean isAngry() {
return getScale() >= ANGRY_SCALE;
}
@Override
protected boolean isAIEnabled() {
return true;
}
@Override
public void setAttackTarget(EntityLivingBase target) {
if(getAttackTarget() != target) {
EntityUtil.cancelCurrentTasks(this);
}
super.setAttackTarget(target);
tasks.removeTask(followTask);
if(target == null) {
tasks.addTask(3, followTask);
}
}
@Override
protected void applyEntityAttributes() {
super.applyEntityAttributes();
getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(Config.witherCatHealth);
getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.25D);
getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(Config.witherCatAttackDamage);
//getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(40.0D);
}
@Override
public boolean isPotionApplicable(PotionEffect potion) {
return potion.getPotionID() != Potion.wither.id && super.isPotionApplicable(potion);
}
@Override
public boolean attackEntityFrom(DamageSource source, float amount) {
if(source.getEntity() == owner) {
return false;
}
boolean res = super.attackEntityFrom(source, amount);
if(source.getEntity() instanceof EntityLivingBase) {
if(owner != null) {
EntityLivingBase ownerHitBy = owner.getAITarget();
if(ownerHitBy == null) {
owner.setRevengeTarget((EntityLivingBase) source.getEntity());
}
} else if(owner == null) {
setAttackTarget((EntityLivingBase) source.getEntity());
}
}
return res;
}
@Override
public void setDead() {
super.setDead();
if(owner != null) {
owner.catDied(this);
}
}
@Override
public void onLivingUpdate() {
super.onLivingUpdate();
if(worldObj.isRemote) {
float scale = getScale();
if(lastScale != scale) {
spawnParticles();
lastScale = scale;
}
return;
}
if(owner != null && owner.isDead) {
setOwner(null);
}
if(getOwner() != null && getAttackTarget() != null && !isAngry() && getGrowthMode() != GrowthMode.GROW) {
setGrowthMode(GrowthMode.GROW);
}
updateScale();
float scale = getScale();
if(lastScale != scale) {
lastScale = scale;
setSize(DEF_WIDTH * scale, DEF_HEIGHT * scale);
float growthRatio = (lastScale - 1) / (ANGRY_SCALE - 1);
updateAttackDamage(growthRatio);
updateHealth(growthRatio);
}
}
private double getDistanceToOwner() {
if(owner == null) {
return 0;
}
return getDistanceSqToEntity(owner);
}
public void updateScale() {
GrowthMode curMode = getGrowthMode();
if(curMode == GrowthMode.NONE) {
return;
}
float scale = getScale();
if(curMode == GrowthMode.GROW) {
if(scale < ANGRY_SCALE) {
setScale(scale + SCALE_INC);
} else {
setScale(ANGRY_SCALE);
setGrowthMode(GrowthMode.NONE);
}
} else {
if(scale > 1) {
setScale(scale - SCALE_INC);
} else {
setScale(1);
setGrowthMode(GrowthMode.NONE);
}
}
}
protected void updateAttackDamage(float growthRatio) {
IAttributeInstance att = EntityUtil.removeModifier(this, SharedMonsterAttributes.attackDamage, ATTACK_BOOST_MOD_UID);
if(growthRatio == 0) {
return;
}
double attackDif = Config.witherCatAngryAttackDamage - Config.witherCatAttackDamage;
double toAdd = attackDif * growthRatio;
AttributeModifier mod = new AttributeModifier(ATTACK_BOOST_MOD_UID, "Transformed Attack Modifier", toAdd, 0);
att.applyModifier(mod);
}
protected void updateHealth(float growthRatio) {
IAttributeInstance att = EntityUtil.removeModifier(this, SharedMonsterAttributes.maxHealth, HEALTH_BOOST_MOD_UID);
if(growthRatio == 0) {
return;
}
double currentRatio = getHealth() / getMaxHealth();
double healthDif = Config.witherCatAngryHealth - Config.witherCatHealth;
double toAdd = healthDif * growthRatio;
AttributeModifier mod = new AttributeModifier(HEALTH_BOOST_MOD_UID, "Transformed Attack Modifier", toAdd, 0);
att.applyModifier(mod);
double newHealth = currentRatio * getMaxHealth();
setHealth((float) newHealth);
}
private void spawnParticles() {
double startX = posX;
double startY = posY;
double startZ = posZ;
double offsetScale = 0.8 * getScale();
for (int i = 0; i < 2; i++) {
double xOffset = offsetScale - rand.nextFloat() * offsetScale * 2;
double yOffset = offsetScale / 3 + rand.nextFloat() * offsetScale / 3 * 2F;
double zOffset = offsetScale - rand.nextFloat() * offsetScale * 2;
EntityFX fx = Minecraft.getMinecraft().renderGlobal.doSpawnParticle("spell", startX + xOffset, startY + yOffset, startZ + zOffset, 0.0D, 0.0D, 0.0D);
if(fx != null) {
fx.setRBGColorF(0.8f, 0.2f, 0.2f);
fx.motionY *= 0.025f;
}
}
}
@Override
public boolean writeToNBTOptional(NBTTagCompound root) {
if(getOwner() == null) {
return super.writeToNBTOptional(root);
}
return false;
}
@Override
public void writeEntityToNBT(NBTTagCompound root) {
super.writeEntityToNBT(root);
root.setFloat("scale", getScale());
root.setByte("growthMode", (byte) getGrowthMode().ordinal());
}
@Override
public void readEntityFromNBT(NBTTagCompound root) {
super.readEntityFromNBT(root);
if(root.hasKey("scale")) {
setScale(root.getFloat("scale"));
}
if(root.hasKey("growthMode")) {
setGrowthMode(root.getByte("growthMode"));
}
}
}
| [
"crazypants.mc@gmail.com"
] | crazypants.mc@gmail.com |
038f7e889b0200224a4823074faa7f6203ca431b | 5b5f90c99f66587cea981a640063a54b6ea75185 | /src/main/java/com/coxandkings/travel/operations/consumer/listners/impl/ThirdPartyVouchersListenerImpl.java | 136cccfa68ad816f0279da8423190e4f48a33712 | [] | no_license | suyash-capiot/operations | 02558d5f4c72a895d4a7e7e743495a118b953e97 | b6ad01cbdd60190e3be1f2a12d94258091fec934 | refs/heads/master | 2020-04-02T06:22:30.589898 | 2018-10-26T12:11:11 | 2018-10-26T12:11:11 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,857 | java | package com.coxandkings.travel.operations.consumer.listners.impl;
import com.coxandkings.travel.operations.consumer.listners.BookingListenerType;
import com.coxandkings.travel.operations.consumer.listners.ThirdPartyVoucherListener;
import com.coxandkings.travel.operations.exceptions.OperationException;
import com.coxandkings.travel.operations.model.booking.KafkaBookingMessage;
import com.coxandkings.travel.operations.model.core.OpsBooking;
import com.coxandkings.travel.operations.utils.thirdpartyvouchers.AssignVoucherCode;
import org.json.JSONException;
import org.quartz.SchedulerException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Lookup;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.annotation.Scope;
import org.springframework.scheduling.annotation.Async;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.text.ParseException;
@Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE)
public class ThirdPartyVouchersListenerImpl implements ThirdPartyVoucherListener {
@Autowired
private AssignVoucherCode assignVoucherCode;
@Override
public BookingListenerType getListenerType() {
return BookingListenerType.THIRD_PARTY_VOUCHERS;
}
@Async
@Override
public void processBooking(OpsBooking opsBooking, KafkaBookingMessage message) throws IOException, OperationException, ParseException, SchedulerException, JSONException, IllegalAccessException, InvocationTargetException {
System.out.println("*****Start Flow for ThirdPartyVouchers*****");
assignVoucherCode.processBooking(opsBooking);
}
@Lookup
public ThirdPartyVouchersListenerImpl getThirdPartyVouchersListener() {
return null;
}
}
| [
"sahil@capiot.com"
] | sahil@capiot.com |
f51bda82a80eef31a18167c15c1d599f1dbcb5f6 | 0d62f25696699a0b4c3d2fd67978dec8755d1439 | /back/woo/BoardSwagger/src/main/java/com/ssafy/edu/dto/AccessTokenRequest.java | 024c346ef52f6e5faa6fd0887650734663865214 | [] | no_license | ssshhh0402/dev42.195 | 352af17434915e25d83215b5f519d240f64c0c82 | b9d6fa2757f2435831ceabecf9d60a64fc1245ff | refs/heads/master | 2022-09-08T10:14:42.820825 | 2020-05-27T14:25:53 | 2020-05-27T14:25:53 | 238,406,472 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 826 | java | package com.ssafy.edu.dto;
public class AccessTokenRequest {
private String access_token;
private String scope;
private String token_type;
private String login_access_token;
public AccessTokenRequest() {
super();
}
public String getAccess_token() {
return access_token;
}
public void setAccess_token(String access_token) {
this.access_token = access_token;
}
public String getScope() {
return scope;
}
public void setScope(String scope) {
this.scope = scope;
}
public String getToken_type() {
return token_type;
}
public void setToken_type(String token_type) {
this.token_type = token_type;
}
public String getLogin_access_token() {
return login_access_token;
}
public void setLogin_access_token(String login_access_token) {
this.login_access_token = login_access_token;
}
}
| [
"an286@naver.com"
] | an286@naver.com |
016ac7c709f97070022ff6af57b9b7bd628ad48e | 4e533efde70e49c26dc132c3f75d33fe7f0d85cc | /src/main/java/examples/weibo4j/examples/location/SearchPoisByLocation.java | 6590852e1d0398243aa6f2511fe42734a96fb7ec | [] | no_license | xlfxulinfeng/framework | 3d4228a915a734cc63a48465d524f11fabdfb6cc | d98f7dc1ff8d25eb2e2f0de0152117dfd3b06228 | refs/heads/master | 2021-06-08T21:34:41.811606 | 2017-01-09T02:42:32 | 2017-01-09T02:42:32 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 609 | java | package examples.weibo4j.examples.location;
import java.util.List;
import weibo4j.Location;
import examples.weibo4j.examples.oauth2.Log;
import weibo4j.model.Poisition;
import weibo4j.model.WeiboException;
public class SearchPoisByLocation {
public static void main(String[] args) {
String access_token = args[0];
String q = args[1];
Location l = new Location(access_token);
try {
List<Poisition> list = l.searchPoisByLocationByQ(q);
for (Poisition p : list) {
Log.logInfo(p.toString());
}
} catch (WeiboException e) {
e.printStackTrace();
}
}
}
| [
"honeybee_bee@126.com"
] | honeybee_bee@126.com |
0221c61af46be109c3fe33ef701cd61bb12a0c8f | 39faf42e8e3da4b6788944b26d0b8113a438aaee | /src/main/java/plugins/reports/ibm/IBMqmForAllure.java | a29b25bd47ff6ab33676f6b6351141cda12ea994 | [] | no_license | ssnechkin/RSAutotest | bc7b3015ae3b20f9cf9fcf04d96e457ceb76d077 | 9856cb4824e6e39e5729f0a993fdf2549069f9f4 | refs/heads/master | 2020-03-24T07:29:27.254088 | 2018-08-04T08:49:36 | 2018-08-04T08:49:36 | 142,565,950 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,130 | java | package plugins.reports.ibm;
import modules.testExecutor.interfaces.SuiteDatas;
import modules.testExecutor.interfaces.TestDatas;
import modules.testExecutor.templates.TestThread;
import plugins.interfaces.ReportWriter;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.Map;
import java.util.Properties;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.ExecutorService;
public class IBMqmForAllure implements ReportWriter {
private ConcurrentHashMap<String, String> settings = new ConcurrentHashMap<>();
private SuiteDatas suite;
private TestDatas test;
private ConcurrentHashMap<Long, CopyOnWriteArrayList<TestThread>> testThreads;
private String reportDirectory = "report";
private String allurePluginName = "Allure";
private String reportUID = "ReportUID";
private String programFilesDirectory;
private String progressFile = System.getenv("qm_ExecutionPropertiesFile");
private String qm_AttachmentsFile = System.getenv("qm_AttachmentsFile");
private Integer allSteps = 0;
private ExecutorService executorService;
@Override
public String getPluginName() {
return "IBM_QM_ALLURE";
}
@Override
public ConcurrentHashMap<String, ConcurrentHashMap<String, String>> getDefaultSettings() {
ConcurrentHashMap<String, ConcurrentHashMap<String, String>> properties = new ConcurrentHashMap<>();
ConcurrentHashMap<String, String> settings;
settings = new ConcurrentHashMap<>();
settings.put("ReportWebPath", "");
properties.put("URL-адрес на Allure-отчёт в IBM QM. Приммер: http://10.0.2.85/report/allure2/ ", settings);
return properties;
}
@Override
public void set(SuiteDatas suite, TestDatas test, ConcurrentHashMap<Long, CopyOnWriteArrayList<TestThread>> testThreads, String programFilesDirectory, String reportDirectory, ConcurrentHashMap<String, String> settings, ExecutorService executorService) {
this.settings.clear();
this.settings.putAll(settings);
this.suite = suite;
this.test = test;
this.testThreads = testThreads;
this.reportDirectory = reportDirectory;
this.programFilesDirectory = programFilesDirectory;
this.executorService = executorService;
if (progressFile != null) {
// Цикл по наборам <id набора, список тестов в наборе>
for (Map.Entry<Long, CopyOnWriteArrayList<TestThread>> threads : testThreads.entrySet()) {
// Цикл по тестам в наборе
for (TestThread testThread : threads.getValue()) {
TestDatas testDatas = testThread.getSuitesMap().get(testThread.getSuiteId()).getTestsMap().get(testThread.getTestId());
allSteps += testDatas.getNumberOfSteps();
}
}
}
}
@Override
public void addAttachment(String name, byte[] attachment) {
}
@Override
public void suiteStarted(String name) {
}
@Override
public void suiteFailure() {
}
@Override
public void suiteFinished() {
}
@Override
public void testStarted(String name) {
}
@Override
public void testCanceled(String message) {
}
@Override
public void testBroken(String message) {
}
@Override
public void testFailure(String message) {
}
@Override
public void testFinished() {
}
@Override
public void stepStarted(String name) {
}
@Override
public void stepBroken(String message) {
}
@Override
public void stepFailure(String message) {
}
@Override
public void stepCanceled() {
}
@Override
public void stepFinished() {
threadStart();
}
@Override
public void allSuiteFinished() {
threadStart();
if (new File(programFilesDirectory + File.separator + allurePluginName + ".properties").exists() && qm_AttachmentsFile != null) {
suite.getProgramLogger().info("");
suite.getProgramLogger().info("Формирование ссылок для IBM QM");
ConcurrentHashMap<String, String> allureSettings = new ConcurrentHashMap<>();
try {
allureSettings = test.getProgramSettings().readPropertiesFile(programFilesDirectory + File.separator + allurePluginName + ".properties", null, false);
} catch (IOException e) {
//suite.printStackTrace(e);
}
try {
reportUID = allureSettings.get(reportUID);
if (reportUID != null) {
String[] reportIBMQM = {
System.getProperty("line.separator") + "ReportAllure=" + settings.get("ReportWebPath") + reportUID + "/index.html#suites",
System.getProperty("line.separator") + "Report.zip=" + settings.get("ReportWebPath") + reportUID + "/" + allureSettings.get("ZipName") + ".zip"
};
writeFile(qm_AttachmentsFile, reportIBMQM);
}
suite.getProgramLogger().info("Cсылки для IBM QM cормированы");
} catch (Throwable t) {
suite.printStackTrace(t);
}
}
}
private void threadStart() {
if (progressFile != null) {
Thread thread = new Thread(new Runnable() {
public void run() {
writeProgress();
try {
Thread.sleep(4320);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
});
executorService.execute(thread);
}
}
private void writeProgress() {
Integer progress = 0;
// Цикл по наборам <id набора, список тестов в наборе>
for (Map.Entry<Long, CopyOnWriteArrayList<TestThread>> threads : testThreads.entrySet()) {
// Цикл по тестам в наборе
for (TestThread testThread : threads.getValue()) {
TestDatas testDatas = testThread.getSuitesMap().get(testThread.getSuiteId()).getTestsMap().get(testThread.getTestId());
progress += testDatas.getNumberOfСompletedSteps();
}
}
progress = Math.round((progress * 100) / allSteps);
if (progress >= 100) progress = 99;
try {
Properties props = new Properties();
props.setProperty("progress", progress + "");
FileOutputStream out = new FileOutputStream(progressFile);
props.store(out, progress + "");
out.close();
} catch (Exception e) {
suite.printStackTrace(e);
}
}
private void writeFile(String filePathAndName, String[] data) {
OutputStream os = null;
if (filePathAndName != null) {
if (!new File(filePathAndName).exists()) {
try {
new File(filePathAndName).createNewFile();
} catch (Exception e) {
suite.printStackTrace(e);
}
}
if (filePathAndName != null && new File(filePathAndName).exists()) {
try {
os = new FileOutputStream(new File(filePathAndName));
for (String text : data) {
os.write((text + "\n").getBytes(), 0, text.length());
}
} catch (IOException e) {
suite.printStackTrace(e);
} finally {
try {
os.close();
} catch (IOException e) {
suite.printStackTrace(e);
}
}
}
}
}
} | [
"sergey.nechkin@redsys.ru"
] | sergey.nechkin@redsys.ru |
e4ed52b8de792d3108b5aea638d704e0f077e3f6 | 3a7fe3e6f2454135072c128074b1f1c74f20cd24 | /custom/amway/amwaynotificationengine/gensrc/org/amway/notification/engine/jalo/expressupdate/cron/GeneratedProductExpressUpdateCleanerCronJob.java | 31a137c8c096681129af6ab11695e55417b4239a | [] | no_license | nitin201187/amway | 74a2d4f4efcb55048eaca892c8bbe007c2fb6d65 | a26f2f0a3381ea31be1ca568545ff8c576cb4262 | refs/heads/master | 2021-01-10T06:23:13.084177 | 2017-07-20T04:56:55 | 2017-07-20T04:56:55 | 54,173,575 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,584 | java | /*
* ----------------------------------------------------------------
* --- WARNING: THIS FILE IS GENERATED AND WILL BE OVERWRITTEN! ---
* --- Generated at 17 Mar, 2016 10:23:00 PM ---
* ----------------------------------------------------------------
*/
package org.amway.notification.engine.jalo.expressupdate.cron;
import de.hybris.platform.cronjob.jalo.CronJob;
import de.hybris.platform.jalo.Item.AttributeMode;
import de.hybris.platform.jalo.SessionContext;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import org.amway.notification.engine.constants.YcommercewebservicesConstants;
/**
* Generated class for type {@link org.amway.notification.engine.jalo.expressupdate.cron.ProductExpressUpdateCleanerCronJob ProductExpressUpdateCleanerCronJob}.
*/
@SuppressWarnings({"deprecation","unused","cast","PMD"})
public abstract class GeneratedProductExpressUpdateCleanerCronJob extends CronJob
{
/** Qualifier of the <code>ProductExpressUpdateCleanerCronJob.queueTimeLimit</code> attribute **/
public static final String QUEUETIMELIMIT = "queueTimeLimit";
protected static final Map<String, AttributeMode> DEFAULT_INITIAL_ATTRIBUTES;
static
{
final Map<String, AttributeMode> tmp = new HashMap<String, AttributeMode>(CronJob.DEFAULT_INITIAL_ATTRIBUTES);
tmp.put(QUEUETIMELIMIT, AttributeMode.INITIAL);
DEFAULT_INITIAL_ATTRIBUTES = Collections.unmodifiableMap(tmp);
}
@Override
protected Map<String, AttributeMode> getDefaultAttributeModes()
{
return DEFAULT_INITIAL_ATTRIBUTES;
}
/**
* <i>Generated method</i> - Getter of the <code>ProductExpressUpdateCleanerCronJob.queueTimeLimit</code> attribute.
* @return the queueTimeLimit - Only elements older than specified value (in minutes) will be removed from the queue
*/
public Integer getQueueTimeLimit(final SessionContext ctx)
{
return (Integer)getProperty( ctx, QUEUETIMELIMIT);
}
/**
* <i>Generated method</i> - Getter of the <code>ProductExpressUpdateCleanerCronJob.queueTimeLimit</code> attribute.
* @return the queueTimeLimit - Only elements older than specified value (in minutes) will be removed from the queue
*/
public Integer getQueueTimeLimit()
{
return getQueueTimeLimit( getSession().getSessionContext() );
}
/**
* <i>Generated method</i> - Getter of the <code>ProductExpressUpdateCleanerCronJob.queueTimeLimit</code> attribute.
* @return the queueTimeLimit - Only elements older than specified value (in minutes) will be removed from the queue
*/
public int getQueueTimeLimitAsPrimitive(final SessionContext ctx)
{
Integer value = getQueueTimeLimit( ctx );
return value != null ? value.intValue() : 0;
}
/**
* <i>Generated method</i> - Getter of the <code>ProductExpressUpdateCleanerCronJob.queueTimeLimit</code> attribute.
* @return the queueTimeLimit - Only elements older than specified value (in minutes) will be removed from the queue
*/
public int getQueueTimeLimitAsPrimitive()
{
return getQueueTimeLimitAsPrimitive( getSession().getSessionContext() );
}
/**
* <i>Generated method</i> - Setter of the <code>ProductExpressUpdateCleanerCronJob.queueTimeLimit</code> attribute.
* @param value the queueTimeLimit - Only elements older than specified value (in minutes) will be removed from the queue
*/
public void setQueueTimeLimit(final SessionContext ctx, final Integer value)
{
setProperty(ctx, QUEUETIMELIMIT,value);
}
/**
* <i>Generated method</i> - Setter of the <code>ProductExpressUpdateCleanerCronJob.queueTimeLimit</code> attribute.
* @param value the queueTimeLimit - Only elements older than specified value (in minutes) will be removed from the queue
*/
public void setQueueTimeLimit(final Integer value)
{
setQueueTimeLimit( getSession().getSessionContext(), value );
}
/**
* <i>Generated method</i> - Setter of the <code>ProductExpressUpdateCleanerCronJob.queueTimeLimit</code> attribute.
* @param value the queueTimeLimit - Only elements older than specified value (in minutes) will be removed from the queue
*/
public void setQueueTimeLimit(final SessionContext ctx, final int value)
{
setQueueTimeLimit( ctx,Integer.valueOf( value ) );
}
/**
* <i>Generated method</i> - Setter of the <code>ProductExpressUpdateCleanerCronJob.queueTimeLimit</code> attribute.
* @param value the queueTimeLimit - Only elements older than specified value (in minutes) will be removed from the queue
*/
public void setQueueTimeLimit(final int value)
{
setQueueTimeLimit( getSession().getSessionContext(), value );
}
}
| [
"nitin201187@gmail.com"
] | nitin201187@gmail.com |
fda14568c9e0ea50f328a93fa910cdc32d01a453 | 744e9d8c4d9b93179fc903fdd546abbdcedc1551 | /18周 eureka/tristeza-cloud/common/tristeza-cloud-shared-pojo/src/main/java/com/tristeza/enums/BooleanEnum.java | 4536c1c6118340ae0b8064ec9bf6390cb998f039 | [] | no_license | CoDeleven/architect | 6d237517ea4081aca0322bfef2f70539e89accf6 | 1f1c55546e7d428b061be304d4031cc70c187091 | refs/heads/master | 2023-03-03T09:26:14.326775 | 2021-02-10T17:00:53 | 2021-02-10T17:00:53 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 292 | java | package com.tristeza.enums;
/**
* 性别枚举
*/
public enum BooleanEnum {
FALSE(0, "否"),
TRUE(1, "是");
public final Integer type;
public final String value;
BooleanEnum(Integer type, String value) {
this.type = type;
this.value = value;
}
}
| [
"1768205721@qq.com"
] | 1768205721@qq.com |
261d62292ddd88349a474b4fd013e0e3371198ce | 282f22926e912cb35077052416d5ab83a6a6647b | /loadingbar/src/test/java/com/example/loadingbar/ExampleUnitTest.java | 5c5946bfad11f7f0f015ae6fdbc4d2f964568780 | [] | no_license | dropdeveloper/LoadingBarVertical | 0d74ab4ac296aecbc97bd0c04a5fe010f5454e2f | 3e5a9b5923a7a8254d52a281f005117d80f29def | refs/heads/master | 2020-03-30T06:52:30.848408 | 2018-09-29T19:19:37 | 2018-09-29T19:19:37 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 383 | java | package com.example.loadingbar;
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() {
assertEquals(4, 2 + 2);
}
} | [
"zaroor.tech@gmail.com"
] | zaroor.tech@gmail.com |
8bc9baae870f50d8645fb697e2603ed3d062f620 | 7613d965928f4c7ba154b3fe61a13d883172beb7 | /src/com/shekspeare/algorithms/epi/GCD.java | e4fe890a80926d122c7bcaf79bcecf2d95d88c61 | [] | no_license | abhishe3/Algorithms | 251d83dd756fd650d5283294c8175186dc2b9a65 | 67504034f4cb45a760692782dd404ffd51963693 | refs/heads/master | 2020-07-07T05:39:26.182535 | 2018-02-05T07:57:53 | 2018-02-05T07:57:53 | 66,907,269 | 0 | 0 | null | 2016-08-30T05:42:44 | 2016-08-30T04:43:47 | Java | UTF-8 | Java | false | false | 285 | java | package com.shekspeare.algorithms.epi;
public class GCD {
public static int getGCD(int x, int y){
return (y==0)?x:getGCD(y,x%y);
}
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println(getGCD(13,4));
}
}
| [
"abashok@ABASHOK-LAP1.oradev.oraclecorp.com"
] | abashok@ABASHOK-LAP1.oradev.oraclecorp.com |
368bd0fd0fa6b364549f36be51b5161a1c0ada53 | ddbbfddfe0773fd5ae35d9afbe0931aefc24c472 | /Avancement/Minijava/src/AST/Raxiome.java | 9e290378a93ef886def57e78040f37cb67b0e261 | [] | no_license | Dimitri78000/MiniJava_compilateur | d68874f4ac1debb829ea13a5ae5c74a3f5b23f84 | 08151aa02d6cafe21d276496ffba826461e28383 | refs/heads/master | 2020-04-10T21:54:12.864900 | 2019-01-08T13:31:46 | 2019-01-08T13:31:46 | 161,309,839 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 285 | java | package AST;
/** Raxiome : RklassMain km; Lklass kl; */
public class Raxiome extends ASTNode {
public RklassMain km;
public Lklass kl;
public Raxiome(RklassMain km, Lklass kl) {
super(km,kl);
this.km=km; this.kl=kl;
}
public void accept(ASTVisitor v) { v.visit(this); }
}
| [
"dimitri.leurs@telecom-sudparis.eu"
] | dimitri.leurs@telecom-sudparis.eu |
09e97fa74889c89122199f2125add1cebbd242d0 | 264da5308210f9d2e5ff2f53ab130f4f308a7872 | /geotrans/GEOTRANS3/java_gui/geotrans3/parameters/MapProjection3Parameters.java | b89065fbbe23d76958d19cacf36e190cb4468fbd | [
"MIT"
] | permissive | arpg/GeoCon | d2aa7d2a777953c74e8b784bad1a281995ccbe48 | 7c924742ba5d4a76e95ec0868fe3fb31df6d208f | refs/heads/master | 2021-01-17T21:34:50.119380 | 2015-01-27T23:06:13 | 2015-01-27T23:06:13 | 22,550,285 | 1 | 2 | null | 2015-01-27T23:06:13 | 2014-08-02T16:24:25 | C++ | UTF-8 | Java | false | false | 1,621 | java | // CLASSIFICATION: UNCLASSIFIED
/*
* MapProjection3Parameters.java
*
* Created on April 4, 2007, 9:16 AM
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package geotrans3.parameters;
/**
*
* @author comstam
*/
public class MapProjection3Parameters extends CoordinateSystemParameters
{
private double centralMeridian;
private double falseEasting;
private double falseNorthing;
/** Creates a new instance of MapProjection3Parameters */
public MapProjection3Parameters(int coordinateType, double _centralMeridian, double _falseEasting, double _falseNorthing)
{
super(coordinateType);
centralMeridian = _centralMeridian;
falseEasting = _falseEasting;
falseNorthing = _falseNorthing;
}
/**
* Tests if this object contains the same information as another
* MapProjection3Parameters object.
* .
* @param parameters MapProjection3Parameters object to compare
* @return true if the information is the same, otherwise false
*/
public boolean equal(MapProjection3Parameters parameters)
{
if(super.equal(parameters) && centralMeridian == parameters.getCentralMeridian() && falseEasting == parameters.getFalseEasting() && falseNorthing == parameters.getFalseNorthing())
return true;
else
return false;
}
public double getCentralMeridian()
{
return centralMeridian;
}
public double getFalseEasting()
{
return falseEasting;
}
public double getFalseNorthing()
{
return falseNorthing;
}
}
// CLASSIFICATION: UNCLASSIFIED
| [
"jackmorrison1@gmail.com"
] | jackmorrison1@gmail.com |
c207fee866fee7f5088c198797fb8b0615b94c02 | 8aeb5a89c1f1451a031be0d6d426c762d96d3176 | /app/src/test/java/com/asum/xphotoview/ExampleUnitTest.java | 94539aaee84c01e4b797f7418e7b8c8853473f05 | [] | no_license | asum0007/XPhotoView | e99a3907e00fab6bf11ad1ef826a6a7cf61551e1 | d15d8ab172616d631841ccea1c8a821ee617cdb0 | refs/heads/master | 2016-09-14T18:26:12.714269 | 2016-04-19T12:08:27 | 2016-04-19T12:08:27 | 56,593,461 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 312 | java | package com.asum.xphotoview;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* To work on unit tests, switch the Test Artifact in the Build Variants view.
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
} | [
"229302602@qq.com"
] | 229302602@qq.com |
9c62e00a031311a34d13bf5fa2a0cf2132dadc26 | bc72a5194f25cb94de0b70391ccbebe1732d4742 | /LAB 2/opr.java | 2432a1930dec80023802c99e4ed4d0ef0621221a | [] | no_license | hassanmirokhani/JAVA | f94eef0ef0590cd135ff857a3dee255d3ef2e865 | 52195d0a91c487e7a3c66926539a9d5ed93e8eba | refs/heads/master | 2020-06-04T09:30:29.806058 | 2019-06-14T15:33:04 | 2019-06-14T15:33:04 | 191,967,289 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 205 | java | class opr
{
public static void main(String arg[])
{
int a=10;
System.out.println((a+=2));
System.out.println((a-=2));
System.out.println((a*=2));
System.out.println((a/=2));
System.out.print((a%=2));
}
}
| [
"hassanmuhammad535@gmail.com"
] | hassanmuhammad535@gmail.com |
824183ea084997a4409344bd36824fd64b6a46e3 | 35551fbbf28a6c41bc2ff4398a70e1d124dc1761 | /dz14/src/dz14/File.java | bf775c543ec22cd460991a0eb56f6f4525aefaa2 | [] | no_license | artem70323/javaProjects | 2b72edb887a93c920e69c3094f647a7fbb9d9474 | 7b6db932b96df8deafa756a3f618048e3a4c29bb | refs/heads/master | 2021-07-05T11:29:14.609550 | 2017-09-27T13:02:40 | 2017-09-27T13:02:40 | 92,170,992 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 805 | java | package dz14;
import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class File {
public static void main(String[] args) {
System.out.println("Введите имя файла");
Scanner scan = new Scanner(System.in);
String file = scan.nextLine();
String regex = "\\.\\w+$";
Pattern p = Pattern.compile(regex);
Matcher m = p.matcher(file);
m.find();
System.out.println("Расширение файла: " + m.group());
if (m.group().equals(".xml") || m.group().equals(".json")) {
System.out.println("Ваш формат нам подходит");
} else {
System.out.println("Ваш формат нам не подходит");
}
}
}
| [
"artem70323@gmail.com"
] | artem70323@gmail.com |
e993e12d2b732946ca3660cc79cf566a4d9ed9d1 | 6f98fb1df78eb4a66b6eb48ef94f897168fb3b98 | /Lab_06_AssociativeArrays/src/com/company/P05_Largest3Number.java | 9a229de9b89402167781e89adef3517e708e116a | [
"Apache-2.0"
] | permissive | s3valkov/Technology-Fundamentals | 9c069aa672fd44d9fd2373121fa32e553cc45c0b | a219f0be2dbc29bb5f239a114b8dad235c7f508a | refs/heads/master | 2020-04-11T19:38:18.099256 | 2019-01-04T15:45:27 | 2019-01-04T15:45:27 | 162,041,427 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 727 | java | package com.company;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;
import java.util.stream.Collectors;
public class P05_Largest3Number {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
List<Integer> numbers = Arrays.stream(scanner.nextLine().split(" "))
.map(Integer::parseInt)
.sorted((n1, n2) -> n2.compareTo(n1))
.collect(Collectors.toList());
int count = 0;
for (Integer number : numbers) {
if (count ==3) {
break;
}
System.out.print(number + " ");
count++;
}
}
}
| [
"noreply@github.com"
] | noreply@github.com |
5712dd45ea58b258998d1030b37c8a2748304070 | ff880f88d7d7eccbf7fb25cebd47881df17bd39f | /i2mapreduce.git/trunk/src/mapred/org/apache/hadoop/mapred/JobConf.java | f72457cf4b3035acf100a9c311b0442a7cf83cde | [] | no_license | hookk/i2mapreduce | 435834c01382a122777e5bf479e20ba3070ceea6 | 381cc5c93c72713c2505e66fac0c043aa967c365 | refs/heads/master | 2020-04-08T14:07:08.926014 | 2016-05-10T08:53:40 | 2016-05-10T08:53:40 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 81,524 | java | /**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.hadoop.mapred;
import java.io.IOException;
import java.net.URL;
import java.net.URLDecoder;
import java.util.Enumeration;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.filecache.DistributedCache;
import org.apache.hadoop.fs.FileStatus;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.io.*;
import org.apache.hadoop.io.compress.CompressionCodec;
import org.apache.hadoop.mapred.IFile.PreserveFile;
import org.apache.hadoop.mapred.IdentityEasyReducer;
import org.apache.hadoop.mapred.lib.IdentityIterativeMapper;
import org.apache.hadoop.mapred.lib.IdentityIterativeReducer;
import org.apache.hadoop.mapred.lib.IdentityMapper;
import org.apache.hadoop.mapred.lib.IdentityProjector;
import org.apache.hadoop.mapred.lib.IdentityReducer;
import org.apache.hadoop.mapred.lib.HashPartitioner;
import org.apache.hadoop.mapred.lib.IntTextKVInputFormat;
import org.apache.hadoop.mapred.lib.IntTextKVOutputFormat;
import org.apache.hadoop.mapred.lib.KeyFieldBasedComparator;
import org.apache.hadoop.mapred.lib.KeyFieldBasedPartitioner;
import org.apache.hadoop.mapred.lib.StaticDataComparator;
import org.apache.hadoop.security.Credentials;
import org.apache.hadoop.util.ReflectionUtils;
import org.apache.hadoop.util.Tool;
/**
* A map/reduce job configuration.
*
* <p><code>JobConf</code> is the primary interface for a user to describe a
* map-reduce job to the Hadoop framework for execution. The framework tries to
* faithfully execute the job as-is described by <code>JobConf</code>, however:
* <ol>
* <li>
* Some configuration parameters might have been marked as
* <a href="{@docRoot}/org/apache/hadoop/conf/Configuration.html#FinalParams">
* final</a> by administrators and hence cannot be altered.
* </li>
* <li>
* While some job parameters are straight-forward to set
* (e.g. {@link #setNumReduceTasks(int)}), some parameters interact subtly
* rest of the framework and/or job-configuration and is relatively more
* complex for the user to control finely (e.g. {@link #setNumMapTasks(int)}).
* </li>
* </ol></p>
*
* <p><code>JobConf</code> typically specifies the {@link Mapper}, combiner
* (if any), {@link Partitioner}, {@link Reducer}, {@link InputFormat} and
* {@link OutputFormat} implementations to be used etc.
*
* <p>Optionally <code>JobConf</code> is used to specify other advanced facets
* of the job such as <code>Comparator</code>s to be used, files to be put in
* the {@link DistributedCache}, whether or not intermediate and/or job outputs
* are to be compressed (and how), debugability via user-provided scripts
* ( {@link #setMapDebugScript(String)}/{@link #setReduceDebugScript(String)}),
* for doing post-processing on task logs, task's stdout, stderr, syslog.
* and etc.</p>
*
* <p>Here is an example on how to configure a job via <code>JobConf</code>:</p>
* <p><blockquote><pre>
* // Create a new JobConf
* JobConf job = new JobConf(new Configuration(), MyJob.class);
*
* // Specify various job-specific parameters
* job.setJobName("myjob");
*
* FileInputFormat.setInputPaths(job, new Path("in"));
* FileOutputFormat.setOutputPath(job, new Path("out"));
*
* job.setMapperClass(MyJob.MyMapper.class);
* job.setCombinerClass(MyJob.MyReducer.class);
* job.setReducerClass(MyJob.MyReducer.class);
*
* job.setInputFormat(SequenceFileInputFormat.class);
* job.setOutputFormat(SequenceFileOutputFormat.class);
* </pre></blockquote></p>
*
* @see JobClient
* @see ClusterStatus
* @see Tool
* @see DistributedCache
*/
public class JobConf extends Configuration {
private static final Log LOG = LogFactory.getLog(JobConf.class);
static{
Configuration.addDefaultResource("mapred-default.xml");
Configuration.addDefaultResource("mapred-site.xml");
}
/**
* @deprecated Use {@link #MAPRED_JOB_MAP_MEMORY_MB_PROPERTY} and
* {@link #MAPRED_JOB_REDUCE_MEMORY_MB_PROPERTY}
*/
@Deprecated
public static final String MAPRED_TASK_MAXVMEM_PROPERTY =
"mapred.task.maxvmem";
/**
* @deprecated
*/
@Deprecated
public static final String UPPER_LIMIT_ON_TASK_VMEM_PROPERTY =
"mapred.task.limit.maxvmem";
/**
* @deprecated
*/
@Deprecated
public static final String MAPRED_TASK_DEFAULT_MAXVMEM_PROPERTY =
"mapred.task.default.maxvmem";
/**
* @deprecated
*/
@Deprecated
public static final String MAPRED_TASK_MAXPMEM_PROPERTY =
"mapred.task.maxpmem";
/**
* A value which if set for memory related configuration options,
* indicates that the options are turned off.
*/
public static final long DISABLED_MEMORY_LIMIT = -1L;
/**
* Property name for the configuration property mapred.local.dir
*/
public static final String MAPRED_LOCAL_DIR_PROPERTY = "mapred.local.dir";
/**
* Name of the queue to which jobs will be submitted, if no queue
* name is mentioned.
*/
public static final String DEFAULT_QUEUE_NAME = "default";
static final String MAPRED_JOB_MAP_MEMORY_MB_PROPERTY =
"mapred.job.map.memory.mb";
static final String MAPRED_JOB_REDUCE_MEMORY_MB_PROPERTY =
"mapred.job.reduce.memory.mb";
static final String MR_ACLS_ENABLED = "mapred.acls.enabled";
static final String MR_ADMINS = "mapreduce.cluster.administrators";
/**
* Configuration key to set the java command line options for the child
* map and reduce tasks.
*
* Java opts for the task tracker child processes.
* The following symbol, if present, will be interpolated: @taskid@.
* It is replaced by current TaskID. Any other occurrences of '@' will go
* unchanged.
* For example, to enable verbose gc logging to a file named for the taskid in
* /tmp and to set the heap maximum to be a gigabyte, pass a 'value' of:
* -Xmx1024m -verbose:gc -Xloggc:/tmp/@taskid@.gc
*
* The configuration variable {@link #MAPRED_TASK_ULIMIT} can be used to
* control the maximum virtual memory of the child processes.
*
* The configuration variable {@link #MAPRED_TASK_ENV} can be used to pass
* other environment variables to the child processes.
*
* @deprecated Use {@link #MAPRED_MAP_TASK_JAVA_OPTS} or
* {@link #MAPRED_REDUCE_TASK_JAVA_OPTS}
*/
@Deprecated
public static final String MAPRED_TASK_JAVA_OPTS = "mapred.child.java.opts";
/**
* Configuration key to set the java command line options for the map tasks.
*
* Java opts for the task tracker child map processes.
* The following symbol, if present, will be interpolated: @taskid@.
* It is replaced by current TaskID. Any other occurrences of '@' will go
* unchanged.
* For example, to enable verbose gc logging to a file named for the taskid in
* /tmp and to set the heap maximum to be a gigabyte, pass a 'value' of:
* -Xmx1024m -verbose:gc -Xloggc:/tmp/@taskid@.gc
*
* The configuration variable {@link #MAPRED_MAP_TASK_ULIMIT} can be used to
* control the maximum virtual memory of the map processes.
*
* The configuration variable {@link #MAPRED_MAP_TASK_ENV} can be used to pass
* other environment variables to the map processes.
*/
public static final String MAPRED_MAP_TASK_JAVA_OPTS =
"mapred.map.child.java.opts";
/**
* Configuration key to set the java command line options for the reduce tasks.
*
* Java opts for the task tracker child reduce processes.
* The following symbol, if present, will be interpolated: @taskid@.
* It is replaced by current TaskID. Any other occurrences of '@' will go
* unchanged.
* For example, to enable verbose gc logging to a file named for the taskid in
* /tmp and to set the heap maximum to be a gigabyte, pass a 'value' of:
* -Xmx1024m -verbose:gc -Xloggc:/tmp/@taskid@.gc
*
* The configuration variable {@link #MAPRED_REDUCE_TASK_ULIMIT} can be used
* to control the maximum virtual memory of the reduce processes.
*
* The configuration variable {@link #MAPRED_REDUCE_TASK_ENV} can be used to
* pass process environment variables to the reduce processes.
*/
public static final String MAPRED_REDUCE_TASK_JAVA_OPTS =
"mapred.reduce.child.java.opts";
public static final String DEFAULT_MAPRED_TASK_JAVA_OPTS = "-Xmx200m";
/**
* Configuration key to set the maximum virutal memory available to the child
* map and reduce tasks (in kilo-bytes).
*
* Note: This must be greater than or equal to the -Xmx passed to the JavaVM
* via {@link #MAPRED_TASK_JAVA_OPTS}, else the VM might not start.
*
* @deprecated Use {@link #MAPRED_MAP_TASK_ULIMIT} or
* {@link #MAPRED_REDUCE_TASK_ULIMIT}
*/
@Deprecated
public static final String MAPRED_TASK_ULIMIT = "mapred.child.ulimit";
/**
* Configuration key to set the maximum virutal memory available to the
* map tasks (in kilo-bytes).
*
* Note: This must be greater than or equal to the -Xmx passed to the JavaVM
* via {@link #MAPRED_MAP_TASK_JAVA_OPTS}, else the VM might not start.
*/
public static final String MAPRED_MAP_TASK_ULIMIT = "mapred.map.child.ulimit";
/**
* Configuration key to set the maximum virutal memory available to the
* reduce tasks (in kilo-bytes).
*
* Note: This must be greater than or equal to the -Xmx passed to the JavaVM
* via {@link #MAPRED_REDUCE_TASK_JAVA_OPTS}, else the VM might not start.
*/
public static final String MAPRED_REDUCE_TASK_ULIMIT =
"mapred.reduce.child.ulimit";
/**
* Configuration key to set the environment of the child map/reduce tasks.
*
* The format of the value is <code>k1=v1,k2=v2</code>. Further it can
* reference existing environment variables via <code>$key</code>.
*
* Example:
* <ul>
* <li> A=foo - This will set the env variable A to foo. </li>
* <li> B=$X:c This is inherit tasktracker's X env variable. </li>
* </ul>
*
* @deprecated Use {@link #MAPRED_MAP_TASK_ENV} or
* {@link #MAPRED_REDUCE_TASK_ENV}
*/
@Deprecated
public static final String MAPRED_TASK_ENV = "mapred.child.env";
/**
* Configuration key to set the maximum virutal memory available to the
* map tasks.
*
* The format of the value is <code>k1=v1,k2=v2</code>. Further it can
* reference existing environment variables via <code>$key</code>.
*
* Example:
* <ul>
* <li> A=foo - This will set the env variable A to foo. </li>
* <li> B=$X:c This is inherit tasktracker's X env variable. </li>
* </ul>
*/
public static final String MAPRED_MAP_TASK_ENV = "mapred.map.child.env";
/**
* Configuration key to set the maximum virutal memory available to the
* reduce tasks.
*
* The format of the value is <code>k1=v1,k2=v2</code>. Further it can
* reference existing environment variables via <code>$key</code>.
*
* Example:
* <ul>
* <li> A=foo - This will set the env variable A to foo. </li>
* <li> B=$X:c This is inherit tasktracker's X env variable. </li>
* </ul>
*/
public static final String MAPRED_REDUCE_TASK_ENV =
"mapred.reduce.child.env";
private Credentials credentials = new Credentials();
/**
* Construct a map/reduce job configuration.
*/
public JobConf() {
checkAndWarnDeprecation();
}
/**
* Construct a map/reduce job configuration.
*
* @param exampleClass a class whose containing jar is used as the job's jar.
*/
public JobConf(Class exampleClass) {
setJarByClass(exampleClass);
checkAndWarnDeprecation();
}
/**
* Construct a map/reduce job configuration.
*
* @param conf a Configuration whose settings will be inherited.
*/
public JobConf(Configuration conf) {
super(conf);
if (conf instanceof JobConf) {
JobConf that = (JobConf)conf;
credentials = that.credentials;
}
checkAndWarnDeprecation();
}
/** Construct a map/reduce job configuration.
*
* @param conf a Configuration whose settings will be inherited.
* @param exampleClass a class whose containing jar is used as the job's jar.
*/
public JobConf(Configuration conf, Class exampleClass) {
this(conf);
setJarByClass(exampleClass);
}
/** Construct a map/reduce configuration.
*
* @param config a Configuration-format XML job description file.
*/
public JobConf(String config) {
this(new Path(config));
}
/** Construct a map/reduce configuration.
*
* @param config a Configuration-format XML job description file.
*/
public JobConf(Path config) {
super();
addResource(config);
checkAndWarnDeprecation();
}
/** A new map/reduce configuration where the behavior of reading from the
* default resources can be turned off.
* <p/>
* If the parameter {@code loadDefaults} is false, the new instance
* will not load resources from the default files.
*
* @param loadDefaults specifies whether to load from the default files
*/
public JobConf(boolean loadDefaults) {
super(loadDefaults);
checkAndWarnDeprecation();
}
/**
* Get credentials for the job.
* @return credentials for the job
*/
public Credentials getCredentials() {
return credentials;
}
void setCredentials(Credentials credentials) {
this.credentials = credentials;
}
//************************************************************************************************
// Yanfeng: set the distance threshold
public void setDistanceThreshold(float threshold) {
setFloat("mapred.iterative.terminate.threshold", threshold);
}
public float getDistanceThreshold() {
return getFloat("mapred.iterative.terminate.threshold", -1);
}
public void setFilterThreshold(float threshold) {
setFloat("mapred.incremental.filter.threshold", threshold);
}
public float getFilterThreshold() {
return getFloat("mapred.incremental.filter.threshold", -1);
}
// Yanfeng: set the job is iterative or not
public void setIterative(boolean iterative) {
set("mapred.iterative", Boolean.toString(iterative));
}
public boolean isIterative() {
return getBoolean("mapred.iterative", false);
}
// Yanfeng: set the job is iterative distribution job or not
public void setDataDistribution(boolean distributionjob) {
set("mapred.iterative.distribution.job", Boolean.toString(distributionjob));
}
public boolean isDataDistribution() {
return getBoolean("mapred.iterative.distribution.job", false);
}
public void setPreserve(boolean preserve) {
setBoolean("mapred.iterative.preserve", preserve);
}
public boolean isPreserve() {
return getBoolean("mapred.iterative.preserve", false);
}
public void setEasyPreserve(boolean preserve) {
setBoolean("mapred.easy.preserve", preserve);
}
public boolean isEasyPreserve() {
return getBoolean("mapred.easy.preserve", false);
}
public void setEasyIncremental(boolean preserve) {
setBoolean("mapred.easy.incremental", preserve);
}
public boolean isEasyIncremental() {
return getBoolean("mapred.easy.incremental", false);
}
public void setPreserveBufferType(int num){
set("preserve.buffer.type", Integer.toString(num));
}
public int getPreserveBufferType(){
return getInt("preserve.buffer.type", 5);
}
public void setPreserveBufferInterval(int num){
set("preserve.buffer.Interval", Integer.toString(num));
}
public int getPreserveBufferInterval(){
return getInt("preserve.buffer.Interval", 5);
}
/**---------------------------------------*/
//set the job preserve file read buffer
public void setPreserveReadBufferSize(int num){
set("mapred.incremental.preserveread.buffersize", Integer.toString(num));
}
public int getPreserveReadBufferSize(){
return getInt("mapred.incremental.preserveread.buffersize", 0);
}
//set the job preserve file write buffer
public void setPreserveWriteBufferSize(int num){
set("mapred.incremental.preservewrite.buffersize", Integer.toString(num));
}
public int getPreserveWriteBufferSize(){
return getInt("mapred.incremental.preservewrite.buffersize", 0);
}
// Yanfeng: set the job is iterative and is incremental or not
public void setIncrementalStart(boolean incrstart) {
set("mapred.incremental.start", Boolean.toString(incrstart));
}
public boolean isIncrementalStart() {
return getBoolean("mapred.incremental.start", false);
}
// Yanfeng: set the job is iterative and is incremental or not
public void setIncrementalIterative(boolean incriter) {
setBoolean("mapred.incremental.iterative", incriter);
}
public boolean isIncrementalIterative() {
return getBoolean("mapred.incremental.iterative", false);
}
public void setIterCPC(boolean itercpc) {
setBoolean("mapred.iterative.cpc", itercpc);
}
public boolean isIterCPC() {
return getBoolean("mapred.iterative.cpc", false);
}
public void setIncrMRBGOnly(boolean mrbg) {
setBoolean("mapred.incremental.mrbg", mrbg);
}
public boolean isIncrMRBGOnly() {
return getBoolean("mapred.incremental.mrbg", false);
}
// Yanfeng: set the reduce input kvs in incremental iterative job is buffered in memory or file
public void setBufferReduceKVs(boolean buffer) {
set("mapred.incremental.iterative.buffereRKVs", Boolean.toString(buffer));
}
public boolean isBufferReduceKVs() {
return getBoolean("mapred.incremental.iterative.buffereRKVs", false);
}
// Yanfeng: set a job's iteration id (must be global unique), the jobs in a iterative algorithm share the same iteration id
public void setIterativeAlgorithmID(String iteration_id) {
set("mapred.iterative.algorithmid", iteration_id);
}
public String getIterativeAlgorithmID() {
return get("mapred.iterative.algorithmid", "none");
}
// Yanfeng: set the number of iteration rounds
public void setMaxIterations(int num) {
set("mapred.iterative.terminate.iteartions", Integer.toString(num));
}
public int getMaxIterations() {
return getInt("mapred.iterative.terminate.iteartions", 0);
}
/*
public Class<? extends Partitioner> getDynamicKeyPartitionerClass() {
return getClass("mapred.iterative.dynamickey.partitioner.class",
HashPartitioner.class, Partitioner.class);
}
public void setDynamicKeyPartitionerClass(Class<? extends Partitioner> theClass) {
setClass("mapred.iterative.dynamickey.partitioner.class", theClass, Partitioner.class);
}
public RawComparator getDynamicOutputKeyComparator() {
Class<? extends RawComparator> theClass = getClass("mapred.iterative.output.key.comparator.class",
null, RawComparator.class);
if (theClass != null)
return ReflectionUtils.newInstance(theClass, this);
return WritableComparator.get(getMapOutputKeyClass().asSubclass(WritableComparable.class));
}
public void setDynamicOutputKeyComparatorClass(Class<? extends RawComparator> theClass) {
setClass("mapred.iterative.output.key.comparator.class",
theClass, RawComparator.class);
}
public Class<?> getDynamicOutputKeyClass() {
return getClass("mapred.iterative.dynamic.output.key.class",
LongWritable.class, Object.class);
}
public void setDynamicOutputKeyClass(Class<?> theClass) {
setClass("mapred.iterative.dynamic.output.key.class", theClass, Object.class);
}
*/
public Class<? extends Projector> getProjectorClass() {
return getClass("mapred.iterative.projector.class",
IdentityProjector.class, Projector.class);
}
public void setProjectorClass(Class<? extends Projector> theClass) {
setClass("mapred.iterative.projector.class", theClass, Projector.class);
}
public Class<? extends IterativeMapper> getIterativeMapperClass() {
return getClass("mapred.iterative.mapper.class", IdentityIterativeMapper.class, IterativeMapper.class);
}
public void setIterativeMapperClass(Class<? extends IterativeMapper> theClass) {
setClass("mapred.iterative.mapper.class", theClass, IterativeMapper.class);
}
public Class<? extends IterativeReducer> getIterativeReducerClass() {
return getClass("mapred.iterative.reducer.class", IdentityIterativeReducer.class, IterativeReducer.class);
}
public void setIterativeReducerClass(Class<? extends IterativeReducer> theClass) {
setClass("mapred.iterative.reducer.class", theClass, IterativeReducer.class);
}
public Class<? extends EasyReducer> getEasyReducerClass() {
return getClass("mapred.easy.reducer.class", IdentityEasyReducer.class, EasyReducer.class);
}
public void setEasyReducerClass(Class<? extends EasyReducer> theClass) {
setClass("mapred.easy.reducer.class", theClass, EasyReducer.class);
}
public void setStaticInputFormat(Class<? extends InputFormat> theClass) {
setClass("mapred.iterative.staticformat.class", theClass, InputFormat.class);
}
public InputFormat getStaticInputFormat() {
return ReflectionUtils.newInstance(getClass("mapred.iterative.staticformat.class",
IntTextKVInputFormat.class,
InputFormat.class), this);
}
public void setDynamicInputFormat(Class<? extends InputFormat> theClass) {
setClass("mapred.iterative.kvstate.inputformat.class", theClass, InputFormat.class);
}
public InputFormat getDynamicInputFormat() {
return ReflectionUtils.newInstance(getClass("mapred.iterative.kvstate.inputformat.class",
IntTextKVInputFormat.class,
InputFormat.class), this);
}
//for termination check to read the last iteration's result
public void setResultInputFormat(Class<? extends InputFormat> theClass) {
setClass("mapred.iterative.result.inputformat.class", theClass, InputFormat.class);
}
public InputFormat getResultInputFormat() {
return ReflectionUtils.newInstance(getClass("mapred.iterative.result.inputformat.class",
IntTextKVInputFormat.class,
InputFormat.class), this);
}
public void setGlobalUniqValuePath(String globaldatapath){
set("mapred.iterative.globaldata", globaldatapath);
}
public String getGlobalUniqValuePath(){
return get("mapred.iterative.globaldata");
}
public void setPreserveStatePath(String preservepath){
set("mapred.iterative.preserve.path", preservepath);
}
public String getPreserveStatePath(){
return get("mapred.iterative.preserve.path");
}
public void setConvergeStatePath(String convergepath){
set("mapred.iterative.converge.path", convergepath);
}
public String getConvergeStatePath(){
return get("mapred.iterative.converge.path");
}
public void setSplitNum(int num){
setInt("split.num", num);
}
public int getSplitNum(){
return getInt("split.num", -1);
}
/*
public void setGlobalUniqValueClass(Class<? extends GlobalUniqValue> theClass){
setClass("mapred.iterative.globaluniqvalue.class", theClass, GlobalUniqValue.class);
}
public Class<? extends GlobalUniqValue> getGlobalUniqValueClass(){
return getClass("mapred.iterative.globaluniqvalue.class", DefaultGlobalUniqValue.class, GlobalUniqValue.class);
}
public void setKVStateOutputFormat(Class<? extends OutputFormat> theClass) {
setClass("mapred.iterative.kvstate.outputformat.class", theClass, OutputFormat.class);
}
public OutputFormat getKVStateOutputFormat() {
return ReflectionUtils.newInstance(getClass("mapred.iterative.kvstate.outputformat.class",
IntTextKVOutputFormat.class,
OutputFormat.class), this);
}
public void setGlobalStateInputFormat(Class<? extends InputFormat> theClass) {
setClass("mapred.iterative.globalstate.inputformat.class", theClass, InputFormat.class);
}
public InputFormat getGlobalStateInputFormat() {
return ReflectionUtils.newInstance(getClass("mapred.iterative.globalstate.inputformat.class",
IntTextKVInputFormat.class,
InputFormat.class), this);
}
public void setGlobalStateOutputFormat(Class<? extends OutputFormat> theClass) {
setClass("mapred.iterative.globalstate.outputformat.class", theClass, OutputFormat.class);
}
public OutputFormat getGlobalStateOutputFormat() {
return ReflectionUtils.newInstance(getClass("mapred.iterative.globalstate.outputformat.class",
IntTextKVOutputFormat.class,
OutputFormat.class), this);
}
//input key, state, static data Class
public Class<?> getInputKeyClass() {
return getClass("mapred.input.key.class",
LongWritable.class, Object.class);
}
public void setInputKeyClass(Class<?> theClass) {
setClass("mapred.input.key.class", theClass, Object.class);
}
public Class<?> getStateValueClass() {
return getClass("mapred.state.value.class",
FloatWritable.class, Object.class);
}
public void setStateValueClass(Class<?> theClass) {
setClass("mapred.state.value.class", theClass, Object.class);
}
public Class<?> getStaticValueClass() {
return getClass("mapred.static.value.class",
Text.class, Object.class);
}
public void setStaticValueClass(Class<?> theClass) {
setClass("mapred.static.value.class", theClass, Object.class);
}
*/
public Class<?> getSourceKeyClass() {
return getClass("mapred.source.key.class", null);
}
public void setSourceKeyClass(Class<?> theClass) {
setClass("mapred.source.key.class", theClass, Object.class);
}
public Class<?> getStaticKeyClass() {
return getClass("mapred.iterative.static.key.class",
getOutputKeyClass(), Object.class);
}
public void setStaticKeyClass(Class<?> theClass) {
setClass("mapred.iterative.static.key.class", theClass, Object.class);
}
public Class<?> getStaticValueClass() {
return getClass("mapred.iterative.static.value.class",
getOutputKeyClass(), Object.class);
}
public void setStaticValueClass(Class<?> theClass) {
setClass("mapred.iterative.static.value.class", theClass, Object.class);
}
public void setCheckPointInterval(int interval) {
setInt("mapred.iterative.checkpoint.interval", interval);
}
public int getCheckPointInterval() {
return getInt("mapred.iterative.checkpoint.interval", 1);
}
// Yanfeng: set state data hdfs path
public void setDynamicDataPath(String statepath) {
set("mapred.iterative.state.path", statepath);
}
public String getDynamicDataPath() {
return get("mapred.iterative.state.path");
}
//set static data hdfs path
public void setStaticDataPath(String staticpath) {
set("mapred.iterative.static.path", staticpath);
}
public String getStaticDataPath() {
return get("mapred.iterative.static.path");
}
//set init method
public void setInitWithFileOrApp(boolean stateOrApp) {
setBoolean("mapred.iterative.init.stateorpath", stateOrApp);
}
public boolean getInitWithFileOrApp() {
return getBoolean("mapred.iterative.init.stateorpath", true);
}
//set init path
public void setInitStatePath(String statePath) {
set("mapred.iterative.init.statepath", statePath);
}
public String getInitStatePath() {
return get("mapred.iterative.init.statepath");
}
//set static data hdfs path
public void setDeltaUpdatePath(String deltaUpdatePath) {
set("mapred.incrmental.delta.path", deltaUpdatePath);
}
public String getDeltaUpdatePath() {
return get("mapred.incrmental.delta.path");
}
//set static data hdfs path
public void setIncrOutputPath(String incrOutputPath) {
set("mapred.incrmental.output.path", incrOutputPath);
}
public String getIncrOutputPath() {
return get("mapred.incrmental.output.path", "");
}
//************************************************************************
/**
* Get the user jar for the map-reduce job.
*
* @return the user jar for the map-reduce job.
*/
public String getJar() { return get("mapred.jar"); }
/**
* Set the user jar for the map-reduce job.
*
* @param jar the user jar for the map-reduce job.
*/
public void setJar(String jar) { set("mapred.jar", jar); }
/**
* Set the job's jar file by finding an example class location.
*
* @param cls the example class.
*/
public void setJarByClass(Class cls) {
String jar = findContainingJar(cls);
if (jar != null) {
setJar(jar);
}
}
public String[] getLocalDirs() throws IOException {
return getStrings(MAPRED_LOCAL_DIR_PROPERTY);
}
public void deleteLocalFiles() throws IOException {
String[] localDirs = getLocalDirs();
for (int i = 0; i < localDirs.length; i++) {
FileSystem.getLocal(this).delete(new Path(localDirs[i]));
}
}
public void deleteLocalFiles(String subdir) throws IOException {
String[] localDirs = getLocalDirs();
for (int i = 0; i < localDirs.length; i++) {
FileSystem.getLocal(this).delete(new Path(localDirs[i], subdir));
}
}
/**
* Constructs a local file name. Files are distributed among configured
* local directories.
*/
public Path getLocalPath(String pathString) throws IOException {
return getLocalPath(MAPRED_LOCAL_DIR_PROPERTY, pathString);
}
/**
* Get the reported username for this job.
*
* @return the username
*/
public String getUser() {
return get("user.name");
}
/**
* Set the reported username for this job.
*
* @param user the username for this job.
*/
public void setUser(String user) {
set("user.name", user);
}
/**
* Set whether the framework should keep the intermediate files for
* failed tasks.
*
* @param keep <code>true</code> if framework should keep the intermediate files
* for failed tasks, <code>false</code> otherwise.
*
*/
public void setKeepFailedTaskFiles(boolean keep) {
setBoolean("keep.failed.task.files", keep);
}
/**
* Should the temporary files for failed tasks be kept?
*
* @return should the files be kept?
*/
public boolean getKeepFailedTaskFiles() {
return getBoolean("keep.failed.task.files", false);
}
/**
* Set a regular expression for task names that should be kept.
* The regular expression ".*_m_000123_0" would keep the files
* for the first instance of map 123 that ran.
*
* @param pattern the java.util.regex.Pattern to match against the
* task names.
*/
public void setKeepTaskFilesPattern(String pattern) {
set("keep.task.files.pattern", pattern);
}
/**
* Get the regular expression that is matched against the task names
* to see if we need to keep the files.
*
* @return the pattern as a string, if it was set, othewise null.
*/
public String getKeepTaskFilesPattern() {
return get("keep.task.files.pattern");
}
/**
* Set the current working directory for the default file system.
*
* @param dir the new current working directory.
*/
public void setWorkingDirectory(Path dir) {
dir = new Path(getWorkingDirectory(), dir);
set("mapred.working.dir", dir.toString());
}
/**
* Get the current working directory for the default file system.
*
* @return the directory name.
*/
public Path getWorkingDirectory() {
String name = get("mapred.working.dir");
if (name != null) {
return new Path(name);
} else {
try {
Path dir = FileSystem.get(this).getWorkingDirectory();
set("mapred.working.dir", dir.toString());
return dir;
} catch (IOException e) {
throw new RuntimeException(e);
}
}
}
/**
* Sets the number of tasks that a spawned task JVM should run
* before it exits
* @param numTasks the number of tasks to execute; defaults to 1;
* -1 signifies no limit
*/
public void setNumTasksToExecutePerJvm(int numTasks) {
setInt("mapred.job.reuse.jvm.num.tasks", numTasks);
}
/**
* Get the number of tasks that a spawned JVM should execute
*/
public int getNumTasksToExecutePerJvm() {
return getInt("mapred.job.reuse.jvm.num.tasks", 1);
}
/**
* Get the {@link InputFormat} implementation for the map-reduce job,
* defaults to {@link TextInputFormat} if not specified explicity.
*
* @return the {@link InputFormat} implementation for the map-reduce job.
*/
public InputFormat getInputFormat() {
return ReflectionUtils.newInstance(getClass("mapred.input.format.class",
TextInputFormat.class,
InputFormat.class),
this);
}
/**
* Set the {@link InputFormat} implementation for the map-reduce job.
*
* @param theClass the {@link InputFormat} implementation for the map-reduce
* job.
*/
public void setInputFormat(Class<? extends InputFormat> theClass) {
setClass("mapred.input.format.class", theClass, InputFormat.class);
}
/**
* Get the {@link OutputFormat} implementation for the map-reduce job,
* defaults to {@link TextOutputFormat} if not specified explicity.
*
* @return the {@link OutputFormat} implementation for the map-reduce job.
*/
public OutputFormat getOutputFormat() {
return ReflectionUtils.newInstance(getClass("mapred.output.format.class",
TextOutputFormat.class,
OutputFormat.class),
this);
}
/**
* Get the {@link OutputCommitter} implementation for the map-reduce job,
* defaults to {@link FileOutputCommitter} if not specified explicitly.
*
* @return the {@link OutputCommitter} implementation for the map-reduce job.
*/
public OutputCommitter getOutputCommitter() {
return (OutputCommitter)ReflectionUtils.newInstance(
getClass("mapred.output.committer.class", FileOutputCommitter.class,
OutputCommitter.class), this);
}
/**
* Set the {@link OutputCommitter} implementation for the map-reduce job.
*
* @param theClass the {@link OutputCommitter} implementation for the map-reduce
* job.
*/
public void setOutputCommitter(Class<? extends OutputCommitter> theClass) {
setClass("mapred.output.committer.class", theClass, OutputCommitter.class);
}
/**
* Set the {@link OutputFormat} implementation for the map-reduce job.
*
* @param theClass the {@link OutputFormat} implementation for the map-reduce
* job.
*/
public void setOutputFormat(Class<? extends OutputFormat> theClass) {
setClass("mapred.output.format.class", theClass, OutputFormat.class);
}
/**
* Should the map outputs be compressed before transfer?
* Uses the SequenceFile compression.
*
* @param compress should the map outputs be compressed?
*/
public void setCompressMapOutput(boolean compress) {
setBoolean("mapred.compress.map.output", compress);
}
/**
* Are the outputs of the maps be compressed?
*
* @return <code>true</code> if the outputs of the maps are to be compressed,
* <code>false</code> otherwise.
*/
public boolean getCompressMapOutput() {
return getBoolean("mapred.compress.map.output", false);
}
/**
* Set the given class as the {@link CompressionCodec} for the map outputs.
*
* @param codecClass the {@link CompressionCodec} class that will compress
* the map outputs.
*/
public void
setMapOutputCompressorClass(Class<? extends CompressionCodec> codecClass) {
setCompressMapOutput(true);
setClass("mapred.map.output.compression.codec", codecClass,
CompressionCodec.class);
}
/**
* Get the {@link CompressionCodec} for compressing the map outputs.
*
* @param defaultValue the {@link CompressionCodec} to return if not set
* @return the {@link CompressionCodec} class that should be used to compress the
* map outputs.
* @throws IllegalArgumentException if the class was specified, but not found
*/
public Class<? extends CompressionCodec>
getMapOutputCompressorClass(Class<? extends CompressionCodec> defaultValue) {
Class<? extends CompressionCodec> codecClass = defaultValue;
String name = get("mapred.map.output.compression.codec");
if (name != null) {
try {
codecClass = getClassByName(name).asSubclass(CompressionCodec.class);
} catch (ClassNotFoundException e) {
throw new IllegalArgumentException("Compression codec " + name +
" was not found.", e);
}
}
return codecClass;
}
/**
* Get the key class for the map output data. If it is not set, use the
* (final) output key class. This allows the map output key class to be
* different than the final output key class.
*
* @return the map output key class.
*/
public Class<?> getMapOutputKeyClass() {
Class<?> retv = getClass("mapred.mapoutput.key.class", null, Object.class);
if (retv == null) {
retv = getOutputKeyClass();
}
return retv;
}
/**
* Set the key class for the map output data. This allows the user to
* specify the map output key class to be different than the final output
* value class.
*
* @param theClass the map output key class.
*/
public void setMapOutputKeyClass(Class<?> theClass) {
setClass("mapred.mapoutput.key.class", theClass, Object.class);
}
/**
* Get the value class for the map output data. If it is not set, use the
* (final) output value class This allows the map output value class to be
* different than the final output value class.
*
* @return the map output value class.
*/
public Class<?> getMapOutputValueClass() {
Class<?> retv = getClass("mapred.mapoutput.value.class", null,
Object.class);
if (retv == null) {
retv = getOutputValueClass();
}
return retv;
}
/**
* Set the value class for the map output data. This allows the user to
* specify the map output value class to be different than the final output
* value class.
*
* @param theClass the map output value class.
*/
public void setMapOutputValueClass(Class<?> theClass) {
setClass("mapred.mapoutput.value.class", theClass, Object.class);
}
/**
* Get the key class for the job output data.
*
* @return the key class for the job output data.
*/
public Class<?> getOutputKeyClass() {
return getClass("mapred.output.key.class",
LongWritable.class, Object.class);
}
/**
* Set the key class for the job output data.
*
* @param theClass the key class for the job output data.
*/
public void setOutputKeyClass(Class<?> theClass) {
setClass("mapred.output.key.class", theClass, Object.class);
}
/**
* Get the {@link RawComparator} comparator used to compare keys.
*
* @return the {@link RawComparator} comparator used to compare keys.
*/
public RawComparator getOutputKeyComparator() {
if(this.isDataDistribution()){
return StaticDataComparator.get(getMapOutputKeyClass().asSubclass(WritableComparable.class), this);
}else{
Class<? extends RawComparator> theClass = getClass("mapred.output.key.comparator.class",
null, RawComparator.class);
if (theClass != null)
return ReflectionUtils.newInstance(theClass, this);
return WritableComparator.get(getMapOutputKeyClass().asSubclass(WritableComparable.class));
}
}
/**
* Set the {@link RawComparator} comparator used to compare keys.
*
* @param theClass the {@link RawComparator} comparator used to
* compare keys.
* @see #setOutputValueGroupingComparator(Class)
*/
public void setOutputKeyComparatorClass(Class<? extends RawComparator> theClass) {
setClass("mapred.output.key.comparator.class",
theClass, RawComparator.class);
}
/**
* Set the {@link KeyFieldBasedComparator} options used to compare keys.
*
* @param keySpec the key specification of the form -k pos1[,pos2], where,
* pos is of the form f[.c][opts], where f is the number
* of the key field to use, and c is the number of the first character from
* the beginning of the field. Fields and character posns are numbered
* starting with 1; a character position of zero in pos2 indicates the
* field's last character. If '.c' is omitted from pos1, it defaults to 1
* (the beginning of the field); if omitted from pos2, it defaults to 0
* (the end of the field). opts are ordering options. The supported options
* are:
* -n, (Sort numerically)
* -r, (Reverse the result of comparison)
*/
public void setKeyFieldComparatorOptions(String keySpec) {
setOutputKeyComparatorClass(KeyFieldBasedComparator.class);
set("mapred.text.key.comparator.options", keySpec);
}
/**
* Get the {@link KeyFieldBasedComparator} options
*/
public String getKeyFieldComparatorOption() {
return get("mapred.text.key.comparator.options");
}
/**
* Set the {@link KeyFieldBasedPartitioner} options used for
* {@link Partitioner}
*
* @param keySpec the key specification of the form -k pos1[,pos2], where,
* pos is of the form f[.c][opts], where f is the number
* of the key field to use, and c is the number of the first character from
* the beginning of the field. Fields and character posns are numbered
* starting with 1; a character position of zero in pos2 indicates the
* field's last character. If '.c' is omitted from pos1, it defaults to 1
* (the beginning of the field); if omitted from pos2, it defaults to 0
* (the end of the field).
*/
public void setKeyFieldPartitionerOptions(String keySpec) {
setPartitionerClass(KeyFieldBasedPartitioner.class);
set("mapred.text.key.partitioner.options", keySpec);
}
/**
* Get the {@link KeyFieldBasedPartitioner} options
*/
public String getKeyFieldPartitionerOption() {
return get("mapred.text.key.partitioner.options");
}
/**
* Get the user defined {@link WritableComparable} comparator for
* grouping keys of inputs to the reduce.
*
* @return comparator set by the user for grouping values.
* @see #setOutputValueGroupingComparator(Class) for details.
*/
public RawComparator getOutputValueGroupingComparator() {
Class<? extends RawComparator> theClass = getClass("mapred.output.value.groupfn.class", null,
RawComparator.class);
if (theClass == null) {
return getOutputKeyComparator();
}
return ReflectionUtils.newInstance(theClass, this);
}
/**
* Set the user defined {@link RawComparator} comparator for
* grouping keys in the input to the reduce.
*
* <p>This comparator should be provided if the equivalence rules for keys
* for sorting the intermediates are different from those for grouping keys
* before each call to
* {@link Reducer#reduce(Object, java.util.Iterator, OutputCollector, Reporter)}.</p>
*
* <p>For key-value pairs (K1,V1) and (K2,V2), the values (V1, V2) are passed
* in a single call to the reduce function if K1 and K2 compare as equal.</p>
*
* <p>Since {@link #setOutputKeyComparatorClass(Class)} can be used to control
* how keys are sorted, this can be used in conjunction to simulate
* <i>secondary sort on values</i>.</p>
*
* <p><i>Note</i>: This is not a guarantee of the reduce sort being
* <i>stable</i> in any sense. (In any case, with the order of available
* map-outputs to the reduce being non-deterministic, it wouldn't make
* that much sense.)</p>
*
* @param theClass the comparator class to be used for grouping keys.
* It should implement <code>RawComparator</code>.
* @see #setOutputKeyComparatorClass(Class)
*/
public void setOutputValueGroupingComparator(
Class<? extends RawComparator> theClass) {
setClass("mapred.output.value.groupfn.class",
theClass, RawComparator.class);
}
/**
* Should the framework use the new context-object code for running
* the mapper?
* @return true, if the new api should be used
*/
public boolean getUseNewMapper() {
return getBoolean("mapred.mapper.new-api", false);
}
/**
* Set whether the framework should use the new api for the mapper.
* This is the default for jobs submitted with the new Job api.
* @param flag true, if the new api should be used
*/
public void setUseNewMapper(boolean flag) {
setBoolean("mapred.mapper.new-api", flag);
}
/**
* Should the framework use the new context-object code for running
* the reducer?
* @return true, if the new api should be used
*/
public boolean getUseNewReducer() {
return getBoolean("mapred.reducer.new-api", false);
}
/**
* Set whether the framework should use the new api for the reducer.
* This is the default for jobs submitted with the new Job api.
* @param flag true, if the new api should be used
*/
public void setUseNewReducer(boolean flag) {
setBoolean("mapred.reducer.new-api", flag);
}
/**
* Get the value class for job outputs.
*
* @return the value class for job outputs.
*/
public Class<?> getOutputValueClass() {
return getClass("mapred.output.value.class", Text.class, Object.class);
}
/**
* Set the value class for job outputs.
*
* @param theClass the value class for job outputs.
*/
public void setOutputValueClass(Class<?> theClass) {
setClass("mapred.output.value.class", theClass, Object.class);
}
/**
* Get the {@link Mapper} class for the job.
*
* @return the {@link Mapper} class for the job.
*/
public Class<? extends Mapper> getMapperClass() {
return getClass("mapred.mapper.class", IdentityMapper.class, Mapper.class);
}
/**
* Set the {@link Mapper} class for the job.
*
* @param theClass the {@link Mapper} class for the job.
*/
public void setMapperClass(Class<? extends Mapper> theClass) {
setClass("mapred.mapper.class", theClass, Mapper.class);
}
/**
* Get the {@link MapRunnable} class for the job.
*
* @return the {@link MapRunnable} class for the job.
*/
public Class<? extends MapRunnable> getMapRunnerClass() {
return getClass("mapred.map.runner.class",
MapRunner.class, MapRunnable.class);
}
/**
* Expert: Set the {@link MapRunnable} class for the job.
*
* Typically used to exert greater control on {@link Mapper}s.
*
* @param theClass the {@link MapRunnable} class for the job.
*/
public void setMapRunnerClass(Class<? extends MapRunnable> theClass) {
setClass("mapred.map.runner.class", theClass, MapRunnable.class);
}
/**
* Get the {@link Partitioner} used to partition {@link Mapper}-outputs
* to be sent to the {@link Reducer}s.
*
* @return the {@link Partitioner} used to partition map-outputs.
*/
public Class<? extends Partitioner> getPartitionerClass() {
return getClass("mapred.partitioner.class",
HashPartitioner.class, Partitioner.class);
}
/**
* Set the {@link Partitioner} class used to partition
* {@link Mapper}-outputs to be sent to the {@link Reducer}s.
*
* @param theClass the {@link Partitioner} used to partition map-outputs.
*/
public void setPartitionerClass(Class<? extends Partitioner> theClass) {
setClass("mapred.partitioner.class", theClass, Partitioner.class);
}
/**
* Get the {@link Reducer} class for the job.
*
* @return the {@link Reducer} class for the job.
*/
public Class<? extends Reducer> getReducerClass() {
return getClass("mapred.reducer.class",
IdentityReducer.class, Reducer.class);
}
/**
* Set the {@link Reducer} class for the job.
*
* @param theClass the {@link Reducer} class for the job.
*/
public void setReducerClass(Class<? extends Reducer> theClass) {
setClass("mapred.reducer.class", theClass, Reducer.class);
}
/**
* Get the user-defined <i>combiner</i> class used to combine map-outputs
* before being sent to the reducers. Typically the combiner is same as the
* the {@link Reducer} for the job i.e. {@link #getReducerClass()}.
*
* @return the user-defined combiner class used to combine map-outputs.
*/
public Class<? extends Reducer> getCombinerClass() {
return getClass("mapred.combiner.class", null, Reducer.class);
}
/**
* Set the user-defined <i>combiner</i> class used to combine map-outputs
* before being sent to the reducers.
*
* <p>The combiner is an application-specified aggregation operation, which
* can help cut down the amount of data transferred between the
* {@link Mapper} and the {@link Reducer}, leading to better performance.</p>
*
* <p>The framework may invoke the combiner 0, 1, or multiple times, in both
* the mapper and reducer tasks. In general, the combiner is called as the
* sort/merge result is written to disk. The combiner must:
* <ul>
* <li> be side-effect free</li>
* <li> have the same input and output key types and the same input and
* output value types</li>
* </ul></p>
*
* <p>Typically the combiner is same as the <code>Reducer</code> for the
* job i.e. {@link #setReducerClass(Class)}.</p>
*
* @param theClass the user-defined combiner class used to combine
* map-outputs.
*/
public void setCombinerClass(Class<? extends Reducer> theClass) {
setClass("mapred.combiner.class", theClass, Reducer.class);
}
/**
* Should speculative execution be used for this job?
* Defaults to <code>true</code>.
*
* @return <code>true</code> if speculative execution be used for this job,
* <code>false</code> otherwise.
*/
public boolean getSpeculativeExecution() {
return (getMapSpeculativeExecution() || getReduceSpeculativeExecution());
}
/**
* Turn speculative execution on or off for this job.
*
* @param speculativeExecution <code>true</code> if speculative execution
* should be turned on, else <code>false</code>.
*/
public void setSpeculativeExecution(boolean speculativeExecution) {
setMapSpeculativeExecution(speculativeExecution);
setReduceSpeculativeExecution(speculativeExecution);
}
/**
* Should speculative execution be used for this job for map tasks?
* Defaults to <code>true</code>.
*
* @return <code>true</code> if speculative execution be
* used for this job for map tasks,
* <code>false</code> otherwise.
*/
public boolean getMapSpeculativeExecution() {
return getBoolean("mapred.map.tasks.speculative.execution", true);
}
/**
* Turn speculative execution on or off for this job for map tasks.
*
* @param speculativeExecution <code>true</code> if speculative execution
* should be turned on for map tasks,
* else <code>false</code>.
*/
public void setMapSpeculativeExecution(boolean speculativeExecution) {
setBoolean("mapred.map.tasks.speculative.execution", speculativeExecution);
}
/**
* Should speculative execution be used for this job for reduce tasks?
* Defaults to <code>true</code>.
*
* @return <code>true</code> if speculative execution be used
* for reduce tasks for this job,
* <code>false</code> otherwise.
*/
public boolean getReduceSpeculativeExecution() {
return getBoolean("mapred.reduce.tasks.speculative.execution", true);
}
/**
* Turn speculative execution on or off for this job for reduce tasks.
*
* @param speculativeExecution <code>true</code> if speculative execution
* should be turned on for reduce tasks,
* else <code>false</code>.
*/
public void setReduceSpeculativeExecution(boolean speculativeExecution) {
setBoolean("mapred.reduce.tasks.speculative.execution",
speculativeExecution);
}
/**
* Get configured the number of reduce tasks for this job.
* Defaults to <code>1</code>.
*
* @return the number of reduce tasks for this job.
*/
public int getNumMapTasks() { return getInt("mapred.map.tasks", 1); }
/**
* Set the number of map tasks for this job.
*
* <p><i>Note</i>: This is only a <i>hint</i> to the framework. The actual
* number of spawned map tasks depends on the number of {@link InputSplit}s
* generated by the job's {@link InputFormat#getSplits(JobConf, int)}.
*
* A custom {@link InputFormat} is typically used to accurately control
* the number of map tasks for the job.</p>
*
* <h4 id="NoOfMaps">How many maps?</h4>
*
* <p>The number of maps is usually driven by the total size of the inputs
* i.e. total number of blocks of the input files.</p>
*
* <p>The right level of parallelism for maps seems to be around 10-100 maps
* per-node, although it has been set up to 300 or so for very cpu-light map
* tasks. Task setup takes awhile, so it is best if the maps take at least a
* minute to execute.</p>
*
* <p>The default behavior of file-based {@link InputFormat}s is to split the
* input into <i>logical</i> {@link InputSplit}s based on the total size, in
* bytes, of input files. However, the {@link FileSystem} blocksize of the
* input files is treated as an upper bound for input splits. A lower bound
* on the split size can be set via
* <a href="{@docRoot}/../mapred-default.html#mapred.min.split.size">
* mapred.min.split.size</a>.</p>
*
* <p>Thus, if you expect 10TB of input data and have a blocksize of 128MB,
* you'll end up with 82,000 maps, unless {@link #setNumMapTasks(int)} is
* used to set it even higher.</p>
*
* @param n the number of map tasks for this job.
* @see InputFormat#getSplits(JobConf, int)
* @see FileInputFormat
* @see FileSystem#getDefaultBlockSize()
* @see FileStatus#getBlockSize()
*/
public void setNumMapTasks(int n) { setInt("mapred.map.tasks", n); }
/**
* Get configured the number of reduce tasks for this job. Defaults to
* <code>1</code>.
*
* @return the number of reduce tasks for this job.
*/
public int getNumReduceTasks() { return getInt("mapred.reduce.tasks", 1); }
/**
* Set the requisite number of reduce tasks for this job.
*
* <h4 id="NoOfReduces">How many reduces?</h4>
*
* <p>The right number of reduces seems to be <code>0.95</code> or
* <code>1.75</code> multiplied by (<<i>no. of nodes</i>> *
* <a href="{@docRoot}/../mapred-default.html#mapred.tasktracker.reduce.tasks.maximum">
* mapred.tasktracker.reduce.tasks.maximum</a>).
* </p>
*
* <p>With <code>0.95</code> all of the reduces can launch immediately and
* start transfering map outputs as the maps finish. With <code>1.75</code>
* the faster nodes will finish their first round of reduces and launch a
* second wave of reduces doing a much better job of load balancing.</p>
*
* <p>Increasing the number of reduces increases the framework overhead, but
* increases load balancing and lowers the cost of failures.</p>
*
* <p>The scaling factors above are slightly less than whole numbers to
* reserve a few reduce slots in the framework for speculative-tasks, failures
* etc.</p>
*
* <h4 id="ReducerNone">Reducer NONE</h4>
*
* <p>It is legal to set the number of reduce-tasks to <code>zero</code>.</p>
*
* <p>In this case the output of the map-tasks directly go to distributed
* file-system, to the path set by
* {@link FileOutputFormat#setOutputPath(JobConf, Path)}. Also, the
* framework doesn't sort the map-outputs before writing it out to HDFS.</p>
*
* @param n the number of reduce tasks for this job.
*/
public void setNumReduceTasks(int n) { setInt("mapred.reduce.tasks", n); }
/**
* Get the configured number of maximum attempts that will be made to run a
* map task, as specified by the <code>mapred.map.max.attempts</code>
* property. If this property is not already set, the default is 4 attempts.
*
* @return the max number of attempts per map task.
*/
public int getMaxMapAttempts() {
return getInt("mapred.map.max.attempts", 4);
}
/**
* Expert: Set the number of maximum attempts that will be made to run a
* map task.
*
* @param n the number of attempts per map task.
*/
public void setMaxMapAttempts(int n) {
setInt("mapred.map.max.attempts", n);
}
/**
* Get the configured number of maximum attempts that will be made to run a
* reduce task, as specified by the <code>mapred.reduce.max.attempts</code>
* property. If this property is not already set, the default is 4 attempts.
*
* @return the max number of attempts per reduce task.
*/
public int getMaxReduceAttempts() {
return getInt("mapred.reduce.max.attempts", 4);
}
/**
* Expert: Set the number of maximum attempts that will be made to run a
* reduce task.
*
* @param n the number of attempts per reduce task.
*/
public void setMaxReduceAttempts(int n) {
setInt("mapred.reduce.max.attempts", n);
}
/**
* Get the user-specified job name. This is only used to identify the
* job to the user.
*
* @return the job's name, defaulting to "".
*/
public String getJobName() {
return get("mapred.job.name", "");
}
/**
* Set the user-specified job name.
*
* @param name the job's new name.
*/
public void setJobName(String name) {
set("mapred.job.name", name);
}
/**
* Get the user-specified session identifier. The default is the empty string.
*
* The session identifier is used to tag metric data that is reported to some
* performance metrics system via the org.apache.hadoop.metrics API. The
* session identifier is intended, in particular, for use by Hadoop-On-Demand
* (HOD) which allocates a virtual Hadoop cluster dynamically and transiently.
* HOD will set the session identifier by modifying the mapred-site.xml file
* before starting the cluster.
*
* When not running under HOD, this identifer is expected to remain set to
* the empty string.
*
* @return the session identifier, defaulting to "".
*/
public String getSessionId() {
return get("session.id", "");
}
/**
* Set the user-specified session identifier.
*
* @param sessionId the new session id.
*/
public void setSessionId(String sessionId) {
set("session.id", sessionId);
}
/**
* Set the maximum no. of failures of a given job per tasktracker.
* If the no. of task failures exceeds <code>noFailures</code>, the
* tasktracker is <i>blacklisted</i> for this job.
*
* @param noFailures maximum no. of failures of a given job per tasktracker.
*/
public void setMaxTaskFailuresPerTracker(int noFailures) {
setInt("mapred.max.tracker.failures", noFailures);
}
/**
* Expert: Get the maximum no. of failures of a given job per tasktracker.
* If the no. of task failures exceeds this, the tasktracker is
* <i>blacklisted</i> for this job.
*
* @return the maximum no. of failures of a given job per tasktracker.
*/
public int getMaxTaskFailuresPerTracker() {
return getInt("mapred.max.tracker.failures", 4);
}
/**
* Get the maximum percentage of map tasks that can fail without
* the job being aborted.
*
* Each map task is executed a minimum of {@link #getMaxMapAttempts()}
* attempts before being declared as <i>failed</i>.
*
* Defaults to <code>zero</code>, i.e. <i>any</i> failed map-task results in
* the job being declared as {@link JobStatus#FAILED}.
*
* @return the maximum percentage of map tasks that can fail without
* the job being aborted.
*/
public int getMaxMapTaskFailuresPercent() {
return getInt("mapred.max.map.failures.percent", 0);
}
/**
* Expert: Set the maximum percentage of map tasks that can fail without the
* job being aborted.
*
* Each map task is executed a minimum of {@link #getMaxMapAttempts} attempts
* before being declared as <i>failed</i>.
*
* @param percent the maximum percentage of map tasks that can fail without
* the job being aborted.
*/
public void setMaxMapTaskFailuresPercent(int percent) {
setInt("mapred.max.map.failures.percent", percent);
}
/**
* Get the maximum percentage of reduce tasks that can fail without
* the job being aborted.
*
* Each reduce task is executed a minimum of {@link #getMaxReduceAttempts()}
* attempts before being declared as <i>failed</i>.
*
* Defaults to <code>zero</code>, i.e. <i>any</i> failed reduce-task results
* in the job being declared as {@link JobStatus#FAILED}.
*
* @return the maximum percentage of reduce tasks that can fail without
* the job being aborted.
*/
public int getMaxReduceTaskFailuresPercent() {
return getInt("mapred.max.reduce.failures.percent", 0);
}
/**
* Set the maximum percentage of reduce tasks that can fail without the job
* being aborted.
*
* Each reduce task is executed a minimum of {@link #getMaxReduceAttempts()}
* attempts before being declared as <i>failed</i>.
*
* @param percent the maximum percentage of reduce tasks that can fail without
* the job being aborted.
*/
public void setMaxReduceTaskFailuresPercent(int percent) {
setInt("mapred.max.reduce.failures.percent", percent);
}
/**
* Set {@link JobPriority} for this job.
*
* @param prio the {@link JobPriority} for this job.
*/
public void setJobPriority(JobPriority prio) {
set("mapred.job.priority", prio.toString());
}
/**
* Get the {@link JobPriority} for this job.
*
* @return the {@link JobPriority} for this job.
*/
public JobPriority getJobPriority() {
String prio = get("mapred.job.priority");
if(prio == null) {
return JobPriority.NORMAL;
}
return JobPriority.valueOf(prio);
}
/**
* Set {@link JobSubmitHostName} for this job.
*
* @param prio the {@link JobSubmitHostName} for this job.
*/
void setJobSubmitHostName(String hostname) {
set("mapreduce.job.submithost", hostname);
}
/**
* Get the {@link JobSubmitHostName} for this job.
*
* @return the {@link JobSubmitHostName} for this job.
*/
String getJobSubmitHostName() {
String hostname = get("mapreduce.job.submithost");
return hostname;
}
/**
* Set {@link JobSubmitHostAddress} for this job.
*
* @param prio the {@link JobSubmitHostAddress} for this job.
*/
void setJobSubmitHostAddress(String hostadd) {
set("mapreduce.job.submithostaddress", hostadd);
}
/**
* Get the {@link JobSubmitHostAddress} for this job.
*
* @return the {@link JobSubmitHostAddress} for this job.
*/
String getJobSubmitHostAddress() {
String hostadd = get("mapreduce.job.submithostaddress");
return hostadd;
}
/**
* Get whether the task profiling is enabled.
* @return true if some tasks will be profiled
*/
public boolean getProfileEnabled() {
return getBoolean("mapred.task.profile", false);
}
/**
* Set whether the system should collect profiler information for some of
* the tasks in this job? The information is stored in the user log
* directory.
* @param newValue true means it should be gathered
*/
public void setProfileEnabled(boolean newValue) {
setBoolean("mapred.task.profile", newValue);
}
/**
* Get the profiler configuration arguments.
*
* The default value for this property is
* "-agentlib:hprof=cpu=samples,heap=sites,force=n,thread=y,verbose=n,file=%s"
*
* @return the parameters to pass to the task child to configure profiling
*/
public String getProfileParams() {
return get("mapred.task.profile.params",
"-agentlib:hprof=cpu=samples,heap=sites,force=n,thread=y," +
"verbose=n,file=%s");
}
/**
* Set the profiler configuration arguments. If the string contains a '%s' it
* will be replaced with the name of the profiling output file when the task
* runs.
*
* This value is passed to the task child JVM on the command line.
*
* @param value the configuration string
*/
public void setProfileParams(String value) {
set("mapred.task.profile.params", value);
}
/**
* Get the range of maps or reduces to profile.
* @param isMap is the task a map?
* @return the task ranges
*/
public IntegerRanges getProfileTaskRange(boolean isMap) {
return getRange((isMap ? "mapred.task.profile.maps" :
"mapred.task.profile.reduces"), "0-2");
}
/**
* Set the ranges of maps or reduces to profile. setProfileEnabled(true)
* must also be called.
* @param newValue a set of integer ranges of the map ids
*/
public void setProfileTaskRange(boolean isMap, String newValue) {
// parse the value to make sure it is legal
new Configuration.IntegerRanges(newValue);
set((isMap ? "mapred.task.profile.maps" : "mapred.task.profile.reduces"),
newValue);
}
/**
* Set the debug script to run when the map tasks fail.
*
* <p>The debug script can aid debugging of failed map tasks. The script is
* given task's stdout, stderr, syslog, jobconf files as arguments.</p>
*
* <p>The debug command, run on the node where the map failed, is:</p>
* <p><pre><blockquote>
* $script $stdout $stderr $syslog $jobconf.
* </blockquote></pre></p>
*
* <p> The script file is distributed through {@link DistributedCache}
* APIs. The script needs to be symlinked. </p>
*
* <p>Here is an example on how to submit a script
* <p><blockquote><pre>
* job.setMapDebugScript("./myscript");
* DistributedCache.createSymlink(job);
* DistributedCache.addCacheFile("/debug/scripts/myscript#myscript");
* </pre></blockquote></p>
*
* @param mDbgScript the script name
*/
public void setMapDebugScript(String mDbgScript) {
set("mapred.map.task.debug.script", mDbgScript);
}
/**
* Get the map task's debug script.
*
* @return the debug Script for the mapred job for failed map tasks.
* @see #setMapDebugScript(String)
*/
public String getMapDebugScript() {
return get("mapred.map.task.debug.script");
}
/**
* Set the debug script to run when the reduce tasks fail.
*
* <p>The debug script can aid debugging of failed reduce tasks. The script
* is given task's stdout, stderr, syslog, jobconf files as arguments.</p>
*
* <p>The debug command, run on the node where the map failed, is:</p>
* <p><pre><blockquote>
* $script $stdout $stderr $syslog $jobconf.
* </blockquote></pre></p>
*
* <p> The script file is distributed through {@link DistributedCache}
* APIs. The script file needs to be symlinked </p>
*
* <p>Here is an example on how to submit a script
* <p><blockquote><pre>
* job.setReduceDebugScript("./myscript");
* DistributedCache.createSymlink(job);
* DistributedCache.addCacheFile("/debug/scripts/myscript#myscript");
* </pre></blockquote></p>
*
* @param rDbgScript the script name
*/
public void setReduceDebugScript(String rDbgScript) {
set("mapred.reduce.task.debug.script", rDbgScript);
}
/**
* Get the reduce task's debug Script
*
* @return the debug script for the mapred job for failed reduce tasks.
* @see #setReduceDebugScript(String)
*/
public String getReduceDebugScript() {
return get("mapred.reduce.task.debug.script");
}
/**
* Get the uri to be invoked in-order to send a notification after the job
* has completed (success/failure).
*
* @return the job end notification uri, <code>null</code> if it hasn't
* been set.
* @see #setJobEndNotificationURI(String)
*/
public String getJobEndNotificationURI() {
return get("job.end.notification.url");
}
/**
* Set the uri to be invoked in-order to send a notification after the job
* has completed (success/failure).
*
* <p>The uri can contain 2 special parameters: <tt>$jobId</tt> and
* <tt>$jobStatus</tt>. Those, if present, are replaced by the job's
* identifier and completion-status respectively.</p>
*
* <p>This is typically used by application-writers to implement chaining of
* Map-Reduce jobs in an <i>asynchronous manner</i>.</p>
*
* @param uri the job end notification uri
* @see JobStatus
* @see <a href="{@docRoot}/org/apache/hadoop/mapred/JobClient.html#
* JobCompletionAndChaining">Job Completion and Chaining</a>
*/
public void setJobEndNotificationURI(String uri) {
set("job.end.notification.url", uri);
}
/**
* Get job-specific shared directory for use as scratch space
*
* <p>
* When a job starts, a shared directory is created at location
* <code>
* ${mapred.local.dir}/taskTracker/$user/jobcache/$jobid/work/ </code>.
* This directory is exposed to the users through
* <code>job.local.dir </code>.
* So, the tasks can use this space
* as scratch space and share files among them. </p>
* This value is available as System property also.
*
* @return The localized job specific shared directory
*/
public String getJobLocalDir() {
return get(TaskTracker.JOB_LOCAL_DIR);
}
/**
* Get memory required to run a map task of the job, in MB.
*
* If a value is specified in the configuration, it is returned.
* Else, it returns {@link #DISABLED_MEMORY_LIMIT}.
* <p/>
* For backward compatibility, if the job configuration sets the
* key {@link #MAPRED_TASK_MAXVMEM_PROPERTY} to a value different
* from {@link #DISABLED_MEMORY_LIMIT}, that value will be used
* after converting it from bytes to MB.
* @return memory required to run a map task of the job, in MB,
* or {@link #DISABLED_MEMORY_LIMIT} if unset.
*/
public long getMemoryForMapTask() {
long value = getDeprecatedMemoryValue();
if (value == DISABLED_MEMORY_LIMIT) {
value = normalizeMemoryConfigValue(
getLong(JobConf.MAPRED_JOB_MAP_MEMORY_MB_PROPERTY,
DISABLED_MEMORY_LIMIT));
}
return value;
}
public void setMemoryForMapTask(long mem) {
setLong(JobConf.MAPRED_JOB_MAP_MEMORY_MB_PROPERTY, mem);
}
/**
* Get memory required to run a reduce task of the job, in MB.
*
* If a value is specified in the configuration, it is returned.
* Else, it returns {@link #DISABLED_MEMORY_LIMIT}.
* <p/>
* For backward compatibility, if the job configuration sets the
* key {@link #MAPRED_TASK_MAXVMEM_PROPERTY} to a value different
* from {@link #DISABLED_MEMORY_LIMIT}, that value will be used
* after converting it from bytes to MB.
* @return memory required to run a reduce task of the job, in MB,
* or {@link #DISABLED_MEMORY_LIMIT} if unset.
*/
public long getMemoryForReduceTask() {
long value = getDeprecatedMemoryValue();
if (value == DISABLED_MEMORY_LIMIT) {
value = normalizeMemoryConfigValue(
getLong(JobConf.MAPRED_JOB_REDUCE_MEMORY_MB_PROPERTY,
DISABLED_MEMORY_LIMIT));
}
return value;
}
// Return the value set to the key MAPRED_TASK_MAXVMEM_PROPERTY,
// converted into MBs.
// Returns DISABLED_MEMORY_LIMIT if unset, or set to a negative
// value.
private long getDeprecatedMemoryValue() {
long oldValue = getLong(MAPRED_TASK_MAXVMEM_PROPERTY,
DISABLED_MEMORY_LIMIT);
oldValue = normalizeMemoryConfigValue(oldValue);
if (oldValue != DISABLED_MEMORY_LIMIT) {
oldValue /= (1024*1024);
}
return oldValue;
}
public void setMemoryForReduceTask(long mem) {
setLong(JobConf.MAPRED_JOB_REDUCE_MEMORY_MB_PROPERTY, mem);
}
/**
* Return the name of the queue to which this job is submitted.
* Defaults to 'default'.
*
* @return name of the queue
*/
public String getQueueName() {
return get("mapred.job.queue.name", DEFAULT_QUEUE_NAME);
}
/**
* Set the name of the queue to which this job should be submitted.
*
* @param queueName Name of the queue
*/
public void setQueueName(String queueName) {
set("mapred.job.queue.name", queueName);
}
/**
* Normalize the negative values in configuration
*
* @param val
* @return normalized value
*/
public static long normalizeMemoryConfigValue(long val) {
if (val < 0) {
val = DISABLED_MEMORY_LIMIT;
}
return val;
}
/**
* Compute the number of slots required to run a single map task-attempt
* of this job.
* @param slotSizePerMap cluster-wide value of the amount of memory required
* to run a map-task
* @return the number of slots required to run a single map task-attempt
* 1 if memory parameters are disabled.
*/
int computeNumSlotsPerMap(long slotSizePerMap) {
if ((slotSizePerMap==DISABLED_MEMORY_LIMIT) ||
(getMemoryForMapTask()==DISABLED_MEMORY_LIMIT)) {
return 1;
}
return (int)(Math.ceil((float)getMemoryForMapTask() / (float)slotSizePerMap));
}
/**
* Compute the number of slots required to run a single reduce task-attempt
* of this job.
* @param slotSizePerReduce cluster-wide value of the amount of memory
* required to run a reduce-task
* @return the number of slots required to run a single reduce task-attempt
* 1 if memory parameters are disabled.
*/
int computeNumSlotsPerReduce(long slotSizePerReduce) {
if ((slotSizePerReduce==DISABLED_MEMORY_LIMIT) ||
(getMemoryForReduceTask()==DISABLED_MEMORY_LIMIT)) {
return 1;
}
return
(int)(Math.ceil((float)getMemoryForReduceTask() / (float)slotSizePerReduce));
}
/**
* Find a jar that contains a class of the same name, if any.
* It will return a jar file, even if that is not the first thing
* on the class path that has a class with the same name.
*
* @param my_class the class to find.
* @return a jar file that contains the class, or null.
* @throws IOException
*/
private static String findContainingJar(Class my_class) {
ClassLoader loader = my_class.getClassLoader();
String class_file = my_class.getName().replaceAll("\\.", "/") + ".class";
try {
for(Enumeration itr = loader.getResources(class_file);
itr.hasMoreElements();) {
URL url = (URL) itr.nextElement();
if ("jar".equals(url.getProtocol())) {
String toReturn = url.getPath();
if (toReturn.startsWith("file:")) {
toReturn = toReturn.substring("file:".length());
}
toReturn = URLDecoder.decode(toReturn, "UTF-8");
return toReturn.replaceAll("!.*$", "");
}
}
} catch (IOException e) {
throw new RuntimeException(e);
}
return null;
}
/**
* Get the memory required to run a task of this job, in bytes. See
* {@link #MAPRED_TASK_MAXVMEM_PROPERTY}
* <p/>
* This method is deprecated. Now, different memory limits can be
* set for map and reduce tasks of a job, in MB.
* <p/>
* For backward compatibility, if the job configuration sets the
* key {@link #MAPRED_TASK_MAXVMEM_PROPERTY} to a value different
* from {@link #DISABLED_MEMORY_LIMIT}, that value is returned.
* Otherwise, this method will return the larger of the values returned by
* {@link #getMemoryForMapTask()} and {@link #getMemoryForReduceTask()}
* after converting them into bytes.
*
* @return Memory required to run a task of this job, in bytes,
* or {@link #DISABLED_MEMORY_LIMIT}, if unset.
* @see #setMaxVirtualMemoryForTask(long)
* @deprecated Use {@link #getMemoryForMapTask()} and
* {@link #getMemoryForReduceTask()}
*/
@Deprecated
public long getMaxVirtualMemoryForTask() {
LOG.warn(
"getMaxVirtualMemoryForTask() is deprecated. " +
"Instead use getMemoryForMapTask() and getMemoryForReduceTask()");
long value = getLong(MAPRED_TASK_MAXVMEM_PROPERTY, DISABLED_MEMORY_LIMIT);
value = normalizeMemoryConfigValue(value);
if (value == DISABLED_MEMORY_LIMIT) {
value = Math.max(getMemoryForMapTask(), getMemoryForReduceTask());
value = normalizeMemoryConfigValue(value);
if (value != DISABLED_MEMORY_LIMIT) {
value *= 1024*1024;
}
}
return value;
}
/**
* Set the maximum amount of memory any task of this job can use. See
* {@link #MAPRED_TASK_MAXVMEM_PROPERTY}
* <p/>
* mapred.task.maxvmem is split into
* mapred.job.map.memory.mb
* and mapred.job.map.memory.mb,mapred
* each of the new key are set
* as mapred.task.maxvmem / 1024
* as new values are in MB
*
* @param vmem Maximum amount of virtual memory in bytes any task of this job
* can use.
* @see #getMaxVirtualMemoryForTask()
* @deprecated
* Use {@link #setMemoryForMapTask(long mem)} and
* Use {@link #setMemoryForReduceTask(long mem)}
*/
@Deprecated
public void setMaxVirtualMemoryForTask(long vmem) {
LOG.warn("setMaxVirtualMemoryForTask() is deprecated."+
"Instead use setMemoryForMapTask() and setMemoryForReduceTask()");
if(vmem != DISABLED_MEMORY_LIMIT && vmem < 0) {
setMemoryForMapTask(DISABLED_MEMORY_LIMIT);
setMemoryForReduceTask(DISABLED_MEMORY_LIMIT);
}
if(get(JobConf.MAPRED_TASK_MAXVMEM_PROPERTY) == null) {
setMemoryForMapTask(vmem / (1024 * 1024)); //Changing bytes to mb
setMemoryForReduceTask(vmem / (1024 * 1024));//Changing bytes to mb
}else{
this.setLong(JobConf.MAPRED_TASK_MAXVMEM_PROPERTY,vmem);
}
}
/**
* @deprecated this variable is deprecated and nolonger in use.
*/
@Deprecated
public long getMaxPhysicalMemoryForTask() {
LOG.warn("The API getMaxPhysicalMemoryForTask() is deprecated."
+ " Refer to the APIs getMemoryForMapTask() and"
+ " getMemoryForReduceTask() for details.");
return -1;
}
/*
* @deprecated this
*/
@Deprecated
public void setMaxPhysicalMemoryForTask(long mem) {
LOG.warn("The API setMaxPhysicalMemoryForTask() is deprecated."
+ " The value set is ignored. Refer to "
+ " setMemoryForMapTask() and setMemoryForReduceTask() for details.");
}
static String deprecatedString(String key) {
return "The variable " + key + " is no longer used.";
}
private void checkAndWarnDeprecation() {
if(get(JobConf.MAPRED_TASK_MAXVMEM_PROPERTY) != null) {
LOG.warn(JobConf.deprecatedString(JobConf.MAPRED_TASK_MAXVMEM_PROPERTY)
+ " Instead use " + JobConf.MAPRED_JOB_MAP_MEMORY_MB_PROPERTY
+ " and " + JobConf.MAPRED_JOB_REDUCE_MEMORY_MB_PROPERTY);
}
}
}
| [
"zhangyf@mail.neu.edu.cn"
] | zhangyf@mail.neu.edu.cn |
37ff211af4c3c1d0903c81cacb26f2017a4810f8 | 95e9802bc259958e5f7533e48e1911d2f0421fa0 | /OrdenDatos/src/PriorityQueue1.java | 0dcb35fcae06b8a0ed03d85580ad25072afe4168 | [] | no_license | michirapper/TareasJavaDAM1 | d1def7d5e09481577ea63e1b29ed9bc649c2619c | 8284d631365b247dd1f029333ddcca6fdc982304 | refs/heads/master | 2022-10-14T07:08:13.574367 | 2020-06-10T14:28:10 | 2020-06-10T14:28:10 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 609 | java |
import java.util.LinkedList;
import java.util.PriorityQueue;
public class PriorityQueue1 {
public static void main(String[] args) {
LinkedList<String> miColeccion = new LinkedList<String>();
miColeccion.add("Collection");
miColeccion.add("List");
miColeccion.add("Set");
miColeccion.add("SortedSet");
miColeccion.add("Map");
String aux = miColeccion.poll();
miColeccion.add(aux);
// System.out.println("Primer elemento:");
// System.out.println(miColeccion.poll());
// System.out.println("Resto de elementos:");
for (String elto : miColeccion) {
System.out.println(elto);
}
}
}
| [
"magarreacebes@gmail.com"
] | magarreacebes@gmail.com |
ebd84797cdc4c9ca26bb1dfae40a57b347b8d7aa | fff66ea0fd7a430cbda0fb488d3298ce2c930397 | /refactoring/src/main/java/refactoring/day1/practice04/DivergentChange/PrescriptionTest.java | 675beea556f7305d2ee7a4d18cc4cd18d89930be | [] | no_license | MinCha/lab | 272ec1abea5e02158854143f15d66ef0d0a23c44 | 9c0a68d1f72200cccdf62e7e938ed43e8dd73b1a | refs/heads/master | 2020-12-24T15:22:14.063401 | 2015-10-20T12:46:45 | 2015-10-20T12:46:45 | 12,552,842 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,530 | java | package refactoring.day1.practice04.DivergentChange;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import refactoring.day1.practice01.longMethod.case1.extractMethod.Robot;
@RunWith(MockitoJUnitRunner.class)
public class PrescriptionTest {
@Mock
private Robot robot;
@Test(expected = IllegalArgumentException.class)
public void testGetPrescription() throws Exception {
Prescription prescription = new Prescription();
assertEquals("two pill a day", prescription.getPrescription("adult", "serious"));
assertEquals("one pill a day", prescription.getPrescription("adult", "mild"));
assertEquals("one pill a day", prescription.getPrescription("child", "serious"));
assertEquals("half pill a day", prescription.getPrescription("child", "mild"));
prescription.getPrescription("children", "mild");
}
@Test(expected = IllegalArgumentException.class)
public void testGetIngestionPerDay() throws Exception {
Prescription prescription = new Prescription();
assertTrue(2d == prescription.getMaxIngestionPerDay("adult", "serious"));
assertTrue(1d == prescription.getMaxIngestionPerDay("adult", "mild"));
assertTrue(1d == prescription.getMaxIngestionPerDay("child", "serious"));
assertTrue(0.5d == prescription.getMaxIngestionPerDay("child", "mild"));
prescription.getPrescription("adlut", "mild");
}
}
| [
"vayne.q@daumkakao.com"
] | vayne.q@daumkakao.com |
a89c5db716379cd21e90b4c8916942f0f2d78bc5 | bc1156993ef0bb9bd90ee97e2e0ec261c91fa95b | /src/com/elikill58/negativity/sponge/FakePlayer.java | 50f06227958e927c241fc37e5bbb8c3780296146 | [] | no_license | VincoNafta/Negativity | 8caf6b22c2c2ee6fcc1ea4f6836d2caf872d8118 | d6f356a7ed63e30eb21dde0f4f96af82f0417359 | refs/heads/master | 2023-07-14T07:35:47.174010 | 2021-08-12T10:50:54 | 2021-08-12T10:50:54 | 251,014,159 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,204 | java | package com.elikill58.negativity.sponge;
import org.spongepowered.api.entity.Entity;
import org.spongepowered.api.entity.living.player.Player;
import org.spongepowered.api.world.Location;
import org.spongepowered.api.world.World;
import com.elikill58.negativity.universal.adapter.Adapter;
public class FakePlayer {
private Entity fakePlayer;
private Location<World> loc;
private String name;
public FakePlayer(Location<World> loc, String name) {
this.loc = loc;
this.name = name;
/*fakePlayer = loc.getExtent().createEntity(EntityTypes.PLAYER, loc.getPosition());
fakePlayer.offer(Keys.DISPLAY_NAME, Text.of(name));
fakePlayer.offer(Keys.INVISIBLE, true);*/
Adapter.getAdapter().warn("Cannot spawn a fake player now. Sponge doesn't allow us to do it right now.");
}
public FakePlayer show(Player p) {
//p.getWorld().spawnEntity(fakePlayer);
return this;
}
public void hide(Player p) {
if(fakePlayer.isRemoved())
fakePlayer.remove();
SpongeNegativityPlayer.getNegativityPlayer(p).removeFakePlayer(this);
}
public Location<World> getLocation() {
return loc;
}
public String getName() {
return name;
}
public Entity getEntity() {
return fakePlayer;
}
}
| [
"arpetzouille@gmail.com"
] | arpetzouille@gmail.com |
5883e5c3078ca4738fdcc7405ee75794509a3966 | 4ed22c04993f78172724b66167a6cefe7a92f135 | /use-undertow/src/main/java/com/ltq/undertow/pattern/factory/simple/Operation.java | 37ac9814e54599e82f1a3ca85c13ffe6cdbc0440 | [] | no_license | lituquan/springboot-demo | 1b0cfe2a79d69459e84f5f26278cf7dc591463d9 | a27c8ed2d6820ba6782fa73f303a6d23a7441a8e | refs/heads/master | 2023-07-20T03:39:10.520870 | 2023-07-13T16:38:35 | 2023-07-13T16:38:35 | 247,472,558 | 0 | 0 | null | 2023-07-13T16:36:12 | 2020-03-15T13:33:07 | Java | UTF-8 | Java | false | false | 706 | java | package com.ltq.undertow.pattern.factory.simple;
public abstract class Operation {
private double numberA;
private double numberB;
/**
* @return double return the numberA
*/
public double getNumberA() {
return numberA;
}
/**
* @param numberA the numberA to set
*/
public void setNumberA(double numberA) {
this.numberA = numberA;
}
/**
* @return double return the numberB
*/
public double getNumberB() {
return numberB;
}
/**
* @param numberB the numberB to set
*/
public void setNumberB(double numberB) {
this.numberB = numberB;
}
public abstract double getresult();
} | [
"1242441055@qq.com"
] | 1242441055@qq.com |
ae81987e9517269b4f77f98665abde98b74d013b | ba2a5afc0e9f8ac1e7e93ae06f575aaad026375d | /java/DesignPattern/src/com/bruce/factory/simplefactory/pizzastore/pizza/CheesPizza.java | f3608713f5847912d976ec23dbb87dc716e7d213 | [] | no_license | brucewoods/code_kitchen | 96da1262d52309e47616f4a3bae0b99d0e1294b8 | 731a4f2660c94b46feecda1e226da90ea00891d4 | refs/heads/master | 2022-12-26T06:19:30.177092 | 2020-05-12T06:10:33 | 2020-05-12T06:10:33 | 129,546,680 | 0 | 0 | null | 2022-12-15T23:51:35 | 2018-04-14T19:09:36 | HTML | UTF-8 | Java | false | false | 176 | java | package com.bruce.factory.simplefactory.pizzastore.pizza;
public class CheesPizza extends Pizza {
public void prepare() {
System.out.println(name+" : preparing");
}
}
| [
"wooupup@gmail.com"
] | wooupup@gmail.com |
2bbaafcd0009f29c62b00e42bc2f72ba103addc5 | aa78b36eb75f315e3b82cf726b86f243a89f7924 | /src/main/java/com/kevin/base/spi/Cat.java | d8e3cddb646760cbbcdc88bc25f8f25b05ba4980 | [] | no_license | kevinyangss/train-java | 1a8c0ee8c4535acf4e26c5a06e620e75dad38dec | f7f021bee5931b85447d36674ba513c9bf95febb | refs/heads/master | 2022-12-20T13:18:19.635050 | 2021-04-17T10:14:44 | 2021-04-17T10:14:44 | 140,805,166 | 0 | 0 | null | 2022-12-16T04:24:37 | 2018-07-13T06:14:28 | Java | UTF-8 | Java | false | false | 249 | java | package com.kevin.base.spi;
/**
* @ClassName Cat
* @Description TODO
* @Author kevin.yang
* @Date 2021-04-17 11:20
*/
public class Cat implements IShout{
@Override
public void shout() {
System.out.println("miao miao");
}
}
| [
"ss.yang@datsch.com.cn"
] | ss.yang@datsch.com.cn |
b20bf6e6c95866f1b64768a49befe63b30564c96 | 6060d86ff300326b98442ff5ae9865a032a8b092 | /SeleniumCerificationProblem/src/test/java/Test/MercuryTours.java | 1b3cfab800e3bcc5adb572d3babb7f1fc1bee816 | [] | no_license | bhavsbhatnagar2484/Selenium | 87615b171c18f6c7e2e396f3b08c5466dae671ca | 11fe5d8f1604c7ee673fd551ba7b5dc30b74ab91 | refs/heads/master | 2022-06-16T23:57:13.241725 | 2020-05-09T04:34:58 | 2020-05-09T04:34:58 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,118 | java | package Test;
import org.testng.Assert;
import org.testng.annotations.Test;
import API.ReportConfigurations;
import Entities.UserEntity;
import MasterSetup.Temp;
import Pages.DashboardPage;
import Pages.FlightsPage;
public class MercuryTours {
@Test(priority=1,enabled=true)
public static void TestCase1()
{
try{
ReportConfigurations.appendTestCaseHeader("Mercury Tours - TestCase 1");
ReportConfigurations.appendTestCaseSubTitle("Test Case : "+Temp.iTcCnt +" - Validate the credentials of the user on the application.");
boolean loginTest=DashboardPage.fnLogin("Test", "Test");
Assert.assertFalse(loginTest);
ReportConfigurations.Close_Subtitle();
ReportConfigurations.close_TestcaseHeader();
ReportConfigurations.endExtentReport();
}catch(Exception e)
{
e.printStackTrace();
}
}
@Test(priority=2,enabled=true)
public static void TestCase2()
{
try{
ReportConfigurations.appendTestCaseHeader("Mercury Tours - TestCase 2");
UserEntity user1=new UserEntity();
user1.setFirstName("Sanjay");user1.setLastName("Ramasamy");
user1.setExp_month("04");user1.setExp_year("2010");
user1.setCreditCardType("MasterCard");user1.setCreditCardNumber("1234 5678 9012");
ReportConfigurations.appendTestCaseSubTitle("Test Case : "+Temp.iTcCnt +" - User should be able to book a return ticket successfully by logging into application");
boolean loginTest=DashboardPage.fnLogin("Ramasamy", "Ramasamy");
Assert.assertTrue(loginTest);
DashboardPage.fnNavigateToFlightsPage();
boolean bookTicketsTest=FlightsPage.fnBookReturnTicket(user1.getFirstName(), user1.getLastName(), user1.getCreditCardType(), user1.getCreditCardNumber(), user1.getExp_month(), user1.getExp_year());
Assert.assertTrue(bookTicketsTest);
FlightsPage.fnLogout();
ReportConfigurations.Close_Subtitle();
ReportConfigurations.close_TestcaseHeader();
ReportConfigurations.endExtentReport();
}catch(Exception e)
{
e.printStackTrace();
}
}
}
| [
"M1047284@B2ML32250.mindtree.com"
] | M1047284@B2ML32250.mindtree.com |
0aff661820dad2ec39ee4133b6f28240df85716b | 2bfe5bbebb1f440a6f5f8938e4923193214cea0e | /server/menus/ScoreboardMenu.java | 096e181b113787ebddfb9d9178b1c0e53c0fba50 | [] | no_license | Negarbsh/YuGiOh | 47cd5267479d034b34212dd3f4834d82fe0aae56 | c898029486bf7b1317635c9c73947b9244694ca9 | refs/heads/master | 2023-06-28T07:13:41.573583 | 2021-07-21T20:09:34 | 2021-07-21T20:09:34 | 382,063,317 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 1,003 | java | package server.menus;
import server.model.User;
import java.io.DataOutputStream;
import java.io.IOException;
public class ScoreboardMenu {
// public static void checkMenuCommands(String command) throws InvalidCommand, WrongMenu {
// if (RelatedToMenuController.isMenuFalse(MenuName.SCOREBOARD)) throw new WrongMenu();
// if (command.equals("show"))
// System.out.println(ScoreBoardMenuController.showScoreBoard());
// else throw new InvalidCommand();
// }
public static void checkMenuCommands(String command, Menu menu) {
if (command.contains("show")) {
DataOutputStream dataOutputStream = menu.dataOutputStream;
try {
dataOutputStream.writeUTF("scoreBoard-show-" + User.showScoreBoard());
} catch (IOException e) {
e.printStackTrace();
}
} else if (command.contains("addScore10")) {
menu.user.increaseScore(10);
} //else throw sth
}
}
| [
"mehrnegar81@gmail.com"
] | mehrnegar81@gmail.com |
93d73aa6c345088db4a5b03d968c0a7621e8c251 | 139af6571416192fd36f9c9885a4c9b54792d8c6 | /EmpiricalAnalyses/TIS/Mutants/TIS367.java | 37f9def3be53452089d225446c748dbf4fd6640d | [] | no_license | NatCPN/TransformRules | 6f60c368498f58e85aa25437939b5da3b5d39ce3 | eaa64c8dc43b75c1ea9e1588398ac3982a6962d7 | refs/heads/master | 2020-12-24T06:47:04.156901 | 2018-03-15T16:16:01 | 2018-03-15T16:16:01 | 73,331,665 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,715 | java | // This is mutant program.
// Author : ysma
public class TIS367
{
public int the_indication_lights = 2;
public int the_flashing_mode = 2;
public int the_flashing_timer = 0;
public int primed_the_indication_lights = 2;
public int primed_the_flashing_mode = 2;
public int primed_the_flashing_timer = 0;
public int old_the_turn_indicator_lever = 0;
public int old_the_emergency_flashing = 0;
public int old_the_voltage = 79;
public int old_the_flashing_mode = 2;
public java.lang.String run( int TIME, int the_emergency_flashing, int the_turn_indicator_lever, int the_voltage )
{
if (!(the_flashing_mode == 3) && old_the_turn_indicator_lever == 2 && the_turn_indicator_lever == 2 && (!(old_the_emergency_flashing == 0) && the_emergency_flashing == 0)) {
primed_the_flashing_mode = 3;
primed_the_flashing_timer = TIME;
}
if (the_emergency_flashing == 0 && (!(old_the_turn_indicator_lever == 2) && the_turn_indicator_lever == 2)) {
primed_the_flashing_mode = 3;
primed_the_flashing_timer = TIME;
}
if (!(old_the_emergency_flashing == 1) && the_emergency_flashing == 1) {
primed_the_flashing_mode = 0;
primed_the_flashing_timer = TIME;
}
if (the_emergency_flashing == 0 && (!(old_the_turn_indicator_lever == 1) && the_turn_indicator_lever == 1)) {
primed_the_flashing_mode = 1;
primed_the_flashing_timer = TIME;
}
if (!(old_the_turn_indicator_lever == 2) && the_turn_indicator_lever == 2 && old_the_emergency_flashing == 1 && the_emergency_flashing == 1) {
primed_the_flashing_mode = 3;
primed_the_flashing_timer = TIME;
}
if (!(the_flashing_mode == 0) && (!(!(old_the_turn_indicator_lever == 0) && the_turn_indicator_lever == 0)) && old_the_emergency_flashing == 1 && the_emergency_flashing == 1) {
primed_the_flashing_mode = 0;
primed_the_flashing_timer = TIME;
}
if (!(old_the_turn_indicator_lever == 1) && the_turn_indicator_lever == 1 && old_the_emergency_flashing == 1 && the_emergency_flashing == 1) {
primed_the_flashing_mode = 1;
primed_the_flashing_timer = TIME;
}
if (!(the_flashing_mode == 1) && old_the_turn_indicator_lever == 1 && the_turn_indicator_lever == 1 && (!(old_the_emergency_flashing == 0) && the_emergency_flashing == 0)) {
primed_the_flashing_mode = 1;
primed_the_flashing_timer = TIME;
}
if (!(old_the_voltage <= 80) && the_voltage <= 80) {
primed_the_indication_lights = 2;
primed_the_flashing_timer = TIME;
}
if (the_flashing_mode == 1 && the_voltage > 80 && (!(old_the_flashing_mode == 1) && the_flashing_mode == 1 || !(old_the_voltage > 80) && the_voltage > 80)) {
primed_the_indication_lights = 1;
primed_the_flashing_timer = TIME;
}
if (the_flashing_mode == 0 && the_indication_lights == 2 && the_voltage > 80 && TIME - the_flashing_timer >= 220) {
primed_the_indication_lights = 0;
primed_the_flashing_timer = TIME;
}
if (the_flashing_mode == 1 && the_indication_lights == 2 && the_voltage > 80 && TIME - the_flashing_timer >= 220) {
primed_the_indication_lights = 1;
primed_the_flashing_timer = TIME;
}
if (the_flashing_mode == 0 && the_voltage > 80 && (!(old_the_flashing_mode == 0) && the_flashing_mode == 0 || !(old_the_voltage > 80) && the_voltage > 80)) {
primed_the_indication_lights = 0;
primed_the_flashing_timer = TIME;
}
if (the_flashing_mode == 2 && the_voltage > 80) {
primed_the_indication_lights = 2;
primed_the_flashing_timer = TIME;
}
if ((the_indication_lights == 3 || the_indication_lights == 1) && the_voltage > 80 && TIME - the_flashing_timer >= 340) {
primed_the_indication_lights = 2;
primed_the_flashing_timer = TIME;
}
if (the_flashing_mode == 3 && the_indication_lights == 2 && the_voltage > 80 && TIME - the_flashing_timer >= 220) {
primed_the_indication_lights = 3;
primed_the_flashing_timer = TIME;
}
if (the_flashing_mode == 3 && the_voltage > 80 && (!(old_the_flashing_mode == 3) && the_flashing_mode == 3 || !(old_the_voltage > 80) && the_voltage > 80)) {
primed_the_indication_lights = 3;
primed_the_flashing_timer = TIME;
}
return primed_the_indication_lights + " " + primed_the_flashing_mode;
}
}
| [
"noreply@github.com"
] | noreply@github.com |
8c7076d1f79e955bb98a160486c4516151b27579 | 757360b8d8a36a2c1eecc6e14a8f53fab1092fda | /android/graphics/drawable/VectorDrawable.java | 121208bb993a738e52f86309b8febebcb3a53b97 | [] | no_license | haigendong/AndroidDictionary | d51ef266f4684c40986286a70511a7648c1b4e33 | be0c7a4508d8055d915404273339610bbf53e3fa | refs/heads/master | 2022-04-13T14:36:53.280469 | 2020-03-26T20:21:41 | 2020-03-26T20:21:41 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,210 | java | /* */ package android.graphics.drawable;
/* */
/* */ import android.content.res.ColorStateList;
/* */ import android.content.res.Resources;
/* */ import android.graphics.Canvas;
/* */ import android.graphics.ColorFilter;
/* */ import android.graphics.PorterDuff;
/* */ import android.util.AttributeSet;
/* */ import androidx.annotation.RecentlyNonNull;
/* */ import androidx.annotation.RecentlyNullable;
/* */ import java.io.IOException;
/* */ import org.xmlpull.v1.XmlPullParser;
/* */ import org.xmlpull.v1.XmlPullParserException;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public class VectorDrawable
/* */ extends Drawable
/* */ {
/* */ public VectorDrawable() {
/* 277 */ throw new RuntimeException("Stub!");
/* */ } public Drawable mutate() {
/* 279 */ throw new RuntimeException("Stub!");
/* */ } public Drawable.ConstantState getConstantState() {
/* 281 */ throw new RuntimeException("Stub!");
/* */ } public void draw(Canvas canvas) {
/* 283 */ throw new RuntimeException("Stub!");
/* */ } public int getAlpha() {
/* 285 */ throw new RuntimeException("Stub!");
/* */ } public void setAlpha(int alpha) {
/* 287 */ throw new RuntimeException("Stub!");
/* */ } public void setColorFilter(ColorFilter colorFilter) {
/* 289 */ throw new RuntimeException("Stub!");
/* */ } public ColorFilter getColorFilter() {
/* 291 */ throw new RuntimeException("Stub!");
/* */ } public void setTintList(ColorStateList tint) {
/* 293 */ throw new RuntimeException("Stub!");
/* */ } public void setTintMode(PorterDuff.Mode tintMode) {
/* 295 */ throw new RuntimeException("Stub!");
/* */ } public boolean isStateful() {
/* 297 */ throw new RuntimeException("Stub!");
/* */ } protected boolean onStateChange(int[] stateSet) {
/* 299 */ throw new RuntimeException("Stub!");
/* */ } public int getOpacity() {
/* 301 */ throw new RuntimeException("Stub!");
/* */ } public int getIntrinsicWidth() {
/* 303 */ throw new RuntimeException("Stub!");
/* */ } public int getIntrinsicHeight() {
/* 305 */ throw new RuntimeException("Stub!");
/* */ } public boolean canApplyTheme() {
/* 307 */ throw new RuntimeException("Stub!");
/* */ } public void applyTheme(Resources.Theme t) {
/* 309 */ throw new RuntimeException("Stub!");
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public void inflate(@RecentlyNonNull Resources r, @RecentlyNonNull XmlPullParser parser, @RecentlyNonNull AttributeSet attrs, @RecentlyNullable Resources.Theme theme) throws IOException, XmlPullParserException {
/* 321 */ throw new RuntimeException("Stub!");
/* */ }
/* */
/* */
/* */
/* */ public int getChangingConfigurations() {
/* 327 */ throw new RuntimeException("Stub!");
/* */ } public void setAutoMirrored(boolean mirrored) {
/* 329 */ throw new RuntimeException("Stub!");
/* */ } public boolean isAutoMirrored() {
/* 331 */ throw new RuntimeException("Stub!");
/* */ }
/* */ }
/* Location: M:\learn_android\android.jar!\android\graphics\drawable\VectorDrawable.class
* Java compiler version: 8 (52.0)
* JD-Core Version: 1.1.3
*/ | [
"13377875645@163.com"
] | 13377875645@163.com |
295335e6870ca90af934f40849dd98ba13bfe5af | d20e90dae10b3349c0b5ac03ba8963555176ab05 | /aeolian/parser$check_valid_line_number.java | 9c9bac7e9b843cb56b6bdbf4aca713f43e660043 | [] | no_license | andeemarks/aeolian-decompiled | 07673e069a149e5d91ffb3ffff983de32213db71 | 3375a68b3fd7d7bc07a3e9cbd9732d794de35a48 | refs/heads/master | 2021-07-14T23:33:33.516388 | 2017-10-16T11:08:07 | 2017-10-16T11:08:07 | 107,116,585 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,374 | java | /* */ package aeolian;
/* */
/* */ import clojure.lang.IFn;
/* */ import clojure.lang.Var;
/* */
/* */ public final class parser$check_valid_line_number extends clojure.lang.AFunction
/* */ {
/* */ public Object invoke(Object paramObject)
/* */ {
/* 10 */ paramObject = null;return invokeStatic(paramObject); } public static final Object const__4 = java.util.regex.Pattern.compile("#"); public static final Var const__3 = (Var)clojure.lang.RT.var("clojure.string", "split"); public static final Var const__2 = (Var)clojure.lang.RT.var("clojure.core", "last"); public static final Var const__1 = (Var)clojure.lang.RT.var("aeolian.parser", "metric-line-to-bits"); public static final Var const__0 = (Var)clojure.lang.RT.var("clojure.core", "first");
/* 11 */ public static Object invokeStatic(Object metric) { metric = null;Object file_line_id = ((IFn)const__0.getRawRoot()).invoke(((IFn)const__1.getRawRoot()).invoke(metric));
/* 12 */ file_line_id = null;return Integer.valueOf(Integer.parseInt((String)((IFn)const__2.getRawRoot()).invoke(((IFn)const__3.getRawRoot()).invoke(file_line_id, const__4))));
/* */ }
/* */ }
/* Location: /home/amarks/code/aeolian/target/aeolian-0.1.1-SNAPSHOT.jar!/aeolian/parser$check_valid_line_number.class
* Java compiler version: 5 (49.0)
* JD-Core Version: 0.7.1
*/ | [
"amarks@thoughtworks.com"
] | amarks@thoughtworks.com |
7081f3ed09659396f6bacb7e2b9393efb6571e4d | 57b5a57182f029ec64fb47503463c3242904cf12 | /FrontEnd/SailfishFrontEnd/src/main/java/com/exactpro/sf/testwebgui/restapi/json/action/JsonAction.java | 44810fa5a7b8101a5be2a910e66024d080e990c3 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | exactpro/sailfish-core | ac77a5e32460f8d4b2643bba3bf16c0ce7556ccc | 9886bdda0ed6e568d984f3b5fc091cffc17387bf | refs/heads/master | 2023-09-03T15:56:29.896363 | 2023-08-23T18:39:49 | 2023-08-24T07:28:56 | 163,079,637 | 42 | 11 | Apache-2.0 | 2023-03-04T04:37:31 | 2018-12-25T12:11:23 | Java | UTF-8 | Java | false | false | 2,871 | java | /******************************************************************************
* Copyright 2009-2018 Exactpro (Exactpro Systems Limited)
*
* 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.exactpro.sf.testwebgui.restapi.json.action;
import java.util.Collection;
import java.util.Collections;
import java.util.Set;
import com.exactpro.sf.aml.Direction;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
public class JsonAction {
private final String name;
private final Collection<String> required;
private final Collection<String> optional;
private final Direction direction;
private final Set<String> utilClasses;
private final boolean isAML2;
private final boolean isAML3;
@JsonInclude(Include.NON_NULL)
private final String help;
public JsonAction(String name, Collection<String> required, Collection<String> optional,
Direction direction, Set<String> utilClasses, boolean isAML2, boolean isAML3, String help) {
this.name = name;
this.required = required;
this.optional = optional;
this.direction = direction;
this.utilClasses = utilClasses;
this.isAML2 = isAML2;
this.isAML3 = isAML3;
this.help = help;
}
public JsonAction(String name) {
this(name, Collections.<String>emptyList(), Collections.<String>emptyList(), null, null, false, true, null);
}
public JsonAction(String name, Collection<String> required) {
this(name, required, Collections.<String>emptyList(), null, null, false, true, null);
}
public JsonAction(String name, Collection<String> required, Collection<String> optional) {
this(name, required, optional, null, null, false, true, null);
}
public String getName() {
return name;
}
public Collection<String> getRequired() {
return required;
}
public Collection<String> getOptional() {
return optional;
}
public Direction getDirection() {
return direction;
}
public Set<String> getUtilClasses() {
return utilClasses;
}
@JsonProperty("isAML2")
public boolean isAML2() {
return isAML2;
}
@JsonProperty("isAML3")
public boolean isAML3() {
return isAML3;
}
public String getHelp() {
return help;
}
}
| [
"nikita.smirnov@exactprosystems.com"
] | nikita.smirnov@exactprosystems.com |
7fcccf6b1ced9c70e42362c045069786d2389322 | 31c6d8db4880d0d8912401af1887bc4029b616ad | /EBookProj/src/com/ebook/model/Customer.java | 9da4580c61083a3488e766194747f8b5cf520370 | [] | no_license | DTD-365/CRMDoc | e73566dfa330bafcc6b7bc05effc4695a7662b9b | a52a8d45982840bcb1c0116c05e3c75c9a929d65 | refs/heads/master | 2021-01-20T12:06:56.637352 | 2015-10-03T14:43:50 | 2015-10-03T14:43:50 | 43,598,734 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,351 | java | package com.ebook.model;
public class Customer {
private Integer id;
private String name;
private String password;
private String sex;
private String email;
private String phone;
private String address;
private String question;
private String answer;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getSex() {
return sex;
}
public void setSex(String sex) {
this.sex = sex;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getQuestion() {
return question;
}
public void setQuestion(String question) {
this.question = question;
}
public String getAnswer() {
return answer;
}
public void setAnswer(String answer) {
this.answer = answer;
}
}
| [
"2219510449@qq.com"
] | 2219510449@qq.com |
92013393c9ff0726f8f112e7e4763c7a74e07d41 | 861867cd6d048f2b3bd9241be451631a4dbeccec | /Triangle.java | 590e5db2bc77c2e013dde957bfd528217e67a981 | [] | no_license | tohak/oopLesson2 | c0b16ac94e33b09eb70d3efe7d5c2a965da6237d | ac2f71c77231092c49e4a426ece124b5e84f70eb | refs/heads/master | 2021-04-27T19:41:43.353145 | 2018-02-21T16:46:00 | 2018-02-21T16:46:00 | 122,362,758 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 999 | java | package com.konovalov;
public class Triangle extends Shape {
private Point a;
private Point b;
private Point c;
public Triangle(Point a, Point b, Point c) {
super();
this.a = a;
this.b = b;
this.c = c;
}
public Triangle() {
super();
// TODO Auto-generated constructor stub
}
public Point getA() {
return a;
}
public void setA(Point a) {
this.a = a;
}
public Point getB() {
return b;
}
public void setB(Point b) {
this.b = b;
}
public Point getC() {
return c;
}
public void setC(Point c) {
this.c = c;
}
@Override
public String toString() {
return "Triangle [a=" + a + ", b=" + b + ", c=" + c + "]";
}
@Override
double getPerimetr() {
// TODO Auto-generated method stub
return a.distance(b)+b.distance(c)+c.distance(a);
}
@Override
double getArea() {
double p= (a.distance(b)+b.distance(c)+c.distance(a))/2;
return Math.sqrt(p*(p-a.distance(b))*(p-b.distance(c))*(p-c.distance(a)));
}
}
| [
"noreply@github.com"
] | noreply@github.com |
cfa5cb4d92d2fe6538a72e252abd7ea312e1f0fa | 357886faf6e614ac1a299e05939877484d2bb292 | /src/com/lenovo/market/dbhelper/UserDBHelper.java | f226842e1d3ebd6b4d8c45d8a61a1114e3f6b43f | [] | no_license | happy-rmq/market_beihai | 65d3e91e885a3ebe1ebb2ae909bb3b1af0bcb3dd | cb728b2d39ac4224407c753c0e96e4160a929480 | refs/heads/master | 2021-01-20T08:31:11.229585 | 2014-08-25T09:21:18 | 2014-08-25T09:21:18 | 23,308,432 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 6,279 | java | package com.lenovo.market.dbhelper;
import android.content.ContentValues;
import android.database.Cursor;
import android.text.TextUtils;
import com.lenovo.market.common.MarketApp;
import com.lenovo.market.vo.server.UserVo;
public class UserDBHelper {
private MarketDBHelper marketDB;
public UserDBHelper() {
super();
marketDB = MarketDBHelper.getInstance(MarketApp.app);
if (!marketDB.db.isOpen())
marketDB.open();
}
public long saveUserInfo(UserVo user) {
marketDB.getDb();
ContentValues values = new ContentValues();
if (!TextUtils.isEmpty(user.getUid())) {
values.put(DatabaseContract.UserInfoTable.COLUMN_NAME_UID, user.getUid());
}
if (!TextUtils.isEmpty(user.getAccount())) {
values.put(DatabaseContract.UserInfoTable.COLUMN_NAME_ACCOUNT, user.getAccount());
}
if (!TextUtils.isEmpty(user.getPassword())) {
values.put(DatabaseContract.UserInfoTable.COLUMN_NAME_PASSWORD, user.getPassword());
}
if (!TextUtils.isEmpty(user.getUserName())) {
values.put(DatabaseContract.UserInfoTable.COLUMN_NAME_NAME, user.getUserName());
}
if (!TextUtils.isEmpty(user.getPhone())) {
values.put(DatabaseContract.UserInfoTable.COLUMN_NAME_PHONE, user.getPhone());
}
if (!TextUtils.isEmpty(user.getPicture())) {
values.put(DatabaseContract.UserInfoTable.COLUMN_NAME_HEADURL, user.getPicture());
}
if (!TextUtils.isEmpty(user.getQrCode())) {
values.put(DatabaseContract.UserInfoTable.COLUMN_NAME_QRCODE, user.getQrCode());
}
if (!TextUtils.isEmpty(user.getSign())) {
values.put(DatabaseContract.UserInfoTable.COLUMN_NAME_SIGN, user.getSign());
}
if (!TextUtils.isEmpty(user.getSex())) {
values.put(DatabaseContract.UserInfoTable.COLUMN_NAME_SEX, user.getSex());
}
if (!TextUtils.isEmpty(user.getCompanyId())) {
values.put(DatabaseContract.UserInfoTable.COLUMN_NAME_COMPANYID, user.getCompanyId());
}
if (!TextUtils.isEmpty(user.getDefaultServAccount())) {
values.put(DatabaseContract.UserInfoTable.COLUMN_NAME_DEFAULTSERVACCOUNT, user.getDefaultServAccount());
}
if (!TextUtils.isEmpty(user.getDefaultServId())) {
values.put(DatabaseContract.UserInfoTable.COLUMN_NAME_DEFAULTSERVID, user.getDefaultServId());
}
if (!TextUtils.isEmpty(user.getServAccount())) {
values.put(DatabaseContract.UserInfoTable.COLUMN_NAME_SERVACCOUNT, user.getServAccount());
}
if (!TextUtils.isEmpty(user.getServId())) {
values.put(DatabaseContract.UserInfoTable.COLUMN_NAME_SERVID, user.getServId());
}
String sql = "select * from " + DatabaseContract.UserInfoTable.TABLE_NAME + " where "//
+ DatabaseContract.UserInfoTable.COLUMN_NAME_ACCOUNT + " = ?"; //
Cursor cursor = marketDB.db.rawQuery(sql, new String[]{user.getAccount()});
long num = 0;
if (cursor.moveToFirst()) {
num = marketDB.db.update(DatabaseContract.UserInfoTable.TABLE_NAME, values, DatabaseContract.UserInfoTable.COLUMN_NAME_ACCOUNT + " = ?", new String[]{user.getAccount()});
} else {
num = marketDB.db.insert(DatabaseContract.UserInfoTable.TABLE_NAME, null, values);
}
cursor.close();
return num;
}
public UserVo getUserInfo(String account) {
marketDB.getDb();
String sql = "select * from " + DatabaseContract.UserInfoTable.TABLE_NAME + " where "//
+ DatabaseContract.UserInfoTable.COLUMN_NAME_ACCOUNT + " = ?"; //
Cursor cursor = marketDB.db.rawQuery(sql, new String[]{account});
UserVo user = null;
if (cursor.moveToFirst()) {
String user_account = cursor.getString(cursor.getColumnIndex(DatabaseContract.UserInfoTable.COLUMN_NAME_ACCOUNT));
String uid = cursor.getString(cursor.getColumnIndex(DatabaseContract.UserInfoTable.COLUMN_NAME_UID));
String password = cursor.getString(cursor.getColumnIndex(DatabaseContract.UserInfoTable.COLUMN_NAME_PASSWORD));
String name = cursor.getString(cursor.getColumnIndex(DatabaseContract.UserInfoTable.COLUMN_NAME_NAME));
String phone = cursor.getString(cursor.getColumnIndex(DatabaseContract.UserInfoTable.COLUMN_NAME_PHONE));
String headUrl = cursor.getString(cursor.getColumnIndex(DatabaseContract.UserInfoTable.COLUMN_NAME_HEADURL));
String qrcode = cursor.getString(cursor.getColumnIndex(DatabaseContract.UserInfoTable.COLUMN_NAME_QRCODE));
String sign = cursor.getString(cursor.getColumnIndex(DatabaseContract.UserInfoTable.COLUMN_NAME_SIGN));
String sex = cursor.getString(cursor.getColumnIndex(DatabaseContract.UserInfoTable.COLUMN_NAME_SEX));
String companyId = cursor.getString(cursor.getColumnIndex(DatabaseContract.UserInfoTable.COLUMN_NAME_COMPANYID));
String default_serv_account = cursor.getString(cursor.getColumnIndex(DatabaseContract.UserInfoTable.COLUMN_NAME_DEFAULTSERVACCOUNT));
String default_servId = cursor.getString(cursor.getColumnIndex(DatabaseContract.UserInfoTable.COLUMN_NAME_DEFAULTSERVID));
String servAccount = cursor.getString(cursor.getColumnIndex(DatabaseContract.UserInfoTable.COLUMN_NAME_SERVACCOUNT));
String servId = cursor.getString(cursor.getColumnIndex(DatabaseContract.UserInfoTable.COLUMN_NAME_SERVID));
user = new UserVo();
user.setAccount(user_account);
user.setUid(uid);
user.setPassword(password);
user.setUserName(name);
user.setPhone(phone);
user.setPicture(headUrl);
user.setQrCode(qrcode);
user.setSign(sign);
user.setSex(sex);
user.setCompanyId(companyId);
user.setDefaultServAccount(default_serv_account);
user.setDefaultServId(default_servId);
user.setServAccount(servAccount);
user.setServId(servId);
}
cursor.close();
return user;
}
}
| [
"happy_rmq@163.com"
] | happy_rmq@163.com |
2f4c6c3f318a3b2b6348193ccbf309b7ea9deb08 | 51ca49bb5cfc5220d8af834756d3962450205067 | /src/com/google/wave/api/BlipContentRefs.java | 04dd434f1d0a8da1063f2ca29a742ef33641a725 | [
"Apache-2.0"
] | permissive | vega113/WaveInCloud | c08f2e33503511e9754888ad63b2a674f348300b | 7a240021b931b240c33dca0b8443152fb82e0487 | refs/heads/master | 2021-01-01T17:47:13.719444 | 2011-11-15T18:00:21 | 2011-11-15T18:00:21 | 1,935,818 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 25,894 | java | /* Copyright (c) 2009 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.wave.api;
import com.google.wave.api.Function.BlipContentFunction;
import com.google.wave.api.Function.MapFunction;
import com.google.wave.api.JsonRpcConstant.ParamsProperty;
import com.google.wave.api.OperationRequest.Parameter;
import com.google.wave.api.impl.DocumentModifyAction;
import com.google.wave.api.impl.DocumentModifyQuery;
import com.google.wave.api.impl.DocumentModifyAction.BundledAnnotation;
import com.google.wave.api.impl.DocumentModifyAction.ModifyHow;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
/**
* A class that represents a set of references to contents in a blip.
*
* A {@link BlipContentRefs} instance for example can represent the
* results of a search, an explicitly set range, a regular expression, or refer
* to the entire blip.
*
* {@link BlipContentRefs} are used to express operations on a blip in a
* consistent way that can be easily transfered to the server.
*/
public class BlipContentRefs implements Iterable<Range> {
/** The blip that this blip references are pointing to. */
private final Blip blip;
/** The iterator to iterate over the blip content. */
private final BlipIterator<?> iterator;
/** The additional parameters that need to be supplied in the outgoing op. */
private final List<Parameter> parameters;
/**
* Constructs an instance representing the search for text {@code target}.
*
* @param blip the blip to find {@code target} in.
* @param target the target to search.
* @param maxResult the maximum number of results.
* @return an instance of blip references.
*/
public static BlipContentRefs all(Blip blip, String target, int maxResult) {
return new BlipContentRefs(blip,
new BlipIterator.TextIterator(blip, target, maxResult),
Parameter.of(ParamsProperty.MODIFY_QUERY, new DocumentModifyQuery(target, maxResult)));
}
/**
* Constructs an instance representing the search for element
* {@code ElementType}, that has the properties specified in
* {@code restrictions}.
*
* @param blip the blip to find {@code target} in.
* @param target the element type to search.
* @param maxResult the maximum number of results.
* @param restrictions the additional properties filter that need to be
* matched.
* @return an instance of blip references.
*/
public static BlipContentRefs all(Blip blip, ElementType target, int maxResult,
Restriction... restrictions) {
Map<String, String> restrictionsAsMap = new HashMap<String, String>(restrictions.length);
for (Restriction restriction : restrictions) {
restrictionsAsMap.put(restriction.getKey(), restriction.getValue());
}
return new BlipContentRefs(blip,
new BlipIterator.ElementIterator(blip, target, restrictionsAsMap, maxResult),
Parameter.of(ParamsProperty.MODIFY_QUERY,
new DocumentModifyQuery(target, restrictionsAsMap, maxResult)));
}
/**
* Constructs an instance representing the entire blip content.
*
* @param blip the blip to represent.
* @return an instance of blip references.
*/
public static BlipContentRefs all(Blip blip) {
return new BlipContentRefs(blip,
new BlipIterator.SingleshotIterator(blip, 0, blip.getContent().length()));
}
/**
* Constructs an instance representing an explicitly set range.
*
* @param blip the blip to represent.
* @param start the start index of the range.
* @param end the end index of the range.
* @return an instance of blip references.
*/
public static BlipContentRefs range(Blip blip, int start, int end) {
return new BlipContentRefs(blip,
new BlipIterator.SingleshotIterator(blip, start, end),
Parameter.of(ParamsProperty.RANGE, new Range(start, end)));
}
/**
* Private constructor.
*
* @param blip the blip to navigate.
* @param iterator the iterator to iterate over blip content.
* @param parameters the additional parameters to be passed in the outgoing
* operation.
*/
private BlipContentRefs(Blip blip, BlipIterator<?> iterator, Parameter... parameters) {
this.blip = blip;
this.iterator = iterator;
this.parameters = Arrays.asList(parameters);
}
/**
* Executes this BlipRefs object.
*
* @param modifyHow the operation to be executed.
* @param bundledAnnotations optional list of annotations to immediately
* apply to newly added text.
* @param arguments a list of arguments for the operation. The arguments vary
* depending on the operation:
* <ul>
* <li>For DELETE: none (the supplied arguments will be ignored)</li>
* <li>For ANNOTATE: a list of {@link Annotation} objects</li>
* <li>For CLEAR_ANNOTATION: the key of the annotation to be
* cleared. Only the first argument will be used.</li>
* <li>For UPDATE_ELEMENT: a list of {@link Map}, each represents
* new element properties.</li>
* <li>For INSERT, INSERT_AFTER, or REPLACE: a list of
* {@link BlipContent}s.
* </ul>
* For operations that take a list of entities as the argument, once
* this method hits the end of the argument list, it will wrap around.
* For example, if this {@link BlipContentRefs} object has 5 hits, when
* applying an ANNOTATE operation with 4 arguments, the first argument
* will be applied to the 5th hit.
* @return this instance of blip references, for chaining.
*/
@SuppressWarnings({"unchecked", "fallthrough"})
private BlipContentRefs execute(
ModifyHow modifyHow, List<BundledAnnotation> bundledAnnotations, Object... arguments) {
// If there is no match found, return immediately without generating op.
if (!iterator.hasNext()) {
return this;
}
int nextIndex = 0;
Object next = null;
List<BlipContent> computed = new ArrayList<BlipContent>();
List<Element> updatedElements = new ArrayList<Element>();
boolean useMarkup = false;
while (iterator.hasNext()) {
Range range = iterator.next();
int start = range.getStart();
int end = range.getEnd();
if (blip.length() == 0 && (start != 0 || end != 0)) {
throw new IndexOutOfBoundsException("Start and end have to be 0 for empty blip.");
} else if (start < 0 || end < 1) {
throw new IndexOutOfBoundsException("Position outside the blip.");
} else if ((start >= blip.length() || end > blip.length()) &&
modifyHow != ModifyHow.INSERT) {
throw new IndexOutOfBoundsException("Position outside the blip.");
} else if (start > blip.length() && modifyHow == ModifyHow.INSERT) {
throw new IndexOutOfBoundsException("Position outside the blip.");
} else if (start >= end){
throw new IndexOutOfBoundsException("Start has to be less than end.");
}
// Get the next argument.
if (nextIndex < arguments.length) {
next = arguments[nextIndex];
// If the next argument is a function, call the function.
if (next instanceof Function) {
// Get the matched content.
BlipContent source;
if (end - start == 1 && blip.getElements().containsKey(start)) {
source = blip.getElements().get(start);
} else {
source = Plaintext.of(blip.getContent().substring(start, end));
}
// Compute the new content.
next = ((Function) next).call(source);
if (next instanceof BlipContent) {
computed.add((BlipContent) next);
}
}
nextIndex = ++nextIndex % arguments.length;
}
switch (modifyHow) {
case DELETE:
// You can't delete the first newline.
if (start == 0) {
start = 1;
}
// Delete all elements that fall into this range.
Iterator<Integer> elementIterator =
blip.getElements().subMap(start, end).keySet().iterator();
while(elementIterator.hasNext()) {
elementIterator.next();
elementIterator.remove();
}
blip.deleteAnnotations(start, end);
blip.shift(end, start - end);
iterator.shift(-1);
blip.setContent(blip.getContent().substring(0, start) +
blip.getContent().substring(end));
break;
case ANNOTATE:
Annotation annotation = Annotation.class.cast(next);
blip.getAnnotations().add(annotation.getName(), annotation.getValue(), start, end);
break;
case CLEAR_ANNOTATION:
String annotationName = arguments[0].toString();
blip.getAnnotations().delete(annotationName, start, end);
break;
case UPDATE_ELEMENT:
Element existingElement = blip.getElements().get(start);
if (existingElement == null) {
throw new IllegalArgumentException("No element found at index " + start + ".");
}
Map<String, String> properties = Map.class.cast(next);
updatedElements.add(new Element(existingElement.getType(), properties));
for (Entry<String, String> entry : properties.entrySet()) {
existingElement.setProperty(entry.getKey(), entry.getValue());
}
break;
case INSERT:
end = start;
case INSERT_AFTER:
start = end;
case REPLACE:
// Get the plain-text version of next.
String text = BlipContent.class.cast(next).getText();
// Compute the shift amount for the iterator.
int iteratorShiftAmount = text.length() - 1;
if (end == start) {
iteratorShiftAmount += range.getEnd() - range.getStart();
}
iterator.shift(iteratorShiftAmount);
// In the case of a replace, and the replacement text is shorter,
// delete the delta.
if (start != end && text.length() < end - start) {
blip.deleteAnnotations(start + text.length(), end);
}
blip.shift(end, text.length() + start - end);
blip.setContent(blip.getContent().substring(0, start) + text +
blip.getContent().substring(end));
if (next instanceof Element) {
blip.getElements().put(start, Element.class.cast(next));
} else if (bundledAnnotations != null) {
for (BundledAnnotation bundled : bundledAnnotations) {
blip.getAnnotations().add(bundled.key, bundled.value, start, start + text.length());
}
}
break;
}
}
OperationRequest op = blip.getOperationQueue().modifyDocument(blip);
for (Parameter parameter : parameters) {
op.addParameter(parameter);
}
// Prepare the operation parameters.
List<String> values = null;
String annotationName = null;
List<Element> elements = null;
switch (modifyHow) {
case UPDATE_ELEMENT:
elements = updatedElements;
break;
case ANNOTATE:
values = new ArrayList<String>(arguments.length);
for (Object item : arguments) {
values.add(Annotation.class.cast(item).getValue());
}
annotationName = Annotation.class.cast(arguments[0]).getName();
break;
case CLEAR_ANNOTATION:
annotationName = arguments[0].toString();
break;
case INSERT:
case INSERT_AFTER:
case REPLACE:
values = new ArrayList<String>(arguments.length);
elements = new ArrayList<Element>(arguments.length);
Object[] toBeAdded = arguments;
if (arguments[0] instanceof Function) {
toBeAdded = computed.toArray();
}
for (Object argument : toBeAdded) {
if (argument instanceof Element) {
elements.add(Element.class.cast(argument));
values.add(null);
} else if (argument instanceof Plaintext){
values.add(BlipContent.class.cast(argument).getText());
elements.add(null);
}
}
break;
}
op.addParameter(Parameter.of(ParamsProperty.MODIFY_ACTION,
new DocumentModifyAction(
modifyHow, values, annotationName, elements, bundledAnnotations, useMarkup)));
iterator.reset();
return this;
}
/**
* Inserts the given arguments at the matched positions.
*
* @param arguments the new contents to be inserted.
* @return an instance of this blip references, for chaining.
*/
public BlipContentRefs insert(BlipContent... arguments) {
return insert(null, arguments);
}
/**
* Inserts computed contents at the matched positions.
*
* @param functions the functions to compute the new contents based on the
* matched contents.
* @return an instance of this blip references, for chaining.
*/
public BlipContentRefs insert(BlipContentFunction... functions) {
return insert(null, functions);
}
/**
* Inserts the given strings at the matched positions.
*
* @param arguments the new strings to be inserted.
* @return an instance of this blip references, for chaining.
*/
public BlipContentRefs insert(String... arguments) {
return insert(null, arguments);
}
/**
* Inserts the given arguments at the matched positions.
*
* @param bundledAnnotations annotations to immediately apply to the inserted
* text.
* @param arguments the new contents to be inserted.
* @return an instance of this blip references, for chaining.
*/
public BlipContentRefs insert(
List<BundledAnnotation> bundledAnnotations, BlipContent... arguments) {
return execute(ModifyHow.INSERT, bundledAnnotations, ((Object[]) arguments));
}
/**
* Inserts computed contents at the matched positions.
*
* @param bundledAnnotations annotations to immediately apply to the inserted
* text.
* @param functions the functions to compute the new contents based on the
* matched contents.
* @return an instance of this blip references, for chaining.
*/
public BlipContentRefs insert(
List<BundledAnnotation> bundledAnnotations, BlipContentFunction... functions) {
return execute(ModifyHow.INSERT, bundledAnnotations, ((Object[]) functions));
}
/**
* Inserts the given strings at the matched positions.
*
* @param bundledAnnotations annotations to immediately apply to the inserted
* text.
* @param arguments the new strings to be inserted.
* @return an instance of this blip references, for chaining.
*/
public BlipContentRefs insert(List<BundledAnnotation> bundledAnnotations, String... arguments) {
Object[] array = new Plaintext[arguments.length];
for (int i = 0; i < arguments.length; ++i) {
array[i] = Plaintext.of(arguments[i]);
}
return execute(ModifyHow.INSERT, bundledAnnotations, array);
}
/**
* Inserts the given arguments just after the matched positions.
*
* @param arguments the new contents to be inserted.
* @return an instance of this blip references, for chaining.
*/
public BlipContentRefs insertAfter(BlipContent... arguments) {
return insertAfter(null, arguments);
}
/**
* Inserts computed contents just after the matched positions.
*
* @param functions the functions to compute the new contents based on the
* matched contents.
* @return an instance of this blip references, for chaining.
*/
public BlipContentRefs insertAfter(BlipContentFunction... functions) {
return insertAfter(null, functions);
}
/**
* Inserts the given strings just after the matched positions.
*
* @param arguments the new strings to be inserted.
* @return an instance of this blip references, for chaining.
*/
public BlipContentRefs insertAfter(String... arguments) {
return insertAfter(null, arguments);
}
/**
* Inserts the given arguments just after the matched positions.
*
* @param bundledAnnotations annotations to immediately apply to the inserted
* text.
* @param arguments the new contents to be inserted.
* @return an instance of this blip references, for chaining.
*/
public BlipContentRefs insertAfter(
List<BundledAnnotation> bundledAnnotations, BlipContent... arguments) {
return execute(ModifyHow.INSERT_AFTER, bundledAnnotations, (Object[]) arguments);
}
/**
* Inserts computed contents just after the matched positions.
*
* @param bundledAnnotations annotations to immediately apply to the inserted
* text.
* @param functions the functions to compute the new contents based on the
* matched contents.
* @return an instance of this blip references, for chaining.
*/
public BlipContentRefs insertAfter(
List<BundledAnnotation> bundledAnnotations, BlipContentFunction... functions) {
return execute(ModifyHow.INSERT_AFTER, bundledAnnotations, (Object[]) functions);
}
/**
* Inserts the given strings just after the matched positions.
*
* @param bundledAnnotations annotations to immediately apply to the inserted
* text.
* @param arguments the new strings to be inserted.
* @return an instance of this blip references, for chaining.
*/
public BlipContentRefs insertAfter(
List<BundledAnnotation> bundledAnnotations, String... arguments) {
Object[] array = new Plaintext[arguments.length];
for (int i = 0; i < arguments.length; ++i) {
array[i] = Plaintext.of(arguments[i]);
}
return execute(ModifyHow.INSERT_AFTER, bundledAnnotations, array);
}
/**
* Replaces the matched positions with the given arguments.
*
* @param arguments the new contents to replace the original contents.
* @return an instance of this blip references, for chaining.
*/
public BlipContentRefs replace(BlipContent... arguments) {
return replace(null, arguments);
}
/**
* Replaces the matched positions with computed contents.
*
* @param functions the functions to compute the new contents.
* @return an instance of this blip references, for chaining.
*/
public BlipContentRefs replace(BlipContentFunction... functions) {
return replace(null, functions);
}
/**
* Replaces the matched positions with the given strings.
*
* @param arguments the new strings to replace the original contents.
* @return an instance of this blip references, for chaining.
*/
public BlipContentRefs replace(String... arguments) {
return replace(null, arguments);
}
/**
* Replaces the matched positions with the given arguments.
*
* @param bundledAnnotations annotations to immediately apply to the inserted
* text.
* @param arguments the new contents to replace the original contents.
* @return an instance of this blip references, for chaining.
*/
public BlipContentRefs replace(
List<BundledAnnotation> bundledAnnotations, BlipContent... arguments) {
return execute(ModifyHow.REPLACE, bundledAnnotations, (Object[]) arguments);
}
/**
* Replaces the matched positions with computed contents.
*
* @param bundledAnnotations annotations to immediately apply to the inserted
* text.
* @param functions the functions to compute the new contents.
* @return an instance of this blip references, for chaining.
*/
public BlipContentRefs replace(
List<BundledAnnotation> bundledAnnotations, BlipContentFunction... functions) {
return execute(ModifyHow.REPLACE, bundledAnnotations, (Object[]) functions);
}
/**
* Replaces the matched positions with the given strings.
*
* @param bundledAnnotations annotations to immediately apply to the inserted
* text.
* @param arguments the new strings to replace the original contents.
* @return an instance of this blip references, for chaining.
*/
public BlipContentRefs replace(List<BundledAnnotation> bundledAnnotations, String... arguments) {
Object[] array = new Plaintext[arguments.length];
for (int i = 0; i < arguments.length; ++i) {
array[i] = Plaintext.of(arguments[i]);
}
return execute(ModifyHow.REPLACE, bundledAnnotations, array);
}
/**
* Deletes the contents at the matched positions.
*
* @return an instance of this blip references, for chaining.
*/
public BlipContentRefs delete() {
return execute(ModifyHow.DELETE, null);
}
/**
* Annotates the contents at the matched positions.
*
* @param key the annotation key.
* @param values the annotation values.
* @return an instance of this blip references, for chaining.
*/
public BlipContentRefs annotate(String key, String... values) {
if (values.length == 0) {
values = new String[]{key};
}
Annotation[] annotations = new Annotation[values.length];
for (int i = 0; i < values.length; ++i) {
annotations[i] = new Annotation(key, values[i], 0, 1);
}
return execute(ModifyHow.ANNOTATE, null, (Object[]) annotations);
}
/**
* Clears the annotations at the matched positions.
*
* @param key the annotation key to be cleared.
* @return an instance of this blip references, for chaining.
*/
public BlipContentRefs clearAnnotation(String key) {
return execute(ModifyHow.CLEAR_ANNOTATION, null, key);
}
/**
* Updates the properties of all elements at the matched positions with the
* given properties map.
*
* Note: The purpose of this overloaded version is because the version that
* takes a var-args generates compiler warning due to the way generics and
* var-args are implemented in Java. Most of the time, robot only needs to
* update one gadget at at time, and it can use this version to avoid the
* compiler warning.
*
* @param newProperties the new properties map.
* @return an instance of this blip references, for chaining.
*/
public BlipContentRefs updateElement(Map<String, String> newProperties) {
return execute(ModifyHow.UPDATE_ELEMENT, null, new Object[] {newProperties});
}
/**
* Updates the properties of all elements at the matched positions with
* computed properties map.
*
* Note: The purpose of this overloaded version is because the version that
* takes a var-args generates compiler warning due to the way generics and
* var-args are implemented in Java. Most of the time, robot only needs to
* update one gadget at at time, and it can use this version to avoid the
* compiler warning.
*
* @param function the function to compute the new properties map.
* @return an instance of this blip references, for chaining.
*/
public BlipContentRefs updateElement(MapFunction function) {
return execute(ModifyHow.UPDATE_ELEMENT, null, new Object[] {function});
}
/**
* Updates the properties of all elements at the matched positions with the
* given properties maps.
*
* @param newProperties an array of new properties map.
* @return an instance of this blip references, for chaining.
*/
public BlipContentRefs updateElement(Map<String, String>... newProperties) {
return execute(ModifyHow.UPDATE_ELEMENT, null, (Object[]) newProperties);
}
/**
* Updates the properties of all elements at the matched positions with
* computed properties maps.
*
* @param functions an array of function to compute new properties maps.
* @return an instance of this blip references, for chaining.
*/
public BlipContentRefs updateElement(MapFunction... functions) {
return execute(ModifyHow.UPDATE_ELEMENT, null, (Object[]) functions);
}
/**
* Checks whether this blip references contains any matches or not.
*
* @return {@code true} if it has any more matches. Otherwise, returns
* {@code false}.
*/
public boolean isEmpty() {
return iterator.hasNext();
}
/**
* Returns all matches.
*
* @return a list of {@link BlipContent} that represents the hits.
*/
public List<BlipContent> values() {
List<BlipContent> result = new ArrayList<BlipContent>();
while (iterator.hasNext()) {
Range range = iterator.next();
if (range.getEnd() - range.getStart() == 1 &&
blip.getElements().containsKey(range.getStart())) {
result.add(blip.getElements().get(range.getStart()));
} else {
result.add(Plaintext.of(blip.getContent().substring(range.getStart(), range.getEnd())));
}
}
iterator.reset();
return result;
}
/**
* Returns the first hit.
*
* @return an instance of {@link BlipContent}, that represents the first hit.
*/
public BlipContent value() {
BlipContent result = null;
if (iterator.hasNext()) {
Range range = iterator.next();
if (range.getEnd() - range.getStart() == 1 &&
blip.getElements().containsKey(range.getStart())) {
result = blip.getElements().get(range.getStart());
} else {
result = Plaintext.of(blip.getContent().substring(range.getStart(), range.getEnd()));
}
}
iterator.reset();
return result;
}
@Override
public Iterator<Range> iterator() {
iterator.reset();
return iterator;
}
}
| [
"vega113@gmail.com"
] | vega113@gmail.com |
cbabbc500157ab4a7d6860a975f5b382c932e02f | f86e0ba65fbea5307dfa57b8fde2a0d192aa4b08 | /TeamPro/src/Sql/AdNoticeSql.java | 13537d6f92c4738534f7695ad31ba33c2d23e1a3 | [] | no_license | cielrenard/jspproject | 5ad6a5bc907599d1055a24f9c079cc8ffe7b9caf | a2983083990a2f488071706f6b691445960e5681 | refs/heads/master | 2020-04-18T11:12:17.801920 | 2019-01-25T05:48:27 | 2019-01-25T05:48:27 | 167,491,864 | 0 | 0 | null | null | null | null | UHC | Java | false | false | 3,069 | java | package Sql;
//이 클래스는 질의명령을 보관.. 필요시 알려주는 기능을 가진 클래스
public class AdNoticeSql {
//질의명령 코드를 가독성있게 부여하기 위해 코드값에 이름을 부여하자.
public static final int SELECT_BOARDLIST=1; //게시물 목록 검색
public static final int SELECT_TOTALCOUNT=2; //총 원글 게시물 수
public static final int INSERT_ORIBOARD=3; //원글 등록
public static final int UPDATE_HIT=4; //총 조회수
public static final int SELECT_DETAIL = 5; //원글 상세보기
public static final int UPDATE_BOARD = 6; //원글수정
public static final int DELETE_BOARD = 7; //원글삭제
//질의명령을 달라는 요구하면 질의명령을 주는 함수
public static String getSQL(int code) {
StringBuffer buff=new StringBuffer();
switch(code) {
case 7: //원글삭제(데이터는 남기기)
buff.append("UPDATE ");
buff.append(" notice ");
buff.append("SET ");
buff.append(" no_IsShow='N' ");
buff.append("WHERE ");
buff.append(" no_No=? ");
break;
case 6: //원글수정
buff.append("UPDATE ");
buff.append(" notice ");
buff.append("SET ");
buff.append(" no_Title=?, ");
buff.append(" no_Contents=? ");
buff.append("WHERE ");
buff.append(" no_No=?");
break;
case 5: //원글 상세보기
buff.append("SELECT ");
buff.append(" no_No AS no, ");
buff.append(" m_Id AS writer, ");
buff.append(" no_Title AS title, ");
buff.append(" no_Contents AS body, ");
buff.append(" no_Look AS hit, ");
buff.append(" no_Date AS wday ");
//buff.append(" no_File AS nfile ");
buff.append("FROM ");
buff.append(" notice ");
buff.append("WHERE ");
buff.append(" no_No=? ");
buff.append(" AND ");
buff.append(" no_IsShow='Y'");
break;
case 4://조회수 증가
buff.append("UPDATE ");
buff.append(" notice ");
buff.append(" SET ");
buff.append(" no_Look=no_Look+1 ");
buff.append("Where ");
buff.append(" no_NO=?");
break;
case 3://글 등록
buff.append("INSERT INTO ");
buff.append(" notice ");
buff.append("VALUES((SELECT NVL(MAX(no_No),0)+1 FROM notice), ");
buff.append(" ?,?,?,SYSDATE,'file',0,'Y')");
break;
case 2://게시물 수
buff.append("SELECT ");
buff.append(" COUNT(*) AS CNT ");
buff.append("FROM ");
buff.append(" notice ");
buff.append("WHERE ");
buff.append(" no_IsShow='Y'");
break;
case 1: //게시물 목록 검색
buff.append("SELECT ");
buff.append(" no_No AS no, ");
buff.append(" m_Id AS writer, ");
buff.append(" no_Title AS title, ");
buff.append(" no_Look AS hit, ");
buff.append(" no_Date AS wday ");
//buff.append(" no_File AS nfile ");
buff.append("FROM ");
buff.append(" notice ");
buff.append("WHERE ");
buff.append(" no_IsShow='Y' ");
buff.append("ORDER BY no_No DESC");
break;
}
return buff.toString();
}
}
| [
"cielrenard@gmail.com"
] | cielrenard@gmail.com |
b628bf3e2f263131fa7d1c4afa5d746d86271760 | d15a059332bd4815a990d9599909a68e67bea812 | /moviefun-jcache-start/src/main/java/org/superbiz/moviefun/persistence/Movie.java | b1f9dfea7d8a1d22591cb1c9c7f637fa73168b15 | [] | no_license | tomitribe/microprofile-jcache | 9b1c6789f51ad5185cb53a741a44292d915b3ffc | 6d89e519cd92a729b8f96f9efceefe69ad433c88 | refs/heads/master | 2021-01-19T23:22:10.563291 | 2017-09-12T20:43:18 | 2017-09-12T20:43:18 | 88,970,886 | 4 | 5 | null | null | null | null | UTF-8 | Java | false | false | 2,593 | java | /**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.superbiz.moviefun.persistence;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.xml.bind.annotation.XmlRootElement;
import java.io.Serializable;
@Entity
@XmlRootElement(name = "movie")
public class Movie implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private long id;
private String director;
private String title;
private int year;
private String genre;
private int rating;
public Movie() {
}
public Movie(String title, String director, String genre, int rating, int year) {
this.director = director;
this.title = title;
this.year = year;
this.genre = genre;
this.rating = rating;
}
public Movie(String director, String title, int year) {
this.director = director;
this.title = title;
this.year = year;
}
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getDirector() {
return director;
}
public void setDirector(String director) {
this.director = director;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public int getYear() {
return year;
}
public void setYear(int year) {
this.year = year;
}
public String getGenre() {
return genre;
}
public void setGenre(String genre) {
this.genre = genre;
}
public int getRating() {
return rating;
}
public void setRating(int rating) {
this.rating = rating;
}
}
| [
"jon@jrg.me.uk"
] | jon@jrg.me.uk |
34b661f7b2af3226fe3da6b55b62dc699d24769b | 6ab8fc6c218dc3b752f3c9acd825c1ad60589c2b | /src/main/java/com/jukuad/statistic/util/Constant.java | 7a20bd63fd15fd2e37b4070ef6fdde6a6523d729 | [] | no_license | wallyhung/mongo-statistic | 8dba4af6a62dcce4bacd59c8553bba60997eb1dc | 90f662429341c4cc9c1b2d33f0c5ec86e4c508e4 | refs/heads/master | 2021-01-23T18:58:33.605857 | 2014-03-10T02:49:22 | 2014-03-10T02:49:22 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 974 | java | package com.jukuad.statistic.util;
public class Constant {
/**点击日志路径**/
public final static String PATH_CLICK = "click";
/**下载日志路径**/
public final static String PATH_DOWNLOAD = "download";
/**客户端信息采集日志路径**/
public final static String PATH_INFO = "info";
/**安装日志路径**/
public final static String PATH_INSTALL = "install";
/**推送日志路径**/
public final static String PATH_PUSH = "push";
/**请求日志路径**/
public final static String PATH_REQUEST = "request";
/**展示日志路径**/
public final static String PATH_VIEW = "view";
/***统计标示**/
public final static int SIGN_DAY = 0; //日活用户
public final static int SIGN_REMAIN = 1; //留存用户
public final static int SIGN_NEW = 2; //新增用户
public final static long TEMPSTAMP_ONE = 86400000;
public final static long TEMPSTAMP_THREE = 259200000;
}
| [
"hongwei200612@gmail.com"
] | hongwei200612@gmail.com |
d4f88c1aff53642495290fb76f568a3136cc0a35 | b9444e532cd2d339fc3f45951649ead2c4eda7e1 | /test/multicast/MultiCastTestN1.java | 03f5dbe3afdfdc75c223cb64ccb51b89470c04ec | [] | no_license | mymailmjj/easyserver | 2af4549ea078f6386813d6d37a42257d0642c2b5 | c4a7f53365eaf3b3a1ba250d9a23538cbe39d519 | refs/heads/master | 2021-05-06T12:34:49.248142 | 2018-01-30T10:05:43 | 2018-01-30T10:05:43 | 113,159,838 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 288 | java | /**
*
*/
package multicast;
/**
* 组播节点1
* @author cango
*
*/
public class MultiCastTestN1 {
/**
* @param args
*/
public static void main(String[] args) {
MultiCastServer multCastServer = new MultiCastServer(8085,"node1");
multCastServer.start();
}
}
| [
"mymailmjj@yeah.net"
] | mymailmjj@yeah.net |
c45fcae139ee9b14449d10b9d7e280aacb776e6d | df1a1709eb37171ffda0f58b460754b7bb5b7d3a | /src/unitil/ReadExcel.java | 0e529d59b1b7dc57c4e006c79b4e8593e9b108d0 | [] | no_license | liwanlei/java_selenium | 787ee22b880c78b68fae3003b2f4d2073e75ccff | bd4462ecaf0c7e8bc5c96637ed6cab02bd056968 | refs/heads/master | 2020-03-29T21:34:52.802463 | 2018-09-26T06:13:10 | 2018-09-26T06:13:10 | 150,374,846 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,614 | java | /**
*lileilei
* 2018年9月24日
* ReadExcel.java
*/
package unitil;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import org.apache.poi.xssf.usermodel.XSSFCell;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
public class ReadExcel {
/*
* 从excle读取case的用例
*/
private static XSSFSheet ExcelWSheet;
private static XSSFWorkbook ExcelWBook;
private static XSSFCell Cell;
private static XSSFRow Row;
static LogNew logger_user=new LogNew();
public static Object[][] getTableArray(String FilePath, String SheetName) {
String[][]tabArray = null;
try {
FileInputStream ExcelFile = new FileInputStream(FilePath);
ExcelWBook = new XSSFWorkbook(ExcelFile);
ExcelWSheet = ExcelWBook.getSheet(SheetName);
int startRow = 1;
int startCol = 1;
int ci,cj = 0;
int totalRows = ExcelWSheet.getLastRowNum();
int totalC=ExcelWSheet.getRow(0).getLastCellNum();
int totalCols = 2;
int size=totalC-totalCols;
tabArray=new String[totalRows][size];
ci=0;
cj=0;
int cm = 0;int cl = 0;int ch = 0;
for (int i=startRow ;i<=totalRows;i++, ci++) {
int m=2;
if (m<totalCols+1) {
for(int j=0;j<=size;j++) {
try {
tabArray[ci][j]=getCellData(i,m);
} catch (Exception e) {
logger_user.error(e);
}
m++;
}
}
}
}
catch (FileNotFoundException e){
logger_user.error(e);
}
catch (IOException e){
logger_user.error(e);
}
return(tabArray);
}
public static String getCellData(int RowNum, int ColNum) {
try{
Cell = ExcelWSheet.getRow(RowNum).getCell(ColNum);
Cell.setCellType(Cell.CELL_TYPE_STRING);
int dataType = Cell.getCellType();
if (dataType == 3) {
return "";
}
else{
String CellData = Cell.getStringCellValue();
return CellData;
}
}
catch (Exception e){
throw (e);
}
}
}
| [
"leileili126@163.com"
] | leileili126@163.com |
2a3b1dd90295d19f63659838cc8240aa0bb02d9e | c77cbc4593c38045d43803ec9a14d8aeceec249e | /app/src/androidTest/java/com/ta/hanafi/grammarepos/ExampleInstrumentedTest.java | 45239f5fe7f55efabe2a534075e0d1a46efcc8d1 | [] | no_license | andresual/BahasaInggrisApp | a82d5ab98a1c38d7e0345b2b4875268a607911a7 | d64feeaed3537b7f0a9392144faccbdf9f3f261e | refs/heads/master | 2020-11-29T01:25:13.867037 | 2019-12-24T19:12:52 | 2019-12-24T19:12:52 | 229,976,308 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 751 | java | package com.ta.hanafi.grammarepos;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.ta.hanafi.grammarepos", appContext.getPackageName());
}
}
| [
"andrean9103@gmail.com"
] | andrean9103@gmail.com |
6126a87f3f7e6810fa5ad0340d0bbbd39e21291b | c02d4cb1059b60232a01fc566da8efe9b090c36e | /SZ/KSee/app/src/main/java/com/junhsue/ksee/dto/MsgQuestionInviteDTO.java | 0a47e2bfb237bf29089b698add564e3bc0bddd55 | [] | no_license | Beckboy/SZ-V1.2.3 | a3a97fe43c43bdbb047abf758e15ae7e39b3e1c7 | e5fc8f5f6f6ab541bd24f30b17336238ada5806a | refs/heads/master | 2021-08-24T00:22:05.237799 | 2017-12-07T07:07:05 | 2017-12-07T07:07:05 | 113,413,037 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 826 | java | package com.junhsue.ksee.dto;
import com.junhsue.ksee.entity.BaseEntity;
import com.junhsue.ksee.entity.MsgQuestionEntity;
/**
* Created by longer on 17/6/7.
*/
public class MsgQuestionInviteDTO extends BaseEntity {
/**
*
*"user_id": 1,
"question_id": 1,
"qustion": {
"title": "招⽣生问题我们要怎么解决问题"
},
"nickname": "Beck",
"avatar": "http://omxx7cyms.bkt.clouddn.com/JK_1492408223500",
"organization": "上海海雁传书⽂文化传媒有限公司"
}
*/
//用户id
public String user_id;
//
public String question_id;
//用户昵称
public String nickname;
//
public String avatar;
//组织机构
public String organization;
//
public MsgQuestionEntity question=new MsgQuestionEntity();
}
| [
"kunjiang93@gmail.com"
] | kunjiang93@gmail.com |
35c4db30111c2f21164d0083f79e31e7e1f53e4e | d0e8f076f037fb8be5ec272e2c0d7c16fa7f4b5d | /modules/citrus-ws/src/test/java/com/consol/citrus/ws/message/converter/WsAddressingMessageConverterTest.java | c0477069fef2601216dcbbbd3ebbe6980f87027e | [
"Apache-2.0"
] | permissive | swathisprasad/citrus | b6811144ab46e1f88bb85b16f00539e1fe075f0c | 5156c5e03f89de193b642aad91a4ee1611b4b27f | refs/heads/master | 2020-05-20T08:27:52.578157 | 2019-05-11T12:29:42 | 2019-05-11T12:29:42 | 185,473,773 | 2 | 0 | Apache-2.0 | 2019-05-07T20:32:02 | 2019-05-07T20:32:02 | null | UTF-8 | Java | false | false | 6,664 | java | /*
* Copyright 2006-2014 the original author or 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.consol.citrus.ws.message.converter;
import com.consol.citrus.message.DefaultMessage;
import com.consol.citrus.message.Message;
import com.consol.citrus.testng.AbstractTestNGUnitTest;
import com.consol.citrus.ws.addressing.*;
import com.consol.citrus.ws.client.WebServiceEndpointConfiguration;
import org.mockito.Mockito;
import org.springframework.ws.soap.*;
import org.springframework.xml.transform.StringResult;
import org.testng.Assert;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import javax.xml.namespace.QName;
import javax.xml.transform.TransformerException;
import java.io.IOException;
import static org.mockito.Mockito.*;
/**
* @author Christoph Deppisch
* @since 2.0
*/
public class WsAddressingMessageConverterTest extends AbstractTestNGUnitTest {
private SoapMessage soapRequest = Mockito.mock(SoapMessage.class);
private SoapBody soapBody = Mockito.mock(SoapBody.class);
private SoapHeader soapHeader = Mockito.mock(SoapHeader.class);
private String requestPayload = "<testMessage>Hello</testMessage>";
private WsAddressingMessageConverter messageConverter;
@BeforeMethod
public void setup() {
WsAddressingHeaders wsAddressingHeaders = new WsAddressingHeaders();
wsAddressingHeaders.setVersion(WsAddressingVersion.VERSION10);
wsAddressingHeaders.setAction("wsAddressing");
wsAddressingHeaders.setFrom("Citrus");
wsAddressingHeaders.setTo("Test");
wsAddressingHeaders.setMessageId("urn:uuid:aae36050-2853-4ca8-b879-fe366f97c5a1");
messageConverter = new WsAddressingMessageConverter(wsAddressingHeaders);
}
@Test
public void testOutboundWsAddressingHeaders() throws TransformerException, IOException {
Message testMessage = new DefaultMessage(requestPayload);
StringResult soapBodyResult = new StringResult();
StringResult soapHeaderResult = new StringResult();
SoapHeaderElement soapHeaderElement = Mockito.mock(SoapHeaderElement.class);
reset(soapRequest, soapBody, soapHeader, soapHeaderElement);
when(soapRequest.getSoapBody()).thenReturn(soapBody);
when(soapBody.getPayloadResult()).thenReturn(soapBodyResult);
when(soapRequest.getSoapHeader()).thenReturn(soapHeader);
when(soapHeader.addHeaderElement(eq(new QName("http://www.w3.org/2005/08/addressing", "To", "")))).thenReturn(soapHeaderElement);
when(soapHeader.addHeaderElement(eq(new QName("http://www.w3.org/2005/08/addressing", "From", "")))).thenReturn(soapHeaderElement);
when(soapHeader.addHeaderElement(eq(new QName("http://www.w3.org/2005/08/addressing", "Action", "")))).thenReturn(soapHeaderElement);
when(soapHeader.addHeaderElement(eq(new QName("http://www.w3.org/2005/08/addressing", "MessageID", "")))).thenReturn(soapHeaderElement);
when(soapHeaderElement.getResult()).thenReturn(new StringResult());
when(soapHeader.getResult()).thenReturn(soapHeaderResult);
messageConverter.convertOutbound(soapRequest, testMessage, new WebServiceEndpointConfiguration(), context);
Assert.assertEquals(soapBodyResult.toString(), "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + requestPayload);
Assert.assertEquals(soapHeaderResult.toString(), "");
verify(soapHeader).addNamespaceDeclaration("wsa", "http://www.w3.org/2005/08/addressing");
verify(soapHeaderElement).setText("Test");
verify(soapHeaderElement).setMustUnderstand(true);
verify(soapHeaderElement).setText("wsAddressing");
verify(soapHeaderElement).setText("urn:uuid:aae36050-2853-4ca8-b879-fe366f97c5a1");
}
@Test
public void testOverwriteWsAddressingHeaders() throws TransformerException, IOException {
Message testMessage = new DefaultMessage(requestPayload)
.setHeader(WsAddressingMessageHeaders.FROM, "customFrom")
.setHeader(WsAddressingMessageHeaders.TO, "customTo")
.setHeader(WsAddressingMessageHeaders.ACTION, "customAction")
.setHeader(WsAddressingMessageHeaders.MESSAGE_ID, "${messageId}");
context.setVariable("messageId", "urn:custom");
StringResult soapBodyResult = new StringResult();
StringResult soapHeaderResult = new StringResult();
SoapHeaderElement soapHeaderElement = Mockito.mock(SoapHeaderElement.class);
reset(soapRequest, soapBody, soapHeader, soapHeaderElement);
when(soapRequest.getSoapBody()).thenReturn(soapBody);
when(soapBody.getPayloadResult()).thenReturn(soapBodyResult);
when(soapRequest.getSoapHeader()).thenReturn(soapHeader);
when(soapHeader.addHeaderElement(eq(new QName("http://www.w3.org/2005/08/addressing", "To", "")))).thenReturn(soapHeaderElement);
when(soapHeader.addHeaderElement(eq(new QName("http://www.w3.org/2005/08/addressing", "From", "")))).thenReturn(soapHeaderElement);
when(soapHeader.addHeaderElement(eq(new QName("http://www.w3.org/2005/08/addressing", "Action", "")))).thenReturn(soapHeaderElement);
when(soapHeader.addHeaderElement(eq(new QName("http://www.w3.org/2005/08/addressing", "MessageID", "")))).thenReturn(soapHeaderElement);
when(soapHeaderElement.getResult()).thenReturn(new StringResult());
when(soapHeader.getResult()).thenReturn(soapHeaderResult);
messageConverter.convertOutbound(soapRequest, testMessage, new WebServiceEndpointConfiguration(), context);
Assert.assertEquals(soapBodyResult.toString(), "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + requestPayload);
Assert.assertEquals(soapHeaderResult.toString(), "");
verify(soapHeader).addNamespaceDeclaration("wsa", "http://www.w3.org/2005/08/addressing");
verify(soapHeaderElement).setText("customTo");
verify(soapHeaderElement).setMustUnderstand(true);
verify(soapHeaderElement).setText("customAction");
verify(soapHeaderElement).setText("urn:custom");
}
}
| [
"deppisch@consol.de"
] | deppisch@consol.de |
cdc45e2a22ffaaf52bf50d55e6badd9c0804aa89 | 3984f1a6e60474dd9f37d4ef361a3cc5aaf3b339 | /app/src/main/java/com/events/events/eventapplication/EventListFragment.java | c846339c01af858fc47c5613948c32f4871767f6 | [] | no_license | sgaamuwa/eventAndroidApp | 6e867064e8af5f7bea4e2f0ffbcba5c3b2a83fe3 | ecd9d8602f90353eb71f69a5a3e41fe909c692bc | refs/heads/master | 2020-03-30T12:59:15.930320 | 2018-10-02T12:32:04 | 2018-10-02T12:32:04 | 151,251,274 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,488 | java | package com.events.events.eventapplication;
import android.arch.lifecycle.Observer;
import android.arch.lifecycle.ViewModelProviders;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.ListFragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.events.events.eventapplication.models.Event;
import java.util.List;
/**
* Created by samuel on 24/08/2018.
*/
public class EventListFragment extends ListFragment {
private EventViewModel eventViewModel;
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
eventViewModel = ViewModelProviders.of(getActivity()).get(EventViewModel.class);
}
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
return inflater.inflate(R.layout.fragment_event_list, container, false);
}
@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
eventViewModel.getEvents().observe(this, new Observer<List<Event>>() {
@Override
public void onChanged(@Nullable List<Event> events) {
EventAdapter eventAdapter = new EventAdapter(getActivity(), events);
setListAdapter(eventAdapter);
}
});
}
}
| [
"samuel.gaamuwa@andela.com"
] | samuel.gaamuwa@andela.com |
b32eea3dc3a9f0809a3c055c67c2f214a5ba3ac7 | 3b91ed788572b6d5ac4db1bee814a74560603578 | /com/tencent/mm/plugin/backup/c/c$11.java | e8073d1b7c3c5ed979afdf60e934506d5473bbae | [] | no_license | linsir6/WeChat_java | a1deee3035b555fb35a423f367eb5e3e58a17cb0 | 32e52b88c012051100315af6751111bfb6697a29 | refs/heads/master | 2020-05-31T05:40:17.161282 | 2018-08-28T02:07:02 | 2018-08-28T02:07:02 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 424 | java | package com.tencent.mm.plugin.backup.c;
import com.tencent.mm.plugin.backup.f.b;
import com.tencent.mm.plugin.backup.f.b.c;
import com.tencent.mm.sdk.platformtools.x;
class c$11 implements c {
final /* synthetic */ c gUr;
c$11(c cVar) {
this.gUr = cVar;
}
public final void arI() {
x.i("MicroMsg.BackupMoveRecoverServer", "stopCallback ");
b.asm();
b.arv().aqR();
}
}
| [
"707194831@qq.com"
] | 707194831@qq.com |
a9229588391bcda3cf619c7da1dff7768d6569ee | c5b8c74f97e9e8d38122e307d0f066ef48e819dd | /BackUp/SistemaCZ/SistemaCZ_Android/app/src/main/java/com/example/sistemacz/ListaImoveisTrabalhadosActivity.java | b28f3e4b55a96c95cdc661f3433ab335ffc508fb | [] | no_license | DOUGLASINFO07/SistemaCZ | 74376c3042881c069b09e949d0a8c243a5a94e03 | 9969ee96d178b3823cb12209ba440319f3d48155 | refs/heads/master | 2020-07-07T05:36:32.364696 | 2019-09-18T22:18:10 | 2019-09-18T22:18:10 | 197,274,272 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 387 | java | package com.example.sistemacz;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
public class ListaImoveisTrabalhadosActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_lista_imoveis_trabalhados);
}
}
| [
"douglas.egidio@gmail.com"
] | douglas.egidio@gmail.com |
65c5ae132c3c36f710af0894b8b6a62bd5006cef | 0a9967f12f144774b91c8fa0031c53c6299d22af | /platform-workflow/src/main/java/com/webank/wecube/platform/workflow/parse/BpmnProcessModelCustomizer.java | 92a2eed95e9e28910149504d7b12d3b180234c14 | [
"Apache-2.0"
] | permissive | jeromeji/wecube-platform | 1c8fe9a1ca9006771b06314f1cb0fddb4813d7fe | a070dc2ae57767495a208f759578ec13c77f1a9a | refs/heads/master | 2021-01-08T17:07:13.029381 | 2020-02-21T06:17:10 | 2020-02-21T06:17:10 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 21,104 | java | package com.webank.wecube.platform.workflow.parse;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.concurrent.locks.ReentrantLock;
import org.apache.commons.lang3.StringUtils;
import org.camunda.bpm.model.bpmn.Bpmn;
import org.camunda.bpm.model.bpmn.BpmnModelInstance;
import org.camunda.bpm.model.bpmn.GatewayDirection;
import org.camunda.bpm.model.bpmn.builder.AbstractFlowNodeBuilder;
import org.camunda.bpm.model.bpmn.builder.EndEventBuilder;
import org.camunda.bpm.model.bpmn.builder.IntermediateCatchEventBuilder;
import org.camunda.bpm.model.bpmn.builder.StartEventBuilder;
import org.camunda.bpm.model.bpmn.instance.ConditionExpression;
import org.camunda.bpm.model.bpmn.instance.EndEvent;
import org.camunda.bpm.model.bpmn.instance.ErrorEventDefinition;
import org.camunda.bpm.model.bpmn.instance.EventDefinition;
import org.camunda.bpm.model.bpmn.instance.FlowNode;
import org.camunda.bpm.model.bpmn.instance.IntermediateCatchEvent;
import org.camunda.bpm.model.bpmn.instance.SequenceFlow;
import org.camunda.bpm.model.bpmn.instance.ServiceTask;
import org.camunda.bpm.model.bpmn.instance.Signal;
import org.camunda.bpm.model.bpmn.instance.SignalEventDefinition;
import org.camunda.bpm.model.bpmn.instance.StartEvent;
import org.camunda.bpm.model.bpmn.instance.SubProcess;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.webank.wecube.platform.workflow.commons.LocalIdGenerator;
/**
*
* @author gavin
*
*/
public class BpmnProcessModelCustomizer {
private static final Logger log = LoggerFactory.getLogger(BpmnProcessModelCustomizer.class);
public static final String NS_BPMN = "http://www.omg.org/spec/BPMN/20100524/MODEL";
public static final String PROC_ID_PREFIX = "PK_";
public static final String DEFAULT_ERROR_CODE = "1";
public static final String CONDITION_EXPR_OK = "${ok}";
public static final String CONDITION_EXPR_NOT_OK = "${!ok}";
public static final String FORMAL_EXPR_TYPE = "bpmn:tFormalExpression";
private static final String CONDITION_EXPR_RETCODE_OK = "${retCode_%s == 0}";
private static final String CONDITION_EXPR_RETCODE_NOT_OK = "${retCode_%s == 1}";
private String resourceName;
private String originalProcessXml;
private String encoding;
private BpmnModelInstance rootBpmnModelInstance;
private ReentrantLock reentrantBuildLock = new ReentrantLock();
private BpmnParseAttachment bpmnParseAttachment;
public BpmnProcessModelCustomizer(String resourceName, String originalProcessXml, String encoding) {
super();
if (StringUtils.isBlank(resourceName)) {
throw new BpmnCustomizationException("resource name must not be null");
}
if (StringUtils.isBlank(originalProcessXml)) {
throw new BpmnCustomizationException("process XML must provide");
}
this.resourceName = resourceName;
this.originalProcessXml = originalProcessXml;
if (StringUtils.isBlank(encoding)) {
this.encoding = Charset.defaultCharset().name();
} else {
this.encoding = encoding;
}
}
public String buildAsXml() {
if (rootBpmnModelInstance == null) {
performBuild();
}
if (rootBpmnModelInstance != null) {
return Bpmn.convertToString(rootBpmnModelInstance);
} else {
throw new BpmnCustomizationException("failed to build BPMN model instance");
}
}
public BpmnModelInstance build() {
if (rootBpmnModelInstance == null) {
performBuild();
}
if (rootBpmnModelInstance != null) {
return rootBpmnModelInstance;
} else {
throw new BpmnCustomizationException("failed to build BPMN model instance");
}
}
public final void performBuild() {
reentrantBuildLock.lock();
try {
BpmnModelInstance modelInstance = internalPerformBuild();
this.rootBpmnModelInstance = modelInstance;
} finally {
reentrantBuildLock.unlock();
}
}
public String getResourceName() {
return resourceName;
}
public String getEncoding() {
return encoding;
}
public String getOriginalProcessXml() {
return originalProcessXml;
}
protected BpmnModelInstance internalPerformBuild() {
BpmnModelInstance procModelInstance = readModelFromStream();
if (procModelInstance == null) {
log.error("failed to read model from stream");
throw new BpmnCustomizationException("failed to read model from stream");
}
enhanceSubProcesses(procModelInstance);
enhanceServiceTasks(procModelInstance);
enhanceIntermediateCatchEvents(procModelInstance);
enhanceEndEvents(procModelInstance);
enhanceSequenceFlows(procModelInstance);
validateSignalEventDefinitions(procModelInstance);
validateProcess(procModelInstance);
return procModelInstance;
}
protected BpmnModelInstance readModelFromStream() {
InputStream is = null;
BpmnModelInstance procModelInstance = null;
try {
is = new ByteArrayInputStream(originalProcessXml.getBytes(encoding));
procModelInstance = Bpmn.readModelFromStream(is);
} catch (UnsupportedEncodingException e1) {
log.error("errors while reading model", e1);
procModelInstance = null;
throw new BpmnCustomizationException("failed to read original process content");
} finally {
if (is != null) {
try {
is.close();
} catch (IOException e) {
log.error("errors while closing", e);
}
}
}
return procModelInstance;
}
protected void enhanceProcess(BpmnModelInstance procModelInstance) {
Collection<org.camunda.bpm.model.bpmn.instance.Process> processes = procModelInstance
.getModelElementsByType(org.camunda.bpm.model.bpmn.instance.Process.class);
if (processes.size() != 1) {
log.error("only one process must provide, size={}", processes.size());
throw new BpmnCustomizationException("only one process must provide");
}
org.camunda.bpm.model.bpmn.instance.Process process = processes.iterator().next();
// String procId = process.getId();
// if (StringUtils.isBlank(procId) ||
// !procId.startsWith(PROC_ID_PREFIX)) {
// procId = LocalIdGenerator.generateId(PROC_ID_PREFIX);
// process.setId(procId);
// }
if (StringUtils.isBlank(process.getId())) {
throw new BpmnCustomizationException("process ID must provide");
}
String procName = process.getName();
if (StringUtils.isBlank(procName)) {
throw new BpmnCustomizationException("process name must provide");
}
}
protected void enhanceSubProcesses(BpmnModelInstance procModelInstance) {
Collection<SubProcess> subProcesses = procModelInstance.getModelElementsByType(SubProcess.class);
for (SubProcess subProc : subProcesses) {
log.info("subprocess {} {}", subProc.getId(), subProc.getName());
Collection<StartEvent> internalStartEvents = subProc.getChildElementsByType(StartEvent.class);
if (!internalStartEvents.isEmpty()) {
log.info("subprocess {} {} already have child nodes and no need to supplement any nodes",
subProc.getId(), subProc.getName());
continue;
}
supplementSubProcess(subProc);
}
}
protected void validateLeafNode(FlowNode dstFlowNode) {
if (dstFlowNode.getOutgoing().isEmpty()) {
if ("endEvent".equals(dstFlowNode.getElementType().getTypeName())) {
log.info("end event,id={}", dstFlowNode.getId());
} else {
log.error("the leaf node must be end event,id={}", dstFlowNode.getId());
throw new BpmnCustomizationException("the leaf node must be end event");
}
}
}
protected void enhanceSequenceFlow(SequenceFlow sf) {
FlowNode srcFlowNode = sf.getSource();
FlowNode dstFlowNode = sf.getTarget();
// type="bpmn:tFormalExpression"
if (sf.getConditionExpression() == null && "exclusiveGateway".equals(srcFlowNode.getElementType().getTypeName())
&& srcFlowNode.getOutgoing().size() == 2) {
String dstType = dstFlowNode.getElementType().getTypeName();
if ("serviceTask".equals(dstType) || "subProcess".equals(dstType)) {
log.info("to add condition,sequenceFlowId={}", sf.getId());
ConditionExpression okCon = sf.getModelInstance().newInstance(ConditionExpression.class);
okCon.setType(FORMAL_EXPR_TYPE);
okCon.setTextContent(CONDITION_EXPR_OK);
sf.builder().condition(okCon).done();
}
if ("endEvent".equals(dstType)) {
EndEvent endEvent = (EndEvent) dstFlowNode;
Collection<EventDefinition> eventDefinitions = endEvent.getEventDefinitions();
boolean isErrorEndEvent = false;
for (EventDefinition ed : eventDefinitions) {
if (ErrorEventDefinition.class.isAssignableFrom(ed.getClass())) {
isErrorEndEvent = true;
break;
}
}
if (isErrorEndEvent) {
log.info("to add condition,sequenceFlowId={}", sf.getId());
ConditionExpression notOkCon = sf.getModelInstance().newInstance(ConditionExpression.class);
notOkCon.setType(FORMAL_EXPR_TYPE);
notOkCon.setTextContent(CONDITION_EXPR_NOT_OK);
sf.builder().condition(notOkCon).done();
} else {
ConditionExpression okCon = sf.getModelInstance().newInstance(ConditionExpression.class);
okCon.setType(FORMAL_EXPR_TYPE);
okCon.setTextContent(CONDITION_EXPR_OK);
sf.builder().condition(okCon).done();
}
}
}
}
protected void enhanceSequenceFlows(BpmnModelInstance procModelInstance) {
Collection<SequenceFlow> sequenceFlows = procModelInstance.getModelElementsByType(SequenceFlow.class);
for (SequenceFlow sf : sequenceFlows) {
FlowNode srcFlowNode = sf.getSource();
FlowNode dstFlowNode = sf.getTarget();
log.info("validate sequence flow, id={},name={},srcType={},srcId={},srcOut={},dstId={},dstOut={} ",
sf.getId(), sf.getName(), srcFlowNode.getElementType().getTypeName(), srcFlowNode.getId(),
srcFlowNode.getOutgoing().size(), dstFlowNode.getId(), dstFlowNode.getOutgoing().size());
validateLeafNode(dstFlowNode);
enhanceSequenceFlow(sf);
}
}
protected void enhanceEndEvents(BpmnModelInstance procModelInstance) {
Collection<EndEvent> endEvents = procModelInstance.getModelElementsByType(EndEvent.class);
for (EndEvent endEvent : endEvents) {
enhanceEndEvent(endEvent);
}
}
protected void enhanceEndEvent(EndEvent endEvent) {
log.info("validate end event,id={}", endEvent.getId());
Collection<EventDefinition> eventDefinitions = endEvent.getEventDefinitions();
List<ErrorEventDefinition> eedsToReplace = new ArrayList<ErrorEventDefinition>();
for (EventDefinition ed : eventDefinitions) {
if (ed instanceof ErrorEventDefinition) {
log.info("error end event definition");
ErrorEventDefinition eed = (ErrorEventDefinition) ed;
if (eed.getError() != null) {
if (StringUtils.isBlank(eed.getError().getErrorCode())) {
log.info("error code is null,errorId={}", eed.getError().getId());
eed.getError().setErrorCode(DEFAULT_ERROR_CODE);
}
} else {
log.info("does not have error reference, eventId={}", endEvent.getId());
eedsToReplace.add(eed);
}
}
}
for (ErrorEventDefinition eed : eedsToReplace) {
endEvent.builder().error(DEFAULT_ERROR_CODE).done();
endEvent.removeChildElement(eed);
}
}
protected void validateSignalEventDefinitions(BpmnModelInstance procModelInstance) {
Collection<SignalEventDefinition> signalEventDefinitions = procModelInstance
.getModelElementsByType(SignalEventDefinition.class);
for (SignalEventDefinition sed : signalEventDefinitions) {
log.info("validate signal event definition, id={},signalRef={}", sed.getId(),
sed.getAttributeValueNs(NS_BPMN, "signalRef"));
Signal sig = sed.getSignal();
if (sig == null) {
log.error("invalid signal defined, id={},signalRef={}", sed.getId(),
sed.getAttributeValueNs(NS_BPMN, "signalRef"));
throw new BpmnCustomizationException("invalid signal definition");
} else {
log.info("signal id={}, name={}", sig.getId(), sig.getName());
}
}
}
protected void enhanceIntermediateCatchEvents(BpmnModelInstance procModelInstance) {
Collection<IntermediateCatchEvent> ices = procModelInstance
.getModelElementsByType(IntermediateCatchEvent.class);
for (IntermediateCatchEvent ice : ices) {
log.info("validate intermediate catch event,{} {}", ice.getId(), ice.getName());
Collection<EventDefinition> events = ice.getEventDefinitions();
List<EventDefinition> eventsToReplace = new ArrayList<EventDefinition>();
for (EventDefinition e : events) {
log.info("event definition,{}, {}", e.getId(), e.getElementType().getTypeName());
if ("signalEventDefinition".equals(e.getElementType().getTypeName())
&& StringUtils.isBlank(e.getAttributeValueNs(NS_BPMN, "signalRef"))) {
log.info("invalid event definition");
eventsToReplace.add(e);
}
}
for (EventDefinition e : eventsToReplace) {
if ("signalEventDefinition".equals(e.getElementType().getTypeName())
&& StringUtils.isBlank(e.getAttributeValueNs(NS_BPMN, "signalRef"))) {
String signalId = "Sig_" + LocalIdGenerator.generateId();
IntermediateCatchEventBuilder iceBuilder = ice.builder().signal(signalId);
iceBuilder.done();
ice.removeChildElement(e);
log.info("add signal event definition, signalId={}", signalId);
}
}
}
}
protected void enhanceServiceTasks(BpmnModelInstance procModelInstance) {
Collection<ServiceTask> serviceTasks = procModelInstance.getModelElementsByType(ServiceTask.class);
for (ServiceTask serviceTask : serviceTasks) {
log.info("validate service task, {} {}", serviceTask.getId(), serviceTask.getName());
String delegateExpression = serviceTask.getCamundaDelegateExpression();
if (StringUtils.isBlank(delegateExpression)) {
log.info("delegate expression is blank, {} {}", serviceTask.getId(), serviceTask.getName());
delegateExpression = "${taskDispatcher}";
serviceTask.setCamundaDelegateExpression(delegateExpression);
}
}
}
protected void supplementSubProcess(SubProcess subProc) {
String subProcId = subProc.getId();
String userTaskId = "exceptSubUT-" + subProcId;
String srvBeanServiceTaskId = String.format("srvBeanST-%s", subProcId);
String actRetryExpr = String.format("${ act_%s == 'retry' }", subProcId);
String actSkipExpr = String.format("${ act_%s == 'skip' }", subProcId);
String catchEventId = subProcId + "_ice1";
String signalId = subProcId + "_sig1";
String retCodeOkExpr = String.format("${retCode_%s != 1}",catchEventId);
String retCodeNotOkExpr = String.format("${retCode_%s == 1}",catchEventId);
StartEventBuilder b = subProc.builder().embeddedSubProcess().startEvent(subProcId + "_startEvent1")
.name("St1_" + subProcId);
EndEventBuilder eb = b.serviceTask(srvBeanServiceTaskId).name("T1_" + subProcId) //
.eventBasedGateway().name("EGW1_" + subProcId) //
.intermediateCatchEvent(catchEventId).name("ICE1_" + subProcId) //
.signal(signalId) //
.exclusiveGateway().gatewayDirection(GatewayDirection.Diverging) //
.condition("con1", retCodeOkExpr) //
.endEvent(subProcId + "_endEvent1").name("End1_" + subProcId) //
.moveToLastGateway() //
.condition("con2", retCodeNotOkExpr) //
.serviceTask("srvFailBeanST-" + subProcId) //
.name("SRV-FAIL-HANDLER_" + subProcId).camundaDelegateExpression("${srvFailBean}") //
.userTask(userTaskId).name("EXCEPTION-HANDLER_" + subProcId) //
.condition("con4", actRetryExpr) //
.connectTo(srvBeanServiceTaskId) //
.moveToActivity(userTaskId) //
.condition("con3", actSkipExpr) //
.endEvent().name("End2_" + subProcId);
String subProcessTimeoutExpr = getSubProcessTimeoutExpression(subProc);
if (StringUtils.isNotBlank(subProcessTimeoutExpr)) {
AbstractFlowNodeBuilder<?, ?> ab = eb.moveToLastGateway().moveToLastGateway()
.intermediateCatchEvent(subProcId + "_time1").timerWithDuration(subProcessTimeoutExpr)
.serviceTask("srvTimeOutBeanST-" + subProcId).name("SRV-TIMEOUT-HANDLER_" + subProcId)
.camundaDelegateExpression("${srvTimeoutBean}").connectTo(userTaskId);
ab.done();
} else {
eb.done();
}
}
protected String getSubProcessTimeoutExpression(SubProcess subProc) {
if (bpmnParseAttachment == null) {
return null;
}
if (bpmnParseAttachment.getSubProcessAddtionalInfos() == null
|| bpmnParseAttachment.getSubProcessAddtionalInfos().isEmpty()) {
return null;
}
SubProcessAdditionalInfo subProcessAdditionalInfo = null;
for (SubProcessAdditionalInfo info : bpmnParseAttachment.getSubProcessAddtionalInfos()) {
if (subProc.getId().equals(info.getSubProcessNodeId())) {
subProcessAdditionalInfo = info;
break;
}
}
if (subProcessAdditionalInfo == null) {
return null;
}
return subProcessAdditionalInfo.getTimeoutExpression();
}
protected void validateProcess(BpmnModelInstance procModelInstance) {
org.camunda.bpm.model.bpmn.instance.Process process = procModelInstance
.getModelElementsByType(org.camunda.bpm.model.bpmn.instance.Process.class).iterator().next();
Collection<StartEvent> procStartEvents = process.getChildElementsByType(StartEvent.class);
Collection<EndEvent> procEndEvents = process.getChildElementsByType(EndEvent.class);
if (procStartEvents.size() != 1) {
log.error("only one start event must provide for {} {}", process.getId(), process.getName());
throw new BpmnCustomizationException("only one start event must provide");
}
if (procEndEvents.size() < 1) {
log.error("at least one end event must provide for {} {}", process.getId(), process.getName());
throw new BpmnCustomizationException("at least one end event must provide");
}
}
public BpmnParseAttachment getBpmnParseAttachment() {
return bpmnParseAttachment;
}
public void setBpmnParseAttachment(BpmnParseAttachment bpmnParseAttachment) {
this.bpmnParseAttachment = bpmnParseAttachment;
}
public void setResourceName(String resourceName) {
this.resourceName = resourceName;
}
public void setOriginalProcessXml(String originalProcessXml) {
this.originalProcessXml = originalProcessXml;
}
public void setEncoding(String encoding) {
this.encoding = encoding;
}
}
| [
"gavin2lee@163.com"
] | gavin2lee@163.com |
7d3b4a1db637daa0d0f74797d7d6ddde352474b6 | b526ce63f0aebd89e3b2ce34ff357ef4888fc8a5 | /Analysis/src/main/java/edu/run/major/MajorTCSStatisticsToDB.java | f6b1635427ab349e4bbbf7ed5edbe5032f0689b9 | [] | no_license | guxiaoyan5/graduadtionProject | d7e5aa575f749ac42cb1845b230a97effdf4f3d4 | 9bcdec70c2c4cb5cf0ad41ca7dcdab69f72f8beb | refs/heads/master | 2023-04-29T03:44:51.808799 | 2021-05-24T01:18:23 | 2021-05-24T01:18:23 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,484 | java | package edu.run.major;
import edu.Dao.Class.ClassTCSInputValue;
import edu.Dao.Class.ClassTCSKey;
import edu.Dao.Class.ClassTCSValue;
import edu.Dao.Major.MajorTCSInputValue;
import edu.Dao.Major.MajorTCSKey;
import edu.Dao.Major.MajorTCSValue;
import edu.Infomation.Class.ClassTCS;
import edu.Infomation.Major.MajorTCS;
import edu.run.classCS.ClassTCSStatisticsToDB;
import edu.util.StaticConstant;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.io.WritableUtils;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.Mapper;
import org.apache.hadoop.mapreduce.Reducer;
import org.apache.hadoop.mapreduce.lib.db.DBConfiguration;
import org.apache.hadoop.mapreduce.lib.db.DBInputFormat;
import org.apache.hadoop.mapreduce.lib.db.DBOutputFormat;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashSet;
public class MajorTCSStatisticsToDB {
public static void main(String[] args) throws IOException, InterruptedException, ClassNotFoundException {
Configuration configuration = new Configuration();
configuration.set("mapreduce.framework.name", "yarn");
DBConfiguration.configureDB(configuration, StaticConstant.jdbcDriver, StaticConstant.jdbcUrl, StaticConstant.jdbcUser, StaticConstant.jdbcPassword);
Job job = Job.getInstance(configuration, "major three meals consume");
job.setJarByClass(MajorTCSStatisticsToDB.class);
job.setMapperClass(Map.class);
job.setReducerClass(Reduce.class);
job.setMapOutputKeyClass(MajorTCSKey.class);
job.setMapOutputValueClass(MajorTCSValue.class);
job.setOutputKeyClass(MajorTCS.class);
job.setOutputValueClass(MajorTCS.class);
job.setInputFormatClass(DBInputFormat.class);
job.setOutputKeyClass(DBOutputFormat.class);
DBOutputFormat.setOutput(job, "major_three_meals_statistics",
"major_id", "consumption_category", "consumption_count", "consumption_total_money",
"consumption_average_money", "consumption_student_average_money", "student_count",
"consumption_low_count", "consumption_high_count", "student_low_count", "student_high_count"
);
DBInputFormat.setInput(job, MajorTCSInputValue.class,
"select student.id,major_id,execution_time,consumption_category,money,consumption_total_money " +
"from student,consume,student_three_meals_statistics where student.id=consume.sid " +
"and student.id=student_three_meals_statistics.sid and (((hour(execution_time) between 0 and 9) and consumption_category = '早') or ((hour(execution_time) between 10 and 15) and consumption_category = '午') or ((hour(execution_time) between 16 and 24) and consumption_category = '晚'))",
"select count(1) from consume");
boolean result = job.waitForCompletion(true);
System.exit(result ? 0 : 1);
}
static class Map extends Mapper<Object, MajorTCSInputValue, MajorTCSKey, MajorTCSValue> {
@Override
protected void map(Object key, MajorTCSInputValue value, Context context) throws IOException, InterruptedException {
context.write(new MajorTCSKey(value.getMajor_id(), value.getMeal()), new MajorTCSValue(value.getSid(), value.getMoney(), value.getStudentTotalMoney()));
}
}
static class Reduce extends Reducer<MajorTCSKey, MajorTCSValue, MajorTCS, MajorTCS> {
@Override
protected void reduce(MajorTCSKey key, Iterable<MajorTCSValue> values, Context context) throws IOException, InterruptedException {
ArrayList<MajorTCSValue> newValues = new ArrayList<>();
HashSet<String> sidLow = new HashSet<>();
HashSet<String> highLow = new HashSet<>();
HashSet<String> sid = new HashSet<>();
int count = 0;
int lowCount = 0;
int highCount = 0;
int studentCount = 0;
int studentLowCount = 0;
int studentHighCount = 0;
float totalMoney = 0;
for (MajorTCSValue value : values) {
count += 1;
totalMoney += value.getMoney();
sid.add(value.getSid());
MajorTCSValue newValue = WritableUtils.clone(value, context.getConfiguration());
newValues.add(newValue);
}
studentCount = sid.size();
float average = totalMoney / count;
float studentAverage = totalMoney / studentCount;
for (MajorTCSValue value : newValues) {
if (value.getMoney() < average) {
lowCount += 1;
} else {
highCount += 1;
}
if (value.getStudentTotalMoney() < studentAverage) {
sidLow.add(value.getSid());
} else {
highLow.add(value.getSid());
}
}
studentLowCount = sidLow.size();
studentHighCount = highLow.size();
context.write(new MajorTCS(key.getMajor_id(), key.getMeal(), count, totalMoney, average, studentAverage, studentCount, lowCount, highCount, studentLowCount, studentHighCount),
new MajorTCS(key.getMajor_id(), key.getMeal(), count, totalMoney, average, studentAverage, studentCount, lowCount, highCount, studentLowCount, studentHighCount));
}
}
}
| [
"54840826+love5yan@users.noreply.github.com"
] | 54840826+love5yan@users.noreply.github.com |
3c383668c5943690911cb89a045fbaae267810ea | d023adcd0f3efa57efa06d1b26857bcc460282ea | /NewAccount.java | e6f7aa53fe5e31e42bf3a138585009363ed39481 | [
"MIT"
] | permissive | shikhar29111996/Bank_System | 084295db9a786ea0b3e5639d37dabbe1d1af466c | 8e0681e33295fdf79132bda72a0e355af60e210e | refs/heads/master | 2021-01-22T22:57:20.023748 | 2017-03-20T15:24:08 | 2017-03-20T15:24:08 | 85,592,959 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,353 | java | import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.io.*;
public class NewAccount extends JInternalFrame implements ActionListener {
private JPanel jpInfo = new JPanel();
private JLabel lbNo, lbName, lbDate, lbDeposit;
private JTextField txtNo, txtName, txtDeposit;
private JComboBox cboMonth, cboDay, cboYear;
private JButton btnSave, btnCancel;
private int count = 0;
private int rows = 0;
private int total = 0;
//String Type Array use to Load Records From File.
private String records[][] = new String [500][6];
//String Type Array use to Save Records into File.
private String saves[][] = new String [500][6];
private FileInputStream fis;
private DataInputStream dis;
NewAccount () {
// super(Title, Resizable, Closable, Maximizable, Iconifiable)
super ("Create New Account", false, true, false, true);
setSize (335, 235);
jpInfo.setBounds (0, 0, 500, 115);
jpInfo.setLayout (null);
lbNo = new JLabel ("Account No:");
lbNo.setForeground (Color.black);
lbNo.setBounds (15, 20, 80, 25);
lbName = new JLabel ("Person Name:");
lbName.setForeground (Color.black);
lbName.setBounds (15, 55, 80, 25);
lbDate = new JLabel ("Deposit Date:");
lbDate.setForeground (Color.black);
lbDate.setBounds (15, 90, 80, 25);
lbDeposit = new JLabel ("Dep. Amount:");
lbDeposit.setForeground (Color.black);
lbDeposit.setBounds (15, 125, 80, 25);
txtNo = new JTextField ();
txtNo.setHorizontalAlignment (JTextField.RIGHT);
txtNo.setBounds (105, 20, 205, 25);
txtName = new JTextField ();
txtName.setBounds (105, 55, 205, 25);
txtDeposit = new JTextField ();
txtDeposit.setHorizontalAlignment (JTextField.RIGHT);
txtDeposit.setBounds (105, 125, 205, 25);
//Restricting The User Input to only Numerics in Numeric TextBoxes.
txtNo.addKeyListener (new KeyAdapter() {
public void keyTyped (KeyEvent ke) {
char c = ke.getKeyChar ();
if (!((Character.isDigit (c) || (c == KeyEvent.VK_BACK_SPACE)))) {
getToolkit().beep ();
ke.consume ();
}
}
}
);
txtDeposit.addKeyListener (new KeyAdapter() {
public void keyTyped (KeyEvent ke) {
char c = ke.getKeyChar ();
if (!((Character.isDigit (c) || (c == KeyEvent.VK_BACK_SPACE)))) {
getToolkit().beep ();
ke.consume ();
}
}
}
);
//Creating Date Option.
String Months[] = {"January", "February", "March", "April", "May", "June",
"July", "August", "September", "October", "November", "December"};
cboMonth = new JComboBox (Months);
cboDay = new JComboBox ();
cboYear = new JComboBox ();
for (int i = 1; i <= 31; i++) {
String days = "" + i;
cboDay.addItem (days);
}
for (int i = 2000; i <= 2015; i++) {
String years = "" + i;
cboYear.addItem (years);
}
//Aligning The Date Option Controls.
cboMonth.setBounds (105, 90, 92, 25);
cboDay.setBounds (202, 90, 43, 25);
cboYear.setBounds (250, 90, 60, 25);
//Aligning The Buttons.
btnSave = new JButton ("Save");
btnSave.setBounds (20, 165, 120, 25);
btnSave.addActionListener (this);
btnCancel = new JButton ("Cancel");
btnCancel.setBounds (185, 165, 120, 25);
btnCancel.addActionListener (this);
//Adding the All the Controls to Panel.
jpInfo.add (lbNo);
jpInfo.add (txtNo);
jpInfo.add (lbName);
jpInfo.add (txtName);
jpInfo.add (lbDate);
jpInfo.add (cboMonth);
jpInfo.add (cboDay);
jpInfo.add (cboYear);
jpInfo.add (lbDeposit);
jpInfo.add (txtDeposit);
jpInfo.add (btnSave);
jpInfo.add (btnCancel);
//Adding Panel to Window.
getContentPane().add (jpInfo);
//In the End Showing the New Account Window.
setVisible (true);
}
//Function use By Buttons of Window to Perform Action as User Click Them.
public void actionPerformed (ActionEvent ae) {
Object obj = ae.getSource();
if (obj == btnSave) {
if (txtNo.getText().equals("")) {
JOptionPane.showMessageDialog (this, "Please! Provide Id of Customer.",
"BankSystem - EmptyField", JOptionPane.PLAIN_MESSAGE);
txtNo.requestFocus();
}
else if (txtName.getText().equals("")) {
JOptionPane.showMessageDialog (this, "Please! Provide Name of Customer.",
"BankSystem - EmptyField", JOptionPane.PLAIN_MESSAGE);
txtName.requestFocus ();
}
else if (txtDeposit.getText().equals("")) {
JOptionPane.showMessageDialog (this, "Please! Provide Deposit Amount.",
"BankSystem - EmptyField", JOptionPane.PLAIN_MESSAGE);
txtDeposit.requestFocus ();
}
else {
populateArray (); //Load All Existing Records in Memory.
findRec (); //Finding if Account No. Already Exist or Not.
}
}
if (obj == btnCancel) {
txtClear ();
setVisible (false);
dispose();
}
}
//Function use to load all Records from File when Application Execute.
void populateArray () {
try {
fis = new FileInputStream ("Bank.dat");
dis = new DataInputStream (fis);
//Loop to Populate the Array.
while (true) {
for (int i = 0; i < 6; i++) {
records[rows][i] = dis.readUTF ();
}
rows++;
}
}
catch (Exception ex) {
total = rows;
if (total == 0) { }
else {
try {
dis.close();
fis.close();
}
catch (Exception exp) { }
}
}
}
//Function use to Find Record by Matching the Contents of Records Array with ID TextBox.
void findRec () {
boolean found = false;
for (int x = 0; x < total; x++) {
if (records[x][0].equals (txtNo.getText())) {
found = true;
JOptionPane.showMessageDialog (this, "Account No. " + txtNo.getText () + " is Already Exist.",
"BankSystem - WrongNo", JOptionPane.PLAIN_MESSAGE);
txtClear ();
break;
}
}
if (found == false) {
saveArray ();
}
}
//Function use to add new Element to Array.
void saveArray () {
saves[count][0] = txtNo.getText ();
saves[count][1] = txtName.getText ();
saves[count][2] = "" + cboMonth.getSelectedItem ();
saves[count][3] = "" + cboDay.getSelectedItem ();
saves[count][4] = "" + cboYear.getSelectedItem ();
saves[count][5] = txtDeposit.getText ();
saveFile (); //Save This Array to File.
count++;
}
//Function use to Save new Record to the File.
void saveFile () {
try {
FileOutputStream fos = new FileOutputStream ("Bank.dat", true);
DataOutputStream dos = new DataOutputStream (fos);
dos.writeUTF (saves[count][0]);
dos.writeUTF (saves[count][1]);
dos.writeUTF (saves[count][2]);
dos.writeUTF (saves[count][3]);
dos.writeUTF (saves[count][4]);
dos.writeUTF (saves[count][5]);
JOptionPane.showMessageDialog (this, "The Record has been Saved Successfully",
"BankSystem - Record Saved", JOptionPane.PLAIN_MESSAGE);
txtClear ();
dos.close();
fos.close();
}
catch (IOException ioe) {
JOptionPane.showMessageDialog (this, "There are Some Problem with File",
"BankSystem - Problem", JOptionPane.PLAIN_MESSAGE);
}
}
//Function use to Clear all TextFields of Window.
void txtClear () {
txtNo.setText ("");
txtName.setText ("");
txtDeposit.setText ("");
txtNo.requestFocus ();
}
} | [
"noreply@github.com"
] | noreply@github.com |
7c5d97c1b64723090ab8f5b60ea421915f7e024e | d442753aa6c432ca90d837117a529b9422e23ee6 | /src/main/java/com/mybatis/test/binding/MapperProxy.java | 25c22462a10d6a4f17e5cbb1c66bc523c66cbe76 | [] | no_license | 2358723997/mybatis-test | f9cf769afaaa65d206f87e378d6eaa9461362de3 | 0f70ea7f7fe71f9436a4a0fbb205098ca26dcc6d | refs/heads/master | 2023-07-13T17:02:35.132085 | 2021-08-15T15:48:09 | 2021-08-15T15:48:09 | 396,402,780 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,382 | java | package com.mybatis.test.binding;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import com.mybatis.test.session.DefaultSqlSession;
/**
* MapperProxy类
* MapperProxy代理类,用于代理Mapper接口
*
* @author wangjixue
* @date 8/15/21 9:16 PM
*/
public class MapperProxy implements InvocationHandler {
private DefaultSqlSession sqlSession;
private Class pojo;
public MapperProxy(DefaultSqlSession sqlSession, Class pojo) {
this.sqlSession = sqlSession;
this.pojo = pojo;
}
/**
* 所有Mapper接口的方法调用都会走到这里
*
* @param proxy
* @param method
* @param args
* @return
* @throws Throwable
*/
@Override
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
String mapperInterface = method.getDeclaringClass().getName();
String methodName = method.getName();
String statementId = mapperInterface + methodName;
// 如果根据接口类型+方法名能找到映射的SQL,则执行SQL
if (sqlSession.getConfiguration().hasStatement(statementId)) {
return sqlSession.selectOne(statementId, args, pojo);
}
// 否则直接执行被代理对象的原方法
return method.invoke(proxy, args);
}
}
| [
"2358723997@qq.com"
] | 2358723997@qq.com |
b9974a8e9572d7a3280801001f790edbbf8a3e81 | 2e37d297e8c9782bd4f9349d9bb8e9ee21a51da4 | /AppChatV4/app/src/main/java/com/example/appchatv4/Facebook/SignUpFacebookActivity.java | c290aadb961eb4552a77fa8d2238c678cd63170d | [] | no_license | nguyenven299/LapTrinhAndroid | 1c42bb6cf07d2459a33131026a09373e1930bd6f | 2a764fd42b5696a570865ca28ff0f9e6f0179d62 | refs/heads/master | 2020-08-06T06:00:19.864443 | 2020-05-03T08:22:01 | 2020-05-03T08:22:01 | 212,850,341 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 81 | java | package com.example.appchatv4.Facebook;
public class SignUpFacebookActivity {
}
| [
"nguyenven1999@gmail.com"
] | nguyenven1999@gmail.com |
ce2250efe15896fe305f1be5af6b360a093427c7 | 283a699ad7f59c0ef27f65fa541435ddd44d9a10 | /src/main/java/com/rhjf/salesman/web/util/Test.java | 5c10a6b00f974c4d56e9e55d59485cf4515cf7a1 | [] | no_license | zfy0098/salesman-web | 462a3a4c1153e30bc28cb5d205a45b61032c2fc8 | 48c3ed4731a7d091d0f5a4f8f740d2f482ba1cf9 | refs/heads/master | 2021-01-19T18:23:35.369308 | 2018-03-05T06:33:44 | 2018-03-05T06:33:44 | 101,130,736 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 301 | java | package com.rhjf.salesman.web.util;
import java.util.UUID;
/**
* Created by hadoop on 2017/8/29.
*/
public class Test {
public static void main(String[] args){
for (int i =0 ; i < 5 ; i++){
System.out.println(UUID.randomUUID().toString().toUpperCase());
}
}
}
| [
"zfy0098@163.com"
] | zfy0098@163.com |
c37bd1429de0b67d6bb7d441be9916c4b216aa5c | 1d928c3f90d4a0a9a3919a804597aa0a4aab19a3 | /java/hazelcast/2015/4/MapPutTransientRequest.java | dd4576dacee1d201e8dd5955adcb397c4be249a3 | [] | no_license | rosoareslv/SED99 | d8b2ff5811e7f0ffc59be066a5a0349a92cbb845 | a062c118f12b93172e31e8ca115ce3f871b64461 | refs/heads/main | 2023-02-22T21:59:02.703005 | 2021-01-28T19:40:51 | 2021-01-28T19:40:51 | 306,497,459 | 1 | 1 | null | 2020-11-24T20:56:18 | 2020-10-23T01:18:07 | null | UTF-8 | Java | false | false | 1,781 | java | /*
* Copyright (c) 2008-2015, Hazelcast, Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hazelcast.map.impl.client;
import com.hazelcast.map.impl.MapPortableHook;
import com.hazelcast.map.impl.operation.PutTransientOperation;
import com.hazelcast.nio.serialization.Data;
import com.hazelcast.spi.Operation;
import java.util.concurrent.TimeUnit;
public class MapPutTransientRequest extends MapPutRequest {
public MapPutTransientRequest() {
}
public MapPutTransientRequest(String name, Data key, Data value, long threadId) {
super(name, key, value, threadId);
}
public MapPutTransientRequest(String name, Data key, Data value, long threadId, long ttl) {
super(name, key, value, threadId, ttl);
}
public int getClassId() {
return MapPortableHook.PUT_TRANSIENT;
}
protected Operation prepareOperation() {
PutTransientOperation op = new PutTransientOperation(name, key, value, ttl);
op.setThreadId(threadId);
return op;
}
@Override
public String getMethodName() {
return "putTransient";
}
@Override
public Object[] getParameters() {
return new Object[]{key, value, ttl, TimeUnit.MILLISECONDS};
}
}
| [
"rodrigosoaresilva@gmail.com"
] | rodrigosoaresilva@gmail.com |
622691aba90c46f08e03123dc44e6e8e0a8a9791 | 21f7c0afc4f9561498039e1ce516135e16abfc07 | /src/main/java/com/brenolins/cursomc/domain/Endereco.java | 0977e74db81b703df63a4ac5566adcf250af6ab9 | [] | no_license | brenohlins/springboot-ionic-backend | 86adf04c19337798eaff4f1e0b9544e2608ce8d3 | d008f1712fb93917c8465dea1648081d56d41888 | refs/heads/master | 2022-11-18T04:24:47.089495 | 2020-07-19T04:09:26 | 2020-07-19T04:09:26 | 263,360,639 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,047 | java | package com.brenolins.cursomc.domain;
import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.AllArgsConstructor;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@NoArgsConstructor
@AllArgsConstructor
@Getter
@Setter
@EqualsAndHashCode
@Entity
public class Endereco implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
private String logradouro;
private String numero;
private String complemento;
private String bairro;
private String cep;
@JsonIgnore
@ManyToOne
@JoinColumn(name = "cliente_id")
private Cliente cliente;
@ManyToOne
@JoinColumn(name = "cidade_id")
private Cidade cidade;
}
| [
"brenoh21@gmail.com"
] | brenoh21@gmail.com |
3ec06e355d5b1b8a971d02f304cd6421e31d0015 | 190b0d767cc9848beb55bae998f2fd9e8f4541cb | /JavaSE/src/JavaSE_09_API/项目/T_Date.java | 1cb4097d5cab7d1ba172d249b013d63038c0ba9d | [] | no_license | cxysl/mytest | 0b7ad12f64afc21b6a88aff785a0a0610451d092 | d4519acfe2c953cec57015a960337783634393b8 | refs/heads/master | 2022-06-26T14:09:43.686394 | 2020-07-27T06:58:40 | 2020-07-27T06:58:40 | 229,001,336 | 4 | 0 | null | 2022-06-21T02:28:46 | 2019-12-19T07:39:57 | Java | UTF-8 | Java | false | false | 1,351 | java | package JavaSE_09_API.项目;
import java.util.Date;
import java.util.Scanner;
import java.text.SimpleDateFormat;
public class T_Date {
public static void main(String[] args) {
System.out.print("输入商品生产日期(格式:yyyy-mm-dd):");
Scanner reader = new Scanner(System.in);
String str1 = reader.next();
System.out.print("输入商品的保质期:");
int day = reader.nextInt();
com(str1,day);
}
public static void com(String str1,int day){
Date date = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
String time = sdf.format(date.getTime());
System.out.println("今天的日期为:"+time);
int s01 = Integer.parseInt(str1.substring(0,4));
int s02 = Integer.parseInt(str1.substring(5,7));
int s03 = Integer.parseInt(str1.substring(8,10));
int s1 = Integer.parseInt(time.substring(0,4));
int s2 = Integer.parseInt(time.substring(5,7));
int s3 = Integer.parseInt(time.substring(8,10));
int day1 = (s1-s01)*365+(s2-s02)*30+s3-s03;
if (day>day1) System.out.println("商品没过期!");
else System.out.println("商品已经过期!");
// System.out.println(s1+" "+s2+" "+s3);
// System.out.println(s01+" "+s02+" "+s03);
}
}
//2019-08-25 | [
"463572181@qq.com"
] | 463572181@qq.com |
78904a642ead9c663739c0e56d098b4e00d01018 | 90f17cd659cc96c8fff1d5cfd893cbbe18b1240f | /src/main/java/com/google/firebase/firestore/local/LocalStore$$Lambda$5.java | 454f10005bdc8f24eae1331afa286579bf6aa391 | [] | no_license | redpicasso/fluffy-octo-robot | c9b98d2e8745805edc8ddb92e8afc1788ceadd08 | b2b62d7344da65af7e35068f40d6aae0cd0835a6 | refs/heads/master | 2022-11-15T14:43:37.515136 | 2020-07-01T22:19:16 | 2020-07-01T22:19:16 | 276,492,708 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 733 | java | package com.google.firebase.firestore.local;
import com.google.protobuf.ByteString;
/* compiled from: com.google.firebase:firebase-firestore@@19.0.0 */
final /* synthetic */ class LocalStore$$Lambda$5 implements Runnable {
private final LocalStore arg$1;
private final ByteString arg$2;
private LocalStore$$Lambda$5(LocalStore localStore, ByteString byteString) {
this.arg$1 = localStore;
this.arg$2 = byteString;
}
public static Runnable lambdaFactory$(LocalStore localStore, ByteString byteString) {
return new LocalStore$$Lambda$5(localStore, byteString);
}
public void run() {
this.arg$1.mutationQueue.setLastStreamToken(this.arg$2);
}
}
| [
"aaron@goodreturn.org"
] | aaron@goodreturn.org |
c21eaa26c265e95e932c6ce1254289d236a94781 | 69285a08dff1c168844a8c420099deabe6f5d385 | /5_year/D5_DifferentialCryptanalysis/src/branch_and_bound/PrecalculationTable.java | 42b03b981e7b81a5ea118059275d06c0ea8b3501 | [] | no_license | Flav1us/Labs | 47b038af9505e6e72d5d0cfd3e4953690014058b | 567ff8b7a58f28eabccb4badcbbf670a1d193b03 | refs/heads/master | 2022-09-22T02:53:21.747550 | 2019-06-25T16:47:39 | 2019-06-25T16:47:39 | 153,999,652 | 1 | 0 | null | 2022-09-08T00:59:37 | 2018-10-21T11:12:16 | HTML | UTF-8 | Java | false | false | 2,960 | java | package branch_and_bound;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.LinkedList;
import java.util.List;
public class PrecalculationTable {
//private static int decrease_multiplier = 1; //for speed during testing
public static List<List<Node>> content = new ArrayList<>();
private static final double minprob = 0.15;
/*
* *
* 0 0.4 0.1 0z 0 0 0.3 0 0.2 0
* * * * * * * * * * *
* * * * *
*/
private static SerializableDiffTable dt = null;
public static void init() throws ClassNotFoundException, IOException {
char input = (char)0b1111;
init(input);
}
public static void init(char input) throws ClassNotFoundException, IOException {
int numIter = 5;
content = new ArrayList<>();
if (dt == null) dt = new SerializableDiffTable();
//root
List<Node> root = new LinkedList<Node>();
root.add(new Node(input, null, 1));
//done: 0b1, 0b1111
content.add(root);
for (int i = 0; i < numIter; i++) {
Node[] interim = new Node[Character.MAX_VALUE];
for (Node n : content.get(i)) {
//System.out.println("iter " + i);
for (char c = 0; c < Character.MAX_VALUE; c++) {
// double p = BranchAndBound.roundDiffProb(n.value, c, decrease_multiplier);
Double p0 = dt.get(n.value).get(c);
double p = p0 == null ? 0 : p0;
if (interim[c] == null) {
interim[c] = new Node(c, n, p*n.input_prob); //p*n.input_prob
} else {
interim[c].input_prob += p*n.input_prob; //p*n.input_prob
interim[c].parents.add(n);
}
}
}
List<Node> notZeroProb = new LinkedList<Node>();
for (Node n : interim) {
if (n != null && n.input_prob > Math.pow(minprob, i+1)) {
notZeroProb.add(n); }}
System.out.println("notZeroProb " + i + " length: " + notZeroProb.size());
content.add(notZeroProb);
for(Node t : content.get(i+1)) {
System.out.println(Integer.toHexString(t.value) + "\t" + t.input_prob);
}
// идея - хранить пары дифф с ненулевой вер
}
if(content.size() != numIter+1) System.out.println("content size == " + content.size() + " != " + numIter+1);
}
public static char getMaxProbDiff() {
List<Node> l = content.get(content.size()-1);
double max_prob = 0;
Character max_pr_diff = null;
for(Node n : l) {
if(n.input_prob > max_prob) {
max_prob = n.input_prob;
max_pr_diff = n.value;
}
}
if(max_pr_diff == null) throw new IllegalStateException("no valid candidates for differential. increase minprob");
return max_pr_diff;
}
public static void sortNodeList(List<Node> l) {
Collections.sort(l, new Comparator<Node>() {
@Override
public int compare(Node o1, Node o2) {
return Double.compare(o2.input_prob, o1.input_prob);
}
});
}
}
| [
"an215@ukr.net"
] | an215@ukr.net |
4f5eb11b9915a23e1fe2a00c3dd7a37f7ad85a15 | ef71494fef6618b48cfbcce2904dfd74b12a8948 | /icloud-stock/icloud-stock-connector/src/main/java/com/icloud/stock/importer/meta/MoreStockInfoImporter.java | 93917f9f0ec8f75805e706e0a11e16472722700e | [] | no_license | djgrasss/icloud-2 | 128d8ba977afc1787f280c9b524d1704035476d7 | 796c0b53af2c05e82ef68f8c140a726e19a0e1ce | refs/heads/master | 2021-01-21T23:58:10.983738 | 2014-09-03T01:41:55 | 2014-09-03T01:41:55 | 23,603,476 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 4,210 | java | package com.icloud.stock.importer.meta;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import com.icloud.framework.file.TextFile;
import com.icloud.stock.ctx.BaseServiceImporter;
import com.icloud.stock.ctx.BeansUtil;
import com.icloud.stock.model.Category;
import com.icloud.stock.model.CategoryStock;
import com.icloud.stock.model.Stock;
import com.icloud.stock.model.constant.StockConstants.BaseCategory;
import com.icloud.stock.model.constant.StockConstants.StockLocation;
import com.icloud.stock.service.ICategoryService;
import com.icloud.stock.service.ICategoryStockService;
import com.icloud.stock.service.IStockService;
/**
*
* @author jiangningcui
*
*/
public class MoreStockInfoImporter extends BaseServiceImporter {
public void importMetaInfo() {
String filePath = "/home/jiangningcui/workspace/mygithub/icloud/icloud-data/xueqiu/processed/jichufenlei.txt";
importFile(filePath, BaseCategory.BASE);
}
public void importFile(String filePath, BaseCategory baseCategory) {
List<String> content = getContent(filePath);
/**
* 类别
*/
Map<String, Category> categoryMap = new HashMap<String, Category>();
for (String str : content) {
Category category = getCategory(str, baseCategory);
if (categoryMap.get(category.getCategoryName()) == null) {
List<Category> tmpList = categoryService.findByProperies(
"categoryName", category.getCategoryName());
System.out.println(tmpList.get(0).getCategoryName());
if (tmpList == null || tmpList.size() == 0) {
categoryService.save(category);
categoryMap.put(category.getCategoryName(), category);
} else {
categoryMap.put(category.getCategoryName(), tmpList.get(0));
}
}
}
System.out.println("---------------------");
// Map<String, Stock> stockMap = new HashMap<String, Stock>();
int count = content.size();
int i = 0;
for (String str : content) {
Stock stock = getStockInfo(str);
List<Stock> tmpList = stockService.findByProperies("stockCode",
stock.getStockCode());
if (tmpList == null || tmpList.size() == 0) {
stockService.save(stock);
System.out.println(stock.getStockCode());
} else {
stock = tmpList.get(0);
if (tmpList.size() != 1) {
System.out.println(stock.getStockCode());
}
}
i++;
if (i % 100 == 0) {
System.out.println(i + " " + count);
}
// 找一下类别
Category category = getCategory(str, baseCategory);
category = categoryMap.get(category.getCategoryName());
CategoryStock cs = new CategoryStock();
cs.setCategory(category);
cs.setStock(stock);
categoryStockService.save(cs);
}
System.out.println("------------------end");
}
public List<String> getContent(String filePath) {
TextFile textFile = new TextFile(filePath);
List<String> list = new ArrayList<String>();
for (String text : textFile) {
list.add(text);
}
return list;
}
public Category getCategory(String pair, BaseCategory base) {
String[] tokens = pair.trim().split(" ");
Category category = new Category();
category.setCategoryCategoryType(base.getType());
category.setCategoryName(tokens[2]);
category.setCategoryRank(1.0d);
return category;
}
public Stock getStockInfo(String pair) {
String[] tokens = null;
tokens = pair.trim().split(" ");
Stock stock = new Stock();
stock.setCreateTime(new Date());
stock.setUpdateTime(new Date());
stock.setStockAllCode(tokens[0]);
stock.setStockName(tokens[1]);
stock.setStockLocation(getLocation(tokens[0]));
stock.setStockCode(getCode(tokens[0]));
return stock;
}
public static String getLocation(String code) {
code = code.toLowerCase();
if (code.startsWith("sz")) {
return StockLocation.SZX.getLocation();
}
return StockLocation.SHA.getLocation();
}
public static String getCode(String code) {
code = code.toLowerCase();
code = code.replace("sz", "").replace("sh", "");
return code;
}
public static void main(String[] args) {
MoreStockInfoImporter importer = new MoreStockInfoImporter();
importer.importMetaInfo();
// importer.importXueqiuInfo();
}
}
| [
"jiangning.cui2@travelzen.com"
] | jiangning.cui2@travelzen.com |
76cf80281690885ba1407dda5639c049ad958d4d | fd77766788703190418fab5626f4fec39bf2a736 | /src/main/java/ge/kerketi/kpay/persistence/model/TblGroup.java | 8181ce56265ee58c49ed39af80b89a40460d1fdd | [] | no_license | akkerketi/k-pay | 68acc9b7afcf25c746e1d08579782af065a9bdec | b4a1d03c82834b81e09fb4bf089479eaafeae2b7 | refs/heads/master | 2022-12-27T19:18:36.418330 | 2020-10-07T06:08:40 | 2020-10-07T06:08:40 | 300,927,329 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 887 | java | package ge.kerketi.kpay.persistence.model;
import ge.kerketi.kpay.persistence.model.enums.GroupType;
import lombok.Data;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import javax.persistence.Table;
@Data
@Entity
@Table(name = "tbl_group")
public class TblGroup {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private long id;
@Column(name = "removed")
private boolean removed;
@Column(name = "name")
private String name;
@Column(name = "description")
private String description;
@Column(name = "group_type")
private GroupType groupType;
@OneToOne
private TblAccessSettings tblAccessSettings;
@OneToOne
private TblPermission tblPermission;
}
| [
"ak@kerketi.ge"
] | ak@kerketi.ge |
17a1159984476c2ebbc6d172a0acaf3e81e1ab7a | 7f7065e8d3a6b9a4b1dd5a56adbd8c8cdae956a4 | /src/main/java/ru/ssau/tk/pillank1/Kazakov_Practice/dataTypes/ConsoleOutputOfTypes.java | d9231742e6a8751c5e0d08b1589a84ff24d53191 | [] | no_license | pillank1/Kazakov_Practice | 4a98692d63956539ce19b5c0f6b6df316fabc49b | af10d4623b0e5f61525d5967d094b0dc923e89d3 | refs/heads/master | 2023-02-13T01:31:26.278631 | 2021-01-15T11:18:19 | 2021-01-15T11:18:19 | 295,716,703 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,033 | java | package ru.ssau.tk.pillank1.Kazakov_Practice.dataTypes;
public class ConsoleOutputOfTypes {
public static void printType(byte type) {
System.out.println("byte");
}
public static void printType(char type) {
System.out.println("char");
}
public static void printType(short type) {
System.out.println("short");
}
public static void printType(int type) {
System.out.println("int");
}
public static void printType(long type) {
System.out.println("long");
}
public static void printType(float type) {
System.out.println("float");
}
public static void printType(double type) {
System.out.println("double");
}
public static void printType(boolean type) {
System.out.println("boolean");
}
public static void printType(Object type) {
if (type == null) {
System.out.println("null");
} else {
System.out.println(type.getClass().getSimpleName());
}
}
}
| [
"nikita37pobeditel@mail.ru"
] | nikita37pobeditel@mail.ru |
798145918f82e5925b6eb7d708d7d4d289e20833 | fd4fe835d97778f8a6c597a7bdb80126d0c4e45b | /src/main/java/Shape.java | b1956576455bde071f97ae82470b4454d8298b27 | [] | no_license | mohan-13/ProcessingOOP | d2ebd5eb79e22930111414bc4fe8c8051aa00a9e | f9ed696b929580a6cea6093fe91fad9bf598bf53 | refs/heads/master | 2023-03-21T22:08:36.202467 | 2021-03-10T16:10:47 | 2021-03-10T16:10:47 | 341,786,541 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 120 | java | import processing.core.PApplet;
public interface Shape {
void moveLeftToRight();
void draw(PApplet pApplet);
}
| [
"mohankumar.t@thoughtworks.com"
] | mohankumar.t@thoughtworks.com |
6ca94879bb54252575f88d6dc64d52e14339c5bd | cbb9f3df4011ca7d611f38c5f8e9b2c41e450d3f | /src/main/java/br/com/guilhermealvessilve/jms/thread/JMSPriceThreadFactory.java | e6cbe72cbfc35d979b4e535685a68958419de65e | [] | no_license | guilherme-alves-silve/quarkus-messaging | 324dc8478b5a4bd812235d9f53d3189710b27c5a | 6ee8e84e197cb3c6cd45c754861012340a029e5d | refs/heads/master | 2022-10-18T00:24:27.883309 | 2020-06-15T20:05:39 | 2020-06-15T20:05:39 | 272,532,751 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 757 | java | package br.com.guilhermealvessilve.jms.thread;
import javax.enterprise.context.ApplicationScoped;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicLong;
@ApplicationScoped
public class JMSPriceThreadFactory implements ThreadFactory {
private static final AtomicInteger INCREMENT_THREAD_POOL = new AtomicInteger();
private final AtomicLong INCREMENT = new AtomicLong();
JMSPriceThreadFactory() {
INCREMENT_THREAD_POOL.incrementAndGet();
}
@Override
public Thread newThread(final Runnable runnable) {
return new Thread(runnable, "jms-" + INCREMENT.incrementAndGet() + "-thread-pool-" + INCREMENT_THREAD_POOL.intValue());
}
}
| [
"guilherme_alves_silve@hotmail.com"
] | guilherme_alves_silve@hotmail.com |
58e5695246d27622d1960a3f72eb46986b9557bc | f766baf255197dd4c1561ae6858a67ad23dcda68 | /app/src/main/java/com/tencent/b/a/a/o.java | 0805de151637f9bead5f6d0bed34a26249a08368 | [] | no_license | jianghan200/wxsrc6.6.7 | d83f3fbbb77235c7f2c8bc945fa3f09d9bac3849 | eb6c56587cfca596f8c7095b0854cbbc78254178 | refs/heads/master | 2020-03-19T23:40:49.532494 | 2018-06-12T06:00:50 | 2018-06-12T06:00:50 | 137,015,278 | 4 | 2 | null | null | null | null | UTF-8 | Java | false | false | 1,565 | java | package com.tencent.b.a.a;
import android.content.Context;
import android.provider.Settings.System;
public final class o
extends q
{
public o(Context paramContext)
{
super(paramContext);
}
protected final void a(a parama)
{
try
{
new StringBuilder("write CheckEntity to Settings.System:").append(parama.toString());
p.aG(this.context).u(s.decode("4kU71lN96TJUomD1vOU9lgj9U+kKmxDPLVM+zzjst5U="), parama.toString());
return;
}
finally {}
}
protected final String read()
{
try
{
String str = Settings.System.getString(this.context.getContentResolver(), s.decode("4kU71lN96TJUomD1vOU9lgj9Tw=="));
return str;
}
finally {}
}
protected final boolean tL()
{
return s.o(this.context, "android.permission.WRITE_SETTINGS");
}
protected final a tM()
{
try
{
a locala = new a(Settings.System.getString(this.context.getContentResolver(), s.decode("4kU71lN96TJUomD1vOU9lgj9U+kKmxDPLVM+zzjst5U=")));
new StringBuilder("read readCheckEntity from Settings.System:").append(locala.toString());
return locala;
}
finally {}
}
protected final void write(String paramString)
{
try
{
p.aG(this.context).u(s.decode("4kU71lN96TJUomD1vOU9lgj9Tw=="), paramString);
return;
}
finally {}
}
}
/* Location: /Users/Han/Desktop/wxall/微信反编译/反编译 6.6.7/dex2jar-2.0/classes2-dex2jar.jar!/com/tencent/b/a/a/o.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | [
"526687570@qq.com"
] | 526687570@qq.com |
148d94791dea302097b0c44a09f2d629ae652687 | 5aee2ea5477936af2a70037bb63003e750a9faa5 | /src/DesignPattern/Strategy/Duck/Behaviour/Diet/Diet.java | 76d5427483f92917ce58f56a63bda8b27d43b3e1 | [] | no_license | Will3x/Practise | d41203b2d79a054a15624d6d9c719cf938f323fb | 2dfb6b22da15d07396f7679a7563e9a37ad743c7 | refs/heads/master | 2020-04-27T18:08:37.791605 | 2019-03-29T16:56:09 | 2019-03-29T16:56:09 | 174,556,009 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 101 | java | package DesignPattern.Strategy.Duck.Behaviour.Diet;
public interface Diet {
String diet();
}
| [
"peppingw3@gmail.com"
] | peppingw3@gmail.com |
0b2e4d21d42ef6bea533cdb282e76a8c075c9505 | 942c58ef13d753466b0cfdc95689353b4c281991 | /src/com/robodogs/frc2018/commands/auto/DrivePastLine.java | e5b07e9e3127811a3d3bda5d8f8f8c9959644210 | [] | no_license | dsrasheed/FRC-2018-Robot | c0f3d4bf3c3c3fd6fa42a20c20e6c3c0e9187c24 | be411cc55d6d25bd34137d12dd060bb2f721d301 | refs/heads/master | 2021-09-12T20:01:20.987032 | 2018-04-20T12:11:37 | 2018-04-20T12:11:37 | 119,760,766 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,375 | java | package com.robodogs.frc2018.commands.auto;
import edu.wpi.first.wpilibj.command.Command;
import edu.wpi.first.wpilibj.Timer;
import com.robodogs.frc2018.Robot;
import com.robodogs.frc2018.subsystems.Drive.DriveSignal;
/**;
*
*/
public class DrivePastLine extends Command {
private double startTime;
public DrivePastLine() {
// Use requires() here to declare subsystem dependencies
// eg. requires(chassis);
requires(Robot.drive);
}
// Called just before this Command runs the first time
protected void initialize() {
startTime = Timer.getFPGATimestamp();
}
// Called repeatedly when this Command is scheduled to run
protected void execute() {
double currTime = Timer.getFPGATimestamp();
if (currTime - startTime >= 10) {
Robot.drive.set(new DriveSignal(0.75));
}
}
// Make this return true when this Command no longer needs to run execute()
protected boolean isFinished() {
return Timer.getFPGATimestamp() - startTime >= 12.5;
}
// Called once after isFinished returns true
protected void end() {
Robot.drive.set(DriveSignal.STOP);
}
// Called when another command which requires one or more of the same
// subsystems is scheduled to run
protected void interrupted() {
end();
}
}
| [
"xcub101@gmail.com"
] | xcub101@gmail.com |
14d35d33b11bd8469b9061c0313bc50bc167ccdb | 8e94005abdd35f998929b74c19a86b7203c3dbbc | /src/linkedin/tree/SymmetricTree.java | 42d6b068de9215d8383f2ec2cf417ba4c07d3d73 | [] | no_license | tinapgaara/leetcode | d1ced120da9ca74bfc1712c4f0c5541ec12cf980 | 8a93346e7476183ecc96065062da8585018b5a5b | refs/heads/master | 2020-12-11T09:41:39.468895 | 2018-04-24T07:15:27 | 2018-04-24T07:15:27 | 43,688,533 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,037 | java | package linkedin.tree;
import tree.TreeNode;
/**
* Created by yingtan on 11/19/17.
*
* 101. Symmetric Tree
DescriptionHintsSubmissionsDiscussSolution
Discuss Pick One
Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).
For example, this binary tree [1,2,2,3,4,4,3] is symmetric:
1
/ \
2 2
/ \ / \
3 4 4 3
But the following [1,2,2,null,3,null,3] is not:
1
/ \
2 2
\ \
3 3
*/
public class SymmetricTree {
public boolean isSymmetric(TreeNode root) {
if (root == null) return true;
return isSym(root.left, root.right);
}
public boolean isSym(TreeNode t1, TreeNode t2) {
if (t1 == null && t2 == null) return true;
if (t1 == null && t2 != null) return false;
if (t1 != null && t2 == null) return false;
if (t1 != null && t2 != null) {
if (t1.val == t2.val) {
return (isSym(t1.left, t2.right) && isSym(t1.right, t2.left));
}
}
return false;
}
}
| [
"ying.tan@oracle.com"
] | ying.tan@oracle.com |
c6d5067341e928de29d7431739574fbc618cc307 | a6edd768140cb32c23a54b0430f8a23a69b5f35b | /app/src/test/java/com/example/administrator/myapplication4/ExampleUnitTest.java | b9b501ded3382f4b00565b9544ebe28ed4f19de3 | [] | no_license | lijinpeople2333/myapp1 | 3a94b8c5be04e5a53337508e768897a4af7cb7d4 | 799553524b31311c5a1585faacf64f746de42522 | refs/heads/master | 2021-01-12T15:06:45.522268 | 2016-10-23T13:04:59 | 2016-10-23T13:04:59 | 71,703,294 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 333 | java | package com.example.administrator.myapplication4;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* To work on unit tests, switch the Test Artifact in the Build Variants view.
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
} | [
"273513249@qq.com"
] | 273513249@qq.com |
fb94efe98ceaed8f8daf07899c115952bc287dd0 | 8ca9069b8ee82f967791f4650d3e8cc16e1504f8 | /src/test/java/FLUserProfileCollectorTest.java | ae7e367f6595681f2e7ab57233f19d0966de3b56 | [] | no_license | a-pavlov/fantlab | de52871add375684521015b6b6741d1f00c89b3a | 9b7928c9f9e3af38c55efdc298231183cd9382bb | refs/heads/master | 2022-12-03T08:05:54.159611 | 2022-01-13T16:40:00 | 2022-01-13T16:40:00 | 120,786,968 | 1 | 0 | null | 2022-11-16T09:32:25 | 2018-02-08T16:31:02 | C++ | UTF-8 | Java | false | false | 4,503 | java | import lombok.extern.slf4j.Slf4j;
import org.fantlab.FLUserProfileCollector;
import org.junit.Test;
import java.util.regex.Matcher;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
/**
* Created by apavlov on 01.03.18.
*/
@Slf4j
public class FLUserProfileCollectorTest {
@Test
public void testMarksPattern() {
Matcher m = FLUserProfileCollector.markPattern.matcher("Оценок 8");
assertTrue(m.find());
assertEquals("8", m.group("d1"));
}
@Test
public void testRecalls() {
Matcher m1 = FLUserProfileCollector.recallPattern.matcher("Отзывов 94 | баллы за отзывы: 635");
Matcher m2 = FLUserProfileCollector.recallPattern.matcher("Отзывов 33");
assertTrue(m1.find());
assertTrue(m2.find());
assertEquals("94", m1.group("d1"));
assertEquals("635", m1.group("d2"));
assertEquals("33", m2.group("d1"));
assertEquals(null, m2.group("d2"));
Matcher m3 = FLUserProfileCollector.recallPattern.matcher("Личных книжных полок 8");
assertFalse(m3.find());
}
@Test
public void testAnnotationPattern() {
Matcher m = FLUserProfileCollector.annotationPattern.matcher("Аннотаций 9098");
assertTrue(m.find());
assertEquals("9098", m.group("d1"));
}
@Test
public void testClassPattern() {
Matcher m = FLUserProfileCollector.classPattern.matcher("Классифицировано произведений 105");
assertTrue(m.find());
assertEquals("105", m.group("d1"));
}
@Test
public void testMsgPattern() {
Matcher m = FLUserProfileCollector.fmsgPattern.matcher("Сообщений в форуме 7881");
assertTrue(m.find());
assertEquals("7881", m.group("d1"));
}
@Test
public void testNewThemesPattern() {
Matcher m = FLUserProfileCollector.newThemesPattern.matcher("Новых тем в форуме 249");
assertTrue(m.find());
assertEquals("249", m.group("d1"));
}
@Test
public void testSurveyPattern() {
Matcher m = FLUserProfileCollector.surveyPattern.matcher("Новых опросов в форуме 13");
assertTrue(m.find());
assertEquals("13", m.group("d1"));
}
@Test
public void testShelfPatterns() {
Matcher m = FLUserProfileCollector.shelfPattern.matcher("Личных книжных полок 8");
assertTrue(m.find());
assertEquals("8", m.group("d1"));
}
@Test
public void testDataExtraction() {
FLUserProfileCollector collector = new FLUserProfileCollector(null, null);
collector.extractDataFromString("");
collector.extractDataFromString("Пол мужской");
collector.extractDataFromString("День рождения 6 мая 1981 г.");
collector.extractDataFromString("Место жительства Россия, Самара");
collector.extractDataFromString("Skype crealist");
collector.extractDataFromString("Домашняя страница http://fantlab.ru");
collector.extractDataFromString("Дата регистрации 2004-07-17 22:11:01");
collector.extractDataFromString("Последнее посещение 2018-03-01 07:59:12");
collector.extractDataFromString("Класс философ");
collector.extractDataFromString("Развитие в классе 3868.54 из 4000");
collector.extractDataFromString("Оценок 313");
collector.extractDataFromString("Отзывов 94 | баллы за отзывы: 635");
collector.extractDataFromString("Аннотаций 118");
collector.extractDataFromString("Классифицировано произведений 105");
collector.extractDataFromString("Заявок 68");
collector.extractDataFromString("Сообщений в форуме 7881");
collector.extractDataFromString("Новых тем в форуме 249");
collector.extractDataFromString("Новых опросов в форуме 13");
collector.extractDataFromString("Личных книжных полок 8");
assertEquals(new FLUserProfileCollector.UserData(313, 94, 635, 118, 68, 105, 7881, 249, 13, 8), collector.getUserData());
}
}
| [
"intser79@gmail.com"
] | intser79@gmail.com |
5d54f1326a3b827f60c76547d19cf13259441cfa | 4289a563563523ea12c7d5a6a6f1224ef185ea15 | /src/level_011_RainbowOfClarity/E_050_chessKnight.java | 012dbcd69c2c1a41e6cb47d4c776fb313b3c57ab | [] | no_license | nguyenlehai/CodeSignalSolution | a7c1c0b7c96c267bd3e10ba411f65d9966b52f8b | dd273a77d5827020c63e5b0f48aca4eefb631934 | refs/heads/master | 2022-11-12T19:05:19.812268 | 2020-07-08T10:14:24 | 2020-07-08T10:14:24 | 274,824,262 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,140 | java | package level_011_RainbowOfClarity;
public class E_050_chessKnight {
/*
Given a position of a knight on the standard chessboard, find the number of different moves the knight can perform.
The knight can move to a square that is two squares horizontally and one square vertically,
or two squares vertically and one square horizontally away from it.
The complete move therefore looks like the letter L.
Check out the image below to see all valid moves for a knight piece that is placed on one of the central squares.
Photo: img/knight.jpg
----------------------
Example:
For cell = "a1", the output should be
chessKnight(cell) = 2.
Photo: img/ex_1.jpg
For cell = "c2", the output should be
chessKnight(cell) = 6.
Photo: img/ex_2.jpg
*/
public int chessKnight(String cell) {
int count = 8;
if (cell.charAt(0) == 'b' || cell.charAt(0) == 'g') {
count = count - 2;
}
if (cell.charAt(1) == '2' || cell.charAt(1) == '7') {
count = count - 2;
}
if (cell.charAt(0) == 'a' || cell.charAt(0) == 'h') {
count = count / 2;
}
if (cell.charAt(1) == '1' || cell.charAt(1) == '8') {
count = count / 2;
}
return count;
}
}
| [
"nguyenlehai@hotmail.com"
] | nguyenlehai@hotmail.com |
05abf738f2742cd595b6f46a61a86e8372358d63 | 16021fba8068e54dbeac92395a1d1848d588a80f | /src/main/java/gpstudy/factory/demo1/Div.java | 4d4f2c61dc64e4ca14d6d510540522ff7928fddd | [] | no_license | xuxiaoruirui/demo | 1cfb6348110f80b86af1e484c68f51698c1327ed | 7de0c7563d63803ded7a4f65c90748dfb97d1e4f | refs/heads/master | 2022-06-27T10:27:08.038615 | 2021-08-16T09:09:02 | 2021-08-16T09:09:02 | 229,669,253 | 0 | 0 | null | 2022-06-17T03:35:06 | 2019-12-23T03:25:06 | Java | UTF-8 | Java | false | false | 187 | java | package gpstudy.factory.demo1;
import factory.demo1.Operation;
public class Div extends Operation{
@Override
public double getResult() {
return numberA/numberB;
}
}
| [
"rui.xu@gshopper.com"
] | rui.xu@gshopper.com |
7c29f8846572c784550fd0515865dcfa8d8d18bb | 88a44d178eb0786dfa684ea309596c1f9dcf1c6d | /gemfire/src/main/java/com/TestMain.java | 314d061fe1249b76ab2f5ea3c13111652fc37e7c | [] | no_license | rajiv0903/Java | d77ccb07abbc78f42a9dad16b98db4828afa1829 | 46d99461c9da196a7e91b79ee430c6e9bbf7ae25 | refs/heads/master | 2021-05-07T01:01:26.127786 | 2018-01-15T18:54:16 | 2018-01-15T18:54:16 | 110,309,670 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 844 | java | package com;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
public class TestMain {
public static void main(String[] args) throws Exception{
//1510976648280
//1510976664925
System.out.println(System.currentTimeMillis());
long prev = 1510976648280L;
Thread.sleep(2000L);
long curr = System.currentTimeMillis();
long diff = curr - prev;
System.out.println((int) (diff/(1000*60*60)));
long millisSinceEpoch = LocalDateTime.parse("2017/11/19 18:10:45", DateTimeFormatter.ofPattern("uuuu/MM/dd HH:mm:ss"))
.atZone(ZoneId.of("Etc/GMT-5"))
.toInstant()
.toEpochMilli();
System.out.println(ZoneId.getAvailableZoneIds());
diff = millisSinceEpoch - prev;
System.out.println((int) (diff/(1000*60*60)));
}
}
| [
"rajiv.juprod@gmail.com"
] | rajiv.juprod@gmail.com |
54d58d0df0b40068dd9ebddaa38be1f855dea1d0 | 333142e77e2223c6e4d075c6b6a23f91a8daaa2c | /allcod/SE1/src/FemtoParser.java | f637ff5d824d4ffb12697e7c8f1c4983bd5eca64 | [] | no_license | HatemOrhoma/GameOL | 211c08e009d2ec3acee73f6e82cbbf85eb180386 | fc3938a68720622a13bdc62fd0c8bfb95b0e2568 | refs/heads/master | 2023-08-14T07:17:49.465494 | 2021-10-14T15:50:03 | 2021-10-14T15:50:03 | 207,632,948 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 870 | java |
public class FemtoParser extends Parser {
void Programm() {
VereinbarungsListe();
accept(print);
Ausdruck();
accept(semikolon);
}
void VereinbarungsListe(){
if (nextIs(typeInt)){
WertVereinbarung();
VereinbarungsListe();
}
else {
}
}
void WertVereinbarung(){
accept(typeInt);
accept(bezeichner);
accept(gleich);
Ausdruck();
accept(semikolon);
}
void Ausdruck(){
if (nextIs(bezeichner)) {
accept(bezeichner);
}
else if (nextIs(zahl)) {
accept(zahl);
}
else {
accept(klammerAuf);
Ausdruck();
Operator();
Ausdruck();
accept(klammerZu);
}
}
void Operator(){
if(nextIs(plus)){
accept(plus);
}
else {
accept(mult);
}
}
public static void main(String[] args) {
FemtoParser p = new FemtoParser();
p.Programm();
p.ende();
}
} | [
"hatemorhoma96@gmail.com"
] | hatemorhoma96@gmail.com |
c1d81fa0aa47cc7034a6efc40377d9addb9236ae | ed7a427ae45cea0585484faf03acc9766776cc58 | /src/factory_af/RedPepper.java | 87cc393a806d830e11d646ad9562e5f71d938e26 | [] | no_license | so0choi/DesignPattern | d3030c555e017ce68cb466c6fc23f742e28e900a | cd7eac06945317836aaaa6840f13f2c61be948c1 | refs/heads/master | 2022-12-03T13:52:25.098526 | 2020-08-24T04:43:56 | 2020-08-24T04:43:56 | 262,072,092 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 121 | java | package factory_af;
public class RedPepper implements Veggies {
public String toString() {
return "Red Pepper";
}
}
| [
"simc2644@gmail.com"
] | simc2644@gmail.com |
ebbd9b30596b35868a7e9b3594ad359e9a18d9d8 | e43d5e2445c1679421218a5261b72faba052a648 | /JavaRushTasks/1.JavaSyntax/src/com/javarush/task/task06/task0618/Solution.java | 9222cd62eee2a7e48a1d9aaa03870c83d07415a4 | [] | no_license | SokolY/javarush2020 | a008087efe2c21f79905e2c55129e69063d3adf1 | e8c780605357b8c8c5359a4b64439a76a3a85fd5 | refs/heads/master | 2023-08-03T14:05:40.500475 | 2021-10-06T17:14:14 | 2021-10-06T17:14:14 | 291,798,788 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 355 | java | package com.javarush.task.task06.task0618;
/*
KissMyShinyMetalAss
*/
public class Solution {
public static class KissMyShinyMetalAss
{
}
public static void main(String[] args) {
//напишите тут ваш код
KissMyShinyMetalAss bender = new KissMyShinyMetalAss();
System.out.println(bender);
}
}
| [
"yura.sokol@gmail.com"
] | yura.sokol@gmail.com |
d32c7bd1e38e0608e9145017f071df417378986c | fdcad577e09a7411e4e86692251c89fd7a66adc3 | /src/test/java/javatrDay1/task5/logic/Logic5Test.java | 561238bc34614fc3a8dcbf41fd94d5c7e5e8b9b3 | [] | no_license | OSmol/ProjectAndrievich | 50e05e89c7b38b365005c5656f866bde30ac8506 | 0cbc62665ebdfb699c5f6f75e19489b2519a10e2 | refs/heads/master | 2021-01-14T19:26:19.200156 | 2020-02-24T14:03:33 | 2020-02-24T14:03:33 | 242,728,522 | 0 | 0 | null | 2020-02-24T12:18:08 | 2020-02-24T12:18:07 | null | UTF-8 | Java | false | false | 433 | java | package javatrDay1.task5.logic;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
class Logic5Test {
@Test
void findDividersOfNumberAndSum() {
assertTrue(Logic5.findDividersOfNumberAndSum(6));
assertFalse(Logic5.findDividersOfNumberAndSum(22));
assertFalse(Logic5.findDividersOfNumberAndSum(-6));
assertTrue(Logic5.findDividersOfNumberAndSum(0));
}
} | [
"tatsiana.andryievich@gmail.com"
] | tatsiana.andryievich@gmail.com |
0d31ae22e503ac375c4e093753518b221b85d274 | d548d9f562386c689838938406b4bb9756ebc819 | /tianhe-netty/src/main/java/com/tianhe/framework/netty/online/client/Main.java | cac6f2d26838ffdf3b8e68d8675e906b53f8bd02 | [] | no_license | frametianhe/tianhe-framework | 049392677e7532f2845d3cd57e421e03e423a94f | ed4fec0da86848bc45e3e3c2ac7077c575e7a7b4 | refs/heads/master | 2023-02-20T11:19:40.718464 | 2021-01-25T07:59:17 | 2021-01-25T07:59:17 | 327,812,312 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 627 | java | package com.tianhe.framework.netty.online.client;
/**
* Created by weifeng.jiang on 2017-11-03 10:35.
*/
public class Main {
public static void main(String[] args) throws Exception{
DefaultTestServiceChannel handler = new DefaultTestServiceChannel();
ChannelInfo channelInfo = new ChannelInfo();
channelInfo.setFrontIp("127.0.0.1");
channelInfo.setFrontPort("8084");
channelInfo.setUrl("/demo");
TestChannelHandler serviceHandler = new TestChannelHandler(channelInfo);
handler.setChannelInfo(channelInfo);
handler.service("hello",serviceHandler);
}
}
| [
"jiangweifeng@didichuxing.com"
] | jiangweifeng@didichuxing.com |
ac2fec6169975faaa9ca3bc18182e0c0f893022f | fdd0a024fd9f5203b32ba0592c50111bf4c8cdd0 | /aboo/src/main/java/com/kh/aboo/admin/schedule/model/service/impl/ScheduleServiceImpl.java | b939f3e843235de10c83868d203c9834f674fea2 | [] | no_license | season91/aboo | eaeae597ea652c639424ed2fbc2c40272fd191d5 | debdd357a44f43b951466cedd42766d830020230 | refs/heads/main | 2023-06-07T00:33:05.761606 | 2021-06-22T11:54:33 | 2021-06-22T11:54:33 | 350,609,378 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,289 | java | package com.kh.aboo.admin.schedule.model.service.impl;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.stereotype.Service;
import com.kh.aboo.admin.schedule.model.repository.ScheduleRepository;
import com.kh.aboo.admin.schedule.model.service.ScheduleService;
import com.kh.aboo.admin.schedule.model.vo.Schedule;
import com.kh.aboo.common.util.paging.Paging;
import com.kh.aboo.user.generation.model.vo.Generation;
@Service
public class ScheduleServiceImpl implements ScheduleService{
private final ScheduleRepository scheduleRepository;
public ScheduleServiceImpl(ScheduleRepository scheduleRepository) {
this.scheduleRepository = scheduleRepository;
}
@Override
public int insertSchedule(Schedule schedule) {
return scheduleRepository.insertSchedule(schedule);
}
@Override
public Map<String, Object> selectScheduleList(int currentPage,String apartmentIdx, String standard, String keyword) {
Map<String, Object> searchMap = new HashMap<String, Object>();
searchMap.put("apartmentIdx", apartmentIdx);
searchMap.put("searchType", standard);
searchMap.put("keyword", keyword);
Paging paging = Paging.builder()
.currentPage(currentPage)
.blockCnt(5)
.cntPerPage(10)
.type("schedule")
.total(scheduleRepository.selectScheduleCnt(searchMap))
.build();
System.out.println(paging.toString());
searchMap.put("paging", paging);
searchMap.put("schedule", scheduleRepository.selectScheduleList(searchMap));
return searchMap;
}
@Override
public String selectAptNameByIdx(String apartmentIdx) {
String aptName = scheduleRepository.selectAptNameByIdx(apartmentIdx);
return aptName;
}
@Override
public int updateSchedule(Schedule schedule) {
return scheduleRepository.updateSchedule(schedule);
}
@Override
public int deleteSchedule(String scheduleIdx) {
return scheduleRepository.deleteSchedule(scheduleIdx);
}
@Override
public List<Schedule> selectScheduleByMonth(String apartmentIdx) {
return scheduleRepository.selectScheduleByMonth(apartmentIdx);
}
@Override
public List<Schedule> selectScheduleListForCalendar(String apartmentIdx) {
return scheduleRepository.selectScheduleListForCalendar(apartmentIdx);
}
}
| [
"76516455+IMHEEWON@users.noreply.github.com"
] | 76516455+IMHEEWON@users.noreply.github.com |
f27f6dfb640fe846cbff9fbce0876b7b4e7c498d | cc52669589f3d610272ecd48115614ce32af619d | /TwitVid/src/com/videotweet/DBConnection.java | bfb68268aa36ed530a276f582edd12f51e0009a6 | [] | no_license | selvadinesh/cloud_assign_1 | 0f2489c0803daeae70cb68862127d324cea755fa | 948fa2448f61ee386c56cb28f94b392a31c5018b | refs/heads/master | 2021-01-19T06:31:08.841788 | 2014-03-17T02:41:39 | 2014-03-17T02:41:39 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 584 | java | package com.videotweet;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
public class DBConnection {
public static Connection openConnection() throws ClassNotFoundException, SQLException{
String myDriver = "com.mysql.jdbc.Driver";
String myUrl = "jdbc:mysql://tweetvideousers.cngwtgfvvaab.us-west-2.rds.amazonaws.com:3306/TweetVideo";
Class.forName(myDriver);
Connection conn = DriverManager.getConnection(myUrl, "vthallam", "Steve123");
System.out.print("Connection created");
return conn;
}
}
| [
"sdt279@nyu.edu"
] | sdt279@nyu.edu |
27663d433430cc93ed5981643bd1a4c924cddbea | 410fb585f1df066579ea640982ce6994a7deadf2 | /src/main/java/com/bachngo/socialmediaprj/service/FriendConnectionService.java | 96df2f02ac7cd95b303267e457c1259f35ba8a0d | [] | no_license | BachNgoH/spring-boot-social-media-app | 24780def3ff97f185dd8ec3bd2962a187a71b252 | ac83bdb879dd7c4e53d577eb5683b6bfc0531fec | refs/heads/master | 2023-07-07T05:52:59.861941 | 2021-08-05T06:12:01 | 2021-08-05T06:12:01 | 383,707,316 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,470 | java | package com.bachngo.socialmediaprj.service;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import org.springframework.stereotype.Service;
import com.bachngo.socialmediaprj.dto.AppUserResponse;
import com.bachngo.socialmediaprj.dto.ConnectionResponse;
import com.bachngo.socialmediaprj.models.AppUser;
import com.bachngo.socialmediaprj.models.FriendConnection;
import com.bachngo.socialmediaprj.repository.AppUserRepository;
import com.bachngo.socialmediaprj.repository.FriendConnectionRepository;
import lombok.AllArgsConstructor;
/**
* service for friend connection
* @author Bach
*
*/
@Service
@AllArgsConstructor
public class FriendConnectionService {
private final FriendConnectionRepository friendConnectionRepository;
private final AppUserDetailsService appUserDetailsService;
private final AppUserRepository appUserRepository;
private final ChatService chatService;
public void sendFriendRequest(Long requestdeeId) {
AppUser requestdee = appUserRepository.findById(requestdeeId)
.orElseThrow(() -> new IllegalStateException("User not Found"));
AppUser requestder = appUserDetailsService.getCurrentUser();
if(requestder.getId().equals(requestdee.getId())) {
throw new IllegalStateException("You can't send request to yourself");
}
Optional<FriendConnection> connection =
friendConnectionRepository.findByRequestderAndRequestdee(requestder, requestdee);
Optional<FriendConnection> connectionReverse =
friendConnectionRepository.findByRequestderAndRequestdee(requestdee, requestder);
if(connection.isPresent() || connectionReverse.isPresent()) {
throw new IllegalStateException("Connection already formed");
}
FriendConnection newConnection = FriendConnection.builder().requestdee(requestdee)
.requestder(requestder).build();
friendConnectionRepository.save(newConnection);
}
public void sendAcceptRequest(Long requestderId) {
AppUser requestder = appUserRepository.findById(requestderId)
.orElseThrow(() -> new IllegalStateException("User not Found"));
AppUser requestdee = appUserDetailsService.getCurrentUser();
FriendConnection connection =
friendConnectionRepository.findByRequestderAndRequestdee(requestder, requestdee)
.orElseThrow(() -> new IllegalStateException("Connection Not Found!"));
connection.setAccepted(true);
friendConnectionRepository.save(connection);
chatService.createNewChatBox(requestderId);
}
public void sendUnfriendRequest(Long requestdeeId) {
AppUser requestder = appUserRepository.findById(requestdeeId)
.orElseThrow(() -> new IllegalStateException("User not Found"));
AppUser requestdee = appUserDetailsService.getCurrentUser();
Optional<FriendConnection> connection =
friendConnectionRepository.findByRequestderAndRequestdee(requestder, requestdee);
Optional<FriendConnection> connectionReverse =
friendConnectionRepository.findByRequestderAndRequestdee(requestdee, requestder);
if(connection.isPresent()) {
friendConnectionRepository.delete(connection.get());
}
if(connectionReverse.isPresent()) {
friendConnectionRepository.delete(connectionReverse.get());
}
}
public ConnectionResponse findConnection(Long userId) {
AppUser currentUser = appUserDetailsService.getCurrentUser();
AppUser user = appUserRepository.findById(userId)
.orElseThrow(() -> new IllegalStateException("user not found"));
Optional<FriendConnection> connectionOptional =
friendConnectionRepository.findByRequestderAndRequestdee(currentUser, user);
Optional<FriendConnection> connectionOptional2 =
friendConnectionRepository.findByRequestderAndRequestdee(user, currentUser);
if(currentUser.getId() == user.getId()) {
return new ConnectionResponse("SELF");
}
if(connectionOptional.isPresent()) {
FriendConnection connection = connectionOptional.get();
if(connection.isAccepted()) {
return new ConnectionResponse("FRIEND");
}else {
return new ConnectionResponse("REQUESTED");
}
}
if(connectionOptional2.isPresent()) {
FriendConnection connection = connectionOptional2.get();
if(connection.isAccepted()) {
return new ConnectionResponse("FRIEND");
}else {
return new ConnectionResponse("REQUESTED");
}
}
return new ConnectionResponse("NO CONNECTION");
}
public List<AppUserResponse> findAllFriendsOfUser() {
AppUser currentUser = appUserDetailsService.getCurrentUser();
List<FriendConnection> connections = friendConnectionRepository
.findAllByRequestderAndAccepted(currentUser, true);
List<FriendConnection> connectionsReversed = friendConnectionRepository
.findAllByRequestdeeAndAccepted(currentUser, true);
List<AppUser> friends = new ArrayList<AppUser>();
for(FriendConnection connection: connections) {
friends.add(connection.getRequestdee());
}
for(FriendConnection connection: connectionsReversed) {
friends.add(connection.getRequestder());
}
List<AppUserResponse> responses = new ArrayList<AppUserResponse>();
for(AppUser friend: friends) {
responses.add(AppUserResponse.builder()
.lastName(friend.getLastName()).firstName(friend.getFirstName())
.userId(friend.getId()).build());
}
return responses;
}
public List<AppUser> findAllFriendsOfUserInternal(){
AppUser currentUser = appUserDetailsService.getCurrentUser();
List<FriendConnection> connections = friendConnectionRepository
.findAllByRequestderAndAccepted(currentUser, true);
List<FriendConnection> connectionsReversed = friendConnectionRepository
.findAllByRequestdeeAndAccepted(currentUser, true);
List<AppUser> friends = new ArrayList<AppUser>();
for(FriendConnection connection: connections) {
friends.add(connection.getRequestdee());
}
for(FriendConnection connection: connectionsReversed) {
friends.add(connection.getRequestder());
}
return friends;
}
public List<AppUserResponse> findAllRequestOfUser() {
AppUser currentUser = appUserDetailsService.getCurrentUser();
List<FriendConnection> connectionsReversed = friendConnectionRepository
.findAllByRequestdeeAndAccepted(currentUser, false);
List<AppUserResponse> responses = new ArrayList<AppUserResponse>();
for(FriendConnection connection: connectionsReversed) {
AppUser friend = connection.getRequestder();
responses.add(AppUserResponse.builder().firstName(friend.getFirstName())
.lastName(friend.getLastName()).userId(friend.getId()).build());
}
return responses;
}
}
| [
"nlmbao2015@gmail.com"
] | nlmbao2015@gmail.com |
f267a139d03772dd846136c1c97fc901509bf334 | 8ef2cecd392f43cc670ae8c6f149be6d71d737ba | /src/com/google/common/collect/RegularImmutableMap$1.java | 60e8bc458c30f7dcdd2fc2ebb5af6424820cb8c3 | [] | 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 | 549 | java | package com.google.common.collect;
class RegularImmutableMap$1
extends ImmutableMapKeySet<K, V>
{
RegularImmutableMap$1(RegularImmutableMap paramRegularImmutableMap, ImmutableSet paramImmutableSet, int paramInt)
{
super(paramImmutableSet, paramInt);
}
ImmutableMap<K, V> c()
{
return this.a;
}
}
/* Location: C:\DISKD\fishfinder\apktool-install-windows-r05-ibot\classes_dex2jar.jar
* Qualified Name: com.google.common.collect.RegularImmutableMap.1
* JD-Core Version: 0.7.0.1
*/ | [
"bjtu2010@hotmail.com"
] | bjtu2010@hotmail.com |
6649c821a187464f31bbe4513ac5b9f1355e2faa | 2e34de505149e801f39e6778470252edbaa7ee06 | /Armory/src/java/servlets/SearchCharacters.java | 2d5b1966090af6322765ab397439d55f0986eaeb | [] | no_license | willian-gouveia/Prog4Project | 0ec30e1a75c8bc5ad588f94d093253a5545e5d03 | 3c822d024106b88b5446763b3ebb18402cb59e8c | refs/heads/master | 2022-05-01T09:53:59.761716 | 2015-01-26T21:52:05 | 2015-01-26T21:52:05 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,857 | 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 servlets;
import DAL.Character;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
*
* @author LanceDH
*/
@WebServlet(name = "SearchCharacters", urlPatterns = {"/Search"})
public class SearchCharacters extends HttpServlet {
/**
* Processes requests for both HTTP <code>GET</code> and <code>POST</code>
* methods.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
String search = request.getParameter("search");
ArrayList<DAL.Character> chars = Services.CharacterServices.GetCharactersLike(search);
request.getSession().setAttribute("Characters", chars);
RequestDispatcher dispatcher = request.getRequestDispatcher("Search.jsp");
dispatcher.forward(request, response);
}
// <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">
/**
* Handles the HTTP <code>GET</code> method.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
}
/**
* Handles the HTTP <code>POST</code> method.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
}
/**
* Returns a short description of the servlet.
*
* @return a String containing servlet description
*/
@Override
public String getServletInfo() {
return "Short description";
}// </editor-fold>
}
| [
"kiep_out@hotmail.com"
] | kiep_out@hotmail.com |
5d80a57f0ef9f2d42a904e95e923773e5aee799b | 8831a51eaf07c76482c7dbc5ff2fb987849c2b29 | /build/app/generated/not_namespaced_r_class_sources/debug/processDebugResources/r/com/renan/bem_aventurancas/R.java | bb3a6eb075301e403df22707220929122e910622 | [] | no_license | renanamr/AppCrismando | 72ef2fa78f1efbe3806c49f345a7f354d73cf1ef | d4d41e9d2f97f46b95eeb995bbb1677434fb6e90 | refs/heads/master | 2021-04-24T03:32:13.717844 | 2020-04-02T10:00:26 | 2020-04-02T10:00:26 | 250,068,115 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 72,582 | java | /* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* aapt tool from the resource data it found. It
* should not be modified by hand.
*/
package com.renan.bem_aventurancas;
public final class R {
public static final class attr {
/**
* Alpha multiplier applied to the base color.
* <p>May be a floating point value, such as "<code>1.2</code>".
*/
public static final int alpha=0x7f010000;
/**
* <p>May be a reference to another resource, in the form
* "<code>@[+][<i>package</i>:]<i>type</i>/<i>name</i></code>" or a theme
* attribute in the form
* "<code>?[<i>package</i>:]<i>type</i>/<i>name</i></code>".
* <p>Must be one of the following constant values.</p>
* <table>
* <colgroup align="left" />
* <colgroup align="left" />
* <colgroup align="left" />
* <tr><th>Constant</th><th>Value</th><th>Description</th></tr>
* <tr><td>icon_only</td><td>2</td><td></td></tr>
* <tr><td>standard</td><td>0</td><td></td></tr>
* <tr><td>wide</td><td>1</td><td></td></tr>
* </table>
*/
public static final int buttonSize=0x7f010001;
/**
* <p>May be a boolean value, such as "<code>true</code>" or
* "<code>false</code>".
*/
public static final int circleCrop=0x7f010002;
/**
* <p>May be a reference to another resource, in the form
* "<code>@[+][<i>package</i>:]<i>type</i>/<i>name</i></code>" or a theme
* attribute in the form
* "<code>?[<i>package</i>:]<i>type</i>/<i>name</i></code>".
* <p>Must be one of the following constant values.</p>
* <table>
* <colgroup align="left" />
* <colgroup align="left" />
* <colgroup align="left" />
* <tr><th>Constant</th><th>Value</th><th>Description</th></tr>
* <tr><td>auto</td><td>2</td><td></td></tr>
* <tr><td>dark</td><td>0</td><td></td></tr>
* <tr><td>light</td><td>1</td><td></td></tr>
* </table>
*/
public static final int colorScheme=0x7f010003;
/**
* <p>May be a reference to another resource, in the form
* "<code>@[+][<i>package</i>:]<i>type</i>/<i>name</i></code>" or a theme
* attribute in the form
* "<code>?[<i>package</i>:]<i>type</i>/<i>name</i></code>".
*/
public static final int coordinatorLayoutStyle=0x7f010004;
/**
* The reference to the font file to be used. This should be a file in the res/font folder
* and should therefore have an R reference value. E.g. @font/myfont
* <p>May be a reference to another resource, in the form
* "<code>@[+][<i>package</i>:]<i>type</i>/<i>name</i></code>" or a theme
* attribute in the form
* "<code>?[<i>package</i>:]<i>type</i>/<i>name</i></code>".
*/
public static final int font=0x7f010005;
/**
* The authority of the Font Provider to be used for the request.
* <p>May be a string value, using '\\;' to escape characters such as
* '\\n' or '\\uxxxx' for a unicode character;
*/
public static final int fontProviderAuthority=0x7f010006;
/**
* The sets of hashes for the certificates the provider should be signed with. This is
* used to verify the identity of the provider, and is only required if the provider is not
* part of the system image. This value may point to one list or a list of lists, where each
* individual list represents one collection of signature hashes. Refer to your font provider's
* documentation for these values.
* <p>May be a reference to another resource, in the form
* "<code>@[+][<i>package</i>:]<i>type</i>/<i>name</i></code>" or a theme
* attribute in the form
* "<code>?[<i>package</i>:]<i>type</i>/<i>name</i></code>".
*/
public static final int fontProviderCerts=0x7f010007;
/**
* The strategy to be used when fetching font data from a font provider in XML layouts.
* This attribute is ignored when the resource is loaded from code, as it is equivalent to the
* choice of API between {@link
* androidx.core.content.res.ResourcesCompat#getFont(Context, int)} (blocking) and
* {@link
* androidx.core.content.res.ResourcesCompat#getFont(Context, int, FontCallback, Handler)}
* (async).
* <p>Must be one of the following constant values.</p>
* <table>
* <colgroup align="left" />
* <colgroup align="left" />
* <colgroup align="left" />
* <tr><th>Constant</th><th>Value</th><th>Description</th></tr>
* <tr><td>async</td><td>1</td><td>The async font fetch works as follows.
* First, check the local cache, then if the requeted font is not cached, trigger a
* request the font and continue with layout inflation. Once the font fetch succeeds, the
* target text view will be refreshed with the downloaded font data. The
* fontProviderFetchTimeout will be ignored if async loading is specified.</td></tr>
* <tr><td>blocking</td><td>0</td><td>The blocking font fetch works as follows.
* First, check the local cache, then if the requested font is not cached, request the
* font from the provider and wait until it is finished. You can change the length of
* the timeout by modifying fontProviderFetchTimeout. If the timeout happens, the
* default typeface will be used instead.</td></tr>
* </table>
*/
public static final int fontProviderFetchStrategy=0x7f010008;
/**
* The length of the timeout during fetching.
* <p>May be an integer value, such as "<code>100</code>".
* <p>Must be one of the following constant values.</p>
* <table>
* <colgroup align="left" />
* <colgroup align="left" />
* <colgroup align="left" />
* <tr><th>Constant</th><th>Value</th><th>Description</th></tr>
* <tr><td>forever</td><td>ffffffff</td><td>A special value for the timeout. In this case, the blocking font fetching will not
* timeout and wait until a reply is received from the font provider.</td></tr>
* </table>
*/
public static final int fontProviderFetchTimeout=0x7f010009;
/**
* The package for the Font Provider to be used for the request. This is used to verify
* the identity of the provider.
* <p>May be a string value, using '\\;' to escape characters such as
* '\\n' or '\\uxxxx' for a unicode character;
*/
public static final int fontProviderPackage=0x7f01000a;
/**
* The query to be sent over to the provider. Refer to your font provider's documentation
* on the format of this string.
* <p>May be a string value, using '\\;' to escape characters such as
* '\\n' or '\\uxxxx' for a unicode character;
*/
public static final int fontProviderQuery=0x7f01000b;
/**
* The style of the given font file. This will be used when the font is being loaded into
* the font stack and will override any style information in the font's header tables. If
* unspecified, the value in the font's header tables will be used.
* <p>Must be one of the following constant values.</p>
* <table>
* <colgroup align="left" />
* <colgroup align="left" />
* <colgroup align="left" />
* <tr><th>Constant</th><th>Value</th><th>Description</th></tr>
* <tr><td>italic</td><td>1</td><td></td></tr>
* <tr><td>normal</td><td>0</td><td></td></tr>
* </table>
*/
public static final int fontStyle=0x7f01000c;
/**
* The variation settings to be applied to the font. The string should be in the following
* format: "'tag1' value1, 'tag2' value2, ...". If the default variation settings should be
* used, or the font used does not support variation settings, this attribute needs not be
* specified.
* <p>May be a string value, using '\\;' to escape characters such as
* '\\n' or '\\uxxxx' for a unicode character;
*/
public static final int fontVariationSettings=0x7f01000d;
/**
* The weight of the given font file. This will be used when the font is being loaded into
* the font stack and will override any weight information in the font's header tables. Must
* be a positive number, a multiple of 100, and between 100 and 900, inclusive. The most
* common values are 400 for regular weight and 700 for bold weight. If unspecified, the value
* in the font's header tables will be used.
* <p>May be an integer value, such as "<code>100</code>".
*/
public static final int fontWeight=0x7f01000e;
/**
* <p>May be a floating point value, such as "<code>1.2</code>".
*/
public static final int imageAspectRatio=0x7f01000f;
/**
* <p>Must be one of the following constant values.</p>
* <table>
* <colgroup align="left" />
* <colgroup align="left" />
* <colgroup align="left" />
* <tr><th>Constant</th><th>Value</th><th>Description</th></tr>
* <tr><td>adjust_height</td><td>2</td><td></td></tr>
* <tr><td>adjust_width</td><td>1</td><td></td></tr>
* <tr><td>none</td><td>0</td><td></td></tr>
* </table>
*/
public static final int imageAspectRatioAdjust=0x7f010010;
/**
* A reference to an array of integers representing the
* locations of horizontal keylines in dp from the starting edge.
* Child views can refer to these keylines for alignment using
* layout_keyline="index" where index is a 0-based index into
* this array.
* <p>May be a reference to another resource, in the form
* "<code>@[+][<i>package</i>:]<i>type</i>/<i>name</i></code>" or a theme
* attribute in the form
* "<code>?[<i>package</i>:]<i>type</i>/<i>name</i></code>".
*/
public static final int keylines=0x7f010011;
/**
* The id of an anchor view that this view should position relative to.
* <p>May be a reference to another resource, in the form
* "<code>@[+][<i>package</i>:]<i>type</i>/<i>name</i></code>" or a theme
* attribute in the form
* "<code>?[<i>package</i>:]<i>type</i>/<i>name</i></code>".
*/
public static final int layout_anchor=0x7f010012;
/**
* Specifies how an object should position relative to an anchor, on both the X and Y axes,
* within its parent's bounds.
* <p>Must be one or more (separated by '|') of the following constant values.</p>
* <table>
* <colgroup align="left" />
* <colgroup align="left" />
* <colgroup align="left" />
* <tr><th>Constant</th><th>Value</th><th>Description</th></tr>
* <tr><td>bottom</td><td>50</td><td>Push object to the bottom of its container, not changing its size.</td></tr>
* <tr><td>center</td><td>11</td><td>Place the object in the center of its container in both the vertical and horizontal axis, not changing its size.</td></tr>
* <tr><td>center_horizontal</td><td>1</td><td>Place object in the horizontal center of its container, not changing its size.</td></tr>
* <tr><td>center_vertical</td><td>10</td><td>Place object in the vertical center of its container, not changing its size.</td></tr>
* <tr><td>clip_horizontal</td><td>8</td><td>Additional option that can be set to have the left and/or right edges of
* the child clipped to its container's bounds.
* The clip will be based on the horizontal gravity: a left gravity will clip the right
* edge, a right gravity will clip the left edge, and neither will clip both edges.</td></tr>
* <tr><td>clip_vertical</td><td>80</td><td>Additional option that can be set to have the top and/or bottom edges of
* the child clipped to its container's bounds.
* The clip will be based on the vertical gravity: a top gravity will clip the bottom
* edge, a bottom gravity will clip the top edge, and neither will clip both edges.</td></tr>
* <tr><td>end</td><td>800005</td><td>Push object to the end of its container, not changing its size.</td></tr>
* <tr><td>fill</td><td>77</td><td>Grow the horizontal and vertical size of the object if needed so it completely fills its container.</td></tr>
* <tr><td>fill_horizontal</td><td>7</td><td>Grow the horizontal size of the object if needed so it completely fills its container.</td></tr>
* <tr><td>fill_vertical</td><td>70</td><td>Grow the vertical size of the object if needed so it completely fills its container.</td></tr>
* <tr><td>left</td><td>3</td><td>Push object to the left of its container, not changing its size.</td></tr>
* <tr><td>right</td><td>5</td><td>Push object to the right of its container, not changing its size.</td></tr>
* <tr><td>start</td><td>800003</td><td>Push object to the beginning of its container, not changing its size.</td></tr>
* <tr><td>top</td><td>30</td><td>Push object to the top of its container, not changing its size.</td></tr>
* </table>
*/
public static final int layout_anchorGravity=0x7f010013;
/**
* The class name of a Behavior class defining special runtime behavior
* for this child view.
* <p>May be a string value, using '\\;' to escape characters such as
* '\\n' or '\\uxxxx' for a unicode character;
*/
public static final int layout_behavior=0x7f010014;
/**
* Specifies how this view dodges the inset edges of the CoordinatorLayout.
* <p>Must be one or more (separated by '|') of the following constant values.</p>
* <table>
* <colgroup align="left" />
* <colgroup align="left" />
* <colgroup align="left" />
* <tr><th>Constant</th><th>Value</th><th>Description</th></tr>
* <tr><td>all</td><td>77</td><td>Dodge all the inset edges.</td></tr>
* <tr><td>bottom</td><td>50</td><td>Dodge the bottom inset edge.</td></tr>
* <tr><td>end</td><td>800005</td><td>Dodge the end inset edge.</td></tr>
* <tr><td>left</td><td>3</td><td>Dodge the left inset edge.</td></tr>
* <tr><td>none</td><td>0</td><td>Don't dodge any edges</td></tr>
* <tr><td>right</td><td>5</td><td>Dodge the right inset edge.</td></tr>
* <tr><td>start</td><td>800003</td><td>Dodge the start inset edge.</td></tr>
* <tr><td>top</td><td>30</td><td>Dodge the top inset edge.</td></tr>
* </table>
*/
public static final int layout_dodgeInsetEdges=0x7f010015;
/**
* Specifies how this view insets the CoordinatorLayout and make some other views
* dodge it.
* <p>Must be one of the following constant values.</p>
* <table>
* <colgroup align="left" />
* <colgroup align="left" />
* <colgroup align="left" />
* <tr><th>Constant</th><th>Value</th><th>Description</th></tr>
* <tr><td>bottom</td><td>50</td><td>Inset the bottom edge.</td></tr>
* <tr><td>end</td><td>800005</td><td>Inset the end edge.</td></tr>
* <tr><td>left</td><td>3</td><td>Inset the left edge.</td></tr>
* <tr><td>none</td><td>0</td><td>Don't inset.</td></tr>
* <tr><td>right</td><td>5</td><td>Inset the right edge.</td></tr>
* <tr><td>start</td><td>800003</td><td>Inset the start edge.</td></tr>
* <tr><td>top</td><td>30</td><td>Inset the top edge.</td></tr>
* </table>
*/
public static final int layout_insetEdge=0x7f010016;
/**
* The index of a keyline this view should position relative to.
* android:layout_gravity will affect how the view aligns to the
* specified keyline.
* <p>May be an integer value, such as "<code>100</code>".
*/
public static final int layout_keyline=0x7f010017;
/**
* <p>May be a reference to another resource, in the form
* "<code>@[+][<i>package</i>:]<i>type</i>/<i>name</i></code>" or a theme
* attribute in the form
* "<code>?[<i>package</i>:]<i>type</i>/<i>name</i></code>".
* <p>May be a string value, using '\\;' to escape characters such as
* '\\n' or '\\uxxxx' for a unicode character;
*/
public static final int scopeUris=0x7f010018;
/**
* Drawable to display behind the status bar when the view is set to draw behind it.
* <p>May be a reference to another resource, in the form
* "<code>@[+][<i>package</i>:]<i>type</i>/<i>name</i></code>" or a theme
* attribute in the form
* "<code>?[<i>package</i>:]<i>type</i>/<i>name</i></code>".
* <p>May be a color value, in the form of "<code>#<i>rgb</i></code>",
* "<code>#<i>argb</i></code>", "<code>#<i>rrggbb</i></code>", or
* "<code>#<i>aarrggbb</i></code>".
*/
public static final int statusBarBackground=0x7f010019;
/**
* The index of the font in the tcc font file. If the font file referenced is not in the
* tcc format, this attribute needs not be specified.
* <p>May be an integer value, such as "<code>100</code>".
*/
public static final int ttcIndex=0x7f01001a;
}
public static final class color {
public static final int common_google_signin_btn_text_dark=0x7f020000;
public static final int common_google_signin_btn_text_dark_default=0x7f020001;
public static final int common_google_signin_btn_text_dark_disabled=0x7f020002;
public static final int common_google_signin_btn_text_dark_focused=0x7f020003;
public static final int common_google_signin_btn_text_dark_pressed=0x7f020004;
public static final int common_google_signin_btn_text_light=0x7f020005;
public static final int common_google_signin_btn_text_light_default=0x7f020006;
public static final int common_google_signin_btn_text_light_disabled=0x7f020007;
public static final int common_google_signin_btn_text_light_focused=0x7f020008;
public static final int common_google_signin_btn_text_light_pressed=0x7f020009;
public static final int common_google_signin_btn_tint=0x7f02000a;
public static final int notification_action_color_filter=0x7f02000b;
public static final int notification_icon_bg_color=0x7f02000c;
public static final int ripple_material_light=0x7f02000d;
public static final int secondary_text_default_material_light=0x7f02000e;
}
public static final class dimen {
public static final int compat_button_inset_horizontal_material=0x7f030000;
public static final int compat_button_inset_vertical_material=0x7f030001;
public static final int compat_button_padding_horizontal_material=0x7f030002;
public static final int compat_button_padding_vertical_material=0x7f030003;
public static final int compat_control_corner_material=0x7f030004;
public static final int compat_notification_large_icon_max_height=0x7f030005;
public static final int compat_notification_large_icon_max_width=0x7f030006;
public static final int notification_action_icon_size=0x7f030007;
public static final int notification_action_text_size=0x7f030008;
public static final int notification_big_circle_margin=0x7f030009;
public static final int notification_content_margin_start=0x7f03000a;
public static final int notification_large_icon_height=0x7f03000b;
public static final int notification_large_icon_width=0x7f03000c;
public static final int notification_main_column_padding_top=0x7f03000d;
public static final int notification_media_narrow_margin=0x7f03000e;
public static final int notification_right_icon_size=0x7f03000f;
public static final int notification_right_side_padding_top=0x7f030010;
public static final int notification_small_icon_background_padding=0x7f030011;
public static final int notification_small_icon_size_as_large=0x7f030012;
public static final int notification_subtext_size=0x7f030013;
public static final int notification_top_pad=0x7f030014;
public static final int notification_top_pad_large_text=0x7f030015;
}
public static final class drawable {
public static final int common_full_open_on_phone=0x7f040000;
public static final int common_google_signin_btn_icon_dark=0x7f040001;
public static final int common_google_signin_btn_icon_dark_focused=0x7f040002;
public static final int common_google_signin_btn_icon_dark_normal=0x7f040003;
public static final int common_google_signin_btn_icon_dark_normal_background=0x7f040004;
public static final int common_google_signin_btn_icon_disabled=0x7f040005;
public static final int common_google_signin_btn_icon_light=0x7f040006;
public static final int common_google_signin_btn_icon_light_focused=0x7f040007;
public static final int common_google_signin_btn_icon_light_normal=0x7f040008;
public static final int common_google_signin_btn_icon_light_normal_background=0x7f040009;
public static final int common_google_signin_btn_text_dark=0x7f04000a;
public static final int common_google_signin_btn_text_dark_focused=0x7f04000b;
public static final int common_google_signin_btn_text_dark_normal=0x7f04000c;
public static final int common_google_signin_btn_text_dark_normal_background=0x7f04000d;
public static final int common_google_signin_btn_text_disabled=0x7f04000e;
public static final int common_google_signin_btn_text_light=0x7f04000f;
public static final int common_google_signin_btn_text_light_focused=0x7f040010;
public static final int common_google_signin_btn_text_light_normal=0x7f040011;
public static final int common_google_signin_btn_text_light_normal_background=0x7f040012;
public static final int googleg_disabled_color_18=0x7f040013;
public static final int googleg_standard_color_18=0x7f040014;
public static final int launch_background=0x7f040015;
public static final int notification_action_background=0x7f040016;
public static final int notification_bg=0x7f040017;
public static final int notification_bg_low=0x7f040018;
public static final int notification_bg_low_normal=0x7f040019;
public static final int notification_bg_low_pressed=0x7f04001a;
public static final int notification_bg_normal=0x7f04001b;
public static final int notification_bg_normal_pressed=0x7f04001c;
public static final int notification_icon_background=0x7f04001d;
public static final int notification_template_icon_bg=0x7f04001e;
public static final int notification_template_icon_low_bg=0x7f04001f;
public static final int notification_tile_bg=0x7f040020;
public static final int notify_panel_notification_icon_bg=0x7f040021;
}
public static final class id {
public static final int action_container=0x7f050000;
public static final int action_divider=0x7f050001;
public static final int action_image=0x7f050002;
public static final int action_text=0x7f050003;
public static final int actions=0x7f050004;
public static final int adjust_height=0x7f050005;
public static final int adjust_width=0x7f050006;
public static final int all=0x7f050007;
public static final int async=0x7f050008;
public static final int auto=0x7f050009;
public static final int blocking=0x7f05000a;
public static final int bottom=0x7f05000b;
public static final int center=0x7f05000c;
public static final int center_horizontal=0x7f05000d;
public static final int center_vertical=0x7f05000e;
public static final int chronometer=0x7f05000f;
public static final int clip_horizontal=0x7f050010;
public static final int clip_vertical=0x7f050011;
public static final int dark=0x7f050012;
public static final int end=0x7f050013;
public static final int fill=0x7f050014;
public static final int fill_horizontal=0x7f050015;
public static final int fill_vertical=0x7f050016;
public static final int forever=0x7f050017;
public static final int icon=0x7f050018;
public static final int icon_group=0x7f050019;
public static final int icon_only=0x7f05001a;
public static final int info=0x7f05001b;
public static final int italic=0x7f05001c;
public static final int left=0x7f05001d;
public static final int light=0x7f05001e;
public static final int line1=0x7f05001f;
public static final int line3=0x7f050020;
public static final int none=0x7f050021;
public static final int normal=0x7f050022;
public static final int notification_background=0x7f050023;
public static final int notification_main_column=0x7f050024;
public static final int notification_main_column_container=0x7f050025;
public static final int right=0x7f050026;
public static final int right_icon=0x7f050027;
public static final int right_side=0x7f050028;
public static final int standard=0x7f050029;
public static final int start=0x7f05002a;
public static final int tag_transition_group=0x7f05002b;
public static final int tag_unhandled_key_event_manager=0x7f05002c;
public static final int tag_unhandled_key_listeners=0x7f05002d;
public static final int text=0x7f05002e;
public static final int text2=0x7f05002f;
public static final int time=0x7f050030;
public static final int title=0x7f050031;
public static final int top=0x7f050032;
public static final int wide=0x7f050033;
}
public static final class integer {
public static final int google_play_services_version=0x7f060000;
public static final int status_bar_notification_info_maxnum=0x7f060001;
}
public static final class layout {
public static final int notification_action=0x7f070000;
public static final int notification_action_tombstone=0x7f070001;
public static final int notification_template_custom_big=0x7f070002;
public static final int notification_template_icon_group=0x7f070003;
public static final int notification_template_part_chronometer=0x7f070004;
public static final int notification_template_part_time=0x7f070005;
}
public static final class mipmap {
public static final int ic_launcher=0x7f080000;
}
public static final class string {
public static final int common_google_play_services_enable_button=0x7f090000;
public static final int common_google_play_services_enable_text=0x7f090001;
public static final int common_google_play_services_enable_title=0x7f090002;
public static final int common_google_play_services_install_button=0x7f090003;
public static final int common_google_play_services_install_text=0x7f090004;
public static final int common_google_play_services_install_title=0x7f090005;
public static final int common_google_play_services_notification_channel_name=0x7f090006;
public static final int common_google_play_services_notification_ticker=0x7f090007;
public static final int common_google_play_services_unknown_issue=0x7f090008;
public static final int common_google_play_services_unsupported_text=0x7f090009;
public static final int common_google_play_services_update_button=0x7f09000a;
public static final int common_google_play_services_update_text=0x7f09000b;
public static final int common_google_play_services_update_title=0x7f09000c;
public static final int common_google_play_services_updating_text=0x7f09000d;
public static final int common_google_play_services_wear_update_text=0x7f09000e;
public static final int common_open_on_phone=0x7f09000f;
public static final int common_signin_button_text=0x7f090010;
public static final int common_signin_button_text_long=0x7f090011;
public static final int default_web_client_id=0x7f090012;
public static final int firebase_database_url=0x7f090013;
public static final int gcm_defaultSenderId=0x7f090014;
public static final int google_api_key=0x7f090015;
public static final int google_app_id=0x7f090016;
public static final int google_crash_reporting_api_key=0x7f090017;
public static final int google_storage_bucket=0x7f090018;
public static final int project_id=0x7f090019;
public static final int status_bar_notification_info_overflow=0x7f09001a;
}
public static final class style {
public static final int LaunchTheme=0x7f0a0000;
public static final int TextAppearance_Compat_Notification=0x7f0a0001;
public static final int TextAppearance_Compat_Notification_Info=0x7f0a0002;
public static final int TextAppearance_Compat_Notification_Line2=0x7f0a0003;
public static final int TextAppearance_Compat_Notification_Time=0x7f0a0004;
public static final int TextAppearance_Compat_Notification_Title=0x7f0a0005;
public static final int Widget_Compat_NotificationActionContainer=0x7f0a0006;
public static final int Widget_Compat_NotificationActionText=0x7f0a0007;
public static final int Widget_Support_CoordinatorLayout=0x7f0a0008;
}
public static final class styleable {
/**
* Attributes that can be used with a ColorStateListItem.
* <p>Includes the following attributes:</p>
* <table>
* <colgroup align="left" />
* <colgroup align="left" />
* <tr><th>Attribute</th><th>Description</th></tr>
* <tr><td><code>{@link #ColorStateListItem_android_color android:color}</code></td><td></td></tr>
* <tr><td><code>{@link #ColorStateListItem_android_alpha android:alpha}</code></td><td></td></tr>
* <tr><td><code>{@link #ColorStateListItem_alpha com.renan.bem_aventurancas:alpha}</code></td><td>Alpha multiplier applied to the base color.</td></tr>
* </table>
* @see #ColorStateListItem_android_color
* @see #ColorStateListItem_android_alpha
* @see #ColorStateListItem_alpha
*/
public static final int[] ColorStateListItem={
0x010101a5, 0x0101031f, 0x7f010000
};
/**
* <p>
* @attr description
* Base color for this state.
*
* <p>May be a color value, in the form of "<code>#<i>rgb</i></code>",
* "<code>#<i>argb</i></code>", "<code>#<i>rrggbb</i></code>", or
* "<code>#<i>aarrggbb</i></code>".
*
* @attr name android:color
*/
public static final int ColorStateListItem_android_color=0;
/**
* <p>This symbol is the offset where the {@link android.R.attr#alpha}
* attribute's value can be found in the {@link #ColorStateListItem} array.
*
* <p>May be a floating point value, such as "<code>1.2</code>".
*
* @attr name android:alpha
*/
public static final int ColorStateListItem_android_alpha=1;
/**
* <p>
* @attr description
* Alpha multiplier applied to the base color.
*
* <p>May be a floating point value, such as "<code>1.2</code>".
*
* @attr name com.renan.bem_aventurancas:alpha
*/
public static final int ColorStateListItem_alpha=2;
/**
* Attributes that can be used with a CoordinatorLayout.
* <p>Includes the following attributes:</p>
* <table>
* <colgroup align="left" />
* <colgroup align="left" />
* <tr><th>Attribute</th><th>Description</th></tr>
* <tr><td><code>{@link #CoordinatorLayout_keylines com.renan.bem_aventurancas:keylines}</code></td><td>A reference to an array of integers representing the
* locations of horizontal keylines in dp from the starting edge.</td></tr>
* <tr><td><code>{@link #CoordinatorLayout_statusBarBackground com.renan.bem_aventurancas:statusBarBackground}</code></td><td>Drawable to display behind the status bar when the view is set to draw behind it.</td></tr>
* </table>
* @see #CoordinatorLayout_keylines
* @see #CoordinatorLayout_statusBarBackground
*/
public static final int[] CoordinatorLayout={
0x7f010011, 0x7f010019
};
/**
* <p>
* @attr description
* A reference to an array of integers representing the
* locations of horizontal keylines in dp from the starting edge.
* Child views can refer to these keylines for alignment using
* layout_keyline="index" where index is a 0-based index into
* this array.
*
* <p>May be a reference to another resource, in the form
* "<code>@[+][<i>package</i>:]<i>type</i>/<i>name</i></code>" or a theme
* attribute in the form
* "<code>?[<i>package</i>:]<i>type</i>/<i>name</i></code>".
*
* @attr name com.renan.bem_aventurancas:keylines
*/
public static final int CoordinatorLayout_keylines=0;
/**
* <p>
* @attr description
* Drawable to display behind the status bar when the view is set to draw behind it.
*
* <p>May be a reference to another resource, in the form
* "<code>@[+][<i>package</i>:]<i>type</i>/<i>name</i></code>" or a theme
* attribute in the form
* "<code>?[<i>package</i>:]<i>type</i>/<i>name</i></code>".
* <p>May be a color value, in the form of "<code>#<i>rgb</i></code>",
* "<code>#<i>argb</i></code>", "<code>#<i>rrggbb</i></code>", or
* "<code>#<i>aarrggbb</i></code>".
*
* @attr name com.renan.bem_aventurancas:statusBarBackground
*/
public static final int CoordinatorLayout_statusBarBackground=1;
/**
* Attributes that can be used with a CoordinatorLayout_Layout.
* <p>Includes the following attributes:</p>
* <table>
* <colgroup align="left" />
* <colgroup align="left" />
* <tr><th>Attribute</th><th>Description</th></tr>
* <tr><td><code>{@link #CoordinatorLayout_Layout_android_layout_gravity android:layout_gravity}</code></td><td></td></tr>
* <tr><td><code>{@link #CoordinatorLayout_Layout_layout_anchor com.renan.bem_aventurancas:layout_anchor}</code></td><td>The id of an anchor view that this view should position relative to.</td></tr>
* <tr><td><code>{@link #CoordinatorLayout_Layout_layout_anchorGravity com.renan.bem_aventurancas:layout_anchorGravity}</code></td><td>Specifies how an object should position relative to an anchor, on both the X and Y axes,
* within its parent's bounds.</td></tr>
* <tr><td><code>{@link #CoordinatorLayout_Layout_layout_behavior com.renan.bem_aventurancas:layout_behavior}</code></td><td>The class name of a Behavior class defining special runtime behavior
* for this child view.</td></tr>
* <tr><td><code>{@link #CoordinatorLayout_Layout_layout_dodgeInsetEdges com.renan.bem_aventurancas:layout_dodgeInsetEdges}</code></td><td>Specifies how this view dodges the inset edges of the CoordinatorLayout.</td></tr>
* <tr><td><code>{@link #CoordinatorLayout_Layout_layout_insetEdge com.renan.bem_aventurancas:layout_insetEdge}</code></td><td>Specifies how this view insets the CoordinatorLayout and make some other views
* dodge it.</td></tr>
* <tr><td><code>{@link #CoordinatorLayout_Layout_layout_keyline com.renan.bem_aventurancas:layout_keyline}</code></td><td>The index of a keyline this view should position relative to.</td></tr>
* </table>
* @see #CoordinatorLayout_Layout_android_layout_gravity
* @see #CoordinatorLayout_Layout_layout_anchor
* @see #CoordinatorLayout_Layout_layout_anchorGravity
* @see #CoordinatorLayout_Layout_layout_behavior
* @see #CoordinatorLayout_Layout_layout_dodgeInsetEdges
* @see #CoordinatorLayout_Layout_layout_insetEdge
* @see #CoordinatorLayout_Layout_layout_keyline
*/
public static final int[] CoordinatorLayout_Layout={
0x010100b3, 0x7f010012, 0x7f010013, 0x7f010014,
0x7f010015, 0x7f010016, 0x7f010017
};
/**
* <p>This symbol is the offset where the {@link android.R.attr#layout_gravity}
* attribute's value can be found in the {@link #CoordinatorLayout_Layout} array.
*
* <p>Must be one or more (separated by '|') of the following constant values.</p>
* <table>
* <colgroup align="left" />
* <colgroup align="left" />
* <colgroup align="left" />
* <tr><th>Constant</th><th>Value</th><th>Description</th></tr>
* <tr><td>bottom</td><td>50</td><td></td></tr>
* <tr><td>center</td><td>11</td><td></td></tr>
* <tr><td>center_horizontal</td><td>1</td><td></td></tr>
* <tr><td>center_vertical</td><td>10</td><td></td></tr>
* <tr><td>clip_horizontal</td><td>8</td><td></td></tr>
* <tr><td>clip_vertical</td><td>80</td><td></td></tr>
* <tr><td>end</td><td>800005</td><td></td></tr>
* <tr><td>fill</td><td>77</td><td></td></tr>
* <tr><td>fill_horizontal</td><td>7</td><td></td></tr>
* <tr><td>fill_vertical</td><td>70</td><td></td></tr>
* <tr><td>left</td><td>3</td><td></td></tr>
* <tr><td>right</td><td>5</td><td></td></tr>
* <tr><td>start</td><td>800003</td><td></td></tr>
* <tr><td>top</td><td>30</td><td></td></tr>
* </table>
*
* @attr name android:layout_gravity
*/
public static final int CoordinatorLayout_Layout_android_layout_gravity=0;
/**
* <p>
* @attr description
* The id of an anchor view that this view should position relative to.
*
* <p>May be a reference to another resource, in the form
* "<code>@[+][<i>package</i>:]<i>type</i>/<i>name</i></code>" or a theme
* attribute in the form
* "<code>?[<i>package</i>:]<i>type</i>/<i>name</i></code>".
*
* @attr name com.renan.bem_aventurancas:layout_anchor
*/
public static final int CoordinatorLayout_Layout_layout_anchor=1;
/**
* <p>
* @attr description
* Specifies how an object should position relative to an anchor, on both the X and Y axes,
* within its parent's bounds.
*
* <p>Must be one or more (separated by '|') of the following constant values.</p>
* <table>
* <colgroup align="left" />
* <colgroup align="left" />
* <colgroup align="left" />
* <tr><th>Constant</th><th>Value</th><th>Description</th></tr>
* <tr><td>bottom</td><td>50</td><td>Push object to the bottom of its container, not changing its size.</td></tr>
* <tr><td>center</td><td>11</td><td>Place the object in the center of its container in both the vertical and horizontal axis, not changing its size.</td></tr>
* <tr><td>center_horizontal</td><td>1</td><td>Place object in the horizontal center of its container, not changing its size.</td></tr>
* <tr><td>center_vertical</td><td>10</td><td>Place object in the vertical center of its container, not changing its size.</td></tr>
* <tr><td>clip_horizontal</td><td>8</td><td>Additional option that can be set to have the left and/or right edges of
* the child clipped to its container's bounds.
* The clip will be based on the horizontal gravity: a left gravity will clip the right
* edge, a right gravity will clip the left edge, and neither will clip both edges.</td></tr>
* <tr><td>clip_vertical</td><td>80</td><td>Additional option that can be set to have the top and/or bottom edges of
* the child clipped to its container's bounds.
* The clip will be based on the vertical gravity: a top gravity will clip the bottom
* edge, a bottom gravity will clip the top edge, and neither will clip both edges.</td></tr>
* <tr><td>end</td><td>800005</td><td>Push object to the end of its container, not changing its size.</td></tr>
* <tr><td>fill</td><td>77</td><td>Grow the horizontal and vertical size of the object if needed so it completely fills its container.</td></tr>
* <tr><td>fill_horizontal</td><td>7</td><td>Grow the horizontal size of the object if needed so it completely fills its container.</td></tr>
* <tr><td>fill_vertical</td><td>70</td><td>Grow the vertical size of the object if needed so it completely fills its container.</td></tr>
* <tr><td>left</td><td>3</td><td>Push object to the left of its container, not changing its size.</td></tr>
* <tr><td>right</td><td>5</td><td>Push object to the right of its container, not changing its size.</td></tr>
* <tr><td>start</td><td>800003</td><td>Push object to the beginning of its container, not changing its size.</td></tr>
* <tr><td>top</td><td>30</td><td>Push object to the top of its container, not changing its size.</td></tr>
* </table>
*
* @attr name com.renan.bem_aventurancas:layout_anchorGravity
*/
public static final int CoordinatorLayout_Layout_layout_anchorGravity=2;
/**
* <p>
* @attr description
* The class name of a Behavior class defining special runtime behavior
* for this child view.
*
* <p>May be a string value, using '\\;' to escape characters such as
* '\\n' or '\\uxxxx' for a unicode character;
*
* @attr name com.renan.bem_aventurancas:layout_behavior
*/
public static final int CoordinatorLayout_Layout_layout_behavior=3;
/**
* <p>
* @attr description
* Specifies how this view dodges the inset edges of the CoordinatorLayout.
*
* <p>Must be one or more (separated by '|') of the following constant values.</p>
* <table>
* <colgroup align="left" />
* <colgroup align="left" />
* <colgroup align="left" />
* <tr><th>Constant</th><th>Value</th><th>Description</th></tr>
* <tr><td>all</td><td>77</td><td>Dodge all the inset edges.</td></tr>
* <tr><td>bottom</td><td>50</td><td>Dodge the bottom inset edge.</td></tr>
* <tr><td>end</td><td>800005</td><td>Dodge the end inset edge.</td></tr>
* <tr><td>left</td><td>3</td><td>Dodge the left inset edge.</td></tr>
* <tr><td>none</td><td>0</td><td>Don't dodge any edges</td></tr>
* <tr><td>right</td><td>5</td><td>Dodge the right inset edge.</td></tr>
* <tr><td>start</td><td>800003</td><td>Dodge the start inset edge.</td></tr>
* <tr><td>top</td><td>30</td><td>Dodge the top inset edge.</td></tr>
* </table>
*
* @attr name com.renan.bem_aventurancas:layout_dodgeInsetEdges
*/
public static final int CoordinatorLayout_Layout_layout_dodgeInsetEdges=4;
/**
* <p>
* @attr description
* Specifies how this view insets the CoordinatorLayout and make some other views
* dodge it.
*
* <p>Must be one of the following constant values.</p>
* <table>
* <colgroup align="left" />
* <colgroup align="left" />
* <colgroup align="left" />
* <tr><th>Constant</th><th>Value</th><th>Description</th></tr>
* <tr><td>bottom</td><td>50</td><td>Inset the bottom edge.</td></tr>
* <tr><td>end</td><td>800005</td><td>Inset the end edge.</td></tr>
* <tr><td>left</td><td>3</td><td>Inset the left edge.</td></tr>
* <tr><td>none</td><td>0</td><td>Don't inset.</td></tr>
* <tr><td>right</td><td>5</td><td>Inset the right edge.</td></tr>
* <tr><td>start</td><td>800003</td><td>Inset the start edge.</td></tr>
* <tr><td>top</td><td>30</td><td>Inset the top edge.</td></tr>
* </table>
*
* @attr name com.renan.bem_aventurancas:layout_insetEdge
*/
public static final int CoordinatorLayout_Layout_layout_insetEdge=5;
/**
* <p>
* @attr description
* The index of a keyline this view should position relative to.
* android:layout_gravity will affect how the view aligns to the
* specified keyline.
*
* <p>May be an integer value, such as "<code>100</code>".
*
* @attr name com.renan.bem_aventurancas:layout_keyline
*/
public static final int CoordinatorLayout_Layout_layout_keyline=6;
/**
* Attributes that can be used with a FontFamily.
* <p>Includes the following attributes:</p>
* <table>
* <colgroup align="left" />
* <colgroup align="left" />
* <tr><th>Attribute</th><th>Description</th></tr>
* <tr><td><code>{@link #FontFamily_fontProviderAuthority com.renan.bem_aventurancas:fontProviderAuthority}</code></td><td>The authority of the Font Provider to be used for the request.</td></tr>
* <tr><td><code>{@link #FontFamily_fontProviderCerts com.renan.bem_aventurancas:fontProviderCerts}</code></td><td>The sets of hashes for the certificates the provider should be signed with.</td></tr>
* <tr><td><code>{@link #FontFamily_fontProviderFetchStrategy com.renan.bem_aventurancas:fontProviderFetchStrategy}</code></td><td>The strategy to be used when fetching font data from a font provider in XML layouts.</td></tr>
* <tr><td><code>{@link #FontFamily_fontProviderFetchTimeout com.renan.bem_aventurancas:fontProviderFetchTimeout}</code></td><td>The length of the timeout during fetching.</td></tr>
* <tr><td><code>{@link #FontFamily_fontProviderPackage com.renan.bem_aventurancas:fontProviderPackage}</code></td><td>The package for the Font Provider to be used for the request.</td></tr>
* <tr><td><code>{@link #FontFamily_fontProviderQuery com.renan.bem_aventurancas:fontProviderQuery}</code></td><td>The query to be sent over to the provider.</td></tr>
* </table>
* @see #FontFamily_fontProviderAuthority
* @see #FontFamily_fontProviderCerts
* @see #FontFamily_fontProviderFetchStrategy
* @see #FontFamily_fontProviderFetchTimeout
* @see #FontFamily_fontProviderPackage
* @see #FontFamily_fontProviderQuery
*/
public static final int[] FontFamily={
0x7f010006, 0x7f010007, 0x7f010008, 0x7f010009,
0x7f01000a, 0x7f01000b
};
/**
* <p>
* @attr description
* The authority of the Font Provider to be used for the request.
*
* <p>May be a string value, using '\\;' to escape characters such as
* '\\n' or '\\uxxxx' for a unicode character;
*
* @attr name com.renan.bem_aventurancas:fontProviderAuthority
*/
public static final int FontFamily_fontProviderAuthority=0;
/**
* <p>
* @attr description
* The sets of hashes for the certificates the provider should be signed with. This is
* used to verify the identity of the provider, and is only required if the provider is not
* part of the system image. This value may point to one list or a list of lists, where each
* individual list represents one collection of signature hashes. Refer to your font provider's
* documentation for these values.
*
* <p>May be a reference to another resource, in the form
* "<code>@[+][<i>package</i>:]<i>type</i>/<i>name</i></code>" or a theme
* attribute in the form
* "<code>?[<i>package</i>:]<i>type</i>/<i>name</i></code>".
*
* @attr name com.renan.bem_aventurancas:fontProviderCerts
*/
public static final int FontFamily_fontProviderCerts=1;
/**
* <p>
* @attr description
* The strategy to be used when fetching font data from a font provider in XML layouts.
* This attribute is ignored when the resource is loaded from code, as it is equivalent to the
* choice of API between {@link
* androidx.core.content.res.ResourcesCompat#getFont(Context, int)} (blocking) and
* {@link
* androidx.core.content.res.ResourcesCompat#getFont(Context, int, FontCallback, Handler)}
* (async).
*
* <p>Must be one of the following constant values.</p>
* <table>
* <colgroup align="left" />
* <colgroup align="left" />
* <colgroup align="left" />
* <tr><th>Constant</th><th>Value</th><th>Description</th></tr>
* <tr><td>async</td><td>1</td><td>The async font fetch works as follows.
* First, check the local cache, then if the requeted font is not cached, trigger a
* request the font and continue with layout inflation. Once the font fetch succeeds, the
* target text view will be refreshed with the downloaded font data. The
* fontProviderFetchTimeout will be ignored if async loading is specified.</td></tr>
* <tr><td>blocking</td><td>0</td><td>The blocking font fetch works as follows.
* First, check the local cache, then if the requested font is not cached, request the
* font from the provider and wait until it is finished. You can change the length of
* the timeout by modifying fontProviderFetchTimeout. If the timeout happens, the
* default typeface will be used instead.</td></tr>
* </table>
*
* @attr name com.renan.bem_aventurancas:fontProviderFetchStrategy
*/
public static final int FontFamily_fontProviderFetchStrategy=2;
/**
* <p>
* @attr description
* The length of the timeout during fetching.
*
* <p>May be an integer value, such as "<code>100</code>".
* <p>Must be one of the following constant values.</p>
* <table>
* <colgroup align="left" />
* <colgroup align="left" />
* <colgroup align="left" />
* <tr><th>Constant</th><th>Value</th><th>Description</th></tr>
* <tr><td>forever</td><td>ffffffff</td><td>A special value for the timeout. In this case, the blocking font fetching will not
* timeout and wait until a reply is received from the font provider.</td></tr>
* </table>
*
* @attr name com.renan.bem_aventurancas:fontProviderFetchTimeout
*/
public static final int FontFamily_fontProviderFetchTimeout=3;
/**
* <p>
* @attr description
* The package for the Font Provider to be used for the request. This is used to verify
* the identity of the provider.
*
* <p>May be a string value, using '\\;' to escape characters such as
* '\\n' or '\\uxxxx' for a unicode character;
*
* @attr name com.renan.bem_aventurancas:fontProviderPackage
*/
public static final int FontFamily_fontProviderPackage=4;
/**
* <p>
* @attr description
* The query to be sent over to the provider. Refer to your font provider's documentation
* on the format of this string.
*
* <p>May be a string value, using '\\;' to escape characters such as
* '\\n' or '\\uxxxx' for a unicode character;
*
* @attr name com.renan.bem_aventurancas:fontProviderQuery
*/
public static final int FontFamily_fontProviderQuery=5;
/**
* Attributes that can be used with a FontFamilyFont.
* <p>Includes the following attributes:</p>
* <table>
* <colgroup align="left" />
* <colgroup align="left" />
* <tr><th>Attribute</th><th>Description</th></tr>
* <tr><td><code>{@link #FontFamilyFont_android_font android:font}</code></td><td></td></tr>
* <tr><td><code>{@link #FontFamilyFont_android_fontWeight android:fontWeight}</code></td><td></td></tr>
* <tr><td><code>{@link #FontFamilyFont_android_fontStyle android:fontStyle}</code></td><td></td></tr>
* <tr><td><code>{@link #FontFamilyFont_android_ttcIndex android:ttcIndex}</code></td><td></td></tr>
* <tr><td><code>{@link #FontFamilyFont_android_fontVariationSettings android:fontVariationSettings}</code></td><td></td></tr>
* <tr><td><code>{@link #FontFamilyFont_font com.renan.bem_aventurancas:font}</code></td><td>The reference to the font file to be used.</td></tr>
* <tr><td><code>{@link #FontFamilyFont_fontStyle com.renan.bem_aventurancas:fontStyle}</code></td><td>The style of the given font file.</td></tr>
* <tr><td><code>{@link #FontFamilyFont_fontVariationSettings com.renan.bem_aventurancas:fontVariationSettings}</code></td><td>The variation settings to be applied to the font.</td></tr>
* <tr><td><code>{@link #FontFamilyFont_fontWeight com.renan.bem_aventurancas:fontWeight}</code></td><td>The weight of the given font file.</td></tr>
* <tr><td><code>{@link #FontFamilyFont_ttcIndex com.renan.bem_aventurancas:ttcIndex}</code></td><td>The index of the font in the tcc font file.</td></tr>
* </table>
* @see #FontFamilyFont_android_font
* @see #FontFamilyFont_android_fontWeight
* @see #FontFamilyFont_android_fontStyle
* @see #FontFamilyFont_android_ttcIndex
* @see #FontFamilyFont_android_fontVariationSettings
* @see #FontFamilyFont_font
* @see #FontFamilyFont_fontStyle
* @see #FontFamilyFont_fontVariationSettings
* @see #FontFamilyFont_fontWeight
* @see #FontFamilyFont_ttcIndex
*/
public static final int[] FontFamilyFont={
0x01010532, 0x01010533, 0x0101053f, 0x0101056f,
0x01010570, 0x7f010005, 0x7f01000c, 0x7f01000d,
0x7f01000e, 0x7f01001a
};
/**
* <p>This symbol is the offset where the {@link android.R.attr#font}
* attribute's value can be found in the {@link #FontFamilyFont} array.
*
* <p>May be a reference to another resource, in the form
* "<code>@[+][<i>package</i>:]<i>type</i>/<i>name</i></code>" or a theme
* attribute in the form
* "<code>?[<i>package</i>:]<i>type</i>/<i>name</i></code>".
*
* @attr name android:font
*/
public static final int FontFamilyFont_android_font=0;
/**
* <p>This symbol is the offset where the {@link android.R.attr#fontWeight}
* attribute's value can be found in the {@link #FontFamilyFont} array.
*
* <p>May be an integer value, such as "<code>100</code>".
*
* @attr name android:fontWeight
*/
public static final int FontFamilyFont_android_fontWeight=1;
/**
* <p>
* @attr description
* References to the framework attrs
*
* <p>Must be one of the following constant values.</p>
* <table>
* <colgroup align="left" />
* <colgroup align="left" />
* <colgroup align="left" />
* <tr><th>Constant</th><th>Value</th><th>Description</th></tr>
* <tr><td>italic</td><td>1</td><td></td></tr>
* <tr><td>normal</td><td>0</td><td></td></tr>
* </table>
*
* @attr name android:fontStyle
*/
public static final int FontFamilyFont_android_fontStyle=2;
/**
* <p>This symbol is the offset where the {@link android.R.attr#ttcIndex}
* attribute's value can be found in the {@link #FontFamilyFont} array.
*
* <p>May be an integer value, such as "<code>100</code>".
*
* @attr name android:ttcIndex
*/
public static final int FontFamilyFont_android_ttcIndex=3;
/**
* <p>This symbol is the offset where the {@link android.R.attr#fontVariationSettings}
* attribute's value can be found in the {@link #FontFamilyFont} array.
*
* <p>May be a string value, using '\\;' to escape characters such as
* '\\n' or '\\uxxxx' for a unicode character;
*
* @attr name android:fontVariationSettings
*/
public static final int FontFamilyFont_android_fontVariationSettings=4;
/**
* <p>
* @attr description
* The reference to the font file to be used. This should be a file in the res/font folder
* and should therefore have an R reference value. E.g. @font/myfont
*
* <p>May be a reference to another resource, in the form
* "<code>@[+][<i>package</i>:]<i>type</i>/<i>name</i></code>" or a theme
* attribute in the form
* "<code>?[<i>package</i>:]<i>type</i>/<i>name</i></code>".
*
* @attr name com.renan.bem_aventurancas:font
*/
public static final int FontFamilyFont_font=5;
/**
* <p>
* @attr description
* The style of the given font file. This will be used when the font is being loaded into
* the font stack and will override any style information in the font's header tables. If
* unspecified, the value in the font's header tables will be used.
*
* <p>Must be one of the following constant values.</p>
* <table>
* <colgroup align="left" />
* <colgroup align="left" />
* <colgroup align="left" />
* <tr><th>Constant</th><th>Value</th><th>Description</th></tr>
* <tr><td>italic</td><td>1</td><td></td></tr>
* <tr><td>normal</td><td>0</td><td></td></tr>
* </table>
*
* @attr name com.renan.bem_aventurancas:fontStyle
*/
public static final int FontFamilyFont_fontStyle=6;
/**
* <p>
* @attr description
* The variation settings to be applied to the font. The string should be in the following
* format: "'tag1' value1, 'tag2' value2, ...". If the default variation settings should be
* used, or the font used does not support variation settings, this attribute needs not be
* specified.
*
* <p>May be a string value, using '\\;' to escape characters such as
* '\\n' or '\\uxxxx' for a unicode character;
*
* @attr name com.renan.bem_aventurancas:fontVariationSettings
*/
public static final int FontFamilyFont_fontVariationSettings=7;
/**
* <p>
* @attr description
* The weight of the given font file. This will be used when the font is being loaded into
* the font stack and will override any weight information in the font's header tables. Must
* be a positive number, a multiple of 100, and between 100 and 900, inclusive. The most
* common values are 400 for regular weight and 700 for bold weight. If unspecified, the value
* in the font's header tables will be used.
*
* <p>May be an integer value, such as "<code>100</code>".
*
* @attr name com.renan.bem_aventurancas:fontWeight
*/
public static final int FontFamilyFont_fontWeight=8;
/**
* <p>
* @attr description
* The index of the font in the tcc font file. If the font file referenced is not in the
* tcc format, this attribute needs not be specified.
*
* <p>May be an integer value, such as "<code>100</code>".
*
* @attr name com.renan.bem_aventurancas:ttcIndex
*/
public static final int FontFamilyFont_ttcIndex=9;
/**
* Attributes that can be used with a GradientColor.
* <p>Includes the following attributes:</p>
* <table>
* <colgroup align="left" />
* <colgroup align="left" />
* <tr><th>Attribute</th><th>Description</th></tr>
* <tr><td><code>{@link #GradientColor_android_startColor android:startColor}</code></td><td></td></tr>
* <tr><td><code>{@link #GradientColor_android_endColor android:endColor}</code></td><td></td></tr>
* <tr><td><code>{@link #GradientColor_android_type android:type}</code></td><td></td></tr>
* <tr><td><code>{@link #GradientColor_android_centerX android:centerX}</code></td><td></td></tr>
* <tr><td><code>{@link #GradientColor_android_centerY android:centerY}</code></td><td></td></tr>
* <tr><td><code>{@link #GradientColor_android_gradientRadius android:gradientRadius}</code></td><td></td></tr>
* <tr><td><code>{@link #GradientColor_android_tileMode android:tileMode}</code></td><td></td></tr>
* <tr><td><code>{@link #GradientColor_android_centerColor android:centerColor}</code></td><td></td></tr>
* <tr><td><code>{@link #GradientColor_android_startX android:startX}</code></td><td></td></tr>
* <tr><td><code>{@link #GradientColor_android_startY android:startY}</code></td><td></td></tr>
* <tr><td><code>{@link #GradientColor_android_endX android:endX}</code></td><td></td></tr>
* <tr><td><code>{@link #GradientColor_android_endY android:endY}</code></td><td></td></tr>
* </table>
* @see #GradientColor_android_startColor
* @see #GradientColor_android_endColor
* @see #GradientColor_android_type
* @see #GradientColor_android_centerX
* @see #GradientColor_android_centerY
* @see #GradientColor_android_gradientRadius
* @see #GradientColor_android_tileMode
* @see #GradientColor_android_centerColor
* @see #GradientColor_android_startX
* @see #GradientColor_android_startY
* @see #GradientColor_android_endX
* @see #GradientColor_android_endY
*/
public static final int[] GradientColor={
0x0101019d, 0x0101019e, 0x010101a1, 0x010101a2,
0x010101a3, 0x010101a4, 0x01010201, 0x0101020b,
0x01010510, 0x01010511, 0x01010512, 0x01010513
};
/**
* <p>
* @attr description
* Start color of the gradient.
*
* <p>May be a color value, in the form of "<code>#<i>rgb</i></code>",
* "<code>#<i>argb</i></code>", "<code>#<i>rrggbb</i></code>", or
* "<code>#<i>aarrggbb</i></code>".
*
* @attr name android:startColor
*/
public static final int GradientColor_android_startColor=0;
/**
* <p>
* @attr description
* End color of the gradient.
*
* <p>May be a color value, in the form of "<code>#<i>rgb</i></code>",
* "<code>#<i>argb</i></code>", "<code>#<i>rrggbb</i></code>", or
* "<code>#<i>aarrggbb</i></code>".
*
* @attr name android:endColor
*/
public static final int GradientColor_android_endColor=1;
/**
* <p>
* @attr description
* Type of gradient. The default type is linear.
*
* <p>Must be one of the following constant values.</p>
* <table>
* <colgroup align="left" />
* <colgroup align="left" />
* <colgroup align="left" />
* <tr><th>Constant</th><th>Value</th><th>Description</th></tr>
* <tr><td>linear</td><td>0</td><td></td></tr>
* <tr><td>radial</td><td>1</td><td></td></tr>
* <tr><td>sweep</td><td>2</td><td></td></tr>
* </table>
*
* @attr name android:type
*/
public static final int GradientColor_android_type=2;
/**
* <p>
* @attr description
* X coordinate of the center of the gradient within the path.
*
* <p>May be a floating point value, such as "<code>1.2</code>".
* <p>May be a fractional value, which is a floating point number appended with
* either % or %p, such as "<code>14.5%</code>".
* The % suffix always means a percentage of the base size;
* the optional %p suffix provides a size relative to some parent container.
*
* @attr name android:centerX
*/
public static final int GradientColor_android_centerX=3;
/**
* <p>
* @attr description
* Y coordinate of the center of the gradient within the path.
*
* <p>May be a floating point value, such as "<code>1.2</code>".
* <p>May be a fractional value, which is a floating point number appended with
* either % or %p, such as "<code>14.5%</code>".
* The % suffix always means a percentage of the base size;
* the optional %p suffix provides a size relative to some parent container.
*
* @attr name android:centerY
*/
public static final int GradientColor_android_centerY=4;
/**
* <p>
* @attr description
* Radius of the gradient, used only with radial gradient.
*
* <p>May be a floating point value, such as "<code>1.2</code>".
* <p>May be a dimension value, which is a floating point number appended with a
* unit such as "<code>14.5sp</code>".
* Available units are: px (pixels), dp (density-independent pixels),
* sp (scaled pixels based on preferred font size), in (inches), and
* mm (millimeters).
* <p>May be a fractional value, which is a floating point number appended with
* either % or %p, such as "<code>14.5%</code>".
* The % suffix always means a percentage of the base size;
* the optional %p suffix provides a size relative to some parent container.
*
* @attr name android:gradientRadius
*/
public static final int GradientColor_android_gradientRadius=5;
/**
* <p>
* @attr description
* Defines the tile mode of the gradient. SweepGradient doesn't support tiling.
*
* <p>Must be one of the following constant values.</p>
* <table>
* <colgroup align="left" />
* <colgroup align="left" />
* <colgroup align="left" />
* <tr><th>Constant</th><th>Value</th><th>Description</th></tr>
* <tr><td>clamp</td><td>0</td><td></td></tr>
* <tr><td>disabled</td><td>ffffffff</td><td></td></tr>
* <tr><td>mirror</td><td>2</td><td></td></tr>
* <tr><td>repeat</td><td>1</td><td></td></tr>
* </table>
*
* @attr name android:tileMode
*/
public static final int GradientColor_android_tileMode=6;
/**
* <p>
* @attr description
* Optional center color.
*
* <p>May be a color value, in the form of "<code>#<i>rgb</i></code>",
* "<code>#<i>argb</i></code>", "<code>#<i>rrggbb</i></code>", or
* "<code>#<i>aarrggbb</i></code>".
*
* @attr name android:centerColor
*/
public static final int GradientColor_android_centerColor=7;
/**
* <p>
* @attr description
* X coordinate of the start point origin of the gradient.
* Defined in same coordinates as the path itself
*
* <p>May be a floating point value, such as "<code>1.2</code>".
*
* @attr name android:startX
*/
public static final int GradientColor_android_startX=8;
/**
* <p>
* @attr description
* Y coordinate of the start point of the gradient within the shape.
* Defined in same coordinates as the path itself
*
* <p>May be a floating point value, such as "<code>1.2</code>".
*
* @attr name android:startY
*/
public static final int GradientColor_android_startY=9;
/**
* <p>
* @attr description
* X coordinate of the end point origin of the gradient.
* Defined in same coordinates as the path itself
*
* <p>May be a floating point value, such as "<code>1.2</code>".
*
* @attr name android:endX
*/
public static final int GradientColor_android_endX=10;
/**
* <p>
* @attr description
* Y coordinate of the end point of the gradient within the shape.
* Defined in same coordinates as the path itself
*
* <p>May be a floating point value, such as "<code>1.2</code>".
*
* @attr name android:endY
*/
public static final int GradientColor_android_endY=11;
/**
* Attributes that can be used with a GradientColorItem.
* <p>Includes the following attributes:</p>
* <table>
* <colgroup align="left" />
* <colgroup align="left" />
* <tr><th>Attribute</th><th>Description</th></tr>
* <tr><td><code>{@link #GradientColorItem_android_color android:color}</code></td><td></td></tr>
* <tr><td><code>{@link #GradientColorItem_android_offset android:offset}</code></td><td></td></tr>
* </table>
* @see #GradientColorItem_android_color
* @see #GradientColorItem_android_offset
*/
public static final int[] GradientColorItem={
0x010101a5, 0x01010514
};
/**
* <p>
* @attr description
* The current color for the offset inside the gradient.
*
* <p>May be a color value, in the form of "<code>#<i>rgb</i></code>",
* "<code>#<i>argb</i></code>", "<code>#<i>rrggbb</i></code>", or
* "<code>#<i>aarrggbb</i></code>".
*
* @attr name android:color
*/
public static final int GradientColorItem_android_color=0;
/**
* <p>
* @attr description
* The offset (or ratio) of this current color item inside the gradient.
* The value is only meaningful when it is between 0 and 1.
*
* <p>May be a floating point value, such as "<code>1.2</code>".
*
* @attr name android:offset
*/
public static final int GradientColorItem_android_offset=1;
/**
* Attributes that can be used with a LoadingImageView.
* <p>Includes the following attributes:</p>
* <table>
* <colgroup align="left" />
* <colgroup align="left" />
* <tr><th>Attribute</th><th>Description</th></tr>
* <tr><td><code>{@link #LoadingImageView_circleCrop com.renan.bem_aventurancas:circleCrop}</code></td><td></td></tr>
* <tr><td><code>{@link #LoadingImageView_imageAspectRatio com.renan.bem_aventurancas:imageAspectRatio}</code></td><td></td></tr>
* <tr><td><code>{@link #LoadingImageView_imageAspectRatioAdjust com.renan.bem_aventurancas:imageAspectRatioAdjust}</code></td><td></td></tr>
* </table>
* @see #LoadingImageView_circleCrop
* @see #LoadingImageView_imageAspectRatio
* @see #LoadingImageView_imageAspectRatioAdjust
*/
public static final int[] LoadingImageView={
0x7f010002, 0x7f01000f, 0x7f010010
};
/**
* <p>This symbol is the offset where the {@link com.renan.bem_aventurancas.R.attr#circleCrop}
* attribute's value can be found in the {@link #LoadingImageView} array.
*
* <p>May be a boolean value, such as "<code>true</code>" or
* "<code>false</code>".
*
* @attr name com.renan.bem_aventurancas:circleCrop
*/
public static final int LoadingImageView_circleCrop=0;
/**
* <p>This symbol is the offset where the {@link com.renan.bem_aventurancas.R.attr#imageAspectRatio}
* attribute's value can be found in the {@link #LoadingImageView} array.
*
* <p>May be a floating point value, such as "<code>1.2</code>".
*
* @attr name com.renan.bem_aventurancas:imageAspectRatio
*/
public static final int LoadingImageView_imageAspectRatio=1;
/**
* <p>This symbol is the offset where the {@link com.renan.bem_aventurancas.R.attr#imageAspectRatioAdjust}
* attribute's value can be found in the {@link #LoadingImageView} array.
*
* <p>Must be one of the following constant values.</p>
* <table>
* <colgroup align="left" />
* <colgroup align="left" />
* <colgroup align="left" />
* <tr><th>Constant</th><th>Value</th><th>Description</th></tr>
* <tr><td>adjust_height</td><td>2</td><td></td></tr>
* <tr><td>adjust_width</td><td>1</td><td></td></tr>
* <tr><td>none</td><td>0</td><td></td></tr>
* </table>
*
* @attr name com.renan.bem_aventurancas:imageAspectRatioAdjust
*/
public static final int LoadingImageView_imageAspectRatioAdjust=2;
/**
* Attributes that can be used with a SignInButton.
* <p>Includes the following attributes:</p>
* <table>
* <colgroup align="left" />
* <colgroup align="left" />
* <tr><th>Attribute</th><th>Description</th></tr>
* <tr><td><code>{@link #SignInButton_buttonSize com.renan.bem_aventurancas:buttonSize}</code></td><td></td></tr>
* <tr><td><code>{@link #SignInButton_colorScheme com.renan.bem_aventurancas:colorScheme}</code></td><td></td></tr>
* <tr><td><code>{@link #SignInButton_scopeUris com.renan.bem_aventurancas:scopeUris}</code></td><td></td></tr>
* </table>
* @see #SignInButton_buttonSize
* @see #SignInButton_colorScheme
* @see #SignInButton_scopeUris
*/
public static final int[] SignInButton={
0x7f010001, 0x7f010003, 0x7f010018
};
/**
* <p>This symbol is the offset where the {@link com.renan.bem_aventurancas.R.attr#buttonSize}
* attribute's value can be found in the {@link #SignInButton} array.
*
* <p>May be a reference to another resource, in the form
* "<code>@[+][<i>package</i>:]<i>type</i>/<i>name</i></code>" or a theme
* attribute in the form
* "<code>?[<i>package</i>:]<i>type</i>/<i>name</i></code>".
* <p>Must be one of the following constant values.</p>
* <table>
* <colgroup align="left" />
* <colgroup align="left" />
* <colgroup align="left" />
* <tr><th>Constant</th><th>Value</th><th>Description</th></tr>
* <tr><td>icon_only</td><td>2</td><td></td></tr>
* <tr><td>standard</td><td>0</td><td></td></tr>
* <tr><td>wide</td><td>1</td><td></td></tr>
* </table>
*
* @attr name com.renan.bem_aventurancas:buttonSize
*/
public static final int SignInButton_buttonSize=0;
/**
* <p>This symbol is the offset where the {@link com.renan.bem_aventurancas.R.attr#colorScheme}
* attribute's value can be found in the {@link #SignInButton} array.
*
* <p>May be a reference to another resource, in the form
* "<code>@[+][<i>package</i>:]<i>type</i>/<i>name</i></code>" or a theme
* attribute in the form
* "<code>?[<i>package</i>:]<i>type</i>/<i>name</i></code>".
* <p>Must be one of the following constant values.</p>
* <table>
* <colgroup align="left" />
* <colgroup align="left" />
* <colgroup align="left" />
* <tr><th>Constant</th><th>Value</th><th>Description</th></tr>
* <tr><td>auto</td><td>2</td><td></td></tr>
* <tr><td>dark</td><td>0</td><td></td></tr>
* <tr><td>light</td><td>1</td><td></td></tr>
* </table>
*
* @attr name com.renan.bem_aventurancas:colorScheme
*/
public static final int SignInButton_colorScheme=1;
/**
* <p>This symbol is the offset where the {@link com.renan.bem_aventurancas.R.attr#scopeUris}
* attribute's value can be found in the {@link #SignInButton} array.
*
* <p>May be a reference to another resource, in the form
* "<code>@[+][<i>package</i>:]<i>type</i>/<i>name</i></code>" or a theme
* attribute in the form
* "<code>?[<i>package</i>:]<i>type</i>/<i>name</i></code>".
* <p>May be a string value, using '\\;' to escape characters such as
* '\\n' or '\\uxxxx' for a unicode character;
*
* @attr name com.renan.bem_aventurancas:scopeUris
*/
public static final int SignInButton_scopeUris=2;
}
} | [
"renanrochamorais@outlook.com"
] | renanrochamorais@outlook.com |
1f09e4e5019a14bfdf66a3084d1ea58a88e750ea | 7e7312070aba187fd8c0e5703b111dde01a28045 | /modules/gesaduan-war/src/main/java/es/mercadona/gesaduan/jpa/tarics/v1/ReasReemplazarJPA.java | 2c1dd9a2192d93432fff88a152380de04ae861f2 | [] | no_license | trinimorillas/gesaduan_online_git | 0ffd0c64846c8be529f1aea992ec4c569bf3cdd2 | c8529f2e4cb88b116f67cf43c63f1284e54df32a | refs/heads/master | 2023-07-30T20:08:26.093976 | 2021-07-28T09:57:01 | 2021-07-28T09:57:01 | 411,603,520 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,691 | java | package es.mercadona.gesaduan.jpa.tarics.v1;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
@Entity
@Table(name = "D_CODIGO_REA")
public class ReasReemplazarJPA implements Serializable{
/**
*
*/
private static final long serialVersionUID = 1L;
@Id
@Column(name = "COD_V_REA")
private String codigoRea;
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "FEC_D_CREACION", insertable=false)
private Date fechaCreacion;
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "FEC_D_MODIFICACION", insertable=false)
private Date fechaModificacion;
@Column(name = "COD_V_APLICACION")
private String codigoAplicacion;
@Column(name = "COD_V_USUARIO_CREACION")
private String usuarioCreacion;
@Column(name = "COD_V_USUARIO_MODIFICACION")
private String usuarioModificacion;
@OneToMany(
mappedBy = "reas",
cascade = CascadeType.ALL,
orphanRemoval = true
)
List<ReasProductosJPA> reasDeProductos = new ArrayList<>();
public String getCodigoRea() {
return codigoRea;
}
public void setCodigoRea(String codigoRea) {
this.codigoRea = codigoRea;
}
public Date getFechaCreacion() {
return fechaCreacion;
}
public void setFechaCreacion(Date fechaCreacion) {
this.fechaCreacion = fechaCreacion;
}
public Date getFechaModificacion() {
return fechaModificacion;
}
public void setFechaModificacion(Date fechaModificacion) {
this.fechaModificacion = fechaModificacion;
}
public String getCodigoAplicacion() {
return codigoAplicacion;
}
public void setCodigoAplicacion(String codigoAplicacion) {
this.codigoAplicacion = codigoAplicacion;
}
public String getUsuarioCreacion() {
return usuarioCreacion;
}
public void setUsuarioCreacion(String usuarioCreacion) {
this.usuarioCreacion = usuarioCreacion;
}
public String getUsuarioModificacion() {
return usuarioModificacion;
}
public void setUsuarioModificacion(String usuarioModificacion) {
this.usuarioModificacion = usuarioModificacion;
}
public List<ReasProductosJPA> getReasDeProductos() {
return reasDeProductos;
}
public void setReasDeProductos(List<ReasProductosJPA> reasDeProductos) {
this.reasDeProductos = reasDeProductos;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((codigoAplicacion == null) ? 0 : codigoAplicacion.hashCode());
result = prime * result + ((codigoRea == null) ? 0 : codigoRea.hashCode());
result = prime * result + ((fechaCreacion == null) ? 0 : fechaCreacion.hashCode());
result = prime * result + ((fechaModificacion == null) ? 0 : fechaModificacion.hashCode());
result = prime * result + ((reasDeProductos == null) ? 0 : reasDeProductos.hashCode());
result = prime * result + ((usuarioCreacion == null) ? 0 : usuarioCreacion.hashCode());
result = prime * result + ((usuarioModificacion == null) ? 0 : usuarioModificacion.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
ReasReemplazarJPA other = (ReasReemplazarJPA) obj;
if (codigoAplicacion == null) {
if (other.codigoAplicacion != null)
return false;
} else if (!codigoAplicacion.equals(other.codigoAplicacion))
return false;
if (codigoRea == null) {
if (other.codigoRea != null)
return false;
} else if (!codigoRea.equals(other.codigoRea))
return false;
if (fechaCreacion == null) {
if (other.fechaCreacion != null)
return false;
} else if (!fechaCreacion.equals(other.fechaCreacion))
return false;
if (fechaModificacion == null) {
if (other.fechaModificacion != null)
return false;
} else if (!fechaModificacion.equals(other.fechaModificacion))
return false;
if (reasDeProductos == null) {
if (other.reasDeProductos != null)
return false;
} else if (!reasDeProductos.equals(other.reasDeProductos))
return false;
if (usuarioCreacion == null) {
if (other.usuarioCreacion != null)
return false;
} else if (!usuarioCreacion.equals(other.usuarioCreacion))
return false;
if (usuarioModificacion == null) {
if (other.usuarioModificacion != null)
return false;
} else if (!usuarioModificacion.equals(other.usuarioModificacion))
return false;
return true;
}
}
| [
"raul.chover-selles@capgemini.com"
] | raul.chover-selles@capgemini.com |
001ae712bfff4ff55c037e28db0bca2ee7885a93 | 33b57c7031d40790df941752ed22f60aaa69ff2f | /src/controller/ConnectServer.java | 30a9e03e500404e065fe805af41de5dd43e26391 | [] | no_license | ShaliovArtiom/AIPOS | bbd1941e6c3ae54317dd143213c836325c02168c | 40c56ccf17753a6c79d21658baf3bb7bfe7999e5 | refs/heads/master | 2021-08-11T13:10:35.384571 | 2017-11-13T19:10:58 | 2017-11-13T19:10:58 | 110,590,107 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,635 | java | package controller;
import view.Frame;
import view.MemoFrame;
import javax.swing.*;
import java.io.*;
/**
* Класс, реализующий соединение с сервером
* @author ShaliovArtiom, TruntsVitalij
*/
public class ConnectServer {
/**
* Запрос, который обрабатывает сервер
*/
private static Request request;
/**
* Окно, предназначенное для вывода диалога с сервером
*/
private MemoFrame memoFrame;
/**
* Конструктор, реализующий отправку запроса серверу
* @param argc массив строк, переданный как аргумент командной строкой
* @param req запрос, обрабатываемый сервером
* @throws Exception ошибка отправки запроса
*/
public ConnectServer(String argc[], String req) throws Exception {
memoFrame = new MemoFrame(new JFrame());
request = new Request(memoFrame);
try {
String header = null;
if (argc.length == 0) {
header = req;
}
memoFrame.printInfo("Запрос: \n" + header);
String answer = request.sendRequest(header);
memoFrame.printInfo("Ответ от сервера: \n");
memoFrame.printInfo(answer);
memoFrame.printInfoLogFail();
} catch (IOException e) {
System.err.println(e.getMessage());
e.getCause().printStackTrace();
}
}
} | [
"shaliov.artiom@mail.ru"
] | shaliov.artiom@mail.ru |
1c1deaf8e33816843c94ca4de7e4df223cb58184 | ea70247aec6dc5c974a9a5a34623d418cd917593 | /plugins/webjars/src/main/java/juzu/plugin/webjars/WebJar.java | 7953ec94ddd976a457ae12ce3c603822b0e0c846 | [] | no_license | JN88/juzu | 40206b1d02247e270ff668ad3ac6d9ef395834d5 | 4e2d2ed2d002ac40103d7be8886db7d91387420f | refs/heads/master | 2020-12-30T23:08:18.220122 | 2014-02-11T09:06:10 | 2014-02-11T09:19:38 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,187 | java | /*
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package juzu.plugin.webjars;
/**
* Specify a webjar by its coordinates (artifactId, version), for example <code>@WebJar("jquery", "2.0.0")</code>.
*
* @author Julien Viet
*/
public @interface WebJar {
/**
* The webjar artifact id.
*
* @return the artifact id
*/
String value();
/**
* The optional version.
*
* @return the version
*/
String version() default "";
}
| [
"julien@julienviet.com"
] | julien@julienviet.com |
4cda5a1db358564d905ce8a76fb68b3f1ba57d5b | 71e8533d5cfc7f6d061596b51b6db7a182d0f89c | /.svn/pristine/05/0525768fa22809bca35cd3290d617975af928c29.svn-base | c310ce89f1494e8ef59ca212d49e0756e3cfc290 | [] | no_license | github188/ecms | 04e29a3a3f926242f5690322304822ea7a2b7807 | 9dc62cbca1e8b4c0944f89bbce6ad7bb7148f22f | refs/heads/master | 2020-03-20T00:30:00.280243 | 2018-03-07T03:26:50 | 2018-03-07T03:26:50 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,127 | package com.ecaray.ecms.commons.exception;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.HttpStatus;
import org.springframework.http.converter.HttpMessageNotReadableException;
import org.springframework.web.HttpMediaTypeNotSupportedException;
import org.springframework.web.HttpRequestMethodNotSupportedException;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.ResponseStatus;
import com.ecaray.ecms.commons.constant.Result;
/**
* com.ecaray.owms.commons.exception
* Author :zhxy
* 2016/12/2 11:51
* 说明:Controller切面,捕获全局异常并返回统一错误码,
* 这里的错误码因为前段人员处理不了,只能返回200, 然后讲权限码放入 code来处理
*/
@ControllerAdvice
@ResponseBody
public class ExceptionAdvice {
public static Logger logger = LoggerFactory.getLogger(ExceptionAdvice.class);
/**
* Author :zhxy
* 说明:400 - Bad Request
*/
@ResponseStatus(HttpStatus.OK)
@ExceptionHandler(HttpMessageNotReadableException.class)
public Result handleHttpMessageNotReadableException(HttpMessageNotReadableException e) {
logger.error("json 参数解析失败", e);
return Result.error(HttpStatus.BAD_REQUEST.value()+"","请求参数解析失败!");
}
/**
* Author :zhxy
* 说明:401 身份验证错误
*/
@ResponseStatus(HttpStatus.OK)
@ExceptionHandler(AuthorizationException.class)
public Result authorizationException(Exception e){
logger.error("身份验证异常", "user authority error");
return Result.error(HttpStatus.UNAUTHORIZED.value()+"","身份验证失败!");
}
/**
* Author :zhxy
* 405 - Method Not Allowed
*/
// @ResponseStatus(HttpStatus.METHOD_NOT_ALLOWED)
@ResponseStatus(HttpStatus.OK)
@ExceptionHandler(HttpRequestMethodNotSupportedException.class)
public Result handleHttpRequestMethodNotSupportedException(HttpRequestMethodNotSupportedException e) {
logger.error("不支持当前请求方法", e);
return Result.error(HttpStatus.METHOD_NOT_ALLOWED.value()+"","请求方法错误!");
}
/**
* Author :zhxy
* 415 - Unsupported Media Type
*/
// @ResponseStatus(HttpStatus.UNSUPPORTED_MEDIA_TYPE)
@ResponseStatus(HttpStatus.OK)
@ExceptionHandler(HttpMediaTypeNotSupportedException.class)
public Result handleHttpMediaTypeNotSupportedException(Exception e) {
logger.error("不支持当前媒体类型", e);
return Result.error(HttpStatus.UNSUPPORTED_MEDIA_TYPE.value()+"","不支持当前媒体类型!");
}
/**
* Author :zhxy
* 500 - Internal Server Error
*/
@ResponseStatus(HttpStatus.OK)
@ExceptionHandler(Exception.class)
public Result handleException(Exception e) {
logger.error("服务运行异常", e);
return Result.error(HttpStatus.INTERNAL_SERVER_ERROR.value()+"","服务运行异常!");
}
/**
* Author :zhxy
* 说明:417 flow submit error
*/
// @ResponseStatus(HttpStatus.EXPECTATION_FAILED)
@ResponseStatus(HttpStatus.OK)
@ExceptionHandler(FlowSubmitException.class)
public Result handleFlowSubmitException(Exception e){
logger.error("流程提交异常", e);
return Result.error(HttpStatus.UNSUPPORTED_MEDIA_TYPE.value()+"","流程提交异常!" + e.getMessage());
}
@ResponseStatus(HttpStatus.OK)
@ExceptionHandler(ProcessSubmitException.class)
public Result handleProcessSubmitException(RuntimeException e){
logger.error("流程初始化异常", e);
return Result.error(HttpStatus.UNSUPPORTED_MEDIA_TYPE.value()+"", e.getMessage());
}
@ResponseStatus(HttpStatus.OK)
@ExceptionHandler(ReSubmitException.class)
public Result reSubmitException(RuntimeException e){
return Result.failed(e.getMessage());
}
} | [
"lshstyle@163.com"
] | lshstyle@163.com | |
5c5790d3d0d5c4aa2ad11bb63d6419f9953f7a7a | 123d1715097020ce496032b26d786a36993054eb | /src/test/java/com/gargoylesoftware/htmlunit/html/HtmlTableTest.java | 16d973c6e3f9bf5b797a333e5ddc56f52af0ba52 | [
"Apache-2.0"
] | permissive | 8nevil8/htmlunit | 5db9e1d5984579817b6e7abc02477c561d14b8bd | 1f386be40ee0c9e0e4747205c03f2535acaeeaa9 | refs/heads/master | 2022-07-24T01:16:41.483396 | 2011-12-06T12:46:24 | 2011-12-06T12:46:24 | 2,924,321 | 0 | 0 | NOASSERTION | 2022-07-07T23:03:37 | 2011-12-06T11:41:02 | JavaScript | UTF-8 | Java | false | false | 15,260 | java | /*
* Copyright (c) 2002-2009 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.gargoylesoftware.htmlunit.html;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertSame;
import java.util.ArrayList;
import java.util.List;
import org.junit.Assert;
import org.junit.Test;
import com.gargoylesoftware.htmlunit.BrowserVersion;
import com.gargoylesoftware.htmlunit.WebTestCase;
/**
* Tests for {@link HtmlTable}.
*
* @version $Revision: 4781 $
* @author <a href="mailto:mbowler@GargoyleSoftware.com">Mike Bowler</a>
* @author Ahmed Ashour
* @author Marc Guillemot
*/
public class HtmlTableTest extends WebTestCase {
/**
* Tests getTableCell(int,int).
* @exception Exception If the test fails
*/
@Test
public void testGetTableCell() throws Exception {
final String htmlContent
= "<html><head><title>foo</title></head><body>\n"
+ "<table id='table1' summary='Test table'>\n"
+ "<tr><td>cell1</td><td>cell2</td><td rowspan='2'>cell4</td></tr>\n"
+ "<tr><td colspan='2'>cell3</td></tr>\n"
+ "</table>\n"
+ "</body></html>";
final HtmlPage page = loadPage(htmlContent);
final HtmlTable table = page.getHtmlElementById("table1");
final HtmlTableCell cell1 = table.getCellAt(0, 0);
Assert.assertEquals("cell1 contents", "cell1", cell1.asText());
final HtmlTableCell cell2 = table.getCellAt(0, 1);
Assert.assertEquals("cell2 contents", "cell2", cell2.asText());
final HtmlTableCell cell3 = table.getCellAt(1, 0);
Assert.assertEquals("cell3 contents", "cell3", cell3.asText());
assertSame("cells (1,0) and (1,1)", cell3, table.getCellAt(1, 1));
final HtmlTableCell cell4 = table.getCellAt(0, 2);
Assert.assertEquals("cell4 contents", "cell4", cell4.asText());
assertSame("cells (0,2) and (1,2)", cell4, table.getCellAt(1, 2));
}
/**
* Tests getCellAt(int,int) with colspan.
* @exception Exception If the test fails
*/
@Test
public void testGetCellAt() throws Exception {
final String htmlContent
= "<html><head><title>foo</title></head><body>\n"
+ "<table id='table1'>\n"
+ "<tr><td>row 1 col 1</td></tr>\n"
+ "<tr><td>row 2 col 1</td><td>row 2 col 2</td></tr>\n"
+ "<tr><td colspan='1'>row 3 col 1&2</td></tr>\n"
+ "</table>\n"
+ "</body></html>";
final HtmlPage page = loadPage(htmlContent);
final HtmlTable table = page.getHtmlElementById("table1");
final HtmlTableCell cell1 = table.getCellAt(0, 0);
Assert.assertEquals("cell (0,0) contents", "row 1 col 1", cell1.asText());
final HtmlTableCell cell2 = table.getCellAt(0, 1);
Assert.assertEquals("cell (0,1) contents", null, cell2);
final HtmlTableCell cell3 = table.getCellAt(1, 0);
Assert.assertEquals("cell (1,0) contents", "row 2 col 1", cell3.asText());
final HtmlTableCell cell4 = table.getCellAt(1, 1);
Assert.assertEquals("cell (1,1) contents", "row 2 col 2", cell4.asText());
final HtmlTableCell cell5 = table.getCellAt(2, 0);
Assert.assertEquals("cell (2, 0) contents", "row 3 col 1&2", cell5.asText());
final HtmlTableCell cell6 = table.getCellAt(2, 1);
Assert.assertEquals("cell (2, 1) contents", null, cell6);
}
/**
* Tests getTableCell(int,int) for a cell that doesn't exist.
* @exception Exception If the test fails
*/
@Test
public void testGetTableCell_NotFound() throws Exception {
final String htmlContent
= "<html><head><title>foo</title></head><body>\n"
+ "<table id='table1' summary='Test table'>\n"
+ "<tr><td>cell1</td><td>cell2</td><td rowspan='2'>cell4</td></tr>\n"
+ "<tr><td colspan='2'>cell3</td></tr>\n"
+ "</table>\n"
+ "</body></html>";
final HtmlPage page = loadPage(htmlContent);
final HtmlTable table = page.getHtmlElementById("table1");
final HtmlTableCell cell = table.getCellAt(99, 0);
Assert.assertNull("cell", cell);
}
/**
* @throws Exception if the test fails
*/
@Test
public void testGetTableRows() throws Exception {
final String htmlContent
= "<html><head><title>foo</title></head><body>\n"
+ "<table id='table1'>\n"
+ "<tr id='row1'><td>cell1</td></tr>\n"
+ "<tr id='row2'><td>cell2</td></tr>\n"
+ "<tr id='row3'><td>cell3</td></tr>\n"
+ "<tr id='row4'><td>cell4</td></tr>\n"
+ "<tr id='row5'><td>cell5</td></tr>\n"
+ "<tr id='row6'><td>cell6</td></tr>\n"
+ "</table>\n"
+ "</body></html>";
final HtmlPage page = loadPage(htmlContent);
final HtmlTable table = page.getHtmlElementById("table1");
final List<HtmlTableRow> expectedRows = new ArrayList<HtmlTableRow>();
expectedRows.add(table.getRowById("row1"));
expectedRows.add(table.getRowById("row2"));
expectedRows.add(table.getRowById("row3"));
expectedRows.add(table.getRowById("row4"));
expectedRows.add(table.getRowById("row5"));
expectedRows.add(table.getRowById("row6"));
assertEquals(expectedRows, table.getRows());
}
/**
* @throws Exception if the test fails
*/
@Test
public void testGetTableRows_WithHeadBodyFoot() throws Exception {
final String htmlContent
= "<html><head><title>foo</title></head><body>\n"
+ "<table id='table1'>\n"
+ "<thead>\n"
+ " <tr id='row1'><td>cell1</td></tr>\n"
+ " <tr id='row2'><td>cell2</td></tr>\n"
+ "</thead>\n"
+ "<tbody>\n"
+ " <tr id='row3'><td>cell3</td></tr>\n"
+ " <tr id='row4'><td>cell4</td></tr>\n"
+ "</tbody>\n"
+ "<tfoot>\n"
+ " <tr id='row5'><td>cell5</td></tr>\n"
+ " <tr id='row6'><td>cell6</td></tr>\n"
+ "</tfoot>\n"
+ "</table>\n"
+ "</body></html>";
final HtmlPage page = loadPage(htmlContent);
final HtmlTable table = page.getHtmlElementById("table1");
final List<HtmlTableRow> expectedRows = new ArrayList<HtmlTableRow>();
expectedRows.add(table.getRowById("row1"));
expectedRows.add(table.getRowById("row2"));
expectedRows.add(table.getRowById("row3"));
expectedRows.add(table.getRowById("row4"));
expectedRows.add(table.getRowById("row5"));
expectedRows.add(table.getRowById("row6"));
assertEquals(expectedRows, table.getRows());
}
/**
* @throws Exception if the test fails
*/
@Test
public void testRowGroupings_AllDefined() throws Exception {
final String htmlContent
= "<html><head><title>foo</title></head><body>\n"
+ "<table id='table1'>\n"
+ "<thead>\n"
+ " <tr id='row1'><td>cell1</td></tr>\n"
+ " <tr id='row2'><td>cell2</td></tr>\n"
+ "</thead>\n"
+ "<tbody>\n"
+ " <tr id='row3'><td>cell3</td></tr>\n"
+ "</tbody>\n"
+ "<tbody>\n"
+ " <tr id='row4'><td>cell4</td></tr>\n"
+ "</tbody>\n"
+ "<tfoot>\n"
+ " <tr id='row5'><td>cell5</td></tr>\n"
+ " <tr id='row6'><td>cell6</td></tr>\n"
+ "</tfoot>\n"
+ "</table>\n"
+ "</body></html>";
final HtmlPage page = loadPage(htmlContent);
final HtmlTable table = page.getHtmlElementById("table1");
assertNotNull(table.getHeader());
assertNotNull(table.getFooter());
assertEquals(2, table.getBodies().size());
}
/**
* Check to ensure that the proper numbers of tags show up. Note that an extra tbody
* will be inserted to be in compliance with the common browsers.
* @throws Exception if the test fails
*/
@Test
public void testRowGroupings_NoneDefined()
throws Exception {
final String htmlContent
= "<html><head><title>foo</title></head><body>\n"
+ "<table id='table1'>\n"
+ " <tr id='row1'><td>cell1</td></tr>\n"
+ " <tr id='row2'><td>cell2</td></tr>\n"
+ " <tr id='row3'><td>cell3</td></tr>\n"
+ " <tr id='row4'><td>cell4</td></tr>\n"
+ " <tr id='row5'><td>cell5</td></tr>\n"
+ " <tr id='row6'><td>cell6</td></tr>\n"
+ "</table>\n"
+ "</body></html>";
final HtmlPage page = loadPage(htmlContent);
final HtmlTable table = page.getHtmlElementById("table1");
assertEquals(null, table.getHeader());
assertEquals(null, table.getFooter());
assertEquals(1, table.getBodies().size());
}
/**
* @throws Exception if the test fails
*/
@Test
public void testGetCaptionText() throws Exception {
final String htmlContent
= "<html><head><title>foo</title></head><body>\n"
+ "<table id='table1' summary='Test table'>\n"
+ "<caption>MyCaption</caption>\n"
+ "<tr><td>cell1</td><td>cell2</td><td rowspan='2'>cell4</td></tr>\n"
+ "<tr><td colspan='2'>cell3</td></tr>\n"
+ "</table>\n"
+ "</body></html>";
final HtmlPage page = loadPage(htmlContent);
final HtmlTable table = page.getHtmlElementById("table1");
assertEquals("MyCaption", table.getCaptionText());
}
/**
* The common browsers will automatically insert tbody tags around the table rows if
* one wasn't specified. Ensure that we do this too. Also ensure that extra ones
* aren't inserted if a tbody was already there.
* @throws Exception if the test fails
*/
@Test
public void testInsertionOfTbodyTags() throws Exception {
final String htmlContent
= "<html><head><title>foo</title></head><body>\n"
+ "<table>\n"
+ "<tr><td id='cell1'>cell1</td></tr>\n"
+ "</table>\n"
+ "<table><tbody>\n"
+ "<tr><td id='cell2'>cell1</td></tr>\n"
+ "</tbody></table>\n"
+ "</body></html>";
final HtmlPage page = loadPage(htmlContent);
// Check that a <tbody> was inserted properly
final HtmlTableDataCell cell1 = page.getHtmlElementById("cell1");
assertTrue(HtmlTableRow.class.isInstance(cell1.getParentNode()));
assertTrue(HtmlTableBody.class.isInstance(cell1.getParentNode().getParentNode()));
assertTrue(HtmlTable.class.isInstance(cell1.getParentNode().getParentNode().getParentNode()));
// Check that the existing <tbody> wasn't messed up.
final HtmlTableDataCell cell2 = page.getHtmlElementById("cell2");
assertTrue(HtmlTableRow.class.isInstance(cell2.getParentNode()));
assertTrue(HtmlTableBody.class.isInstance(cell2.getParentNode().getParentNode()));
assertTrue(HtmlTable.class.isInstance(cell2.getParentNode().getParentNode().getParentNode()));
}
/**
* Regression test for bug 1210751: JavaScript inside <tt><table></tt> run twice.
* @throws Exception if the test fails
*/
@Test
public void testJSInTable() throws Exception {
final String content
= "<html><head><title>foo</title></head><body>\n"
+ "<table>\n"
+ "<tr><td>cell1</td></tr>\n"
+ "<script>alert('foo');</script>\n"
+ "<tr><td>cell1</td></tr>\n"
+ "</table>\n"
+ "<div id='div1'>foo</div>\n"
+ "<script>alert(document.getElementById('div1').parentNode.tagName);</script>\n"
+ "</body></html>";
final String[] expectedAlerts = {"foo", "BODY"};
createTestPageForRealBrowserIfNeeded(content, expectedAlerts);
final List<String> collectedAlerts = new ArrayList<String>();
loadPage(content, collectedAlerts);
assertEquals(expectedAlerts, collectedAlerts);
}
/**
* @throws Exception if the test fails
*/
@Test
public void testSimpleScriptable() throws Exception {
final String html = "<html><head>\n"
+ "<script>\n"
+ " function test() {\n"
+ " alert(document.getElementById('myId'));\n"
+ " }\n"
+ "</script>\n"
+ "</head><body onload='test()'>\n"
+ " <table id='myId'/>\n"
+ "</body></html>";
final String[] expectedAlerts = {"[object HTMLTableElement]"};
final List<String> collectedAlerts = new ArrayList<String>();
createTestPageForRealBrowserIfNeeded(html, expectedAlerts);
final HtmlPage page = loadPage(BrowserVersion.FIREFOX_2, html, collectedAlerts);
assertTrue(HtmlTable.class.isInstance(page.getHtmlElementById("myId")));
assertEquals(expectedAlerts, collectedAlerts);
}
/**
* @throws Exception if the test fails
*/
@Test
public void asText() throws Exception {
final String html = "<html><head>\n"
+ "</head><body>\n"
+ " <table id='myId'>\n"
+ " <caption>This is the caption</caption>\n"
+ " <tr>\n"
+ " <td>cell 1,1</td>\n"
+ " <td>cell 1,2</td>\n"
+ " </tr>\n"
+ " <tr>\n"
+ " <td>cell 2,1</td>\n"
+ " <td>cell 2,2</td>\n"
+ " </tr>\n"
+ " </table>\n"
+ "</body></html>";
final HtmlPage page = loadPage(html);
final HtmlElement table = page.getHtmlElementById("myId");
final String expectedText = "This is the caption" + LINE_SEPARATOR
+ "cell 1,1\tcell 1,2" + LINE_SEPARATOR
+ "cell 2,1\tcell 2,2";
assertEquals(expectedText, table.asText());
}
/**
* @throws Exception if the test fails
*/
@Test
public void asXml_emptyTable() throws Exception {
final String html = "<html>\n"
+ "<head/>\n"
+ "<body>\n"
+ "<div style=\"visibility: hidden\">\n"
+ "<table>\n"
+ "</table>\n"
+ "</div>\n"
+ "after the div\n"
+ "</body>\n"
+ "</html>";
final HtmlPage page = loadPage(html);
assertTrue(page.asXml().contains("</table>"));
}
}
| [
"kk@kohsuke.org"
] | kk@kohsuke.org |
56ea14529d08266086f6f84365048c53ff6a7b38 | 7b493250111e86a58fdeba55603697661edc0eb4 | /bundle/src/main/java/com/adobe/acs/commons/ccvar/util/ContentVariableReplacementUtil.java | 4f9d5293b099e07391786245c645f703752487b7 | [
"Apache-2.0"
] | permissive | rbotha78/acs-aem-commons | 1d96b37157cbf5f624d81789216a56077979e3d6 | bfe1c01ee1bb5e6af2fa02af7fb66e8975423ee9 | refs/heads/master | 2022-06-30T04:53:53.431252 | 2022-05-31T07:02:36 | 2022-05-31T07:02:36 | 125,922,488 | 0 | 0 | Apache-2.0 | 2022-05-31T21:52:06 | 2018-03-19T21:27:04 | Java | UTF-8 | Java | false | false | 5,937 | java | /*
* #%L
* ACS AEM Commons Bundle
* %%
* Copyright (C) 2021 Adobe
* %%
* 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.
* #L%
*/
package com.adobe.acs.commons.ccvar.util;
import com.adobe.acs.commons.ccvar.TransformAction;
import org.apache.commons.lang3.StringUtils;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import static com.adobe.acs.commons.ccvar.impl.PropertyConfigServiceImpl.PARSER_SEPARATOR;
/**
* Util class used to provide helper methods for finding and replacing the tokens used in this feature.
*/
public class ContentVariableReplacementUtil {
private static final Pattern PLACEHOLDER_PATTERN = Pattern.compile("\\(\\(([a-zA-Z0-9_:\\-]+\\.[a-zA-Z0-9_:\\-]+(![a-zA-Z0-9_:\\-]*)?)\\)\\)");
private static final Map<String, String> REQUIRED_ESCAPE = escapeMap();
private static final String PLACEHOLDER_BEGIN = "((";
private static final String PLACEHOLDER_END = "))";
private ContentVariableReplacementUtil() {
}
/**
* Takes the current key and returns it wrapped with the placeholder containers
*
* @param key The full input key
* @return The substring of the placeholder
*/
public static String getPlaceholder(String key) {
return PLACEHOLDER_BEGIN + key + PLACEHOLDER_END;
}
/**
* Checks if the passed map of variable replacements contains the key passed. It has an additional check for when
* the key contains an action.
*
* @param contentVariableReplacements Current map of content variable keys and values
* @param key Current property key
* @return Whether the map contains the key
*/
public static boolean hasKey(Map<String, Object> contentVariableReplacements, String key) {
if (StringUtils.contains(key, PARSER_SEPARATOR)) {
String keyWithoutAction = StringUtils.substringBefore(key, PARSER_SEPARATOR);
return contentVariableReplacements.containsKey(keyWithoutAction);
}
return contentVariableReplacements.containsKey(key);
}
/**
* Returns the value from the map based on the key. Handles the special case of when the key contains an action.
*
* @param contentVariableReplacements Current map of content variable keys and values
* @param key Current property key
* @return The value in the map
*/
public static Object getValue(Map<String, Object> contentVariableReplacements, String key) {
if (StringUtils.contains(key, PARSER_SEPARATOR)) {
String keyWithoutAction = StringUtils.substringBefore(key, PARSER_SEPARATOR);
return contentVariableReplacements.get(keyWithoutAction);
}
return contentVariableReplacements.get(key);
}
/**
* Takes the current string and returns the placeholder value. Ex: ((value))
*
* @param string The full input string
* @return A list of placeholders
*/
public static List<String> getKeys(String string) {
List<String> keys = new ArrayList<>();
Matcher matcher = PLACEHOLDER_PATTERN.matcher(string);
while (matcher.find()) {
keys.add(StringUtils.substringBetween(
StringUtils.defaultString(matcher.group()),
PLACEHOLDER_BEGIN,
PLACEHOLDER_END));
}
return keys;
}
/**
* Utility method to replace values and optionally execute actions on the values to be replaced. The default output
* of this method will include base escaping of volatile HTML entities. Actions can define whether they explicitly
* disable this base escaping.
*
* @param input The input string containing the placeholders
* @param key The key containing the property name and an optional action
* @param replacement The value to be replaced and optionally transformed
* @param action The action found in the placeholder key
* @return The fully replaced value
*/
public static String doReplacement(String input, String key, String replacement, TransformAction action) {
if (action != null) {
if (action.disableEscaping()) {
return input.replace(getPlaceholder(key), action.execute(replacement));
}
return input.replace(getPlaceholder(key), baseEscaping(action.execute(replacement)));
}
return input.replace(getPlaceholder(key), baseEscaping(replacement));
}
/**
* Applies the base level escaping unless otherwise overridden.
*
* @param input String to escape
* @return Escaped string
*/
private static String baseEscaping(String input) {
for (Map.Entry<String, String> entry : REQUIRED_ESCAPE.entrySet()) {
if (input.contains(entry.getKey())) {
input = input.replace(entry.getKey(), entry.getValue());
}
}
return input;
}
/**
* Generates the map of characters to automatically escape
*
* @return Map of escape keys/values
*/
private static Map<String, String> escapeMap() {
Map<String, String> escapes = new HashMap<>();
escapes.put("\"", """);
escapes.put("'", "'");
escapes.put("<", "<");
escapes.put(">", ">");
return escapes;
}
}
| [
"noreply@github.com"
] | noreply@github.com |
15e5396eb274e7a7f1d5185c5ee9fe97e9447ab9 | f06108ac62e9eaf309f3cd68653e43950a8a0b96 | /SpringBatchCSV/src/test/java/com/spring/batch/csv/SpringBatchCSV/SpringBatchCsvApplicationTests.java | 35fb05a34f298722f5d261396d5a42db908b2dc4 | [] | no_license | Mushadiqsk/spring-batch | fbf2283a14d5b81ed848d10ff526c81ea920f584 | 540fe5218b30d748bcfb6a2dbf2acde9a657b321 | refs/heads/main | 2023-04-24T06:42:20.611984 | 2021-05-16T15:32:04 | 2021-05-16T15:32:04 | 367,865,150 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 235 | java | package com.spring.batch.csv.SpringBatchCSV;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class SpringBatchCsvApplicationTests {
@Test
void contextLoads() {
}
}
| [
"mushadiq.shaik-dxc@hpe.com"
] | mushadiq.shaik-dxc@hpe.com |
15a5009f2b2512d7a48d91f93ceba788e1968493 | 39e185d2ed520ce481d8697938caa1c6da3c86ef | /src/com/proyecto/dominio/UserInvitado.java | 7eb9caaecf6240c5e8014005364f3d799e70233e | [] | no_license | neolukas86/WebLiga | d0a36cff2b4da24a14b5b4530ff398796db8a851 | 90880f127a8037e4809379fb5e3ebf8c60fb7d14 | refs/heads/master | 2020-12-24T17:35:41.052061 | 2013-10-10T14:54:38 | 2013-10-10T14:54:38 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 593 | java | package com.proyecto.dominio;
public class UserInvitado {
private User solicitado;
private User solicitante;
public UserInvitado() {
// TODO Auto-generated constructor stub
}
public UserInvitado(User solicitado, User solicitante){
this.solicitado = solicitado;
this.solicitante = solicitante;
}
public User getSolicitado() {
return solicitado;
}
public void setSolicitado(User solicitado) {
this.solicitado = solicitado;
}
public User getSolicitante() {
return solicitante;
}
public void setSolicitante(User solicitante) {
this.solicitante = solicitante;
}
}
| [
"neolukas@gmail.com"
] | neolukas@gmail.com |
f8a31d23cb58ea199fa47f46f66986fc775b720e | 9996a5db3c95464d2559f6f0364c7320748f5b42 | /Example1Metamodel/src/example1metamodel/Example1Metamodel.java | 61b138bf6488b70258e5d7e07400c5679f9245d3 | [] | no_license | brontofuzik/thespian | 8f93b35fbd14af0219eac3015b9b94fcef910ce4 | 83ebe949c8446ff0ca22d31350f50bf2a5fe2e47 | refs/heads/master | 2021-01-20T09:09:39.763159 | 2012-04-11T12:21:19 | 2012-04-11T12:21:19 | 37,160,493 | 0 | 0 | null | null | null | null | WINDOWS-1250 | Java | false | false | 5,519 | java | package example1metamodel;
import thespian.semanticmodel.MultiAgentSystem;
import thespian.semanticmodel.fsm.FSM;
import thespian.semanticmodel.organization.OrganizationType;
import thespian.semanticmodel.organization.Competence;
import thespian.semanticmodel.organization.Role;
import thespian.semanticmodel.player.PlayerType;
import thespian.semanticmodel.player.Responsibility;
import thespian.semanticmodel.protocol.Message;
import thespian.semanticmodel.protocol.Message.MessageType;
import thespian.semanticmodel.protocol.Party;
import thespian.semanticmodel.protocol.Protocol;
/**
* @author Lukáš Kúdela
* @since 2012-01-10
* @version %I% %G%
*/
public class Example1Metamodel {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
MultiAgentSystem model = createModel();
model.generate("C:\\DATA\\projects\\MAS\\MetaMAS");
}
// ----- PRIVATE -----
private static MultiAgentSystem createModel() {
MultiAgentSystem example1Mas = new MultiAgentSystem("Example1FunctionInvocation", "example1");
// ---------- Protocols ----------
example1Mas.addProtocol(createInvokeFunctionProtocol());
// ---------- Organizations ----------
OrganizationType invokeFunctionOrganizationType = createInvokeFunctionOrganizationType();
example1Mas.addOrganizationType(invokeFunctionOrganizationType);
example1Mas.addOrganization(invokeFunctionOrganizationType.createOrganization("invokeFunction_Organization"));
// ---------- Players ----------
PlayerType blankPlayerType = createBlankPlayerType();
example1Mas.addPlayerType(blankPlayerType);
example1Mas.addPlayer(blankPlayerType.createPlayer("player1"));
PlayerType factorialComputerPlayerType = createFactorialComputerPlayerType();
example1Mas.addPlayerType(factorialComputerPlayerType);
example1Mas.addPlayer(factorialComputerPlayerType.createPlayer("player2"));
return example1Mas;
}
// ---------- Protocols ----------
private static Protocol createInvokeFunctionProtocol() {
Protocol invokeFunctionProtocol = new Protocol("InvokeFunctionProtocol");
// ---------- Parties ----------
// The initiator party.
Party initiatorParty = new Party("InvokeFunction_InitiatorParty");
initiatorParty.setFSM(createInvokeFunctionInitiatorFSM());
invokeFunctionProtocol.setInitiatorParty(initiatorParty);
// The responder party.
Party responderParty = new Party("InvokeFunction_ResponderParty");
responderParty.setFSM(createInvokeFunctionResponderFMS());
invokeFunctionProtocol.setResponderParty(responderParty);
// ---------- Messages ----------
invokeFunctionProtocol.addMessage(new Message("RequestMessage", MessageType.TextMessage));
invokeFunctionProtocol.addMessage(new Message("ReplyMessage", MessageType.TextMessage));
return invokeFunctionProtocol;
}
private static FSM createInvokeFunctionInitiatorFSM() {
throw new UnsupportedOperationException("Not yet implemented");
}
private static FSM createInvokeFunctionResponderFMS() {
throw new UnsupportedOperationException("Not yet implemented");
}
// ---------- Organizations ----------
private static OrganizationType createInvokeFunctionOrganizationType() {
OrganizationType invokeFunctionOrganizationType = new OrganizationType("InvokeFunction_Organization");
// ---------- Roles ----------
invokeFunctionOrganizationType.addRole(createInvokerRole());
invokeFunctionOrganizationType.addRole(createExecutorRole());
return invokeFunctionOrganizationType;
}
private static Role createInvokerRole() {
Role invokerRole = new Role("Invoker_Role");
// The 'Invoke function' competence.
Competence invokeFunctionCompetence = new Competence("InvokeFunction_Competence",
Competence.CompetenceType.Synchronous, "Integer", "Integer");
invokeFunctionCompetence.setFSM(createInvokeFunctionCompetenceFSM());
invokerRole.addCompetence(invokeFunctionCompetence);
return invokerRole;
}
private static FSM createInvokeFunctionCompetenceFSM() {
throw new UnsupportedOperationException("Not yet implemented");
}
private static Role createExecutorRole() {
Role executorRole = new Role("Executor_Role");
return executorRole;
}
// ---------- Players ----------
private static PlayerType createBlankPlayerType() {
PlayerType blankPlayerType = new PlayerType("Blank_Player");
return blankPlayerType;
}
private static PlayerType createFactorialComputerPlayerType() {
PlayerType factorialComputerPlayerType = new PlayerType("FactorialComputer_Player");
// The 'Execute function' responsibility.
Responsibility executeFunctionResponsibility = new Responsibility("InvokeFunction_Responsibility",
Responsibility.ResponsibilityType.Asynchronous, "Integer", "Integer");
factorialComputerPlayerType.addResponsibility(executeFunctionResponsibility);
return factorialComputerPlayerType;
}
}
| [
"lukas.kudela@gmail.com"
] | lukas.kudela@gmail.com |
f6584fa72a223ab1015eb4635c1293f501bd2468 | dceb44b0cde7ed629ee0332fe6d0396011d2221d | /src/selenium/AutomationScript.java | 9e09d91a57739c4651a0f736772e678230e00bc4 | [] | no_license | vani24/intoduction | 2903e181f469559d40e689894e19ec0465f58eab | c478fae6f95dfbf3df31760ce991c9db4db66764 | refs/heads/master | 2020-03-19T07:09:06.840755 | 2018-06-05T05:11:49 | 2018-06-05T05:11:49 | 136,090,571 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 382 | java | package selenium;
public class AutomationScript {
public static void main(String[] args) {
// TODO Auto-generated method stub
Forgot_Password_A();
Check_RemeberMe();
ValidateLoginErrorMessage();
}
public static void Forgot_Password_A() {
}
public static void Check_RemeberMe() {
}
public static void ValidateLoginErrorMessage()
{
}
}
| [
"vani.shadaksharaiah@gmail.com"
] | vani.shadaksharaiah@gmail.com |
e3608c27a44dea6cfb8d95ef1856d8720c9b3603 | d852471b6035f8bdb48cedc3e07354117e7b9e92 | /src/main/java/no/kantega/forum/jaxrs/dal/ForumDao.java | a5e343ba16698e8ec51df96547d75b7c35c861d2 | [] | no_license | kantega/Flyt-forum-plugin | 8b90b168e349d989acfb6e14a641d081a6fd9492 | 891dcae324379b1bd9a644b9c284a724f4122725 | refs/heads/master | 2022-12-21T04:47:45.713882 | 2020-05-16T11:33:54 | 2020-05-16T11:33:54 | 30,144,193 | 1 | 0 | null | 2022-12-16T02:14:43 | 2015-02-01T11:29:00 | Java | UTF-8 | Java | false | false | 1,866 | java | package no.kantega.forum.jaxrs.dal;
import no.kantega.forum.jaxrs.bol.Fault;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
/**
* @author Kristian Myrhaug
* @since 2015-08-04
*/
public class ForumDao {
public List<Long> getForumIdsForGroups(Connection connection, List<String> groups) {
;
try (PreparedStatement preparedStatement = connection.prepareStatement(new StringBuilder("SELECT forumId FROM forum_forum_groups WHERE groupId IN (")
.append(groups.stream().map(group -> String.format("'%s'", group)).collect(Collectors.joining(", ")))
.append(")")
.toString())) {
try (ResultSet resultSet = preparedStatement.executeQuery()) {
List<Long> forumIds = new ArrayList<>();
while (resultSet.next()) {
forumIds.add(resultSet.getLong(1));
}
return forumIds;
}
} catch (SQLException cause) {
throw new Fault(500, cause);
}
}
public List<Long> getForumIdsWithoutGroups(Connection connection) {
try (PreparedStatement preparedStatement = connection.prepareStatement("SELECT f.forumId FROM forum_forum f LEFT JOIN forum_forum_groups g ON f.forumId = g.forumId WHERE g.forumId IS NULL")) {
try (ResultSet resultSet = preparedStatement.executeQuery()) {
List<Long> forumIds = new ArrayList<>();
while (resultSet.next()) {
forumIds.add(resultSet.getLong(1));
}
return forumIds;
}
} catch (SQLException cause) {
throw new Fault(500, cause);
}
}
}
| [
"kmyrhaug@gmail.com"
] | kmyrhaug@gmail.com |
3d3c58034a137df005d710e6a91a5ad31545bfbc | 846a8c1621bbf0b6d9d00a809c02ea99bb17a1bb | /src/test/java/dev/douglassparker/pixels/ImageAnalysisTest.java | 139a8ef4311d46f530828fbbee57f3fa2abb5950 | [] | no_license | douglassparker/pixels | 92a3463fcd8184043db7d4f8c97de7dd2a65a72d | 1a2037b5e9430c94b26530b2c1ef3172fce63a93 | refs/heads/master | 2021-07-05T08:46:21.301603 | 2019-08-14T18:11:33 | 2019-08-14T18:11:33 | 193,163,892 | 0 | 0 | null | 2020-10-13T14:21:54 | 2019-06-21T21:49:46 | Java | UTF-8 | Java | false | false | 2,796 | java | package dev.douglassparker.pixels;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.notNullValue;
import java.awt.image.BufferedImage;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.junit.Test;
import reactor.core.publisher.Flux;
/**
* Tests for <code>ImageAnalysisClass</code>
*
* @author <a href="mailto:douglassparker@me.com">Douglass Parker</a>
*/
@SuppressWarnings("static-method")
public class ImageAnalysisTest extends BaseImageAnalysisTest {
/**
* Confirms that an image can be retrieved from a URL.
*/
@Test
public void testFetchImage() {
BufferedImage image = imageAnalysis.fetchImage(testUrl);
assertThat(image, is(notNullValue()));
}
/**
* Confirms the logic to extract the pixels from an image.
*/
@Test
public void testGetImagePixelFlux() {
List<Integer> pixels = imageAnalysis.getImagePixelFlux(
imageAnalysis.fetchImage(testUrl))
.collect(Collectors.toList()).block();
assertThat(pixels, is(notNullValue()));
// test image has size 800 by 600.
assertThat(pixels.size(), is(800 * 600));
}
/**
* Confirms the logic to transform an integer into a six character
* String.
*/
@Test
public void testToRGB() {
assertThat(imageAnalysis.toRGB(0),is("000000"));
assertThat(imageAnalysis.toRGB(-1),is("ffffff"));
assertThat(imageAnalysis.toRGB(0xcafebabe),is("febabe"));
}
/**
* Confirms the ability to extract the three most occurrences in
* from a Stream of Strings.
*/
@Test
public void testGetTop3() {
Stream<String> stream = Stream.of("BEADED", "DECADE", "DEFACE"
,"FACADE", "DECADE","DEFACE", "FACADE", "DEFACE"
,"FACADE", "FACADE");
Map<String,Long> map = Flux.fromStream(stream)
.collect(Collectors.groupingBy(
Function.identity(), Collectors.counting()))
.block();
String[] top3 = imageAnalysis.getTop3(map);
assertThat(top3, is(notNullValue()));
assertThat(top3.length, is(3));
assertThat(top3[0], is("FACADE"));
assertThat(top3[1], is("DEFACE"));
assertThat(top3[2], is("DECADE"));
}
/**
* Tests that the apply() method correctly identifies the three
* most occurring colors in the test.jpg file as black, white, and
* red.
*/
@Test
public void testApply() {
String s = imageAnalysis.apply(TEST_IMAGE).block();
assertThat(s, is("test.jpg,#000000,#FFFFFF,#FE0000"));
}
}
| [
"douglass.parker@level3.com"
] | douglass.parker@level3.com |
2007ee5bdf6f2e33e799fe651988af00d65a5e96 | 81a8ea40ae38583b94d8eae479c0948620a40d9d | /src/test/java/org/qiunet/handler/mina/client/protocols/ClientMessageCodecFactory.java | b7bc830ee57c67500683bb074d2ee758bb08b8bd | [] | no_license | lstarby/RequestHandler | 65dc2685b3f020c5579d43fd88d98b4f1fc67260 | 7a4c5ddb03b1533ecfa0688b53f9568ebb24843e | refs/heads/master | 2021-09-08T05:03:15.031363 | 2017-03-17T01:35:18 | 2017-03-17T01:35:18 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 918 | java | package org.qiunet.handler.mina.client.protocols;
import org.apache.mina.core.session.IoSession;
import org.apache.mina.filter.codec.ProtocolCodecFactory;
import org.apache.mina.filter.codec.ProtocolDecoder;
import org.apache.mina.filter.codec.ProtocolEncoder;
import org.qiunet.handler.mina.server.protocols.MessageCodecEncode;
/**
* @author Zero
* @mail baozilaji@126.com
* @datetime May 31, 2015 11:53:28 PM
* @desc 协议编解码器工厂类
*/
public class ClientMessageCodecFactory implements ProtocolCodecFactory {
private MessageCodecEncode encode;
private CumulativeDecode decode;
@Override
public ProtocolEncoder getEncoder(IoSession session) throws Exception {
if(encode==null) encode = new MessageCodecEncode();
return encode;
}
@Override
public ProtocolDecoder getDecoder(IoSession session) throws Exception {
if(decode==null) decode = new CumulativeDecode();
return decode;
}
}
| [
"qiunet@163.com"
] | qiunet@163.com |
a875acdc84b6c39f773503bd9fb401b0e19074b7 | 03217a03ab6eb49a97f5b9072967c9814f7cf9bf | /src/CollisionInfo.java | 34176e6c65045e5d8e7efddd72d7f44ce98d325e | [] | no_license | Elorl/arkanoid | 5139bffa38954666d5a4fe1c3d359b00a7727ce5 | 31ad806f6f5d2ba96a0d6c4a9d3c96ede70286b4 | refs/heads/master | 2020-03-18T17:59:17.836156 | 2018-05-27T16:48:28 | 2018-05-27T16:48:28 | 135,064,698 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 926 | java | /**
* CollisionInfo.
* @author Elor lichtziger
*/
public class CollisionInfo {
private Rectangle rect;
private Collidable collide;
private Line line;
/**
* CollisionInfo.
*
* constructor.
*
* @param c the Collidable object the collision occur with.
* @param l the line that collide with the collidable object.
*/
public CollisionInfo(Collidable c, Line l) {
this.collide = c;
this.rect = c.getCollisionRectangle();
this.line = l;
}
/**
* CollisionInfo.
*
* @return the point at which the collision occurs.
*/
public Point collisionPoint() {
return this.line.closestIntersectionToStartOfLine(this.rect);
}
/**
* CollisionInfo.
*
* @return the collidable object involved in the collision.
*/
public Collidable collisionObject() {
return this.collide;
}
} | [
"elor14@gmail.com"
] | elor14@gmail.com |
19669e53e3168a009a079171a05beb0f1682a80c | 13a4b831f636b716263141af1bcd5e8c0946d58a | /designmodel/src/bridge/ConcreteImplementorA.java | 13dca3ddee8a8e79fe2f5d5bbfff03e3ff70f0d0 | [] | no_license | wdl2200/designmodel | bf7921047a4b1151d1d93c399f6c6d1e5f7bce3e | 741ad22779a6c4e252c928b1660f03b6e247c88d | refs/heads/master | 2020-03-11T08:06:10.060473 | 2018-05-23T02:28:06 | 2018-05-23T02:28:06 | 129,859,417 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 205 | java | package bridge;
public class ConcreteImplementorA implements Implementor {
@Override
public void OperationImp() {
// TODO Auto-generated method stub
System.out.println("concreteImplementA");
}
}
| [
"30312335+wdl2200@users.noreply.github.com"
] | 30312335+wdl2200@users.noreply.github.com |
6966caae3fe392a984564f970d7deca31636a6f3 | ff2b88881cee33d6ef12f3215acb1db177174726 | /NetFlixEurekaServer/src/test/java/com/spring/eureka/SpringcloudnetflixeurekaserverApplicationTests.java | 0cb4eec0b19fa89befda63a8abc15118eca338b8 | [] | no_license | Bujail/eurekaserver | 0536f26e945d72aeb9cb2dbe0697890c02abaa63 | ee22538c414878712be968c5e5651292801d8d82 | refs/heads/master | 2021-05-06T17:13:15.177901 | 2017-11-26T07:52:06 | 2017-11-26T07:52:06 | 111,799,176 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 358 | java | package com.spring.eureka;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest
public class SpringcloudnetflixeurekaserverApplicationTests {
@Test
public void contextLoads() {
}
}
| [
"ram.b.mohan@capgemini.com"
] | ram.b.mohan@capgemini.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.