blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
390
content_id
stringlengths
40
40
detected_licenses
listlengths
0
35
license_type
stringclasses
2 values
repo_name
stringlengths
6
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
539 values
visit_date
timestamp[us]date
2016-08-02 21:09:20
2023-09-06 10:10:07
revision_date
timestamp[us]date
1990-01-30 01:55:47
2023-09-05 21:45:37
committer_date
timestamp[us]date
2003-07-12 18:48:29
2023-09-05 21:45:37
github_id
int64
7.28k
684M
star_events_count
int64
0
77.7k
fork_events_count
int64
0
48k
gha_license_id
stringclasses
13 values
gha_event_created_at
timestamp[us]date
2012-06-11 04:05:37
2023-09-14 21:59:18
gha_created_at
timestamp[us]date
2008-05-22 07:58:19
2023-08-28 02:39:21
gha_language
stringclasses
62 values
src_encoding
stringclasses
26 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
128
12.8k
extension
stringclasses
11 values
content
stringlengths
128
8.19k
authors
listlengths
1
1
author_id
stringlengths
1
79
5ac1126331dc89fad34ad851811e56d7e93f15c0
280da3630f692c94472f2c42abd1051fb73d1344
/src/net/minecraft/world/biome/BiomeGenDesert.java
5217439736e7766918c1edbb66dbce00b7b51a7c
[]
no_license
MicrowaveClient/Clarinet
7c35206c671eb28bc139ee52e503f405a14ccb5b
bd387bc30329e0febb6c1c1b06a836d9013093b5
refs/heads/master
2020-04-02T18:47:52.047731
2016-07-14T03:21:46
2016-07-14T03:21:46
63,297,767
1
0
null
null
null
null
UTF-8
Java
false
false
1,208
java
package net.minecraft.world.biome; import net.minecraft.init.Blocks; import net.minecraft.util.BlockPos; import net.minecraft.world.World; import net.minecraft.world.gen.feature.WorldGenDesertWells; import java.util.Random; public class BiomeGenDesert extends BiomeGenBase { public BiomeGenDesert(int p_i1977_1_) { super(p_i1977_1_); this.spawnableCreatureList.clear(); this.topBlock = Blocks.sand.getDefaultState(); this.fillerBlock = Blocks.sand.getDefaultState(); this.theBiomeDecorator.treesPerChunk = -999; this.theBiomeDecorator.deadBushPerChunk = 2; this.theBiomeDecorator.reedsPerChunk = 50; this.theBiomeDecorator.cactiPerChunk = 10; this.spawnableCreatureList.clear(); } public void decorate(World worldIn, Random rand, BlockPos pos) { super.decorate(worldIn, rand, pos); if (rand.nextInt(1000) == 0) { int var4 = rand.nextInt(16) + 8; int var5 = rand.nextInt(16) + 8; BlockPos var6 = worldIn.getHeight(pos.add(var4, 0, var5)).up(); (new WorldGenDesertWells()).generate(worldIn, rand, var6); } } }
[ "justanormalpcnoghostclientoranyt@justanormalpcnoghostclientoranyt-Aspire-XC-704" ]
justanormalpcnoghostclientoranyt@justanormalpcnoghostclientoranyt-Aspire-XC-704
ad23a8af36d654cbbabf12da2fac7acaf0d94184
73b5d880fa06943c20ff0a9aee9d0c1d1eeebe10
/tinyos-1.x/tools/java/net/tinyos/sim/script/reflect/Mote.java
e159720289712ade119d331148303f128ca0acf2
[ "Intel" ]
permissive
x3ro/tinyos-legacy
101d19f9e639f5a9d59d3edd4ed04b1f53221e63
cdc0e7ba1cac505fcace33b974b2e0aca1ccc56a
refs/heads/master
2021-01-16T19:20:21.744228
2015-06-30T20:23:05
2015-06-30T20:23:05
38,358,728
0
1
null
null
null
null
UTF-8
Java
false
false
5,718
java
// $Id: Mote.java,v 1.7 2004/04/14 18:30:31 mikedemmer Exp $ /* * * * "Copyright (c) 2004 and The Regents of the University * of California. All rights reserved. * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose, without fee, and without written * agreement is hereby granted, provided that the above copyright * notice and the following two paragraphs appear in all copies of * this software. * * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY * PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL * DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS * DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE * PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF * CALIFORNIA HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, * UPDATES, ENHANCEMENTS, OR MODIFICATIONS." * * Authors: Michael Demmer * Date: January 9, 2004 * Desc: Reflected Mote object * */ /** * @author Michael Demmer */ package net.tinyos.sim.script.reflect; import net.tinyos.sim.*; import net.tinyos.sim.event.*; import net.tinyos.sim.script.ScriptInterpreter; import java.io.*; import org.python.core.*; /** * The Mote class provides access to the simulated mote objects.<p> * * Each mote that is simulated has a corresponding simulator object. * These simulator objects are bound into the simcore module as the * <i>motes</i> list. Hence for example, <tt>motes[3].turnOn()</tt> * will turn on mote number 3. * * Generic methods that are available on all simulator objects are * described in {@link SimObject}. * */ public class Mote extends net.tinyos.sim.script.reflect.SimObject { private MoteVariables moteVars; private MoteSimObject mote; public Mote(ScriptInterpreter interp, SimDriver driver, MoteSimObject mote) { super(interp, driver, mote); moteVars = driver.getVariables(); this.mote = mote; } /** * Return the mote's ID. */ public int getID() { return mote.getID(); } /** * Return a string representing the mote's state (i.e. power, * position). */ public String toString() { String msg = "Mote " + getID() + ": "; msg += "[power=" + (isOn()? "on":"off") + "] "; msg += "[state=active] "; msg += "[pos=" + (int)getXCoord() + "," + (int)getYCoord() + "]"; return msg; } /** * Turn the mote on. */ public void turnOn() throws IOException { boolean wasOn = mote.getPower(); if (wasOn) return; mote.setPower(true); driver.getSimComm().sendCommand( new TurnOnMoteCommand((short)mote.getID(), 0L)); driver.refreshMotePanel(); } /** * Turn the mote off. */ public void turnOff() throws IOException { boolean wasOn = mote.getPower(); if (! wasOn) return; mote.setPower(false); driver.getSimComm().sendCommand( new TurnOffMoteCommand((short)mote.getID(), 0L)); driver.refreshMotePanel(); } /** * Return whether or not the mote is on. */ public boolean isOn() { return mote.getPower(); } /** * Set a label in the TinyViz GUI for the given mote at a constant * offset to the mote's position. Has no effect if the gui is not * enabled. * * @param label the string to display * @param xoff x offset of the label * @param yoff y offset of the label */ public void setLabel(String label, int xoff, int yoff) { mote.addAttribute(new MoteLabelAttribute(label, xoff, yoff)); driver.refreshMotePanel(); } /** * Resolve and return the value of a mote frame variable, specifying * the length and the offset, and return it as a byte array. * * @param var variable name to resolve and return */ public byte[] getBytes(String var, long len, long offset) throws IOException { return moteVars.getBytes((short)mote.getID(), var, len, offset); } /** * Resolve and return the value of a mote frame variable, and return * it as a byte array. * * @param var variable name to resolve and return */ public byte[] getBytes(String var) throws IOException { return moteVars.getBytes((short)mote.getID(), var); } /** * Resolve and return the value of a mote frame variable, and return * it as a long. * * @param var variable name to resolve and return */ public long getLong(String var) throws IOException { return moteVars.getLong((short)mote.getID(), var); } /** * Resolve and return the value of a mote frame variable, and return * it as an int. * * @param var variable name to resolve and return */ public int getInt(String var) throws IOException { return (int)moteVars.getLong((short)mote.getID(), var); } /** * Resolve and return the value of a mote frame variable, and return * it as a short. * * @param var variable name to resolve and return */ public short getShort(String var) throws IOException { return (short)moteVars.getShort((short)mote.getID(), var); } /** * Resolve and return the value of a mote frame variable, and return * it as a byte. * * @param var variable name to resolve and return */ public byte getByte(String var) throws IOException { byte b[] = getBytes(var); if (b.length > 0) { return b[0]; } else { throw Py.IndexError(var + " is not a valid variable (it has length 0)"); } } }
[ "lucas@x3ro.de" ]
lucas@x3ro.de
16b001739757a3800d68051a53c4f466e727957b
b39d7e1122ebe92759e86421bbcd0ad009eed1db
/sources/org/ifaa/android/manager/face/IFAAFaceManagerFactory.java
3e3265b7d2cf58d0d750a23f608b2b4536eacf97
[]
no_license
AndSource/miuiframework
ac7185dedbabd5f619a4f8fc39bfe634d101dcef
cd456214274c046663aefce4d282bea0151f1f89
refs/heads/master
2022-03-31T11:09:50.399520
2020-01-02T09:49:07
2020-01-02T09:49:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
257
java
package org.ifaa.android.manager.face; import android.content.Context; public class IFAAFaceManagerFactory { public static IFAAFaceManager getIFAAFaceManager(Context context) { return IFAAFaceManagerImpl.getInstance(context); } }
[ "shivatejapeddi@gmail.com" ]
shivatejapeddi@gmail.com
badaaad3797e712b650882d733148081c4f12b4d
8219ce7669faa54e44afc9ca3d52003dc04d753e
/app/src/main/java/org/cocos2d/nodes/CCSpriteFrame.java
5f945bd6323aa37f9ea67777f1ad978485133bae
[]
no_license
nareshmiriyala/DancingMowgli
2bab4e1c3a0aff250e59936d79db1c2b188e6530
5accf7f34701d89e363ba2abf4ea2f0d42cc92c3
refs/heads/master
2021-01-10T07:00:19.046212
2016-04-11T10:56:55
2016-04-11T10:56:55
48,690,106
1
0
null
null
null
null
UTF-8
Java
false
false
3,287
java
package org.cocos2d.nodes; import org.cocos2d.opengl.CCTexture2D; import org.cocos2d.types.CGPoint; import org.cocos2d.types.CGRect; import org.cocos2d.types.CGSize; /** * A CCSpriteFrame has: * - texture: A CCTexture2D that will be used by the CCSprite * - rectangle: A rectangle of the texture * <p/> * <p/> * You can modify the frame of a CCSprite by doing: * <p/> * CCSpriteFrame *frame = [CCSpriteFrame frameWithTexture:texture rect:rect offset:offset]; * [sprite setDisplayFrame:frame]; */ public class CCSpriteFrame { /** * rect of the frame */ final CGRect rect_; public CGRect getRect() { return CGRect.make(rect_); } public CGRect getRectRef() { return rect_; } /** * offset of the frame */ final CGPoint offset_; public CGPoint getOffset() { return CGPoint.make(offset_.x, offset_.y); } public CGPoint getOffsetRef() { return offset_; } /** * original size of the trimmed image */ final CGSize originalSize_; /** * texture of the frame */ final CCTexture2D texture_; public CCTexture2D getTexture() { return texture_; } /** * Flag shows that Zwoptex rotated texture for optimizations */ final Boolean rotated_; public Boolean getRotated() { return rotated_; } /** * Create a CCSpriteFrame with a texture, rect and offset. * It is assumed that the frame was not trimmed. */ public static CCSpriteFrame frame(CCTexture2D texture, CGRect rect, CGPoint offset) { return new CCSpriteFrame(texture, rect, offset); } /** * Create a CCSpriteFrame with a texture, rect, offset and originalSize. * The originalSize is the size in pixels of the frame before being trimmed. */ public static CCSpriteFrame frame(CCTexture2D texture, CGRect rect, CGPoint offset, CGSize originalSize) { return new CCSpriteFrame(texture, rect, offset, originalSize, false); } /** * Create a CCSpriteFrame with a texture, rect, offset, originalSize and rotated. * The originalSize is the size in pixels of the frame before being trimmed. */ public static CCSpriteFrame frame(CCTexture2D texture, CGRect rect, Boolean rotated, CGPoint offset, CGSize originalSize) { return new CCSpriteFrame(texture, rect, offset, originalSize, rotated); } /** * Initializes a CCSpriteFrame with a texture, rect and offset. * It is assumed that the frame was not trimmed. */ protected CCSpriteFrame(CCTexture2D texture, CGRect rect, CGPoint offset) { this(texture, rect, offset, rect.size, false); } /** * Initializes a CCSpriteFrame with a texture, rect, offset and originalSize. * The originalSize is the size in pixels of the frame before being trimmed. */ protected CCSpriteFrame(CCTexture2D texture, CGRect rect, CGPoint offset, CGSize originalSize, Boolean rotated) { texture_ = texture; offset_ = offset; rect_ = rect; originalSize_ = originalSize; rotated_ = rotated; } public CCSpriteFrame copy() { return new CCSpriteFrame(texture_, rect_, offset_, originalSize_, rotated_); } }
[ "ncmiriyala@gmail.com" ]
ncmiriyala@gmail.com
54f46f2bb22bf93c8725c94535924354f8c85f9c
a3fe5db4cf9f5dc75b8331b1fe69de13e0549587
/activemq/broker/region/AbstractTempRegion.java
76fa192099284b1e2a25a38c38a7f39816e43e86
[]
no_license
ShengtaoHou/software-recovery
7cd8e1a0aabadb808a0f00e5b0503a582c8d3c89
72a3dde6a0cba56f851c29008df94ae129a05d03
refs/heads/master
2020-09-26T08:25:54.952083
2019-12-11T07:32:57
2019-12-11T07:32:57
226,215,103
1
0
null
null
null
null
UTF-8
Java
false
false
4,896
java
// // Decompiled by Procyon v0.5.36 // package org.apache.activemq.broker.region; import org.slf4j.LoggerFactory; import java.util.Iterator; import java.util.Set; import java.util.Collection; import java.util.HashSet; import org.apache.activemq.command.ActiveMQDestination; import org.apache.activemq.broker.ConnectionContext; import java.util.HashMap; import org.apache.activemq.thread.TaskRunnerFactory; import org.apache.activemq.usage.SystemUsage; import java.util.TimerTask; import java.util.Timer; import java.util.Map; import org.slf4j.Logger; public abstract class AbstractTempRegion extends AbstractRegion { private static final Logger LOG; private Map<CachedDestination, Destination> cachedDestinations; private final boolean doCacheTempDestinations; private final int purgeTime; private Timer purgeTimer; private TimerTask purgeTask; public AbstractTempRegion(final RegionBroker broker, final DestinationStatistics destinationStatistics, final SystemUsage memoryManager, final TaskRunnerFactory taskRunnerFactory, final DestinationFactory destinationFactory) { super(broker, destinationStatistics, memoryManager, taskRunnerFactory, destinationFactory); this.cachedDestinations = new HashMap<CachedDestination, Destination>(); this.doCacheTempDestinations = broker.getBrokerService().isCacheTempDestinations(); this.purgeTime = broker.getBrokerService().getTimeBeforePurgeTempDestinations(); if (this.doCacheTempDestinations) { this.purgeTimer = new Timer("ActiveMQ Temp destination purge timer", true); this.purgeTask = new TimerTask() { @Override public void run() { AbstractTempRegion.this.doPurge(); } }; this.purgeTimer.schedule(this.purgeTask, this.purgeTime, this.purgeTime); } } @Override public void stop() throws Exception { super.stop(); if (this.purgeTimer != null) { this.purgeTimer.cancel(); } } @Override protected synchronized Destination createDestination(final ConnectionContext context, final ActiveMQDestination destination) throws Exception { Destination result = this.cachedDestinations.remove(new CachedDestination(destination)); if (result == null) { result = this.destinationFactory.createDestination(context, destination, this.destinationStatistics); } return result; } @Override protected final synchronized void dispose(final ConnectionContext context, final Destination dest) throws Exception { if (this.doCacheTempDestinations) { this.cachedDestinations.put(new CachedDestination(dest.getActiveMQDestination()), dest); } else { try { dest.dispose(context); dest.stop(); } catch (Exception e) { AbstractTempRegion.LOG.warn("Failed to dispose of {}", dest, e); } } } private void doDispose(final Destination dest) { final ConnectionContext context = new ConnectionContext(); try { dest.dispose(context); dest.stop(); } catch (Exception e) { AbstractTempRegion.LOG.warn("Failed to dispose of {}", dest, e); } } private synchronized void doPurge() { final long currentTime = System.currentTimeMillis(); if (this.cachedDestinations.size() > 0) { final Set<CachedDestination> tmp = new HashSet<CachedDestination>(this.cachedDestinations.keySet()); for (final CachedDestination key : tmp) { if (key.timeStamp + this.purgeTime < currentTime) { final Destination dest = this.cachedDestinations.remove(key); if (dest == null) { continue; } this.doDispose(dest); } } } } static { LOG = LoggerFactory.getLogger(TempQueueRegion.class); } static class CachedDestination { long timeStamp; ActiveMQDestination destination; CachedDestination(final ActiveMQDestination destination) { this.destination = destination; this.timeStamp = System.currentTimeMillis(); } @Override public int hashCode() { return this.destination.hashCode(); } @Override public boolean equals(final Object o) { if (o instanceof CachedDestination) { final CachedDestination other = (CachedDestination)o; return other.destination.equals(this.destination); } return false; } } }
[ "shengtao@ShengtaoHous-MacBook-Pro.local" ]
shengtao@ShengtaoHous-MacBook-Pro.local
e3f527813f553190157fe8b543ebe4a2550bf1ad
93d06d6b9657cf4ce8fb7583f30615ddc2851c95
/ssaw-authenticate-center/ssaw-authenticate-center-service/src/main/java/com/ssaw/ssawauthenticatecenterservice/config/upload/ResourceAutoConfig.java
5065deab98d65ee688c6b8f93891c143f1613a32
[]
no_license
IsSenHu/sapache2
89f532fc0353dc5639c1c30ac59a83dae6f35b47
f563bf69449af827b6b0163a67c2ec39f5873164
refs/heads/master
2023-08-05T05:45:34.448788
2019-07-26T11:56:11
2019-07-26T11:56:11
187,483,694
2
1
null
2023-07-22T06:17:33
2019-05-19T13:58:44
Java
UTF-8
Java
false
false
7,461
java
package com.ssaw.ssawauthenticatecenterservice.config.upload; import com.ssaw.commons.util.json.jack.JsonUtils; import com.ssaw.commons.vo.CommonResult; import com.ssaw.ssawauthenticatecenterfeign.annotations.Menu; import com.ssaw.ssawauthenticatecenterfeign.annotations.SecurityApi; import com.ssaw.ssawauthenticatecenterfeign.annotations.SecurityMethod; import com.ssaw.ssawauthenticatecenterfeign.event.local.AppFinishedEvent; import com.ssaw.ssawauthenticatecenterfeign.event.local.UploadScopeAndWhiteListFinishedEvent; import com.ssaw.ssawauthenticatecenterfeign.store.AuthorizeStore; import com.ssaw.ssawauthenticatecenterfeign.vo.resource.UploadResourceVO; import com.ssaw.ssawauthenticatecenterfeign.vo.scope.ScopeVO; import com.ssaw.ssawauthenticatecenterfeign.properties.EnableResourceAutoProperties; import com.ssaw.ssawauthenticatecenterservice.service.MenuService; import com.ssaw.ssawauthenticatecenterservice.service.ResourceService; import com.ssaw.ssawauthenticatecenterservice.service.ScopeService; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.context.event.ApplicationStartedEvent; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.Configuration; import org.springframework.context.event.EventListener; import org.springframework.core.annotation.AnnotationUtils; import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.util.Assert; import java.lang.reflect.Method; import java.util.*; import java.util.concurrent.atomic.AtomicBoolean; import java.util.stream.Collectors; import static com.ssaw.commons.constant.Constants.ResultCodes.SUCCESS; /** * @author HuSen * @date 2019/2/25 17:41 */ @Slf4j @Configuration @EnableScheduling @EnableConfigurationProperties(EnableResourceAutoProperties.class) public class ResourceAutoConfig { private AtomicBoolean initialized = new AtomicBoolean(false); private final ApplicationContext context; private final EnableResourceAutoProperties enableResourceAutoProperties; private final ResourceService resourceService; private final ScopeService scopeService; private final MenuService menuService; @Autowired public ResourceAutoConfig(EnableResourceAutoProperties enableResourceAutoProperties, ApplicationContext context, ResourceService resourceService, ScopeService scopeService, MenuService menuService) { this.enableResourceAutoProperties = enableResourceAutoProperties; this.context = context; this.resourceService = resourceService; this.scopeService = scopeService; this.menuService = menuService; } @EventListener(ApplicationStartedEvent.class) public void init() { if (!initialized.getAndSet(true)) { Assert.hasText(enableResourceAutoProperties.getResourceId(), "资源ID不能为空"); Assert.hasText(enableResourceAutoProperties.getDescription(), "资源描述不能为空"); Assert.hasText(enableResourceAutoProperties.getCode(), "资源编码不能为空"); UploadResourceVO resource = new UploadResourceVO(); resource.setResourceId(enableResourceAutoProperties.getResourceId()); resource.setDescription(enableResourceAutoProperties.getDescription()); log.info("上传资源服务:{}", JsonUtils.object2JsonString(resource)); CommonResult<UploadResourceVO> result = resourceService.uploadResource(resource); Assert.state(result.getCode() == SUCCESS, "上传资源服务失败"); List<SecurityMethod> securityMethods = new ArrayList<>(); List<ScopeVO> scopeVOList = new ArrayList<>(); List<Menu> menus = new ArrayList<>(); Map<String, Object> beansWithAnnotation = context.getBeansWithAnnotation(SecurityApi.class); for (Object bean : beansWithAnnotation.values()) { SecurityApi securityApi = AnnotationUtils.findAnnotation(bean.getClass(), SecurityApi.class); if (Objects.nonNull(securityApi)) { menus.addAll(Arrays.stream(securityApi.menu()).collect(Collectors.toList())); } Method[] declaredMethods = bean.getClass().getMethods(); for (Method method : declaredMethods) { SecurityMethod securityMethod = AnnotationUtils.findAnnotation(method, SecurityMethod.class); if (Objects.nonNull(securityMethod)) { securityMethods.add(securityMethod); AuthorizeStore.URL_SCOPE.put(securityMethod.antMatcher(), enableResourceAutoProperties.getResourceId().concat("_").concat(securityMethod.scope())); } } } Set<Map.Entry<String, List<SecurityMethod>>> entries = securityMethods.stream().collect(Collectors.groupingBy(SecurityMethod::scope)).entrySet(); for (Map.Entry<String, List<SecurityMethod>> entry : entries) { String antMatchers = String.join(",", entry.getValue().stream().map(SecurityMethod::antMatcher).collect(Collectors.toList()).toArray(new String[]{})); ScopeVO scopeVO = new ScopeVO(); scopeVO.setResourceId(result.getData().getId()); scopeVO.setResourceName(result.getData().getResourceId()); scopeVO.setScope(enableResourceAutoProperties.getResourceId().concat("_").concat(entry.getKey())); scopeVO.setUri(antMatchers); scopeVOList.add(scopeVO); } for (Menu menu : menus) { ScopeVO scopeVO = new ScopeVO(); scopeVO.setResourceId(result.getData().getId()); scopeVO.setResourceName(result.getData().getResourceId()); scopeVO.setScope(enableResourceAutoProperties.getResourceId().concat("_").concat(menu.scope())); scopeVO.setUri(UUID.randomUUID().toString()); scopeVOList.add(scopeVO); } log.info("上传作用域:{}", JsonUtils.object2JsonString(scopeVOList)); CommonResult<String> commonResult = scopeService.uploadScopes(result.getData().getId(), scopeVOList); Assert.state(commonResult.getCode() == SUCCESS, "上传作用域失败"); List<String> whiteList = enableResourceAutoProperties.getWhiteList(); log.info("上传白名单:{}", JsonUtils.object2JsonString(whiteList)); CommonResult<String> uploadWhiteListResult = menuService.uploadWhiteList(whiteList, enableResourceAutoProperties.getResourceId()); Assert.state(uploadWhiteListResult.getCode() == SUCCESS, "上传白名单失败"); context.publishEvent(new UploadScopeAndWhiteListFinishedEvent(enableResourceAutoProperties.getResourceId())); } } @EventListener(UploadScopeAndWhiteListFinishedEvent.class) public void refreshScopes(UploadScopeAndWhiteListFinishedEvent event) { String resourceId = (String) event.getSource(); log.info("因为:{} 完成认证信息上传, 重新刷新作用域和内部用户信息", resourceId); scopeService.refreshScope(resourceId); context.publishEvent(new AppFinishedEvent(resourceId)); } }
[ "1178515826@qq.com" ]
1178515826@qq.com
cb9e9cf06207628f26ff7469fb3a9bfc01e7ea49
d24de9be4c3993d9dc726e9a3c74d9662c470226
/reverse/Rocketbank_All_3.12.4_source_from_JADX/sources/android/support/v7/widget/ContentFrameLayout.java
33bcb5eae59082fcde7fad4e1f98c83cba8f30ba
[]
no_license
MEJIOMAH17/rocketbank-api
b18808ee4a2fdddd8b3045cd16655b0d82e0b13b
fc4eb0cbb4a8f52277fdb09a3b26b4cceef6ff79
refs/heads/master
2022-07-17T20:24:29.721131
2019-07-26T18:55:21
2019-07-26T18:55:21
198,698,231
4
0
null
2022-06-20T22:43:15
2019-07-24T19:31:49
Smali
UTF-8
Java
false
false
7,554
java
package android.support.v7.widget; import android.content.Context; import android.graphics.Rect; import android.support.annotation.RestrictTo; import android.support.v4.view.ViewCompat; import android.util.AttributeSet; import android.util.DisplayMetrics; import android.util.TypedValue; import android.view.View.MeasureSpec; import android.widget.FrameLayout; @RestrictTo public class ContentFrameLayout extends FrameLayout { private OnAttachListener mAttachListener; private final Rect mDecorPadding; private TypedValue mFixedHeightMajor; private TypedValue mFixedHeightMinor; private TypedValue mFixedWidthMajor; private TypedValue mFixedWidthMinor; private TypedValue mMinWidthMajor; private TypedValue mMinWidthMinor; public interface OnAttachListener { void onAttachedFromWindow(); void onDetachedFromWindow(); } public ContentFrameLayout(Context context) { this(context, null); } public ContentFrameLayout(Context context, AttributeSet attributeSet) { this(context, attributeSet, 0); } public ContentFrameLayout(Context context, AttributeSet attributeSet, int i) { super(context, attributeSet, i); this.mDecorPadding = new Rect(); } @RestrictTo public void dispatchFitSystemWindows(Rect rect) { fitSystemWindows(rect); } public void setAttachListener(OnAttachListener onAttachListener) { this.mAttachListener = onAttachListener; } @RestrictTo public void setDecorPadding(int i, int i2, int i3, int i4) { this.mDecorPadding.set(i, i2, i3, i4); if (ViewCompat.isLaidOut(this) != 0) { requestLayout(); } } protected void onMeasure(int i, int i2) { int dimension; TypedValue typedValue; DisplayMetrics displayMetrics = getContext().getResources().getDisplayMetrics(); Object obj = 1; Object obj2 = displayMetrics.widthPixels < displayMetrics.heightPixels ? 1 : null; int mode = MeasureSpec.getMode(i); int mode2 = MeasureSpec.getMode(i2); if (mode == Integer.MIN_VALUE) { TypedValue typedValue2 = obj2 != null ? this.mFixedWidthMinor : this.mFixedWidthMajor; if (!(typedValue2 == null || typedValue2.type == 0)) { dimension = typedValue2.type == 5 ? (int) typedValue2.getDimension(displayMetrics) : typedValue2.type == 6 ? (int) typedValue2.getFraction((float) displayMetrics.widthPixels, (float) displayMetrics.widthPixels) : 0; if (dimension > 0) { dimension = MeasureSpec.makeMeasureSpec(Math.min(dimension - (this.mDecorPadding.left + this.mDecorPadding.right), MeasureSpec.getSize(i)), 1073741824); i = 1; if (mode2 == Integer.MIN_VALUE) { typedValue = obj2 == null ? this.mFixedHeightMajor : this.mFixedHeightMinor; if (!(typedValue == null || typedValue.type == 0)) { mode2 = typedValue.type != 5 ? (int) typedValue.getDimension(displayMetrics) : typedValue.type != 6 ? (int) typedValue.getFraction((float) displayMetrics.heightPixels, (float) displayMetrics.heightPixels) : 0; if (mode2 > 0) { i2 = MeasureSpec.makeMeasureSpec(Math.min(mode2 - (this.mDecorPadding.top + this.mDecorPadding.bottom), MeasureSpec.getSize(i2)), 1073741824); } } } super.onMeasure(dimension, i2); mode2 = getMeasuredWidth(); dimension = MeasureSpec.makeMeasureSpec(mode2, 1073741824); if (i == 0 && mode == Integer.MIN_VALUE) { i = obj2 == null ? this.mMinWidthMinor : this.mMinWidthMajor; if (!(i == 0 || i.type == 0)) { i = i.type != 5 ? (int) i.getDimension(displayMetrics) : i.type != 6 ? (int) i.getFraction((float) displayMetrics.widthPixels, (float) displayMetrics.widthPixels) : 0; if (i > 0) { i -= this.mDecorPadding.left + this.mDecorPadding.right; } if (mode2 < i) { dimension = MeasureSpec.makeMeasureSpec(i, 1073741824); if (obj == null) { super.onMeasure(dimension, i2); } } } } obj = null; if (obj == null) { super.onMeasure(dimension, i2); } } } } dimension = i; i = 0; if (mode2 == Integer.MIN_VALUE) { if (obj2 == null) { } if (typedValue.type != 5) { if (typedValue.type != 6) { } } if (mode2 > 0) { i2 = MeasureSpec.makeMeasureSpec(Math.min(mode2 - (this.mDecorPadding.top + this.mDecorPadding.bottom), MeasureSpec.getSize(i2)), 1073741824); } } super.onMeasure(dimension, i2); mode2 = getMeasuredWidth(); dimension = MeasureSpec.makeMeasureSpec(mode2, 1073741824); if (obj2 == null) { } if (i.type != 5) { if (i.type != 6) { } } if (i > 0) { i -= this.mDecorPadding.left + this.mDecorPadding.right; } if (mode2 < i) { dimension = MeasureSpec.makeMeasureSpec(i, 1073741824); if (obj == null) { super.onMeasure(dimension, i2); } } obj = null; if (obj == null) { super.onMeasure(dimension, i2); } } public TypedValue getMinWidthMajor() { if (this.mMinWidthMajor == null) { this.mMinWidthMajor = new TypedValue(); } return this.mMinWidthMajor; } public TypedValue getMinWidthMinor() { if (this.mMinWidthMinor == null) { this.mMinWidthMinor = new TypedValue(); } return this.mMinWidthMinor; } public TypedValue getFixedWidthMajor() { if (this.mFixedWidthMajor == null) { this.mFixedWidthMajor = new TypedValue(); } return this.mFixedWidthMajor; } public TypedValue getFixedWidthMinor() { if (this.mFixedWidthMinor == null) { this.mFixedWidthMinor = new TypedValue(); } return this.mFixedWidthMinor; } public TypedValue getFixedHeightMajor() { if (this.mFixedHeightMajor == null) { this.mFixedHeightMajor = new TypedValue(); } return this.mFixedHeightMajor; } public TypedValue getFixedHeightMinor() { if (this.mFixedHeightMinor == null) { this.mFixedHeightMinor = new TypedValue(); } return this.mFixedHeightMinor; } protected void onAttachedToWindow() { super.onAttachedToWindow(); if (this.mAttachListener != null) { this.mAttachListener.onAttachedFromWindow(); } } protected void onDetachedFromWindow() { super.onDetachedFromWindow(); if (this.mAttachListener != null) { this.mAttachListener.onDetachedFromWindow(); } } }
[ "mekosichkin.ru" ]
mekosichkin.ru
909bbb30612df6812ec5a69be2dbfe28eae1e08f
84dad148f19a6d552a9d6f8d9aea366af5f72a2e
/src/main/java/org/intellij/xquery/completion/function/BuiltInFunctionSignatureToLookupElementConverter.java
058b2b670155e1beb069ed752d39dcf100271cec
[ "Apache-2.0" ]
permissive
arnostv/intellij-xquery
695c5e49b1675bf8b77cbbabed3f42aba80695d1
ddf3d5212335b0425b379ede11b66915b9dc00fd
refs/heads/master
2021-01-17T22:09:23.013400
2014-07-04T13:10:57
2014-07-04T13:10:57
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,729
java
/* * Copyright 2013-2014 Grzegorz Ligas <ligasgr@gmail.com> and other contributors * (see the CONTRIBUTORS file). * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.intellij.xquery.completion.function; import com.intellij.codeInsight.lookup.LookupElement; import com.intellij.codeInsight.lookup.LookupElementBuilder; import org.intellij.xquery.icons.XQueryIcons; /** * User: ligasgr * Date: 08/12/13 * Time: 00:27 */ public class BuiltInFunctionSignatureToLookupElementConverter { public static LookupElement convert(BuiltInFunctionSignature functionSignature, String key) { return LookupElementBuilder.create(functionSignature, key) .withIcon(XQueryIcons.FUNCTION_ICON) .withTailText(getTailText(functionSignature), true) .withTypeText(getTypeText(functionSignature)) .withInsertHandler(new XQueryFunctionInsertHandler()); } private static String getTypeText(BuiltInFunctionSignature functionSignature) { return functionSignature.getReturnType(); } private static String getTailText(BuiltInFunctionSignature functionSignature) { return "(" + functionSignature.getArguments() + ")"; } }
[ "ligasgr@gmail.com" ]
ligasgr@gmail.com
d0550c242be26f7a1150ea8a92bdacb907e34b52
f37739a9fe79ae57abb6666dd6e5c5eb2f7d877d
/src/main/java/cn/banny/unidbg/linux/android/AndroidResolver.java
3847cbfefc6d9bdde497f553dd48d613014c8536
[ "Apache-2.0" ]
permissive
qiang/unidbg
f6ba4a4ae674da4bbfeb4439c6ed366dd0fda6c9
4e35dbf848a02b239eae319b899d0853b61c5e51
refs/heads/master
2020-05-27T15:14:47.498103
2019-06-14T05:44:16
2019-06-14T05:44:16
188,676,274
0
0
Apache-2.0
2019-06-14T05:44:17
2019-05-26T11:48:36
Java
UTF-8
Java
false
false
5,776
java
package cn.banny.unidbg.linux.android; import cn.banny.unidbg.Emulator; import cn.banny.unidbg.spi.LibraryFile; import cn.banny.unidbg.LibraryResolver; import cn.banny.unidbg.file.FileIO; import cn.banny.unidbg.file.IOResolver; import cn.banny.unidbg.unix.IO; import cn.banny.unidbg.linux.file.*; import org.apache.commons.io.FileUtils; import org.apache.commons.io.FilenameUtils; import org.apache.commons.io.IOUtils; import java.io.*; import java.net.URL; import java.util.Arrays; import java.util.List; public class AndroidResolver implements LibraryResolver, IOResolver { private final int sdk; private final List<String> needed; public AndroidResolver(int sdk, String... needed) { this.sdk = sdk; this.needed = needed == null ? null : Arrays.asList(needed); } @Override public LibraryFile resolveLibrary(Emulator emulator, String libraryName) { if (needed == null) { return null; } if (!needed.isEmpty() && !needed.contains(libraryName)) { return null; } return resolveLibrary(emulator, libraryName, sdk); } static LibraryFile resolveLibrary(Emulator emulator, String libraryName, int sdk) { final String lib = emulator.getPointerSize() == 4 ? "lib" : "lib64"; String name = "/android/sdk" + sdk + "/" + lib + "/" + libraryName.replace('+', 'p'); URL url = AndroidResolver.class.getResource(name); if (url != null) { return new URLibraryFile(url, libraryName, sdk); } return null; } @Override public FileIO resolve(File workDir, String path, int oflags) { if (workDir == null) { workDir = new File("target"); } final boolean create = (oflags & FileIO.O_CREAT) != 0; if (IO.STDOUT.equals(path) || IO.STDERR.equals(path)) { try { if (!workDir.exists() && !workDir.mkdir()) { throw new IOException("mkdir failed: " + workDir); } File stdio = new File(workDir, path); if (!stdio.exists() && !stdio.createNewFile()) { throw new IOException("create new file failed: " + stdio); } return new Stdout(oflags, stdio, path, IO.STDERR.equals(path)); } catch (IOException e) { throw new IllegalStateException(e); } } if (path.startsWith("/dev/log/")) { try { File log = new File(workDir, path); File logDir = log.getParentFile(); if (!logDir.exists() && !logDir.mkdirs()) { throw new IOException("mkdirs failed: " + logDir); } if (!log.exists() && !log.createNewFile()) { throw new IOException("create new file failed: " + log); } return new LogCatFileIO(oflags, log, path); } catch (IOException e) { throw new IllegalStateException(e); } } if (".".equals(path)) { return createFileIO(workDir, path, oflags); } File file; String workPath = workDir.getAbsolutePath(); if (path.startsWith(workPath) && ((file = new File(path)).canRead() || create)) { if (file.canRead()) { return createFileIO(file, path, oflags); } try { File parent = file.getParentFile(); if (!parent.exists() && !parent.mkdirs()) { throw new IOException("mkdirs failed: " + parent); } if (!file.exists() && !file.createNewFile()) { throw new IOException("create file failed: " + file); } } catch (IOException e) { throw new IllegalStateException(e); } return createFileIO(file, path, oflags); } file = new File(workDir, path); if (file.canRead()) { return createFileIO(file, path, oflags); } if (file.getParentFile().exists() && create) { return createFileIO(file, path, oflags); } String androidResource = FilenameUtils.normalize("/android/sdk" + sdk + "/" + path, true); InputStream inputStream = AndroidResolver.class.getResourceAsStream(androidResource); if (inputStream != null) { OutputStream outputStream = null; try { File tmp = new File(FileUtils.getTempDirectory(), path); File dir = tmp.getParentFile(); if (!dir.exists() && !dir.mkdirs()) { throw new IOException("mkdirs failed: " + dir); } if (!tmp.exists() && !tmp.createNewFile()) { throw new IOException("createNewFile failed: " + tmp); } outputStream = new FileOutputStream(tmp); IOUtils.copy(inputStream, outputStream); return createFileIO(tmp, path, oflags); } catch (IOException e) { throw new IllegalStateException(e); } finally { IOUtils.closeQuietly(outputStream); IOUtils.closeQuietly(inputStream); } } else if ("/dev/__properties__".equals(path)) { return new DirectoryFileIO(oflags, path); } return null; } private FileIO createFileIO(File file, String pathname, int oflags) { if (file.canRead()) { return file.isDirectory() ? new DirectoryFileIO(oflags, pathname) : new SimpleFileIO(oflags, file, pathname); } return null; } }
[ "zhkl0228@qq.com" ]
zhkl0228@qq.com
56e51ccd21969137e291fda2ef9993564dd1a58d
0dfdc585caccc458fb8ca583ebb4bf41f102726b
/core/src/main/java/cn/ztuo/bitrade/entity/TbBeginnerGuide.java
a0336ece287ff636dc36a82c5d4f52ba48430971
[]
no_license
q-exchange/framework
1f016a642eff09840b802dfb62b542d76f87dc2c
d2e488c52ccaa93f862c10f935d5d2cd9ec59af2
refs/heads/master
2022-11-17T06:52:16.693355
2020-01-10T08:37:46
2020-01-10T08:37:46
233,000,909
1
4
null
2022-11-16T08:56:17
2020-01-10T08:26:56
Java
UTF-8
Java
false
false
2,930
java
package cn.ztuo.bitrade.entity; import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.ToString; import javax.persistence.*; import java.sql.Timestamp; import java.util.Objects; /** * @Author: dupinyan * @Description: * @Date: 2019/10/15 9:39 * @Version: 1.0 */ @Entity @Table(name = "tb_beginner_guide", schema = "bitrade", catalog = "") @ToString public class TbBeginnerGuide { private long id; private String imgUrl; private String videoUrl; private String videoTitle; private String sort; private Timestamp createTime; private Timestamp updateTime; @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "id", nullable = false) public long getId() { return id; } public void setId(long id) { this.id = id; } @Basic @Column(name = "img_url", nullable = true, length = 1024) public String getImgUrl() { return imgUrl; } public void setImgUrl(String imgUrl) { this.imgUrl = imgUrl; } @Basic @Column(name = "video_url", nullable = true, length = 1024) public String getVideoUrl() { return videoUrl; } public void setVideoUrl(String videoUrl) { this.videoUrl = videoUrl; } @Basic @Column(name = "video_title", nullable = true, length = 50) public String getVideoTitle() { return videoTitle; } public void setVideoTitle(String videoTitle) { this.videoTitle = videoTitle; } @Basic @Column(name = "sort", nullable = true, length = 1) public String getSort() { return sort; } public void setSort(String sort) { this.sort = sort; } @Basic @Column(name = "create_time", nullable = true) public Timestamp getCreateTime() { return createTime; } public void setCreateTime(Timestamp createTime) { this.createTime = createTime; } @Basic @JsonIgnore @Column(name = "update_time", nullable = true) public Timestamp getUpdateTime() { return updateTime; } public void setUpdateTime(Timestamp updateTime) { this.updateTime = updateTime; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; TbBeginnerGuide that = (TbBeginnerGuide) o; return id == that.id && Objects.equals(imgUrl, that.imgUrl) && Objects.equals(videoUrl, that.videoUrl) && Objects.equals(videoTitle, that.videoTitle) && Objects.equals(sort, that.sort) && Objects.equals(createTime, that.createTime) && Objects.equals(updateTime, that.updateTime); } @Override public int hashCode() { return Objects.hash(id, imgUrl, videoUrl, videoTitle, sort, createTime, updateTime); } }
[ "3402309136@qq.com" ]
3402309136@qq.com
1ca14c4a05ce0b58590c90323fb677fc9fe3486a
30e2cb0f82d70cab392f70518c16067705c752eb
/src/test/java/outcomes/parametrized_tests/boxing/TestParametrizationBoxingShortBad.java
017a759dbd85f8a5ec94a964522d206dcbbe644a
[]
no_license
hyperskill/hs-test
7afb9fbfb32d3efea9f810be8116f6d99728b8d1
94a14529121e3509a0db1e1a552378085587f34d
refs/heads/master
2023-08-10T04:28:38.330242
2023-06-12T10:25:57
2023-06-12T10:25:57
167,659,709
35
19
null
2023-06-12T10:25:58
2019-01-26T06:55:37
Java
UTF-8
Java
false
false
767
java
package outcomes.parametrized_tests.boxing; import org.hyperskill.hstest.dynamic.DynamicTest; import org.hyperskill.hstest.testcase.CheckResult; import outcomes.base.ContainsMessage; import outcomes.base.UnexpectedErrorTest; public class TestParametrizationBoxingShortBad extends UnexpectedErrorTest { @ContainsMessage String m = "short[] data provider isn't supported, use java.lang.Short[]"; short[] values = { 1, 2, 3, 4, 5 }; int counter = 0; @DynamicTest(data = "values") CheckResult test(short value) { System.out.println(value); return new CheckResult(values[counter++] == value, ""); } @DynamicTest CheckResult test2() { return CheckResult.wrong("counter = " + counter); } }
[ "aaaaaa2493@yandex.ru" ]
aaaaaa2493@yandex.ru
d05e8936682c08fd0615a4bea6838d42abaf2f2f
8af1164bac943cef64e41bae312223c3c0e38114
/results-java/spring-projects--spring-framework/dc6d67510d65393eabf420cc6648e8f31acb6586/before/EmbeddedDatabaseFactoryBeanTests.java
bdcadbe3ff0423e4d807b24c92d02635fcf2a7ff
[]
no_license
fracz/refactor-extractor
3ae45c97cc63f26d5cb8b92003b12f74cc9973a9
dd5e82bfcc376e74a99e18c2bf54c95676914272
refs/heads/master
2021-01-19T06:50:08.211003
2018-11-30T13:00:57
2018-11-30T13:00:57
87,353,478
0
0
null
null
null
null
UTF-8
Java
false
false
1,637
java
/* * Copyright 2002-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 org.springframework.jdbc.datasource.embedded; import javax.sql.DataSource; import org.junit.Test; import org.springframework.core.io.ClassPathResource; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.datasource.init.ResourceDatabasePopulator; import static org.junit.Assert.*; /** * @author Keith Donald */ public class EmbeddedDatabaseFactoryBeanTests { @Test public void testFactoryBeanLifecycle() throws Exception { EmbeddedDatabaseFactoryBean bean = new EmbeddedDatabaseFactoryBean(); ResourceDatabasePopulator populator = new ResourceDatabasePopulator(); populator.setScripts(new ClassPathResource("db-schema.sql", getClass()), new ClassPathResource("db-test-data.sql", getClass())); bean.setDatabasePopulator(populator); bean.afterPropertiesSet(); DataSource ds = bean.getObject(); JdbcTemplate template = new JdbcTemplate(ds); assertEquals("Keith", template.queryForObject("select NAME from T_TEST", String.class)); bean.destroy(); } }
[ "fraczwojciech@gmail.com" ]
fraczwojciech@gmail.com
d5ab8c22a2412762885644ffd42836c7c278fee4
0524570edad83d4727c413904ab3afdd096674d1
/hadoop-2.6.5-src/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestInjectionForSimulatedStorage.java
d38e808698d77eb8faad445c87dcaa8003e45dbc
[ "LicenseRef-scancode-unknown", "BSD-3-Clause", "BSD-2-Clause-Views", "LicenseRef-scancode-protobuf", "CDDL-1.0", "CDDL-1.1", "MIT", "EPL-1.0", "LicenseRef-scancode-unknown-license-reference", "Apache-2.0", "BSD-2-Clause", "Classpath-exception-2.0", "LGPL-2.1-only", "LicenseRef-scancode-other-permissive", "GCC-exception-3.1", "GPL-2.0-only", "LicenseRef-scancode-public-domain", "CC-PDDC", "LicenseRef-scancode-generic-cla", "LicenseRef-scancode-free-unknown", "LGPL-2.0-or-later", "GPL-1.0-or-later", "CPL-1.0", "MPL-1.1", "MPL-1.0" ]
permissive
lsds/sgx-spark
559426f71be03ad3cd12ac4856fb1af686f2c64c
7ce0009050b30ba63e5090635925fbe86f5a3e2d
refs/heads/v1
2023-08-22T16:48:53.818334
2019-04-24T16:51:01
2019-04-24T16:51:01
179,549,243
25
9
Apache-2.0
2022-12-05T23:36:45
2019-04-04T17:58:03
Java
UTF-8
Java
false
false
8,055
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.hdfs; import static org.junit.Assert.assertEquals; import java.io.IOException; import java.net.InetSocketAddress; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.CommonConfigurationKeys; import org.apache.hadoop.fs.FSDataOutputStream; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hdfs.protocol.Block; import org.apache.hadoop.hdfs.protocol.BlockListAsLongs; import org.apache.hadoop.hdfs.protocol.ClientProtocol; import org.apache.hadoop.hdfs.protocol.LocatedBlock; import org.apache.hadoop.hdfs.protocol.LocatedBlocks; import org.apache.hadoop.hdfs.server.datanode.SimulatedFSDataset; import org.apache.hadoop.hdfs.server.protocol.DatanodeStorage; import org.apache.hadoop.util.Time; import org.junit.Test; /** * This class tests the replication and injection of blocks of a DFS file for simulated storage. */ public class TestInjectionForSimulatedStorage { private final int checksumSize = 16; private final int blockSize = checksumSize*2; private final int numBlocks = 4; private final int filesize = blockSize*numBlocks; private final int numDataNodes = 4; private static final Log LOG = LogFactory.getLog( "org.apache.hadoop.hdfs.TestInjectionForSimulatedStorage"); private void writeFile(FileSystem fileSys, Path name, int repl) throws IOException { // create and write a file that contains three blocks of data FSDataOutputStream stm = fileSys.create(name, true, fileSys.getConf() .getInt(CommonConfigurationKeys.IO_FILE_BUFFER_SIZE_KEY, 4096), (short) repl, blockSize); byte[] buffer = new byte[filesize]; for (int i=0; i<buffer.length; i++) { buffer[i] = '1'; } stm.write(buffer); stm.close(); } // Waits for all of the blocks to have expected replication // Waits for all of the blocks to have expected replication private void waitForBlockReplication(String filename, ClientProtocol namenode, int expected, long maxWaitSec) throws IOException { long start = Time.now(); //wait for all the blocks to be replicated; LOG.info("Checking for block replication for " + filename); LocatedBlocks blocks = namenode.getBlockLocations(filename, 0, Long.MAX_VALUE); assertEquals(numBlocks, blocks.locatedBlockCount()); for (int i = 0; i < numBlocks; ++i) { LOG.info("Checking for block:" + (i+1)); while (true) { // Loop to check for block i (usually when 0 is done all will be done blocks = namenode.getBlockLocations(filename, 0, Long.MAX_VALUE); assertEquals(numBlocks, blocks.locatedBlockCount()); LocatedBlock block = blocks.get(i); int actual = block.getLocations().length; if ( actual == expected ) { LOG.info("Got enough replicas for " + (i+1) + "th block " + block.getBlock() + ", got " + actual + "."); break; } LOG.info("Not enough replicas for " + (i+1) + "th block " + block.getBlock() + " yet. Expecting " + expected + ", got " + actual + "."); if (maxWaitSec > 0 && (Time.now() - start) > (maxWaitSec * 1000)) { throw new IOException("Timedout while waiting for all blocks to " + " be replicated for " + filename); } try { Thread.sleep(500); } catch (InterruptedException ignored) {} } } } /* This test makes sure that NameNode retries all the available blocks * for under replicated blocks. This test uses simulated storage and one * of its features to inject blocks, * * It creates a file with several blocks and replication of 4. * The cluster is then shut down - NN retains its state but the DNs are * all simulated and hence loose their blocks. * The blocks are then injected in one of the DNs. The expected behaviour is * that the NN will arrange for themissing replica will be copied from a valid source. */ @Test public void testInjection() throws IOException { MiniDFSCluster cluster = null; String testFile = "/replication-test-file"; Path testPath = new Path(testFile); byte buffer[] = new byte[1024]; for (int i=0; i<buffer.length; i++) { buffer[i] = '1'; } try { Configuration conf = new HdfsConfiguration(); conf.set(DFSConfigKeys.DFS_REPLICATION_KEY, Integer.toString(numDataNodes)); conf.setInt(DFSConfigKeys.DFS_BYTES_PER_CHECKSUM_KEY, checksumSize); SimulatedFSDataset.setFactory(conf); //first time format cluster = new MiniDFSCluster.Builder(conf).numDataNodes(numDataNodes).build(); cluster.waitActive(); String bpid = cluster.getNamesystem().getBlockPoolId(); DFSClient dfsClient = new DFSClient(new InetSocketAddress("localhost", cluster.getNameNodePort()), conf); writeFile(cluster.getFileSystem(), testPath, numDataNodes); waitForBlockReplication(testFile, dfsClient.getNamenode(), numDataNodes, 20); List<Map<DatanodeStorage, BlockListAsLongs>> blocksList = cluster.getAllBlockReports(bpid); cluster.shutdown(); cluster = null; /* Start the MiniDFSCluster with more datanodes since once a writeBlock * to a datanode node fails, same block can not be written to it * immediately. In our case some replication attempts will fail. */ LOG.info("Restarting minicluster"); conf = new HdfsConfiguration(); SimulatedFSDataset.setFactory(conf); conf.set(DFSConfigKeys.DFS_NAMENODE_SAFEMODE_THRESHOLD_PCT_KEY, "0.0f"); cluster = new MiniDFSCluster.Builder(conf) .numDataNodes(numDataNodes * 2) .format(false) .build(); cluster.waitActive(); Set<Block> uniqueBlocks = new HashSet<Block>(); for(Map<DatanodeStorage, BlockListAsLongs> map : blocksList) { for(BlockListAsLongs blockList : map.values()) { for(Block b : blockList) { uniqueBlocks.add(new Block(b)); } } } // Insert all the blocks in the first data node LOG.info("Inserting " + uniqueBlocks.size() + " blocks"); cluster.injectBlocks(0, uniqueBlocks, null); dfsClient = new DFSClient(new InetSocketAddress("localhost", cluster.getNameNodePort()), conf); waitForBlockReplication(testFile, dfsClient.getNamenode(), numDataNodes, -1); } finally { if (cluster != null) { cluster.shutdown(); } } } }
[ "fkelbert@acm.org" ]
fkelbert@acm.org
792b5b2b0a77eb18c67a45d17e058a8e69ec62ad
4a7e10652e99c7538d3fb1088d554e2317a290cf
/app/src/main/java/com/codeboy/qianghongbao/util/BitmapUtils.java
cd7cf4b9f3dec9b10276abc8528c756f834a9b79
[]
no_license
Maxxjf/hongbao
188e17fb9983ca82fa6933ba9d4146aec21f7e40
d8b62a7faa6cec97f94dc4716b58902bfd60be98
refs/heads/master
2021-01-11T04:14:28.345701
2019-06-06T08:17:33
2019-06-06T08:17:33
71,227,108
0
0
null
null
null
null
UTF-8
Java
false
false
1,913
java
package com.codeboy.qianghongbao.util; import android.content.ContentValues; import android.content.Context; import android.content.Intent; import android.graphics.Bitmap; import android.net.Uri; import android.provider.MediaStore; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; /** * <p>Created 16/12/16 上午1:16.</p> * <p><a href="mailto:841100358@qq.com">Email:841100358@qq.com</a></p> * * @author Max */ public final class BitmapUtils { private BitmapUtils() {} public static boolean saveBitmap(Context context, File output, Bitmap bitmap) { if(output.exists()) { return false; } FileOutputStream fos = null; try { fos = new FileOutputStream(output); bitmap.compress(Bitmap.CompressFormat.JPEG, 100, fos); insertMedia(context, output, "image/jpeg"); return true; } catch (FileNotFoundException e) { e.printStackTrace(); return false; } finally { if(fos != null) { try { fos.close(); } catch (Exception e) {} } } } /** 加入到系统的图库中*/ private static void insertMedia(Context context, File output, String mime) { try { ContentValues values = new ContentValues(); values.put(MediaStore.Video.Media.DATA, output.getAbsolutePath()); values.put(MediaStore.Video.Media.MIME_TYPE, mime); //记录到系统媒体数据库,通过系统的gallery可以即时查看 context.getContentResolver().insert(MediaStore.Video.Media.EXTERNAL_CONTENT_URI, values); //通知系统去扫描 context.sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, Uri.fromFile(output))); } catch (Exception e){} } }
[ "15015912346@163.com" ]
15015912346@163.com
645e488495b83204d82d69fca2da2b4c9d052a9e
85d75b0211b5f18aea4770556df1722a45dd4523
/src/test/java/org/codemucker/jmutate/refactor/RefactorTest.java
b2dc6b8e62eb5440d76376011073cd19097d63cb
[ "Apache-2.0" ]
permissive
codemucker/codemucker-jmutate
8b536d5a3475a47ae4b6723676e9d7712aaaeb84
a6417887685df469e018111a914cc85cf288a568
refs/heads/master
2021-01-01T06:17:00.821752
2015-05-06T07:54:47
2015-05-06T07:54:47
3,552,490
0
0
null
null
null
null
UTF-8
Java
false
false
6,817
java
package org.codemucker.jmutate.refactor; import static com.google.common.collect.Lists.newArrayList; import java.lang.annotation.Annotation; import java.util.Collection; import org.apache.commons.lang3.StringUtils; import org.codemucker.jmatch.AbstractNotNullMatcher; import org.codemucker.jmatch.MatchDiagnostics; import org.codemucker.jmatch.Matcher; import org.codemucker.jmutate.JMutateException; import org.codemucker.jmutate.ast.AnnotationsProvider; import org.codemucker.jmutate.ast.AstNodeProvider; import org.codemucker.jmutate.ast.JAnnotation; import org.codemucker.jmutate.ast.JField; import org.codemucker.jmutate.ast.JMethod; import org.codemucker.jpattern.bean.Property; import org.codemucker.jtest.ReflectionUtils; public class RefactorTest { // @Test // public void test_add_getters_setters_builder(){ // JSourceFinder finder = JSourceFinder.newBuilder() // .setSearchPaths(SearchPathsBuilder.newBuilder() // .setIncludeClassesDir(false) // .setIncludeTestDir(true) // ) // .setFilter(FilterBuilder.newBuilder() // .setIncludeResource(ResourceMatchers.inPackage(TstBean.class)) // .setIncludeTypes(JTypeMatchers.withAnnotation(GenerateBean.class)) // ) // .build(); // // FindResult<JType> found = finder.findTypes(); // // for(JType type:found){ // assertEquals(TstBean.class.getName(), type.getFullName()); // //TODO:generate getters/setters // // FindResult<JField> fields = type.findAllFields(); // //FindResult<JMethod> methods = type.findAllJavaMethods(); // //findMethods().asMap,asCollection,... FindResults object? // Map<String,MethodDef> setterMap = newHashMap(); // Map<String,MethodDef> getterMap = newHashMap(); // // KeyProvider<String, JMethod> propertyNameProvider = new KeyProvider<String, JMethod>() { // // @Override // public String getKeyFor(JMethod method) { // return extractPropertyName(method); // } // }; // // FindResult<JMethod> getters = type.findMethodsMatching(getterMatcher()); // FindResult<JMethod> setters = type.findMethodsMatching(setterMatcher()); // // // //find existing getters/setters // for( JMethod method:methods){ // MethodDef def = extracteMthodDef(method); // if( def != null) { // if( def.isReader()){ // getterMap.put(def.name, def); // } else if (def.isWriter()){ // setterMap.put(def.name, def); // } // } // } // JTypeMutator typeMut = type.asMutator(); // // //find getters/setters by name, _or_annotation marker.... // for( JField field:fields){ // //TODO:find corresponding methods // //TODO:determien if to ignore getter/setter for this field. Class annon, field annon? // Collection<String> propertyNames = extractPropertyNames(field); // for( String name:propertyNames){ // MethodDef def = setterMap.get(name); // if( def == null){ // Collection<Object> args = newArrayList(); // args.add(ClassNameUtil.upperFirstChar(name)); // args.add(field.getFieldNode().getType()); // args.add(name); // args.add(name); // args.add(name); // // typeMut.addMethod("public void set%s(%s %s){ this.%s = %s; }",args.toArray()); // } // def = getterMap.get(name); // if( def == null){ // Collection<Object> args = newArrayList(); // args.add(field.getFieldNode().getType()); // args.add(ClassNameUtil.upperFirstChar(name)); // args.add(name); // // typeMut.addMethod("public %s get%s(){ return this.%s; }",args.toArray()); // } // } // } // // // // fail("TODO:implement me!"); // } // JChangeSet changes = new JChangeSet(); // for( JType type:found){ // type.getTypeNode().getAST() // changes.add(type) // } // changes.save(); // } static class JChangeSet{ public void add(AstNodeProvider provider){ } public void save(){} } private Matcher<JMethod> getterMatcher(){ return new AbstractNotNullMatcher<JMethod>(){ @Override public boolean matchesSafely(JMethod found, MatchDiagnostics diag) { return ReflectionUtils.isReaderMethodFromName(found.getName()); } }; } private Matcher<JMethod> setterMatcher(){ return new AbstractNotNullMatcher<JMethod>(){ @Override public boolean matchesSafely(JMethod found, MatchDiagnostics diag) { return ReflectionUtils.isWriterMethodFromName(found.getName()); } }; } private MethodDef extracteMthodDef(JMethod m){ if( isSetterMethod(m)){ MethodDef def = new MethodDef(); def.name = extractPropertyName(m); def.type = MethodDef.TYPE.WRITER; def.method = m; return def; } else if (isGetterMethod(m)){ MethodDef def = new MethodDef(); def.name = extractPropertyName(m); def.type = MethodDef.TYPE.READER; def.method = m; return def; } //if builder method??? return null; } private Collection<String> extractPropertyNames(JField field){ Collection<String> names= newArrayList(); String name = getAnonationValue(field, Property.class, "name"); if (name !=null) { names.add(name); } else { for(String fieldName:field.getNames()){ name = ReflectionUtils.extractPropertyNameFromMethod(fieldName); if( name != null ){ names.add(name); } } } return names; } private String extractPropertyName(JMethod method) { String name = getAnonationValue(method, Property.class, "name"); if (name == null) { name = ReflectionUtils.extractPropertyNameFromMethod(method.getName()); } return name; } private boolean isSetterMethod(JMethod m){ return ReflectionUtils.isWriterMethodFromName(m.getName()); } private boolean isGetterMethod(JMethod m){ //or a builder method??? return ReflectionUtils.isReaderMethodFromName(m.getName()); } private <A extends Annotation> String getAnonationValue(AnnotationsProvider annotatable, Class<A> anon, String attributeName){ JAnnotation janon = annotatable.getAnnotations().getOrNull(Property.class); if( anon != null ){ Object value = janon.getAttributeValue("name", null); String sval = value==null?null:value.toString(); if(StringUtils.isBlank(sval)){ throw new JMutateException("Expected a value for 'name' for annotation 'BeanProperty'"); } return sval; } return null; } static class MethodDef { static enum TYPE {READER,WRITER}; String name; boolean ignore; TYPE type; JMethod method; boolean isWriter(){ return type == TYPE.WRITER; } boolean isReader(){ return type == TYPE.READER; } } }
[ "bertvanbrakel@gmail.com" ]
bertvanbrakel@gmail.com
bfaf2dd50dd10d5dcc1395247c1b8aeb6b56bfec
a4e9f8c914245a7b3003a1aaba03fecd756f281b
/src_app/lebah/app/HelloWorld.java
d3d5a2331eddd9c97b6a10609b6e88c66a5bbd30
[ "Apache-2.0" ]
permissive
aalihusni/LebahFramework
d3f49acb9516b566ddb66b6a01a32efcdf064098
97a31c43faa0e8c18b00411f578b18616b8e32d2
refs/heads/master
2020-03-25T09:29:26.265875
2018-04-13T07:19:27
2018-04-13T07:19:27
143,672,342
1
0
Apache-2.0
2019-09-03T02:18:47
2018-08-06T03:35:15
Java
UTF-8
Java
false
false
212
java
package lebah.app; import lebah.portal.action.LebahModule; public class HelloWorld extends LebahModule { @Override public String start() { // TODO Auto-generated method stub return "app/hello.vm"; } }
[ "sbahrin3@gmail.com" ]
sbahrin3@gmail.com
54471671701e3dee5872906a9f7787247b0f5870
9cc124920bdd52460cf3e602b049542f328c97aa
/rdap-service/src/main/java/org/restfulwhois/rdap/redirect/service/RedirectService.java
5268f27aef6371597792d263a025ab92c4d10280
[ "BSD-2-Clause" ]
permissive
whileZhou/rdap
373d5e6f19a32b38594b45f6856b30593bfb18eb
94a79a8ce67b90d4f093878030b276dc83d8c998
refs/heads/master
2021-01-20T16:47:29.432866
2015-09-17T02:01:59
2015-09-17T02:01:59
38,670,099
0
0
null
2015-07-07T07:04:08
2015-07-07T07:04:08
null
UTF-8
Java
false
false
3,440
java
/* * Copyright (c) 2012 - 2015, Internet Corporation for Assigned Names and * Numbers (ICANN) and China Internet Network Information Center (CNNIC) * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * Neither the name of the ICANN, CNNIC nor the names of its contributors may * be used to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL ICANN OR CNNIC BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. */ package org.restfulwhois.rdap.redirect.service; import java.util.List; import org.restfulwhois.rdap.bootstrap.bean.Redirect; import org.restfulwhois.rdap.common.support.QueryParam; import org.restfulwhois.rdap.redirect.bean.RedirectResponse; /** * redirect service interface. * * provide methods: is the own url or redirect to domain/AS/IP url. * * @author jiashuo * */ public interface RedirectService { /** * check if redirect response is valid. * * @param redirect * for respose of redirect. * @return true if valid, false if not. */ boolean isValidRedirect(RedirectResponse redirect); /** * query domain by domain name. * * @param queryParam * queryParam. * @return RedirectResponse RedirectResponse. */ RedirectResponse queryDomain(QueryParam queryParam); /** * query autnm. * * @param queryParam * queryParam. * @return RedirectResponse RedirectResponse. */ RedirectResponse queryAutnum(QueryParam queryParam); /** * query Ip. * * @param queryParam * queryParam. * @return RedirectResponse RedirectResponse. */ RedirectResponse queryIp(QueryParam queryParam); /** * save domain redirects. * * @param redirects * redirects. */ void saveDomainRedirect(List<Redirect> redirects); /** * save network redirects. * * @param redirects * redirects. */ void saveNetworkRedirect(List<Redirect> redirects); /** * save as number redirects. * * @param redirects * redirects. */ void saveAutnumRedirect(List<Redirect> redirects); }
[ "jiashuo@cnnic.cn" ]
jiashuo@cnnic.cn
64d4990bed1854592f6d512a1e3fea8ca530c44b
7d2786b383b00d49265fe52fd3ca8c5652540c27
/src/spaceinvaders/com/Boss.java
2bbdb17e6a6d203aeebee839d86ae00148688892
[ "Apache-2.0" ]
permissive
Hismahil/spaceinvaders
410660e8541ab0f8547ef21194030985a81b4ad4
11b27fa4f43567e50454a5ab6617b1b586fa105a
refs/heads/master
2020-12-03T06:30:00.575152
2016-09-17T00:41:29
2016-09-17T00:41:29
68,423,398
0
0
null
null
null
null
UTF-8
Java
false
false
6,543
java
package spaceinvaders.com; import java.awt.Graphics; import java.awt.image.BufferedImage; import java.io.IOException; import java.util.ArrayList; import spaceinvaders.com.interfaces.WinDefs; import spaceinvaders.com.resources.LoadResources; /** * * @author hismahil */ public class Boss { private BufferedImage boss; //sprite do boss private BufferedImage missiel; private LoadResources load; private int x, y, width, height, dx; //definições gerais private int bossHeal = 10; //quantidade de tiros que o boss pode levar até morrer private ArrayList<Tiro> bossTiro = new ArrayList<Tiro>(); //para organizar os tiros private int bossQtTiros = 5; //quantidade maxima de tiros private boolean direction = false; //false para esquerda true para direita private boolean delay = true; //espera 10x para criar outro tiro private int countDelay = 0; //contabiliza o dalay private Sound shoot; //som do tiro private Sound killed; //som de explosão private Explosao bossFail = null; //vetor de explosão /** * coordenada x e y do boss * FileBoss = nome do arquivo da imagem do boss * @param FileBoss nome do sprite do boss * @param x coordenada x onde o boss aparecerá de inicio * @param y coordenada y onde o boss aparecerá de inicio * @throws IOException */ public Boss(String FileBoss,int x,int y) throws IOException{ load = new LoadResources(); boss = load.resourceImageLoader(FileBoss); //carrega sprite do boss this.x = x; //seta coordenadas da tela this.y = y; missiel = load.resourceImageLoader("missiel.png"); //carrega sprite do missiel //sons de tiro e quando ele é morto shoot = new Sound("shoot.wav"); killed = new Sound("explosion.wav"); //dimensões da imagem width = boss.getWidth(); height = boss.getHeight(); load = null; } /** * Desenha a imagem do boss no double buffering e * os tiros * @param g referência da imagem em Double Buffering do GamePanel */ public void draw(Graphics g) throws IOException{ //se o boss existe e o hp dele é maior que 0 if(boss != null && bossHeal > 0) { g.drawImage(boss, x, y, null); //causa uma espera entre um disparo e outro if (delay) { createFire(); delay = false; } else { waitFire(); //espera para o próximo disparo } /** * verifica se a sequencia de tiros não esta vasia verifica se o * tiro saiu da tela, se saiu remove se não desenha na nova posição */ if (!bossTiro.isEmpty()) { for (int i = 0; i < bossTiro.size(); i++) { if (bossTiro.get(i).getY() > WinDefs.GHEIGHT) { bossTiro.remove(i); } else { bossTiro.get(i).draw(g); } } } } else { //se o hp do boss acabou cria vetor de explosão if( bossFail == null) bossFail = new Explosao("explosao64.png", x, y, 64, 64, 12); bossFail.draw(g); //repasa referência para o objeto que criará a explosão na tela } } /** * atualiza posição da nave do boss e dos tiros */ public void move(){ if(bossHeal > 0){ //se o hp > 0 //verifica se ele vai pela esquerda ou pela direita if(direction) x++; //direita else x--; //esquerda if(x < 0) {//muda direção caso o boss chegue no canto esquerdo da tela x = 0; direction = true; //direita } if(x+width > WinDefs.GWIDTH) { //muda de direção caso chegue no canto direito x = WinDefs.GWIDTH - width; direction = false; //esquerda } //atualiza tiro if(!bossTiro.isEmpty()){ for(int i = 0; i < bossTiro.size(); i++) bossTiro.get(i).move(); } } } /** * cria disparos do boss */ private void createFire(){ if(bossTiro.size() < 5){ Tiro t = new Tiro(missiel, x + (width / 2) - 3, y + height); t.setOrientacao(true); t.setVelocidade(+5); bossTiro.add(t); shoot.playSound(); } } /** * causa uma espera para o próximo disparo */ private void waitFire(){ if(countDelay < 32) countDelay++; else{ countDelay = 0; delay = true; } } /** * * @param x coordenada * @param xwidth coordenada x + a largura do elemento intersectado * @param y coordenada y * @param yheight coordenada y + a altura do elemento intersectado * @return true se atingiu * @return false se n atingiu */ public boolean intersects(int x,int xwidth,int y,int yheight){ if(!bossTiro.isEmpty()){ for(int i = 0; i < bossTiro.size(); i++){ if( (bossTiro.get(i).getX() >= x && bossTiro.get(i).getX() <= xwidth) && (bossTiro.get(i).getY() >= y && bossTiro.get(i).getY() <= yheight) ){ bossTiro.remove(i); killed.playSound(); return true; } } } return false; } /** * * @param x seta x com novo posição em x da nave */ public void setX(int x) { this.x = x; } /** * * @param y seta y com nova posição em y da nave */ public void setY(int y) { this.y = y; } /** * * @return posição atual da nave em x */ public int getX() { return x; } /** * * @return posição atual da nave em y */ public int getY() { return y; } /** * * @return largura da nave */ public int getWidth() { return width; } /** * * @return altura da nave */ public int getHeight() { return height; } /** * decrementa o HP do boss */ public void decBossHeal(){ bossHeal--; } /** * * @return HP do boss */ public int getHP(){ return bossHeal; } }
[ "=" ]
=
b1161d152362e8c549e2afee354d3e6a400a22c5
62e330c99cd6cedf20bc162454b8160c5e1a0df8
/basex-core/src/main/java/org/basex/util/hash/ASet.java
bfa5c0c51498c10f8e4e7dd6bb4e6335f6cb429c
[ "BSD-3-Clause" ]
permissive
nachawati/basex
76a717b069dcea3932fad5116e0a42a727052b58
0bc95648390ec3e91b8fd3e6ddb9ba8f19158807
refs/heads/master
2021-07-20T06:57:18.969297
2017-10-31T04:17:00
2017-10-31T04:17:00
106,351,382
0
0
null
2017-10-10T01:00:38
2017-10-10T01:00:38
null
UTF-8
Java
false
false
2,257
java
package org.basex.util.hash; import java.util.*; /** * This is the basic structure of an efficient and memory-saving hash set. * The first entry of the token set (offset 0) will always be kept empty. * * @author BaseX Team 2005-17, BSD License * @author Christian Gruen */ public abstract class ASet { /** Hash table buckets. */ protected int[] buckets; /** Pointers to the next entry. */ protected int[] next; /** Hash entries. The actual number of entries is {@code size - 1}. */ protected int size = 1; /** * Empty constructor. */ protected ASet() { } /** * Initializes the data structure with an initial array size. * @param capacity initial array capacity (will be resized to a power of two) */ protected ASet(final int capacity) { int c = 1; while(c < capacity) c <<= 1; buckets = new int[c]; next = new int[c]; } /** * Resets the data structure. Must be called when data structure is initialized. */ void clear() { Arrays.fill(buckets, 0); size = 1; } /** * Returns the number of entries. * The actual number of keys may be smaller if keys have been deleted. * @return number of entries */ public final int size() { return size - 1; } /** * Tests is the set is empty. * @return result of check */ public final boolean isEmpty() { return size == 1; } /** * Resizes the hash table. */ protected final void checkSize() { if(size < next.length) return; final int s = size << 1; final int[] tmp = new int[s]; for(final int b : buckets) { int id = b; while(id != 0) { final int p = hash(id) & s - 1; final int nx = next[id]; next[id] = tmp[p]; tmp[p] = id; id = nx; } } buckets = tmp; next = Arrays.copyOf(next, s); rehash(s); } /** * Returns the hash value of the element with the specified id. * @param id id of the element * @return hash value */ protected abstract int hash(int id); /** * Rehashes all entries. * @param newSize new hash size */ protected abstract void rehash(int newSize); }
[ "mnachawa@gmu.edu" ]
mnachawa@gmu.edu
23dd02756382aa323b62f48a5b3aacb3b3da5b72
ec9a6943f217a9b9d63d149e51e4a56161c8a6dd
/src/main/java/org/onetwo/common/db/exception/NotUniqueResultException.java
1134412263534d1c773a55c3f425fa67b61fe830
[]
no_license
wayshall/dbm
048e75be9cfa9426c58f92785629faeb8469325f
901dd697e7a959c1cd82b17d0dec7c1f96d8b166
refs/heads/master
2023-07-20T03:06:13.584553
2021-03-18T15:18:35
2021-03-18T15:18:35
86,407,844
13
4
null
2022-09-01T23:11:17
2017-03-28T02:52:33
Java
UTF-8
Java
false
false
359
java
package org.onetwo.common.db.exception; import org.onetwo.common.exception.BaseException; public class NotUniqueResultException extends BaseException { public NotUniqueResultException(int resultCount) { super("query did not return a unique result: " + resultCount ); } public NotUniqueResultException(String msg, Exception e) { super(msg, e); } }
[ "weishao.zeng@gmail.com" ]
weishao.zeng@gmail.com
382aa41f7469b40892acb7d9ebe28317d53472f8
f051ee9d89950383a842a6e2094083f6b4b8b316
/Lecture/Spring/Work/textapp02/src/main/java/com/testapp02/inf/IDaoUser.java
a598143081dc989b97ef87bae00918316df38e0f
[]
no_license
BBongR/workspace
6d3b5c5a05bee75c031a80b971c859b6749e541e
2f020cd7809e28a2cae0199cac59375d407f58cf
refs/heads/master
2021-09-13T14:49:51.825677
2018-02-07T09:18:40
2018-02-07T09:18:40
106,399,804
0
0
null
null
null
null
UTF-8
Java
false
false
143
java
package com.testapp02.inf; import com.testapp02.model.ModelUser; public interface IDaoUser { ModelUser login(ModelUser user); }
[ "suv1214@naver.com" ]
suv1214@naver.com
1f02318540dc81fe7cbdf26835ed964bc825051e
e7ee311e20b40c87bf6d23a53a1d7b11fd29d2c3
/src/chosun/ciis/mt/etccar/ds/MT_ETCCAR_9003_LDataSet.java
83e822707f5feae30801252546383babdf1042d1
[]
no_license
nosmoon/misdevteam
4e3695ef7bbdcd231bb84d7d8d7df54a23ff0a60
1829d5bd489eb6dd307ca244f0e183a31a1de773
refs/heads/master
2020-04-15T15:57:05.480056
2019-01-10T01:12:01
2019-01-10T01:12:01
164,812,547
1
0
null
null
null
null
UHC
Java
false
false
3,451
java
/*************************************************************************************************** * 파일명 : .java * 기능 : 독자우대-구독신청 * 작성일자 : 2007-05-22 * 작성자 : 김대섭 ***************************************************************************************************/ /*************************************************************************************************** * 수정내역 : * 수정자 : * 수정일자 : * 백업 : ***************************************************************************************************/ package chosun.ciis.mt.etccar.ds; import java.sql.*; import java.util.*; import somo.framework.db.*; import somo.framework.util.*; import chosun.ciis.mt.etccar.dm.*; import chosun.ciis.mt.etccar.rec.*; /** * */ public class MT_ETCCAR_9003_LDataSet extends somo.framework.db.BaseDataSet implements java.io.Serializable{ public ArrayList curlist = new ArrayList(); public String errcode; public String errmsg; public MT_ETCCAR_9003_LDataSet(){} public MT_ETCCAR_9003_LDataSet(String errcode, String errmsg){ this.errcode = errcode; this.errmsg = errmsg; } public void setErrcode(String errcode){ this.errcode = errcode; } public void setErrmsg(String errmsg){ this.errmsg = errmsg; } public String getErrcode(){ return this.errcode; } public String getErrmsg(){ return this.errmsg; } public void getValues(CallableStatement cstmt) throws SQLException{ this.errcode = Util.checkString(cstmt.getString(1)); this.errmsg = Util.checkString(cstmt.getString(2)); if(!"".equals(this.errcode)){ return; } ResultSet rset0 = (ResultSet) cstmt.getObject(9); while(rset0.next()){ MT_ETCCAR_9003_LCURLISTRecord rec = new MT_ETCCAR_9003_LCURLISTRecord(); rec.drvr_cd = Util.checkString(rset0.getString("drvr_cd")); rec.drvr_nm = Util.checkString(rset0.getString("drvr_nm")); rec.tel_no = Util.checkString(rset0.getString("tel_no")); this.curlist.add(rec); } } }/*---------------------------------------------------------------------------------------------------- Web Tier에서 DataSet 객체 관련 코드 작성시 사용하십시오. <% MT_ETCCAR_9003_LDataSet ds = (MT_ETCCAR_9003_LDataSet)request.getAttribute("ds"); %> Web Tier에서 Record 객체 관련 코드 작성시 사용하십시오. <% for(int i=0; i<ds.curlist.size(); i++){ MT_ETCCAR_9003_LCURLISTRecord curlistRec = (MT_ETCCAR_9003_LCURLISTRecord)ds.curlist.get(i);%> HTML 코드들.... <%}%> ----------------------------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------------------------- Web Tier에서 DataSet 객체의 <%= %> 작성시 사용하십시오. <%= ds.getErrcode()%> <%= ds.getErrmsg()%> <%= ds.getCurlist()%> ----------------------------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------------------------- Web Tier에서 Record 객체의 <%= %> 작성시 사용하십시오. <%= curlistRec.drvr_no%> <%= curlistRec.drvr_nm%> <%= curlistRec.tel_no%> ----------------------------------------------------------------------------------------------------*/ /* 작성시간 : Thu Sep 06 18:03:04 KST 2012 */
[ "DLCOM000@172.16.30.11" ]
DLCOM000@172.16.30.11
06126a88456dc8bab7eaf93072a6a1cc0f4b178d
12a6c83d8227125ac107607d61a0f218809cdfdf
/utilcode/src/test/java/com/blankj/utilcode/utils/FileUtilsTest.java
d70bcd07cb1c6c99d579a79dc3bee77006690af2
[ "Apache-2.0" ]
permissive
jp1017/AndroidUtilCode
c0ac1f3896ee9375ce5ed9bdc1bf014cd96e282b
dc30cece829aa60aa9de90be4a5eff7aa6ec8838
refs/heads/master
2020-04-06T04:15:50.319287
2016-09-27T01:07:10
2016-09-27T01:07:10
69,304,761
3
0
null
2016-09-27T00:40:45
2016-09-27T00:40:45
null
UTF-8
Java
false
false
7,802
java
package com.blankj.utilcode.utils; import org.junit.Test; import java.io.File; import java.io.FileInputStream; import java.io.FilenameFilter; import static com.blankj.utilcode.utils.FileUtils.*; import static com.blankj.utilcode.utils.TestUtils.BASEPATH; import static com.blankj.utilcode.utils.TestUtils.SEP; import static com.google.common.truth.Truth.assertThat; /** * <pre> * author: Blankj * blog : http://blankj.com * time : 2016/8/19 * desc : FileUtils单元测试 * </pre> */ public class FileUtilsTest { String path = BASEPATH + "file" + SEP; @Test public void testGetFileByPath() throws Exception { System.out.println(new byte[0].length); assertThat(getFileByPath(" ")).isNull(); assertThat(getFileByPath("c:")).isNotNull(); } @Test public void testIsFileExists() throws Exception { assertThat(isFileExists(path + "UTF8.txt")).isTrue(); assertThat(isFileExists(path + "UTF8")).isFalse(); } @Test public void testIsDir() throws Exception { assertThat(isDir(path + "UTF8.txt")).isFalse(); assertThat(isDir(path)).isTrue(); } @Test public void testIsFile() throws Exception { assertThat(isFile(path + "UTF8.txt")).isTrue(); assertThat(isFile(path)).isFalse(); } @Test public void testCreateOrExistsDir() throws Exception { assertThat(createOrExistsDir(path + "new Dir")).isTrue(); assertThat(createOrExistsDir(path)).isTrue(); } @Test public void testCreateOrExistsFile() throws Exception { assertThat(createOrExistsFile(path + "new File")).isTrue(); assertThat(createOrExistsFile(path)).isFalse(); } @Test public void testCreateFileByDeleteOldFile() throws Exception { assertThat(createFileByDeleteOldFile(path + "new File")).isTrue(); assertThat(createFileByDeleteOldFile(path)).isFalse(); } String path1 = BASEPATH + "file1" + SEP; @Test public void testCopyDir() throws Exception { assertThat(copyDir(path, path)).isFalse(); assertThat(copyDir(path, path + "new Dir")).isFalse(); assertThat(copyDir(path, path1)).isTrue(); } @Test public void testCopyFile() throws Exception { assertThat(copyFile(path + "GBK.txt", path + "GBK.txt")).isFalse(); assertThat(copyFile(path + "GBK.txt", path + "new Dir" + SEP + "GBK.txt")).isTrue(); assertThat(copyFile(path + "GBK.txt", path1 + "GBK.txt")).isTrue(); } @Test public void testMoveDir() throws Exception { assertThat(moveDir(path, path)).isFalse(); assertThat(moveDir(path, path + "new Dir")).isFalse(); assertThat(moveDir(path, path1)).isTrue(); assertThat(moveDir(path1, path)).isTrue(); } @Test public void testMoveFile() throws Exception { assertThat(moveFile(path + "GBK.txt", path + "GBK.txt")).isFalse(); assertThat(moveFile(path + "GBK.txt", path1 + "GBK.txt")).isTrue(); assertThat(moveFile(path1 + "GBK.txt", path + "GBK.txt")).isTrue(); } @Test public void testDeleteDir() throws Exception { assertThat(deleteDir(path + "GBK.txt")).isFalse(); assertThat(deleteDir(path + "del")).isTrue(); } @Test public void testDeleteFile() throws Exception { assertThat(deleteFile(path)).isFalse(); assertThat(deleteFile(path + "GBK1.txt")).isTrue(); assertThat(deleteFile(path + "del.txt")).isTrue(); } @Test public void testListFilesInDir() throws Exception { System.out.println(listFilesInDir(path, false).toString()); System.out.println(listFilesInDir(path, true).toString()); } FilenameFilter filter = new FilenameFilter() { public boolean accept(File dir, String name) { return name.endsWith("k.txt"); } }; @Test public void testListFilesInDirWithFiltere() throws Exception { System.out.println(listFilesInDirWithFilter(path, "k.txt", false).toString()); System.out.println(listFilesInDirWithFilter(path, "k.txt", true).toString()); System.out.println(listFilesInDirWithFilter(path, filter, false).toString()); System.out.println(listFilesInDirWithFilter(path, filter, true).toString()); } @Test public void testSearchFile() throws Exception { System.out.println(searchFileInDir(path, "GBK.txt").toString()); System.out.println(searchFileInDir(path, "child").toString()); } @Test public void testWriteFileFromIS() throws Exception { assertThat(writeFileFromIS(path + "NEW.txt", new FileInputStream(path + "UTF8.txt"), false)) .isTrue(); assertThat(writeFileFromIS(path + "NEW.txt", new FileInputStream(path + "UTF8.txt"), true)) .isTrue(); } @Test public void testWriteFileFromString() throws Exception { assertThat(writeFileFromString(path + "NEW.txt", "这是新的", false)).isTrue(); assertThat(writeFileFromString(path + "NEW.txt", "\r\n这是追加的", true)).isTrue(); } @Test public void testGetFileCharsetSimple() throws Exception { assertThat(getFileCharsetSimple(path + "GBK.txt")).isEqualTo("GBK"); assertThat(getFileCharsetSimple(path + "Unicode.txt")).isEqualTo("Unicode"); assertThat(getFileCharsetSimple(path + "UTF8.txt")).isEqualTo("UTF-8"); assertThat(getFileCharsetSimple(path + "UTF16BE.txt")).isEqualTo("UTF-16BE"); } @Test public void testGetFileLines() throws Exception { assertThat(getFileLines(path + "UTF8.txt")).isEqualTo(7); } @Test public void testReadFile2List() throws Exception { System.out.println(readFile2List(path + "UTF8.txt", "").toString()); System.out.println(readFile2List(path + "UTF8.txt", "UTF-8").toString()); System.out.println(readFile2List(path + "UTF8.txt", 2, 5, "UTF-8").toString()); System.out.println(readFile2List(path + "UTF8.txt", "GBK").toString()); } @Test public void testReadFile2String() throws Exception { System.out.println(readFile2String(path + "UTF8.txt", "")); System.out.println(readFile2String(path + "UTF8.txt", "UTF-8")); System.out.println(readFile2String(path + "UTF8.txt", "GBK")); } @Test public void testReadFile2Bytes() throws Exception { System.out.println(new String(readFile2Bytes(path + "UTF8.txt"))); } @Test public void testGetFileSize() throws Exception { assertThat(getFileSize(path + "UTF8.txt")).isEqualTo("25B"); } @Test public void testGetDirName() throws Exception { assertThat(getDirName(new File(path + "UTF8.txt"))).isEqualTo(path); assertThat(getDirName(path + "UTF8.txt")).isEqualTo(path); } @Test public void testGetFileName() throws Exception { assertThat(getFileName(new File(path + "UTF8.txt"))).isEqualTo("UTF8.txt"); assertThat(getFileName(path + "UTF8.txt")).isEqualTo("UTF8.txt"); } @Test public void testGetFileNameNoExtension() throws Exception { assertThat(getFileNameNoExtension(new File(path + "UTF8.txt"))).isEqualTo("UTF8"); assertThat(getFileNameNoExtension(path + "UTF8.txt")).isEqualTo("UTF8"); } @Test public void testGetFileExtension() throws Exception { assertThat(getFileExtension(new File(path + "UTF8.txt"))).isEqualTo(".txt"); assertThat(getFileExtension(path + "UTF8.txt")).isEqualTo(".txt"); } }
[ "625783482@qq.com" ]
625783482@qq.com
3ca02977315f146d6ecb117737430fa5e8ce0fa1
ad9c328aeb5ea617a1c056df45ae9acc3e5c1aad
/study/study-springboot2/study-springboot2-example03/src/main/java/org/jq/controller/MySpringBootApplication.java
c60645cab77e7013b39d5861c751d9099472fdd5
[]
no_license
tangjiquan/collect
3fa4b3fd5fecc7e0d8d7a6bf89151464bd4e98bb
d059d89ae9899bd43b2f5b7d46b7ba88d5f066d4
refs/heads/master
2022-12-22T19:26:37.599708
2019-08-05T15:00:32
2019-08-05T15:00:48
126,582,519
1
0
null
2022-12-16T08:04:19
2018-03-24T09:03:08
Java
UTF-8
Java
false
false
985
java
package org.jq.controller; import org.springframework.boot.Banner; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.PropertySource; /** * @Author: Kevin * @Date: Created in 下午4:01 18-5-1 * @Version: * @Description: */ //会初始化那些注解:@Repository @Service @Controller @Component @Entity , 当前包或者是子包下的都会被扫描 @SpringBootApplication//告知spring是一个入口类 @PropertySource("classpath:config.properties") public class MySpringBootApplication { public static void main(String[] args){ // 第一种方式启动 // 启动springboot, 并初始化相关属性 //SpringApplication.run(MySpringBootApplication.class); // 第二种方式启动 SpringApplication app = new SpringApplication(MySpringBootApplication.class); app.setBannerMode(Banner.Mode.OFF);// 关闭banner的配置 app.run(args); } }
[ "2495527426@qq.com" ]
2495527426@qq.com
81c3a2a1bbdb4e6dd960717eaf301721f1c71a0e
6e6db7db5aa823c77d9858d2182d901684faaa24
/sample/webservice/eBayDemoApp/src/com/ebay/trading/api/ProfileCategoryGroupDefinitionType.java
51d9b17e16b89c98364101bcaa2ad9ff0f1e1ebc
[ "Apache-2.0", "LicenseRef-scancode-warranty-disclaimer", "MIT" ]
permissive
4everalone/nano
68a480d07d80f0f50d73ec593443bfb362d646aa
71779b1ad546663ee90a29f1c2d4236a6948a621
refs/heads/master
2020-12-25T14:08:08.303942
2013-07-25T13:28:41
2013-07-25T13:28:41
10,792,684
0
1
Apache-2.0
2019-04-24T20:12:27
2013-06-19T13:14:26
Java
UTF-8
Java
false
false
740
java
// Generated by xsd compiler for android/java // DO NOT CHANGE! package com.ebay.trading.api; import java.io.Serializable; import com.leansoft.nano.annotation.*; import java.util.List; /** * * Type defining the <b>PaymentProfileCategoryGroup</b>, <b> * ReturnPolicyProfileCategoryGroup</b>, and <b>ShippingProfileCategoryGroup</b> * fields, which are all returned in the <b>GetCategoryFeature</b> response if these * Business Policies profile types apply to the category. Each of these fields is returned as an * empty element. * */ public class ProfileCategoryGroupDefinitionType implements Serializable { private static final long serialVersionUID = -1L; @AnyElement @Order(value=0) public List<Object> any; }
[ "51startup@sina.com" ]
51startup@sina.com
1778120a483b0c2f8d2b8b1fb01b207b28494314
0981333953bdbf488421f094bd584efd0c789902
/SillyChildClient/app/src/main/java/com/sillykid/app/entity/homepage/airporttransportation/SelectProductAirportTransportationBean.java
33d9d0e112913a6ffc6ad732b80d03c34fdfab72
[ "Apache-2.0" ]
permissive
921668753/SillyChildClient2-Android
ff7f0d9a97be64e610ecad304903bc853cbb3db0
f8f8ea3cca9013d39c9d7164bd2bd9573528093d
refs/heads/master
2020-03-23T09:18:15.433017
2018-12-04T13:46:33
2018-12-04T13:46:33
141,379,323
1
0
null
null
null
null
UTF-8
Java
false
false
1,922
java
package com.sillykid.app.entity.homepage.airporttransportation; import com.common.cklibrary.entity.BaseResult; import java.util.List; public class SelectProductAirportTransportationBean extends BaseResult<List<SelectProductAirportTransportationBean.DataBean>> { public class DataBean { /** * id : 1 * main_picture : http://img.shahaizhi.com/%28null%291530269095 * model : 丰田阿尔法 * order_number : 暂未预定 * passenger_number : 最多可乘坐6人 * product_name : 成田机场接机 */ private int id; private String main_picture; private String model; private String order_number; private String passenger_number; private String product_name; public int getId() { return id; } public void setId(int id) { this.id = id; } public String getMain_picture() { return main_picture; } public void setMain_picture(String main_picture) { this.main_picture = main_picture; } public String getModel() { return model; } public void setModel(String model) { this.model = model; } public String getOrder_number() { return order_number; } public void setOrder_number(String order_number) { this.order_number = order_number; } public String getPassenger_number() { return passenger_number; } public void setPassenger_number(String passenger_number) { this.passenger_number = passenger_number; } public String getProduct_name() { return product_name; } public void setProduct_name(String product_name) { this.product_name = product_name; } } }
[ "921668753@qq.com" ]
921668753@qq.com
4a8082b3472a12e8b1a240b10dd070d111ff2f5d
0fa466405f0fbef8a33eeaa6e685fbe06b7ad5e1
/qtiworks-jqtiplus/src/main/java/uk/ac/ed/ph/jqtiplus/node/expression/operator/IsNull.java
b4abd1aaeeab5bbf830a82bbeb8530d41d83934d
[]
no_license
ZackPierce/qtiworks
35e6334632113ab116cfd385eda8bceebff18029
90649f5f4dfa8fa3430c9d725bad779f8fc68664
refs/heads/master
2021-01-18T06:13:56.936481
2013-09-24T00:05:54
2013-09-24T00:05:54
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,976
java
/* Copyright (c) 2012-2013, University of Edinburgh. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright notice, this * list of conditions and the following disclaimer in the documentation and/or * other materials provided with the distribution. * * * Neither the name of the University of Edinburgh nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * * This software is derived from (and contains code from) QTItools and MathAssessEngine. * QTItools is (c) 2008, University of Southampton. * MathAssessEngine is (c) 2010, University of Edinburgh. */ package uk.ac.ed.ph.jqtiplus.node.expression.operator; import uk.ac.ed.ph.jqtiplus.node.expression.AbstractSimpleFunctionalExpression; import uk.ac.ed.ph.jqtiplus.node.expression.ExpressionParent; import uk.ac.ed.ph.jqtiplus.value.BooleanValue; import uk.ac.ed.ph.jqtiplus.value.Value; /** * The isNull operator takes A sub-expression with any base-type and cardinality. * The result is A single boolean with A value of true if the sub-expression is NULL and false otherwise. * Note that empty containers and empty strings are both treated as NULL. * * @see uk.ac.ed.ph.jqtiplus.value.Cardinality * @see uk.ac.ed.ph.jqtiplus.value.BaseType * @author Jiri Kajaba */ public final class IsNull extends AbstractSimpleFunctionalExpression { private static final long serialVersionUID = 2510627886708118311L; /** Name of this class in xml schema. */ public static final String QTI_CLASS_NAME = "isNull"; public IsNull(final ExpressionParent parent) { super(parent, QTI_CLASS_NAME); } @Override protected BooleanValue evaluateValidSelf(final Value[] childValues) { return BooleanValue.valueOf(childValues[0].isNull()); } }
[ "david.mckain@ed.ac.uk" ]
david.mckain@ed.ac.uk
ac7459865ce4c29abbfb23317471cc45e6b93373
b863faa7e79a4b0ffabc726d3efaaf197b5ed736
/AllOnline/src/com/coomix/app/all/util/ResizeUtil.java
1080ef7cf8bf7d8ae68f7c7b781b7befd39b7fac
[]
no_license
crisslee/pw
991bd837b21fd5c96b7f81cf512be4beb1f0e65b
6b1a5adb5f0bd9c1b83cc983086e149c8ea91ec6
refs/heads/master
2022-12-16T02:57:22.258713
2020-09-09T00:16:31
2020-09-09T00:16:31
292,913,172
0
0
null
null
null
null
UTF-8
Java
false
false
4,553
java
package com.coomix.app.all.util; import android.content.Context; import android.content.SharedPreferences; import android.util.DisplayMetrics; import android.view.LayoutInflater; import android.view.View; import android.widget.TextView; import com.coomix.app.all.AllOnlineApp; import com.coomix.app.all.R; /** * @author HZJ */ public class ResizeUtil { private static final String TAG = "ResizeUtil"; private static final String DEVICE_PREF = "devicePref"; private static final String HAD_CALCULATE_DEVICE_PARAMS = "hadCalculateDeviceParams", SCREEN_WIDTH = "screenWidth", SCREEN_HEIGHT = "screenHeight", DENSITY = "density", RESIZE = "resize", RESIZE_FACTOR = "resizeFactor"; private static int screenWidth, screenHeight; // public static int appScreenHeight; private static float density; private static float resize; private static float resizeFactor; public static float getDensity() { if (density <= 0) { density = getValue(DENSITY, 1); } return density; } public static float getResize() { float defaultVaule = 1f; if (resize <= 0) { defaultVaule = NewUIParam.TOPIC_IMAGE_GRID; resize = getValue(RESIZE, defaultVaule); } return defaultVaule; } public static float getResizeFactor() { if (resizeFactor <= 0) { SharedPreferences pref = AllOnlineApp.mApp.getSharedPreferences(DEVICE_PREF, Context.MODE_PRIVATE); if (!pref.contains(RESIZE_FACTOR)) { resizeFactor = getDensity() * getResize(); pref.edit().putFloat(RESIZE_FACTOR, resizeFactor).commit(); } else { resizeFactor = pref.getFloat(RESIZE_FACTOR, 1); } } return resizeFactor; } private static float getValue(String key, float defaultVaule) { SharedPreferences pref = AllOnlineApp.mApp.getSharedPreferences(DEVICE_PREF, Context.MODE_PRIVATE); return pref.getFloat(key, defaultVaule); } public static void initDeviceParams(Context context) { SharedPreferences pref = context.getSharedPreferences(DEVICE_PREF, Context.MODE_PRIVATE); boolean hadDeviceParams = pref.getBoolean(HAD_CALCULATE_DEVICE_PARAMS, false); if (hadDeviceParams) { screenWidth = pref.getInt(SCREEN_WIDTH, -1); screenHeight = pref.getInt(SCREEN_HEIGHT, -1); density = pref.getFloat(DENSITY, 1); resize = pref.getFloat(RESIZE, 1); resizeFactor = pref.getFloat(RESIZE_FACTOR, 0); } else { DisplayMetrics dm = context.getResources().getDisplayMetrics(); screenWidth = dm.widthPixels; screenHeight = dm.heightPixels; density = dm.density; resize = calculateResize(context); resizeFactor = resize * density; boolean success = pref.edit().putInt(SCREEN_WIDTH, screenWidth).putInt(SCREEN_HEIGHT, screenHeight) .putFloat(DENSITY, density).putFloat(RESIZE, resize).putFloat(RESIZE_FACTOR, resizeFactor).commit(); if (success) { pref.edit().putBoolean(HAD_CALCULATE_DEVICE_PARAMS, true).commit(); } } } /** * 使用华为P6-T100(4.7英寸)手机作为参照设备,此设备分辨率为720 * 1184 参照设备相关参数:density=2.0, * width=720, height=1184, scaledDensity=2.0, xdpi=315.31, ydpi=315.65 * 40sp大小的textView1,在P6设备上的大小为80 * * @return resize * @author Barry */ private static float calculateResize(Context context) { float resize = 1; try { View view = LayoutInflater.from(context).inflate(R.layout.resize_layout, null); TextView resizeView = (TextView) view.findViewById(R.id.resize_view); float oldSize = resizeView.getTextSize(); // oldSize是textView1在当前设备上,适配前的大小 float percent = (float) 80 / 720; // 80是textView1在参照设备的大小,720是参照设备的屏幕宽度大小 float newSize = (float) (percent * screenWidth); // newSize是textView1在当前设备上,适配后的大小 resize = (float) newSize / oldSize; } catch (Exception e) { e.printStackTrace(); } return resize; } public static void setTextSize(TextView textView, float textSize) { textView.setTextSize(textSize * ResizeUtil.resize); } }
[ "1206656459@qq.com" ]
1206656459@qq.com
b5b07285af088babe84fedc33fca3003f80fed64
01b73df6ab9405f4a92ac703b6d6743260a3b755
/src/test/java/com/zuma/sms/SmsSenderApplicationTests.java
d310a7b3dd39e3651625bd071a8e9bbe83234fbd
[]
no_license
lvjj/SMS-Sender
afbcb6717ba973bad14eb36a32408e687424ad75
bab95262b0508be8917abb4b46c6e40d285947fb
refs/heads/master
2021-02-17T07:31:48.449463
2020-03-05T05:55:55
2020-03-05T05:55:55
245,080,903
0
0
null
2020-03-05T05:54:50
2020-03-05T05:54:49
null
UTF-8
Java
false
false
4,086
java
package com.zuma.sms; import com.fasterxml.jackson.databind.ObjectMapper; import com.zuma.sms.dto.IdFieldValuePair; import com.zuma.sms.entity.Platform; import com.zuma.sms.entity.SmsSendRecord; import com.zuma.sms.form.PlatformSendSmsForm; import com.zuma.sms.form.SendSmsForm; import com.zuma.sms.repository.BatchRepository; import com.zuma.sms.service.BatchService; import com.zuma.sms.service.SendTaskRecordService; import com.zuma.sms.util.CodeUtil; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.http.MediaType; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.request.MockMvcRequestBuilders; import org.springframework.test.web.servlet.result.MockMvcResultMatchers; import org.springframework.transaction.annotation.Transactional; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; import java.util.ArrayList; import java.util.LinkedList; import java.util.List; @RunWith(SpringRunner.class) @SpringBootTest @AutoConfigureMockMvc public class SmsSenderApplicationTests { @Autowired private MockMvc mockMvc; @Autowired private SendTaskRecordService sendTaskRecordService; @Autowired private BatchRepository batchRepository; @Test public void contextLoads() { } @PersistenceContext protected EntityManager em; @Autowired private BatchService batchService; @Test public void testBatch() { List<SmsSendRecord> l = new ArrayList<>(); l.add(new SmsSendRecord(1000L,1000L,"aaa","bbb",10,"xxxx")); l.add(new SmsSendRecord(1001L,1000L,"aaa","bbb",10,"xxxx")); l.add(new SmsSendRecord(1002L,1000L,"aaa","bbb",10,"xxxx")); batchService.batchSave(l); } @Test public void testBatch2() { List<IdFieldValuePair> l = new ArrayList<>(); l.add(new IdFieldValuePair(1015L, "channel_name", "xxxx", true)); l.add(new IdFieldValuePair(1016L, "channel_name", "xxxx", true)); l.add(new IdFieldValuePair(1017L, "channel_name", "xxxx", true)); l.add(new IdFieldValuePair(1026L, "channel_name", "xxxx", true)); l.add(new IdFieldValuePair(1021L, "channel_name", "xxxx", true)); l.add(new IdFieldValuePair(1022L, "channel_name", "xxxx", true)); batchService.batchUpdateSmsSendRecordFieldById(l,"channel_name",true); } @Test public void test3() { List<SmsSendRecord> l = new LinkedList<>(); l.add(new SmsSendRecord().setMessage("111").setPhones("aaa").setPhoneCount(11)); l.add(new SmsSendRecord().setMessage("22").setPhones("aaa").setPhoneCount(11)); l.add(new SmsSendRecord().setMessage("22").setPhones("aaa").setPhoneCount(11)); batchService.batchSave(l); l.get(0).setErrorInfo("xxx"); batchService.batchSave(l); } @Autowired private ObjectMapper objectMapper; /** * 测试api调用发送短信接口 */ @Test public void testApiSendSms() throws Exception { Long platformId = 1000L; String phone = "17826824998,13325869158"; Integer channel = 0; String smsMessage = "xxxxxx!&aaaaaa"; Long timestamp = System.currentTimeMillis(); String sign = CodeUtil.stringToMd5("$2a$10$E7A/X1w9DvxpCCL99P.M/eg6I1ovItS3UxNHRwUlV/ueDXW2GBf4e" + phone + timestamp); PlatformSendSmsForm sendSmsForm = new PlatformSendSmsForm(platformId, channel, phone, smsMessage, sign, timestamp); String result = mockMvc.perform( MockMvcRequestBuilders.post("/api/sendsms") // .param("platformId", "1000") // .param("phone", phone) // .param("smsMessage", ) // .param("timestamp", timestamp) // .param("sign", sign) .contentType(MediaType.APPLICATION_JSON_UTF8) .content(objectMapper.writeValueAsString(sendSmsForm)) .header("X-Real-IP","127.0.0.1") ) .andExpect(MockMvcResultMatchers.status().isOk()) .andReturn().getResponse().getContentAsString(); System.out.println(result); } }
[ "970389745@qq.com" ]
970389745@qq.com
32a97af3225a3da00b165cd6929d21d21a9dd040
96f8d42c474f8dd42ecc6811b6e555363f168d3e
/budejie/sources/android/support/v4/content/res/ResourcesCompat.java
2aa5c07f2191a2a40070d9316b38dc402ed938ba
[]
no_license
aheadlcx/analyzeApk
050b261595cecc85790558a02d79739a789ae3a3
25cecc394dde4ed7d4971baf0e9504dcb7fabaca
refs/heads/master
2020-03-10T10:24:49.773318
2018-04-13T09:44:45
2018-04-13T09:44:45
129,332,351
6
2
null
null
null
null
UTF-8
Java
false
false
2,051
java
package android.support.v4.content.res; import android.content.res.ColorStateList; import android.content.res.Resources; import android.content.res.Resources.NotFoundException; import android.content.res.Resources.Theme; import android.graphics.drawable.Drawable; import android.os.Build.VERSION; import android.support.annotation.ColorInt; import android.support.annotation.ColorRes; import android.support.annotation.DrawableRes; import android.support.annotation.NonNull; import android.support.annotation.Nullable; public final class ResourcesCompat { @Nullable public static Drawable getDrawable(@NonNull Resources resources, @DrawableRes int i, @Nullable Theme theme) throws NotFoundException { if (VERSION.SDK_INT >= 21) { return ResourcesCompatApi21.getDrawable(resources, i, theme); } return resources.getDrawable(i); } @Nullable public static Drawable getDrawableForDensity(@NonNull Resources resources, @DrawableRes int i, int i2, @Nullable Theme theme) throws NotFoundException { if (VERSION.SDK_INT >= 21) { return ResourcesCompatApi21.getDrawableForDensity(resources, i, i2, theme); } if (VERSION.SDK_INT >= 15) { return ResourcesCompatIcsMr1.getDrawableForDensity(resources, i, i2); } return resources.getDrawable(i); } @ColorInt public static int getColor(@NonNull Resources resources, @ColorRes int i, @Nullable Theme theme) throws NotFoundException { if (VERSION.SDK_INT >= 23) { return ResourcesCompatApi23.getColor(resources, i, theme); } return resources.getColor(i); } @Nullable public static ColorStateList getColorStateList(@NonNull Resources resources, @ColorRes int i, @Nullable Theme theme) throws NotFoundException { if (VERSION.SDK_INT >= 23) { return ResourcesCompatApi23.getColorStateList(resources, i, theme); } return resources.getColorStateList(i); } private ResourcesCompat() { } }
[ "aheadlcxzhang@gmail.com" ]
aheadlcxzhang@gmail.com
2ed8588c4915547c1439fefc8e976a97393519a8
ed3cb95dcc590e98d09117ea0b4768df18e8f99e
/project_1_2/src/b/g/f/b/Calc_1_2_16513.java
b6afc8dbb9118c6897039eecfa11af2179d9a84e
[]
no_license
chalstrick/bigRepo1
ac7fd5785d475b3c38f1328e370ba9a85a751cff
dad1852eef66fcec200df10083959c674fdcc55d
refs/heads/master
2016-08-11T17:59:16.079541
2015-12-18T14:26:49
2015-12-18T14:26:49
48,244,030
0
0
null
null
null
null
UTF-8
Java
false
false
134
java
package b.g.f.b; public class Calc_1_2_16513 { /** @return the sum of a and b */ public int add(int a, int b) { return a+b; } }
[ "christian.halstrick@sap.com" ]
christian.halstrick@sap.com
5abbfb6d6bba99ddff11a7e891d4c3eef2f5399b
1fd7d32218412c022965fecbbc6c7bdbc57d13a3
/src/main/java/io/jenkins/plugins/analysis/warnings/MyPy.java
4fd12b2b6765cad64f5cab8f56628ae02f5b3dc6
[ "MIT" ]
permissive
irundaia/warnings-plugin
948050b56be66401d6235dae8b2e15144aa23001
e999c49d16c9c55ed214955288dcd68e218b92bb
refs/heads/master
2020-04-01T17:52:44.533267
2018-10-06T22:54:27
2018-10-06T22:54:27
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,195
java
package io.jenkins.plugins.analysis.warnings; import javax.annotation.Nonnull; import org.kohsuke.stapler.DataBoundConstructor; import edu.hm.hafner.analysis.parser.violations.MyPyAdapter; import io.jenkins.plugins.analysis.core.model.StaticAnalysisTool; import hudson.Extension; /** * Provides a parser and customized messages for MyPy. * * @author Ullrich Hafner */ public class MyPy extends StaticAnalysisTool { private static final long serialVersionUID = -1864782743893780307L; static final String ID = "mypy"; /** Creates a new instance of {@link MyPy}. */ @DataBoundConstructor public MyPy() { super(); // empty constructor required for stapler } @Override public MyPyAdapter createParser() { return new MyPyAdapter(); } /** Descriptor for this static analysis tool. */ @Extension public static class Descriptor extends StaticAnalysisToolDescriptor { /** Creates the descriptor instance. */ public Descriptor() { super(ID); } @Nonnull @Override public String getDisplayName() { return Messages.Violations_MyPy(); } } }
[ "ullrich.hafner@gmail.com" ]
ullrich.hafner@gmail.com
1dca757a39a0873eb822143c29b7b50777f6dae9
e115ca60c5e79dc8fe2498789278756e678f4f63
/src/main/java/com/kepler/connection/impl/ResourceHandler.java
ed2a9a8deb90d16307a4472b041b06548288b47a
[]
no_license
pologood/Kepler-All
c4eaff798c25366f74de6bdfa696860d89c38dee
337ce8538712e5e92d1da7afa54783cb88744e5c
refs/heads/master
2021-01-20T07:18:36.043727
2017-04-11T07:14:31
2017-04-11T07:14:31
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,446
java
package com.kepler.connection.impl; import io.netty.channel.ChannelHandler.Sharable; import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelInboundHandlerAdapter; import java.util.concurrent.atomic.AtomicInteger; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import com.kepler.config.PropertiesUtils; /** * @author kim * * 2016年2月17日 */ @Sharable public class ResourceHandler extends ChannelInboundHandlerAdapter { private static final String RESOURCE_KEY = ResourceHandler.class.getName().toLowerCase() + ".resources"; private static final int RESOURCE_DEF = PropertiesUtils.get(ResourceHandler.RESOURCE_KEY, Integer.MAX_VALUE); private static final Log LOGGER = LogFactory.getLog(ResourceHandler.class); private final AtomicInteger resources = new AtomicInteger(); public void channelActive(ChannelHandlerContext ctx) throws Exception { if (this.resources.incrementAndGet() < PropertiesUtils.get(ResourceHandler.RESOURCE_KEY, ResourceHandler.RESOURCE_DEF)) { ctx.fireChannelActive(); } else { ResourceHandler.LOGGER.warn("Too many open connection ... (" + ctx.channel().remoteAddress() + ") (" + this.resources + ")"); ctx.close().addListener(ExceptionListener.TRACE); } } public void channelInactive(ChannelHandlerContext ctx) throws Exception { // 钝化时释放 this.resources.decrementAndGet(); ctx.fireChannelInactive(); } }
[ "shenjiawei@didichuxing.com" ]
shenjiawei@didichuxing.com
3e5e50bc34e6b14b198cea3f2e67391a59f35d72
8db5d5eda5d517343434cfc15cd3409090ebc7d2
/tools-service-jnl/src/main/java/org/tis/tools/rservice/jnl/JnlEnqueueRServiceImpl.java
d358e9b77c4c6c2cc52fe878345b816a95c5a087
[]
no_license
kexian-li/tistools
cb4066cb2767aa0b0872fca8eb009834334f079b
4e4b8f39e074f6c1e9f2e9730478cca97aa74aa3
refs/heads/master
2021-01-20T10:19:16.766095
2017-08-28T00:55:33
2017-08-28T00:55:33
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,726
java
/** * Copyright (C) 2016 bronsp.com, All rights reserved. */ package org.tis.tools.rservice.jnl; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.tis.tools.base.WhereCondition; import org.tis.tools.model.po.jnl.JnlEnqueue; import org.tis.tools.rservice.jnl.IJnlEnqueueRService; import org.tis.tools.service.jnl.JnlEnqueueService; import com.alibaba.dubbo.config.annotation.Service; /** * 排队流水(JNL_ENQUEUE) 基本远程服务实现(服务提供者) * * @author by generated by tools:gen-dao * */ //TEMPLATES @Service(group = "jnl", version = "1.0", interfaceClass = IJnlEnqueueRService.class, timeout = 2000, document = "排队流水的基础远程服务") public class JnlEnqueueRServiceImpl implements IJnlEnqueueRService { @Autowired JnlEnqueueService jnlEnqueueService; @Override public void insert(JnlEnqueue t) { jnlEnqueueService.insert(t); } @Override public void update(JnlEnqueue t) { jnlEnqueueService.update(t); } @Override public void updateForce(JnlEnqueue t) { jnlEnqueueService.updateForce(t); } @Override public void delete(String guid) { jnlEnqueueService.delete(guid); } @Override public void deleteByCondition(WhereCondition wc) { jnlEnqueueService.deleteByCondition(wc); } @Override public void updateByCondition(WhereCondition wc, JnlEnqueue t) { jnlEnqueueService.updateByCondition(wc,t); } @Override public List<JnlEnqueue> query(WhereCondition wc) { return jnlEnqueueService.query(wc); } @Override public int count(WhereCondition wc) { return jnlEnqueueService.count(wc); } @Override public JnlEnqueue loadByGuid(String guid) { return jnlEnqueueService.loadByGuid(guid); } }
[ "shiyunlai@gmail.com" ]
shiyunlai@gmail.com
68ba5903b796468c095e31d82a6ecd9c134df4d9
9ed6bcfacbc2de50705b4905c3ce6840e0d54ced
/server-minishift/src/main/java/org/jboss/tools/ssp/server/minishift/discovery/MinishiftVersionLoader.java
2779eeb58104c29d3d55006525bae722c2df61f2
[]
no_license
mmalina/rsp-server
f19b91a50950d27953128ab2a698414c55942928
18f8e110dbd87c63398fe81f217fe484d82a8937
refs/heads/master
2020-03-26T16:04:40.905854
2018-08-15T20:52:23
2018-08-15T20:52:23
145,081,443
0
0
null
2018-08-17T06:32:08
2018-08-17T06:32:07
null
UTF-8
Java
false
false
2,334
java
package org.jboss.tools.ssp.server.minishift.discovery; import java.io.File; import java.io.IOException; import java.util.HashMap; import java.util.Properties; import org.jboss.tools.ssp.server.spi.launchers.CommandTimeoutException; import org.jboss.tools.ssp.server.spi.launchers.ProcessUtility; public class MinishiftVersionLoader { public static String ERROR_KEY = "properties.load.error"; public static String VERSION_KEY = "Minishift version"; public static String VERSION_KEY2 = "minishift"; public static String CDK_VERSION_KEY = "CDK"; public static String CDK_VERSION_KEY_OLD = "CDK Version"; public static MinishiftVersions getVersionProperties(String commandPath) { Properties ret = new Properties(); try { String wd = new File(commandPath).getParentFile().getAbsolutePath(); String[] lines = new ProcessUtility().call(commandPath, new String[] { "version" }, wd, new HashMap<String, String>(), 5000); for (int i = 0; i < lines.length; i++) { if (lines[i].trim().isEmpty()) continue; if (lines[i].contains(":")) { // Old format, Some Key: 1.2.3 String[] split = lines[i].split(":"); if (split.length == 2) ret.put(split[0], split[1]); } else if (lines[i].contains(" ")) { String[] split = lines[i].split(" "); if (split.length == 2) ret.put(split[0], split[1]); } } } catch (IOException | CommandTimeoutException e) { ret.put(ERROR_KEY, e.getMessage()); } return new MinishiftVersions(ret); } public static class MinishiftVersions { private Properties p; public MinishiftVersions(Properties p) { this.p = p; } public String getError() { return p.getProperty(ERROR_KEY); } public String getMinishiftVersion() { String v = p.getProperty(VERSION_KEY); if (v == null) { v = p.getProperty(VERSION_KEY2); } return cleanVersion(v); } private String cleanVersion(String v) { if (v == null) return null; if (v.trim().startsWith("v")) { return v.trim().substring(1); } return v.trim(); } public String getCDKVersion() { // CDK Version String v = p.getProperty(CDK_VERSION_KEY); if (v == null) { v = p.getProperty(CDK_VERSION_KEY_OLD); } return cleanVersion(v); } public boolean isValid() { return getMinishiftVersion() != null; } } }
[ "rob@oxbeef.net" ]
rob@oxbeef.net
f147bebd6e9bb54a9b7f5a1f3fb4708b2ce6bc6e
b532f2ccaba302f4e81a559ffbafaf8d2650b703
/app/src/main/java/com/codingwithmitch/daggerpractice/ui/main/profile/ProfileFragment.java
b0666f05f811af689c9bab772bf340c56ef32b39
[]
no_license
hardikpansuria/Dagger-Examples
2a2fb118788e6ca73b16f730a09716d7184cbb47
85cc86965c97a20ebabb03cee4a0933d17ed9dfd
refs/heads/master
2020-05-15T12:07:49.835825
2019-04-11T02:50:25
2019-04-11T02:50:25
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,297
java
package com.codingwithmitch.daggerpractice.ui.main.profile; import android.os.Bundle; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import com.codingwithmitch.daggerpractice.R; import com.codingwithmitch.daggerpractice.ui.auth.AuthResource; import com.codingwithmitch.daggerpractice.models.User; import com.codingwithmitch.daggerpractice.viewmodels.ViewModelProviderFactory; import javax.inject.Inject; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.lifecycle.Observer; import androidx.lifecycle.ViewModelProviders; import dagger.android.support.DaggerFragment; public class ProfileFragment extends DaggerFragment { private static final String TAG = "DaggerExample"; private ProfileViewModel viewModel; private TextView email, username, website; @Inject ViewModelProviderFactory providerFactory; @Nullable @Override public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { return inflater.inflate(R.layout.fragment_profile, container, false); } @Override public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { Log.d(TAG, "onViewCreated: ProfileFragment. " + this); email = view.findViewById(R.id.email); username = view.findViewById(R.id.username); website = view.findViewById(R.id.website); viewModel = ViewModelProviders.of(this, providerFactory).get(ProfileViewModel.class); subscribeObservers(); } private void subscribeObservers(){ viewModel.getAuthenticatedUser().removeObservers(getViewLifecycleOwner()); viewModel.getAuthenticatedUser().observe(getViewLifecycleOwner(), new Observer<AuthResource<User>>() { @Override public void onChanged(AuthResource<User> userAuthResource) { if(userAuthResource != null){ switch (userAuthResource.status){ case LOADING:{ Log.d(TAG, "onChanged: ProfileFragment: LOADING..."); break; } case AUTHENTICATED:{ Log.d(TAG, "onChanged: ProfileFragment: AUTHENTICATED... " + "Authenticated as: " + userAuthResource.data.getEmail()); setUserDetails(userAuthResource.data); break; } case ERROR:{ Log.d(TAG, "onChanged: ProfileFragment: ERROR..."); break; } case NOT_AUTHENTICATED:{ Log.d(TAG, "onChanged: ProfileFragment: NOT AUTHENTICATED."); break; } } } } }); } private void setUserDetails(User user){ email.setText(user.getEmail()); username.setText(user.getUsername()); website.setText(user.getWebsite()); } }
[ "mitch@tabian.ca" ]
mitch@tabian.ca
13628081dd2c6de936b02dbebc6c69728f058df5
6246ead40970de7586337989821a53ad21909a2f
/app/src/main/java/com/power/travel/xixuntravel/activity/Forget_SetPwdActivity.java
88307d0d4210512560bdb069a9caaa32117ec96b
[]
no_license
Power-Android/xixun
7f05f65e12dfd0d8bb9b4a61df4ca8d39c4f87c1
c0421e147222fecc630b34f3252d5cd28de8e84e
refs/heads/master
2021-05-08T07:40:57.952498
2018-03-19T08:48:36
2018-03-19T08:48:36
106,783,602
0
0
null
null
null
null
UTF-8
Java
false
false
6,087
java
package com.power.travel.xixuntravel.activity; import android.content.Intent; import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.text.TextUtils; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.ImageView; import android.widget.TextView; import com.power.travel.xixuntravel.R; import com.power.travel.xixuntravel.app.BaseActivity; import com.power.travel.xixuntravel.app.MyApplication; import com.power.travel.xixuntravel.net.HttpClientPostUpload; import com.power.travel.xixuntravel.net.HttpUrl; import com.power.travel.xixuntravel.utils.LogUtil; import com.power.travel.xixuntravel.utils.ProgressDialogUtils; import com.power.travel.xixuntravel.utils.StringUtils; import com.power.travel.xixuntravel.utils.ToastUtil; import org.json.JSONException; import org.json.JSONObject; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * 重置密码 */ public class Forget_SetPwdActivity extends BaseActivity { private ImageView back; private TextView title; private Button regist_upload; private EditText regist_setpwd, regist_setpwd2; private String data, TAG = "Forget_SetPwdActivity", info, mobile; private ProgressDialogUtils pd; private Handler handler = new Handler() { @Override public void handleMessage(Message msg) { super.handleMessage(msg); if (msg.what == 1) {// 成功 ToastUtil.showToast(getApplicationContext(), info); Intent intent = new Intent(); intent.putExtra("mobile", mobile); intent.putExtra("password", regist_setpwd.getText().toString()); setResult(101, intent); finish(); } else if (msg.what == 0) {// 失败 ToastUtil.showToast(getApplicationContext(), info); } else if (msg.what == -1) {// 其他情况 ToastUtil.showToast(getApplicationContext(), info); } if (pd != null && Forget_SetPwdActivity.this != null) { pd.dismiss(); } } }; @Override protected void onCreate(Bundle arg0) { super.onCreate(arg0); setContentView(R.layout.activity_forget_setpwd); MyApplication.getInstance().addActivity(this); initGetIntent(); initView(); initListener(); } private void initGetIntent() { Intent intent = getIntent(); if (intent.hasExtra("mobile")) { mobile = intent.getStringExtra("mobile"); } } private void initView() { pd = ProgressDialogUtils.show(this, "提交数据..."); back = (ImageView) findViewById(R.id.back); title = (TextView) findViewById(R.id.title); title.setText("重置密码"); regist_upload = (Button) findViewById(R.id.regist_upload); regist_setpwd = (EditText) findViewById(R.id.regist_setpwd); regist_setpwd2 = (EditText) findViewById(R.id.regist_setpwd2); } private void initListener() { back.setOnClickListener(this); regist_upload.setOnClickListener(this); } @Override public void onClick(View v) { super.onClick(v); if (v == back) { finish(); } else if (v == regist_upload) { if (validate()) { upload(); } } } private boolean validate() { String pwd = regist_setpwd.getText().toString(); Pattern p = Pattern.compile("[0-9]*"); Matcher m = p.matcher(pwd); Pattern o=Pattern.compile("[a-zA-Z]"); Matcher n =o.matcher(pwd); if(m.matches() ){ regist_setpwd.setFocusableInTouchMode(true); regist_setpwd.requestFocus(); regist_setpwd.findFocus(); showEnsure("密码格式不正确!"); return false; } /*if(n.matches()){ regist_setpwd.setFocusableInTouchMode(true); regist_setpwd.requestFocus(); regist_setpwd.findFocus(); LogUtil.e(TAG,"------------------------------------"); showEnsure("密码格式不正确!"); return false; }*/ if (TextUtils.isEmpty(regist_setpwd.getText().toString())) { regist_setpwd.setFocusableInTouchMode(true); regist_setpwd.requestFocus(); regist_setpwd.findFocus(); showEnsure("请输入新密码!"); return false; } if (TextUtils.isEmpty(regist_setpwd2.getText().toString())) { regist_setpwd2.setFocusableInTouchMode(true); regist_setpwd2.requestFocus(); regist_setpwd2.findFocus(); showEnsure("请确认新密码!"); return false; } if (!TextUtils.equals(regist_setpwd.getText().toString(), regist_setpwd2.getText().toString())) { regist_setpwd2.setFocusableInTouchMode(true); regist_setpwd2.requestFocus(); regist_setpwd2.findFocus(); regist_setpwd2.getText().clear(); showEnsure("两次密码不相等!"); return false; } if (regist_setpwd.getText().toString().trim().length() < 6 && regist_setpwd.getText().toString().trim().length() > 16){ regist_setpwd2.setFocusableInTouchMode(true); regist_setpwd2.requestFocus(); regist_setpwd2.findFocus(); showEnsure("请输入6-16位密码"); return false; } if (!isConnect()) { ToastUtil.showToast(getApplication(), getResources().getString(R.string.notnetwork)); return false; } return true; } private void upload() { pd.show(); new Thread(new Runnable() { @Override public void run() { JSONObject data = new JSONObject(); try { data.put("mobile", mobile); data.put("password", regist_setpwd.getText() .toString()); } catch (JSONException e1) { e1.printStackTrace(); } String url = HttpUrl.forgotpass; String json= StringUtils.setJSON(data); LogUtil.e(TAG, "找回密码提交的数据" + json); String request = HttpClientPostUpload.Upload(json, url); JSONObject jsonj = null; String status = null; try { jsonj = new JSONObject(request); LogUtil.e(TAG, "找回密码返回的数据" + jsonj.toString()); status = jsonj.getString("status"); info = jsonj.getString("info"); } catch (JSONException e) { e.printStackTrace(); LogUtil.e(TAG, "解析错误" + e.toString()); } if (TextUtils.equals(status, "1")) { handler.sendEmptyMessage(1); } else if (TextUtils.equals(status, "0")) { handler.sendEmptyMessage(0); } else { handler.sendEmptyMessage(-1); } } }).start(); } }
[ "power_android@163.com" ]
power_android@163.com
9eeb80a416480e15d066b5c7a8723ca74f3d0485
647ec12ce50f06e7380fdbfb5b71e9e2d1ac03b4
/com.tencent.mm/classes.jar/com/tencent/mm/plugin/recordvideo/ui/editor/c/c$a.java
ab9a1cddbca7af0a3133e8a79972a31d99839f75
[]
no_license
tsuzcx/qq_apk
0d5e792c3c7351ab781957bac465c55c505caf61
afe46ef5640d0ba6850cdefd3c11badbd725a3f6
refs/heads/main
2022-07-02T10:32:11.651957
2022-02-01T12:41:38
2022-02-01T12:41:38
453,860,108
36
9
null
2022-01-31T09:46:26
2022-01-31T02:43:22
Java
UTF-8
Java
false
false
763
java
package com.tencent.mm.plugin.recordvideo.ui.editor.c; import com.tencent.matrix.trace.core.AppMethodBeat; import kotlin.Metadata; @Metadata(d1={""}, d2={"Lcom/tencent/mm/plugin/recordvideo/ui/editor/touch/TouchTracker$PivotType;", "", "(Ljava/lang/String;I)V", "FREE", "CENTER", "plugin-recordvideo_release"}, k=1, mv={1, 5, 1}, xi=48) public enum c$a { static { AppMethodBeat.i(280195); Oaw = new a("FREE", 0); Oax = new a("CENTER", 1); Oay = new a[] { Oaw, Oax }; AppMethodBeat.o(280195); } private c$a() {} } /* Location: L:\local\mybackup\temp\qq_apk\com.tencent.mm\classes.jar * Qualified Name: com.tencent.mm.plugin.recordvideo.ui.editor.c.c.a * JD-Core Version: 0.7.0.1 */
[ "98632993+tsuzcx@users.noreply.github.com" ]
98632993+tsuzcx@users.noreply.github.com
0b4137c7fa43a8547b3b1f7a5ea7851d9ee27976
66220fbb2b7d99755860cecb02d2e02f946e0f23
/src/net/sourceforge/plantuml/project/lang/Verb.java
482056cfe4496f7ab3d858a77b95708c434ec2bf
[ "MIT" ]
permissive
isabella232/plantuml-mit
27e7c73143241cb13b577203673e3882292e686e
63b2bdb853174c170f304bc56f97294969a87774
refs/heads/master
2022-11-09T00:41:48.471405
2020-06-28T12:42:10
2020-06-28T12:42:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,962
java
/* ======================================================================== * PlantUML : a free UML diagram generator * ======================================================================== * * (C) Copyright 2009-2020, Arnaud Roques * * Project Info: https://plantuml.com * * If you like this project or if you find it useful, you can support us at: * * https://plantuml.com/patreon (only 1$ per month!) * https://plantuml.com/paypal * * This file is part of PlantUML. * * Licensed under The MIT License (Massachusetts Institute of Technology License) * * See http://opensource.org/licenses/MIT * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * * Original Author: Arnaud Roques */ package net.sourceforge.plantuml.project.lang; import net.sourceforge.plantuml.command.CommandExecutionResult; public interface Verb { public CommandExecutionResult execute(Subject subject, Complement complement); }
[ "plantuml@gmail.com" ]
plantuml@gmail.com
425ee8eb8cec37e23de778399e3623d936536c5d
535e5d97d44fd42fca2a6fc68b3b566046ffa6c2
/com/bigroad/ttb/android/receiver/TimeChangeReceiver.java
712002df5cb482f23cfed312026ad6d3893ebef4
[]
no_license
eric-lanita/BigRoadTruckingLogbookApp_v21.0.12_source_from_JADX
47566c288bc89777184b73ef0eb199b61de39f82
fb84301d90ec083ce06c68a3828cf99d8855c007
refs/heads/master
2021-09-01T07:02:52.500068
2017-12-25T15:06:05
2017-12-25T15:06:05
115,346,008
0
3
null
null
null
null
UTF-8
Java
false
false
444
java
package com.bigroad.ttb.android.receiver; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import com.bigroad.ttb.android.OurApplication; public class TimeChangeReceiver extends BroadcastReceiver { public void onReceive(Context context, Intent intent) { if (intent != null) { OurApplication.m6262S().m6101a(intent.getStringExtra("time-zone")); } } }
[ "eric.lanita@gmail.com" ]
eric.lanita@gmail.com
2bdfa2e98233101cf6781cc42a20a03f41e07a09
76b00b7be11ab2c21eb4a604a9484065a500c52f
/customerLR-service-portlet/docroot/WEB-INF/service/com/pacnet/connect/model/SMA_adminsSoap.java
f6a02b4cd37857d9c9fb6eb580cf4cffc5593a81
[]
no_license
pankajsharmaatcloudsmartz/Pacnet-Connect
8cf201cbcf6de2deae4407df564784fb42fbf55c
2bdc4d44f35373aad6c83cd29ce8dc970091b79d
refs/heads/master
2021-01-23T14:47:10.167327
2015-03-10T11:21:56
2015-03-10T11:30:53
31,952,143
0
0
null
null
null
null
UTF-8
Java
false
false
4,057
java
/** * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved. * * This library 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 library 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. */ package com.pacnet.connect.model; import java.io.Serializable; import java.util.ArrayList; import java.util.Date; import java.util.List; /** * This class is used by SOAP remote services, specifically {@link com.pacnet.connect.service.http.SMA_adminsServiceSoap}. * * @author CloudSmartz * @see com.pacnet.connect.service.http.SMA_adminsServiceSoap * @generated */ public class SMA_adminsSoap implements Serializable { public static SMA_adminsSoap toSoapModel(SMA_admins model) { SMA_adminsSoap soapModel = new SMA_adminsSoap(); soapModel.setId(model.getId()); soapModel.setUser_id(model.getUser_id()); soapModel.setRadcheck_id(model.getRadcheck_id()); soapModel.setCompany_id(model.getCompany_id()); soapModel.setIsActive(model.getIsActive()); soapModel.setCreated_On(model.getCreated_On()); soapModel.setCreated_By(model.getCreated_By()); soapModel.setUpdated_On(model.getUpdated_On()); soapModel.setUpdated_By(model.getUpdated_By()); return soapModel; } public static SMA_adminsSoap[] toSoapModels(SMA_admins[] models) { SMA_adminsSoap[] soapModels = new SMA_adminsSoap[models.length]; for (int i = 0; i < models.length; i++) { soapModels[i] = toSoapModel(models[i]); } return soapModels; } public static SMA_adminsSoap[][] toSoapModels(SMA_admins[][] models) { SMA_adminsSoap[][] soapModels = null; if (models.length > 0) { soapModels = new SMA_adminsSoap[models.length][models[0].length]; } else { soapModels = new SMA_adminsSoap[0][0]; } for (int i = 0; i < models.length; i++) { soapModels[i] = toSoapModels(models[i]); } return soapModels; } public static SMA_adminsSoap[] toSoapModels(List<SMA_admins> models) { List<SMA_adminsSoap> soapModels = new ArrayList<SMA_adminsSoap>(models.size()); for (SMA_admins model : models) { soapModels.add(toSoapModel(model)); } return soapModels.toArray(new SMA_adminsSoap[soapModels.size()]); } public SMA_adminsSoap() { } public long getPrimaryKey() { return _id; } public void setPrimaryKey(long pk) { setId(pk); } public long getId() { return _id; } public void setId(long id) { _id = id; } public long getUser_id() { return _user_id; } public void setUser_id(long user_id) { _user_id = user_id; } public long getRadcheck_id() { return _radcheck_id; } public void setRadcheck_id(long radcheck_id) { _radcheck_id = radcheck_id; } public long getCompany_id() { return _company_id; } public void setCompany_id(long company_id) { _company_id = company_id; } public int getIsActive() { return _IsActive; } public void setIsActive(int IsActive) { _IsActive = IsActive; } public Date getCreated_On() { return _Created_On; } public void setCreated_On(Date Created_On) { _Created_On = Created_On; } public String getCreated_By() { return _Created_By; } public void setCreated_By(String Created_By) { _Created_By = Created_By; } public Date getUpdated_On() { return _Updated_On; } public void setUpdated_On(Date Updated_On) { _Updated_On = Updated_On; } public String getUpdated_By() { return _Updated_By; } public void setUpdated_By(String Updated_By) { _Updated_By = Updated_By; } private long _id; private long _user_id; private long _radcheck_id; private long _company_id; private int _IsActive; private Date _Created_On; private String _Created_By; private Date _Updated_On; private String _Updated_By; }
[ "pankshar@IDCPANKSHAR-LT.cloudsmartz.net" ]
pankshar@IDCPANKSHAR-LT.cloudsmartz.net
9b75a508f2faf17776adcb199cd8ebb7378ba81d
395db7bc1c7c166ecfdfa092434634f907001c87
/ma-gpro-gs/ma-gpro-gs-service/src/main/java/com/gpro/consulting/tiers/gs/service/impl/EntiteStockServiceImpl.java
46604d1f482ff497af670023222116531e5eb365
[]
no_license
anouarbensaad/habillement
2c4aea85511bae5cef00b5b0fc200b8c1973219f
4d6c395300c3eff0a81b38d68d0e0873c130f7b6
refs/heads/master
2022-02-19T10:14:15.442154
2019-09-26T19:09:02
2019-09-26T19:09:02
204,194,945
0
0
null
null
null
null
UTF-8
Java
false
false
3,047
java
package com.gpro.consulting.tiers.gs.service.impl; import java.util.List; import javax.transaction.Transactional; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.gpro.consulting.tiers.gs.coordination.value.EntiteStockValue; import com.gpro.consulting.tiers.gs.coordination.value.RechercheMulticritereEntiteStockValue; import com.gpro.consulting.tiers.gs.coordination.value.ReferenceEntiteStockConcatineeValue; import com.gpro.consulting.tiers.gs.coordination.value.ResultatRechecheEntiteStockStockValue; import com.gpro.consulting.tiers.gs.coordination.value.ResultatRechercheEntiteStockMouvementValue; import com.gpro.consulting.tiers.gs.domaine.IEntiteStockDomaine; import com.gpro.consulting.tiers.gs.service.IEntiteStockService; // TODO: Auto-generated Javadoc /** * The Class EntiteStockServiceImpl. */ @Service @Transactional public class EntiteStockServiceImpl implements IEntiteStockService{ @Autowired IEntiteStockDomaine entiteStockDomaine; /* (non-Javadoc) * @see com.gpro.consulting.tiers.gs.service.IEntiteStockService#rechercherEntiteStockMultiCritere(com.gpro.consulting.tiers.gs.coordination.value.RechercheMulticritereEntiteStockValue) */ @Override public ResultatRechecheEntiteStockStockValue rechercherEntiteStockMultiCritere( RechercheMulticritereEntiteStockValue pRechercheMulticritereEntiteStockValue) { //System.out.println("-------service pRechercheMulticritereEntiteStockValue.getQuantite():----- "+ pRechercheMulticritereEntiteStockValue.getQuantite()); return entiteStockDomaine.rechercherEntiteStockMultiCritere(pRechercheMulticritereEntiteStockValue); } /***liste entite stock*/ @Override public List<EntiteStockValue> listeEntiteStock() { return entiteStockDomaine.listeEntiteStock(); } /********recherche entite stock mouvement ***********/ @Override public ResultatRechercheEntiteStockMouvementValue rechercherEntiteStockMouvement( RechercheMulticritereEntiteStockValue pRechercheMulticritereEntiteStockValue) { return entiteStockDomaine.rechercherEntiteStockMouvement(pRechercheMulticritereEntiteStockValue); } @Override public String creerEntiteStock(EntiteStockValue pEntiteStockValue) { return entiteStockDomaine.creerEntiteStock(pEntiteStockValue); } @Override public String modifierEntiteStock(EntiteStockValue pEntiteStockValue) { return entiteStockDomaine.modifierEntiteStock(pEntiteStockValue); } @Override public void supprimerEntiteStock(Long pId) { entiteStockDomaine.supprimerEntiteStock(pId); } @Override public EntiteStockValue rechercheEntiteStockParId(Long pEntiteStockId) { return entiteStockDomaine.rechercheEntiteStockParId(pEntiteStockId); } @Override public List<ReferenceEntiteStockConcatineeValue> getListeReferencesArticleConcatines() { // TODO Auto-generated method stub return entiteStockDomaine.getListeReferencesArticleConcatines(); } }
[ "bensaad.tig@gmail.com" ]
bensaad.tig@gmail.com
71cc8dd8b170844792fb966ec75efd550d24a775
97b46ff38b675d934948ff3731cf1607a1cc0fc9
/DataPack/dist/game/data/scripts/handlers/effecthandlers/ServitorShare.java
cb354b2270ee869be4d0d9bbddb8600c002d9d79
[]
no_license
l2brutal/pk-elfo_H5
a6703d734111e687ad2f1b2ebae769e071a911a4
766fa2a92cb3dcde5da6e68a7f3d41603b9c037e
refs/heads/master
2020-12-28T13:33:46.142303
2016-01-20T09:53:10
2016-01-20T09:53:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,687
java
package handlers.effecthandlers; import pk.elfo.gameserver.model.actor.L2Summon; import pk.elfo.gameserver.model.actor.instance.L2PcInstance; import pk.elfo.gameserver.model.effects.EffectFlag; import pk.elfo.gameserver.model.effects.EffectTemplate; import pk.elfo.gameserver.model.effects.L2Effect; import pk.elfo.gameserver.model.effects.L2EffectType; import pk.elfo.gameserver.model.stats.Env; /** * Synchronizing effects on player and servitor if one of them gets removed for some reason the same will happen to another. * Projeto PkElfo */ public class ServitorShare extends L2Effect { public ServitorShare(Env env, EffectTemplate template) { super(env, template); } @Override public L2EffectType getEffectType() { return L2EffectType.BUFF; } @Override public void onExit() { L2Effect[] effects = null; if (getEffected().isPlayer()) { L2Summon summon = getEffector().getSummon(); if ((summon != null) && summon.isServitor()) { effects = summon.getAllEffects(); } } else if (getEffected().isServitor()) { L2PcInstance owner = getEffected().getActingPlayer(); if (owner != null) { effects = owner.getAllEffects(); } } if (effects != null) { for (L2Effect eff : effects) { if (eff.getSkill().getId() == getSkill().getId()) { eff.exit(); break; } } } super.onExit(); } @Override public boolean onActionTime() { return false; } @Override public boolean canBeStolen() { return false; } @Override public int getEffectFlags() { return EffectFlag.SERVITOR_SHARE.getMask(); } }
[ "PkElfo@13720c4f-9a1f-4619-977f-b36a0ac534ba" ]
PkElfo@13720c4f-9a1f-4619-977f-b36a0ac534ba
d948f546fab88829d13a8dbefd68368c2c0adfeb
7596b13ad3a84feb67f05aeda486e8b9fc93f65f
/getAndroidAPI/src/java/lang/LinkageError.java
41a9c347407f1d904be079b7f4492466b358d6da
[]
no_license
WinterPan2017/Android-Malware-Detection
7aeacfa03ca1431e7f3ba3ec8902cfe2498fd3de
ff38c91dc6985112e958291867d87bfb41c32a0f
refs/heads/main
2023-02-08T00:02:28.775711
2020-12-20T06:58:01
2020-12-20T06:58:01
303,900,592
1
0
null
null
null
null
UTF-8
Java
false
false
643
java
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.kpdus.com/jad.html // Decompiler options: packimports(3) // Source File Name: LinkageError.java package java.lang; // Referenced classes of package java.lang: // Error, RuntimeException, String, Throwable public class LinkageError extends Error { public LinkageError() { throw new RuntimeException("Stub!"); } public LinkageError(String s) { throw new RuntimeException("Stub!"); } public LinkageError(String s, Throwable cause) { throw new RuntimeException("Stub!"); } }
[ "panwentao1301@163.com" ]
panwentao1301@163.com
0e3aa12456c457ad163c6659d5e3cbf9e3bcfc09
0f3db179c45b313faa09f104b2aa63bd469351bc
/MAXIMOID2/src/br/inf/id2/seedf/bean/ConclusaoCurso.java
163cd9cddefd169a28aba58c79d42b92ff1d6142
[]
no_license
dashpunk/java-class-ewm
227c1ad014657295ac073931b29278a7e5f23f99
51261a6a424dac1c277bfd44eadb93a70e51d845
refs/heads/master
2021-01-10T12:50:45.821114
2017-02-23T14:39:17
2017-02-23T14:39:17
48,771,329
0
0
null
null
null
null
UTF-8
Java
false
false
5,873
java
package br.inf.id2.seedf.bean; import java.rmi.RemoteException; import java.text.DecimalFormat; import psdi.util.MXApplicationException; import psdi.util.MXException; /** * * @author Ricardo S Gomes * */ public class ConclusaoCurso extends psdi.webclient.system.beans.AppBean { /** * */ public ConclusaoCurso() { } /** * * @return * @throws MXException * @throws RemoteException */ @Override public int SAVE() throws MXException, RemoteException { //System.out.println("---- INICIO DO LOOP"); //System.out.println("-------------- total de i " + getMbo().getMboSet("SEERL01MTCOMCUR").count()); for (int i = 0; i < getMbo().getMboSet("SEERL01MTCOMCUR").count(); i++) { //for (int i = 0; i < 1; i++) { double cht = 0d; double flt = 0d; double mf = 0d; boolean chtE = false; boolean fltE = false; boolean mfE = false; if (!getMbo().getMboSet("SEERL01MTCOMCUR").getMbo(i).toBeDeleted()) { int mensuradores = getMbo().getMboSet("SEERL01MTCOMCUR").getMbo(i).getMboSet("SEERL01CCMENS").count(); //System.out.println("------------ mensuradores total "+mensuradores); for (int j = 0; j < mensuradores; j++) { //System.out.println("--------------= j " + j); //System.out.println("--------------= mens " + getMbo().getMboSet("SEERL01MTCOMCUR").getMbo(i).getMboSet("SEERL01CCMENS").getMbo(j).getString("SEEMENS")); //System.out.println("--- Inicio loop J"); if (getMbo().getMboSet("SEERL01MTCOMCUR").getMbo(i).getMboSet("SEERL01CCMENS").getMbo(j).getString("SEEMENS").equals("CHT")) { chtE = true; //System.out.println("-------- chtE"); if (!getMbo().getMboSet("SEERL01MTCOMCUR").getMbo(i).getMboSet("SEERL01CCMENS").getMbo(j).getString("SEEUNIMED").equals("HRA")) { throw new MXApplicationException("company", "unidadeMediaMensuradorInvalido", new String[]{"Carga Horaria Total"}); } cht = getMbo().getMboSet("SEERL01MTCOMCUR").getMbo(i).getMboSet("SEERL01CCMENS").getMbo(j).getDouble("SEEVALOR"); //System.out.println("00000000000 apos cht"); } if (getMbo().getMboSet("SEERL01MTCOMCUR").getMbo(i).getMboSet("SEERL01CCMENS").getMbo(j).getString("SEEMENS").equals("FLT")) { fltE = true; //System.out.println("-------- fltE"); if (!getMbo().getMboSet("SEERL01MTCOMCUR").getMbo(i).getMboSet("SEERL01CCMENS").getMbo(j).getString("SEEUNIMED").equals("HRU")) { throw new MXApplicationException("company", "unidadeMediaMensuradorInvalido", new String[]{"Faltas"}); } flt = getMbo().getMboSet("SEERL01MTCOMCUR").getMbo(i).getMboSet("SEERL01CCMENS").getMbo(j).getDouble("SEEVALOR"); //System.out.println("00000000000 apos flt"); } if (getMbo().getMboSet("SEERL01MTCOMCUR").getMbo(i).getMboSet("SEERL01CCMENS").getMbo(j).getString("SEEMENS").equals("MF")) { mfE = true; //System.out.println("-------- mfE"); if (!getMbo().getMboSet("SEERL01MTCOMCUR").getMbo(i).getMboSet("SEERL01CCMENS").getMbo(j).getString("SEEUNIMED").equals("NT")) { throw new MXApplicationException("company", "unidadeMediaMensuradorInvalido", new String[]{"Media Final"}); } mf = getMbo().getMboSet("SEERL01MTCOMCUR").getMbo(i).getMboSet("SEERL01CCMENS").getMbo(j).getDouble("SEEVALOR"); //System.out.println("00000000000 apos mfe"); } } //System.out.println("--------------))) contador i = " + i); //System.out.println("--------------))) ID = " + getMbo().getMboSet("SEERL01MTCOMCUR").getMbo(i).getString("SEECOMCURMOD")); //System.out.println("--------------))) chtE = " + chtE); //System.out.println("--------------))) " + fltE); //System.out.println("--------------))) " + mfE); if ((!chtE) || (!fltE) || (!mfE)) { throw new MXApplicationException("company", "mensuradorAusente"); } //System.out.println("------ antes deseecperpre"); double percentual = (flt / cht) * 100; //System.out.println("------ percentual "+percentual); DecimalFormat decimalFormat = new DecimalFormat("0.0"); getMbo().getMboSet("SEERL01MTCOMCUR").getMbo(i).setValue("SEECPERPRE", decimalFormat.format(percentual)); //System.out.println("------ apos deseecperpre"); String mensao = ""; if ((mf >= 90) && (mf <= 100)) { mensao = "SS"; } if ((mf >= 70) && (mf < 90)) { mensao = "MS"; } if ((mf >= 50) && (mf < 70)) { mensao = "MM"; } if ((mf >= 30) && (mf < 50)) { mensao = "MI"; } if ((mf >= 01) && (mf < 30)) { mensao = "II"; } if (mf < 1) { mensao = "SS"; } getMbo().getMboSet("SEERL01MTCOMCUR").getMbo(i).setValue("SEECMENCAO", mensao); } } return super.SAVE(); } }
[ "willians.lemos87@gmail.com" ]
willians.lemos87@gmail.com
16f8360717af6eaa6bdfc24c0d47b85b13999d29
6b2a8dd202fdce77c971c412717e305e1caaac51
/solutions_2751486_0/java/Lucretius/Prob1.java
63f4242b25cfc6a894bf1f07f32951d41967c1c1
[]
no_license
alexandraback/datacollection
0bc67a9ace00abbc843f4912562f3a064992e0e9
076a7bc7693f3abf07bfdbdac838cb4ef65ccfcf
refs/heads/master
2021-01-24T18:27:24.417992
2017-05-23T09:23:38
2017-05-23T09:23:38
84,313,442
2
4
null
null
null
null
UTF-8
Java
false
false
2,648
java
/** * * @author RasPat *Problem can be found here: * https://code.google.com/codejam/contest/189252/dashboard#s=p0 */ import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; public class Prob1 { public static void main(String[] args) { long start = System.currentTimeMillis(); String pathRoot = "C:\\Users\\RasPat\\workspace\\2013_1C\\"; String relRoot = "A-small-attempt0.in"; // relRoot = "testA.in"; String in = pathRoot + relRoot; // Length of the file extension int extLength = 2; String out = in.substring(0, in.length() - extLength) + "out"; BufferedReader r = null; BufferedWriter w = null; try { r = new BufferedReader(new FileReader(in)); w = new BufferedWriter(new FileWriter(out)); String[] line; // First line of Input is the # of test cases int testCases = Integer.parseInt(r.readLine()); int caseCount = 0; while (caseCount < testCases) { caseCount++; line = r.readLine().split(" "); String name = line[0]; int n = Integer.parseInt(line[1]); int nVal = 0; for (int i = 0; i <= name.length() - n; i++) { for (int j = i + n; j <= name.length(); j++) { String sub = name.substring(i, j); for(int k = 0; k <= sub.length() - n; k++) { String sub2 = sub.substring(k, k+n); if (!(sub2.contains("a") || sub2.contains("e") || sub2.contains("i") || sub2.contains("o") || sub2 .contains("u"))) { nVal++; break; } } } } System.out.println(nVal); // if(caseCount == 1) break; /** * Pseudo Code * Find the number of substrings in a give name with n consecutive consonants * naive: * find each substring of the name * if it has a n letter consonant substring count * to find a consonant substring take every slice of length n and make sure it doesnt contain a vowel * return the number of strings * * */ System.out.println(nVal); if(caseCount == 1) System.out.println(nVal); w.write("Case #" + caseCount + ": " + nVal); // w.write(" " + String.format("%.6f", d)); w.newLine(); } } catch (IOException e) { e.printStackTrace(); } finally { try { r.close(); if (w != null) { w.flush(); w.close(); } System.out.println("Time elapsed: "+ (System.currentTimeMillis() - start)); } catch (IOException e) { e.printStackTrace(); } } } }
[ "eewestman@gmail.com" ]
eewestman@gmail.com
690078126d2e3481bd4b1cbcfe97537da39a5dd5
6bbf563c014f147c3a3f87d5219b07d1284bc786
/src/main/java/fr/sma/java/app/service/util/RandomUtil.java
4c9d40295c2189d838e372545669a0b0726e74f0
[]
no_license
thomas78om/AppliBt
7901f59663130f9b7916d7e9f1b45f246f28d906
89ab77dc6ee2a9e0eed8e5b75b9639ab0ef96d68
refs/heads/master
2022-12-21T13:20:40.471377
2019-08-12T13:24:51
2019-08-12T13:24:51
201,934,650
0
0
null
2022-12-16T05:02:56
2019-08-12T13:20:53
Java
UTF-8
Java
false
false
892
java
package fr.sma.java.app.service.util; import org.apache.commons.lang3.RandomStringUtils; /** * Utility class for generating random Strings. */ public final class RandomUtil { private static final int DEF_COUNT = 20; private RandomUtil() { } /** * Generate a password. * * @return the generated password. */ public static String generatePassword() { return RandomStringUtils.randomAlphanumeric(DEF_COUNT); } /** * Generate an activation key. * * @return the generated activation key. */ public static String generateActivationKey() { return RandomStringUtils.randomNumeric(DEF_COUNT); } /** * Generate a reset key. * * @return the generated reset key. */ public static String generateResetKey() { return RandomStringUtils.randomNumeric(DEF_COUNT); } }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
828fd78ed7d4e417b1970210ce0f9f15bc5e95bf
89430ea57c73ba9f2c8125b45dc9783006c21448
/sparklivy-submitter-template/src/test/java/io/qkits/sparklivy/livy/LivySessionStatesTest.java
0d96fa4c84added222a617d31351c1bebc887d24
[]
no_license
qdriven/BigData-Collections
f88767bec688312ecbd2c0903285e07ad6733236
5a41ca1aa7862dfe84102c88fbf9cb6163364791
refs/heads/master
2023-01-05T11:13:53.366243
2021-05-27T11:23:56
2021-05-27T11:23:56
186,977,922
2
0
null
2022-12-10T05:31:45
2019-05-16T07:44:04
Java
UTF-8
Java
false
false
510
java
package io.qkits.sparklivy.livy; import org.assertj.core.api.Assertions; import org.junit.Test; public class LivySessionStatesTest { @Test public void toLivyState() { } @Test public void isActive() { } @Test public void convert2QuartzState() { } @Test public void isHealthy() { } @Test public void testIsCompleted(){ boolean result = LivySessionStates.isCompleted("running"); Assertions.assertThat(result).isEqualTo(false); } }
[ "patrickwuke@163.com" ]
patrickwuke@163.com
29ade115d5341372a34de3ef2849348260568f82
74cfe03426f96bc769f2ff8f50839e8398c8a2cc
/app/src/main/java/com/futuretongfu/iview/IRegistRealVerView.java
b765ac3d3eaa226848cb34b6002e5aa06cd7af51
[]
no_license
KqSMea8/ShouDuFu
c39b3cf59a8f86a0aee1182de73762ed363a6e5a
2ae031cbb90e946935334f14dd5f03414afcdb18
refs/heads/master
2020-05-30T10:42:26.086711
2019-06-01T01:42:56
2019-06-01T01:42:56
null
0
0
null
null
null
null
UTF-8
Java
false
false
457
java
package com.futuretongfu.iview; /* * Created by hhm on 2017/7/26. */ import com.futuretongfu.model.entity.FuturePayApiResult; public interface IRegistRealVerView { //开户 public void onaddUserOpenSuccess(FuturePayApiResult futurePayApiResult); public void onaddUserOpenFaileUserExists(String msg); public void onaddUserOpenFaile(String msg); void onGetCardNumberFaile(String msg); void onGetCardNumberSuccess(String data); }
[ "you@example.com" ]
you@example.com
662d6415db0369de1f56258921e979f2217cc874
6dbae30c806f661bcdcbc5f5f6a366ad702b1eea
/Corpus/eclipse.pde.ui/1932.java
9e4b8a2b3f600a73a302e471f3da209c5908507e
[ "MIT" ]
permissive
SurfGitHub/BLIZZARD-Replication-Package-ESEC-FSE2018
d3fd21745dfddb2979e8ac262588cfdfe471899f
0f8f4affd0ce1ecaa8ff8f487426f8edd6ad02c0
refs/heads/master
2020-03-31T15:52:01.005505
2018-10-01T23:38:50
2018-10-01T23:38:50
152,354,327
1
0
MIT
2018-10-10T02:57:02
2018-10-10T02:57:02
null
UTF-8
Java
false
false
4,511
java
/******************************************************************************* * Copyright (c) 2006, 2015 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.eclipse.pde.internal.ui.commands; import org.eclipse.core.commands.Command; import org.eclipse.core.commands.ParameterizedCommand; import org.eclipse.core.expressions.IEvaluationContext; import org.eclipse.jface.dialogs.IDialogConstants; import org.eclipse.jface.viewers.*; import org.eclipse.pde.internal.ui.IHelpContextIds; import org.eclipse.pde.internal.ui.PDEUIMessages; import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.*; import org.eclipse.ui.PlatformUI; import org.eclipse.ui.forms.FormDialog; import org.eclipse.ui.forms.IManagedForm; import org.eclipse.ui.forms.widgets.ScrolledForm; public class CommandComposerDialog extends FormDialog { private CommandComposerPart fCCP; private ParameterizedCommand fPC; private Button fOKButton; public CommandComposerDialog(Shell parentShell, int filterType, ParameterizedCommand preselectedCommand, IEvaluationContext snapshot) { super(parentShell); setShellStyle(SWT.MODELESS | SWT.SHELL_TRIM | SWT.BORDER); fCCP = new CommandComposerPart(); fCCP.setFilterType(filterType); fCCP.setPresetCommand(preselectedCommand); fCCP.setSnapshotContext(snapshot); } @Override protected void createFormContent(IManagedForm mform) { ScrolledForm form = mform.getForm(); mform.getToolkit().decorateFormHeading(form.getForm()); initializeDialogUnits(form); fCCP.createCC(form, mform.getToolkit(), new ISelectionChangedListener() { @Override public void selectionChanged(SelectionChangedEvent event) { updateOkButtonEnablement(event.getSelection()); } }); applyDialogFont(form); } @Override protected void createButtonsForButtonBar(Composite parent) { super.createButtonsForButtonBar(parent); // Update the button enablement only after the button is created fOKButton = getButton(IDialogConstants.OK_ID); CommandList list = fCCP.getCommandList(); // Ensure the tree viewer was created if (list == null) { updateOkButtonEnablement(false); return; } // Retrieve the current selection ISelection selection = list.getSelection(); // Update the OK button based on the current selection updateOkButtonEnablement(selection); } /** * @param selection */ private void updateOkButtonEnablement(Object selection) { // Ensure there is a selection if (selection == null) { updateOkButtonEnablement(false); return; } // Ensure the selection is structured if ((selection instanceof IStructuredSelection) == false) { updateOkButtonEnablement(false); return; } IStructuredSelection sSelection = (IStructuredSelection) selection; // Ensure the selection is a command if (sSelection.getFirstElement() instanceof Command) { // Enable button updateOkButtonEnablement(true); return; } // Disable button updateOkButtonEnablement(false); } /** * @param enabled */ private void updateOkButtonEnablement(boolean enabled) { if (fOKButton != null) { fOKButton.setEnabled(enabled); } } @Override protected void configureShell(Shell newShell) { newShell.setText(PDEUIMessages.CommandSerializerPart_name); super.configureShell(newShell); PlatformUI.getWorkbench().getHelpSystem().setHelp(newShell, IHelpContextIds.COMMAND_COMPOSER_DIALOG); } @Override public void okPressed() { fPC = fCCP.getParameterizedCommand(); super.okPressed(); } @Override public boolean close() { fCCP.dispose(); return super.close(); } public ParameterizedCommand getCommand() { return fPC; } }
[ "masudcseku@gmail.com" ]
masudcseku@gmail.com
ea9d389bec08a2af18afb8633b2329eb842219a9
2dc8257639ca9cb26c09cd70dff339bb9eddc305
/ddm/src/main/java/com/example/ddm/appui/mine/Charge/PayFragment.java
6cdef8acdc38f7fa97ef1ee1a2bb6cba129d282b
[]
no_license
zhouziwen/zhulishangcheng
1aaa3fc3c18ea3f30d8c3448d32cc646deb405f1
4c513d22adc5f6e9d542d81d448d4e8c6fb3f107
refs/heads/master
2021-08-23T08:25:54.256091
2017-12-04T09:10:31
2017-12-04T09:10:49
113,018,136
0
1
null
null
null
null
UTF-8
Java
false
false
2,531
java
package com.example.ddm.appui.mine.Charge; import android.os.Bundle; import android.support.design.widget.TabLayout; import android.support.v4.app.Fragment; import android.support.v4.view.ViewPager; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import com.example.ddm.R; import com.example.ddm.appui.BaseFragment; import com.example.ddm.appui.adapter.FragAdapter; import java.util.ArrayList; import java.util.List; /** * A simple {@link Fragment} subclass. * */ public class PayFragment extends BaseFragment { private ViewPager mViewPager; private TabLayout mTabLayout; private ImageView mImageView; private List<String> mTitles = new ArrayList<>();//标题集合 private List<BaseFragment> mfragments = new ArrayList<>();//视图集合 private ChargeFragment mChargeFragment; private WaitPayFragment mWaitPayFragment; public PayFragment() { // Required empty public constructor } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment return inflater.inflate(R.layout.fragment_pay, container, false); } @Override protected void initView(View view) { super.initView(view); mImageView = mFindViewUtils.findViewById(R.id.pic); mWaitPayFragment = new WaitPayFragment(); mChargeFragment = new ChargeFragment(); mfragments.add(mChargeFragment); mfragments.add(mWaitPayFragment); mTitles.add("在线充值"); mTitles.add("待支付"); mTabLayout = mFindViewUtils.findViewById(R.id.tab_title); mViewPager = mFindViewUtils.findViewById(R.id.viewpager); } @Override protected void setListener() { super.setListener(); //给TabLayout添加内容 mTabLayout.addTab(mTabLayout.newTab().setText(mTitles.get(0))); mTabLayout.addTab(mTabLayout.newTab().setText(mTitles.get(0))); //初始化适配器 FragAdapter adapter = new FragAdapter(getChildFragmentManager(), mfragments,mTitles); mViewPager.setAdapter(adapter); mTabLayout.setupWithViewPager(mViewPager);//让TabLayout随着ViewPager的变换而变换 mImageView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { popSelf(); } }); } }
[ "1916973618@qq.com" ]
1916973618@qq.com
ff0d69d2f86aefc1ae0485a97de663e924c0c613
44b1fa7a4167f80aebe62126a38c3c7927346fa7
/mmtx-sample-springboot/src/test/java/Client.java
86f9c4119bfc075ad37b5ebea0dceeb18e186f33
[]
no_license
qq962155660/mmtx-springcloud-sample
993c0bbadef1cb3473c3752ce9ec8757e8885c04
a147bc676f7ba5ef3bd1a7f81bbb8c47421d71f0
refs/heads/master
2022-12-21T22:14:03.258804
2020-02-29T07:47:06
2020-02-29T07:47:06
237,651,141
0
0
null
2022-12-14T20:39:55
2020-02-01T17:29:19
JavaScript
UTF-8
Java
false
false
3,370
java
import java.util.concurrent.TimeUnit; import io.netty.bootstrap.Bootstrap; import io.netty.buffer.ByteBuf; import io.netty.channel.Channel; import io.netty.channel.ChannelFuture; import io.netty.channel.ChannelFutureListener; import io.netty.channel.ChannelInitializer; import io.netty.channel.ChannelPipeline; import io.netty.channel.nio.NioEventLoopGroup; import io.netty.channel.socket.SocketChannel; import io.netty.channel.socket.nio.NioSocketChannel; import io.netty.handler.codec.LengthFieldBasedFrameDecoder; import io.netty.handler.timeout.IdleStateHandler; public class Client { public static void main(String[] args) throws Exception { Client client = new Client(); client.start(); client.sendData("123"); } String remoteAddr = "127.0.0.1"; int remotePort = 18003; private NioEventLoopGroup workGroup = new NioEventLoopGroup(4); private Channel channel; private Bootstrap bootstrap; public void sendData(String content) throws Exception { if (channel != null && channel.isActive()) { ByteBuf buf = channel.alloc().buffer(5 + content.getBytes().length); buf.writeInt(5 + content.getBytes().length); buf.writeByte(CustomHeartbeatHandler.CUSTOM_MSG); buf.writeBytes(content.getBytes()); channel.writeAndFlush(buf); } } public void start() { try { bootstrap = new Bootstrap(); bootstrap .group(workGroup) .channel(NioSocketChannel.class) .handler(new ChannelInitializer<SocketChannel>() { protected void initChannel(SocketChannel socketChannel) throws Exception { ChannelPipeline p = socketChannel.pipeline(); p.addLast(new IdleStateHandler(0, 0, 5)); p.addLast(new LengthFieldBasedFrameDecoder(1024, 0, 4, -4, 0)); p.addLast(new ClientHandler(Client.this)); } }); doConnect(); } catch (Exception e) { throw new RuntimeException(e); } } protected void doConnect() { if (channel != null && channel.isActive()) { return; } ChannelFuture future = bootstrap.connect(remoteAddr, remotePort); future.addListener(new ChannelFutureListener() { public void operationComplete(ChannelFuture futureListener) throws Exception { if (futureListener.isSuccess()) { channel = futureListener.channel(); System.out.println("Connect to server successfully!"); } else { System.out.println("Failed to connect to server, try connect after 10s"); futureListener.channel().eventLoop().schedule(new Runnable() { @Override public void run() { doConnect(); } }, 10, TimeUnit.SECONDS); } } }); } }
[ "962155660@qq.com" ]
962155660@qq.com
7352180772f576806151d7e02b019e9bb496299f
f789c7e9ba00918cdc3769213936755064e74ad2
/src/main/java/org/sfm/csv/CellValueReader.java
7d5c6feebbb003fcf3b62ab55a6b10df2552be7f
[ "MIT" ]
permissive
ranjeet-floyd/SimpleFlatMapper
3d114d55c33ee1b9e496e0e42c49ae4fead4b893
7077d8c0c6735a8e5486061c5be8b9f551f6eb1a
refs/heads/master
2021-01-15T14:36:41.344988
2015-04-12T20:12:47
2015-04-12T20:22:41
null
0
0
null
null
null
null
UTF-8
Java
false
false
181
java
package org.sfm.csv; import org.sfm.csv.impl.ParsingContext; public interface CellValueReader<T> { T read(char[] chars, int offset, int length, ParsingContext parsingContext); }
[ "arnaud.roger@gmail.com" ]
arnaud.roger@gmail.com
6471fd658e710f115e181666f8399220732cfd19
054b1ff58584fbe49de7f30fe46ac4ab0ac594d4
/apps/rasp/optimized-decompiled/rasp-home/dava/src/android/support/v4/view/ViewConfigurationCompat$BaseViewConfigurationVersionImpl.java
f79b6e4fe1dd6296a1780fbd1e77e59d02d4e6bf
[]
no_license
fthomas-de/android_ipc
55083eeb8c52ff76116ad95e5b0716ddeb77dda3
626dc6aee76ededfb2d15084dfad74a1e7040016
refs/heads/master
2021-05-29T19:02:42.862103
2015-10-15T06:52:31
2015-10-15T06:52:31
null
0
0
null
null
null
null
UTF-8
Java
false
false
448
java
package android.support.v4.view; import android.view.ViewConfiguration; class ViewConfigurationCompat$BaseViewConfigurationVersionImpl implements android.support.v4.view.ViewConfigurationCompat$ViewConfigurationVersionImpl { ViewConfigurationCompat$BaseViewConfigurationVersionImpl() { this.<init>(); } public int getScaledPagingTouchSlop(ViewConfiguration r1) { return r1.getScaledTouchSlop(); } }
[ "fthomas@tzi.de" ]
fthomas@tzi.de
c0e99b51a335e117987d6693b503c6959a979ba8
90bd2fdfc3118d6926ff2b8b8df731eb08ae68a7
/app/src/main/java/fr/hdb/artibip/commun/constantes/Pager.java
1a22d7fa66cbd09c0985e9645d3de7024a13e6e4
[]
no_license
maheryhaja/testFrag
c2d5f66f83de013c7387bbfb58c99f89c34d2625
8606264b0fc2cfedd03e63c77dd7121a016ae335
refs/heads/master
2021-07-21T11:56:54.515622
2017-10-31T12:01:48
2017-10-31T12:01:48
108,989,482
0
0
null
null
null
null
UTF-8
Java
false
false
192
java
package fr.hdb.artibip.commun.constantes; /** * Created on 10/07/2017. */ public class Pager { public static int PAGE_CLIENT_COUNT = 5; public static int PAGE_EMPLOYE_COUNT = 7; }
[ "ygunion@gmail.com" ]
ygunion@gmail.com
fdfae73c3ba25eb84f9ba08cfdb1e84eec340b0c
5fe04ecaba633d794d37c51aa842f17180aa9bfc
/Unit_Testing/src/main/java/prg_lab/Target.java
e9a47c4906e806a6df713f285f456b102c096236
[]
no_license
danielanikolova/JavaOOPAdvanced
3afeaf6991c58b1a6aa510543031885e04a4e80f
1c21ecd51c1722a9e640fe993da2f4dbe7d96ce8
refs/heads/master
2021-09-05T05:40:37.299876
2018-01-24T13:55:29
2018-01-24T13:55:29
118,771,476
0
0
null
null
null
null
UTF-8
Java
false
false
254
java
package prg_lab; /** * Created by danie on 12/1/2017. */ public interface Target { int getHealth(); void takeAttack(int attackPoints); int giveExperience(); boolean isDead(); Weapon giveWeapon(RandomProvider randomProvider); }
[ "daniela.a.nikolova@gmail.com" ]
daniela.a.nikolova@gmail.com
cf8e3c2de0a32266480a0d13aa9970739cbd3499
e374114551fafad384e0150e55949de3e5eaed26
/src/main/java/ch/csnc/extension/httpclient/AliasCertificate.java
f3e1298ae716a9da0ab0abc79d0180bf17bf3095
[]
no_license
nitram509/zaproxy-maven
996ce80dc8718dc100c6f905d9e74d9191acaf3e
19d021496122a224329d46076ba04454d5a18958
refs/heads/master
2021-07-06T06:57:15.120350
2020-09-15T19:38:37
2020-09-15T19:38:37
35,776,475
1
1
null
2021-06-04T01:17:22
2015-05-17T17:58:36
HTML
UTF-8
Java
false
false
2,382
java
/* * This file is part of WebScarab, an Open Web Application Security * Project utility. For details, please see http://www.owasp.org/ * * Copyright (c) 2002 - 2004 Rogan Dawes * * Please note that this file was originally released under the * GNU General Public License as published by the Free Software Foundation; * either version 2 of the License, or (at your option) any later version. * * As of October 2014 Rogan Dawes granted the OWASP ZAP Project permission to * redistribute this code under the Apache License, Version 2.0: * * * 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 ch.csnc.extension.httpclient; import java.security.cert.Certificate; public class AliasCertificate { private Certificate certificate; private String alias; AliasCertificate(Certificate certificate, String alias){ this.setCertificate(certificate); this.setAlias(alias); } public void setCertificate(Certificate certificate) { this.certificate = certificate; } public Certificate getCertificate() { return certificate; } public void setAlias(String alias) { this.alias = alias; } public String getAlias() { return alias; } public String getName(){ String cn = getCN(); if(cn.length() == 0){ return getAlias(); }else{ return cn + " ["+getAlias()+"]"; } } public String getCN() { String dn = getCertificate().toString(); int i = 0; i = dn.indexOf("CN="); if (i == -1) { return null; } //get the remaining DN without CN= dn = dn.substring(i + 3); char[] dncs = dn.toCharArray(); for (i = 0; i < dncs.length; i++) { if (dncs[i] == ',' && i > 0 && dncs[i - 1] != '\\') { break; } } return dn.substring(0, i); } }
[ "maki@bitkings.de" ]
maki@bitkings.de
f0bf974a6d3e03d3a0935cdc7a9d0ddb84d433eb
bf0a5acf1bba30568dacb655a2a5aa4fe2c78d85
/src/com/shroggle/util/process/synchronize/annotation/.svn/text-base/SynchronizeByCache.java.svn-base
ec0aec1a06a7f6f56d53942e9ebe55af333897a0
[]
no_license
shroggle/Shroggle
37fd3a8e264b275b948f05d1bfe100744bb85973
4e3c3c67c55772ca914f12f652cf6023512be615
refs/heads/master
2016-09-06T03:50:14.602344
2011-10-31T22:58:04
2011-10-31T22:58:04
2,683,810
0
0
null
null
null
null
UTF-8
Java
false
false
2,354
/********************************************************************* * * * Copyright (c) 2007-2011 by Web-Deva. * * All rights reserved. * * * * This computer program is protected by copyright law and * * international treaties. Unauthorized reproduction or distribution * * of this program, or any portion of it, may result in severe civil * * and criminal penalties, and will be prosecuted to the maximum * * extent possible under the law. * * * *********************************************************************/ package com.shroggle.util.process.synchronize.annotation; import com.shroggle.util.process.synchronize.SynchronizeRequest; import java.lang.reflect.Method; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; /** * Author: Artem Stasuk (artem). * </p> * Date: 17.09.2008 */ public class SynchronizeByCache { public SynchronizeRequest getRequest( final Method method, final Object object, final Object... parameters) { if (object == null) { throw new UnsupportedOperationException( "Can't create synchronize request by null object!"); } if (method == null) { throw new UnsupportedOperationException( "Can't create synchronize request by null method!"); } SynchronizeByCreator creator = classToCreators.get(method); if (creator == null) { creator = processor.getCreator(method, object, parameters); if (creator == null) { creator = new SynchronizeByCreatorNone(); } classToCreators.putIfAbsent(method, creator); } return creator.create(object, parameters); } private final SynchronizeByProcessor processor = new SynchronizeByProcessor(); private final ConcurrentMap<Method, SynchronizeByCreator> classToCreators = new ConcurrentHashMap<Method, SynchronizeByCreator>(); }
[ "don@shefer.us" ]
don@shefer.us
a3cc96cc08fad34731da562da33e97a9ef30587c
f3b9a444d2d513c670d216f7c700131410c47f92
/game_analyze/src/com/gamecenter/alipay/request/ZhimaCreditWatchlistBriefGetRequest.java
f43555845442d701ddfdbf28b3579ea289656f2d
[]
no_license
kuainiao/GameAdminWeb
6a372087380e3c5ad98fc7cf4c8cbf9f01854e5d
f89327374d39c112421606e6a9fe9189b46c1a90
refs/heads/master
2020-06-03T22:15:02.944948
2017-12-22T06:20:38
2017-12-22T06:20:38
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,964
java
package com.gamecenter.alipay.request; import java.util.Map; import com.gamecenter.alipay.AlipayObject; import com.gamecenter.alipay.AlipayRequest; import com.gamecenter.alipay.internal.util.AlipayHashMap; import com.gamecenter.alipay.response.ZhimaCreditWatchlistBriefGetResponse; /** * ALIPAY API: zhima.credit.watchlist.brief.get request * * @author auto create * @since 1.0, 2017-06-06 14:40:56 */ public class ZhimaCreditWatchlistBriefGetRequest implements AlipayRequest<ZhimaCreditWatchlistBriefGetResponse> { private AlipayHashMap udfParams; // add user-defined text parameters private String apiVersion="1.0"; /** * 行业关注名单普惠版 */ private String bizContent; public void setBizContent(String bizContent) { this.bizContent = bizContent; } public String getBizContent() { return this.bizContent; } private String terminalType; private String terminalInfo; private String prodCode; private String notifyUrl; private String returnUrl; private boolean needEncrypt=false; private AlipayObject bizModel=null; public String getNotifyUrl() { return this.notifyUrl; } public void setNotifyUrl(String notifyUrl) { this.notifyUrl = notifyUrl; } public String getReturnUrl() { return this.returnUrl; } public void setReturnUrl(String returnUrl) { this.returnUrl = returnUrl; } public String getApiVersion() { return this.apiVersion; } public void setApiVersion(String apiVersion) { this.apiVersion = apiVersion; } public void setTerminalType(String terminalType){ this.terminalType=terminalType; } public String getTerminalType(){ return this.terminalType; } public void setTerminalInfo(String terminalInfo){ this.terminalInfo=terminalInfo; } public String getTerminalInfo(){ return this.terminalInfo; } public void setProdCode(String prodCode) { this.prodCode=prodCode; } public String getProdCode() { return this.prodCode; } public String getApiMethodName() { return "zhima.credit.watchlist.brief.get"; } public Map<String, String> getTextParams() { AlipayHashMap txtParams = new AlipayHashMap(); txtParams.put("biz_content", this.bizContent); if(udfParams != null) { txtParams.putAll(this.udfParams); } return txtParams; } public void putOtherTextParam(String key, String value) { if(this.udfParams == null) { this.udfParams = new AlipayHashMap(); } this.udfParams.put(key, value); } public Class<ZhimaCreditWatchlistBriefGetResponse> getResponseClass() { return ZhimaCreditWatchlistBriefGetResponse.class; } public boolean isNeedEncrypt() { return this.needEncrypt; } public void setNeedEncrypt(boolean needEncrypt) { this.needEncrypt=needEncrypt; } public AlipayObject getBizModel() { return this.bizModel; } public void setBizModel(AlipayObject bizModel) { this.bizModel=bizModel; } }
[ "lyh@163.com" ]
lyh@163.com
5eaa978336d82e09b589989c0b448234b207f481
8810972d0375c0a853e3a66bd015993932be9fad
/modelicaml/OBSOLETE/org.openmodelica.simulation.environment/src/org/openmodelica/simulation/environment/view/simulation/noninteractive/NonInteractiveSimulationVisualisationView.java
ad4e31a14bbb71b51e35a7927aa3ee79b427c014
[]
no_license
OpenModelica/MDT
275ffe4c61162a5292d614cd65eb6c88dc58b9d3
9ffbe27b99e729114ea9a4b4dac4816375c23794
refs/heads/master
2020-09-14T03:35:05.384414
2019-11-27T22:35:04
2019-11-27T23:08:29
222,999,464
3
2
null
2019-11-27T23:08:31
2019-11-20T18:15:27
Java
WINDOWS-1252
Java
false
false
3,925
java
/* * This file is part of OpenModelica. * * Copyright (c) 1998-CurrentYear, Open Source Modelica Consortium (OSMC), * c/o Linköpings universitet, Department of Computer and Information Science, * SE-58183 Linköping, Sweden. * * All rights reserved. * * THIS PROGRAM IS PROVIDED UNDER THE TERMS OF GPL VERSION 3 LICENSE OR * THIS OSMC PUBLIC LICENSE (OSMC-PL). * ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE * OF THE OSMC PUBLIC LICENSE OR THE GPL VERSION 3, ACCORDING TO RECIPIENTS CHOICE. * * The OpenModelica software and the Open Source Modelica * Consortium (OSMC) Public License (OSMC-PL) are obtained * from OSMC, either from the above address, * from the URLs: http://www.ida.liu.se/projects/OpenModelica or * http://www.openmodelica.org, and in the OpenModelica distribution. * GNU version 3 is obtained from: http://www.gnu.org/copyleft/gpl.html. * * This program is distributed WITHOUT ANY WARRANTY; without * even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE, EXCEPT AS EXPRESSLY SET FORTH * IN THE BY RECIPIENT SELECTED SUBSIDIARY LICENSE CONDITIONS OF OSMC-PL. * * See the full OSMC Public License conditions for more details. * * Main author: Wladimir Schamai, EADS Innovation Works / Linköping University, 2009-now * * Contributors: * Uwe Pohlmann, University of Paderborn 2009-2010, contribution to the Modelica code generation for state machine behavior, contribution to Papyrus GUI adoptations * Parham Vasaiely, EADS Innovation Works / Hamburg University of Applied Sciences 2009-2011, implementation of simulation plugins */ package org.openmodelica.simulation.environment.view.simulation.noninteractive; import org.eclipse.swt.SWT; import org.eclipse.swt.layout.FillLayout; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Composite; import org.eclipse.ui.part.ViewPart; // TODO: Auto-generated Javadoc /** * The Class NonInteractiveSimulationVisualisationView. */ public class NonInteractiveSimulationVisualisationView extends ViewPart { /** The composite1. */ private Composite composite1; /** The composite visualisation. */ private Composite compositeVisualisation; /** * Instantiates a new non interactive simulation visualisation view. */ public NonInteractiveSimulationVisualisationView() { // TODO Auto-generated constructor stub } /* (non-Javadoc) * @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite) */ @Override public void createPartControl(Composite parent) { composite1 = new Composite(parent, SWT.NULL); GridLayout composite1Layout = new GridLayout(); composite1.setLayout(composite1Layout); { compositeVisualisation = new NonInteractiveSimulationVisualisation_JFreeChartPlotComposite(composite1, SWT.NONE); // compositeVisualisation = new CopyOfInteractiveSimulationVisualisation_JFreeChartPlotComposite(composite1, SWT.NONE); FillLayout compositeVisualisationLayout = new FillLayout(org.eclipse.swt.SWT.HORIZONTAL); GridData compositeVisualisationLData = new GridData(); compositeVisualisationLData.horizontalAlignment = GridData.FILL; compositeVisualisationLData.verticalAlignment = GridData.FILL; compositeVisualisationLData.grabExcessHorizontalSpace = true; compositeVisualisationLData.grabExcessVerticalSpace = true; compositeVisualisation.setLayoutData(compositeVisualisationLData); compositeVisualisation.setLayout(compositeVisualisationLayout); } } /* (non-Javadoc) * @see org.eclipse.ui.part.WorkbenchPart#setFocus() */ @Override public void setFocus() { // TODO Auto-generated method stub } }
[ "wschamai" ]
wschamai
e90cfee82837aa56d4c9f27f0a97f775f24e0728
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/34/34_dd68769b111a79ec5321b29565270bc69c5e1f3b/ContextTest/34_dd68769b111a79ec5321b29565270bc69c5e1f3b_ContextTest_t.java
64a0dd304ffd7e75392b5fdb2a1b50fc5bbd192a
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
4,348
java
package test; import java.util.List; import java.util.ArrayList; import java.util.Map; import java.util.HashMap; import java.lang.UnsupportedOperationException; import org.junit.BeforeClass; import org.junit.AfterClass; import org.junit.Before; import play.test.FakeApplication; import play.test.Helpers; import play.mvc.Content; import play.mvc.Http; import play.i18n.Lang; /** * If you want to run your class as if the application was actually running, * this may be interesting. * @author Felix Van der Jeugt */ public abstract class ContextTest { private static FakeApplication app; /** * Set up the application. */ @BeforeClass public static void setupApplication() { Map<String, String> settings = new HashMap<String, String>(); settings.put("db.default.driver", "org.h2.Driver"); settings.put("db.default.user", "sa"); settings.put("db.default.password", ""); settings.put("db.default.url", "jdbc:h2:mem:play"); settings.put("evolutionplugin","enabled"); app = Helpers.fakeApplication(settings); Helpers.start(app); } /** * Set up the context. */ @Before public void setupContext() { Http.Context.current = new ThreadLocal<Http.Context>() { @Override protected Http.Context initialValue() { return makeContext(); } }; } /** * Default context creation, override to customize. */ protected Http.Context makeContext() { return new Http.Context( makeRequest(), makeSessionData(), makeFlashData() ); } /** * Default Session creation. You can override this class and add this to the * session. * @return A Map mapping the Session keys on their values. */ protected Map<String, String> makeSessionData() { return new HashMap<String, String>(); } /** * Default FlashData creation. * @return The FlashData for in the context. */ protected Map<String, String> makeFlashData() { return new HashMap<String, String>(); } /** * Default Request stub. Override to implement request functions, and thus * mimic the kind of user request you want. * @return The Request for the Context. */ protected Http.Request makeRequest() { return new StubRequest(); } /** * Breaks down the application. */ @AfterClass public static void breakdownApplication() { Helpers.stop(app); } protected class StubRequest extends Http.Request { @Override public Http.RequestBody body() { throw new UnsupportedOperationException(); } @Override public List<String> accept() { throw new UnsupportedOperationException(); } @Override public List<Lang> acceptLanguages() { List<Lang> l = new ArrayList<Lang>(); l.add(Lang.forCode("en-US")); return l; } @Override public boolean accepts(String mediaType) { throw new UnsupportedOperationException(); } @Override public Http.Cookies cookies() { return new Http.Cookies() { @Override public Http.Cookie get(String name) { return null; } }; } @Override public Map<String,String[]> headers() { throw new UnsupportedOperationException(); } @Override public String host() { throw new UnsupportedOperationException(); } @Override public String method() { throw new UnsupportedOperationException(); } @Override public String path() { throw new UnsupportedOperationException(); } @Override public Map<String,String[]> queryString() { throw new UnsupportedOperationException(); } @Override public String remoteAddress() { throw new UnsupportedOperationException(); } @Override public String uri() { throw new UnsupportedOperationException(); } } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
4605f0cfe096aa3ec811d3f6afe0fcfcd87608d6
13c2d3db2d49c40c74c2e6420a9cd89377f1c934
/program_data/JavaProgramData/70/1117.java
986b9e1eec009ac53f8cfe6ed7f3ddc9ad3a5832
[ "MIT" ]
permissive
qiuchili/ggnn_graph_classification
c2090fefe11f8bf650e734442eb96996a54dc112
291ff02404555511b94a4f477c6974ebd62dcf44
refs/heads/master
2021-10-18T14:54:26.154367
2018-10-21T23:34:14
2018-10-21T23:34:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
936
java
package <missing>; public class GlobalMembers { public static double distance(double x1, double y1, double x2, double y2) { double m = Math.sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)); return m; } public static int Main() { int i; int n; int j; int k = 0; double[][] a = new double[100][2]; double dis; double t; n = Integer.parseInt(ConsoleInput.readToWhiteSpace(true)); for (i = 0; i < n; i++) { a[i][0] = Double.parseDouble(ConsoleInput.readToWhiteSpace(true)); a[i][1] = Double.parseDouble(ConsoleInput.readToWhiteSpace(true)); } dis = distance(a[0][0], a[0][1], a[1][0], a[1][1]); while (k != n * (n - 1) / 2) { for (i = 0; i < n; i++) { for (j = i + 1; j < n; j++) { t = distance(a[i][0], a[i][1], a[j][0], a[j][1]); dis = (t > dis) ? t : dis; k++; } } } System.out.printf("%.4f\n", dis); return 0; } }
[ "y.yu@open.ac.uk" ]
y.yu@open.ac.uk
a7f1e74d1e7be861c39cd4426dca54215dfce6bb
780e13b7c76f078f89d21df4aef5ebf8a187b75e
/spring-functionaltest-domain/src/main/java/jp/co/ntt/fw/spring/functionaltest/domain/model/Stock.java
dbb5f4cf4ee8b35b7373069b57a612d22bf8097b
[]
no_license
phoenix110/spring-functionaltest
dba4e64b5f188a8d276315c20938cee76b949961
2671a07e211ceab4ccd925e21f647dfc0586a809
refs/heads/master
2020-04-16T07:38:23.180197
2018-03-08T01:32:35
2018-03-09T06:21:40
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,571
java
/* * Copyright 2014-2018 NTT Corporation. * * 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 jp.co.ntt.fw.spring.functionaltest.domain.model; import java.io.Serializable; public class Stock implements Serializable { private static final long serialVersionUID = 1L; private String itemCode; private String itemName; private int quantity; private long version; public String getItemCode() { return itemCode; } public void setItemCode(String itemCode) { this.itemCode = itemCode; } public String getItemName() { return itemName; } public void setItemName(String itemName) { this.itemName = itemName; } public int getQuantity() { return quantity; } public void setQuantity(int quantity) { this.quantity = quantity; } public long getVersion() { return version; } public void setVersion(long version) { this.version = version; } }
[ "macchinetta.fw@gmail.com" ]
macchinetta.fw@gmail.com
cb79676b7dafb7b8f1226a70a2c4c215d861d343
c173832fd576d45c875063a1a480672fbd59ca04
/seguridad/tags/release-1.0/modulos/tags/apps20120808/apps/LOCALGIS-SQL/src/main/java/com/geopista/sql/PoolPS.java
55c8038a0c3b948c3b3d616c97d5fe4ca3765f52
[]
no_license
jormaral/allocalgis
1308616b0f3ac8aa68fb0820a7dfa89d5a64d0e6
bd5b454b9c2e8ee24f70017ae597a32301364a54
refs/heads/master
2021-01-16T18:08:36.542315
2016-04-12T11:43:18
2016-04-12T11:43:18
50,914,723
0
0
null
2016-02-02T11:04:27
2016-02-02T11:04:27
null
UTF-8
Java
false
false
994
java
package com.geopista.sql; import java.util.ArrayList; import java.util.Iterator; import java.util.Vector; import java.util.Enumeration; /** * Creado por SATEC. * User: angeles * Date: 30-jun-2006 * Time: 12:17:47 */ public class PoolPS { Vector pool; public PoolPS() { pool =new Vector(); } public Iterator iterator() { return pool.iterator(); } public void clear() { try { for (Enumeration e=pool.elements();e.hasMoreElements();) { GEOPISTAPreparedStatement gps=(GEOPISTAPreparedStatement)e.nextElement(); gps.close(); } pool.clear(); }catch(Exception e){} } public void add(GEOPISTAPreparedStatement ps) { pool.add(ps); } public Vector getPool() { return pool; } public void setPool(Vector pool) { this.pool = pool; } }
[ "jorge.martin@cenatic.es" ]
jorge.martin@cenatic.es
3ed879f40f0fc9a4de5d4b6f82a47e8039b4716d
d483a4e01eacfddee8078beffe19d6c54b59f380
/Inhabitants/Office/org.emftext.language.office2.resource.office2/src/org/emftext/language/office2/resource/office2/analysis/Office2QUOTED_40_41TokenResolver.java
1f56a91e2ba2ee1f2672fa29e6870b388bd11d2c
[]
no_license
DevBoost/EMFText-Zoo
1e05a438d30415e8582de0947af26d836fee46ce
c193113edcaa0f92634288782f22a21412f2c396
refs/heads/master
2020-04-06T06:56:44.588008
2013-09-16T09:47:33
2013-09-16T09:47:33
5,324,760
8
2
null
null
null
null
UTF-8
Java
false
false
1,882
java
/******************************************************************************* * Copyright (c) 2006-2012 * Software Technology Group, Dresden University of Technology * DevBoost GmbH, Berlin, Amtsgericht Charlottenburg, HRB 140026 * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Software Technology Group - TU Dresden, Germany; * DevBoost GmbH - Berlin, Germany * - initial API and implementation ******************************************************************************/ package org.emftext.language.office2.resource.office2.analysis; public class Office2QUOTED_40_41TokenResolver implements org.emftext.language.office2.resource.office2.IOffice2TokenResolver { private org.emftext.language.office2.resource.office2.analysis.Office2DefaultTokenResolver defaultTokenResolver = new org.emftext.language.office2.resource.office2.analysis.Office2DefaultTokenResolver(); public java.lang.String deResolve(java.lang.Object value, org.eclipse.emf.ecore.EStructuralFeature feature, org.eclipse.emf.ecore.EObject container) { java.lang.String result = defaultTokenResolver.deResolve(value, feature, container); result += ")"; result = "(" + result; return result; } public void resolve(java.lang.String lexem, org.eclipse.emf.ecore.EStructuralFeature feature, org.emftext.language.office2.resource.office2.IOffice2TokenResolveResult result) { lexem = lexem.substring(1); lexem = lexem.substring(0, lexem.length() - 1); defaultTokenResolver.resolve(lexem, feature, result); } public void setOptions(java.util.Map<?,?> options) { defaultTokenResolver.setOptions(options); } }
[ "jendrik.johannes@devboost.de" ]
jendrik.johannes@devboost.de
86a6d1636794f2cb03efcdfdc1089ad1ec85c1b5
75b0f2fceb9d1786d64cac831326354d431a8a32
/com/planet_ink/coffee_web/http/ServletManager.java
e9fb7020101cf8be85b2f5b6a69c3547993692d7
[ "Apache-2.0" ]
permissive
thierrylach/CoffeeMud
f41857a8106706530c794d377bfb81b6458a847a
83101f209d8875ec2bbaf6c623d520a30cd3cc8d
refs/heads/master
2022-09-20T17:14:07.782102
2022-08-29T22:07:57
2022-08-29T22:07:57
113,072,543
0
0
null
2017-12-04T17:20:51
2017-12-04T17:20:51
null
UTF-8
Java
false
false
4,234
java
package com.planet_ink.coffee_web.http; import java.util.Collection; import java.util.Hashtable; import java.util.Map; import com.planet_ink.coffee_web.interfaces.SimpleServlet; import com.planet_ink.coffee_web.interfaces.SimpleServletManager; import com.planet_ink.coffee_web.util.CWConfig; import com.planet_ink.coffee_web.util.RequestStats; /* Copyright 2012-2022 Bo Zimmerman 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. */ /** * Manages a relatively static set of servlet classes * and the root contexts needed to access them. * * @author Bo Zimmerman * */ public class ServletManager implements SimpleServletManager { private final Map<String,Class<? extends SimpleServlet>> servlets; // map of registered servlets by context private final Map<Class<? extends SimpleServlet>, RequestStats> servletStats; // stats about each servlet private final Map<Class<? extends SimpleServlet>, Boolean> servletInit; // whether a servlets been initialized public ServletManager(final CWConfig config) { servlets = new Hashtable<String,Class<? extends SimpleServlet>>(); servletStats = new Hashtable<Class<? extends SimpleServlet>, RequestStats>(); servletInit = new Hashtable<Class<? extends SimpleServlet>, Boolean>(); for(final String context : config.getServlets().keySet()) { String className=config.getServlets().get(context); if(className.indexOf('.')<0) className="com.planet_ink.coffee_web.servlets."+className; try { @SuppressWarnings("unchecked") final Class<? extends SimpleServlet> servletClass=(Class<? extends SimpleServlet>) Class.forName(className); registerServlet(context, servletClass); } catch (final ClassNotFoundException e) { config.getLogger().severe("Servlet Manager can't load "+className); } } } /** * Internal method to register a servlets existence, and its context. * This will go away when a config file is permitted * @param context the uri context the servlet responds to * @param servletClass the class of the servlet */ @Override public void registerServlet(final String context, final Class<? extends SimpleServlet> servletClass) { servlets.put(context, servletClass); servletStats.put(servletClass, new RequestStats()); } /** * For anyone externally interested, will return the list of servlet classes * that are registered * @return the list of servlet classes */ @Override public Collection<Class<? extends SimpleServlet>> getServlets() { return servlets.values(); } /** * Returns a servlet (if any) that handles the given uri context. * if none is found, NULL is returned. * @param rootContext the uri context * @return the servlet class, if any, or null */ @Override public Class<? extends SimpleServlet> findServlet(final String rootContext) { final Class<? extends SimpleServlet> c=servlets.get(rootContext); if(c == null) return null; if(servletInit.containsKey(c)) return c; synchronized(servletInit) { if(servletInit.containsKey(c)) return c; SimpleServlet servlet; try { servlet = c.newInstance(); servlet.init(); } catch (final Exception e) { } servletInit.put(c, Boolean.TRUE); } return c; } /** * Returns a servlet statistics object for the given servlet class * or null if none exists * @param servletClass the servlet class managed by this web server * @return the servlet stats object */ @Override public RequestStats getServletStats(final Class<? extends SimpleServlet> servletClass) { return servletStats.get(servletClass); } }
[ "bo@zimmers.net" ]
bo@zimmers.net
9480075918e2cfd4187b2324b97439485ce4a911
447520f40e82a060368a0802a391697bc00be96f
/apks/playstore_apps/com_spotify_music/source/btz.java
b7a7e1cf7e3428bd0df8f94d8e7a3991bf3b5709
[ "Apache-2.0" ]
permissive
iantal/AndroidPermissions
7f3343a9c29d82dbcd4ecd98b3a50ddf8d179465
d623b732734243590b5f004d167e542e2e2ae249
refs/heads/master
2023-07-19T01:29:26.689186
2019-09-30T19:01:42
2019-09-30T19:01:42
107,239,248
0
0
Apache-2.0
2023-07-16T07:41:38
2017-10-17T08:22:57
null
UTF-8
Java
false
false
4,017
java
import com.google.android.exoplayer2.ParserException; import java.util.Stack; final class btz implements bub { private final byte[] a = new byte[8]; private final Stack<bua> b = new Stack(); private final buh c = new buh(); private buc d; private int e; private int f; private long g; btz() {} private long a(btl paramBtl, int paramInt) { byte[] arrayOfByte = this.a; int i = 0; paramBtl.b(arrayOfByte, 0, paramInt); long l2; for (long l1 = 0L; i < paramInt; l1 = l1 << 8 | l2) { l2 = this.a[i] & 0xFF; i += 1; } return l1; } public final void a() { this.e = 0; this.b.clear(); this.c.a(); } public final void a(buc paramBuc) { this.d = paramBuc; } public final boolean a(btl paramBtl) { boolean bool; if (this.d != null) { bool = true; } else { bool = false; } ceo.b(bool); for (;;) { if ((!this.b.isEmpty()) && (paramBtl.c() >= ((bua)this.b.peek()).b)) { this.d.c(((bua)this.b.pop()).a); return true; } long l2; long l1; int j; if (this.e == 0) { l2 = this.c.a(paramBtl, true, false, 4); l1 = l2; if (l2 == -2L) { paramBtl.a(); for (;;) { paramBtl.c(this.a, 0, 4); i = buh.a(this.a[0]); if ((i != -1) && (i <= 4)) { j = (int)buh.a(this.a, i, false); if (this.d.b(j)) { paramBtl.b(i); l1 = j; break; } } paramBtl.b(1); } } if (l1 == -1L) { return false; } this.f = ((int)l1); this.e = 1; } if (this.e == 1) { this.g = this.c.a(paramBtl, false, true, 8); this.e = 2; } int i = this.d.a(this.f); buc localBuc; switch (i) { default: paramBtl = new StringBuilder("Invalid element type "); paramBtl.append(i); throw new ParserException(paramBtl.toString()); case 5: if ((this.g != 4L) && (this.g != 8L)) { paramBtl = new StringBuilder("Invalid float size: "); paramBtl.append(this.g); throw new ParserException(paramBtl.toString()); } localBuc = this.d; i = this.f; j = (int)this.g; l1 = a(paramBtl, j); double d1; if (j == 4) { d1 = Float.intBitsToFloat((int)l1); } else { d1 = Double.longBitsToDouble(l1); } localBuc.a(i, d1); this.e = 0; return true; case 4: this.d.a(this.f, (int)this.g, paramBtl); this.e = 0; return true; case 3: if (this.g > 2147483647L) { paramBtl = new StringBuilder("String element size: "); paramBtl.append(this.g); throw new ParserException(paramBtl.toString()); } localBuc = this.d; i = this.f; j = (int)this.g; if (j == 0) { paramBtl = ""; } else { byte[] arrayOfByte = new byte[j]; paramBtl.b(arrayOfByte, 0, j); paramBtl = new String(arrayOfByte); } localBuc.a(i, paramBtl); this.e = 0; return true; case 2: if (this.g > 8L) { paramBtl = new StringBuilder("Invalid integer size: "); paramBtl.append(this.g); throw new ParserException(paramBtl.toString()); } this.d.a(this.f, a(paramBtl, (int)this.g)); this.e = 0; return true; case 1: l1 = paramBtl.c(); l2 = this.g; this.b.add(new bua(this.f, l1 + l2, (byte)0)); this.d.a(this.f, l1, this.g); this.e = 0; return true; } paramBtl.b((int)this.g); this.e = 0; } } }
[ "antal.micky@yahoo.com" ]
antal.micky@yahoo.com
fb82db2c719ee1e5fa66a2b74b8e444f41d45525
260ffca605956d7cb9490a8c33e2fe856e5c97bf
/src/com/google/android/gms/drive/zzf.java
a679c47e785da09cf096081f4bc6e6cec4593eb2
[]
no_license
yazid2016/com.incorporateapps.fakegps.fre
cf7f1802fcc6608ff9a1b82b73a17675d8068beb
44856c804cea36982fcc61d039a46761a8103787
refs/heads/master
2021-06-02T23:32:09.654199
2016-07-21T03:28:48
2016-07-21T03:28:48
null
0
0
null
null
null
null
UTF-8
Java
false
false
206
java
package com.google.android.gms.drive; public abstract interface zzf {} /* Location: * Qualified Name: com.google.android.gms.drive.zzf * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "reverseengineeringer@hackeradmin.com" ]
reverseengineeringer@hackeradmin.com
b7e87748b8c03bdcb94c52e0053d9633f9e75ea8
225011bbc304c541f0170ef5b7ba09b967885e95
/com/mopub/mobileads/AdTypeTranslator.java
b14f30fa63358d7c8f2e8a7261dbb0d8c70b1b78
[]
no_license
sebaudracco/bubble
66536da5367f945ca3318fecc4a5f2e68c1df7ee
e282cda009dfc9422594b05c63e15f443ef093dc
refs/heads/master
2023-08-25T09:32:04.599322
2018-08-14T15:27:23
2018-08-14T15:27:23
140,444,001
1
1
null
null
null
null
UTF-8
Java
false
false
5,038
java
package com.mopub.mobileads; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import com.mopub.common.AdFormat; import com.mopub.common.AdType; import com.mopub.common.util.ResponseHeader; import com.mopub.network.HeaderUtils; import java.util.Map; public class AdTypeTranslator { public static final String BANNER_SUFFIX = "_banner"; public static final String INTERSTITIAL_SUFFIX = "_interstitial"; public enum CustomEventType { GOOGLE_PLAY_SERVICES_BANNER("admob_native_banner", "com.mopub.mobileads.GooglePlayServicesBanner", false), GOOGLE_PLAY_SERVICES_INTERSTITIAL("admob_full_interstitial", "com.mopub.mobileads.GooglePlayServicesInterstitial", false), MILLENNIAL_BANNER("millennial_native_banner", "com.mopub.mobileads.MillennialBanner", false), MILLENNIAL_INTERSTITIAL("millennial_full_interstitial", "com.mopub.mobileads.MillennialInterstitial", false), MRAID_BANNER("mraid_banner", "com.mopub.mraid.MraidBanner", true), MRAID_INTERSTITIAL("mraid_interstitial", "com.mopub.mraid.MraidInterstitial", true), HTML_BANNER("html_banner", "com.mopub.mobileads.HtmlBanner", true), HTML_INTERSTITIAL("html_interstitial", "com.mopub.mobileads.HtmlInterstitial", true), VAST_VIDEO_INTERSTITIAL("vast_interstitial", "com.mopub.mobileads.VastVideoInterstitial", true), MOPUB_NATIVE("mopub_native", "com.mopub.nativeads.MoPubCustomEventNative", true), MOPUB_VIDEO_NATIVE("mopub_video_native", "com.mopub.nativeads.MoPubCustomEventVideoNative", true), MOPUB_REWARDED_VIDEO(AdType.REWARDED_VIDEO, "com.mopub.mobileads.MoPubRewardedVideo", true), MOPUB_REWARDED_PLAYABLE(AdType.REWARDED_PLAYABLE, "com.mopub.mobileads.MoPubRewardedPlayable", true), UNSPECIFIED("", null, false); @Nullable private final String mClassName; private final boolean mIsMoPubSpecific; @NonNull private final String mKey; private CustomEventType(String key, String className, boolean isMoPubSpecific) { this.mKey = key; this.mClassName = className; this.mIsMoPubSpecific = isMoPubSpecific; } private static CustomEventType fromString(@Nullable String key) { for (CustomEventType customEventType : values()) { if (customEventType.mKey.equals(key)) { return customEventType; } } return UNSPECIFIED; } private static CustomEventType fromClassName(@Nullable String className) { for (CustomEventType customEventType : values()) { if (customEventType.mClassName != null && customEventType.mClassName.equals(className)) { return customEventType; } } return UNSPECIFIED; } public String toString() { return this.mClassName; } public static boolean isMoPubSpecific(@Nullable String className) { return fromClassName(className).mIsMoPubSpecific; } } static String getAdNetworkType(String adType, String fullAdType) { String adNetworkType; if ("interstitial".equals(adType)) { adNetworkType = fullAdType; } else { adNetworkType = adType; } return adNetworkType != null ? adNetworkType : "unknown"; } public static String getCustomEventName(@NonNull AdFormat adFormat, @NonNull String adType, @Nullable String fullAdType, @NonNull Map<String, String> headers) { if (AdType.CUSTOM.equalsIgnoreCase(adType)) { return HeaderUtils.extractHeader((Map) headers, ResponseHeader.CUSTOM_EVENT_NAME); } if ("json".equalsIgnoreCase(adType)) { return CustomEventType.MOPUB_NATIVE.toString(); } if (AdType.VIDEO_NATIVE.equalsIgnoreCase(adType)) { return CustomEventType.MOPUB_VIDEO_NATIVE.toString(); } if (AdType.REWARDED_VIDEO.equalsIgnoreCase(adType)) { return CustomEventType.MOPUB_REWARDED_VIDEO.toString(); } if (AdType.REWARDED_PLAYABLE.equalsIgnoreCase(adType)) { return CustomEventType.MOPUB_REWARDED_PLAYABLE.toString(); } if ("html".equalsIgnoreCase(adType) || AdType.MRAID.equalsIgnoreCase(adType)) { CustomEventType access$000; if (AdFormat.INTERSTITIAL.equals(adFormat)) { access$000 = CustomEventType.fromString(adType + INTERSTITIAL_SUFFIX); } else { access$000 = CustomEventType.fromString(adType + BANNER_SUFFIX); } return access$000.toString(); } else if ("interstitial".equalsIgnoreCase(adType)) { return CustomEventType.fromString(fullAdType + INTERSTITIAL_SUFFIX).toString(); } else { return CustomEventType.fromString(adType + BANNER_SUFFIX).toString(); } } }
[ "sebaudracco@gmail.com" ]
sebaudracco@gmail.com
ebe69cbdde8504db5331a5a2b35f6f91607ec708
71007018bfae36117fd2f779dbe6e6d7bb9bde9c
/src/main/java/com/magento/test/dao/SalesruleCouponDao.java
f51ac00715a12201660cff9568d1b4e827365ac6
[]
no_license
gmai2006/magentotest
819201760b720a90d55ef853be964651ace125ac
ca67d16d6280ddaefbf57fa1129b6ae7bd80408f
refs/heads/main
2023-09-03T05:14:27.788984
2021-10-17T06:25:09
2021-10-17T06:25:09
418,040,494
0
0
null
null
null
null
UTF-8
Java
false
false
1,890
java
/** * %% Copyright (C) 2021 DataScience 9 LLC %% Licensed under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance with the License. You may obtain a * copy of the License at * * <p>http://www.apache.org/licenses/LICENSE-2.0 * * <p>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% * * <p>This code is 100% AUTO generated. Please do not modify it DIRECTLY If you need new features or * function or changes please update the templates then submit the template through our web * interface. */ package com.magento.test.dao; import java.util.List; import com.magento.test.entity.SalesruleCoupon; import com.magento.test.entity.SalesruleCouponId; public interface SalesruleCouponDao { /** * Retrieve all records SalesruleCoupon. * * @param maxResult a maximum number of returned records. * @return A list of SalesruleCoupon */ public List<SalesruleCoupon> select(int maxResult); /** * Retrieve all records SalesruleCoupon. * * @return A list of SalesruleCoupon */ public List<SalesruleCoupon> selectAll(); /** * Find an entity. * * @param id An SalesruleCoupon id. * @return The same SalesruleCoupon. */ public SalesruleCoupon find(SalesruleCouponId id); /** * Create an SalesruleCoupon. * * @param e the SalesruleCoupon. * @return The same SalesruleCoupon. */ public SalesruleCoupon create(SalesruleCoupon e); /** * Update the SalesruleCoupon. * * @param e the SalesruleCoupon. * @return The same SalesruleCoupon. */ public SalesruleCoupon update(SalesruleCoupon e); }
[ "gmai2006@gmail.com" ]
gmai2006@gmail.com
515f9a2d65ffe0fea3f88ac0dfa902a883de5259
67ed109e86416b1448247371c51fef5893115f7d
/pwdgen2/evilcorp/com.evilcorp.pwdgen_source_from_JADX/sources/mono/android/app/SharedElementCallback_OnSharedElementsReadyListenerImplementor.java
52116468c1609e2195f5ccc42009da6954feba78
[]
no_license
Hong5489/FSEC2020
cc9fde303e7dced5a1defa121ddc29b88b95ab0d
9063d2266adf688e1792ea78b3f1b61cd28ece89
refs/heads/master
2022-12-01T15:17:21.314765
2020-08-16T15:35:49
2020-08-16T15:35:49
287,962,248
1
0
null
null
null
null
UTF-8
Java
false
false
1,694
java
package mono.android.app; import android.app.SharedElementCallback.OnSharedElementsReadyListener; import java.util.ArrayList; import mono.android.IGCUserPeer; import mono.android.Runtime; import mono.android.TypeManager; public class SharedElementCallback_OnSharedElementsReadyListenerImplementor implements IGCUserPeer, OnSharedElementsReadyListener { public static final String __md_methods = "n_onSharedElementsReady:()V:GetOnSharedElementsReadyHandler:Android.App.SharedElementCallback/IOnSharedElementsReadyListenerInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null\n"; private ArrayList refList; private native void n_onSharedElementsReady(); static { Runtime.register("Android.App.SharedElementCallback+IOnSharedElementsReadyListenerImplementor, Mono.Android", SharedElementCallback_OnSharedElementsReadyListenerImplementor.class, __md_methods); } public SharedElementCallback_OnSharedElementsReadyListenerImplementor() { if (getClass() == SharedElementCallback_OnSharedElementsReadyListenerImplementor.class) { TypeManager.Activate("Android.App.SharedElementCallback+IOnSharedElementsReadyListenerImplementor, Mono.Android", "", this, new Object[0]); } } public void onSharedElementsReady() { n_onSharedElementsReady(); } public void monodroidAddReference(Object obj) { if (this.refList == null) { this.refList = new ArrayList(); } this.refList.add(obj); } public void monodroidClearReferences() { ArrayList arrayList = this.refList; if (arrayList != null) { arrayList.clear(); } } }
[ "hongwei5489@gmail.com" ]
hongwei5489@gmail.com
4fd53cda245a47dda693e47262487ad66996df8d
893fd55d55e65354c563c69d3c3f3d28a72b3a6b
/OpenADRServerVTN20b/src/main/java/com/avob/openadr/server/oadr20b/vtn/service/ei/Oadr20bVTNEiService.java
ba4e372feb435c0efc1f95ef207db35d10d8191e
[ "Apache-2.0" ]
permissive
avob/OpenADR
62a63e08d13e792d8c7ff0b186641b74b49d5b6f
7608f780509e5669bbf5bd311c8cb3206cebf7ac
refs/heads/master
2022-09-18T21:56:32.315131
2021-09-06T06:22:02
2021-09-06T06:22:02
169,761,438
45
18
Apache-2.0
2022-02-16T01:15:15
2019-02-08T16:07:39
Java
UTF-8
Java
false
false
242
java
package com.avob.openadr.server.oadr20b.vtn.service.ei; import com.avob.openadr.server.common.vtn.models.ven.Ven; public interface Oadr20bVTNEiService { public Object request(Ven ven, Object payload); public String getServiceName(); }
[ "zanni.bertrand@gmail.com" ]
zanni.bertrand@gmail.com
375dff96fa6ddb56850490d7349ab535b5efb218
e682fa3667adce9277ecdedb40d4d01a785b3912
/internal/fischer/mangf/A341710.java
0948a9ae3027ab7392301d93eadc7daaf5944e54
[ "Apache-2.0" ]
permissive
gfis/joeis-lite
859158cb8fc3608febf39ba71ab5e72360b32cb4
7185a0b62d54735dc3d43d8fb5be677734f99101
refs/heads/master
2023-08-31T00:23:51.216295
2023-08-29T21:11:31
2023-08-29T21:11:31
179,938,034
4
1
Apache-2.0
2022-06-25T22:47:19
2019-04-07T08:35:01
Roff
UTF-8
Java
false
false
437
java
package irvine.oeis.a341; // manually divmul at 2021-08-20 23:36 import irvine.math.z.Z; import irvine.oeis.a120.A120963; /** * A341710 a(n) = A120963(n)/2. * @author Georg Fischer */ public class A341710 extends A120963 { /** Construct the sequence. */ public A341710() { super.next(); } @Override public int getOffset() { return 1; } @Override public Z next() { return super.next().divide2(); } }
[ "dr.Georg.Fischer@gmail.com" ]
dr.Georg.Fischer@gmail.com
1e1ba858f3881e7925e0bbe59c8daf137016d5f6
a1826c2ed9c12cfc395fb1a14c1a2e1f097155cb
/ahas-20180901/src/main/java/com/aliyun/ahas20180901/models/QueryUserRemainingAmountResponseBody.java
2f1d6249cbfbd263e27e51549268695c793a66c2
[ "Apache-2.0" ]
permissive
aliyun/alibabacloud-java-sdk
83a6036a33c7278bca6f1bafccb0180940d58b0b
008923f156adf2e4f4785a0419f60640273854ec
refs/heads/master
2023-09-01T04:10:33.640756
2023-09-01T02:40:45
2023-09-01T02:40:45
288,968,318
40
45
null
2023-06-13T02:47:13
2020-08-20T09:51:08
Java
UTF-8
Java
false
false
1,714
java
// This file is auto-generated, don't edit it. Thanks. package com.aliyun.ahas20180901.models; import com.aliyun.tea.*; public class QueryUserRemainingAmountResponseBody extends TeaModel { @NameInMap("Code") public String code; @NameInMap("Data") public String data; @NameInMap("Message") public String message; @NameInMap("RequestId") public String requestId; @NameInMap("Success") public Boolean success; public static QueryUserRemainingAmountResponseBody build(java.util.Map<String, ?> map) throws Exception { QueryUserRemainingAmountResponseBody self = new QueryUserRemainingAmountResponseBody(); return TeaModel.build(map, self); } public QueryUserRemainingAmountResponseBody setCode(String code) { this.code = code; return this; } public String getCode() { return this.code; } public QueryUserRemainingAmountResponseBody setData(String data) { this.data = data; return this; } public String getData() { return this.data; } public QueryUserRemainingAmountResponseBody setMessage(String message) { this.message = message; return this; } public String getMessage() { return this.message; } public QueryUserRemainingAmountResponseBody setRequestId(String requestId) { this.requestId = requestId; return this; } public String getRequestId() { return this.requestId; } public QueryUserRemainingAmountResponseBody setSuccess(Boolean success) { this.success = success; return this; } public Boolean getSuccess() { return this.success; } }
[ "sdk-team@alibabacloud.com" ]
sdk-team@alibabacloud.com
f41d3a35a1a150ac16e2418640a8f1c38d1d2bef
6d382fa9e00a4bbee26db1dcc9322c133600fc39
/Date0713/src/ioliu/CopyFileDemo.java
e9049cc2e6a332b996249f8328f5d2b0a90bf4e8
[]
no_license
wang347709862/Javase1
bac85f351c9ad9a4a5d1c130d3f05f93c7cfed56
02feb9d0654a0f80a5a053e3f1d5d334b9719f28
refs/heads/master
2020-07-22T19:57:05.660305
2019-09-09T13:05:32
2019-09-09T13:05:32
192,696,659
0
0
null
null
null
null
UTF-8
Java
false
false
1,083
java
package ioliu; import java.io.*; public class CopyFileDemo { public static void main(String[] args) throws IOException { // FileInputStream file=new FileInputStream("f:\\bos.txt"); // FileOutputStream file2=new FileOutputStream("f:\\bbb.txt"); // InputStreamReader fr=new InputStreamReader(new FileInputStream("f:\\bos.txt"),"GBK"); // OutputStreamWriter fw=new OutputStreamWriter(new FileOutputStream("f:\\aaa.txt"),"GBK"); // OutputStreamWriter fw=new OutputStreamWriter(new FileOutputStream("f:\\bos.txt"),"GBK"); // fw.write("的订单 的的"); // fw.close();; FileReader fr=new FileReader("f:\\bos.txt"); // FileWriter fw=new FileWriter("f:\\bos.txt"); int len=0; // fw.write("的打\r "); // fw.write("的的啊打\r "); char[] bys=new char[1024]; while((len=fr.read(bys))!=-1) { System.out.println(new String(bys,0,len)); // fw.write(bys,0,len); // fw.flush(); } fr.close(); // fw.close(); } }
[ "347709862@qq.com" ]
347709862@qq.com
58022bb18db4c7fa275c2394ede75d8f4ccbd967
aa2f56c3a108da41dafcf53b12e39f520032ca30
/wsclient/src/main/java/org/hpccsystems/ws/client/gen/wsworkunits/v1_74/WUWaitCompiled.java
19c971e394056e1c0835fb0f65723d433b30f4a1
[]
no_license
drealeed/HPCC-JAPIs
459e6c0ab0bbf8d7893fafb775167197567cc573
ee652f4d5163d0f7daa7949015dc4d815b64749d
refs/heads/master
2022-06-24T13:46:14.497602
2019-05-21T18:24:47
2019-05-21T18:24:47
23,236,635
0
0
null
null
null
null
UTF-8
Java
false
false
5,905
java
/** * WUWaitCompiled.java * * This file was auto-generated from WSDL * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. */ package org.hpccsystems.ws.client.gen.wsworkunits.v1_74; public class WUWaitCompiled implements java.io.Serializable { private java.lang.String wuid; private java.lang.Integer wait; private java.lang.Boolean returnOnWait; public WUWaitCompiled() { } public WUWaitCompiled( java.lang.String wuid, java.lang.Integer wait, java.lang.Boolean returnOnWait) { this.wuid = wuid; this.wait = wait; this.returnOnWait = returnOnWait; } /** * Gets the wuid value for this WUWaitCompiled. * * @return wuid */ public java.lang.String getWuid() { return wuid; } /** * Sets the wuid value for this WUWaitCompiled. * * @param wuid */ public void setWuid(java.lang.String wuid) { this.wuid = wuid; } /** * Gets the wait value for this WUWaitCompiled. * * @return wait */ public java.lang.Integer getWait() { return wait; } /** * Sets the wait value for this WUWaitCompiled. * * @param wait */ public void setWait(java.lang.Integer wait) { this.wait = wait; } /** * Gets the returnOnWait value for this WUWaitCompiled. * * @return returnOnWait */ public java.lang.Boolean getReturnOnWait() { return returnOnWait; } /** * Sets the returnOnWait value for this WUWaitCompiled. * * @param returnOnWait */ public void setReturnOnWait(java.lang.Boolean returnOnWait) { this.returnOnWait = returnOnWait; } private java.lang.Object __equalsCalc = null; public synchronized boolean equals(java.lang.Object obj) { if (!(obj instanceof WUWaitCompiled)) return false; WUWaitCompiled other = (WUWaitCompiled) obj; if (obj == null) return false; if (this == obj) return true; if (__equalsCalc != null) { return (__equalsCalc == obj); } __equalsCalc = obj; boolean _equals; _equals = true && ((this.wuid==null && other.getWuid()==null) || (this.wuid!=null && this.wuid.equals(other.getWuid()))) && ((this.wait==null && other.getWait()==null) || (this.wait!=null && this.wait.equals(other.getWait()))) && ((this.returnOnWait==null && other.getReturnOnWait()==null) || (this.returnOnWait!=null && this.returnOnWait.equals(other.getReturnOnWait()))); __equalsCalc = null; return _equals; } private boolean __hashCodeCalc = false; public synchronized int hashCode() { if (__hashCodeCalc) { return 0; } __hashCodeCalc = true; int _hashCode = 1; if (getWuid() != null) { _hashCode += getWuid().hashCode(); } if (getWait() != null) { _hashCode += getWait().hashCode(); } if (getReturnOnWait() != null) { _hashCode += getReturnOnWait().hashCode(); } __hashCodeCalc = false; return _hashCode; } // Type metadata private static org.apache.axis.description.TypeDesc typeDesc = new org.apache.axis.description.TypeDesc(WUWaitCompiled.class, true); static { typeDesc.setXmlType(new javax.xml.namespace.QName("urn:hpccsystems:ws:wsworkunits", ">WUWaitCompiled")); org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); elemField.setFieldName("wuid"); elemField.setXmlName(new javax.xml.namespace.QName("urn:hpccsystems:ws:wsworkunits", "Wuid")); elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); elemField.setMinOccurs(0); elemField.setNillable(false); typeDesc.addFieldDesc(elemField); elemField = new org.apache.axis.description.ElementDesc(); elemField.setFieldName("wait"); elemField.setXmlName(new javax.xml.namespace.QName("urn:hpccsystems:ws:wsworkunits", "Wait")); elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "int")); elemField.setMinOccurs(0); elemField.setNillable(false); typeDesc.addFieldDesc(elemField); elemField = new org.apache.axis.description.ElementDesc(); elemField.setFieldName("returnOnWait"); elemField.setXmlName(new javax.xml.namespace.QName("urn:hpccsystems:ws:wsworkunits", "ReturnOnWait")); elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "boolean")); elemField.setMinOccurs(0); elemField.setNillable(false); typeDesc.addFieldDesc(elemField); } /** * Return type metadata object */ public static org.apache.axis.description.TypeDesc getTypeDesc() { return typeDesc; } /** * Get Custom Serializer */ public static org.apache.axis.encoding.Serializer getSerializer( java.lang.String mechType, java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { return new org.apache.axis.encoding.ser.BeanSerializer( _javaType, _xmlType, typeDesc); } /** * Get Custom Deserializer */ public static org.apache.axis.encoding.Deserializer getDeserializer( java.lang.String mechType, java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { return new org.apache.axis.encoding.ser.BeanDeserializer( _javaType, _xmlType, typeDesc); } }
[ "rodrigo.pastrana@lexisnexis.com" ]
rodrigo.pastrana@lexisnexis.com
9ae55d44acbab9c32f510916a01ce9fddfb3ca2a
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/18/18_0872966897f6c61618b65df24b1035fce4aecb82/LuaJTest/18_0872966897f6c61618b65df24b1035fce4aecb82_LuaJTest_t.java
c9c19daaa0c87a1f60473768837abaf17f13a05b
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
6,544
java
package lua; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import junit.framework.TestCase; import lua.addon.luacompat.LuaCompat; import lua.addon.luajava.LuaJava; import lua.debug.DebugStackState; import lua.io.Closure; import lua.io.LoadState; import lua.io.Proto; import lua.value.LValue; public class LuaJTest extends TestCase { public void testTest1() throws IOException, InterruptedException { runTest( "test1" ); } public void testTest2() throws IOException, InterruptedException { runTest( "test2" ); } public void testTest3() throws IOException, InterruptedException { runTest( "test3" ); } public void testTest4() throws IOException, InterruptedException { runTest( "test4" ); } public void testTest5() throws IOException, InterruptedException { runTest( "test5" ); } public void testTest6() throws IOException, InterruptedException { runTest( "test6" ); } public void testTest7() throws IOException, InterruptedException { runTest( "test7" ); } public void testAutoload() throws IOException, InterruptedException { runTest( "autoload" ); } public void testBoolean() throws IOException, InterruptedException { runTest( "boolean" ); } public void testCalls() throws IOException, InterruptedException { runTest( "calls" ); } public void testCoercions() throws IOException, InterruptedException { runTest( "coercions" ); } public void testCompare() throws IOException, InterruptedException { runTest( "compare" ); } public void testMathLib() throws IOException, InterruptedException { runTest( "mathlib" ); } public void testMetatables() throws IOException, InterruptedException { runTest( "metatables" ); } public void testSelect() throws IOException, InterruptedException { runTest( "select" ); } public void testSetlist() throws IOException, InterruptedException { runTest( "setlist" ); } public void testSimpleMetatables() throws IOException, InterruptedException { runTest( "simplemetatables" ); } public void testStrLib() throws IOException, InterruptedException { runTest( "strlib" ); } public void testType() throws IOException, InterruptedException { runTest( "type" ); } public void testUpvalues() throws IOException, InterruptedException { runTest( "upvalues" ); } public void testUpvalues2() throws IOException, InterruptedException { runTest( "upvalues2" ); } private void runTest( String testName ) throws IOException, InterruptedException { // Reset the _G table just in case some test mucks with it GlobalState.resetGlobals(); // add LuaJava bindings LuaJava.install(); // add LuaCompat bindings LuaCompat.install(); // new lua state StackState state = new DebugStackState(); // load the file Proto p = loadScriptResource( state, testName ); // Replace System.out with a ByteArrayOutputStream ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); Builtin.redirectOutput( outputStream ); try { // create closure and execute Closure c = new Closure( state, p ); state.doCall(c, new LValue[0]); final String actualOutput = new String( outputStream.toByteArray() ); final String expectedOutput = getExpectedOutput( testName ); assertEquals( expectedOutput, actualOutput ); } finally { Builtin.restoreStandardOutput(); outputStream.close(); } } private Proto loadScriptResource( StackState state, String name ) throws IOException { InputStream script = getClass().getResourceAsStream( "/"+name+".luac" ); if ( script == null ) { script = getClass().getResourceAsStream( "/"+name+".lua" ); if ( script == null ) { fail( "Could not load script for test case: "+name ); } } try { return LoadState.undump(state, script, name); } finally { script.close(); } } private String getExpectedOutput( final String testName ) throws IOException, InterruptedException { String expectedOutputName = "/" + testName + "-expected.out"; InputStream is = getClass().getResourceAsStream( expectedOutputName ); if ( is != null ) { try { return readString( is ); } finally { is.close(); } } else { InputStream script; // script = getClass().getResourceAsStream( "/" + testName + ".luac" ); // if ( script == null ) { script = getClass().getResourceAsStream( "/" + testName + ".lua" ); if ( script == null ) { fail( "Could not find script for test case: "+testName ); } // } try { return collectProcessOutput( new String[] { "lua", "-" }, script ); } finally { script.close(); } } } private String collectProcessOutput( String[] cmd, final InputStream input ) throws IOException, InterruptedException { Runtime r = Runtime.getRuntime(); final ByteArrayOutputStream baos = new ByteArrayOutputStream(); final Process p = r.exec( cmd ); try { // start a thread to write the given input to the subprocess. Thread inputCopier = (new Thread() { public void run() { try { OutputStream processStdIn = p.getOutputStream(); try { copy( input, processStdIn ); } finally { processStdIn.close(); } } catch ( IOException e ) { e.printStackTrace(); } } }); inputCopier.start(); // start another thread to read output from the subprocess. Thread outputCopier = (new Thread() { public void run() { try { InputStream processStdOut = p.getInputStream(); try { copy( processStdOut, baos ); } finally { processStdOut.close(); } } catch ( IOException ioe ) { ioe.printStackTrace(); } } }); outputCopier.start(); p.waitFor(); inputCopier.join(); outputCopier.join(); return new String( baos.toByteArray() ); } finally { p.destroy(); } } private String readString( InputStream is ) throws IOException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); copy( is, baos ); return new String( baos.toByteArray() ); } private void copy( InputStream is, OutputStream os ) throws IOException { byte[] buf = new byte[ 1024 ]; int r; while ( ( r = is.read( buf ) ) >= 0 ) { os.write( buf, 0, r ); } } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
96dfca7f34ce45de2edc3b3282fd9f1f73f4b269
0af8b92686a58eb0b64e319b22411432aca7a8f3
/large-multiproject/project9/src/main/java/org/gradle/test/performance9_1/Production9_40.java
68df5354b4e8079b6a4d4fc47aeafcf36da84ff9
[]
no_license
gradle/performance-comparisons
b0d38db37c326e0ce271abebdb3c91769b860799
e53dc7182fafcf9fedf07920cbbea8b40ee4eef4
refs/heads/master
2023-08-14T19:24:39.164276
2022-11-24T05:18:33
2022-11-24T05:18:33
80,121,268
17
15
null
2022-09-30T08:04:35
2017-01-26T14:25:33
null
UTF-8
Java
false
false
297
java
package org.gradle.test.performance9_1; public class Production9_40 extends org.gradle.test.performance5_1.Production5_40 { private final String property; public Production9_40() { this.property = "foo"; } public String getProperty() { return property; } }
[ "cedric.champeau@gmail.com" ]
cedric.champeau@gmail.com
3948077175b5d427c386a81522c3afc5b8a02c8d
2a3adbd1a8cba3434263381997206fa86593cca4
/toceansoft-framework/src/main/java/com/toceansoft/sys/service/SysRoleService.java
6cdc1796cdc1a5398c5523fa2f667f37d83156ac
[]
no_license
narci2010/toceansoft-base
e4590bd190e281d785bc01f5c40840f40f58fdc0
1b5e439e788a13d7a097a0aae92f78c194d9fc46
refs/heads/master
2022-09-11T15:03:29.800126
2019-06-04T09:54:40
2019-06-04T09:54:40
183,211,461
0
0
null
2022-09-01T23:05:50
2019-04-24T11:04:36
JavaScript
UTF-8
Java
false
false
1,411
java
/* * Copyright 2010-2017 Tocean Group. * 版权:商业代码,未经许可,禁止任何形式拷贝、传播及使用 * 文件名:SysRoleService.java * 描述: * 修改人: Narci.Lee * 修改时间:2017年11月22日 * 跟踪单号: * 修改单号: * 修改内容: */ package com.toceansoft.sys.service; import java.util.List; import java.util.Map; import com.toceansoft.sys.entity.SysRoleEntity; /** * 角色 * * @author Narci.Lee * @email admin@toceansoft.com * */ public interface SysRoleService { /** * * @param roleId * Long * @return SysRoleEntity */ SysRoleEntity queryObject(Long roleId); /** * * @param map * Map<String, Object> * @return List<SysRoleEntity> */ List<SysRoleEntity> queryList(Map<String, Object> map); /** * * @param map * (Map<String, Object> * @return int */ int queryTotal(Map<String, Object> map); /** * * @param role * SysRoleEntity */ void save(SysRoleEntity role); /** * * @param role * SysRoleEntity */ void update(SysRoleEntity role); /** * * @param roleIds * (Long[] */ void deleteBatch(Long[] roleIds); /** * 查询用户创建的角色ID列表 * * @param createUserId * Long * @return List<Long> */ List<Long> queryRoleIdList(Long createUserId); }
[ "narci.ltc@toceansoft.com" ]
narci.ltc@toceansoft.com
6bd93bc950963f378092222e4dfada2bfc0adf83
06e6457d8fe8ed8da6222082cda1b97211776fba
/LineaProduccionCP-war/src/java/com/calidadypunto/servlets/HiloBean.java
8d099c165bfb4d4dc2338ecf16439b2458c320de
[]
no_license
faforerof/LineaProduccionCP
4fe9a1ed85b1d92bf6c2840d76d012b7a06e9c91
04a15f85c6a05eb030b6533502b2194e7aa6d21e
refs/heads/master
2020-05-29T17:41:56.135569
2016-09-11T22:23:53
2016-09-11T22:23:53
55,308,972
1
0
null
null
null
null
UTF-8
Java
false
false
6,535
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package com.calidadypunto.servlets; import com.calidadypunto.session.HiloFacade; import javax.faces.bean.ManagedBean; import javax.faces.bean.ViewScoped; import javax.ejb.EJB; import com.calidadypunto.modelo.Hilo; import com.calidadypunto.modelo.Proveedor; import com.calidadypunto.modelo.Referencia; import com.calidadypunto.session.ProveedorFacade; import com.calidadypunto.session.ReferenciaFacade; import com.calidadypunto.utilidades.Utilidades; import java.io.ByteArrayInputStream; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.math.BigDecimal; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.util.ArrayList; import java.util.List; import javax.faces.application.FacesMessage; import javax.faces.context.FacesContext; import org.primefaces.event.FileUploadEvent; import org.primefaces.event.SelectEvent; import org.primefaces.model.DefaultStreamedContent; import org.primefaces.model.StreamedContent; import org.primefaces.model.UploadedFile; /** * * @author lenovo */ @ManagedBean(name="HiloBean") @ViewScoped public class HiloBean { @EJB private HiloFacade hiloFacade; @EJB private ProveedorFacade proveedorFacade; @EJB private ReferenciaFacade referenciaFacade; private List<Referencia> referencias; private List<Proveedor> proveedores; private UploadedFile file; private List<Hilo> hiloList; private Hilo selectedHilo; private Hilo modifyHilo; private StreamedContent fileDownload; private Hilo newHilo; public HiloBean(){ newHilo = new Hilo(); modifyHilo = new Hilo(); } public Hilo getNewHilo() { return newHilo; } public void setNewHilo(Hilo newHilo) { this.newHilo = newHilo; } public UploadedFile getFile() { return file; } public void setFile(UploadedFile file) { this.file = file; } public List<Hilo> getHiloList() { if(hiloList == null || hiloList.isEmpty()){ hiloList = hiloFacade.findAll(); } return hiloList; } public void setHiloList(List<Hilo> hiloList) { this.hiloList = hiloList; } public Hilo getSelectedHilo() { return selectedHilo; } public void setSelectedHilo(Hilo selectedHilo) { this.selectedHilo = selectedHilo; } public Hilo getModifyHilo() { return modifyHilo; } public void setModifyHilo(Hilo modifyHilo) { this.modifyHilo = modifyHilo; } public void onRowSelect(SelectEvent event){ selectedHilo = ((Hilo) event.getObject()); modifyHilo = selectedHilo; } public StreamedContent getFileDownload() throws IOException { InputStream stream = new ByteArrayInputStream(selectedHilo.getDocumento()); File f = File.createTempFile(Utilidades.rellenarCerosIzquierda("0", selectedHilo.getFactura(), 3), "."+selectedHilo.getExtension()); Path path = Paths.get(f.getPath()); fileDownload = new DefaultStreamedContent(stream, Files.probeContentType(path), selectedHilo.getFactura() + "." + selectedHilo.getExtension()); return fileDownload; } public List<Proveedor> completeProveedor(String query) { if(proveedores == null){ proveedores = proveedorFacade.findAll(); } List<Proveedor> proveedoresFiltrados = new ArrayList<>(); for (int i = 0; i < proveedores.size(); i++) { Proveedor proveedor = proveedores.get(i); if(proveedor.getNombreProveedor().toLowerCase().contains(query.toLowerCase()) || proveedor.getNumeroIdProveedor().toLowerCase().startsWith(query)) { proveedoresFiltrados.add(proveedor); } } return proveedoresFiltrados; } public List<Referencia> completeReferencia(String query) { if(referencias == null){ referencias = referenciaFacade.findAll(); } List<Referencia> referenciasFiltradas = new ArrayList<>(); for (int i = 0; i < referencias.size(); i++) { Referencia referencia = referencias.get(i); if(referencia.getNombreReferencia().toLowerCase().contains(query.toLowerCase()) || referencia.getDescripcion().toLowerCase().startsWith(query)) { referenciasFiltradas.add(referencia); } } return referenciasFiltradas; } public void handleFileUpload(FileUploadEvent event) { FacesMessage message = new FacesMessage("Succesful", event.getFile().getFileName() + " is uploaded."); FacesContext.getCurrentInstance().addMessage(null, message); } public String createHilo(){ try{ if(file != null){ newHilo.setDocumento(file.getContents()); String[] nombreArchivo = file.getFileName().split("\\."); newHilo.setExtension(nombreArchivo[nombreArchivo.length-1]); } newHilo.setPesoUsado(new BigDecimal(0)); hiloFacade.create(newHilo); } catch (Exception ex) { addMessage("¡Error!", "No se puede registrar el hilo.", FacesMessage.SEVERITY_ERROR); return ""; } return "home.xhtml?faces-redirect=true"; } public String editHilo(){ try{ if(file != null){ modifyHilo.setDocumento(file.getContents()); String[] nombreArchivo = file.getFileName().split("\\."); modifyHilo.setExtension(nombreArchivo[nombreArchivo.length-1]); } hiloFacade.edit(modifyHilo); } catch (Exception ex) { addMessage("¡Error!", "No se puede modificar el hilo.", FacesMessage.SEVERITY_ERROR); return ""; } return "home.xhtml?faces-redirect=true"; } public void addMessage(String summary, String detail, FacesMessage.Severity severity) { FacesMessage message = new FacesMessage(severity, summary, detail); FacesContext.getCurrentInstance().addMessage(null, message); } }
[ "lenovo@lenovo-PC" ]
lenovo@lenovo-PC
5e424c70d05c353825324e9d17d436123529a4ac
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/4/4_5c987c4e089958721078c99b768e138970bf5b2f/CeylonLog/4_5c987c4e089958721078c99b768e138970bf5b2f_CeylonLog_s.java
c25b2f1f7660f90bb648a562ba9daa273c8be97b
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
1,329
java
package com.redhat.ceylon.compiler.tools; import javax.tools.JavaFileObject; import com.redhat.ceylon.compiler.codegen.CeylonFileObject; import com.sun.tools.javac.util.Context; import com.sun.tools.javac.util.JCDiagnostic; import com.sun.tools.javac.util.Log; import com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition; public class CeylonLog extends Log { /** Get the Log instance for this context. */ public static Log instance(Context context) { Log instance = context.get(logKey); if (instance == null) instance = new CeylonLog(context); return instance; } /** * Register a Context.Factory to create a JavacFileManager. */ public static void preRegister(final Context context) { context.put(logKey, new Context.Factory<Log>() { public Log make() { return new CeylonLog(context); } }); } protected CeylonLog(Context context) { super(context); } @Override public void report(JCDiagnostic diagnostic) { JavaFileObject file = diagnostic.getDiagnosticSource().getFile(); if(file instanceof CeylonFileObject){ ((CeylonFileObject)file).errors++; } super.report(diagnostic); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
d66362b66bf7687a88a6f5d072467032504a3faf
db22bba828ee0118f5766c3a07390cc197d2cc65
/20200315/TestDemo1.java
5ae50a2744e98c6bbeba572e7b7e643b5be2d9b2
[]
no_license
LHJ-123/everydat
4fb3318966f6bd0dcbf550074e96ec1ea425e00c
61e9ac2da2d86559b2a22bc8508ea639d4d41315
refs/heads/master
2022-12-23T13:56:18.976377
2021-03-28T01:09:52
2021-03-28T01:09:52
246,778,966
0
0
null
2022-12-16T00:40:11
2020-03-12T08:15:48
Java
UTF-8
Java
false
false
4,234
java
import java.util.Arrays; import java.util.Scanner; //import java.lang.String; /* public class TestDemo1 { public static void main(String[] args) { int[] array2 = {1,2,3,4,5,6,7,8,9,10}; print(array2); } public static void print(int[] array) { for(int i = 0;i<array.length;i++) { System.out.print(array[i]+" "); } System.out.println(); } } */ /* public class TestDemo1 { public static void main(String[] args) { int[] array2 = {10,20}; System.out.println(array2[0]+" "+array2[1]); swap(array2); System.out.println(array2[0]+" "+array2[1]); } public static void swap(int[] array) { int tmp; tmp = array[1]; array[1] = array[0]; array[0] = tmp; } } */ /* public class TestDemo1 { public static void main(String[] args) { } public static void swap(int[] array) { int tmp; tmp = array[1]; array[1] = array[0]; array[0] = tmp; } } */ /* public class TestDemo1 { public static void main(String[] args) { int[] ret = func2(); System.out.println(Arrays.toString(ret)); } public static int[] func2() { int[] array = {1,2,3,4,5,6}; return array; } } */ /* public class TestDemo1 { public static void main(String[] args) { int[] array = {1,2,3,4,5,6}; System.out.println(myToString(array)); } public static String myToString(int[] array) { String ret = "["; for(int i = 0;i<array.length;i++) { ret = ret+array[i]; if(i!=array.length-1) { ret = ret+","; } } ret =ret+"]"; return ret; } } */ /* public class TestDemo1 { public static void main(String[] args) { int[] array = {1,2,3,4,5,6}; int[] ret = copyArray(array); System.out.println(Arrays.toString(ret)); } public static int[] copyArray(int[] array) { int[] array2 = new int[array.length]; for(int i = 0;i<array.length;i++) { array2[i] = array[i]; } return array2; } } */ /* public class TestDemo1 { public static void main(String[] args) { int[] array = {1,2,3,4,5,6}; double ret = avgArray(array); System.out.println(ret); } public static double avgArray(int[] array) { double ret = 0; for(int i = 0;i<array.length;i++) { ret = ret +array[i]; } double x = ret/(array.length); return x; } } */ /* public class TestDemo1 { public static void main(String[] args) { int[] array = {1,2,3,4,5,6}; int ret = sumArray(array); System.out.println(ret); } public static int sumArray(int[] array) { int ret = 0; for(int i = 0;i<array.length;i++) { ret = ret +array[i]; } return ret; } } */ /* public class TestDemo1 { public static void main(String[] args) { int[] array = {1,2,3,4,5,6}; int[] ret = transformArray(array); System.out.println(Arrays.toString(ret)); } public static int[] transformArray(int[] array) { int[] array2 = new int[array.length]; for(int i = 0;i<array.length;i++) { array2[i] = array[i]*2; } return array2; } } */ /* public class TestDemo1 { public static void main(String[] args) { int[] array = {1,2,3,4,5,6}; printArray(array); } public static void printArray(int[] array) { for(int i = 0;i<array.length;i++) { System.out.println(array[i]); } } } */ /* public class TestDemo1 { public static void main(String[] args) { int[] array = new int[100]; int a = 1; for (int i = 0; i < array.length; i++) { array[i] = a; a++; } for (int i = 0; i < array.length; i++) { System.out.println(array[i]); } } }*/ /* public static void printArray(int[] array) { for(int i = 0;i<array.length;i++) { System.out.println(array[i]); } } } */
[ "15529867019@163.com" ]
15529867019@163.com
2ee803c5763aa0fad4f8e6f4f0f06c6d1643bdba
8ea60c7b73bb5c148ff8c43be87c7ee58b5c53be
/spring-aop/src/main/java/com/gqz/aspectj/expression/thisexpression/ThisAspect.java
30445bc866109e9dae5da7599cc309c92da9d74d
[]
no_license
gqzdev/spring-start
03a3eab534f994c4ec164b1c1c242840bdef84e3
74e3ca4843e9b3f389dbdc415369bab30f55b5b8
refs/heads/master
2020-12-03T18:06:49.903086
2020-06-09T08:54:14
2020-06-09T08:54:14
222,897,870
0
0
null
null
null
null
UTF-8
Java
false
false
947
java
package com.gqz.aspectj.expression.thisexpression; import org.aspectj.lang.annotation.AfterReturning; import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Before; import org.springframework.core.Ordered; /** * @Author zhouguanya * @Date 2018/9/13 * @Description 测试this和target的切面
 */ @Aspect public class ThisAspect implements Ordered { /** * 织入运行期对象为Listener类型的Bean中 */ @AfterReturning("this(com.gqz.aspectj.expression.thisexpression.Listener)") public void after() { System.out.println("ThisAspect after方法执行了"); } @Before("target(com.gqz.aspectj.expression.thisexpression.Listener)") public void before() { System.out.println("ThisAspect before方法执行了"); } /** * 如果有多个切面,注意多切面织入的顺序 */ @Override public int getOrder() { return 1; } }
[ "gqzdev@gmail.com" ]
gqzdev@gmail.com
d34a94b8c84192ff8d94bd2d5f4769b257417cb2
8af1164bac943cef64e41bae312223c3c0e38114
/results-java/google--ExoPlayer/33a2b2d0c55ad9201549e09de48b40410af7a567/after/Mp4WebvttParser.java
c67aa4add6573047b04a5b1cdece1d341476e1d2
[]
no_license
fracz/refactor-extractor
3ae45c97cc63f26d5cb8b92003b12f74cc9973a9
dd5e82bfcc376e74a99e18c2bf54c95676914272
refs/heads/master
2021-01-19T06:50:08.211003
2018-11-30T13:00:57
2018-11-30T13:00:57
87,353,478
0
0
null
null
null
null
UTF-8
Java
false
false
3,804
java
/* * Copyright (C) 2014 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.android.exoplayer.text.mp4webvtt; import com.google.android.exoplayer.ParserException; import com.google.android.exoplayer.text.Cue; import com.google.android.exoplayer.text.SubtitleParser; import com.google.android.exoplayer.util.MimeTypes; import com.google.android.exoplayer.util.ParsableByteArray; import com.google.android.exoplayer.util.Util; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; import java.util.List; /** * A {@link SubtitleParser} for Webvtt embedded in a Mp4 container file. */ public final class Mp4WebvttParser implements SubtitleParser { private static final int BOX_HEADER_SIZE = 8; private static final int TYPE_vttc = Util.getIntegerCodeForString("vttc"); private static final int TYPE_payl = Util.getIntegerCodeForString("payl"); private final ParsableByteArray sampleData; private byte[] inputBytesBuffer; public Mp4WebvttParser() { sampleData = new ParsableByteArray(); } @Override public boolean canParse(String mimeType) { return MimeTypes.APPLICATION_MP4VTT.equals(mimeType); } @Override public Mp4WebvttSubtitle parse(InputStream inputStream) throws IOException { // Webvtt in Mp4 samples have boxes inside of them, so we have to do a traditional box parsing: // first 4 bytes size and then 4 bytes type. int inputStreamByteCount = inputStream.available(); if (inputBytesBuffer == null || inputBytesBuffer.length < inputStreamByteCount) { inputBytesBuffer = new byte[inputStreamByteCount]; } inputStream.read(inputBytesBuffer, 0, inputStreamByteCount); sampleData.reset(inputBytesBuffer, inputStreamByteCount); List<Cue> resultingCueList = new ArrayList<>(); while (sampleData.bytesLeft() > 0) { if (sampleData.bytesLeft() < BOX_HEADER_SIZE) { throw new ParserException("Incomplete Mp4Webvtt Top Level box header found."); } int boxSize = sampleData.readInt(); int boxType = sampleData.readInt(); if (boxType == TYPE_vttc) { resultingCueList.add(parseVttCueBox(sampleData)); } else { // Peers of the VTTCueBox are still not supported and are skipped. sampleData.skipBytes(boxSize - BOX_HEADER_SIZE); } } return new Mp4WebvttSubtitle(resultingCueList); } private static Cue parseVttCueBox(ParsableByteArray sampleData) throws IOException { while (sampleData.bytesLeft() > 0) { if (sampleData.bytesLeft() < BOX_HEADER_SIZE) { throw new ParserException("Incomplete vtt cue box header found."); } int boxSize = sampleData.readInt(); int boxType = sampleData.readInt(); if (boxType == TYPE_payl) { int payloadLength = boxSize - BOX_HEADER_SIZE; String cueText = new String(sampleData.data, sampleData.getPosition(), payloadLength); sampleData.skipBytes(payloadLength); return new Cue(cueText.trim()); } else { // Other VTTCueBox children are still not supported and are skipped. sampleData.skipBytes(boxSize - BOX_HEADER_SIZE); } } throw new ParserException("VTTCueBox does not contain mandatory payload box."); } }
[ "fraczwojciech@gmail.com" ]
fraczwojciech@gmail.com
b887ddd157b4dea06f427848fe8bba65009f4884
647ec12ce50f06e7380fdbfb5b71e9e2d1ac03b4
/com.tencent.minihd.qq/assets/exlibs.1.jar/classes.jar/tencent/im/oidb/cmd0x614/Oidb_0x614$DeviceManageHead.java
c68efa0053e38e57dce7181f560219403dd8caad
[]
no_license
tsuzcx/qq_apk
0d5e792c3c7351ab781957bac465c55c505caf61
afe46ef5640d0ba6850cdefd3c11badbd725a3f6
refs/heads/main
2022-07-02T10:32:11.651957
2022-02-01T12:41:38
2022-02-01T12:41:38
453,860,108
36
9
null
2022-01-31T09:46:26
2022-01-31T02:43:22
Java
UTF-8
Java
false
false
2,206
java
package tencent.im.oidb.cmd0x614; import com.tencent.mobileqq.pb.ByteStringMicro; import com.tencent.mobileqq.pb.MessageMicro; import com.tencent.mobileqq.pb.MessageMicro.FieldMap; import com.tencent.mobileqq.pb.PBBytesField; import com.tencent.mobileqq.pb.PBField; import com.tencent.mobileqq.pb.PBUInt32Field; import com.tencent.mobileqq.pb.PBUInt64Field; public final class Oidb_0x614$DeviceManageHead extends MessageMicro { public static final int BYTES_APPNAME_FIELD_NUMBER = 7; public static final int BYTES_GUID_FIELD_NUMBER = 4; public static final int UINT32_APPID_FIELD_NUMBER = 5; public static final int UINT32_CMD_FIELD_NUMBER = 1; public static final int UINT32_RESULT_FIELD_NUMBER = 2; public static final int UINT32_SUBAPPID_FIELD_NUMBER = 6; public static final int UINT64_UIN_FIELD_NUMBER = 3; static final MessageMicro.FieldMap __fieldMap__; public final PBBytesField bytes_appname = PBField.initBytes(ByteStringMicro.EMPTY); public final PBBytesField bytes_guid = PBField.initBytes(ByteStringMicro.EMPTY); public final PBUInt32Field uint32_appid = PBField.initUInt32(0); public final PBUInt32Field uint32_cmd = PBField.initUInt32(0); public final PBUInt32Field uint32_result = PBField.initUInt32(0); public final PBUInt32Field uint32_subappid = PBField.initUInt32(0); public final PBUInt64Field uint64_uin = PBField.initUInt64(0L); static { ByteStringMicro localByteStringMicro1 = ByteStringMicro.EMPTY; ByteStringMicro localByteStringMicro2 = ByteStringMicro.EMPTY; __fieldMap__ = MessageMicro.initFieldMap(new int[] { 8, 16, 24, 34, 40, 48, 58 }, new String[] { "uint32_cmd", "uint32_result", "uint64_uin", "bytes_guid", "uint32_appid", "uint32_subappid", "bytes_appname" }, new Object[] { Integer.valueOf(0), Integer.valueOf(0), Long.valueOf(0L), localByteStringMicro1, Integer.valueOf(0), Integer.valueOf(0), localByteStringMicro2 }, DeviceManageHead.class); } } /* Location: L:\local\mybackup\temp\qq_apk\com.tencent.minihd.qq\assets\exlibs.1.jar\classes.jar * Qualified Name: tencent.im.oidb.cmd0x614.Oidb_0x614.DeviceManageHead * JD-Core Version: 0.7.0.1 */
[ "98632993+tsuzcx@users.noreply.github.com" ]
98632993+tsuzcx@users.noreply.github.com
c139f70e748abcfb61a9c7b715e7ebb21d5e5002
1095fea85170be0fead52a277f7c5c2661c747ff
/rs3 files/876 Deob Less Renamed/source/com/jagex/Class711.java
f459e3f2ee0e269511278cf2d31286ebd6e68164
[ "Apache-2.0" ]
permissive
emcry666/project-scape
fed5d533f561cb06b3187ea116ff2692b840b6b7
827d213f129a9fd266cf42e7412402609191c484
refs/heads/master
2021-09-01T01:01:40.472745
2017-12-23T19:55:02
2017-12-23T19:55:02
114,505,346
0
0
null
null
null
null
UTF-8
Java
false
false
2,570
java
/* Class711 - Decompiled by JODE * Visit http://jode.sourceforge.net/ */ package com.jagex; public class Class711 implements Interface75 { static Class711 aClass711_8841 = new Class711(-1); public static Class711 aClass711_8842 = new Class711(-2); public static Class711 aClass711_8843 = new Class711(-3); static Class711 aClass711_8844 = new Class711(-4); public static Class711 aClass711_8845 = new Class711(-5); static Class711 aClass711_8846; static Class711 aClass711_8847; static Class711 aClass711_8848; static Class711 aClass711_8849; int anInt8850; public static Class711 aClass711_8851 = new Class711(2); public static Class711[] method14324() { return new Class711[] { aClass711_8845, aClass711_8846, aClass711_8851, aClass711_8848, aClass711_8847, aClass711_8849, aClass711_8843, aClass711_8842, aClass711_8841, aClass711_8844 }; } public int method82() { return anInt8850 * 1043043337; } static { aClass711_8847 = new Class711(3); aClass711_8848 = new Class711(7); aClass711_8849 = new Class711(9); aClass711_8846 = new Class711(37); } public int method6() { return anInt8850 * 1043043337; } public int method101() { return anInt8850 * 1043043337; } Class711(int i) { anInt8850 = i * 657603129; } public static String method14325(long l, int i, short i_0_) { Class17.method776(l); int i_1_ = Class91.aCalendar893.get(5); int i_2_ = Class91.aCalendar893.get(2); int i_3_ = Class91.aCalendar893.get(1); if (i == 3) return Class477.method7890(l, i, -2095769947); return new StringBuilder().append(Integer.toString(i_1_ / 10)).append(i_1_ % 10).append("-").append(Class91.aStringArrayArray892[i][i_2_]).append("-").append(i_3_).toString(); } static Class577[] method14326(int i) { return (new Class577[] { Class577.aClass577_7698, Class577.aClass577_7699 }); } static final void method14327(Class250 class250, Class242 class242, Class669 class669, byte i) { class250.method4501(-1200468114); } public static Class384 method14328(Class523_Sub34 class523_sub34, byte i) { Class384 class384 = Class2.method514(class523_sub34, -192467867); int i_4_ = class523_sub34.readUnsignedInt((byte) -85); int i_5_ = class523_sub34.readUnsignedInt((byte) -41); return new Class384_Sub3(class384.aClass380_3974, class384.aClass389_3968, class384.anInt3970 * 1653743623, class384.anInt3969 * -1732272073, class384.anInt3971 * 1773515723, -1825534571 * class384.anInt3972, -913347581 * class384.anInt3973, -2021763229 * class384.anInt3967, class384.anInt3975 * -495047775, i_4_, i_5_); } }
[ "34613829+emcry666@users.noreply.github.com" ]
34613829+emcry666@users.noreply.github.com
b0463277eb9a0e1a8a0246c6fa4275978b531743
9254e7279570ac8ef687c416a79bb472146e9b35
/live-20161101/src/main/java/com/aliyun/live20161101/models/DescribeCasterComponentsResponse.java
0e8b902eeb3a81953e488bb36da4b7c1c7fa8e91
[ "Apache-2.0" ]
permissive
lquterqtd/alibabacloud-java-sdk
3eaa17276dd28004dae6f87e763e13eb90c30032
3e5dca8c36398469e10cdaaa34c314ae0bb640b4
refs/heads/master
2023-08-12T13:56:26.379027
2021-10-19T07:22:15
2021-10-19T07:22:15
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,143
java
// This file is auto-generated, don't edit it. Thanks. package com.aliyun.live20161101.models; import com.aliyun.tea.*; public class DescribeCasterComponentsResponse extends TeaModel { @NameInMap("headers") @Validation(required = true) public java.util.Map<String, String> headers; @NameInMap("body") @Validation(required = true) public DescribeCasterComponentsResponseBody body; public static DescribeCasterComponentsResponse build(java.util.Map<String, ?> map) throws Exception { DescribeCasterComponentsResponse self = new DescribeCasterComponentsResponse(); return TeaModel.build(map, self); } public DescribeCasterComponentsResponse setHeaders(java.util.Map<String, String> headers) { this.headers = headers; return this; } public java.util.Map<String, String> getHeaders() { return this.headers; } public DescribeCasterComponentsResponse setBody(DescribeCasterComponentsResponseBody body) { this.body = body; return this; } public DescribeCasterComponentsResponseBody getBody() { return this.body; } }
[ "sdk-team@alibabacloud.com" ]
sdk-team@alibabacloud.com
f95e5f8af648226e1ceba1a03bc144e5ce27adf3
9712719aa7118e18dfe8b7284b5985bbe53b187e
/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1LeaseSpec.java
03945dc0e238a409f692c498af65c02cb6eec0fb
[ "Apache-2.0" ]
permissive
infa-vdasaraj/java
d8a8f22b74d9f1fbc967f454ed5530aabb6a0294
1cf980f74314973e8e0f219aeb39e018dbbb85ab
refs/heads/master
2022-06-19T10:41:29.940566
2020-05-06T23:52:51
2020-05-06T23:52:51
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,587
java
/* * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: release-1.16 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ package io.kubernetes.client.openapi.models; import java.util.Objects; import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import org.joda.time.DateTime; /** * LeaseSpec is a specification of a Lease. */ @ApiModel(description = "LeaseSpec is a specification of a Lease.") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2020-04-29T07:27:12.312Z[Etc/UTC]") public class V1LeaseSpec { public static final String SERIALIZED_NAME_ACQUIRE_TIME = "acquireTime"; @SerializedName(SERIALIZED_NAME_ACQUIRE_TIME) private DateTime acquireTime; public static final String SERIALIZED_NAME_HOLDER_IDENTITY = "holderIdentity"; @SerializedName(SERIALIZED_NAME_HOLDER_IDENTITY) private String holderIdentity; public static final String SERIALIZED_NAME_LEASE_DURATION_SECONDS = "leaseDurationSeconds"; @SerializedName(SERIALIZED_NAME_LEASE_DURATION_SECONDS) private Integer leaseDurationSeconds; public static final String SERIALIZED_NAME_LEASE_TRANSITIONS = "leaseTransitions"; @SerializedName(SERIALIZED_NAME_LEASE_TRANSITIONS) private Integer leaseTransitions; public static final String SERIALIZED_NAME_RENEW_TIME = "renewTime"; @SerializedName(SERIALIZED_NAME_RENEW_TIME) private DateTime renewTime; public V1LeaseSpec acquireTime(DateTime acquireTime) { this.acquireTime = acquireTime; return this; } /** * acquireTime is a time when the current lease was acquired. * @return acquireTime **/ @javax.annotation.Nullable @ApiModelProperty(value = "acquireTime is a time when the current lease was acquired.") public DateTime getAcquireTime() { return acquireTime; } public void setAcquireTime(DateTime acquireTime) { this.acquireTime = acquireTime; } public V1LeaseSpec holderIdentity(String holderIdentity) { this.holderIdentity = holderIdentity; return this; } /** * holderIdentity contains the identity of the holder of a current lease. * @return holderIdentity **/ @javax.annotation.Nullable @ApiModelProperty(value = "holderIdentity contains the identity of the holder of a current lease.") public String getHolderIdentity() { return holderIdentity; } public void setHolderIdentity(String holderIdentity) { this.holderIdentity = holderIdentity; } public V1LeaseSpec leaseDurationSeconds(Integer leaseDurationSeconds) { this.leaseDurationSeconds = leaseDurationSeconds; return this; } /** * leaseDurationSeconds is a duration that candidates for a lease need to wait to force acquire it. This is measure against time of last observed RenewTime. * @return leaseDurationSeconds **/ @javax.annotation.Nullable @ApiModelProperty(value = "leaseDurationSeconds is a duration that candidates for a lease need to wait to force acquire it. This is measure against time of last observed RenewTime.") public Integer getLeaseDurationSeconds() { return leaseDurationSeconds; } public void setLeaseDurationSeconds(Integer leaseDurationSeconds) { this.leaseDurationSeconds = leaseDurationSeconds; } public V1LeaseSpec leaseTransitions(Integer leaseTransitions) { this.leaseTransitions = leaseTransitions; return this; } /** * leaseTransitions is the number of transitions of a lease between holders. * @return leaseTransitions **/ @javax.annotation.Nullable @ApiModelProperty(value = "leaseTransitions is the number of transitions of a lease between holders.") public Integer getLeaseTransitions() { return leaseTransitions; } public void setLeaseTransitions(Integer leaseTransitions) { this.leaseTransitions = leaseTransitions; } public V1LeaseSpec renewTime(DateTime renewTime) { this.renewTime = renewTime; return this; } /** * renewTime is a time when the current holder of a lease has last updated the lease. * @return renewTime **/ @javax.annotation.Nullable @ApiModelProperty(value = "renewTime is a time when the current holder of a lease has last updated the lease.") public DateTime getRenewTime() { return renewTime; } public void setRenewTime(DateTime renewTime) { this.renewTime = renewTime; } @Override public boolean equals(java.lang.Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } V1LeaseSpec v1LeaseSpec = (V1LeaseSpec) o; return Objects.equals(this.acquireTime, v1LeaseSpec.acquireTime) && Objects.equals(this.holderIdentity, v1LeaseSpec.holderIdentity) && Objects.equals(this.leaseDurationSeconds, v1LeaseSpec.leaseDurationSeconds) && Objects.equals(this.leaseTransitions, v1LeaseSpec.leaseTransitions) && Objects.equals(this.renewTime, v1LeaseSpec.renewTime); } @Override public int hashCode() { return Objects.hash(acquireTime, holderIdentity, leaseDurationSeconds, leaseTransitions, renewTime); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class V1LeaseSpec {\n"); sb.append(" acquireTime: ").append(toIndentedString(acquireTime)).append("\n"); sb.append(" holderIdentity: ").append(toIndentedString(holderIdentity)).append("\n"); sb.append(" leaseDurationSeconds: ").append(toIndentedString(leaseDurationSeconds)).append("\n"); sb.append(" leaseTransitions: ").append(toIndentedString(leaseTransitions)).append("\n"); sb.append(" renewTime: ").append(toIndentedString(renewTime)).append("\n"); sb.append("}"); return sb.toString(); } /** * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } }
[ "291271447@qq.com" ]
291271447@qq.com
eb746f472caa69ddb00ed7ba319e21c57499a72f
d669e67a5cfd22363b20cc7dc1c56fcb230454ec
/src/davi/mutation/mediana/VDL_4/Mediana.java
bef56d426e05024f9e1db7efaff0e076a7d14b7b
[ "Apache-2.0" ]
permissive
DaviSRodrigues/TAIGA
f1fe37583bd5009fa0ee192954d0c5ce5d051ee0
7997a8e4a31a177335178571a443b03f1bf3f2e4
refs/heads/master
2022-04-10T16:11:10.871395
2020-03-09T14:34:04
2020-03-09T14:34:04
101,459,116
0
0
null
null
null
null
UTF-8
Java
false
false
2,126
java
// This is a mutant program. // Author : ysma package davi.mutation.mediana.VDL_4; import java.awt.image.WritableRaster; import java.util.Arrays; import davi.genetic.algorithm.Image; public class Mediana { public static void main( java.lang.String[] args ) throws java.lang.Exception { } public static davi.genetic.algorithm.Image aplicaFiltro( davi.genetic.algorithm.Image img ) { try { int p1; int p2; int p3; int p4; int p5; int p6; int p7; int p8; int p9; int mediana; int altura = img.getHeight(); int largura = img.getWidth(); java.awt.image.WritableRaster raster = img.getBufferedImage().getRaster(); for (int i = 1; i <= altura - 2; i++) { for (int j = 1; j <= 2; j++) { p1 = raster.getSample( j, i, 0 ); p2 = raster.getSample( j, i - 1, 0 ); p3 = raster.getSample( j + 1, i - 1, 0 ); p4 = raster.getSample( j + 1, i, 0 ); p5 = raster.getSample( j + 1, i + 1, 0 ); p6 = raster.getSample( j, i + 1, 0 ); p7 = raster.getSample( j - 1, i + 1, 0 ); p8 = raster.getSample( j - 1, i, 0 ); p9 = raster.getSample( j - 1, i - 1, 0 ); int[] vizinhanca = { p1, p2, p3, p4, p5, p6, p7, p8, p9 }; Arrays.sort( vizinhanca ); mediana = vizinhanca[vizinhanca.length / 2]; raster.setSample( j, i, 0, mediana ); verificaTimeout(); } verificaTimeout(); } } catch ( java.lang.Exception e ) { return null; } return img; } public static void verificaTimeout() throws java.lang.InterruptedException { if (Thread.currentThread().isInterrupted()) { throw new java.lang.InterruptedException(); } } }
[ "davisilvarodrigues@gmail.com" ]
davisilvarodrigues@gmail.com
2f7de5dc2e85f78cac37c9599842cc87c7365c0d
c4fc44747591d09c91870f6547b4258d4a73cdf2
/src/jsocks/net/sourceforge/jsocks/socks/Socks4Proxy.java
c18c77cb11cf5b8030f48b4c875ec9fdef7291a0
[ "MIT", "LicenseRef-scancode-warranty-disclaimer" ]
permissive
wknishio/variable-terminal
2c3aa7a182662df5c13e026471338d43142690a7
83eedc7ed37fed6859a5ed3355aa3685ed589f1a
refs/heads/master
2023-09-03T11:11:24.946980
2023-09-02T15:29:05
2023-09-02T15:29:05
37,862,908
1
0
null
null
null
null
UTF-8
Java
false
false
4,449
java
/******************************************************************************* * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. *******************************************************************************/ package net.sourceforge.jsocks.socks; import java.io.*; import java.net.*; /** * Proxy which describes SOCKS4 proxy. */ public class Socks4Proxy extends Proxy implements Cloneable { // Data members String user; // Public Constructors // ==================== /** * Creates the SOCKS4 proxy * * @param p * Proxy to use to connect to this proxy, allows proxy chaining. * @param proxyHost * Address of the proxy server. * @param proxyPort * Port of the proxy server * @param user * User name to use for identification purposes. * @throws UnknownHostException * If proxyHost can't be resolved. */ public Socks4Proxy(Proxy p, String proxyHost, int proxyPort, String user) throws UnknownHostException { super(p, proxyHost, proxyPort); this.user = new String(user); version = 4; } /** * Creates the SOCKS4 proxy * * @param proxyHost * Address of the proxy server. * @param proxyPort * Port of the proxy server * @param user * User name to use for identification purposes. * @throws UnknownHostException * If proxyHost can't be resolved. */ public Socks4Proxy(String proxyHost, int proxyPort, String user) throws UnknownHostException { this(null, proxyHost, proxyPort, user); } /** * Creates the SOCKS4 proxy * * @param p * Proxy to use to connect to this proxy, allows proxy chaining. * @param proxyIP * Address of the proxy server. * @param proxyPort * Port of the proxy server * @param user * User name to use for identification purposes. */ public Socks4Proxy(Proxy p, InetAddress proxyIP, int proxyPort, String user) { super(p, proxyIP, proxyPort); this.user = new String(user); version = 4; } /** * Creates the SOCKS4 proxy * * @param proxyIP * Address of the proxy server. * @param proxyPort * Port of the proxy server * @param user * User name to use for identification purposes. */ public Socks4Proxy(InetAddress proxyIP, int proxyPort, String user) { this(null, proxyIP, proxyPort, user); } // Public instance methods // ======================== /** * Creates a clone of this proxy. Changes made to the clone should not affect * this object. */ public Object clone() { Socks4Proxy newProxy = new Socks4Proxy(proxyIP, proxyPort, user); newProxy.directHosts = (InetRange) directHosts.clone(); newProxy.chainProxy = chainProxy; return newProxy; } // Public Static(Class) Methods // ============================== // Protected Methods // ================= protected Proxy copy() { Socks4Proxy copy = new Socks4Proxy(proxyIP, proxyPort, user); copy.directHosts = this.directHosts; copy.chainProxy = chainProxy; return copy; } protected ProxyMessage formMessage(int cmd, InetAddress ip, int port) { switch (cmd) { case SOCKS_CMD_CONNECT: cmd = Socks4Message.REQUEST_CONNECT; break; case SOCKS_CMD_BIND: cmd = Socks4Message.REQUEST_BIND; break; default: return null; } return new Socks4Message(cmd, ip, port, user); } protected ProxyMessage formMessage(int cmd, String host, int port) throws UnknownHostException { return formMessage(cmd, InetAddress.getByName(host), port); } protected ProxyMessage formMessage(InputStream in) throws SocksException, IOException { return new Socks4Message(in, true); } }
[ "wknishio@gmail.com" ]
wknishio@gmail.com
61d15dfd5660da63eefd127ce30101b0fd2ffcd9
0a272b8f87912788a5507989308e28e1bec13bd7
/src/br/com/carlosrafaelgn/fplay/ActivityAbout.java
ef1884abeb0adfa54ebd937359c36028b7e88f43
[ "BSD-2-Clause-Views", "CC-BY-3.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
kishanDevani/FPlayAndroid
28fcfd5483e924dd17b15741319dd83e880f4093
3da0b24d2322a8cfac8ff051d2e29fc15dc3e64a
refs/heads/master
2021-01-18T01:35:30.115765
2014-09-13T13:52:20
2014-09-13T13:52:20
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,921
java
// // FPlayAndroid is distributed under the FreeBSD License // // Copyright (c) 2013-2014, Carlos Rafael Gimenes das Neves // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // // 1. Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // The views and conclusions contained in the software and documentation are those // of the authors and should not be interpreted as representing official policies, // either expressed or implied, of the FreeBSD Project. // // https://github.com/carlosrafaelgn/FPlayAndroid // package br.com.carlosrafaelgn.fplay; import android.content.pm.PackageInfo; import android.os.Build; import android.text.util.Linkify; import android.util.TypedValue; import android.view.View; import android.widget.ScrollView; import android.widget.TextView; import br.com.carlosrafaelgn.fplay.activity.ClientActivity; import br.com.carlosrafaelgn.fplay.ui.BgButton; import br.com.carlosrafaelgn.fplay.ui.SongAddingMonitor; import br.com.carlosrafaelgn.fplay.ui.UI; import br.com.carlosrafaelgn.fplay.ui.drawable.ColorDrawable; public final class ActivityAbout extends ClientActivity implements View.OnClickListener { private ScrollView list; private BgButton btnGoBack; @SuppressWarnings("deprecation") @Override protected void onCreateLayout(boolean firstCreation) { setContentView(R.layout.activity_about); btnGoBack = (BgButton)findViewById(R.id.btnGoBack); btnGoBack.setOnClickListener(this); btnGoBack.setIcon(UI.ICON_GOBACK); list = (ScrollView)findViewById(R.id.list); list.setHorizontalFadingEdgeEnabled(false); list.setVerticalFadingEdgeEnabled(false); list.setFadingEdgeLength(0); list.setBackgroundDrawable(new ColorDrawable(UI.color_list)); final TextView lblTitle = (TextView)findViewById(R.id.lblTitle); lblTitle.setText("FPlay"); UI.largeTextAndColor(lblTitle); final TextView lblVersion = (TextView)findViewById(R.id.lblVersion); UI.smallTextAndColor(lblVersion); try { final PackageInfo inf = getApplication().getPackageManager().getPackageInfo(getApplication().getPackageName(), 0); lblVersion.setText("v" + inf.versionName); } catch (Throwable e) { } UI.smallTextAndColor((TextView)findViewById(R.id.lblAppBy)); final TextView lblMsg = (TextView)findViewById(R.id.lblMsg); final StringBuilder sb = new StringBuilder(1024); sb.append(getText(R.string.app_more_info)); sb.append(getText(R.string.app_more_info2)); sb.append(getText(R.string.app_license)); lblMsg.setAutoLinkMask(Linkify.EMAIL_ADDRESSES | Linkify.WEB_URLS); lblMsg.setLinksClickable(true); lblMsg.setText(sb.toString()); lblMsg.setLinkTextColor(UI.color_text_listitem_secondary); UI.smallText(lblMsg); lblMsg.setTextColor(UI.colorState_text_listitem_static); final TextView lblDbg = (TextView)findViewById(R.id.lblDbg); sb.delete(0, sb.length()); sb.append(getText(R.string.system_info)); sb.append("\nABI: "); sb.append(Build.CPU_ABI); sb.append("\nAPI: "); sb.append(Build.VERSION.SDK_INT); sb.append("\nDPI: "); sb.append(UI.densityDpi); sb.append("\ndp: "); sb.append(UI.formatIntAsFloat((int)(UI.density * 100.0f), true, true)); sb.append("\nsp: "); sb.append(UI.formatIntAsFloat((int)(UI.scaledDensity * 100.0f), true, true)); sb.append("\n" + getText(R.string.resolution) + " (px): "); sb.append(UI.screenWidth); sb.append(" x "); sb.append(UI.screenHeight); sb.append("\n" + getText(R.string.resolution) + " (dp): "); sb.append(UI.formatIntAsFloat((int)(UI.pxToDp(UI.screenWidth) * 100.0f), true, true)); sb.append(" x "); sb.append(UI.formatIntAsFloat((int)(UI.pxToDp(UI.screenHeight) * 100.0f), true, true)); if (UI.isLowDpiScreen) sb.append("\nLDPI"); if (UI.isLargeScreen) sb.append("\nLarge Screen"); lblDbg.setTypeface(UI.defaultTypeface); lblDbg.setTextColor(UI.colorState_text_listitem_secondary_static); lblDbg.setTextSize(TypedValue.COMPLEX_UNIT_PX, UI._14sp); lblDbg.setText(sb.toString()); if (UI.isLargeScreen) { UI.prepareViewPaddingForLargeScreen(list, 0, 0); lblMsg.setTextSize(TypedValue.COMPLEX_UNIT_PX, UI._18sp); } UI.prepareControlContainer(findViewById(R.id.panelControls), false, true); UI.prepareEdgeEffectColor(getApplication()); } @Override protected void onPause() { SongAddingMonitor.stop(); } @Override protected void onResume() { SongAddingMonitor.start(getHostActivity()); } @Override protected void onOrientationChanged() { if (UI.isLargeScreen && list != null) UI.prepareViewPaddingForLargeScreen(list, 0, 0); } @Override protected void onCleanupLayout() { list = null; btnGoBack = null; } @Override public void onClick(View view) { if (view == btnGoBack) { finish(); } } }
[ "carlosrafael.prog@gmail.com" ]
carlosrafael.prog@gmail.com
41b744c4ed8a86ff6f5da511e17efd17eeb67b0a
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/15/15_ad222d4308327f1cce34b0af3e65ad6d297564db/__artifactId__/15_ad222d4308327f1cce34b0af3e65ad6d297564db___artifactId___s.java
d767beb41a0a41eae993ac2fd84abfd69e39bba6
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
1,377
java
package ${package}; import ${package}.commands.PlayerCommands; import org.spout.api.Spout; import org.spout.api.command.CommandRegistrationsFactory; import org.spout.api.command.RootCommand; import org.spout.api.command.annotated.AnnotatedCommandRegistrationFactory; import org.spout.api.command.annotated.SimpleAnnotatedCommandExecutorFactory; import org.spout.api.command.annotated.SimpleInjector; import org.spout.api.plugin.CommonPlugin; /** * If you have found this useful, please let me know. * @author Craig <tenowg at thedemgel.com> */ public class ${artifactId} extends CommonPlugin { private static ${artifactId} instance; @Override public void onEnable() { //Commands CommandRegistrationsFactory<Class<?>> commandRegFactory = new AnnotatedCommandRegistrationFactory(new SimpleInjector(this), new SimpleAnnotatedCommandExecutorFactory()); RootCommand root = getEngine().getRootCommand(); root.addSubCommands(this, PlayerCommands.class, commandRegFactory); getEngine().getEventManager().registerEvents(new EListener(this), this); Spout.getLogger().info("enabled."); } @Override public void onDisable() { Spout.getLogger().info("disabled."); } private static void setInstance(${artifactId} plugin) { instance = plugin; } public static ${artifactId} getInstance() { return instance; } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
4d0900d0ae8a65e2da7ee36d43bf23bc6a6a2fa1
2da87d8ef7afa718de7efa72e16848799c73029f
/ikep4-collpack/src/main/java/com/lgcns/ikep4/collpack/kms/restful/model/KmsItemViewHead.java
ccdb359eaa543300ce03838aa8c2f097ad3f9497
[]
no_license
haifeiforwork/ehr-moo
d3ee29e2cae688f343164384958f3560255e52b2
921ff597b316a9a0111ed4db1d5b63b88838d331
refs/heads/master
2020-05-03T02:34:00.078388
2018-04-05T00:54:04
2018-04-05T00:54:04
178,373,434
0
1
null
2019-03-29T09:21:01
2019-03-29T09:21:01
null
UTF-8
Java
false
false
505
java
package com.lgcns.ikep4.collpack.kms.restful.model; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import com.lgcns.ikep4.support.restful.model.Head; @XmlRootElement(name="Root") public class KmsItemViewHead { @XmlElement(name="header") public Head head; @XmlElement(name="body") public KmsItemViewBody body; public KmsItemViewHead() {} public KmsItemViewHead(Head head, KmsItemViewBody body) { this.head = head; this.body = body; } }
[ "haneul9@gmail.com" ]
haneul9@gmail.com
bf1293accaf069c7883d599af9ea55f70fe2a18f
7bc975c929eedca0d2254360360b7f021749ae7f
/src/main/java/com/redxun/sys/transset/manager/SysTransferSettingManager.java
5d82d1f139b3f48b923aa2c0289bf99b0abaaf0c
[]
no_license
liaosheng2018/jsaas-1
7d6e5a10b9bf22e4e6793a4efe3c783fb4afc621
0fd2df00b4680c92500429bd800b1806b816002d
refs/heads/master
2022-03-10T12:22:51.907294
2019-11-29T07:11:11
2019-11-29T07:11:11
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,843
java
package com.redxun.sys.transset.manager; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.annotation.Resource; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.stereotype.Service; import com.redxun.core.dao.IDao; import com.redxun.core.entity.KeyValEnt; import com.redxun.core.manager.MybatisBaseManager; import com.redxun.core.script.GroovyEngine; import com.redxun.core.util.BeanUtil; import com.redxun.core.util.StringUtil; import com.redxun.saweb.util.IdUtil; import com.redxun.sys.org.entity.OsUser; import com.redxun.sys.org.manager.OsUserManager; import com.redxun.sys.translog.dao.SysTransferLogDao; import com.redxun.sys.translog.entity.SysTransferLog; import com.redxun.sys.transset.dao.SysTransferSettingDao; import com.redxun.sys.transset.entity.SysTransferSetting; import net.sf.json.JSONArray; import net.sf.json.JSONObject; /** * * <pre> * 描述:权限转移设置表 处理接口 * 作者:mansan * 日期:2018-06-20 17:12:34 * 版权:广州红迅软件 * </pre> */ @Service public class SysTransferSettingManager extends MybatisBaseManager<SysTransferSetting>{ @Resource private SysTransferSettingDao sysTransferSettingDao; @Resource private SysTransferLogDao sysTransferLogDao; @Resource private JdbcTemplate jdbcTemplate; @Resource private OsUserManager osUserManager; @Resource GroovyEngine groovyEngine; public static String IDS = "{ids}"; public static String NAMES = "{names}"; public static String TARGET_PERSONID = "{targetPersonId}"; public static String TARGET_PERSONNAME = "{targetPersonName}"; public static String AUTHOR_ID = "{authorId}"; public static String AUTHOR_NAME = "{authorName}"; @SuppressWarnings("rawtypes") @Override protected IDao getDao() { return sysTransferSettingDao; } public SysTransferSetting getSysTransferSetting(String uId){ SysTransferSetting sysTransferSetting = get(uId); return sysTransferSetting; } @Override public void create(SysTransferSetting entity) { entity.setId(IdUtil.getId()); super.create(entity); } @Override public void update(SysTransferSetting entity) { super.update(entity); } public List<KeyValEnt> getHandlers() { List<KeyValEnt> list=new ArrayList<KeyValEnt>(); list.add(new KeyValEnt(AUTHOR_ID,"授权人ID")); list.add(new KeyValEnt(AUTHOR_NAME,"授权人名称")); list.add(new KeyValEnt(TARGET_PERSONID,"目的人ID")); list.add(new KeyValEnt(TARGET_PERSONNAME,"目的人名称")); list.add(new KeyValEnt(IDS,"所选ID列表,‘,’分割")); list.add(new KeyValEnt(NAMES,"所选NAME列表,‘,’分割")); return list; } public List<Map<String,Object>> excuteSelectSql(SysTransferSetting sysTransDef, String authorId) { Map<String, Object> map = new HashMap<String, Object>(); String sql=(String)groovyEngine.executeScripts(sysTransDef .getSelectSql().replace(AUTHOR_ID, authorId), map); //获取SQL if (StringUtil.isEmpty(sql)) { return new ArrayList<Map<String,Object>>(); } List<Map<String,Object>> l = jdbcTemplate.queryForList(sql); return l; } public void excuteUpdateSql(SysTransferSetting sysTransDef, OsUser author, OsUser targetPerson, String selectedItem) { JSONArray selectedItemJa = JSONArray.fromObject(selectedItem); StringBuffer ids = new StringBuffer(); StringBuffer names = new StringBuffer(); for (int i = 0; i < selectedItemJa.size(); i++) { if (ids.length() != 0) { ids.append(","); names.append(","); } JSONObject jo = selectedItemJa.getJSONObject(i); ids.append(jo.getString("id")); names.append(jo.getString("name")); } // 替代sql String updateSql = sysTransDef .getUpdateSql() .replace(AUTHOR_ID, author.getUserId().toString()) .replace(TARGET_PERSONID, targetPerson.getUserId().toString()) .replace(IDS, ids.toString()) .replace(NAMES, names.toString()) .replace(AUTHOR_NAME, author.getFullname()) .replace(TARGET_PERSONNAME, targetPerson.getFullname()) .replace(AUTHOR_ID, author.getUserId().toString()) .replace(TARGET_PERSONID, targetPerson.getUserId().toString()) .replace(IDS, ids.toString()) .replace(AUTHOR_NAME, author.getFullname()) .replace(TARGET_PERSONNAME, targetPerson.getFullname()); String sql=(String)groovyEngine.executeScripts(updateSql, new HashMap<String, Object>()); //获取SQL if (StringUtil.isNotEmpty(sql)) { jdbcTemplate.execute(sql); String authorId = author.getUserId(); String targetPersonId = targetPerson.getUserId(); String content = getLogContent(sysTransDef, authorId, targetPersonId, selectedItem); SysTransferLog entity = new SysTransferLog(); entity.setId(IdUtil.getId()); entity.setAuthorPerson(authorId); entity.setOpDescp(content); entity.setTargetPerson(targetPersonId); sysTransferLogDao.create(entity); } } public String getLogContent(SysTransferSetting sysTransDef, String authorId, String targetPersonId, String selectedItem) { // 开始写日志 String content = sysTransDef.getLogTemplet(); OsUser author = osUserManager.get(authorId); OsUser target = osUserManager.get(targetPersonId); JSONArray selectedItemJa = JSONArray.fromObject(selectedItem); StringBuffer names = new StringBuffer(); for (int i = 0; i < selectedItemJa.size(); i++) { if (names.length() != 0) { names.append(","); } JSONObject jo = selectedItemJa.getJSONObject(i); names.append(jo.getString("name")); } content = content .replace(NAMES, names.toString()) .replace(AUTHOR_NAME, author.getFullname()) .replace(TARGET_PERSONNAME, target.getFullname()); return content; } public List<SysTransferSetting> getInvailAll() { return sysTransferSettingDao.getInvailAll(); } }
[ "18037459447@163.com" ]
18037459447@163.com
408af8820eb648171717ac23d4678cb2a051e9ec
440f26d3ee405d87fc26f4a3bc3cef4703733387
/src/main/java/io/opensec/oval/model/windows/RegistryItem.java
4337cb02e018f2dc41fc93d07b97592ecc791d9a
[ "Apache-2.0" ]
permissive
nakamura5akihito/opensec-oval
37e6e22d79da959a7d64eb7820c4aa81461d056e
7afea82fd919d882231a34e73c0e59d4b184e3e7
refs/heads/master
2021-01-10T06:58:02.597702
2015-06-17T10:56:33
2015-06-17T10:56:33
36,717,938
1
0
null
null
null
null
UTF-8
Java
false
false
5,421
java
/** * Opensec OVAL - https://nakamura5akihito.github.io/ * Copyright (C) 2015 Akihito Nakamura * * 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 io.opensec.oval.model.windows; import io.opensec.oval.model.ComponentType; import io.opensec.oval.model.Family; import io.opensec.oval.model.sc.EntityItemAnySimpleType; import io.opensec.oval.model.sc.EntityItemIntType; import io.opensec.oval.model.sc.EntityItemStringType; import io.opensec.oval.model.sc.ItemType; import java.util.ArrayList; import java.util.Collection; import java.util.Iterator; /** * The registry item specifies information that can be collected * about a particular registry key. * * @author Akihito Nakamura, AIST * @see <a href="http://oval.mitre.org/language/">OVAL Language</a> */ public class RegistryItem extends ItemType { private EntityItemRegistryHiveType hive; //{0..1} private EntityItemStringType key; //{0..1, nillable="true"} private EntityItemStringType name; //{0..1, nillable="true"} private EntityItemIntType last_write_time; //{0..1}: 5.10, 30891 private EntityItemRegistryTypeType type; //{0..1} private final Collection<EntityItemAnySimpleType> value = new ArrayList<EntityItemAnySimpleType>(); //{0..*} // private EntityItemAnySimpleType _value; // We have never found a registry item that has more than one value!!! // private EntityItemWindowsViewType windows_view; //{0..1} /** * Constructor. */ public RegistryItem() { this( 0 ); } public RegistryItem( final int id ) { super( id ); // _oval_platform_type = OvalPlatformType.windows; // _oval_component_type = OvalComponentType.registry; _oval_family = Family.WINDOWS; _oval_component = ComponentType.REGISTRY; } /** */ public void setHive( final EntityItemRegistryHiveType hive ) { this.hive = hive; } public EntityItemRegistryHiveType getHive() { return hive; } /** */ public EntityItemStringType getKey() { return key; } public void setKey( final EntityItemStringType key ) { this.key = key; } /** */ public EntityItemStringType getName() { return name; } public void setName( final EntityItemStringType name ) { this.name = name; } /** */ public void setLastWriteTime( final EntityItemIntType last_write_time ) { this.last_write_time = last_write_time; } public EntityItemIntType getLastWriteTime() { return last_write_time; } /** */ public EntityItemRegistryTypeType getType() { return type; } public void setType( final EntityItemRegistryTypeType type ) { this.type = type; } /** */ public void setValue( final Collection<? extends EntityItemAnySimpleType> value ) { if (this.value != value) { this.value.clear(); if (value != null && value.size() > 0) { this.value.addAll( value ); } } } public Collection<EntityItemAnySimpleType> getValue() { return value; } public Iterator<EntityItemAnySimpleType> iterateValue() { return value.iterator(); } // /** // */ // public void setValue( // final EntityItemAnySimpleType value // ) // { // _value = value; // } // // // public EntityItemAnySimpleType getValue() // { // return _value; // } /** */ public void setWindowsView( final EntityItemWindowsViewType windows_view ) { this.windows_view = windows_view; } public EntityItemWindowsViewType getWindowsView() { return windows_view; } //************************************************************** // java.lang.Object //************************************************************** @Override public String toString() { return "registry_item[" + super.toString() + ", hive=" + getHive() + ", key=" + getKey() + ", name=" + getName() + ", last_write_time=" + getLastWriteTime() + ", type=" + getType() + ", value=" + getValue() + ", windows_view=" + getWindowsView() + "]"; } } //RegistryItem
[ "nakamura5akihito@gmail.com" ]
nakamura5akihito@gmail.com
bdb06e16e044e573151e4273801f92c9fa1ed794
a39222979ed147d8d233dc8be619a216a8b52e8e
/JxvaFramework/WebRoot/WEB-INF/classes/com/jxva/tag/ConditionTag.java
35e1d80de3b08a05b5a86ba1666005b746be56b9
[]
no_license
jxva/jxvaframework
ae532cbaa027540f907b00ea745b8236c17ba555
d56b3a5eafe78dedb55a8feca215de562bac045c
refs/heads/master
2020-06-05T01:23:57.433577
2012-04-17T08:20:39
2012-04-17T08:20:39
1,904,195
1
0
null
null
null
null
UTF-8
Java
false
false
1,392
java
/* * Copyright @ 2006-2010 by The Jxva Framework Foundation * * 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.jxva.tag; import javax.servlet.jsp.JspException; import javax.servlet.jsp.tagext.TagSupport; /** * * * @author The Jxva Framework Foundation * @since 1.0 * @version 2008-12-27 10:43:56 by Jxva */ public abstract class ConditionTag extends TagSupport{ private static final long serialVersionUID = 1L; public static final String CONDITION_TAG_FLAG="condition_tag_flag_for_jxva_framework"; protected String test; public void setTest(String test) { this.test = test; } public int doStartTag() throws JspException{ return doStart(); } public abstract int doStart()throws JspException; public int doEndTag() throws JspException { return EVAL_PAGE; } public void release() { super.release(); test = null; } }
[ "jxva@msn.com" ]
jxva@msn.com
350e04e096d34dc245b05b8735eeff41b1e36ce1
a1958af400ace181194751bd028a16814d9496a9
/code/easycms/src/com/easycms/cms/api/ContentCollectionApiAct.java
de9e86fb3382f8a47c896746798f6324c44a8005
[]
no_license
gziscas/easyPara
a1a700c808649875f1d8e3ed21baea932030a430
46cab44b7ab517e9272e0bb47016910d7651dc0a
refs/heads/master
2021-01-19T00:21:53.335255
2017-04-23T14:43:14
2017-04-23T14:43:14
87,160,858
0
0
null
null
null
null
UTF-8
Java
false
false
5,707
java
package com.easycms.cms.api; import java.util.List; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.json.JSONArray; import org.json.JSONException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import com.easycms.cms.entity.main.ApiAccount; import com.easycms.cms.entity.main.ApiRecord; import com.easycms.cms.entity.main.Content; import com.easycms.cms.manager.main.ApiAccountMng; import com.easycms.cms.manager.main.ApiRecordMng; import com.easycms.cms.manager.main.ApiUserLoginMng; import com.easycms.cms.manager.main.ContentMng; import com.easycms.common.web.RequestUtils; import com.easycms.common.web.ResponseUtils; import com.easycms.core.entity.CmsUser; import com.easycms.core.manager.CmsUserMng; import com.easycms.core.web.WebErrors; import com.easycms.core.web.util.CmsUtils; @Controller public class ContentCollectionApiAct{ /** * 我的收藏 * @param siteId 站点id 非必选 默认当前站 * @param format 模式 非必选 默认1 内容信息简化模式 0全部信息 * @param appId appid 必选 * @param sessionKey 会话标识 必选 * @param first 开始 非必选 默认0 * @param count 数量 非必选 默认10 */ @RequestMapping(value = "/api/content/mycollect.jspx") public void mycollectList( Integer siteId,Integer format,Integer https, String appId,String sessionKey,Integer first,Integer count, HttpServletRequest request,HttpServletResponse response) throws JSONException { String body="\"\""; String message="\"\""; String status=Constants.API_STATUS_FAIL; CmsUser user = null; if(first==null){ first=0; } if(count==null){ count=10; } if(siteId==null){ siteId=CmsUtils.getSiteId(request); } if(format==null){ format=Content.CONTENT_INFO_SIMPLE; } if(https==null){ https=Constants.URL_HTTP; } List<Content>contents=null; WebErrors errors=WebErrors.create(request); ApiAccount apiAccount = null; //验证公共非空参数 errors=ApiValidate.validateRequiredParams(request,errors, appId,sessionKey); if(!errors.hasErrors()){ apiAccount=apiAccountMng.findByAppId(appId); //验证appid errors=ApiValidate.validateApiAccount(request, errors,apiAccount); //apiAccount可能获取不到,需要再次判断 if(!errors.hasErrors()){ String aesKey=apiAccount.getAesKey(); user=apiUserLoginMng.findUser(sessionKey, aesKey,apiAccount.getIvKey()); //验证用户 if(user==null){ errors.addErrorString(Constants.API_MESSAGE_USER_NOT_LOGIN); } } } if(errors.hasErrors()){ message="\""+errors.getErrors().get(0)+"\""; }else{ contents=contentMng.getListForCollection( siteId, user.getId(), first, count); JSONArray jsonArray=new JSONArray(); if(contents!=null&&contents.size()>0){ for(int i=0;i<contents.size();i++){ jsonArray.put(i, contents.get(i).convertToJson(format,https,true)); } } body=jsonArray.toString(); message=Constants.API_MESSAGE_SUCCESS; status=Constants.API_STATUS_SUCCESS; } ApiResponse apiResponse=new ApiResponse(body, message, status); ResponseUtils.renderApiJson(response, request, apiResponse); } /** * 收藏API * @param id 内容ID 必选 * @param operate 操作 非必选 1收藏 0 取消收藏 默认1 * @param appId appid 必选 * @param nonce_str 随机字符串 必选 * @param sign 签名 必选 * @param sessionKey 会话标识 必选 */ @RequestMapping(value = "/api/content/collect.jspx") public void contentCollect( Integer id,Integer operate, String appId,String sessionKey, String nonce_str,String sign, HttpServletRequest request,HttpServletResponse response)throws JSONException { String body="\"\""; String message="\"\""; String status=Constants.API_STATUS_FAIL; if(operate==null){ operate=1; } WebErrors errors=WebErrors.create(request); ApiAccount apiAccount = null; CmsUser user = null; //验证公共非空参数 errors=ApiValidate.validateRequiredParams(request,errors, appId, sessionKey,nonce_str,sign,id); if(!errors.hasErrors()){ apiAccount=apiAccountMng.findByAppId(appId); //验证签名 errors=ApiValidate.validateSign(request, errors, apiAccount, sign); //apiAccount可能获取不到,需要再次判断 if(!errors.hasErrors()){ String aesKey=apiAccount.getAesKey(); user=apiUserLoginMng.findUser(sessionKey, aesKey,apiAccount.getIvKey()); //验证用户 if(user==null){ errors.addErrorString(Constants.API_MESSAGE_USER_NOT_LOGIN); } } } if(errors.hasErrors()){ message="\""+errors.getErrors().get(0)+"\""; }else{ Content content=contentMng.findById(id); if(content!=null){ ApiRecord record=apiRecordMng.findBySign(sign, appId); if(record!=null){ message=Constants.API_MESSAGE_REQUEST_REPEAT; }else{ userMng.updateUserConllection(user,id,operate); apiRecordMng.callApiRecord(RequestUtils.getIpAddr(request), appId, "/api/content/collect.jspx",sign); message=Constants.API_MESSAGE_SUCCESS; status=Constants.API_STATUS_SUCCESS; } }else{ message=Constants.API_MESSAGE_CONTENT_NOT_FOUND; } } ApiResponse apiResponse=new ApiResponse(body, message, status); ResponseUtils.renderApiJson(response, request, apiResponse); } @Autowired private ContentMng contentMng; @Autowired private CmsUserMng userMng; @Autowired private ApiAccountMng apiAccountMng; @Autowired private ApiUserLoginMng apiUserLoginMng; @Autowired private ApiRecordMng apiRecordMng; }
[ "liuya1985liuya@163.com" ]
liuya1985liuya@163.com
dabe494511c72f25927010a85c8adae2233ae2fd
ed657210a17ce8fbe1be3f2a32263182987da177
/com.conx.logistics.kernel/portal/remote.services/src/main/java/com/conx/logistics/kernel/portal/remote/services/IPortalOrganizationService.java
8d65a289ef634208ea3f90f15416413b79ed0e9c
[]
no_license
conxgit/conxlogistics-gerrit4
e6b3becee3561899cf283b1cbd88b737de6af0f4
24885e639432ab45082060ca66d0de45d80fdd82
refs/heads/master
2021-03-12T20:12:32.324680
2012-12-18T18:17:00
2012-12-18T18:17:00
null
0
0
null
null
null
null
UTF-8
Java
false
false
342
java
package com.conx.logistics.kernel.portal.remote.services; import java.util.Set; import com.conx.logistics.mdm.domain.organization.Organization; public interface IPortalOrganizationService { public Set<Organization> getOrganizationsByCompanyId(String companyId); public Organization provideOrganization(String portalOrganizationId); }
[ "mduduzi.keswa@bconv.com" ]
mduduzi.keswa@bconv.com
36a82e67653723c9b602e7fe5c6a0ee09fea1973
947c44cf349ebac90232f79301a63142afbc3191
/src/com/bj/test/Test1.java
4f7cf3750c5504485e9a134b0063f4986e0d253e
[]
no_license
happydaydayday/testmac
76b5deb65170fcb6156cdeffba7358cde1ce3b0f
fc38285cfaf87b59d9e11790254b3ec3c9f44175
refs/heads/master
2023-04-13T08:32:46.727327
2021-04-24T05:56:16
2021-04-24T05:56:16
361,085,891
0
0
null
null
null
null
UTF-8
Java
false
false
2,240
java
package com.bj.test; import com.bj.domain.Student; import org.apache.ibatis.io.Resources; import org.apache.ibatis.session.SqlSession; import org.apache.ibatis.session.SqlSessionFactory; import org.apache.ibatis.session.SqlSessionFactoryBuilder; import java.io.IOException; import java.io.InputStream; import java.util.List; public class Test1 { public static void main(String[] args) { String resource = "mybatis-config.xml"; //输入流 InputStream inputStream = null; try { //通过加载Mybatis的主配置文件mybatis-config.xml,创建输入流对象 inputStream = Resources.getResourceAsStream(resource); } catch (IOException e) { e.printStackTrace(); } /* SqlSessionFactory:SqlSessionFactoryd的建造者 通过该建造这对象调用建造方法,为我们创建一个SqlSessionFactory对象 SqlSessionFactory对象唯一的作用创建SqlSession对象 * */ SqlSessionFactory sqlSessionFactory = new SqlSessionFactoryBuilder().build(inputStream); //所有操作使用的都是SqlSession对象 SqlSession session = sqlSessionFactory.openSession(); //根据id查询单条 /*Student s = session.selectOne("test1.getById", "A0001"); System.out.println(s); session.close();*/ //查询学生信息表中所有记录 /*List<Student> sList = session.selectList("test1.getAll"); for (Student s:sList){ System.out.println(s); } session.close();*/ //添加 需要手动提交事务 /*Student s = new Student(); s.setId("A0006"); s.setName("cxk"); s.setAge(23); session.insert("test1.set", s); session.commit(); session.close();*/ //删除 需要手动提交事务 session.delete("test1.delete","A0006"); session.commit(); session.close(); //修改 需要手动提交事务 /*Student s = new Student(); s.setId("A0006"); s.setName("cxk—SB"); s.setAge(52); session.update("test1.update", s); session.commit(); session.close();*/ } }
[ "zs@bjpowernode.com" ]
zs@bjpowernode.com
cac445925cc8cec25287a72a43da38215bee3849
612849e4c10bcf817ec551576ce89e76bad71213
/app/src/main/java/com/lys/androidapp/myreceiverapplication/SettingActivity.java
9419a560adcca160b9fae3f4eeb95dabe4cac668
[]
no_license
laiyongshan/MyReceiverApplication
110e2982243ec0528faa70d8b7e4bdc90e77a26c
c95e5366bd94717b2862ca08c6036e461b460d34
refs/heads/master
2020-03-28T20:13:54.417957
2018-09-17T06:25:14
2018-09-17T06:25:14
149,051,218
0
0
null
null
null
null
UTF-8
Java
false
false
5,835
java
package com.lys.androidapp.myreceiverapplication; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.support.annotation.Nullable; import android.view.View; import android.widget.CheckBox; import android.widget.CompoundButton; import android.widget.ImageView; import android.widget.RelativeLayout; import android.widget.TextView; import com.lys.androidapp.myreceiverapplication.cusomView.SuccessProgressDialog; import com.lys.androidapp.myreceiverapplication.utils.ToolUtils; /** * @author lys * @time 2018/9/5 17:43 * @desc: */ public class SettingActivity extends Activity { RelativeLayout set_api_layout,exit_layout,save_start_layout; CheckBox alipay_cb,weixin_cb; TextView alipaycount_tv,weixincont_tv; ImageView back_iv; String AlipayCount; String AlipayCountId; String WeChartCount; String WeChartCountId; ToolUtils mToolUtils; SuccessProgressDialog successProgressDialog; @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_setting); mToolUtils=new ToolUtils(); initView(); } private void initView(){ successProgressDialog=new SuccessProgressDialog(SettingActivity.this); AlipayCount=mToolUtils.getAlipayCount()+""; AlipayCountId=mToolUtils.getAlipayCountId()+""; WeChartCount=mToolUtils.getWeChartCount()+""; WeChartCountId=mToolUtils.getWeChartCountId()+""; back_iv=findViewById(R.id.back_iv); back_iv.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { finish(); } }); set_api_layout=findViewById(R.id.set_api_layout); set_api_layout.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent=new Intent(SettingActivity.this,ApiActivity.class); intent.putExtra("type",1); startActivity(intent); finish(); } }); exit_layout=findViewById(R.id.exit_layout); exit_layout.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { mToolUtils.setIsLogin(false); Intent intent=new Intent(SettingActivity.this,LoginActivity.class); startActivity(intent); } }); alipay_cb=findViewById(R.id.alipay_cb); alipay_cb.setChecked(mToolUtils.getIsAlipay()); alipay_cb.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { mToolUtils.setIsAlipay(isChecked); } }); weixin_cb=findViewById(R.id.weixin_cb); weixin_cb.setChecked(mToolUtils.getIsWeChat()); weixin_cb.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { mToolUtils.setIsWeChat(isChecked); } }); alipaycount_tv=findViewById(R.id.alipaycount_tv); if(!mToolUtils.getAlipayCount().equals("null")) { alipaycount_tv.setText(mToolUtils.getAlipayCount() + ""); } alipaycount_tv.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { CountDialog countDialog=new CountDialog(SettingActivity.this, R.style.BaseDialog, "alipay", new CountDialog.CountListener() { @Override public void getCount(String count) { AlipayCount=count; alipaycount_tv.setText(count+""); } @Override public void getCountId(String countId) { AlipayCountId=countId; } }); countDialog.show(); } }); weixincont_tv=findViewById(R.id.weixincount_tv); if(!mToolUtils.getWeChartCount().equals("null")) { weixincont_tv.setText(mToolUtils.getWeChartCount() + ""); } weixincont_tv.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { CountDialog countDialog=new CountDialog(SettingActivity.this, R.style.BaseDialog, "wechat", new CountDialog.CountListener() { @Override public void getCount(String count) { WeChartCount=count; weixincont_tv.setText(""+count); } @Override public void getCountId(String countId) { WeChartCountId=countId; } }); countDialog.show(); } }); save_start_layout=findViewById(R.id.save_start_layout); save_start_layout.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { mToolUtils.setIsAlipay(alipay_cb.isChecked()); mToolUtils.setIsWeChat(weixin_cb.isChecked()); mToolUtils.setAlipayCount(AlipayCount+""); mToolUtils.setAlipayCountId(AlipayCountId+""); mToolUtils.setWeChartCount(WeChartCount+""); mToolUtils.setWeChartCountId(WeChartCountId+""); finish(); } }); } }
[ "850422483@qq.com" ]
850422483@qq.com