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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
254bab90d896bc948bfafac19898e5906b721a31 | 23dde047738a257d9d9733cb0d84e7fa352367c3 | /app/src/main/java/com/gagandeep/audiorecorder/MainActivity.java | 14d4361f5b7d1c074651fff89042494061cb7925 | [] | no_license | Gagandeep39/android-recorder | 42b705f311dd8d7bc8ff6972338556086d033d76 | edb75b24defc74cfcd8fb1b4a9a2dd14b1e62232 | refs/heads/master | 2022-10-30T20:57:22.561315 | 2020-06-16T12:54:16 | 2020-06-16T12:54:16 | 272,707,638 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,253 | java | package com.gagandeep.audiorecorder;
import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
import androidx.navigation.NavController;
import androidx.navigation.Navigation;
import androidx.navigation.ui.AppBarConfiguration;
import androidx.navigation.ui.NavigationUI;
import com.google.android.material.bottomnavigation.BottomNavigationView;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
BottomNavigationView navView = findViewById(R.id.nav_view);
// Passing each menu ID as a set of Ids because each
// menu should be considered as top level destinations.
AppBarConfiguration appBarConfiguration = new AppBarConfiguration.Builder(
R.id.navigation_home, R.id.navigation_dashboard, R.id.navigation_notifications)
.build();
NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment);
NavigationUI.setupActionBarWithNavController(this, navController, appBarConfiguration);
NavigationUI.setupWithNavController(navView, navController);
}
} | [
"singh.gagandeep3911@gmail.com"
] | singh.gagandeep3911@gmail.com |
d746918c34cebb2137aae0ef321d7dcc3facdcca | 117a24dc265bbc965dc4f8b14ce4399b8e0f8ba6 | /src/main/java/SystemDesignCodes/Threading/semaphore/countingsemaphore/Main.java | 37587b4ddb7b5335315e793a78829a96e7898874 | [] | no_license | sureshrmdec/Preparation26EatSleepDrinkCode | e240393eabdc3343bb1165d5c432217f085aa353 | aa5b81907205f9d435835e2150100e8f53027212 | refs/heads/master | 2021-09-29T14:28:24.691090 | 2018-11-25T13:52:43 | 2018-11-25T13:52:43 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 521 | java | package SystemDesignCodes.Threading.semaphore.countingsemaphore;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
public class Main {
public static void main(String[] args) {
final int threadCount = 6;
final ExecutorService exService = Executors.newFixedThreadPool(threadCount);
final Library library = new Library();
for(int i=0; i < threadCount; i++) {
Reader reader = new Reader(library);
exService.execute(reader);
}
exService.shutdown();
}
}
| [
"rahuja@twitter.com"
] | rahuja@twitter.com |
9975d9586b0f034c817167d6c2afebc5e0780c78 | 6baf1fe00541560788e78de5244ae17a7a2b375a | /hollywood/com.oculus.store-Store/sources/com/google/common/base/Stopwatch.java | b9e6c2a3c55509b574f5d2f6ccd76f4377dad393 | [] | no_license | phwd/quest-tracker | 286e605644fc05f00f4904e51f73d77444a78003 | 3d46fbb467ba11bee5827f7cae7dfeabeb1fd2ba | refs/heads/main | 2023-03-29T20:33:10.959529 | 2021-04-10T22:14:11 | 2021-04-10T22:14:11 | 357,185,040 | 4 | 2 | null | 2021-04-12T12:28:09 | 2021-04-12T12:28:08 | null | UTF-8 | Java | false | false | 5,176 | java | package com.google.common.base;
import com.google.common.annotations.GwtCompatible;
import com.google.errorprone.annotations.CanIgnoreReturnValue;
import java.util.concurrent.TimeUnit;
@GwtCompatible
public final class Stopwatch {
private long elapsedNanos;
private boolean isRunning;
private long startTick;
private final Ticker ticker;
public static Stopwatch createUnstarted() {
return new Stopwatch();
}
public static Stopwatch createUnstarted(Ticker ticker2) {
return new Stopwatch(ticker2);
}
public static Stopwatch createStarted() {
return new Stopwatch().start();
}
public static Stopwatch createStarted(Ticker ticker2) {
return new Stopwatch(ticker2).start();
}
Stopwatch() {
this.ticker = Ticker.systemTicker();
}
Stopwatch(Ticker ticker2) {
this.ticker = (Ticker) Preconditions.checkNotNull(ticker2, "ticker");
}
public boolean isRunning() {
return this.isRunning;
}
@CanIgnoreReturnValue
public Stopwatch start() {
Preconditions.checkState(!this.isRunning, "This stopwatch is already running.");
this.isRunning = true;
this.startTick = this.ticker.read();
return this;
}
@CanIgnoreReturnValue
public Stopwatch stop() {
long tick = this.ticker.read();
Preconditions.checkState(this.isRunning, "This stopwatch is already stopped.");
this.isRunning = false;
this.elapsedNanos += tick - this.startTick;
return this;
}
@CanIgnoreReturnValue
public Stopwatch reset() {
this.elapsedNanos = 0;
this.isRunning = false;
return this;
}
private long elapsedNanos() {
return this.isRunning ? (this.ticker.read() - this.startTick) + this.elapsedNanos : this.elapsedNanos;
}
public long elapsed(TimeUnit desiredUnit) {
return desiredUnit.convert(elapsedNanos(), TimeUnit.NANOSECONDS);
}
public String toString() {
long nanos = elapsedNanos();
TimeUnit unit = chooseUnit(nanos);
return Platform.formatCompact4Digits(((double) nanos) / ((double) TimeUnit.NANOSECONDS.convert(1, unit))) + " " + abbreviate(unit);
}
private static TimeUnit chooseUnit(long nanos) {
if (TimeUnit.DAYS.convert(nanos, TimeUnit.NANOSECONDS) > 0) {
return TimeUnit.DAYS;
}
if (TimeUnit.HOURS.convert(nanos, TimeUnit.NANOSECONDS) > 0) {
return TimeUnit.HOURS;
}
if (TimeUnit.MINUTES.convert(nanos, TimeUnit.NANOSECONDS) > 0) {
return TimeUnit.MINUTES;
}
if (TimeUnit.SECONDS.convert(nanos, TimeUnit.NANOSECONDS) > 0) {
return TimeUnit.SECONDS;
}
if (TimeUnit.MILLISECONDS.convert(nanos, TimeUnit.NANOSECONDS) > 0) {
return TimeUnit.MILLISECONDS;
}
if (TimeUnit.MICROSECONDS.convert(nanos, TimeUnit.NANOSECONDS) > 0) {
return TimeUnit.MICROSECONDS;
}
return TimeUnit.NANOSECONDS;
}
/* access modifiers changed from: package-private */
/* renamed from: com.google.common.base.Stopwatch$1 reason: invalid class name */
public static /* synthetic */ class AnonymousClass1 {
static final /* synthetic */ int[] $SwitchMap$java$util$concurrent$TimeUnit = new int[TimeUnit.values().length];
static {
try {
$SwitchMap$java$util$concurrent$TimeUnit[TimeUnit.NANOSECONDS.ordinal()] = 1;
} catch (NoSuchFieldError e) {
}
try {
$SwitchMap$java$util$concurrent$TimeUnit[TimeUnit.MICROSECONDS.ordinal()] = 2;
} catch (NoSuchFieldError e2) {
}
try {
$SwitchMap$java$util$concurrent$TimeUnit[TimeUnit.MILLISECONDS.ordinal()] = 3;
} catch (NoSuchFieldError e3) {
}
try {
$SwitchMap$java$util$concurrent$TimeUnit[TimeUnit.SECONDS.ordinal()] = 4;
} catch (NoSuchFieldError e4) {
}
try {
$SwitchMap$java$util$concurrent$TimeUnit[TimeUnit.MINUTES.ordinal()] = 5;
} catch (NoSuchFieldError e5) {
}
try {
$SwitchMap$java$util$concurrent$TimeUnit[TimeUnit.HOURS.ordinal()] = 6;
} catch (NoSuchFieldError e6) {
}
try {
$SwitchMap$java$util$concurrent$TimeUnit[TimeUnit.DAYS.ordinal()] = 7;
} catch (NoSuchFieldError e7) {
}
}
}
private static String abbreviate(TimeUnit unit) {
switch (AnonymousClass1.$SwitchMap$java$util$concurrent$TimeUnit[unit.ordinal()]) {
case 1:
return "ns";
case 2:
return "μs";
case 3:
return "ms";
case 4:
return "s";
case 5:
return "min";
case 6:
return "h";
case 7:
return "d";
default:
throw new AssertionError();
}
}
}
| [
"cyuubiapps@gmail.com"
] | cyuubiapps@gmail.com |
04cdce318753f94d5e0311f11bc6343c1cd19d3c | 7d2b200db2c005f39edbe6e85facf2d2f308b550 | /app/src/main/java/com/xuechuan/xcedu/vo/ItemSelectVo.java | 6145952775574ee9479202fa9d06aaa3ff2e4abc | [] | no_license | yufeilong92/tushday | 872f54cd05d3cf8441d6f47d2a35ffda96f19edf | 7d463709de92e6c719557f4c5cba13676ed4b988 | refs/heads/master | 2020-04-13T08:38:43.435530 | 2018-12-25T14:02:12 | 2018-12-25T14:02:12 | 163,087,412 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 856 | java | package com.xuechuan.xcedu.vo;
/**
* @version V 1.0 xxxxxxxx
* @Title: xcedu
* @Package com.xuechuan.xcedu.vo
* @Description: 处理用户选中的
* @author: L-BackPacker
* @date: 2018/5/17 9:26
* @verdescript 版本号 修改时间 修改人 修改的概要说明
* @Copyright: 2018
*/
public class ItemSelectVo {
private String id;
private boolean isSelect;
/**
* 保利视频id
*/
private String videoid;
public String getId() {
return id;
}
public String getVideoid() {
return videoid;
}
public void setVideoid(String videoid) {
this.videoid = videoid;
}
public void setId(String id) {
this.id = id;
}
public boolean isSelect() {
return isSelect;
}
public void setSelect(boolean select) {
isSelect = select;
}
}
| [
"931697478@qq.com"
] | 931697478@qq.com |
6ef35d7e6a1879bdd15221d5bbd63d705f19b37a | dba87418d2286ce141d81deb947305a0eaf9824f | /sources/org/codehaus/jackson/ObjectCodec.java | 5ed4b0e7ad3a5a0a6b370701efcf6df277fdc70d | [] | no_license | Sluckson/copyOavct | 1f73f47ce94bb08df44f2ba9f698f2e8589b5cf6 | d20597e14411e8607d1d6e93b632d0cd2e8af8cb | refs/heads/main | 2023-03-09T12:14:38.824373 | 2021-02-26T01:38:16 | 2021-02-26T01:38:16 | 341,292,450 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,245 | java | package org.codehaus.jackson;
import java.io.IOException;
import org.codehaus.jackson.type.JavaType;
import org.codehaus.jackson.type.TypeReference;
public abstract class ObjectCodec {
public abstract JsonNode createArrayNode();
public abstract JsonNode createObjectNode();
public abstract JsonNode readTree(JsonParser jsonParser) throws IOException, JsonProcessingException;
public abstract <T> T readValue(JsonParser jsonParser, Class<T> cls) throws IOException, JsonProcessingException;
public abstract <T> T readValue(JsonParser jsonParser, JavaType javaType) throws IOException, JsonProcessingException;
public abstract <T> T readValue(JsonParser jsonParser, TypeReference<?> typeReference) throws IOException, JsonProcessingException;
public abstract JsonParser treeAsTokens(JsonNode jsonNode);
public abstract <T> T treeToValue(JsonNode jsonNode, Class<T> cls) throws IOException, JsonProcessingException;
public abstract void writeTree(JsonGenerator jsonGenerator, JsonNode jsonNode) throws IOException, JsonProcessingException;
public abstract void writeValue(JsonGenerator jsonGenerator, Object obj) throws IOException, JsonProcessingException;
protected ObjectCodec() {
}
}
| [
"lucksonsurprice94@gmail.com"
] | lucksonsurprice94@gmail.com |
36851c19dd61ca8c04f6c916a270c7bff26e5891 | 81ce004cb29e151f926c67e56f3c71bf979471c5 | /src/cating/demo1.java | 30d65c3585c4af2c192e38ec735b0dcb81670c66 | [] | no_license | swapnil702081/practice1 | b280c93b4ec727f2fbb643817067c702bb574a23 | 9779323ba3fe6fa85be8095bfa03bbb6173c0b40 | refs/heads/master | 2023-06-27T16:50:44.966976 | 2021-08-02T02:45:10 | 2021-08-02T02:45:10 | 391,796,499 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 210 | java | package cating;
public class demo1
{
public void m1()
{
System.out.println("non static method m1");
}
public void m2()
{
System.out.println("non static method m2");
}
}
| [
"Admin@Admin-PC"
] | Admin@Admin-PC |
ef66eecb38c8e6a150f420a2b125d8e0fc4f5e23 | 995f73d30450a6dce6bc7145d89344b4ad6e0622 | /Honor5C-7.0/src/main/java/sun/nio/ch/PollSelectorImpl.java | d33bc6d8c902205b85027934be685f337eabcff1 | [] | no_license | morningblu/HWFramework | 0ceb02cbe42585d0169d9b6c4964a41b436039f5 | 672bb34094b8780806a10ba9b1d21036fd808b8e | refs/heads/master | 2023-07-29T05:26:14.603817 | 2021-09-03T05:23:34 | 2021-09-03T05:23:34 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,194 | java | package sun.nio.ch;
import java.io.IOException;
import java.nio.channels.ClosedSelectorException;
import java.nio.channels.Selector;
import java.nio.channels.spi.SelectorProvider;
class PollSelectorImpl extends AbstractPollSelectorImpl {
private int fd0;
private int fd1;
private Object interruptLock;
private boolean interruptTriggered;
PollSelectorImpl(SelectorProvider sp) {
super(sp, 1, 1);
this.interruptLock = new Object();
this.interruptTriggered = false;
long pipeFds = IOUtil.makePipe(false);
this.fd0 = (int) (pipeFds >>> 32);
this.fd1 = (int) pipeFds;
this.pollWrapper = new PollArrayWrapper(10);
this.pollWrapper.initInterrupt(this.fd0, this.fd1);
this.channelArray = new SelectionKeyImpl[10];
}
protected int doSelect(long timeout) throws IOException {
if (this.channelArray == null) {
throw new ClosedSelectorException();
}
processDeregisterQueue();
try {
begin();
this.pollWrapper.poll(this.totalChannels, 0, timeout);
processDeregisterQueue();
int numKeysUpdated = updateSelectedKeys();
if (this.pollWrapper.getReventOps(0) != 0) {
this.pollWrapper.putReventOps(0, 0);
synchronized (this.interruptLock) {
IOUtil.drain(this.fd0);
this.interruptTriggered = false;
}
}
return numKeysUpdated;
} finally {
end();
}
}
protected void implCloseInterrupt() throws IOException {
synchronized (this.interruptLock) {
this.interruptTriggered = true;
}
FileDispatcherImpl.closeIntFD(this.fd0);
FileDispatcherImpl.closeIntFD(this.fd1);
this.fd0 = -1;
this.fd1 = -1;
this.pollWrapper.release(0);
}
public Selector wakeup() {
synchronized (this.interruptLock) {
if (!this.interruptTriggered) {
this.pollWrapper.interrupt();
this.interruptTriggered = true;
}
}
return this;
}
}
| [
"dstmath@163.com"
] | dstmath@163.com |
97e05a191d465fbacdaa43f9cab916efe982cdf1 | 0c9452b5cf1d0aaf25a405fcf6f0e2e75c2bbbce | /SpringBoot-tutorial/demo/src/main/java/com/example/DemoApplication.java | baac8e9cd9a9f2010e401187aa6e4f4aebe59f71 | [] | no_license | opklnm102/spring | 708e0f17dc44a46e5605ea96af02f148ab0fea75 | 9bba55966bf3fb2bb9c99de1e2c3bb19644ff114 | refs/heads/master | 2020-12-11T03:37:34.729412 | 2017-02-06T11:30:37 | 2017-02-06T11:30:37 | 68,808,621 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 642 | java | package com.example;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@RestController
@SpringBootApplication
public class DemoApplication {
@RequestMapping("/")
String hello(@RequestParam(defaultValue="Gradle") String name){
return String.format("Hello %1$s!", name);
}
public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args);
}
}
| [
"opklnm102@gmail.com"
] | opklnm102@gmail.com |
87fb02ff1ea91bda0ccba4e81e3d619e3d08cd52 | 354ade2c776c767b51c0282ea3e8e3f6b1ed0157 | /Bee/src/com/linkstec/bee/UI/node/view/Helper.java | c5e7b8a82f871aee91b9c2a58ca54c71f00fc908 | [] | no_license | pan1394/SqlParser | b4286083b9a2b58fa922ab785cc83eab54c51c61 | ec0d81ab35e2ce18ed9ad4238640e39a2c4d165c | refs/heads/master | 2022-07-14T13:59:15.612534 | 2019-08-23T07:34:14 | 2019-08-23T07:34:14 | 178,761,865 | 0 | 0 | null | 2022-06-21T01:43:32 | 2019-04-01T01:12:23 | Java | UTF-8 | Java | false | false | 4,237 | java | package com.linkstec.bee.UI.node.view;
import java.util.List;
import javax.swing.ImageIcon;
import com.linkstec.bee.UI.BeeConstants;
import com.linkstec.bee.UI.BeeUIUtils;
import com.linkstec.bee.UI.node.BasicNode;
import com.linkstec.bee.UI.node.ReferNode;
import com.linkstec.bee.UI.node.layout.HorizonalLayout;
import com.linkstec.bee.UI.node.layout.VerticalLayout;
import com.linkstec.bee.core.fw.IUnit;
import com.linkstec.bee.core.fw.logic.BInvoker;
import com.mxgraph.model.mxCell;
import com.mxgraph.model.mxGeometry;
import com.mxgraph.model.mxICell;
public class Helper {
public static mxCell cloneAll(mxCell cell) {
mxCell clone = null;
try {
clone = (mxCell) cell.clone();
int count = cell.getChildCount();
for (int i = 0; i < count; i++) {
mxCell child = (mxCell) cell.getChildAt(i);
if (child instanceof BasicNode) {
BasicNode b = (BasicNode) child;
clone.insert((mxICell) b.cloneAll(), i);
} else {
clone.insert(cloneAll(child), i);
}
}
} catch (CloneNotSupportedException e) {
e.printStackTrace();
}
return clone;
}
public static BasicNode makeBodyLabel(String name) {
BasicNode label = new BasicNode();
label.setOpaque(false);
label.setRound();
label.makeBorder();
mxGeometry geo = new mxGeometry(0, 0, BeeUIUtils.getDefaultFontSize() * 2, BeeConstants.LINE_HEIGHT);
geo.setRelative(true);
label.setGeometry(geo);
label.setValue(name);
// label.addStyle("align=center");
label.addStyle("elbow=vertical");
label.addStyle("portConstraint=west");
label.setOffsetX(10);
label.setOffsetY(-20);
label.addUserAttribute("BodyTitle", "BodyTitle");
HorizonalLayout layout = new HorizonalLayout();
label.setLayout(layout);
return label;
}
public static void findLinkers(List<BInvoker> list, BasicNode node, BasicNode container) {
int count = node.getChildCount();
for (int i = 0; i < count; i++) {
mxICell child = node.getChildAt(i);
if (child instanceof LinkNode) {
LinkNode link = (LinkNode) child;
BasicNode obj = link.getLinkNode();
if (obj instanceof BInvoker && !obj.equals(container)) {
list.add(0, (BInvoker) obj);
}
}
if ((!(child instanceof IUnit)) && child instanceof BasicNode) {
Helper.findLinkers(list, (BasicNode) child, container);
}
}
}
public static void findLinkers(List<LinkNode> list, List<BInvoker> invokers) {
for (LinkNode link : list) {
BInvoker invoker = findInvoker(link.getParent(), link);
if (invoker != null) {
invokers.add(invoker);
} else {
throw new RuntimeException("Linker lost");
}
}
}
private static BInvoker findInvoker(mxICell cell, LinkNode link) {
int count = cell.getChildCount();
for (int i = 0; i < count; i++) {
mxICell child = cell.getChildAt(i);
if (child.equals(link.getLinkNode())) {
return (BInvoker) child;
}
}
if (cell.getParent() instanceof BasicNode) {
return findInvoker(cell.getParent(), link);
}
return null;
}
public static void findAllLinkers(List<BInvoker> list, BasicNode node) {
int count = node.getChildCount();
for (int i = 0; i < count; i++) {
mxICell child = node.getChildAt(i);
if (child instanceof ReferNode) {
ReferNode refer = (ReferNode) child;
if (refer.isLinker()) {
list.add(0, refer);
}
}
if (child instanceof BasicNode) {
Helper.findAllLinkers(list, (BasicNode) child);
}
}
}
public static class Spliter extends BasicNode {
/**
*
*/
private static final long serialVersionUID = -7116583599316253040L;
public Spliter() {
this.setFixedWidth(600);
this.setOpaque(false);
this.getGeometry().setHeight(BeeConstants.NODE_SPACING);
VerticalLayout layout = new VerticalLayout();
layout.setSpacing(0);
this.setLayout(layout);
BasicNode line = new BasicNode();
line.setFixedWidth(600);
line.getGeometry().setHeight(4);
line.addStyle("fillColor=" + BeeConstants.ELEGANT_GREEN_COLOR);
layout.addNode(line);
}
@Override
public ImageIcon getIcon() {
return BeeConstants.DATA_ICON;
}
}
}
| [
"pan1394@126.com"
] | pan1394@126.com |
85a90cd26400e1f2f5f87213736f569f82399b5e | 36f04b5e042303b160296f80e64b6cfbf6d2113c | /uizacoresdk/src/main/java/vn/loitp/libstream/uiza/faucamp/simplertmp/amf/AmfData.java | 91c8d28173f9fcab85ff11f13b3b3dc9b0d82528 | [
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference",
"BSD-2-Clause"
] | permissive | liaoqingfu/uiza-android-sdk-player | cf32382233f41c895129fc37bca0f120fc257d0e | e1813e82c93396b7daaa062d6665b1ba6a1a36a1 | refs/heads/master | 2020-03-28T01:55:22.990911 | 2018-09-05T06:19:34 | 2018-09-05T06:19:34 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 815 | java | package vn.loitp.libstream.uiza.faucamp.simplertmp.amf;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
/**
* Base AMF data object. All other AMF data type instances derive from this
* (including AmfObject)
*
* @author francois
*/
public interface AmfData {
/**
* Write/Serialize this AMF data intance (Object/string/integer etc) to
* the specified OutputStream
*/
void writeTo(OutputStream out) throws IOException;
/**
* Read and parse bytes from the specified input stream to populate this
* AMFData instance (deserialize)
*
* @return the amount of bytes read
*/
void readFrom(InputStream in) throws IOException;
/**
* @return the amount of bytes required for this object
*/
int getSize();
}
| [
"loitp@pateco.vn"
] | loitp@pateco.vn |
59eef73f21c2ea6800fab40491b842eb2eeafa28 | 9410ef0fbb317ace552b6f0a91e0b847a9a841da | /src/main/java/com/tencentcloudapi/antiddos/v20200309/models/DescribeBasicDeviceStatusRequest.java | a56ee6b9fec943f55f093b2d0dc7fdcc5f3065b1 | [
"Apache-2.0"
] | permissive | TencentCloud/tencentcloud-sdk-java-intl-en | 274de822748bdb9b4077e3b796413834b05f1713 | 6ca868a8de6803a6c9f51af7293d5e6dad575db6 | refs/heads/master | 2023-09-04T05:18:35.048202 | 2023-09-01T04:04:14 | 2023-09-01T04:04:14 | 230,567,388 | 7 | 4 | Apache-2.0 | 2022-05-25T06:54:45 | 2019-12-28T06:13:51 | Java | UTF-8 | Java | false | false | 2,212 | java | /*
* Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.tencentcloudapi.antiddos.v20200309.models;
import com.tencentcloudapi.common.AbstractModel;
import com.google.gson.annotations.SerializedName;
import com.google.gson.annotations.Expose;
import java.util.HashMap;
public class DescribeBasicDeviceStatusRequest extends AbstractModel{
/**
* List of IP resources
*/
@SerializedName("IpList")
@Expose
private String [] IpList;
/**
* Get List of IP resources
* @return IpList List of IP resources
*/
public String [] getIpList() {
return this.IpList;
}
/**
* Set List of IP resources
* @param IpList List of IP resources
*/
public void setIpList(String [] IpList) {
this.IpList = IpList;
}
public DescribeBasicDeviceStatusRequest() {
}
/**
* NOTE: Any ambiguous key set via .set("AnyKey", "value") will be a shallow copy,
* and any explicit key, i.e Foo, set via .setFoo("value") will be a deep copy.
*/
public DescribeBasicDeviceStatusRequest(DescribeBasicDeviceStatusRequest source) {
if (source.IpList != null) {
this.IpList = new String[source.IpList.length];
for (int i = 0; i < source.IpList.length; i++) {
this.IpList[i] = new String(source.IpList[i]);
}
}
}
/**
* Internal implementation, normal users should not use it.
*/
public void toMap(HashMap<String, String> map, String prefix) {
this.setParamArraySimple(map, prefix + "IpList.", this.IpList);
}
}
| [
"tencentcloudapi@tencent.com"
] | tencentcloudapi@tencent.com |
08b08c0b9fc2ac7d4370cebad1b7b1ca85f388c7 | 61dfb0e57d202a608e1516c148946012b4df7b75 | /src/main/java/org/n3r/quartz/glass/web/form/SimpleTriggerForm.java | c5618c7b708a6f46c7afb1aeece1d7e2882a4242 | [
"Apache-2.0"
] | permissive | bingooyong/quartz-glass | e8c347f613205725c56cc5e9105acd25ac77b136 | 61fcf5207801f49a09048b0913fb2e87b83be1c5 | refs/heads/master | 2022-07-22T02:53:07.918014 | 2013-10-16T09:19:11 | 2013-10-16T09:19:11 | 13,614,955 | 0 | 0 | Apache-2.0 | 2022-07-07T05:49:24 | 2013-10-16T09:30:23 | Java | UTF-8 | Java | false | false | 2,652 | java | package org.n3r.quartz.glass.web.form;
import org.joda.time.DateTime;
import org.n3r.quartz.glass.job.util.JobDataMapUtils;
import org.n3r.quartz.glass.util.Dates;
import org.quartz.SimpleScheduleBuilder;
import org.quartz.SimpleTrigger;
import org.quartz.Trigger;
import org.quartz.TriggerBuilder;
import javax.validation.constraints.Min;
import java.text.ParseException;
public class SimpleTriggerForm extends TriggerFormSupport implements TriggerForm {
@Min(-1)
protected Integer repeatCount;
@Min(0)
protected Integer intervalInMilliseconds;
public SimpleTriggerForm() {
}
public SimpleTriggerForm(Trigger trigger) {
this.startTime = Dates.copy(trigger.getStartTime());
this.endTime = Dates.copy(trigger.getEndTime());
this.dataMap = JobDataMapUtils.toProperties(trigger.getJobDataMap(), "\n");
this.repeatCount = ((SimpleTrigger) trigger).getRepeatCount();
this.intervalInMilliseconds = (int) ((SimpleTrigger) trigger).getRepeatInterval();
}
public Trigger getTrigger(Trigger trigger) throws ParseException {
fixParameters();
TriggerBuilder<Trigger> builder = TriggerBuilder.newTrigger().forJob(trigger.getJobKey().getName(), trigger.getJobKey().getGroup())
.withIdentity(trigger.getKey().getName(), trigger.getKey().getGroup())
.startAt(startTime).endAt(endTime)
.usingJobData(JobDataMapUtils.fromProperties(dataMap));
if (repeatCount == -1) {
builder.withSchedule(SimpleScheduleBuilder.simpleSchedule().repeatForever()
.withIntervalInMilliseconds(intervalInMilliseconds));
} else {
builder.withSchedule(SimpleScheduleBuilder.simpleSchedule().withRepeatCount(repeatCount)
.withIntervalInMilliseconds(intervalInMilliseconds));
}
return builder.build();
}
public Integer getRepeatCount() {
return repeatCount;
}
public void setRepeatCount(Integer repeatCount) {
this.repeatCount = repeatCount;
}
public Integer getIntervalInMilliseconds() {
return intervalInMilliseconds;
}
public void setIntervalInMilliseconds(Integer intervalInMilliseconds) {
this.intervalInMilliseconds = intervalInMilliseconds;
}
protected void fixParameters() {
if (repeatCount == null) {
repeatCount = 0;
}
if (intervalInMilliseconds == null) {
intervalInMilliseconds = 1000;
}
if (startTime == null) {
startTime = new DateTime().plusSeconds(1).toDate();
}
}
}
| [
"bingoo.huang@gmail.com"
] | bingoo.huang@gmail.com |
6cccc55fecda9d049a7d953558206d76edb2bebd | 13c2d3db2d49c40c74c2e6420a9cd89377f1c934 | /program_data/JavaProgramData/55/1774.java | 2c88a136ff6116a866cb28fd1af46d77253cde68 | [
"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 | 1,477 | java | package <missing>;
public class GlobalMembers
{
public static int Main()
{
String str = new String(new char[50]); //??????????????
final String dest = "";
String trans = new String(new char[36]);
//trans[36]:???0~35???'0'~'9','A'~'Z'????
int a;
int b;
int i;
int d;
int len;
int num = 0; //long??4???????????????31?
for (i = 0;i < 10;i++)
{
trans = tangible.StringFunctions.changeCharacter(trans, i, '0' + i);
}
for (i = 10;i < 36;i++)
{
trans = tangible.StringFunctions.changeCharacter(trans, i, 'A' + i - 10);
}
a = Integer.parseInt(ConsoleInput.readToWhiteSpace(true));
str = ConsoleInput.readToWhiteSpace(true).charAt(0);
b = Integer.parseInt(ConsoleInput.readToWhiteSpace(true));
for (i = 0;str.charAt(i) != '\0';i++)
{ //?????a???????????
if (str.charAt(i) >= '0' && str.charAt(i) <= '9')
{
d = str.charAt(i) - '0';
}
else if (str.charAt(i) >= 'a' && str.charAt(i) <= 'z')
{
d = str.charAt(i) - 'a' + 10;
}
else if (str.charAt(i) >= 'A' && str.charAt(i) <= 'Z')
{
d = str.charAt(i) - 'A' + 10;
}
num = num * a + d;
} //????????????num
i = 0;
do
{ //???b?????????dest???
dest = tangible.StringFunctions.changeCharacter(dest, i++, trans.charAt(num % b)); //???num==0???
num = num / b;
}while (num != 0);
len = dest.length(); //????????????dest????
for (i = len - 1;i >= 0;i--) //????
{
System.out.print(dest.charAt(i));
}
return 0;
}
}
| [
"y.yu@open.ac.uk"
] | y.yu@open.ac.uk |
aa9aba8aa33d2e07c0c27a3bab45fca3ad1fc92b | a23b277bd41edbf569437bdfedad22c2d7733dbe | /projecteuler/P031.java | 6e0dac1c7064b0aa3e97e625857a2ada86fc0b4e | [] | no_license | alexandrofernando/java | 155ed38df33ae8dae641d327be3c6c355b28082a | a783407eaba29a88123152dd5b2febe10eb7bf1d | refs/heads/master | 2021-01-17T06:49:57.241130 | 2019-07-19T11:34:44 | 2019-07-19T11:34:44 | 52,783,678 | 1 | 0 | null | 2017-07-03T21:46:00 | 2016-02-29T10:38:28 | Java | UTF-8 | Java | false | false | 766 | java | public class P031 {
public static void main(String args[]) {
int count = 0;
int rest = 200;
for (int a = 0; a <= rest / 200; a++) {
rest -= a * 200;
for (int b = 0; b <= rest / 100; b++) {
rest -= b * 100;
for (int c = 0; c <= rest / 50; c++) {
rest -= c * 50;
for (int d = 0; d <= rest / 20; d++) {
rest -= d * 20;
for (int e = 0; e <= rest / 10; e++) {
rest -= e * 10;
for (int f = 0; f <= rest / 5; f++) {
rest -= f * 5;
for (int g = 0; g <= rest / 2; g++) {
count++;
}
rest += f * 5;
}
rest += e * 10;
}
rest += d * 20;
}
rest += c * 50;
}
rest += b * 100;
}
rest += a * 200;
}
System.out.println(count);
}
}
| [
"alexandrofernando@gmail.com"
] | alexandrofernando@gmail.com |
e700b43ff5f9b9d7518816a05a4e22ca0ce8b65f | e76364e90190ec020feddc730c78192b32fe88c1 | /neo4j/test/src/test/java/com/buschmais/xo/neo4j/test/modifier/composite/FinalType.java | 130fade841b2a79f4683c9ccd36d402db93bebde | [
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] | permissive | buschmais/extended-objects | 2a8411d81469439a034c11116e34ae799eb57e97 | 0b91a5d55c9a76adba28ddccd6caba699eeaa1fc | refs/heads/master | 2023-08-16T13:33:54.936349 | 2023-06-10T13:44:10 | 2023-06-10T13:44:10 | 14,117,014 | 15 | 5 | Apache-2.0 | 2022-11-02T09:44:17 | 2013-11-04T16:45:59 | Java | UTF-8 | Java | false | false | 210 | java | package com.buschmais.xo.neo4j.test.modifier.composite;
import com.buschmais.xo.api.annotation.Final;
import com.buschmais.xo.neo4j.api.annotation.Label;
@Final
@Label("Final")
public interface FinalType {
}
| [
"dirk.mahler@buschmais.com"
] | dirk.mahler@buschmais.com |
366da066694fc91f43deacd557a3723691f4c683 | 7fa9c6b0fa1d0726ae1cda0199716c811a1ea01b | /Crawler/data/StorageException.java | 50c1863a90c92285b5256354759470dbbc2abec0 | [] | no_license | NayrozD/DD2476-Project | b0ca75799793d8ced8d4d3ba3c43c79bb84a72c0 | 94dfb3c0a470527b069e2e0fd9ee375787ee5532 | refs/heads/master | 2023-03-18T04:04:59.111664 | 2021-03-10T15:03:07 | 2021-03-10T15:03:07 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,373 | java | 18
https://raw.githubusercontent.com/WeBankFinTech/Schedulis/master/azkaban-spi/src/main/java/azkaban/spi/StorageException.java
/*
* Copyright 2017 LinkedIn Corp.
*
* 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 azkaban.spi;
/**
* Super class to capture any exceptions related to {@link Storage}
*/
public class StorageException extends AzkabanException {
public StorageException(final String message) {
this(message, null);
}
public StorageException(final Throwable throwable) {
this(null, throwable);
}
public StorageException(final String message, final Throwable cause) {
super(message, cause);
}
public StorageException(final String message, final Throwable cause,
final boolean enableSuppression, final boolean writableStackTrace) {
super(message, cause, enableSuppression, writableStackTrace);
}
}
| [
"veronika.cucorova@gmail.com"
] | veronika.cucorova@gmail.com |
2afdd4c49ea405adb5dc8ca43e7cff79dbc2efb6 | f3b9602775d2563cb388ec58935c37e2165db8bb | /harry-biz/src/main/java/cn/harry/sys/param/SmsCodeParam.java | 21ae2f5061e63441326f5c1dd95b2b9ebecebe50 | [] | no_license | lijie1024512/harry | 1cb071903b6dbb40a355db13856bff38b2ab4a9e | 9a0777614d9837194b8ba54766f6d0893457550a | refs/heads/master | 2021-01-06T11:47:41.716814 | 2020-02-18T08:49:57 | 2020-02-18T08:49:57 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 512 | java | package cn.harry.sys.param;
import lombok.Data;
import java.util.Map;
/**
* ClassName: SmsCodeParam
* Description:
*
* @author honghh
* Date 2019/08/30 10:13
* Copyright (C) www.tech-harry.cn
*/
@Data
public class SmsCodeParam {
/**
* 手机号
*/
private String mobile;
/**
* 短信类型【非必须】
*/
private Integer msgType;
/**
* 验证码
*/
private String msgCode;
/**
* 参数
*/
private Map<String, String> params;
}
| [
"183865800@qq.com"
] | 183865800@qq.com |
bd6dd1729ed441afb156a5bbd9f88ed52a821393 | b511684052910867af4c32068042b5c7a9d92908 | /LBS_2019-master/lab1/Lab1_Group_11/Assignment1/src/solution0/backEnd/Store.java | 620cc3cde69e8ead7c9428843ee9a6fed919d2a1 | [] | no_license | hchuphal/Chalmers_GU | 5e000e8346e669754a1ae675a65b04d5daa81645 | 68831e266a599fd429dbdf254f9ace7ce0a0c30a | refs/heads/master | 2023-01-19T14:29:20.006127 | 2019-12-01T00:00:53 | 2019-12-01T00:00:53 | 225,082,667 | 1 | 0 | null | 2023-01-09T12:05:50 | 2019-11-30T23:29:22 | Java | UTF-8 | Java | false | false | 1,243 | java | package backEnd;
import java.util.HashMap;
import java.util.Map;
public class Store {
/**
* Store.products is a HashMap with the products and their prices.
* You can access them as:
* Integer price = Store.getProductPrice("book");
*/
public final static Map<String,Integer> products= new HashMap<String,Integer>();
static {
products.put("candies", 1);
products.put("car", 30000);
products.put("pen", 40);
products.put("book", 100);
}
/**
* Returns the product list as a String.
*
* @return product list
*/
public static String asString(){
String res = "";
for (String p : products.keySet()) {
res += p + "\t" + products.get(p) + "\n";
}
return res;
}
/**
* Returns the product list as a String.
*
* @param product product name to get the price of (e.g. "car")
* @return product list
*/
public static Integer getProductPrice(String product) {
if(products.containsKey(product)) {
return products.get(product);
}
throw new IllegalArgumentException("Product " + product + " is not in store");
}
}
| [
"himanshu.chuphal07@gmail.com"
] | himanshu.chuphal07@gmail.com |
eb48b2739c30a4a2cafd9446fc4e648f72c6c828 | 97237ae909bb478c211b11d231a1646ddfa518db | /schema-generation/src/test/java/io/rocketbase/commons/GenerateSchema.java | 7892d32550f79beaf4e52b3f16e619598d3f1545 | [
"MIT"
] | permissive | rocketbase-io/commons-asset | cb45e32b3dea31fd956ec274420a5fd7ef1a5c24 | da12f4e973735e34fafd6b4a8958eacb05a4ff7b | refs/heads/master | 2023-08-11T15:27:07.798739 | 2023-08-01T09:57:27 | 2023-08-01T09:57:27 | 133,913,951 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,273 | java | package io.rocketbase.commons;
import io.rocketbase.commons.model.AssetFileEntity;
import io.rocketbase.commons.model.AssetJpaEntity;
import io.rocketbase.commons.model.ColorPaletteEntity;
import io.rocketbase.commons.model.ResolutionEntity;
import org.hibernate.boot.MetadataSources;
import org.hibernate.boot.registry.StandardServiceRegistryBuilder;
import org.hibernate.service.ServiceRegistry;
import org.hibernate.tool.hbm2ddl.SchemaExport;
import org.hibernate.tool.schema.TargetType;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.Map;
public class GenerateSchema {
@Disabled
@Test
public void generateEntity() {
Map<String, String> settings = new HashMap<>();
settings.put("connection.driver_class", "org.mariadb.jdbc.Driver");
settings.put("dialect", "org.hibernate.dialect.MariaDB103Dialect");
settings.put("hibernate.connection.url", "jdbc:mysql://localhost:3306/generate");
settings.put("hibernate.connection.username", "root");
settings.put("hibernate.connection.password", "my-secret-pw");
settings.put("hibernate.show_sql", "true");
settings.put("hibernate.format_sql", "true");
ServiceRegistry serviceRegistry =
new StandardServiceRegistryBuilder().applySettings(settings).build();
MetadataSources metadata =
new MetadataSources(serviceRegistry);
metadata.addAnnotatedClass(AssetJpaEntity.class);
metadata.addAnnotatedClass(ColorPaletteEntity.class);
metadata.addAnnotatedClass(ResolutionEntity.class);
EnumSet<TargetType> enumSet = EnumSet.of(TargetType.SCRIPT);
SchemaExport schemaExport = new SchemaExport();
schemaExport.setDelimiter(";");
schemaExport.setFormat(true);
schemaExport.setOutputFile("schema-entity.sql");
schemaExport.execute(enumSet, SchemaExport.Action.CREATE, metadata.buildMetadata());
}
@Disabled
@Test
public void generateStorage() {
Map<String, String> settings = new HashMap<>();
settings.put("connection.driver_class", "org.mariadb.jdbc.Driver");
settings.put("dialect", "org.hibernate.dialect.MariaDB103Dialect");
settings.put("hibernate.connection.url", "jdbc:mysql://localhost:3306/generate");
settings.put("hibernate.connection.username", "root");
settings.put("hibernate.connection.password", "my-secret-pw");
settings.put("hibernate.show_sql", "true");
settings.put("hibernate.format_sql", "true");
ServiceRegistry serviceRegistry =
new StandardServiceRegistryBuilder().applySettings(settings).build();
MetadataSources metadata =
new MetadataSources(serviceRegistry);
metadata.addAnnotatedClass(AssetFileEntity.class);
EnumSet<TargetType> enumSet = EnumSet.of(TargetType.SCRIPT);
SchemaExport schemaExport = new SchemaExport();
schemaExport.setDelimiter(";");
schemaExport.setFormat(true);
schemaExport.setOutputFile("schema-storage.sql");
schemaExport.execute(enumSet, SchemaExport.Action.CREATE, metadata.buildMetadata());
}
}
| [
"marten@rocketbase.io"
] | marten@rocketbase.io |
43a3089033135286d862910ccc06bab35736aa16 | b1f85025dac46da921641a71b2edc39e67ae9f23 | /src/main/java/jpabook/jpashop/controller/ItemController.java | 80df19a0560c196d182b31511c0d71601175030c | [] | no_license | jithub91516/Springboot_Jpa_WebAppShop | 772dbd42507fc19783b566437404ea3a4fe9a5d2 | 355f6e6d1fa11c99c23d2000709beaa8387b07ba | refs/heads/master | 2023-03-25T12:34:12.181803 | 2021-03-02T07:12:11 | 2021-03-02T07:12:11 | 340,302,992 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,534 | java | package jpabook.jpashop.controller;
import com.sun.org.apache.xpath.internal.operations.Mod;
import jpabook.jpashop.domain.item.Book;
import jpabook.jpashop.domain.item.Item;
import jpabook.jpashop.service.ItemService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import java.util.List;
@Controller
@RequiredArgsConstructor
public class ItemController {
private final ItemService itemService;
@GetMapping("/items/new")
public String createForm(Model model) {
model.addAttribute("form", new BookForm());
return "items/createItemForm";
}
@PostMapping("/items/new")
public String create(BookForm form) {
Book book = new Book();
book.setName(form.getName());
book.setPrice(form.getPrice());
book.setStockQuantity(form.getStockQuantity());
book.setAuthor(form.getAuthor());
book.setIsbn(form.getIsbn());
itemService.saveItem(book);
return "redirect:/";
}
@GetMapping("/items")
public String list(Model model) {
List<Item> items = itemService.findItems();
model.addAttribute("items", items);
return "items/itemList";
}
@GetMapping("items/{itemId}/edit")
public String updateItemForm(@PathVariable("itemId") Long itemId, Model model){
Book item = (Book) itemService.findOne(itemId);
BookForm form = new BookForm();
form.setId(item.getId());
form.setName(item.getName());
form.setPrice(item.getPrice());
form.setStockQuantity(item.getStockQuantity());
form.setAuthor(item.getAuthor());
form.setIsbn(item.getIsbn());
model.addAttribute("form", form);
return "items/updatesItemForm";
}
@PostMapping("items/{itemId}/edit")
public String updateItem(@ModelAttribute("form") BookForm form){
Book book = new Book();
book.setId(form.getId());
book.setName(form.getName());
book.setPrice(form.getPrice());
book.setStockQuantity(form.getStockQuantity());
book.setAuthor(form.getAuthor());
book.setIsbn(form.getIsbn());
itemService.saveItem(book);
return "redirect:/items";
}
}
| [
"a"
] | a |
c3b5b367b095877276369dea542fee9d755f100b | 7a09529b402c0f55ff13b40dea3dcb9bbca9e004 | /src/main/java/com/oilseller/oilbrocker/product/adaptor/ProductParamAdaptor.java | 067f8a6f66aec8801a911e56d8963d5e3445d59b | [] | no_license | ruchiraPeiris/EasyOil | b3ba1c9b27d98a41abab7067fe5092e539be4165 | 46256f7ad5d522a7a4bdb2c6028fcfc3e6a02d6f | refs/heads/master | 2020-04-20T02:21:27.145204 | 2018-07-30T05:33:46 | 2018-07-30T05:33:46 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,090 | java | package com.oilseller.oilbrocker.product.adaptor;
import com.oilseller.oilbrocker.platform.adaptor.AbstractParamAdaptor;
import com.oilseller.oilbrocker.platform.util.DateUtil;
import com.oilseller.oilbrocker.product.dto.Product;
import com.oilseller.oilbrocker.product.param.ProductParam;
import org.modelmapper.PropertyMap;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.text.ParseException;
public class ProductParamAdaptor extends AbstractParamAdaptor<ProductParam, Product> {
private static final Logger log = LoggerFactory.getLogger(ProductParamAdaptor.class);
public ProductParamAdaptor() {
super(ProductParam.class, Product.class);
}
@Override
public ProductParam fromDto(Product product) {
ProductParam productParam = super.fromDto(product);
productParam.setValidUntil(DateUtil.toSimpleDateWithoutTime(product.getValidTo()));
productParam.setCreatedDate(DateUtil.toSimpleDate(product.getCreatedDate()));
productParam.setLastModifiedDate(DateUtil.toSimpleDate(product.getLastModifiedDate()));
return productParam;
}
@Override
public Product fromParam(ProductParam document) {
document.setLastModifiedDate(null);
document.setCreatedDate(null);
Product product = super.fromParam(document);
try {
product.setValidTo(DateUtil.fromSimpleDateStringToSimpleDate(document.getValidUntil()));
} catch (ParseException e) {
log.error("Invalid Date Option", e);
throw new RuntimeException(e);
}
return product;
}
@Override
protected PropertyMap<ProductParam, Product> fromParamMappings() {
return new PropertyMap<ProductParam, Product>() {
@Override
protected void configure() {
}
};
}
@Override
protected PropertyMap<Product, ProductParam> fromDtoMappings() {
return new PropertyMap<Product, ProductParam>() {
@Override
protected void configure() {
}
};
}
}
| [
"kasunsk@gmail.com"
] | kasunsk@gmail.com |
04ac1f30f275c617a2877115ae2457d3a46ae8b3 | 6f23fc4fb0f6f35ae7b341e2f1b129bb1b498710 | /kcbpay/build/generated-sources/ap-source-output/objects/Token_.java | 29be5c52eeb18137df8ed9815de516b1423b6bb9 | [] | no_license | menty44/paysurefred | adaa73008b7a050f938d729f759b4c9c8ec86332 | f94fff5e4a0034e53bf724adc8fb3204078871e0 | refs/heads/master | 2020-06-18T03:42:46.900270 | 2016-11-28T09:18:18 | 2016-11-28T09:18:18 | 74,952,417 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,707 | java | package objects;
import java.util.Date;
import javax.annotation.Generated;
import javax.persistence.metamodel.SingularAttribute;
import javax.persistence.metamodel.StaticMetamodel;
import objects.Country;
import objects.Gender;
import objects.Merchant;
import objects.Responsecode;
import objects.Status;
import objects.Transactionsource;
import objects.Transactiontype;
@Generated(value="EclipseLink-2.3.0.v20110604-r9504", date="2014-02-28T11:17:43")
@StaticMetamodel(Token.class)
public class Token_ {
public static volatile SingularAttribute<Token, String> transactionindex;
public static volatile SingularAttribute<Token, Transactiontype> transactiontype;
public static volatile SingularAttribute<Token, String> recievinginstitution;
public static volatile SingularAttribute<Token, Date> paysuredate;
public static volatile SingularAttribute<Token, Responsecode> responsecode;
public static volatile SingularAttribute<Token, String> expirydate;
public static volatile SingularAttribute<Token, Integer> securitycode;
public static volatile SingularAttribute<Token, String> currency;
public static volatile SingularAttribute<Token, String> clientname;
public static volatile SingularAttribute<Token, Integer> id;
public static volatile SingularAttribute<Token, Integer> amount;
public static volatile SingularAttribute<Token, String> tokeno;
public static volatile SingularAttribute<Token, String> token;
public static volatile SingularAttribute<Token, String> description;
public static volatile SingularAttribute<Token, String> referenceno;
public static volatile SingularAttribute<Token, Integer> age;
public static volatile SingularAttribute<Token, Country> countryofresidence;
public static volatile SingularAttribute<Token, String> instruction;
public static volatile SingularAttribute<Token, Integer> shippingcost;
public static volatile SingularAttribute<Token, String> nameoncard;
public static volatile SingularAttribute<Token, Date> tokendate;
public static volatile SingularAttribute<Token, String> systemtraceno;
public static volatile SingularAttribute<Token, Status> statusid;
public static volatile SingularAttribute<Token, String> transmission;
public static volatile SingularAttribute<Token, Merchant> merchantid;
public static volatile SingularAttribute<Token, Gender> genderid;
public static volatile SingularAttribute<Token, String> email;
public static volatile SingularAttribute<Token, String> secret;
public static volatile SingularAttribute<Token, Integer> visits;
public static volatile SingularAttribute<Token, Transactionsource> transactionsourceid;
} | [
"fred.oluoch@impalapay.com"
] | fred.oluoch@impalapay.com |
af0a161e432316573a2a50d5aa6de270a4faa479 | 71838e28ed38d430906328d8d7ed3ff670d93080 | /src/main/java/biweekly/io/scribe/property/ListPropertyScribe.java | b454a94bef961dae2e0b5f461c2884ebfad36514 | [
"BSD-2-Clause",
"BSD-2-Clause-Views"
] | permissive | mangstadt/biweekly | 392183392afb4927de24693b106dedb44b2faf20 | 11f8d247d1b6c6cf6fd26fbdc07d114a5eab7861 | refs/heads/master | 2023-09-02T14:11:10.973445 | 2023-02-17T02:12:12 | 2023-02-17T02:12:12 | 46,665,210 | 320 | 59 | NOASSERTION | 2021-12-23T14:20:31 | 2015-11-22T14:57:45 | Java | UTF-8 | Java | false | false | 4,985 | java | package biweekly.io.scribe.property;
import java.util.ArrayList;
import java.util.List;
import biweekly.ICalDataType;
import biweekly.io.ParseContext;
import biweekly.io.WriteContext;
import biweekly.io.json.JCalValue;
import biweekly.io.xml.XCalElement;
import biweekly.parameter.ICalParameters;
import biweekly.property.ListProperty;
import com.github.mangstadt.vinnie.io.VObjectPropertyValues;
/*
Copyright (c) 2013-2023, Michael Angstadt
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.
*/
/**
* Marshals properties that contain a list of values.
* @param <T> the property class
* @param <V> the value class
* @author Michael Angstadt
*/
public abstract class ListPropertyScribe<T extends ListProperty<V>, V> extends ICalPropertyScribe<T> {
public ListPropertyScribe(Class<T> clazz, String propertyName) {
this(clazz, propertyName, ICalDataType.TEXT);
}
public ListPropertyScribe(Class<T> clazz, String propertyName, ICalDataType dataType) {
super(clazz, propertyName, dataType);
}
@Override
protected String _writeText(final T property, WriteContext context) {
List<V> values = property.getValues();
List<String> valuesStr = new ArrayList<String>(values.size());
for (V value : values) {
String valueStr = writeValue(property, value, context);
valuesStr.add(valueStr);
}
switch (context.getVersion()) {
case V1_0:
return VObjectPropertyValues.writeSemiStructured(valuesStr, false, true);
default:
return VObjectPropertyValues.writeList(valuesStr);
}
}
@Override
protected T _parseText(String value, ICalDataType dataType, ICalParameters parameters, ParseContext context) {
List<String> values;
switch (context.getVersion()) {
case V1_0:
values = VObjectPropertyValues.parseSemiStructured(value);
break;
default:
values = VObjectPropertyValues.parseList(value);
break;
}
return parse(values, dataType, parameters, context);
}
@Override
protected void _writeXml(T property, XCalElement element, WriteContext context) {
for (V value : property.getValues()) {
String valueStr = writeValue(property, value, null);
element.append(dataType(property, null), valueStr);
}
}
@Override
protected T _parseXml(XCalElement element, ICalParameters parameters, ParseContext context) {
ICalDataType dataType = defaultDataType(context.getVersion());
List<String> values = element.all(dataType);
if (!values.isEmpty()) {
return parse(values, dataType, parameters, context);
}
throw missingXmlElements(dataType);
}
@Override
protected JCalValue _writeJson(T property, WriteContext context) {
List<V> values = property.getValues();
if (!values.isEmpty()) {
return JCalValue.multi(property.getValues());
}
return JCalValue.single("");
}
@Override
protected T _parseJson(JCalValue value, ICalDataType dataType, ICalParameters parameters, ParseContext context) {
return parse(value.asMulti(), dataType, parameters, context);
}
private T parse(List<String> valueStrs, ICalDataType dataType, ICalParameters parameters, ParseContext context) {
T property = newInstance(dataType, parameters);
List<V> values = property.getValues();
for (String valueStr : valueStrs) {
V value = readValue(property, valueStr, dataType, parameters, context);
values.add(value);
}
return property;
}
protected abstract T newInstance(ICalDataType dataType, ICalParameters parameters);
protected abstract String writeValue(T property, V value, WriteContext context);
protected abstract V readValue(T property, String value, ICalDataType dataType, ICalParameters parameters, ParseContext context);
}
| [
"mike.angstadt@gmail.com"
] | mike.angstadt@gmail.com |
1ad1e9d1d87aac8b261808a04c93a2cc4478f072 | cfc60fc1148916c0a1c9b421543e02f8cdf31549 | /src/testcases/CWE369_Divide_By_Zero/CWE369_Divide_By_Zero__console_readLine_modulo_53d.java | 82282766ce7b9c1909f02ff4baa3ee84f504d966 | [
"LicenseRef-scancode-public-domain"
] | permissive | zhujinhua/GitFun | c77c8c08e89e61006f7bdbc5dd175e5d8bce8bd2 | 987f72fdccf871ece67f2240eea90e8c1971d183 | refs/heads/master | 2021-01-18T05:46:03.351267 | 2012-09-11T16:43:44 | 2012-09-11T16:43:44 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,899 | java | /* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE369_Divide_By_Zero__console_readLine_modulo_53d.java
Label Definition File: CWE369_Divide_By_Zero.label.xml
Template File: sources-sinks-53d.tmpl.java
*/
/*
* @description
* CWE: 369 Divide by zero
* BadSource: console_readLine Read data from the console using readLine
* GoodSource: A hardcoded non-zero, non-min, non-max, even number
* Sinks: modulo
* GoodSink: Check for zero before modulo
* BadSink : Modulo by a value that may be zero
* Flow Variant: 53 Data flow: data passed as an argument from one method through two others to a fourth; all four functions are in different classes in the same package
*
* */
package testcases.CWE369_Divide_By_Zero;
import testcasesupport.*;
import java.sql.*;
import javax.servlet.http.*;
import java.security.SecureRandom;
public class CWE369_Divide_By_Zero__console_readLine_modulo_53d
{
public void bad_sink(int data ) throws Throwable
{
/* POTENTIAL FLAW: Zero modulus will cause an issue. An integer division will
result in an exception. */
IO.writeLine("100%" + String.valueOf(data) + " = " + (100 % data) + "\n");
}
/* goodG2B() - use goodsource and badsink */
public void goodG2B_sink(int data ) throws Throwable
{
/* POTENTIAL FLAW: Zero modulus will cause an issue. An integer division will
result in an exception. */
IO.writeLine("100%" + String.valueOf(data) + " = " + (100 % data) + "\n");
}
/* goodB2G() - use badsource and goodsink */
public void goodB2G_sink(int data ) throws Throwable
{
/* FIX: test for a zero modulus */
if( data != 0 )
{
IO.writeLine("100%" + String.valueOf(data) + " = " + (100 % data) + "\n");
}
else
{
IO.writeLine("This would result in a modulo by zero");
}
}
}
| [
"amitf@chackmarx.com"
] | amitf@chackmarx.com |
1a6f1e5631b1cce1a6e48880acbd04c20164f0b8 | 4212bc421b17d1ec97f7b10de55690ad4049b143 | /src/lesson9interfacesinheritance/measure4/Measurable.java | a6b0a010f030b87a70d9079793cd3160b10c51a8 | [] | no_license | ver2point0/UdacityCoursework | b5d8a0919230d40084a68a2bb24ae4c3b9b159ba | a593ff97f9be6c6240a5533c1aa2e613c03e2c64 | refs/heads/master | 2020-03-30T20:59:49.753876 | 2016-01-28T19:35:45 | 2016-01-28T19:35:45 | 41,003,965 | 0 | 0 | null | 2015-09-23T06:13:14 | 2015-08-19T00:16:08 | Java | UTF-8 | Java | false | false | 256 | java | package lesson9interfacesinheritance.measure4;//HIDE
/**
Describes any class whose objects can be measured.
*/
public interface Measurable
{
/**
Computes the measure of the object.
@return the measure
*/
double getMeasure();
}
| [
"jmci10@hotmail.com"
] | jmci10@hotmail.com |
3c16d1f002ca0e7f08e04c631cca3101786713c9 | cc117181e062adb9a7417d0215750606d20540a2 | /ureport2-core/src/main/java/com/bstek/ureport/export/excel/high/builder/ExcelBuilder.java | d1cd7d5f3def64c78bb578b66f20a1e9fe97a553 | [
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-warranty-disclaimer",
"Apache-2.0"
] | permissive | SpencerZhang/ureport | a5c461b402ec78671308b7907dbf55ae2d66899d | f8a401ecdfbd42213be2006a483a8ff71bad4184 | refs/heads/master | 2020-12-03T17:10:36.863805 | 2020-01-04T08:12:56 | 2020-01-04T08:12:56 | 231,402,811 | 2 | 0 | Apache-2.0 | 2020-01-02T14:54:40 | 2020-01-02T14:54:39 | null | UTF-8 | Java | false | false | 5,293 | java | /*******************************************************************************
* Copyright 2017 Bstek
*
* 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.bstek.ureport.export.excel.high.builder;
import java.util.List;
import org.apache.poi.ss.usermodel.PaperSize;
import org.apache.poi.ss.usermodel.PrintOrientation;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.streaming.SXSSFWorkbook;
import org.apache.poi.xssf.usermodel.XSSFPrintSetup;
import com.bstek.ureport.definition.Orientation;
import com.bstek.ureport.definition.Paper;
import com.bstek.ureport.definition.PaperType;
import com.bstek.ureport.model.Column;
import com.bstek.ureport.model.Image;
import com.bstek.ureport.model.Row;
import com.bstek.ureport.utils.UnitUtils;
/**
* @author Jacky.gao
* @since 2017年8月10日
*/
public abstract class ExcelBuilder {
protected int getWholeWidth(List<Column> columns,int colNumber,int colSpan){
Column col=columns.get(colNumber);
int start=colNumber+1,end=colNumber+colSpan;
int w=col.getWidth();
for(int i=start;i<end;i++){
Column c=columns.get(i);
w+=c.getWidth();
}
w=UnitUtils.pointToPixel(w);
return w;
}
protected int getWholeHeight(List<Row> rows,int rowNumber,int rowSpan){
Row row=rows.get(rowNumber);
int start=rowNumber+1,end=rowNumber+rowSpan;
int h=row.getRealHeight();
for(int i=start;i<end;i++){
Row r=rows.get(i);
h+=r.getRealHeight();
}
h=UnitUtils.pointToPixel(h);
return h;
}
protected Sheet createSheet(SXSSFWorkbook wb,Paper paper,String name){
Sheet sheet = null;
if(name==null){
sheet=wb.createSheet();
}else{
sheet=wb.createSheet(name);
}
PaperType paperType=paper.getPaperType();
XSSFPrintSetup printSetup=(XSSFPrintSetup)sheet.getPrintSetup();
Orientation orientation=paper.getOrientation();
if(orientation.equals(Orientation.landscape)){
printSetup.setOrientation(PrintOrientation.LANDSCAPE);
}
setupPaper(paperType, printSetup);
int leftMargin=paper.getLeftMargin();
int rightMargin=paper.getRightMargin();
int topMargin=paper.getTopMargin();
int bottomMargin=paper.getBottomMargin();
sheet.setMargin(Sheet.LeftMargin, UnitUtils.pointToInche(leftMargin));
sheet.setMargin(Sheet.RightMargin, UnitUtils.pointToInche(rightMargin));
sheet.setMargin(Sheet.TopMargin, UnitUtils.pointToInche(topMargin));
sheet.setMargin(Sheet.BottomMargin, UnitUtils.pointToInche(bottomMargin));
return sheet;
}
protected int buildImageFormat(Image img){
int type=Workbook.PICTURE_TYPE_PNG;
String path=img.getPath();
if(path==null){
return type;
}
path=path.toLowerCase();
if(path.endsWith("jpg") || path.endsWith("jpeg")){
type=Workbook.PICTURE_TYPE_JPEG;
}
return type;
}
protected boolean setupPaper(PaperType paperType, XSSFPrintSetup printSetup) {
boolean setup=false;
switch(paperType){
case A0:
printSetup.setPaperSize(PaperSize.A4_PAPER);
break;
case A1:
printSetup.setPaperSize(PaperSize.A4_PAPER);
break;
case A2:
printSetup.setPaperSize(PaperSize.A4_PAPER);
break;
case A3:
printSetup.setPaperSize(PaperSize.A3_PAPER);
setup=true;
break;
case A4:
printSetup.setPaperSize(PaperSize.A4_PAPER);
setup=true;
break;
case A5:
printSetup.setPaperSize(PaperSize.A5_PAPER);
setup=true;
break;
case A6:
printSetup.setPaperSize(PaperSize.A4_PAPER);
break;
case A7:
printSetup.setPaperSize(PaperSize.A4_PAPER);
break;
case A8:
printSetup.setPaperSize(PaperSize.A4_PAPER);
break;
case A9:
printSetup.setPaperSize(PaperSize.A4_PAPER);
break;
case A10:
printSetup.setPaperSize(PaperSize.A4_PAPER);
break;
case B0:
printSetup.setPaperSize(PaperSize.A4_PAPER);
break;
case B1:
printSetup.setPaperSize(PaperSize.A4_PAPER);
break;
case B2:
printSetup.setPaperSize(PaperSize.A4_PAPER);
break;
case B3:
printSetup.setPaperSize(PaperSize.A4_PAPER);
break;
case B4:
printSetup.setPaperSize(PaperSize.B4_PAPER);
setup=true;
break;
case B5:
printSetup.setPaperSize(PaperSize.B4_PAPER);
setup=true;
break;
case B6:
printSetup.setPaperSize(PaperSize.A4_PAPER);
break;
case B7:
printSetup.setPaperSize(PaperSize.A4_PAPER);
break;
case B8:
printSetup.setPaperSize(PaperSize.A4_PAPER);
break;
case B9:
printSetup.setPaperSize(PaperSize.A4_PAPER);
break;
case B10:
printSetup.setPaperSize(PaperSize.A4_PAPER);
break;
case CUSTOM:
printSetup.setPaperSize(PaperSize.A4_PAPER);
break;
}
return setup;
}
}
| [
"jacky6024@sina.com"
] | jacky6024@sina.com |
8ae0f9151d9a5ba1057d593fc6b49ef3a5f523f8 | 451c688f19b4e7beab97ef3497611b7069ab795e | /src/main/java/com/xjf/springboot/controller/MainController.java | 835f22968c64b5458bb7ff4e650f2b30e26f5148 | [] | no_license | fanrendale/spring-boot-gradle-security | 1ac46e07739fdae86c46a8a9cff92a1d30bd2a0e | e682de6a4961905b9d1f64ea1e21362d5e445b10 | refs/heads/master | 2020-04-20T18:14:56.287723 | 2019-02-04T04:56:39 | 2019-02-04T04:56:39 | 169,014,189 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 792 | java | package com.xjf.springboot.controller;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
/**
* 主页控制器
* @author xjf
* @date 2019/2/4 10:33
*/
@Controller
public class MainController {
@GetMapping("/")
public String root(){
return "redirect:/index";
}
@GetMapping("/index")
public String index(){
return "index";
}
@GetMapping("/login")
public String login(){
return "login";
}
@GetMapping("/login-error")
public String loginError(Model model){
model.addAttribute("loginError",true);
model.addAttribute("errorMsg","登录失败,用户名或密码错误!");
return "login";
}
}
| [
"1053314919@qq.com"
] | 1053314919@qq.com |
ffe0734f72072fc6657807f714a6b2c948e7e05c | f75b9b95125ea1353dd40a09ecb345fd84b31bc8 | /jOOQ-examples/jOOQ-kotlin-example/src/main/java/org/jooq/example/db/h2/tables/BookStore.java | a69d822a547e1ac0d95ff439140bafc02cb3d09a | [
"Apache-2.0"
] | permissive | martom87/jOOQ | 8faefa8394f6753274ba0a4aa9779309b281640f | 389b1b17eb3638a6f75402ce95f64c0c538f39c9 | refs/heads/master | 2021-01-24T08:34:14.453458 | 2017-06-05T08:41:32 | 2017-06-05T08:41:32 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | true | 3,244 | java | /*
* This file is generated by jOOQ.
*/
package org.jooq.example.db.h2.tables;
import java.util.Arrays;
import java.util.List;
import javax.annotation.Generated;
import org.jooq.Field;
import org.jooq.Name;
import org.jooq.Schema;
import org.jooq.Table;
import org.jooq.TableField;
import org.jooq.UniqueKey;
import org.jooq.example.db.h2.Keys;
import org.jooq.example.db.h2.Public;
import org.jooq.example.db.h2.tables.records.BookStoreRecord;
import org.jooq.impl.DSL;
import org.jooq.impl.TableImpl;
/**
* This class is generated by jOOQ.
*/
@Generated(
value = {
"http://www.jooq.org",
"jOOQ version:3.10.0"
},
comments = "This class is generated by jOOQ"
)
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class BookStore extends TableImpl<BookStoreRecord> {
private static final long serialVersionUID = -598409034;
/**
* The reference instance of <code>PUBLIC.BOOK_STORE</code>
*/
public static final BookStore BOOK_STORE = new BookStore();
/**
* The class holding records for this type
*/
@Override
public Class<BookStoreRecord> getRecordType() {
return BookStoreRecord.class;
}
/**
* The column <code>PUBLIC.BOOK_STORE.NAME</code>.
*/
public final TableField<BookStoreRecord, String> NAME = createField("NAME", org.jooq.impl.SQLDataType.VARCHAR.length(400).nullable(false), this, "");
/**
* Create a <code>PUBLIC.BOOK_STORE</code> table reference
*/
public BookStore() {
this(DSL.name("BOOK_STORE"), null);
}
/**
* Create an aliased <code>PUBLIC.BOOK_STORE</code> table reference
*/
public BookStore(String alias) {
this(DSL.name(alias), BOOK_STORE);
}
/**
* Create an aliased <code>PUBLIC.BOOK_STORE</code> table reference
*/
public BookStore(Name alias) {
this(alias, BOOK_STORE);
}
private BookStore(Name alias, Table<BookStoreRecord> aliased) {
this(alias, aliased, null);
}
private BookStore(Name alias, Table<BookStoreRecord> aliased, Field<?>[] parameters) {
super(alias, null, aliased, parameters, "");
}
/**
* {@inheritDoc}
*/
@Override
public Schema getSchema() {
return Public.PUBLIC;
}
/**
* {@inheritDoc}
*/
@Override
public UniqueKey<BookStoreRecord> getPrimaryKey() {
return Keys.UK_T_BOOK_STORE_NAME;
}
/**
* {@inheritDoc}
*/
@Override
public List<UniqueKey<BookStoreRecord>> getKeys() {
return Arrays.<UniqueKey<BookStoreRecord>>asList(Keys.UK_T_BOOK_STORE_NAME);
}
/**
* {@inheritDoc}
*/
@Override
public BookStore as(String alias) {
return new BookStore(DSL.name(alias), this);
}
/**
* {@inheritDoc}
*/
@Override
public BookStore as(Name alias) {
return new BookStore(alias, this);
}
/**
* Rename this table
*/
@Override
public BookStore rename(String name) {
return new BookStore(DSL.name(name), null);
}
/**
* Rename this table
*/
@Override
public BookStore rename(Name name) {
return new BookStore(name, null);
}
}
| [
"lukas.eder@gmail.com"
] | lukas.eder@gmail.com |
5fb01f41bd27aed63616878183146fb32b8a261e | b8f680a3d5f9fa4a6c28fe5dbfc479ecb1079685 | /src/ANXGallery/sources/com/miui/gallery/assistant/utils/ImageFeatureItemUtils.java | 250bdd98d75380500f0664bbd4d28e3c5661b021 | [] | no_license | nckmml/ANXGallery | fb6d4036f5d730f705172e524a038f9b62984c4c | 392f7a28a34556b6784979dd5eddcd9e4ceaaa69 | refs/heads/master | 2020-12-19T05:07:14.669897 | 2020-01-22T15:56:10 | 2020-01-22T15:56:10 | 235,607,907 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 1,518 | java | package com.miui.gallery.assistant.utils;
import android.text.TextUtils;
import com.miui.gallery.assistant.model.ImageFeature;
import com.miui.gallery.assistant.model.ImageFeatureItem;
import com.miui.gallery.dao.GalleryEntityManager;
import com.miui.gallery.util.MiscUtil;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
public class ImageFeatureItemUtils<E extends ImageFeatureItem> {
public void bindImageFeatures(List<E> list) {
if (MiscUtil.isValid(list)) {
ArrayList arrayList = new ArrayList(list.size());
for (E mediaId : list) {
arrayList.add(Long.valueOf(mediaId.getMediaId()));
}
List<ImageFeature> query = GalleryEntityManager.getInstance().query(ImageFeature.class, String.format("%s IN (%s)", new Object[]{"imageId", TextUtils.join(",", arrayList)}), (String[]) null, "createTime DESC", (String) null);
if (MiscUtil.isValid(query)) {
for (E e : list) {
Iterator<ImageFeature> it = query.iterator();
while (true) {
if (!it.hasNext()) {
break;
}
ImageFeature next = it.next();
if (next.getImageId() == e.getMediaId()) {
e.setImageFeature(next);
break;
}
}
}
}
}
}
}
| [
"nico.kuemmel@gmail.com"
] | nico.kuemmel@gmail.com |
e14d689c7c3f161c4cce81899a5fc1b4b2a6d49d | 647ec12ce50f06e7380fdbfb5b71e9e2d1ac03b4 | /com.tencent.minihd.qq/assets/exlibs.3.jar/classes.jar/com/tencent/smtt/sdk/a/c.java | 1887cd2594e707451e9981d1295805263596ea46 | [] | 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,608 | java | package com.tencent.smtt.sdk.a;
import android.text.TextUtils;
import java.util.List;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
public class c
{
private String a;
private String b;
private Integer c;
private String d;
private String e;
private Integer f;
private Integer g;
private List<Integer> h;
public String a()
{
JSONObject localJSONObject = new JSONObject();
Object localObject = new JSONObject();
try
{
if (!TextUtils.isEmpty(this.a)) {
((JSONObject)localObject).put("PP", this.a);
}
if (!TextUtils.isEmpty(this.b)) {
((JSONObject)localObject).put("PPVN", this.b);
}
if (this.c != null) {
((JSONObject)localObject).put("ADRV", this.c);
}
if (!TextUtils.isEmpty(this.d)) {
((JSONObject)localObject).put("MODEL", this.d);
}
if (!TextUtils.isEmpty(this.e)) {
((JSONObject)localObject).put("NAME", this.e);
}
if (this.f != null) {
((JSONObject)localObject).put("SDKVC", this.f);
}
if (this.g != null) {
((JSONObject)localObject).put("COMPVC", this.g);
}
localJSONObject.put("terminal_params", localObject);
if (this.h != null)
{
localObject = new JSONArray();
int i = 0;
while (i < this.h.size())
{
((JSONArray)localObject).put(this.h.get(i));
i += 1;
}
localJSONObject.put("ids", localObject);
}
}
catch (JSONException localJSONException)
{
for (;;)
{
localJSONException.printStackTrace();
}
}
return localJSONObject.toString();
}
public void a(Integer paramInteger)
{
this.c = paramInteger;
}
public void a(String paramString)
{
this.a = paramString;
}
public void a(List<Integer> paramList)
{
this.h = paramList;
}
public void b(Integer paramInteger)
{
this.f = paramInteger;
}
public void b(String paramString)
{
this.b = paramString;
}
public void c(Integer paramInteger)
{
this.g = paramInteger;
}
public void c(String paramString)
{
this.d = paramString;
}
public void d(String paramString)
{
this.e = paramString;
}
}
/* Location: L:\local\mybackup\temp\qq_apk\com.tencent.minihd.qq\assets\exlibs.3.jar\classes.jar
* Qualified Name: com.tencent.smtt.sdk.a.c
* JD-Core Version: 0.7.0.1
*/ | [
"98632993+tsuzcx@users.noreply.github.com"
] | 98632993+tsuzcx@users.noreply.github.com |
d1390ac6024958f5d30492514a96bbd2b1e8f636 | f222dbc0c70f2372179c01ca9e6f7310ab624d63 | /store/src/java/com/zimbra/cs/account/AuthTokenRegistry.java | 4e21247d3b436eff01ef3021685cff65efca347c | [] | no_license | Prashantsurana/zm-mailbox | 916480997851f55d4b2de1bc8034c2187ed34dda | 2fb9a0de108df9c2cd530fe3cb2da678328b819d | refs/heads/develop | 2021-01-23T01:07:59.215154 | 2017-05-26T09:18:30 | 2017-05-26T10:36:04 | 85,877,552 | 1 | 0 | null | 2017-03-22T21:23:04 | 2017-03-22T21:23:04 | null | UTF-8 | Java | false | false | 5,073 | java | /*
* ***** BEGIN LICENSE BLOCK *****
* Zimbra Collaboration Suite Server
* Copyright (C) 2014, 2016 Synacor, Inc.
*
* 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,
* version 2 of the License.
*
* 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 <https://www.gnu.org/licenses/>.
* ***** END LICENSE BLOCK *****
*/
package com.zimbra.cs.account;
import java.util.Arrays;
import java.util.List;
import java.util.TimerTask;
import java.util.concurrent.ConcurrentLinkedQueue;
import com.zimbra.common.localconfig.LC;
import com.zimbra.common.service.ServiceException;
import com.zimbra.common.util.Log;
import com.zimbra.common.util.LogFactory;
import com.zimbra.cs.account.soap.SoapProvisioning;
import com.zimbra.cs.util.Zimbra;
import com.zimbra.soap.admin.message.RefreshRegisteredAuthTokensRequest;
/**
*
* @author gsolovyev
* a registry of authtokens that have been deregistered (logged out) and need to be broadcasted to other servers.
* This class implements storage of tokens as a queue limited in size by {@link LC#zimbra_deregistered_authtoken_queue_size}
* and a {@link TimerTask} task responsible for broadcasting the queue to other servers.
* TODO: switch to using a global shared registry such as Redis or a subscription based notification mechanism such as RabbitMQ
*/
public final class AuthTokenRegistry {
private static final Log mLOG = LogFactory.getLog(AuthTokenRegistry.class);
//queue of deregistered authtokens
final private static ConcurrentLinkedQueue<ZimbraAuthToken> deregisteredOutAuthTokens = new ConcurrentLinkedQueue<ZimbraAuthToken>();
/**
* adds a token to the queue of deregistered tokens
* @param token
*/
final public static void addTokenToQueue(ZimbraAuthToken token) {
while(deregisteredOutAuthTokens.size() > LC.zimbra_deregistered_authtoken_queue_size.intValue() && !deregisteredOutAuthTokens.isEmpty()) {
//throw out oldest tokens to make space
deregisteredOutAuthTokens.remove();
}
deregisteredOutAuthTokens.add(token);
}
/**
* starts up the {@link TimerTask} for broadcasting the queue to other servers
* @param interval
*/
public static void startup(long interval) {
Zimbra.sTimer.schedule(new SendTokensTimerTask(), interval, interval);
}
private static final class SendTokensTimerTask extends TimerTask {
SendTokensTimerTask() { }
@Override
public void run() {
mLOG.debug("Broadcasting dergistered authtokens");
try {
//get a snapshot of the queue so that we are not holding logins and logouts
Object[] copy = deregisteredOutAuthTokens.toArray();
//if we have any tokens to report send them over to all servers
if(copy.length > 0) {
mLOG.debug("Found some dergistered authtokens to broadcast");
/* Remove the snapshot from the queue.
* Since this block is not synchronized new tokens may have been added to the queue and some may have been pushed out due to size limitation
*/
deregisteredOutAuthTokens.removeAll(Arrays.asList(copy));
//send the snapshot to other servers
try {
List<Server> mailServers = Provisioning.getInstance().getAllMailClientServers();
SoapProvisioning soapProv = SoapProvisioning.getAdminInstance();
soapProv.soapZimbraAdminAuthenticate();
RefreshRegisteredAuthTokensRequest req = new RefreshRegisteredAuthTokensRequest();
for(Object ztoken : copy) {
if(!((ZimbraAuthToken)ztoken).isExpired()) {//no need to broadcast expired tokens, since they will be cleaned up automatically
req.addToken(((ZimbraAuthToken)ztoken).getEncoded());
}
}
for(Server server : mailServers) {
if(server.isLocalServer()) {
continue;
}
soapProv.invokeJaxb(req, server.getName());
}
} catch (ServiceException | AuthTokenException e) {
mLOG.error("Failed to broadcast deregistered authtokens", e);
}
}
} catch (Throwable t) {
mLOG.info("Caught exception in SendTokens timer", t);
}
}
}
}
| [
"shriram.vishwanathan@synacor.com"
] | shriram.vishwanathan@synacor.com |
616ac9fc7e64944ad8bb310adcce40c3b2b513c5 | ccca1f7f2672dac4ab57c5d40b321e47edd76f7f | /work/src/collectionEx/list/vector/VectorTest03.java | 51eaaaa6d030c862e38e14e12329353920b6e37b | [] | no_license | chaeheedong/JavaCode | 0d6730725cd3e8ca951d8d257bdc1c2da8123e64 | 1f10e903b4d893bfcbf118abd325af69397339fc | refs/heads/master | 2021-04-06T11:42:35.291687 | 2018-06-05T07:02:24 | 2018-06-05T07:02:24 | 125,187,093 | 1 | 0 | null | null | null | null | UHC | Java | false | false | 1,614 | java | package collectionEx.list.vector;
import java.util.Vector;
public class VectorTest03 {
public static void main(String[] args) {
// Vector 객체 생성시 관리(저장, 추출)될 인스턴스 Data Type 명시
Vector<String> vector = new Vector(10, 10);
// Vector에 String 저장
// add(E obj) : E를 인자로 받는다는 의미는 ? :: Generic 사용으로 묵시적 형변환 불필요
String s1 = new String("1.홍");
vector.add(s1);
vector.add(new String("2.동"));
vector.add("3.님 안녕하세요.");
// Vector 저장된 값을 출력
for (int i = 0; i < vector.size(); i++) {
String s = vector.elementAt(i);
System.out.print(s);
}
System.out.println("\nJDK1.5 추가 기능 :: Generic, Enhanced For Loop 사용");
// ==> 위의 for 문과 비교하여 이해하자 / JDK 1.5에 추가 기능 :: Enhanced For Loop
// Vector 내부에 저장된 값을 size() 만큼 반복, 1EA씩 추출 String 준다.(Generic사용으로...)
for (String value : vector) {
System.out.print(value);
}
System.out.println("\n==> API 확인");
vector.insertElementAt("4.길", 1);
for (int i = 0; i < vector.size(); i++) {
System.out.print(vector.elementAt(i));
}
System.out.println("\n==> API 확인");
vector.setElementAt("5.,홍길순", 3);
for (int i = 0; i < vector.size(); i++) {
System.out.print(vector.elementAt(i));
}
System.out.println("\n==> API 확인");
vector.removeElementAt(3);
for (int i = 0; i < vector.size(); i++) {
System.out.print(vector.elementAt(i));
}
}
}
| [
"Bit@Bitcamp"
] | Bit@Bitcamp |
38f75f3f9c8ae4b068fea433efe3d6dcda10bc6c | 6c6057c606a4fb4a61731a09c178a47f3636c457 | /branches/sportbrush-android_dev_feature/gamenews-app/src/main/java/com/yy/android/gamenews/util/maintab/MainTab2Sportbrush.java | d5a9d502eda5128b3d6102138515ed0459e129ae | [] | no_license | hunan889/brush | 9103c653c4e1c53ad2c1930a5df954c19b794884 | aeccee758e012b74763725b68dc5129d3fc7f273 | refs/heads/master | 2016-09-08T01:26:56.903689 | 2015-04-28T10:24:22 | 2015-04-28T10:24:22 | 29,959,388 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,797 | java | package com.yy.android.gamenews.util.maintab;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import com.yy.android.gamenews.event.MainTabEvent;
import com.yy.android.gamenews.ui.ChannelDepotActivity;
import com.yy.android.gamenews.ui.MainActivity;
import com.yy.android.gamenews.ui.view.ActionBar;
import com.yy.android.gamenews.util.MainTabStatsUtil;
import com.yy.android.gamenews.util.StatsUtil;
import com.yy.android.sportbrush.R;
/**
* 特性:体育刷子右上角添加频道
*
* @author liuchaoqun
* @lastmodify yeyuelai 2014-10-16
*/
public class MainTab2Sportbrush extends MainTab2 {
public MainTab2Sportbrush(MainActivity context, ActionBar actionbar,
Bundle savedInstance) {
super(context, actionbar, savedInstance);
}
@Override
protected void custActionbarRight() {
mActionBar.getRightImageView().setImageResource(
R.drawable.btn_add_channel_selector);
mActionBar.getRightTextView().setText("");
mActionBar.setRightTextVisibility(View.GONE);
mActionBar.setRightVisibility(View.VISIBLE);
mActionBar.setOnRightClickListener(mOnRightClickListener);
}
private OnClickListener mOnRightClickListener = new OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(mContext, ChannelDepotActivity.class);
mContext.startActivity(intent);
StatsUtil.statsReport(mContext, "add_channel", "param", "进入频道仓库");
StatsUtil.statsReportByHiido("add_channel", "进入频道仓库");
StatsUtil.statsReportByMta(mContext, "add_channel", "进入频道仓库");
MainTabStatsUtil.statistics(mContext, MainTabEvent.TAB_ORDER_INFO,
MainTabEvent.INTO_CHANNEL_STORAGE,
MainTabEvent.INTO_CHANNEL_STORAGE_NAME);
}
};
}
| [
"hunan889@gmail.com"
] | hunan889@gmail.com |
14212307653fa33ee12f26d1c73bc45895e3327c | 7ad843a5b11df711f58fdb8d44ed50ae134deca3 | /JDK/JDK1.8/src/javax/print/attribute/standard/NumberUp.java | 8a1a4a6f9e8ebdcf416893e4793a120d652bfa78 | [
"MIT"
] | permissive | JavaScalaDeveloper/java-source | f014526ad7750ad76b46ff475869db6a12baeb4e | 0e6be345eaf46cfb5c64870207b4afb1073c6cd0 | refs/heads/main | 2023-07-01T22:32:58.116092 | 2021-07-26T06:42:32 | 2021-07-26T06:42:32 | 362,427,367 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,283 | java | /*
* Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*/
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
import javax.print.attribute.IntegerSyntax;
import javax.print.attribute.DocAttribute;
import javax.print.attribute.PrintRequestAttribute;
import javax.print.attribute.PrintJobAttribute;
/**
* Class NumberUp is an integer valued printing attribute class that specifies
* the number of print-stream pages to impose upon a single side of an
* instance of a selected medium. That is, if the NumberUp value is <I>n,</I>
* the printer must place <I>n</I> print-stream pages on a single side of
* an instance of the
* selected medium. To accomplish this, the printer may add some sort of
* translation, scaling, or rotation. This attribute primarily controls the
* translation, scaling and rotation of print-stream pages.
* <P>
* The effect of a NumberUp attribute on a multidoc print job (a job with
* multiple documents) depends on whether all the docs have the same number up
* values specified or whether different docs have different number up values
* specified, and on the (perhaps defaulted) value of the {@link
* MultipleDocumentHandling MultipleDocumentHandling} attribute.
* <UL>
* <LI>
* If all the docs have the same number up value <I>n</I> specified, then any
* value of {@link MultipleDocumentHandling MultipleDocumentHandling} makes
* sense, and the printer's processing depends on the {@link
* MultipleDocumentHandling MultipleDocumentHandling} value:
* <UL>
* <LI>
* SINGLE_DOCUMENT -- All the input docs will be combined together into one
* output document. Each media impression will consist of <I>n</I>m
* print-stream pages from the output document.
* <P>
* <LI>
* SINGLE_DOCUMENT_NEW_SHEET -- All the input docs will be combined together
* into one output document. Each media impression will consist of <I>n</I>
* print-stream pages from the output document. However, the first impression of
* each input doc will always start on a new media sheet; this means the last
* impression of an input doc may have fewer than <I>n</I> print-stream pages
* on it.
* <P>
* <LI>
* SEPARATE_DOCUMENTS_UNCOLLATED_COPIES -- The input docs will remain separate.
* Each media impression will consist of <I>n</I> print-stream pages from the
* input doc. Since the input docs are separate, the first impression of each
* input doc will always start on a new media sheet; this means the last
* impression of an input doc may have fewer than <I>n</I> print-stream pages on
* it.
* <P>
* <LI>
* SEPARATE_DOCUMENTS_COLLATED_COPIES -- The input docs will remain separate.
* Each media impression will consist of <I>n</I> print-stream pages from the
* input doc. Since the input docs are separate, the first impression of each
* input doc will always start on a new media sheet; this means the last
* impression of an input doc may have fewer than <I>n</I> print-stream pages
* on it.
* </UL>
* <UL>
* <LI>
* SINGLE_DOCUMENT -- All the input docs will be combined together into one
* output document. Each media impression will consist of <I>n<SUB>i</SUB></I>
* print-stream pages from the output document, where <I>i</I> is the number of
* the input doc corresponding to that point in the output document. When the
* next input doc has a different number up value from the previous input doc,
* the first print-stream page of the next input doc goes at the start of the
* next media impression, possibly leaving fewer than the full number of
* print-stream pages on the previous media impression.
* <P>
* <LI>
* SINGLE_DOCUMENT_NEW_SHEET -- All the input docs will be combined together
* into one output document. Each media impression will consist of <I>n</I>
* print-stream pages from the output document. However, the first impression of
* each input doc will always start on a new media sheet; this means the last
* impression of an input doc may have fewer than <I>n</I> print-stream pages
* on it.
* <P>
* <LI>
* SEPARATE_DOCUMENTS_UNCOLLATED_COPIES -- The input docs will remain separate.
* For input doc <I>i,</I> each media impression will consist of
* <I>n<SUB>i</SUB></I> print-stream pages from the input doc. Since the input
* docs are separate, the first impression of each input doc will always start
* on a new media sheet; this means the last impression of an input doc may have
* fewer than <I>n<SUB>i</SUB></I> print-stream pages on it.
* <P>
* <LI>
* SEPARATE_DOCUMENTS_COLLATED_COPIES -- The input docs will remain separate.
* For input doc <I>i,</I> each media impression will consist of
* <I>n<SUB>i</SUB></I> print-stream pages from the input doc. Since the input
* docs are separate, the first impression of each input doc will always start
* on a new media sheet; this means the last impression of an input doc may
* have fewer than <I>n<SUB>i</SUB></I> print-stream pages on it.
* </UL>
* </UL>
* <B>IPP Compatibility:</B> The integer value gives the IPP integer value.
* The category name returned by <CODE>getName()</CODE> gives the IPP
* attribute name.
* <P>
*
* @author Alan Kaminsky
*/
public final class NumberUp extends IntegerSyntax
implements DocAttribute, PrintRequestAttribute, PrintJobAttribute {
private static final long serialVersionUID = -3040436486786527811L;
/**
* Construct a new number up attribute with the given integer value.
*
* @param value Integer value.
*
* @exception IllegalArgumentException
* (Unchecked exception) Thrown if <CODE>value</CODE> is less than 1.
*/
public NumberUp(int value) {
super (value, 1, Integer.MAX_VALUE);
}
/**
* Returns whether this number up attribute is equivalent to the passed in
* object. To be equivalent, all of the following conditions must be true:
* <OL TYPE=1>
* <LI>
* <CODE>object</CODE> is not null.
* <LI>
* <CODE>object</CODE> is an instance of class NumberUp.
* <LI>
* This number up attribute's value and <CODE>object</CODE>'s value are
* equal.
* </OL>
*
* @param object Object to compare to.
*
* @return True if <CODE>object</CODE> is equivalent to this number up
* attribute, false otherwise.
*/
public boolean equals(Object object) {
return (super.equals(object) && object instanceof NumberUp);
}
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
* <P>
* For class NumberUp, the category is class NumberUp itself.
*
* @return Printing attribute class (category), an instance of class
* {@link java.lang.Class java.lang.Class}.
*/
public final Class<? extends Attribute> getCategory() {
return NumberUp.class;
}
/**
* Get the name of the category of which this attribute value is an
* instance.
* <P>
* For class NumberUp, the category name is <CODE>"number-up"</CODE>.
*
* @return Attribute category name.
*/
public final String getName() {
return "number-up";
}
}
| [
"panzha@dian.so"
] | panzha@dian.so |
7d33de9b54fd95d01407edbe965c5f2ac51f6035 | 9e0a9289eda68465d414efb20e33bb76c27933ca | /src/main/java/org/sagebionetworks/bridge/exporter/record/RecordFilterHelper.java | 6a2f759873abcf3f98313f51e93e957a49c890d8 | [
"LicenseRef-scancode-commons-clause",
"BSD-3-Clause"
] | permissive | Sage-Bionetworks/Bridge-Exporter | af6870b00cd29db8d11ca65a927a33c674546c3f | 0a800d25493e7bbe6b1c21e303f8bab4f5cdf335 | refs/heads/develop | 2023-05-25T18:55:37.900818 | 2023-05-18T04:44:19 | 2023-05-18T04:44:19 | 27,888,108 | 0 | 7 | Apache-2.0 | 2023-05-18T04:44:20 | 2014-12-11T19:35:13 | Java | UTF-8 | Java | false | false | 7,423 | java | package org.sagebionetworks.bridge.exporter.record;
import java.util.Set;
import com.amazonaws.services.dynamodbv2.document.Item;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.sagebionetworks.bridge.exporter.helper.BridgeHelper;
import org.sagebionetworks.bridge.exporter.metrics.Metrics;
import org.sagebionetworks.bridge.exporter.request.BridgeExporterRequest;
import org.sagebionetworks.bridge.exporter.request.BridgeExporterSharingMode;
import org.sagebionetworks.bridge.exporter.util.BridgeExporterUtil;
import org.sagebionetworks.bridge.rest.model.SharingScope;
import org.sagebionetworks.bridge.rest.model.StudyParticipant;
import org.sagebionetworks.bridge.schema.UploadSchemaKey;
/**
* Encapsulates logic for filtering out records from the export. This covers filtering because of request args (study
* whitelist or table whitelist), or filtering because of sharing preferences.
*/
@Component
public class RecordFilterHelper {
private static final Logger LOG = LoggerFactory.getLogger(RecordFilterHelper.class);
private BridgeHelper bridgeHelper;
/** Bridge Helper, used to get the user's health code. */
@Autowired
public final void setBridgeHelper(BridgeHelper bridgeHelper) {
this.bridgeHelper = bridgeHelper;
}
/**
* Returns true if a record should be excluded from the export.
*
* @param metrics
* metrics object, to record filter metrics
* @param request
* export request, used for determining filter settings
* @param record
* record to determine if we should include or exclude
* @return true if the record should be excluded
*/
public boolean shouldExcludeRecord(Metrics metrics, BridgeExporterRequest request, Item record) {
// If record doesn't have a study ID, something is seriously wrong.
String studyId = record.getString("studyId");
if (StringUtils.isBlank(studyId)) {
throw new IllegalArgumentException("record has no study ID");
}
// request always has a sharing mode
boolean excludeBySharingScope = shouldExcludeRecordBySharingScope(metrics, request.getSharingMode(), record);
// filter by study - This is used for filtering out test studies and for limiting study-specific exports.
boolean excludeByStudy = false;
Set<String> studyWhitelist = request.getStudyWhitelist();
if (studyWhitelist != null) {
excludeByStudy = shouldExcludeRecordByStudy(metrics, studyWhitelist, studyId);
}
// filter by table - This is used for table-specific redrives.
boolean excludeByTable = false;
Set<UploadSchemaKey> tableWhitelist = request.getTableWhitelist();
if (tableWhitelist != null) {
excludeByTable = shouldExcludeRecordByTable(metrics, tableWhitelist, studyId,
BridgeExporterUtil.getSchemaKeyForRecord(record));
}
// If any of the filters are hit, we filter the record. (We don't use short-circuiting because we want to
// collect the metrics.)
return excludeBySharingScope || excludeByStudy || excludeByTable;
}
// Helper method that handles the sharing filter.
private boolean shouldExcludeRecordBySharingScope(Metrics metrics, BridgeExporterSharingMode sharingMode,
Item record) {
// Get the record's sharing scope. Defaults to no_sharing if it's not present or unable to be parsed.
SharingScope recordSharingScope;
String recordSharingScopeStr = record.getString("userSharingScope");
if (StringUtils.isBlank(recordSharingScopeStr)) {
recordSharingScope = SharingScope.NO_SHARING;
} else {
try {
recordSharingScope = SharingScope.valueOf(recordSharingScopeStr);
} catch (IllegalArgumentException ex) {
LOG.error("Could not parse sharing scope " + recordSharingScopeStr);
recordSharingScope = SharingScope.NO_SHARING;
}
}
// Get user's sharing scope from Bridge. If not specified, defaults to no_sharing.
String studyId = record.getString("studyId");
String healthCode = record.getString("healthCode");
StudyParticipant participant = bridgeHelper.getParticipantByHealthCode(studyId, healthCode);
SharingScope userSharingScope = participant.getSharingScope();
if (userSharingScope == null) {
userSharingScope = SharingScope.NO_SHARING;
}
// reconcile both sharing scopes to find the most restrictive sharing scope
SharingScope sharingScope;
if (SharingScope.NO_SHARING.equals(recordSharingScope) || SharingScope.NO_SHARING.equals(userSharingScope)) {
sharingScope = SharingScope.NO_SHARING;
} else if (SharingScope.SPONSORS_AND_PARTNERS.equals(recordSharingScope) ||
SharingScope.SPONSORS_AND_PARTNERS.equals(userSharingScope)) {
sharingScope = SharingScope.SPONSORS_AND_PARTNERS;
} else if (SharingScope.ALL_QUALIFIED_RESEARCHERS.equals(recordSharingScope) ||
SharingScope.ALL_QUALIFIED_RESEARCHERS.equals(userSharingScope)) {
sharingScope = SharingScope.ALL_QUALIFIED_RESEARCHERS;
} else {
throw new IllegalArgumentException("Impossible code path in RecordFilterHelper.shouldExcludeRecordBySharingScope(): recordSharingScope=" +
recordSharingScope + ", userSharingScope=" + userSharingScope);
}
// actual filter logic here
if (sharingMode.shouldExcludeScope(sharingScope)) {
metrics.incrementCounter("excluded[" + sharingScope.name() + "]");
return true;
} else {
metrics.incrementCounter("accepted[" + sharingScope.name() + "]");
return false;
}
}
// Helper method that handles the study filter.
private boolean shouldExcludeRecordByStudy(Metrics metrics, Set<String> studyFilterSet, String studyId) {
// studyFilterSet is the set of studies that we accept
if (studyFilterSet.contains(studyId)) {
metrics.incrementCounter("accepted[" + studyId + "]");
return false;
} else {
metrics.incrementCounter("excluded[" + studyId + "]");
return true;
}
}
// Helper method that handles the table filter.
private boolean shouldExcludeRecordByTable(Metrics metrics, Set<UploadSchemaKey> tableFilterSet, String studyId,
UploadSchemaKey schemaKey) {
if (schemaKey == null) {
// The table whitelist specifies the tables that we allow through. A schemaless record, by definition,
// would not be in those tables. So exclude.
metrics.incrementCounter("excluded[" + studyId + "-default]");
return true;
} else if (tableFilterSet.contains(schemaKey)) {
// tableFilterSet is the set of tables that we accept
metrics.incrementCounter("accepted[" + schemaKey + "]");
return false;
} else {
metrics.incrementCounter("excluded[" + schemaKey + "]");
return true;
}
}
}
| [
"dwayne.jeng@sagebase.org"
] | dwayne.jeng@sagebase.org |
b2e6f5079ef91fedcdf8b272669f20c9e5c623c8 | a16fdf4b1bfe44b52fe3fae01944a37ff8765ad1 | /plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnDcp_Block_ControlOptionStart.java | d8c7972f536b52a9da61cf1125183c05a2df857a | [
"Apache-2.0",
"Unlicense"
] | permissive | glcj/plc4x | a56c5fa5168ab0617ac4e2592dbc6134a78cb7b7 | d2b9aeae2dcd226bb56ef5b6545cdaadc2aa816c | refs/heads/develop | 2023-03-18T17:22:42.373051 | 2023-01-19T03:46:34 | 2023-01-19T03:46:34 | 226,454,607 | 1 | 1 | Apache-2.0 | 2023-03-15T07:02:45 | 2019-12-07T04:20:11 | Java | UTF-8 | Java | false | false | 4,121 | 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.plc4x.java.profinet.readwrite;
import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*;
import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*;
import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*;
import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*;
import static org.apache.plc4x.java.spi.generation.StaticHelper.*;
import java.time.*;
import java.util.*;
import org.apache.plc4x.java.api.exceptions.*;
import org.apache.plc4x.java.api.value.*;
import org.apache.plc4x.java.spi.codegen.*;
import org.apache.plc4x.java.spi.codegen.fields.*;
import org.apache.plc4x.java.spi.codegen.io.*;
import org.apache.plc4x.java.spi.generation.*;
// Code generated by code-generation. DO NOT EDIT.
public class PnDcp_Block_ControlOptionStart extends PnDcp_Block implements Message {
// Accessors for discriminator values.
public PnDcp_BlockOptions getOption() {
return PnDcp_BlockOptions.CONTROL_OPTION;
}
public Short getSuboption() {
return (short) 1;
}
public PnDcp_Block_ControlOptionStart() {
super();
}
@Override
protected void serializePnDcp_BlockChild(WriteBuffer writeBuffer) throws SerializationException {
PositionAware positionAware = writeBuffer;
int startPos = positionAware.getPos();
writeBuffer.pushContext("PnDcp_Block_ControlOptionStart");
writeBuffer.popContext("PnDcp_Block_ControlOptionStart");
}
@Override
public int getLengthInBytes() {
return (int) Math.ceil((float) getLengthInBits() / 8.0);
}
@Override
public int getLengthInBits() {
int lengthInBits = super.getLengthInBits();
PnDcp_Block_ControlOptionStart _value = this;
return lengthInBits;
}
public static PnDcp_Block_ControlOptionStartBuilder staticParseBuilder(ReadBuffer readBuffer)
throws ParseException {
readBuffer.pullContext("PnDcp_Block_ControlOptionStart");
PositionAware positionAware = readBuffer;
int startPos = positionAware.getPos();
int curPos;
readBuffer.closeContext("PnDcp_Block_ControlOptionStart");
// Create the instance
return new PnDcp_Block_ControlOptionStartBuilder();
}
public static class PnDcp_Block_ControlOptionStartBuilder
implements PnDcp_Block.PnDcp_BlockBuilder {
public PnDcp_Block_ControlOptionStartBuilder() {}
public PnDcp_Block_ControlOptionStart build() {
PnDcp_Block_ControlOptionStart pnDcp_Block_ControlOptionStart =
new PnDcp_Block_ControlOptionStart();
return pnDcp_Block_ControlOptionStart;
}
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof PnDcp_Block_ControlOptionStart)) {
return false;
}
PnDcp_Block_ControlOptionStart that = (PnDcp_Block_ControlOptionStart) o;
return super.equals(that) && true;
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode());
}
@Override
public String toString() {
WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true);
try {
writeBufferBoxBased.writeSerializable(this);
} catch (SerializationException e) {
throw new RuntimeException(e);
}
return "\n" + writeBufferBoxBased.getBox().toString() + "\n";
}
}
| [
"christofer.dutz@c-ware.de"
] | christofer.dutz@c-ware.de |
747aa5bffbce91ec1e9acd6aba42aebc059e8ae3 | c3cf33e7b9fe20ff3124edcfc39f08fa982b2713 | /pocs/terraform-cdk-fun/src/main/java/imports/kubernetes/DaemonsetSpecTemplateSpecInitContainerLifecyclePostStartTcpSocket.java | aa788817b63118e02ecb893f6af633a27c421466 | [
"Unlicense"
] | permissive | diegopacheco/java-pocs | d9daa5674921d8b0d6607a30714c705c9cd4c065 | 2d6cc1de9ff26e4c0358659b7911d2279d4008e1 | refs/heads/master | 2023-08-30T18:36:34.626502 | 2023-08-29T07:34:36 | 2023-08-29T07:34:36 | 107,281,823 | 47 | 57 | Unlicense | 2022-03-23T07:24:08 | 2017-10-17T14:42:26 | Java | UTF-8 | Java | false | false | 5,339 | java | package imports.kubernetes;
@javax.annotation.Generated(value = "jsii-pacmak/1.30.0 (build adae23f)", date = "2021-06-16T06:12:12.475Z")
@software.amazon.jsii.Jsii(module = imports.kubernetes.$Module.class, fqn = "kubernetes.DaemonsetSpecTemplateSpecInitContainerLifecyclePostStartTcpSocket")
@software.amazon.jsii.Jsii.Proxy(DaemonsetSpecTemplateSpecInitContainerLifecyclePostStartTcpSocket.Jsii$Proxy.class)
public interface DaemonsetSpecTemplateSpecInitContainerLifecyclePostStartTcpSocket extends software.amazon.jsii.JsiiSerializable {
/**
* Number or name of the port to access on the container.
* <p>
* Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME.
* <p>
* Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/kubernetes/r/daemonset.html#port Daemonset#port}
*/
@org.jetbrains.annotations.NotNull java.lang.String getPort();
/**
* @return a {@link Builder} of {@link DaemonsetSpecTemplateSpecInitContainerLifecyclePostStartTcpSocket}
*/
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link DaemonsetSpecTemplateSpecInitContainerLifecyclePostStartTcpSocket}
*/
public static final class Builder implements software.amazon.jsii.Builder<DaemonsetSpecTemplateSpecInitContainerLifecyclePostStartTcpSocket> {
private java.lang.String port;
/**
* Sets the value of {@link DaemonsetSpecTemplateSpecInitContainerLifecyclePostStartTcpSocket#getPort}
* @param port Number or name of the port to access on the container. This parameter is required.
* Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME.
* <p>
* Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/kubernetes/r/daemonset.html#port Daemonset#port}
* @return {@code this}
*/
public Builder port(java.lang.String port) {
this.port = port;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link DaemonsetSpecTemplateSpecInitContainerLifecyclePostStartTcpSocket}
* @throws NullPointerException if any required attribute was not provided
*/
@Override
public DaemonsetSpecTemplateSpecInitContainerLifecyclePostStartTcpSocket build() {
return new Jsii$Proxy(port);
}
}
/**
* An implementation for {@link DaemonsetSpecTemplateSpecInitContainerLifecyclePostStartTcpSocket}
*/
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements DaemonsetSpecTemplateSpecInitContainerLifecyclePostStartTcpSocket {
private final java.lang.String port;
/**
* Constructor that initializes the object based on values retrieved from the JsiiObject.
* @param objRef Reference to the JSII managed object.
*/
protected Jsii$Proxy(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
this.port = software.amazon.jsii.Kernel.get(this, "port", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
}
/**
* Constructor that initializes the object based on literal property values passed by the {@link Builder}.
*/
protected Jsii$Proxy(final java.lang.String port) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
this.port = java.util.Objects.requireNonNull(port, "port is required");
}
@Override
public final java.lang.String getPort() {
return this.port;
}
@Override
@software.amazon.jsii.Internal
public com.fasterxml.jackson.databind.JsonNode $jsii$toJson() {
final com.fasterxml.jackson.databind.ObjectMapper om = software.amazon.jsii.JsiiObjectMapper.INSTANCE;
final com.fasterxml.jackson.databind.node.ObjectNode data = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
data.set("port", om.valueToTree(this.getPort()));
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("kubernetes.DaemonsetSpecTemplateSpecInitContainerLifecyclePostStartTcpSocket"));
struct.set("data", data);
final com.fasterxml.jackson.databind.node.ObjectNode obj = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
obj.set("$jsii.struct", struct);
return obj;
}
@Override
public final boolean equals(final Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
DaemonsetSpecTemplateSpecInitContainerLifecyclePostStartTcpSocket.Jsii$Proxy that = (DaemonsetSpecTemplateSpecInitContainerLifecyclePostStartTcpSocket.Jsii$Proxy) o;
return this.port.equals(that.port);
}
@Override
public final int hashCode() {
int result = this.port.hashCode();
return result;
}
}
}
| [
"diego.pacheco.it@gmail.com"
] | diego.pacheco.it@gmail.com |
76b600893d59b71dc83aaf39d15e86240d12c8dd | 64d3e1ede86f393d20f45bf5689ec97cfebf01da | /src/main/java/ch/ethz/systems/netbench/core/network/OutputPort.java | a238ac5a379726e6c32866fecddbbcbc87299bff | [
"MIT"
] | permissive | ibuystuff/netbench | efd8b492c6ffa33dc319bc0ac98f6f1a6e502564 | e3ce5de28e6ef1940685d396adeb4fda86c82a48 | refs/heads/master | 2023-06-21T20:06:54.704052 | 2017-08-09T10:01:29 | 2017-08-09T10:01:29 | 121,750,449 | 0 | 0 | MIT | 2020-10-24T03:24:55 | 2018-02-16T12:51:18 | Shell | UTF-8 | Java | false | false | 7,785 | java | package ch.ethz.systems.netbench.core.network;
import ch.ethz.systems.netbench.core.Simulator;
import ch.ethz.systems.netbench.core.log.PortLogger;
import java.util.Queue;
/**
* Abstraction for an output port on a network device.
*
* There is no corresponding InputPort class, as the output
* port already forces a rate limit. OutputPort's subclasses
* are forced to handle the enqueuing of packets, and are allowed
* to drop packets depending on their own drop strategy to handle
* congestion at the port (e.g. tail-drop, RED, ...).
*/
public abstract class OutputPort {
// Internal state
private boolean isSending; // True iff the output port is using the medium to send a packet
private final Queue<Packet> queue; // Current queue of packets to send
private long bufferOccupiedBits; // Amount of bits currently occupied of the buffer
// Constants
private final int ownId; // Own network device identifier
private final NetworkDevice ownNetworkDevice; // Network device this output port is attached to
private final int targetId; // Target network device identifier
private final NetworkDevice targetNetworkDevice; // Target network device
private final Link link; // Link type, defines latency and bandwidth of the medium
// that the output port uses
// Logging utility
private final PortLogger logger;
/**
* Constructor.
*
* @param ownNetworkDevice Source network device to which this output port is attached
* @param targetNetworkDevice Target network device that is on the other side of the link
* @param link Link that this output ports solely governs
* @param queue Queue that governs how packet are stored queued in the buffer
*/
protected OutputPort(NetworkDevice ownNetworkDevice, NetworkDevice targetNetworkDevice, Link link, Queue<Packet> queue) {
// State
this.queue = queue;
this.isSending = false;
this.link = link;
this.bufferOccupiedBits = 0;
// References
this.ownNetworkDevice = ownNetworkDevice;
this.ownId = this.ownNetworkDevice.getIdentifier();
this.targetNetworkDevice = targetNetworkDevice;
this.targetId = this.targetNetworkDevice.getIdentifier();
// Logging
this.logger = new PortLogger(this);
}
/**
* Enqueue the given packet for sending.
* There is no guarantee that the packet is actually sent,
* as the queue buffer's limit might be reached.
*
* @param packet Packet instance
*/
public abstract void enqueue(Packet packet);
/**
* Enqueue the given packet.
*
* @param packet Packet instance
*/
protected final void guaranteedEnqueue(Packet packet) {
// If it is not sending, then the queue is empty at the moment,
// so this packet can be immediately send
if (!isSending) {
// Link is now being utilized
logger.logLinkUtilized(true);
// Add event when sending is finished
Simulator.registerEvent(new PacketDispatchedEvent(
packet.getSizeBit() / link.getBandwidthBitPerNs(),
packet,
this
));
// It is now sending again
isSending = true;
} else { // If it is still sending, the packet is added to the queue, making it non-empty
bufferOccupiedBits += packet.getSizeBit();
queue.add(packet);
logger.logQueueState(queue.size(), bufferOccupiedBits);
}
}
/**
* Called when a packet has actually been send completely.
* In response, register arrival event at the destination network device,
* and starts sending another packet if it is available.
*
* @param packet Packet instance that was being sent
*/
void dispatch(Packet packet) {
// Finished sending packet, the last bit of the packet should arrive the link-delay later
if (!link.doesNextTransmissionFail(packet.getSizeBit())) {
Simulator.registerEvent(
new PacketArrivalEvent(
link.getDelayNs(),
packet,
targetNetworkDevice
)
);
}
// Again free to send other packets
isSending = false;
// Check if there are more in the queue to send
if (!queue.isEmpty()) {
// Pop from queue
Packet packetFromQueue = queue.poll();
decreaseBufferOccupiedBits(packetFromQueue.getSizeBit());
logger.logQueueState(queue.size(), bufferOccupiedBits);
// Register when the packet is actually dispatched
Simulator.registerEvent(new PacketDispatchedEvent(
packetFromQueue.getSizeBit() / link.getBandwidthBitPerNs(),
packetFromQueue,
this
));
// It is sending again
isSending = true;
} else {
// If the queue is empty, nothing will be sent for now
logger.logLinkUtilized(false);
}
}
/**
* Return the network identifier of its own device (to which this output port is attached to).
*
* @return Own network device identifier
*/
public int getOwnId() {
return ownId;
}
/**
* Return the network identifier of the target device.
*
* @return Target network device identifier
*/
public int getTargetId() {
return targetId;
}
/**
* Return the network device where this ports originates from.
*
* @return Own network device
*/
public NetworkDevice getOwnDevice(){
return ownNetworkDevice;
}
/**
* Return the network device at the other end of this port.
*
* @return Target network device
*/
public NetworkDevice getTargetDevice(){
return targetNetworkDevice;
}
/**
* Retrieve size of the queue in packets.
*
* @return Queue size in packets
*/
public int getQueueSize() {
return queue.size();
}
/**
* Determine the amount of bits that the buffer occupies.
*
* @return Bits currently occupied in the buffer of this output port.
*/
protected long getBufferOccupiedBits() {
return bufferOccupiedBits;
}
@Override
public String toString() {
return "OutputPort<" +
ownId + " -> " + targetId +
", link: " + link +
", occupied: " + bufferOccupiedBits +
", queue size: " + getQueueSize() +
">";
}
/**
* Retrieve the queue used in the output port.
*
* NOTE: adapting the queue will most likely result in strange values
* in the port queue state log.
*
* @return Queue instance
*/
protected Queue<Packet> getQueue() {
return queue;
}
/**
* Change the amount of bits occupied in the buffer with a delta.
*
* NOTE: adapting the buffer occupancy counter from your own implementation
* will most likely result in strange values in the port queue state log.
*
* @param deltaAmount Amount of bits to from the current occupied counter
*/
protected void decreaseBufferOccupiedBits(long deltaAmount) {
bufferOccupiedBits -= deltaAmount;
assert(bufferOccupiedBits >= 0);
}
}
| [
"s.a.kassing@gmail.com"
] | s.a.kassing@gmail.com |
911782218450276b5cd8983ec49ad1b21d4540ab | ddf0d861a600e9271198ed43be705debae15bafd | /CompetitiveProgrammingSolution/Implementation/Code_602B_ApproximatingAConstantRange.java | 6862c3565f8704b454e8c2a818fe9816fc2bcfcf | [] | no_license | bibhuty-did-this/MyCodes | 79feea385b055edc776d4a9d5aedbb79a9eb55f4 | 2b8c1d4bd3088fc28820145e3953af79417c387f | refs/heads/master | 2023-02-28T09:20:36.500579 | 2021-02-07T17:17:54 | 2021-02-07T17:17:54 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,340 | java | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import static java.lang.Math.max;
import static java.lang.Math.min;
public class Code_602B_ApproximatingAConstantRange {
public static void main(String[] args) throws IOException {
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
PrintWriter out=new PrintWriter(System.out);
StringTokenizer in=new StringTokenizer(br.readLine());
int n=Integer.parseInt(in.nextToken());
int[] a=new int[n];
in=new StringTokenizer(br.readLine());
for(int i=0;i<n;a[i++]=Integer.parseInt(in.nextToken()));
int l=0,r=0;
int length=1,largest=a[l],smallest=a[r];
while (l<=r && r<n){
largest=max(largest,a[r]);
smallest=min(smallest,a[r]);
if(largest-smallest<=1) {
length = max(length, r - l + 1);
++r;
}else{
l=r-1;
int value=a[l];
while (l>0 && a[l-1]==value)--l;
smallest=min(a[l],a[r]);
largest=max(a[l],a[r]);
}
}
out.println(length);
out.close();
}
}
| [
"bibhuty.nit@gmail.com"
] | bibhuty.nit@gmail.com |
0865f6b1b5acb3ee9f28c8811b36e8f46a07c47a | c474b03758be154e43758220e47b3403eb7fc1fc | /apk/decompiled/com.tinder_2018-07-26_source_from_JADX/sources/com/tinder/apprating/target/C10316a.java | 66a35a9b13be013d104c6d85f0e900409fdebfa4 | [] | no_license | EstebanDalelR/tinderAnalysis | f80fe1f43b3b9dba283b5db1781189a0dd592c24 | 941e2c634c40e5dbf5585c6876ef33f2a578b65c | refs/heads/master | 2020-04-04T09:03:32.659099 | 2018-11-23T20:41:28 | 2018-11-23T20:41:28 | 155,805,042 | 0 | 0 | null | 2018-11-18T16:02:45 | 2018-11-02T02:44:34 | null | UTF-8 | Java | false | false | 401 | java | package com.tinder.apprating.target;
/* renamed from: com.tinder.apprating.target.a */
public class C10316a implements AppRatingTarget {
public void closeDialog() {
}
public void setUpRatingBar() {
}
public void showFeedbackView() {
}
public void showInitialRatingView() {
}
public void showReviewButton() {
}
public void showThankYouView() {
}
}
| [
"jdguzmans@hotmail.com"
] | jdguzmans@hotmail.com |
701d1cd9ccdcf2ed86c579d02b090204297378a9 | 3c6384b504492de52edc0e6e8240082711606db2 | /src/main/java/microsoft/exchange/webservices/data/credential/ExchangeCredentials.java | 7803673fd5d843f8c55a70cc33e72fea5d468108 | [
"MIT"
] | permissive | JohanSchulz/ews-java-api | 4c8036ecc49ad464b2f959b23f0b19c76e4104f3 | 637065e428ce01b23abff917e02d5420842a6ddd | refs/heads/master | 2020-12-31T02:01:28.982328 | 2015-07-03T11:36:29 | 2015-07-03T11:36:29 | 37,707,454 | 1 | 0 | null | 2015-06-19T07:11:10 | 2015-06-19T07:11:10 | null | UTF-8 | Java | false | false | 5,504 | java | /*
* The MIT License
* Copyright (c) 2012 Microsoft Corporation
*
* 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.
*/
package microsoft.exchange.webservices.data.credential;
import microsoft.exchange.webservices.data.core.exception.misc.InvalidOperationException;
import microsoft.exchange.webservices.data.core.request.HttpWebRequest;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamWriter;
import java.io.ByteArrayOutputStream;
import java.net.URI;
import java.net.URISyntaxException;
/**
* Base class of Exchange credential types.
*/
public abstract class ExchangeCredentials
{
/**
* Performs an implicit conversion from <see
* cref="System.Net.NetworkCredential"/> to <see
* cref="Microsoft.Exchange.WebServices.Data.ExchangeCredentials"/>. This
* allows a NetworkCredential object to be implictly converted to an
* ExchangeCredential which is useful when setting credential on an
* ExchangeService.
*
* @param userName Account user name.
* @param password Account password.
* @param domain Account domain.
* @return The result of the conversion.
*/
public static ExchangeCredentials
getExchangeCredentialsFromNetworkCredential(
String userName, String password, String domain)
{
return new WebCredentials(userName, password, domain);
}
/**
* Return the url without ws-security address.
*
* @param url The url
* @return The absolute uri base.
*/
protected static String getUriWithoutWSSecurity(URI url)
{
String absoluteUri = url.toString();
int index = absoluteUri.indexOf("/wssecurity");
if (index == -1) {
return absoluteUri;
}
else {
return absoluteUri.substring(0, index);
}
}
/**
* This method is called to pre-authenticate credential before a service
* request is made.
*/
public void preAuthenticate()
{
// do nothing by default.
}
/**
* This method is called to apply credential to a service request before
* the request is made.
*
* @param client The request.
* @throws java.net.URISyntaxException the uRI syntax exception
*/
public void prepareWebRequest(HttpWebRequest client)
throws URISyntaxException
{
// do nothing by default.
}
/**
* Emit any extra necessary namespace aliases for the SOAP:header block.
*
* @param writer the writer
* @throws XMLStreamException the XML stream exception
*/
public void emitExtraSoapHeaderNamespaceAliases(XMLStreamWriter writer)
throws XMLStreamException
{
// do nothing by default.
}
/**
* Serialize any extra necessary SOAP headers. This is used for
* authentication schemes that rely on WS-Security, or for endpoints
* requiring WS-Addressing.
*
* @param writer the writer
* @param webMethodName the Web method being called
* @throws XMLStreamException the XML stream exception
*/
public void serializeExtraSoapHeaders(XMLStreamWriter writer, String webMethodName) throws XMLStreamException
{
// do nothing by default.
}
/**
* Adjusts the URL endpoint based on the credential.
*
* @param url The URL.
* @return Adjust URL.
*/
public URI adjustUrl(URI url) throws URISyntaxException
{
return new URI(getUriWithoutWSSecurity(url));
}
/**
* Gets the flag indicating whether any sign action need taken.
*/
public boolean isNeedSignature()
{
return false;
}
/**
* Add the signature element to the memory stream.
*
* @param memoryStream The memory stream.
*/
public void sign(ByteArrayOutputStream memoryStream) throws Exception
{
throw new InvalidOperationException();
}
/**
* Serialize SOAP headers used for authentication schemes that rely on WS-Security.
*
* @param writer the writer
* @throws XMLStreamException the XML stream exception
*/
public void serializeWSSecurityHeaders(XMLStreamWriter writer)
throws XMLStreamException
{
// do nothing by default.
}
}
| [
"schulz.johan@googlemail.com"
] | schulz.johan@googlemail.com |
067b3761a8cc68d9bddf6d59f5d3bac3eeae4e7c | a0163a6962379aff4cb172044f539f412c5f3655 | /src/main/java/me/alpha432/oyvey/features/Feature.java | 238c964b4d414851bbc8a5182a51553db8508488 | [] | no_license | GentlemanMC/CLEAN_quantum-0.4.6dev9fix2-1-BUILDABLE-SRC | 0d58aca9d5fb878b297449eaf86916fa82f44d50 | 674d21246b0ce6bebd3845eef0911f8f34e98cfc | refs/heads/main | 2023-07-12T21:39:17.857552 | 2021-08-23T23:59:04 | 2021-08-23T23:59:04 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,586 | java | package me.alpha432.oyvey.features;
import me.alpha432.oyvey.OyVey;
import me.alpha432.oyvey.features.gui.OyVeyGui;
import me.alpha432.oyvey.features.modules.Module;
import me.alpha432.oyvey.features.setting.Setting;
import me.alpha432.oyvey.manager.TextManager;
import me.alpha432.oyvey.util.Util;
import java.util.ArrayList;
import java.util.List;
public class Feature
implements Util {
public List<Setting> settings = new ArrayList <> ( );
public TextManager renderer = OyVey.textManager;
private String name;
public Feature() {
}
public Feature(String name) {
this.name = name;
}
public static boolean nullCheck() {
return Feature.mc.player == null;
}
public static boolean fullNullCheck() {
return Feature.mc.player == null || Feature.mc.world == null;
}
public String getName() {
return this.name;
}
public List<Setting> getSettings() {
return this.settings;
}
public boolean hasSettings() {
return !this.settings.isEmpty();
}
public boolean isEnabled() {
if (this instanceof Module) {
return ((Module)this).isOn();
}
return false;
}
public boolean isDisabled() {
return !this.isEnabled();
}
public Setting register(Setting setting) {
setting.setFeature(this);
this.settings.add(setting);
if (this instanceof Module && Feature.mc.currentScreen instanceof OyVeyGui) {
OyVeyGui.getInstance().updateModule((Module)this);
}
return setting;
}
public void unregister(Setting settingIn) {
ArrayList<Setting> removeList = new ArrayList <> ( );
for (Setting setting : this.settings) {
if (!setting.equals(settingIn)) continue;
removeList.add(setting);
}
if (!removeList.isEmpty()) {
this.settings.removeAll(removeList);
}
if (this instanceof Module && Feature.mc.currentScreen instanceof OyVeyGui) {
OyVeyGui.getInstance().updateModule((Module)this);
}
}
public Setting getSettingByName(String name) {
for (Setting setting : this.settings) {
if (!setting.getName().equalsIgnoreCase(name)) continue;
return setting;
}
return null;
}
public void reset() {
for (Setting setting : this.settings) {
setting.setValue(setting.getDefaultValue());
}
}
public void clearSettings() {
this.settings = new ArrayList <> ( );
}
}
| [
"65968863+notperry1234567890@users.noreply.github.com"
] | 65968863+notperry1234567890@users.noreply.github.com |
dd2c9a3c079e2e7a24ceb21d7a00d12d5f7cd5ea | 65074aecb1ec800748d0e5a6a1c12b1396ce9582 | /LocationShare/app/src/main/java/com/example/wqllj/locationshare/model/baidumap/navi_bike_wake/BNaviGuideActivity.java | 96609e6f867000fdf953c1b201b4df2fa369d532 | [] | no_license | wqlljj/note | fe4011547899b469a5c179a813970af326f5c65f | 792821980fb6087719012b943cc4e8dda69d3626 | refs/heads/master | 2021-06-27T16:28:49.376137 | 2019-06-11T03:39:52 | 2019-06-11T03:39:52 | 135,403,941 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,002 | java | /*
* Copyright (C) 2016 Baidu, Inc. All Rights Reserved.
*/
package com.example.wqllj.locationshare.model.baidumap.navi_bike_wake;
import android.app.Activity;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import com.baidu.mapapi.bikenavi.BikeNavigateHelper;
import com.baidu.mapapi.bikenavi.adapter.IBRouteGuidanceListener;
import com.baidu.mapapi.bikenavi.adapter.IBTTSPlayer;
import com.baidu.mapapi.bikenavi.model.BikeRouteDetailInfo;
import com.baidu.mapapi.bikenavi.model.RouteGuideKind;
import com.baidu.mapapi.bikenavi.params.BikeNaviLaunchParam;
public class BNaviGuideActivity extends Activity {
private BikeNavigateHelper mNaviHelper;
BikeNaviLaunchParam param;
@Override
protected void onDestroy() {
super.onDestroy();
mNaviHelper.quit();
}
@Override
protected void onResume() {
super.onResume();
mNaviHelper.resume();
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mNaviHelper = BikeNavigateHelper.getInstance();
View view = mNaviHelper.onCreate(BNaviGuideActivity.this);
if (view != null) {
setContentView(view);
}
mNaviHelper.startBikeNavi(BNaviGuideActivity.this);
mNaviHelper.setTTsPlayer(new IBTTSPlayer() {
@Override
public int playTTSText(String s, boolean b) {
Log.d("tts", s);
return 0;
}
});
mNaviHelper.setRouteGuidanceListener(this, new IBRouteGuidanceListener() {
@Override
public void onRouteGuideIconUpdate(Drawable icon) {
}
@Override
public void onRouteGuideKind(RouteGuideKind routeGuideKind) {
}
@Override
public void onRoadGuideTextUpdate(CharSequence charSequence, CharSequence charSequence1) {
}
@Override
public void onRemainDistanceUpdate(CharSequence charSequence) {
}
@Override
public void onRemainTimeUpdate(CharSequence charSequence) {
}
@Override
public void onGpsStatusChange(CharSequence charSequence, Drawable drawable) {
}
@Override
public void onRouteFarAway(CharSequence charSequence, Drawable drawable) {
}
@Override
public void onRoutePlanYawing(CharSequence charSequence, Drawable drawable) {
}
@Override
public void onReRouteComplete() {
}
@Override
public void onArriveDest() {
}
@Override
public void onVibrate() {
}
@Override
public void onGetRouteDetailInfo(BikeRouteDetailInfo bikeRouteDetailInfo) {
}
});
}
}
| [
"qi.wang.x@cloudminds.com"
] | qi.wang.x@cloudminds.com |
fb9911b6a9a8ccbf71cd7ee46459c0a4c75befd1 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/12/12_8880e540eb0e508839c8c44f72a8b14ef689540d/ESGEventHelper/12_8880e540eb0e508839c8c44f72a8b14ef689540d_ESGEventHelper_t.java | 89abc64289187ea49667c4afcada54ae7d6cef33 | [] | 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,072 | java | /***************************************************************************
* *
* Organization: Lawrence Livermore National Lab (LLNL) *
* Directorate: Computation *
* Department: Computing Applications and Research *
* Division: S&T Global Security *
* Matrix: Atmospheric, Earth and Energy Division *
* Program: PCMDI *
* Project: Earth Systems Grid (ESG) Data Node Software Stack *
* First Author: Gavin M. Bell (gavin@llnl.gov) *
* *
****************************************************************************
* *
* Copyright (c) 2009, Lawrence Livermore National Security, LLC. *
* Produced at the Lawrence Livermore National Laboratory *
* Written by: Gavin M. Bell (gavin@llnl.gov) *
* LLNL-CODE-420962 *
* *
* All rights reserved. This file is part of the: *
* Earth System Grid (ESG) Data Node Software Stack, Version 1.0 *
* *
* For details, see http://esg-repo.llnl.gov/esg-node/ *
* Please also read this link *
* http://esg-repo.llnl.gov/LICENSE *
* *
* * 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 disclaimer below. *
* *
* * Redistributions in binary form must reproduce the above copyright *
* notice, this list of conditions and the disclaimer (as noted below) *
* in the documentation and/or other materials provided with the *
* distribution. *
* *
* Neither the name of the LLNS/LLNL 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 LAWRENCE *
* LIVERMORE NATIONAL SECURITY, LLC, THE U.S. DEPARTMENT OF ENERGY 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. *
* *
***************************************************************************/
/**
Description:
A simple helper/utility class to be a central location for common
Event related manipulations tasks.
**/
package esg.node.core;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.commons.logging.impl.*;
import esg.common.Utils;
import esg.common.service.ESGRemoteEvent;
public class ESGEventHelper {
private static final Log log = LogFactory.getLog(ESGEventHelper.class);
public ESGEventHelper() { }
public static ESGRemoteEvent createOutboundEvent(ESGEvent in) {
//Create the string for *our* callback address...
String myLocation = null;
try{
myLocation = "http://"+java.net.InetAddress.getLocalHost().getCanonicalHostName()+"/esg-node/datanode";
}catch (java.net.UnknownHostException ex) {
log.error("Could not build proper location string for myself",ex);
}
ESGRemoteEvent rEvent = null;
if((rEvent = in.getRemoteEvent()) == null) {
log.warn("The encountered event does not contain a remote event");
return null;
}
return new ESGRemoteEvent(myLocation,rEvent.getMessageType(),in.getData(),rEvent.getSeqNum());
}
public static ESGRemoteEvent createOutboundEvent(ESGRemoteEvent in) {
//Create the string for *our* callback address...
String myLocation = null;
try{
myLocation = "http://"+java.net.InetAddress.getLocalHost().getCanonicalHostName()+"/esg-node/datanode";
}catch (java.net.UnknownHostException ex) {
log.error("Could not build proper location string for myself",ex);
}
return new ESGRemoteEvent(myLocation,in.getMessageType(),in.getPayload(),in.getSeqNum());
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
95128a881b7ac71220b72c593dd23654ca637281 | 7c60fbeca0671291f6d09522ce0cd1025a278bcc | /src/main/java/net/whg/graph/NodeType.java | 398ff7a2f71847e2638ae0a30757e94a3cbceb7d | [
"MIT"
] | permissive | TheDudeFromCI/CodexN | 8ab4907519c5f98d200fa2f4b4756d89eaa25b92 | 3367344e665d5503d82dcb5022b0634a8a2151e2 | refs/heads/main | 2023-08-28T06:20:18.414856 | 2021-11-09T10:49:02 | 2021-11-09T10:49:02 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,720 | java | package net.whg.graph;
import java.util.Arrays;
/**
* Represents an executable node type that can be added to a graph. Node types
* may have a variable number of inputs or outputs.
*/
public final class NodeType {
private final String name;
private final DataType[] inputs;
private final DataType[] outputs;
private final Executor executor;
/**
* Creates a new NodeType instance.
*
* @param name - The name of this node type.
* @param executor - The executor for this node type.
* @param inputs - The array of inputs argument data types, in order.
* @param outputs - The array of output argument data types, in order.
* @throws IllegalArgumentException If the number of inputs and the number of
* outputs are both equal to 0.
*/
public NodeType(String name, Executor executor, DataType[] inputs, DataType[] outputs) {
if (inputs.length == 0 && outputs.length == 0)
throw new IllegalArgumentException("NodeType has not inputs or outputs!");
this.name = name;
this.executor = executor;
this.inputs = Arrays.copyOf(inputs, inputs.length);
this.outputs = Arrays.copyOf(outputs, outputs.length);
}
/**
* Checks whether or not this node type is an input node type.
*
* @return True if this node type has no input arguments, only outputs.
*/
public boolean isInputType() {
return inputs.length == 0;
}
/**
* Checks whether or not this node type is an output node type.
*
* @return True if this node type has no outputs arguments, only inputs.
*/
public boolean isOutputType() {
return outputs.length == 0;
}
/**
* Gets the name of this node type.
*
* @return The name.
*/
public String getName() {
return name;
}
/**
* Gets the data type of the specified input index.
*
* @param index - The input index.
* @return The corresponding data type.
*/
public DataType getInput(int index) {
return inputs[index];
}
/**
* Gets the data type of the specified output index.
*
* @param index - The output index.
* @return The corresponding data type.
*/
public DataType getOutput(int index) {
return outputs[index];
}
/**
* Gets the number of input arguments for this node type.
*
* @return The number of inputs.
*/
public int getInputCount() {
return inputs.length;
}
/**
* Gets the number of output arguments for this node type.
*
* @return The number of outputs.
*/
public int getOutputCount() {
return outputs.length;
}
/**
* {@inheritDoc}
*/
@Override
public String toString() {
var sb = new StringBuilder();
if (outputs.length > 0) {
for (var i = 0; i < outputs.length; i++) {
sb.append(outputs[i].getName());
if (i == outputs.length - 1)
sb.append(" ");
else
sb.append(", ");
}
} else {
sb.append("void ");
}
sb.append(getName());
sb.append("(");
for (var i = 0; i < inputs.length; i++) {
sb.append(inputs[i].getName());
if (i < inputs.length - 1)
sb.append(", ");
}
sb.append(")");
return sb.toString();
}
/**
* Gets the executor for this node type.
*
* @return The executor.
*/
public Executor getExecutor() {
return executor;
}
}
| [
"thedudefromci@gmail.com"
] | thedudefromci@gmail.com |
3d625c1566f60c90e087778c2c4272d41b018f6e | 000e9ddd9b77e93ccb8f1e38c1822951bba84fa9 | /java/classes/c/a/b/c/a.java | 7f48962f5d4c245c4982f1cb3a0faabfdb2abac5 | [
"Apache-2.0"
] | permissive | Paladin1412/house | 2bb7d591990c58bd7e8a9bf933481eb46901b3ed | b9e63db1a4975b614c422fed3b5b33ee57ea23fd | refs/heads/master | 2021-09-17T03:37:48.576781 | 2018-06-27T12:39:38 | 2018-06-27T12:41:35 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,011 | java | package c.a.b.c;
import c.a.b.a.h;
import c.a.b.a.i;
import c.a.b.e.j;
import java.nio.ByteBuffer;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
public abstract class a
{
public static int a = 1000;
public static int b = 64;
public static final byte[] c = c.a.b.b.c.a("<policy-file-request/>\000");
protected c.a.b.a.b d = null;
protected c.a.b.e.a.a e = null;
public static c.a.b.a.c a(ByteBuffer paramByteBuffer, c.a.b.a.b paramb)
throws c.a.b.d.d, c.a.b.d.a
{
Object localObject = b(paramByteBuffer);
if (localObject == null) {
throw new c.a.b.d.a(paramByteBuffer.capacity() + 128);
}
localObject = ((String)localObject).split(" ", 3);
if (localObject.length != 3) {
throw new c.a.b.d.d();
}
if (paramb == c.a.b.a.b.a)
{
paramb = new c.a.b.a.e();
i locali = (i)paramb;
locali.a(Short.parseShort(localObject[1]));
locali.a(localObject[2]);
}
for (;;)
{
localObject = b(paramByteBuffer);
if ((localObject == null) || (((String)localObject).length() <= 0)) {
break label239;
}
localObject = ((String)localObject).split(":", 2);
if (localObject.length == 2) {
break;
}
throw new c.a.b.d.d("not an http header");
paramb = new c.a.b.a.d();
paramb.a(localObject[1]);
}
if (paramb.c(localObject[0])) {
paramb.a(localObject[0], paramb.b(localObject[0]) + "; " + localObject[1].replaceFirst("^ +", ""));
}
for (;;)
{
localObject = b(paramByteBuffer);
break;
paramb.a(localObject[0], localObject[1].replaceFirst("^ +", ""));
}
label239:
if (localObject == null) {
throw new c.a.b.d.a();
}
return paramb;
}
public static ByteBuffer a(ByteBuffer paramByteBuffer)
{
ByteBuffer localByteBuffer = ByteBuffer.allocate(paramByteBuffer.remaining());
byte b1;
for (int i = 48;; i = b1) {
if (paramByteBuffer.hasRemaining())
{
b1 = paramByteBuffer.get();
localByteBuffer.put(b1);
if ((i == 13) && (b1 == 10))
{
localByteBuffer.limit(localByteBuffer.position() - 2);
localByteBuffer.position(0);
return localByteBuffer;
}
}
else
{
paramByteBuffer.position(paramByteBuffer.position() - localByteBuffer.position());
return null;
}
}
}
public static String b(ByteBuffer paramByteBuffer)
{
paramByteBuffer = a(paramByteBuffer);
if (paramByteBuffer == null) {
return null;
}
return c.a.b.b.c.a(paramByteBuffer.array(), 0, paramByteBuffer.limit());
}
public int a(int paramInt)
throws c.a.b.d.e, c.a.b.d.b
{
if (paramInt < 0) {
throw new c.a.b.d.b(1002, "Negative count");
}
return paramInt;
}
public abstract c.a.b.a.b a(c.a.b.a.b paramb)
throws c.a.b.d.d;
public abstract c.a.b.a.c a(c.a.b.a.a parama, i parami)
throws c.a.b.d.d;
public abstract b a(c.a.b.a.a parama)
throws c.a.b.d.d;
public abstract b a(c.a.b.a.a parama, h paramh)
throws c.a.b.d.d;
public abstract ByteBuffer a(c.a.b.e.a parama);
public List<ByteBuffer> a(c.a.b.a.f paramf, c.a.b.a.b paramb)
{
return a(paramf, paramb, true);
}
public List<ByteBuffer> a(c.a.b.a.f paramf, c.a.b.a.b paramb, boolean paramBoolean)
{
paramb = new StringBuilder(100);
if ((paramf instanceof c.a.b.a.a))
{
paramb.append("GET ");
paramb.append(((c.a.b.a.a)paramf).a());
paramb.append(" HTTP/1.1");
}
Object localObject;
for (;;)
{
paramb.append("\r\n");
localObject = paramf.c();
while (((Iterator)localObject).hasNext())
{
String str1 = (String)((Iterator)localObject).next();
String str2 = paramf.b(str1);
paramb.append(str1);
paramb.append(": ");
paramb.append(str2);
paramb.append("\r\n");
}
if (!(paramf instanceof h)) {
break;
}
paramb.append("HTTP/1.1 101 ").append(((h)paramf).a());
}
throw new RuntimeException("unknown role");
paramb.append("\r\n");
paramb = c.a.b.b.c.b(paramb.toString());
if (paramBoolean)
{
paramf = paramf.d();
if (paramf != null) {
break label240;
}
}
label240:
for (int i = 0;; i = paramf.length)
{
localObject = ByteBuffer.allocate(i + paramb.length);
((ByteBuffer)localObject).put(paramb);
if (paramf != null) {
((ByteBuffer)localObject).put(paramf);
}
((ByteBuffer)localObject).flip();
return Collections.singletonList(localObject);
paramf = null;
break;
}
}
public List<c.a.b.e.a> a(c.a.b.e.a.a parama, ByteBuffer paramByteBuffer, boolean paramBoolean)
{
if ((parama != c.a.b.e.a.a.c) && (parama != c.a.b.e.a.a.b)) {
throw new IllegalArgumentException("Only Opcode.BINARY or Opcode.TEXT are allowed");
}
Object localObject;
if (this.e != null) {
localObject = new c.a.b.e.d();
}
for (;;)
{
((c.a.b.e.f)localObject).a(paramByteBuffer);
((c.a.b.e.f)localObject).a(paramBoolean);
for (;;)
{
try
{
((c.a.b.e.f)localObject).c();
if (!paramBoolean) {
break label126;
}
this.e = null;
return Collections.singletonList(localObject);
}
catch (c.a.b.d.b parama)
{
throw new RuntimeException(parama);
}
this.e = parama;
if (parama == c.a.b.e.a.a.c)
{
localObject = new c.a.b.e.b();
break;
}
if (parama != c.a.b.e.a.a.b) {
break label134;
}
localObject = new j();
break;
label126:
this.e = parama;
}
label134:
localObject = null;
}
}
public abstract List<c.a.b.e.a> a(String paramString, boolean paramBoolean);
public abstract List<c.a.b.e.a> a(ByteBuffer paramByteBuffer, boolean paramBoolean);
public abstract void a();
public void a(c.a.b.a.b paramb)
{
this.d = paramb;
}
protected boolean a(c.a.b.a.f paramf)
{
return (paramf.b("Upgrade").equalsIgnoreCase("websocket")) && (paramf.b("Connection").toLowerCase(Locale.ENGLISH).contains("upgrade"));
}
public abstract a b();
public abstract a c();
public abstract List<c.a.b.e.a> c(ByteBuffer paramByteBuffer)
throws c.a.b.d.b;
public c.a.b.a.b d()
{
return this.d;
}
public c.a.b.a.f d(ByteBuffer paramByteBuffer)
throws c.a.b.d.d
{
return a(paramByteBuffer, this.d);
}
public static enum a
{
private a() {}
}
public static enum b
{
private b() {}
}
}
/* Location: /Users/gaoht/Downloads/zirom/classes-dex2jar.jar!/c/a/b/c/a.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | [
"ght163988@autonavi.com"
] | ght163988@autonavi.com |
f52d4c6dd134c0f07a32c67183bc7c5ba4c5ea76 | 70f3bfc09d237b9c9524d960328a4d3eb4b352fd | /mifosng-provider/src/test/java/org/mifosng/platform/loan/domain/LoanTransactionBuilder.java | ab3c20ddf6ad9a2e3fcc622489a487e3f310818f | [] | no_license | hanaa-hajj/mifosx | e20d7adaa982a6d0613f524dfad3ea183a472b44 | b8961d791405cf245e2322af0c7ff821a8323764 | refs/heads/master | 2020-12-25T02:30:52.444973 | 2012-11-21T13:48:44 | 2012-11-21T13:48:44 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 879 | java | package org.mifosng.platform.loan.domain;
import org.joda.time.LocalDate;
import org.mifosng.platform.currency.domain.Money;
public class LoanTransactionBuilder {
private Money transactionAmount = new MoneyBuilder().build();
private LocalDate transactionDate = LocalDate.now();
private boolean repayment = false;
public LoanTransaction build() {
LoanTransaction transaction = null;
if (repayment) {
transaction = LoanTransaction.repayment(transactionAmount, transactionDate);
}
return transaction;
}
public LoanTransactionBuilder with(final Money newAmount) {
this.transactionAmount = newAmount;
return this;
}
public LoanTransactionBuilder with(final LocalDate withTransactionDate) {
this.transactionDate = withTransactionDate;
return this;
}
public LoanTransactionBuilder repayment() {
this.repayment = true;
return this;
}
}
| [
"keithwoodlock@gmail.com"
] | keithwoodlock@gmail.com |
6b68fedea431ccfe59fcf9e78ffc86dfb553d43b | 3d1168c443a154bc4a4e75e12db9d0d1edf57de8 | /eagleboard-services/eagleboard-service-dxf2/src/test/java/com/mass3d/dxf2/metadata/jobs/MetadataRetryContextTest.java | 7665eb7b89fe64c90198786d26e1e4a641654fc2 | [] | no_license | Hamza-ye/eagleboard-platform | cabdb2445fe5d42b4f7bc69b6a9273e1a11d6a29 | 7c178b466ebf7eeef31c7e9288b8a3bafc87339f | refs/heads/master | 2023-01-07T06:07:22.794363 | 2020-11-09T22:35:34 | 2020-11-09T22:35:34 | 307,714,180 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,074 | java | package com.mass3d.dxf2.metadata.jobs;
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
import com.mass3d.DhisSpringTest;
import com.mass3d.dxf2.metadata.feedback.ImportReport;
import com.mass3d.dxf2.metadata.sync.MetadataSyncSummary;
import com.mass3d.feedback.Status;
import com.mass3d.metadata.version.MetadataVersion;
import org.junit.Before;
import org.junit.Test;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.springframework.retry.RetryContext;
public class MetadataRetryContextTest
extends DhisSpringTest
{
@Mock
RetryContext retryContext;
@InjectMocks
MetadataRetryContext metadataRetryContext;
private MetadataVersion mockVersion;
private String testKey = "testKey";
private String testMessage = "testMessage";
@Before
public void setUp() throws Exception
{
MockitoAnnotations.initMocks( this );
mockVersion = mock( MetadataVersion.class );
}
@Test
public void testShouldGetRetryContextCorrectly() throws Exception
{
assertEquals( retryContext, metadataRetryContext.getRetryContext() );
}
@Test
public void testShouldSetRetryContextCorrectly() throws Exception
{
RetryContext newMock = mock( RetryContext.class );
metadataRetryContext.setRetryContext( newMock );
assertEquals( newMock, metadataRetryContext.getRetryContext() );
}
@Test
public void testIfVersionIsNull() throws Exception
{
metadataRetryContext.updateRetryContext( testKey, testMessage, null );
verify( retryContext ).setAttribute( testKey, testMessage );
verify( retryContext, never() ).setAttribute( MetadataSyncJob.VERSION_KEY, null );
}
@Test
public void testIfVersionIsNotNull() throws Exception
{
metadataRetryContext.updateRetryContext( testKey, testMessage, mockVersion );
verify( retryContext ).setAttribute( testKey, testMessage );
verify( retryContext ).setAttribute( MetadataSyncJob.VERSION_KEY, mockVersion );
}
@Test
public void testIfSummaryIsNull() throws Exception
{
MetadataSyncSummary metadataSyncSummary = mock( MetadataSyncSummary.class );
metadataRetryContext.updateRetryContext( testKey, testMessage, mockVersion, null );
verify( retryContext ).setAttribute( testKey, testMessage );
verify( metadataSyncSummary, never() ).getImportReport();
}
@Test
public void testIfSummaryIsNotNull() throws Exception
{
MetadataSyncSummary testSummary = new MetadataSyncSummary();
ImportReport importReport = new ImportReport();
importReport.setStatus( Status.ERROR );
testSummary.setImportReport( importReport );
metadataRetryContext.updateRetryContext( testKey, testMessage, mockVersion, testSummary );
verify( retryContext ).setAttribute( testKey, testMessage );
}
} | [
"7amza.it@gmail.com"
] | 7amza.it@gmail.com |
ea355a26e0a7d7cc2f796a3526181f298d2863fa | 5c2be9dc311a6ee7964efb10bfaac0c626b2bb8c | /sfm-map/src/main/java/org/simpleflatmapper/map/property/DefaultDateFormatProperty.java | 105f265f2dccaf974964ae54a16fe6878d68f271 | [
"MIT"
] | permissive | hank-cp/SimpleFlatMapper | e205eaa4cea885c894cee40080cd41291e32f952 | 7131e74d5d635f577d602ae4c6f06d807216b1d8 | refs/heads/master | 2023-03-04T22:03:21.409617 | 2023-02-23T09:56:16 | 2023-02-23T09:56:16 | 217,269,583 | 0 | 0 | MIT | 2019-10-24T10:09:06 | 2019-10-24T10:09:05 | null | UTF-8 | Java | false | false | 575 | java | package org.simpleflatmapper.map.property;
import org.simpleflatmapper.util.date.DefaultDateFormatSupplier;
import static org.simpleflatmapper.util.Asserts.requireNonNull;
public class DefaultDateFormatProperty implements DefaultDateFormatSupplier {
private final String pattern;
public DefaultDateFormatProperty(String pattern) {
this.pattern = requireNonNull("pattern", pattern);
}
public String get() {
return pattern;
}
@Override
public String toString() {
return "DefaultDateFormat{'" + pattern + "'}";
}
}
| [
"arnaud.roger@gmail.com"
] | arnaud.roger@gmail.com |
682217a396ded3bb18f40fae9b75cac4bc7dcf1f | 4aa2719d74e2c770ee569f3ae6e6021440ea942d | /4.图书管理系统/图书管理系统/src/bookManageSystem/view/AboutSoftDialog.java | f87f8549211d9eca84c675fb8ccae5392d772d41 | [
"Apache-2.0"
] | permissive | zdqmyls/JavaExerciseProject | d0c7f38743c60c5b025b64c81db680c1d9848885 | 4564e70df0c0e772c65c208a101315adee43c422 | refs/heads/master | 2022-03-08T21:37:01.040077 | 2019-08-06T04:42:32 | 2019-08-06T04:42:32 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,702 | java | package bookManageSystem.view;
import bookManageSystem.tools.ComponentTools;
import bookManageSystem.tools.SimpleTools;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
public class AboutSoftDialog extends JDialog implements ActionListener,MouseListener {
private ComponentTools componentTools=new ComponentTools();
private JPanel aboutSoftPanel;
private Box totalHBox,leftHBox,rightVBox;
private JLabel iconLabel,systemLabel,editionLabel,hyperlinkLabel;
private JButton closeButton;
public AboutSoftDialog(){
this.setTitle("关于软件");
this.setBounds(400,400,500,300);
this.setContentPane(this.createAboutSoftPanel());
this.setVisible(false);
closeButton.addActionListener(this::actionPerformed);
hyperlinkLabel.addMouseListener(this);
}
public JPanel createAboutSoftPanel(){
aboutSoftPanel=new JPanel();
aboutSoftPanel.setLayout(new BorderLayout());
totalHBox=Box.createHorizontalBox();
leftHBox=Box.createHorizontalBox();
iconLabel=new JLabel();
/*--打包JAR包路径--*/
String imagePath=new SimpleTools().getJARPath();
iconLabel.setIcon(componentTools.iconSize(new ImageIcon(imagePath+"/images/panda.png"),
160,160));
// iconLabel.setIcon(componentTools.iconSize(new ImageIcon("src/bookManageSystem/images/panda.png"),160,160));
leftHBox.add(iconLabel);
totalHBox.add(leftHBox);
rightVBox=Box.createVerticalBox();
systemLabel=new JLabel("惰惰龟图书管理系统");
systemLabel.setFont(new Font("微软雅黑",Font.PLAIN,30));
editionLabel=new JLabel("版本 1.0");
editionLabel.setFont(new Font("微软雅黑",Font.PLAIN,30));
hyperlinkLabel=new JLabel("<html><u>相关GitHub链接</u></html>");
hyperlinkLabel.setForeground(new Color(0, 149, 200));
hyperlinkLabel.setFont(new Font("微软雅黑",Font.PLAIN,20));
rightVBox.add(systemLabel);
rightVBox.add(Box.createVerticalStrut(50));
rightVBox.add(editionLabel);
rightVBox.add(Box.createVerticalStrut(50));
rightVBox.add(hyperlinkLabel);
totalHBox.add(Box.createHorizontalStrut(20));
totalHBox.add(rightVBox);
aboutSoftPanel.add(totalHBox,BorderLayout.NORTH);
closeButton=new JButton("关闭");
Box buttonHBox=Box.createHorizontalBox();
buttonHBox.add(closeButton);
aboutSoftPanel.add(buttonHBox,BorderLayout.EAST);
return aboutSoftPanel;
}
@Override
public void actionPerformed(ActionEvent e) {
if(e.getSource()==closeButton){
this.setVisible(false);
}
}
@Override
public void mouseClicked(MouseEvent e) {
Desktop desktop = Desktop.getDesktop();
try {
desktop.browse(new URI("https://github.com/lck100/JavaExerciseProject/tree/master/1" +
".%E7%AE%A1%E5%AE%B6%E5%A9%86%E7%B3%BB%E7%BB%9F/%E7%AE%A1%E5%AE%B6%E5%A9%86%E7%B3%BB%E7%BB%9F%EF%BC%88JavaFX%E7%89%88%EF%BC%89"));
} catch (IOException | URISyntaxException e1) {
e1.printStackTrace();
}
}
@Override
public void mousePressed(MouseEvent e) {
hyperlinkLabel.setCursor(new Cursor(Cursor.HAND_CURSOR));
hyperlinkLabel.setForeground(new Color(0,0,0));
}
@Override
public void mouseReleased(MouseEvent e) {
}
@Override
public void mouseEntered(MouseEvent e) {
}
@Override
public void mouseExited(MouseEvent e) {
}
}
| [
"2961316542@qq.com"
] | 2961316542@qq.com |
c1823ee4d5136f481cc1d9e406a5f5b19631f1a9 | f17a8f4dd140532ee10730639f86b62683985c58 | /src/main/java/com/cisco/axl/api/_8/LTvsCertificateService.java | c2c5f3e21f6ed3912c8e4a4ca187e9286e5a866f | [
"Apache-2.0"
] | permissive | alexpekurovsky/cucm-http-api | 16f1b2f54cff4dcdc57cf6407c2a40ac8302a82a | a1eabf49cc9a05c8293ba07ae97f2fe724a6e24d | refs/heads/master | 2021-01-15T14:19:10.994351 | 2013-04-04T15:32:08 | 2013-04-04T15:32:08 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,061 | java |
package com.cisco.axl.api._8;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for LTvsCertificateService complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="LTvsCertificateService">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence minOccurs="0">
* <element name="serviceName" type="{http://www.cisco.com/AXL/API/8.0}XCertificateService" minOccurs="0"/>
* </sequence>
* <attribute name="uuid" type="{http://www.cisco.com/AXL/API/8.0}XUUID" />
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "LTvsCertificateService", propOrder = {
"serviceName"
})
public class LTvsCertificateService {
protected String serviceName;
@XmlAttribute
protected String uuid;
/**
* Gets the value of the serviceName property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getServiceName() {
return serviceName;
}
/**
* Sets the value of the serviceName property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setServiceName(String value) {
this.serviceName = value;
}
/**
* Gets the value of the uuid property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getUuid() {
return uuid;
}
/**
* Sets the value of the uuid property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setUuid(String value) {
this.uuid = value;
}
}
| [
"martin@filliau.com"
] | martin@filliau.com |
8f94f7e673f6d812e75693e51641b993e25a4117 | f3b745afa0087c06d0f8079500052da8324d0606 | /src/main/java/com/matriculate/entity/School.java | af72d5c72fbbd6799226f10f8f418e04553fd555 | [] | no_license | yezijian1677/martiulate | 84214b75c44514ed0c89f43085d92db4ec399d29 | 7f9b8af10c97314ec34b15924f92bdd1e649ba9d | refs/heads/master | 2022-12-24T20:19:28.246108 | 2019-04-07T04:44:48 | 2019-04-07T04:44:48 | 178,008,632 | 1 | 0 | null | 2022-12-16T03:06:07 | 2019-03-27T14:13:58 | Java | UTF-8 | Java | false | false | 559 | java | package com.matriculate.entity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString
public class School {
private String ksh;
private String klmc;
private String klxx;
private String pcmc;
private String pcxx;
private String yxdm;
private String yxmc;
private String zydm;
private String zymc;
private Integer zf;
private Integer pm;
private String ccdm;
private String lqzyxh;
} | [
"1677390657@qq.com"
] | 1677390657@qq.com |
926fbd7c7dda82f53882e44174ff0b9e6ec42fbf | 5c88f575420c64377c113b7706a702c50327e7f0 | /src/com/zc/dao/SchoolDao.java | 7e491e92d0ab9ef071b5394ec845863d4e2263fe | [] | no_license | FlyingZC/MyAjax | c7458a6be635bcf1606b82d63453ce3827afd0bf | 3ed690eb480843a6fb40da6755d40d442a4fe316 | refs/heads/master | 2021-01-17T19:20:06.037985 | 2016-09-28T04:29:13 | 2016-09-28T04:29:13 | 62,223,875 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 690 | java | package com.zc.dao;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.handlers.BeanListHandler;
import org.apache.commons.dbutils.handlers.MapListHandler;
import com.zc.entity.City;
import com.zc.entity.School;
import com.zc.util.DataSourceHelper;
public class SchoolDao {
public SchoolDao(){}
public List<Map<String,Object>> queryAllSchool(int cityId) throws Exception
{
QueryRunner runner =new QueryRunner(DataSourceHelper.getSource());
String sql=" select schoolId,schoolName from school where cityId=? ";
return runner.query(sql, new MapListHandler(),cityId);
}
}
| [
"1262797000@qq.com"
] | 1262797000@qq.com |
957550275d07dedf45027d760a2e35e786228cd9 | 36ecc95b05120dd9923bbaaae4950dcab5b66e19 | /java/object-relationships/src/test/java/com/jimbarritt/tutorial/oo_relationships/length/LengthTest.java | 3e86e5429730f419bfeacf2764be781ff3fe20fa | [] | no_license | jimbarritt/tutorial | 521c343db0d179ad63a6964c5156bf0099331a8c | 732bd79cfcb6c10327e94fb35463c49087200d2a | refs/heads/master | 2021-01-01T18:22:03.026170 | 2011-03-29T14:47:01 | 2011-03-29T14:47:01 | 835,437 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,442 | java | package com.jimbarritt.tutorial.oo_relationships.length;
import org.junit.*;
import java.util.*;
import static com.jimbarritt.tutorial.oo_relationships.length.DistanceUnit.centimetres;
import static com.jimbarritt.tutorial.oo_relationships.length.DistanceUnit.metres;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.is;
public class LengthTest {
@Test
public void ten_centimetres_is_ten_centimetres() {
assertThat(new Length(10, centimetres), is(new Length(10, centimetres)));
}
@Test
public void ten_centimetres_is_one_tenth_of_a_metre() {
Length tenCentimetres = new Length(10, centimetres);
Length oneTenthOfAMetre = new Length(0.1, metres);
assertThat(tenCentimetres, is(equalTo(oneTenthOfAMetre)));
}
@Test
public void hashcode_works_with_same_units() {
Set<Length> lengths = new HashSet<Length>();
lengths.add(new Length(10, centimetres));
lengths.add(new Length(10, centimetres));
lengths.add(new Length(20, centimetres));
assertThat(lengths.size(), is(2));
}
@Test
public void hashcode_works_with_different_units() {
Set<Length> lengths = new HashSet<Length>();
lengths.add(new Length(10, centimetres));
lengths.add(new Length(0.1, metres));
assertThat(lengths.size(), is(1));
}
} | [
"jim@planet-ix.com"
] | jim@planet-ix.com |
53fc597b51377082f3376be5969b280214dca3a7 | 55f938af7c07ec8c54b24a33ebbb220bbbee8f79 | /common/src/main/java/me/lucko/luckperms/common/commands/generic/permission/PermissionCheckInherits.java | 433224e19653da5568aa8bb4db0fe64f2bf380ff | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | ptogher/LuckPerms | b429da816547aa57a61195c21062862282564fa6 | 509e89b9cf711d1612f590788a76cfd75173f256 | refs/heads/master | 2020-03-07T10:16:44.024499 | 2018-03-30T10:58:32 | 2018-03-30T10:58:32 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,190 | java | /*
* This file is part of LuckPerms, licensed under the MIT License.
*
* Copyright (c) lucko (Luck) <luck@lucko.me>
* Copyright (c) contributors
*
* 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.
*/
package me.lucko.luckperms.common.commands.generic.permission;
import me.lucko.luckperms.api.StandardNodeEquality;
import me.lucko.luckperms.api.context.MutableContextSet;
import me.lucko.luckperms.common.command.CommandResult;
import me.lucko.luckperms.common.command.abstraction.CommandException;
import me.lucko.luckperms.common.command.abstraction.SharedSubCommand;
import me.lucko.luckperms.common.command.access.ArgumentPermissions;
import me.lucko.luckperms.common.command.access.CommandPermission;
import me.lucko.luckperms.common.command.utils.ArgumentParser;
import me.lucko.luckperms.common.command.utils.MessageUtils;
import me.lucko.luckperms.common.locale.LocaleManager;
import me.lucko.luckperms.common.locale.command.CommandSpec;
import me.lucko.luckperms.common.locale.message.Message;
import me.lucko.luckperms.common.model.PermissionHolder;
import me.lucko.luckperms.common.node.InheritanceInfo;
import me.lucko.luckperms.common.node.NodeFactory;
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
import me.lucko.luckperms.common.sender.Sender;
import me.lucko.luckperms.common.utils.Predicates;
import java.util.List;
import static me.lucko.luckperms.common.command.utils.TabCompletions.getPermissionTabComplete;
public class PermissionCheckInherits extends SharedSubCommand {
public PermissionCheckInherits(LocaleManager locale) {
super(CommandSpec.PERMISSION_CHECK_INHERITS.localize(locale), "checkinherits", CommandPermission.USER_PERM_CHECK_INHERITS, CommandPermission.GROUP_PERM_CHECK_INHERITS, Predicates.is(0));
}
@Override
public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List<String> args, String label, CommandPermission permission) throws CommandException {
if (ArgumentPermissions.checkViewPerms(plugin, sender, permission, holder)) {
Message.COMMAND_NO_PERMISSION.send(sender);
return CommandResult.NO_PERMISSION;
}
String node = ArgumentParser.parseString(0, args);
MutableContextSet context = ArgumentParser.parseContext(1, args, plugin);
InheritanceInfo result = holder.searchForInheritedMatch(NodeFactory.builder(node).withExtraContext(context).build(), StandardNodeEquality.IGNORE_VALUE_OR_IF_TEMPORARY);
String location = result.getLocation().orElse(null);
if (location == null || location.equalsIgnoreCase(holder.getObjectName())) {
location = "self";
}
String s = MessageUtils.formatTristate(result.getResult());
Message.CHECK_INHERITS_PERMISSION.send(sender, holder.getFriendlyName(), node, s, MessageUtils.contextSetToString(context), String.valueOf(location));
return CommandResult.SUCCESS;
}
@Override
public List<String> tabComplete(LuckPermsPlugin plugin, Sender sender, List<String> args) {
return getPermissionTabComplete(args, plugin.getPermissionVault());
}
}
| [
"git@lucko.me"
] | git@lucko.me |
fb1fe415f0d32f17481e0b1af2d118d944f08054 | b12218b44655c734ef72edbfbd157a774c5754ad | /aplanmis/src/main/java/com/augurit/aplanmis/front/subject/unit/controller/RestUnitController.java | 745f097a1c1e02df55dfe5bb82ab2b1a3d73d496 | [] | no_license | laughing1990/aplan-fork | 590a0ebf520e75d1430d5ed862979f6757a6a9e8 | df27f74c7421982639169cb45a814c9723d9ead9 | refs/heads/master | 2021-05-21T16:27:32.373425 | 2019-12-19T09:26:31 | 2019-12-19T09:26:31 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,155 | java | package com.augurit.aplanmis.front.subject.unit.controller;
import com.augurit.agcloud.framework.ui.result.ContentResultForm;
import com.augurit.agcloud.framework.ui.result.ResultForm;
import com.augurit.agcloud.framework.util.StringUtils;
import com.augurit.aplanmis.common.domain.AeaLinkmanInfo;
import com.augurit.aplanmis.common.domain.AeaUnitInfo;
import com.augurit.aplanmis.common.mapper.AeaUnitInfoMapper;
import com.augurit.aplanmis.common.service.linkman.AeaLinkmanInfoService;
import com.augurit.aplanmis.common.service.unit.AeaUnitInfoService;
import com.augurit.aplanmis.front.subject.unit.service.RestUnitService;
import com.augurit.aplanmis.front.subject.unit.vo.UnitAddVo;
import com.augurit.aplanmis.front.subject.unit.vo.UnitEditVo;
import com.augurit.aplanmis.front.subject.unit.vo.UnitVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
@RestController
@Slf4j
@RequestMapping("/rest/unit")
@Api(tags = "申报-企业单位")
public class RestUnitController {
@Autowired
private AeaUnitInfoService aeaUnitInfoService;
@Autowired
private AeaLinkmanInfoService aeaLinkmanInfoService;
@Autowired
private RestUnitService restUnitService;
@Autowired
private AeaUnitInfoMapper aeaUnitInfoMapper;
@ApiOperation(value = "根据企业单位名称模糊查询")
@ApiImplicitParams({
@ApiImplicitParam(name = "keyword", value = "查询关键字", dataType = "String"),
@ApiImplicitParam(name = "projInfoId", value = "项目id", dataType = "String")
})
@GetMapping("/list")
public ContentResultForm<Set<UnitVo>> list(@RequestParam(required = false) String keyword, @RequestParam(required = false) String projInfoId) {
Set<UnitVo> unitsByKeyword = aeaUnitInfoService.findAeaUnitInfoByKeyword(keyword)
.stream()
.map(this::getUnitVo).collect(Collectors.toSet());
/// 先放开,可以根据关键字查询所有单位
/*if (StringUtils.isNotBlank(projInfoId)) {
Set<UnitVo> unitVos = aeaUnitInfoService.findAllProjUnit(projInfoId)
.stream()
.map(this::getUnitVo).collect(Collectors.toSet());
// 取交集,合并结果
unitsByKeyword.retainAll(unitVos);
}*/
return new ContentResultForm<>(true, unitsByKeyword, "Query success");
}
private UnitVo getUnitVo(AeaUnitInfo u) {
AeaLinkmanInfo aeaLinkmanInfo = new AeaLinkmanInfo();
List<AeaLinkmanInfo> allUnitLinkman = aeaLinkmanInfoService.findAllUnitLinkman(u.getUnitInfoId());
if (allUnitLinkman.size() > 0) {
aeaLinkmanInfo = allUnitLinkman.get(0);
}
return UnitVo.from(u, aeaLinkmanInfo);
}
@ApiOperation(value = "编辑企业单位")
@PostMapping("/edit")
public ContentResultForm<String> edit(UnitEditVo unitEditVo) {
Assert.isTrue(StringUtils.isNotBlank(unitEditVo.getUnitInfoId()) , "unitInfoId is null");
AeaUnitInfo aeaUnitInfo = aeaUnitInfoService.getAeaUnitInfoByUnitInfoId(unitEditVo.getUnitInfoId());
if (aeaUnitInfo == null) {
throw new RuntimeException("AeaUnitInfo not found. unitInfoId: " + unitEditVo.getUnitInfoId());
}
aeaUnitInfoService.updateAeaUnitInfo(unitEditVo.mergeAeaUnitInfo(aeaUnitInfo));
// 更新企业项目关联
if (StringUtils.isNotBlank(unitEditVo.getProjInfoId())
&& StringUtils.isNotBlank(unitEditVo.getUnitInfoId())
&& StringUtils.isNotBlank(unitEditVo.getLinkmanInfoId())) {
restUnitService.updateUnitProj(unitEditVo.getProjInfoId(), unitEditVo.getUnitInfoId(), unitEditVo.getLinkmanInfoId(), unitEditVo.getUnitType(), unitEditVo.getIsOwner());
}
if (unitEditVo.getLinkmanType() != null) {
restUnitService.updateUnitProjLinkman(unitEditVo);
}
return new ContentResultForm<>(true, unitEditVo.getUnitInfoId(), "Edit unit success");
}
@ApiOperation(value = "新增企业单位")
@PostMapping("/save")
public ContentResultForm<String> save(UnitAddVo unitAddVo) throws Exception {
String unitInfoId = restUnitService.save(unitAddVo);
return new ContentResultForm<>(true, unitInfoId, "Save unit success");
}
@ApiOperation(value = "删除企业单位")
@PostMapping("/delete")
public ContentResultForm<String> delete(@RequestParam String unitInfoId, @RequestParam String projInfoId) {
Assert.isTrue(StringUtils.isNotBlank(unitInfoId), "unitInfoId is null");
Assert.isTrue(StringUtils.isNotBlank(projInfoId), "projInfoId is null");
aeaUnitInfoService.deleteUnitProj(projInfoId, null, unitInfoId);
return new ContentResultForm<>(true, unitInfoId, "Delete unit success");
}
@GetMapping("/list/by/{projectInfoId}")
@ApiOperation(value = "根据项目ID查找关联的单位列表")
@ApiImplicitParam(name = "projectInfoId", value = "项目id", required = true, dataType = "String")
public ContentResultForm<List<UnitVo>> listByProjectInfoId(@PathVariable String projectInfoId) {
Assert.isTrue(StringUtils.isNotBlank(projectInfoId) , "projectInfoId is null");
List<UnitVo> unitVos = aeaUnitInfoService.findAllProjUnit(projectInfoId).stream()
.map(u -> UnitVo.from(u, null)).collect(Collectors.toList());
return new ContentResultForm<>(true, unitVos, "Query success");
}
@GetMapping("/list/{linkmanInfoId}")
@ApiOperation(value = "根据联系人ID查找关联的单位列表")
public ContentResultForm<List<AeaUnitInfo>> listUnitInfosByLinkmanInfoId(@PathVariable String linkmanInfoId) {
Assert.isTrue(StringUtils.isNotBlank(linkmanInfoId), "unitInfoId is null");
List<AeaUnitInfo> aeaUnitInfos = aeaUnitInfoMapper.getAeaUnitListByLinkmanInfoId(linkmanInfoId);
return new ContentResultForm<>(true, aeaUnitInfos, "Query success");
}
@PostMapping("/delete/by/{linkmanInfoId}")
@ApiOperation("根据联系人id删除企业单位关联")
public ResultForm deleteUnitByLinkmanInfoId(@PathVariable String linkmanInfoId, String unitInfoId) {
Assert.hasText(linkmanInfoId, "linkmanInfoId is null");
Assert.hasText(unitInfoId, "unitInfoId is null");
restUnitService.deleteUnitByLinkmanInfoId(linkmanInfoId, unitInfoId);
return new ResultForm(true, "success");
}
}
| [
"xiongyb@augurit.com"
] | xiongyb@augurit.com |
9017806529fb4bd3593e86a3ee2f0dfc8b7d532b | 9a6b83abe2ef1b78a9bc0550abb57f93c12af897 | /src/main/java/org/cyclops/integrateddynamics/api/evaluate/variable/IValueTypeLightLevelRegistry.java | abec5117a6bd3b92c6ae7214505315549d2ae59c | [
"MIT"
] | permissive | CyclopsMC/IntegratedDynamics | 17fa3b5ebb3548e04e4f5714e8259df16991a6a1 | 5d944061d749912c5b5428cf8343cfc29e073a6a | refs/heads/master-1.20 | 2023-09-03T18:20:49.515418 | 2023-08-29T16:54:10 | 2023-08-29T16:54:10 | 33,450,119 | 131 | 102 | MIT | 2023-08-09T08:55:29 | 2015-04-05T18:10:24 | Java | UTF-8 | Java | false | false | 1,649 | java | package org.cyclops.integrateddynamics.api.evaluate.variable;
import org.cyclops.cyclopscore.init.IRegistry;
import org.cyclops.integrateddynamics.api.evaluate.InvalidValueTypeException;
import javax.annotation.Nullable;
/**
* Registry for mapping value types to their light level calculator.
* @author rubensworks
*/
public interface IValueTypeLightLevelRegistry extends IRegistry {
/**
* Register light level calculator for a value type.
* @param valueType The value type
* @param lightLevelCalculator The light level calculator.
* @param <L> The light level calculator type.
* @param <V> The value type.
* @return The registered light level calculator.
*/
public <L extends ILightLevelCalculator<V>, V extends IValue> L register(IValueType<V> valueType, L lightLevelCalculator);
/**
* Get the light level calculator for the given value type.
* @param valueType The value type
* @param <V> The value type.
* @return The registered light level calculator.
*/
@Nullable
public <V extends IValue> ILightLevelCalculator<V> getLightLevelCalculator(IValueType<V> valueType);
/**
* Get the light level calculator for the given value.
* @param value The value
* @param <V> The value type.
* @return The registered light level calculator.
* @throws InvalidValueTypeException If an error occured while autocasting.
*/
public <V extends IValue> int getLightLevel(V value) throws InvalidValueTypeException;
public static interface ILightLevelCalculator<V extends IValue> {
public int getLightLevel(V value);
}
}
| [
"rubensworks@gmail.com"
] | rubensworks@gmail.com |
2a0d19e76d312ac56cdd552696a2cfcfd25f80fa | c9497fc0fd48ef307d14ed47c63447ddd520645f | /LuxorMC Framework/src/com/faithfulmc/framework/command/module/inventory/ClearInvCommand.java | 705d4a45d54b63022eff1c4c9a695b4a2f6319af | [
"Apache-2.0"
] | permissive | Tominous/Faithfulmc | 7fe0325f3a8437855cb231bf3f88e2bb98656abe | c057628cdbf770e2892b5bf0cdfccdcb54bc8bfa | refs/heads/master | 2020-12-10T14:25:07.320691 | 2020-01-13T14:47:15 | 2020-01-13T14:47:15 | 233,617,706 | 2 | 0 | Apache-2.0 | 2020-01-13T14:42:51 | 2020-01-13T14:42:51 | null | UTF-8 | Java | false | false | 2,287 | java | package com.faithfulmc.framework.command.module.inventory;
import com.faithfulmc.framework.BaseConstants;
import com.faithfulmc.framework.command.BaseCommand;
import com.faithfulmc.util.BukkitUtils;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.PlayerInventory;
import java.util.Collections;
import java.util.List;
public class ClearInvCommand extends BaseCommand {
public ClearInvCommand() {
super("ci", "Clears a players inventory.");
this.setAliases(new String[]{"clear", "clearinventory"});
this.setUsage("/(command) <playerName>");
}
@Override
public boolean isPlayerOnlyCommand() {
return true;
}
@Override
public boolean onCommand(final CommandSender sender, final Command command, final String label, final String[] args) {
Player target;
if (args.length > 0 && sender.hasPermission(command.getPermission() + ".others")) {
target = BukkitUtils.playerWithNameOrUUID(args[0]);
} else {
if (!(sender instanceof Player)) {
sender.sendMessage(ChatColor.RED + "Usage: " + this.getUsage(label));
return true;
}
target = (Player) sender;
}
if (target != null && BaseCommand.canSee(sender, target)) {
final PlayerInventory targetInventory = target.getInventory();
targetInventory.clear();
targetInventory.setArmorContents(new ItemStack[]{new ItemStack(Material.AIR, 1), new ItemStack(Material.AIR, 1), new ItemStack(Material.AIR, 1), new ItemStack(Material.AIR, 1)});
Command.broadcastCommandMessage(sender, BaseConstants.YELLOW + "Cleared inventory of player " + target.getName() + '.');
return true;
}
sender.sendMessage(String.format(BaseConstants.PLAYER_WITH_NAME_OR_UUID_NOT_FOUND, args[0]));
return true;
}
@Override
public List onTabComplete(final CommandSender sender, final Command command, final String label, final String[] args) {
return (args.length == 1) ? null : Collections.emptyList();
}
}
| [
"realhcfus@gmail.com"
] | realhcfus@gmail.com |
a0e9604db3be7d6ca19d05bd31d52e1137b49fae | 09b7f281818832efb89617d6f6cab89478d49930 | /root/projects/remote-api/source/generated/org/alfresco/repo/cmis/ws/EnumPropertiesRelationship.java | da65225aca1b721cee35efec13df27495670b883 | [] | no_license | verve111/alfresco3.4.d | 54611ab8371a6e644fcafc72dc37cdc3d5d8eeea | 20d581984c2d22d5fae92e1c1674552c1427119b | refs/heads/master | 2023-02-07T14:00:19.637248 | 2020-12-25T10:19:17 | 2020-12-25T10:19:17 | 323,932,520 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,372 | java |
package org.alfresco.repo.cmis.ws;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for enumPropertiesRelationship.
*
* <p>The following schema fragment specifies the expected content contained within this class.
* <p>
* <pre>
* <simpleType name="enumPropertiesRelationship">
* <restriction base="{http://www.w3.org/2001/XMLSchema}string">
* <enumeration value="cmis:sourceId"/>
* <enumeration value="cmis:targetId"/>
* </restriction>
* </simpleType>
* </pre>
*
*/
@XmlType(name = "enumPropertiesRelationship", namespace = "http://docs.oasis-open.org/ns/cmis/core/200908/")
@XmlEnum
public enum EnumPropertiesRelationship {
@XmlEnumValue("cmis:sourceId")
CMIS_SOURCE_ID("cmis:sourceId"),
@XmlEnumValue("cmis:targetId")
CMIS_TARGET_ID("cmis:targetId");
private final String value;
EnumPropertiesRelationship(String v) {
value = v;
}
public String value() {
return value;
}
public static EnumPropertiesRelationship fromValue(String v) {
for (EnumPropertiesRelationship c: EnumPropertiesRelationship.values()) {
if (c.value.equals(v)) {
return c;
}
}
throw new IllegalArgumentException(v);
}
}
| [
"verve111@mail.ru"
] | verve111@mail.ru |
d7d872db8c54957184f8c89a6afcccc115e77f28 | 73267be654cd1fd76cf2cb9ea3a75630d9f58a41 | /services/gaussdbfornosql/src/main/java/com/huaweicloud/sdk/gaussdbfornosql/v3/model/ShowBackupPolicyResponse.java | 7b1d68e1bca3840c2e9f65952e8e5db04e424319 | [
"Apache-2.0"
] | permissive | huaweicloud/huaweicloud-sdk-java-v3 | 51b32a451fac321a0affe2176663fed8a9cd8042 | 2f8543d0d037b35c2664298ba39a89cc9d8ed9a3 | refs/heads/master | 2023-08-29T06:50:15.642693 | 2023-08-24T08:34:48 | 2023-08-24T08:34:48 | 262,207,545 | 91 | 57 | NOASSERTION | 2023-09-08T12:24:55 | 2020-05-08T02:27:00 | Java | UTF-8 | Java | false | false | 2,321 | java | package com.huaweicloud.sdk.gaussdbfornosql.v3.model;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.huaweicloud.sdk.core.SdkResponse;
import java.util.Objects;
import java.util.function.Consumer;
/**
* Response Object
*/
public class ShowBackupPolicyResponse extends SdkResponse {
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "backup_policy")
private ShowBackupPolicyResult backupPolicy;
public ShowBackupPolicyResponse withBackupPolicy(ShowBackupPolicyResult backupPolicy) {
this.backupPolicy = backupPolicy;
return this;
}
public ShowBackupPolicyResponse withBackupPolicy(Consumer<ShowBackupPolicyResult> backupPolicySetter) {
if (this.backupPolicy == null) {
this.backupPolicy = new ShowBackupPolicyResult();
backupPolicySetter.accept(this.backupPolicy);
}
return this;
}
/**
* Get backupPolicy
* @return backupPolicy
*/
public ShowBackupPolicyResult getBackupPolicy() {
return backupPolicy;
}
public void setBackupPolicy(ShowBackupPolicyResult backupPolicy) {
this.backupPolicy = backupPolicy;
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj) {
return true;
}
if (obj == null || getClass() != obj.getClass()) {
return false;
}
ShowBackupPolicyResponse that = (ShowBackupPolicyResponse) obj;
return Objects.equals(this.backupPolicy, that.backupPolicy);
}
@Override
public int hashCode() {
return Objects.hash(backupPolicy);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ShowBackupPolicyResponse {\n");
sb.append(" backupPolicy: ").append(toIndentedString(backupPolicy)).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 ");
}
}
| [
"hwcloudsdk@huawei.com"
] | hwcloudsdk@huawei.com |
034e06a835b031680fb7b64b00446fd61112f438 | 69c1256baec48b66365b5ec8faec5d6318b0eb21 | /Mage.Sets/src/mage/sets/starter1999/EarthElemental.java | 87bd8a3f85735152e25f4461524d5a3199a6a805 | [] | no_license | gbraad/mage | 3b84eefe4845258f6250a7ff692e1f2939864355 | 18ce6a0305db6ebc0d34054af03fdb0ba88b5a3b | refs/heads/master | 2022-09-28T17:31:38.653921 | 2015-04-04T22:28:22 | 2015-04-04T22:28:22 | 33,435,029 | 1 | 0 | null | 2022-09-01T23:39:50 | 2015-04-05T08:25:58 | Java | UTF-8 | Java | false | false | 2,182 | java | /*
* Copyright 2010 BetaSteward_at_googlemail.com. 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 BetaSteward_at_googlemail.com ``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 BetaSteward_at_googlemail.com 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 BetaSteward_at_googlemail.com.
*/
package mage.sets.starter1999;
import java.util.UUID;
/**
*
* @author LevelX2
*/
public class EarthElemental extends mage.sets.tenth.EarthElemental {
public EarthElemental(UUID ownerId) {
super(ownerId);
this.cardNumber = 95;
this.expansionSetCode = "S99";
}
public EarthElemental(final EarthElemental card) {
super(card);
}
@Override
public EarthElemental copy() {
return new EarthElemental(this);
}
}
| [
"ludwig.hirth@online.de"
] | ludwig.hirth@online.de |
6925867c146b7d8ba6c330d16c65f95d81123c77 | f8e300aa04370f8836393455b8a10da6ca1837e5 | /CounselorAPP/app/src/main/java/com/cesaas/android/counselor/order/stafftest/CompleteTestFragment.java | 2b36e44199e61e5906053eabd1bfd25d02739a68 | [] | no_license | FlyBiao/CounselorAPP | d36f56ee1d5989c279167064442d9ea3e0c3a3ae | b724c1457d7544844ea8b4f6f5a9205021c33ae3 | refs/heads/master | 2020-03-22T21:30:14.904322 | 2018-07-12T12:21:37 | 2018-07-12T12:21:37 | 140,691,614 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 5,646 | java | package com.cesaas.android.counselor.order.stafftest;
import java.util.ArrayList;
import android.annotation.SuppressLint;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.widget.SwipeRefreshLayout;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import com.cesaas.android.counselor.order.BaseFragment;
import com.cesaas.android.counselor.order.R;
import com.cesaas.android.counselor.order.bean.ResultStaffTestCompleteBean;
import com.cesaas.android.counselor.order.bean.ResultStaffTestCompleteBean.StaffTestCompleteBean;
import com.cesaas.android.counselor.order.stafftest.net.StaffCompleteTestNet;
import com.cesaas.android.counselor.order.utils.ToastFactory;
import com.cesaas.android.counselor.order.widget.LoadMoreListView;
import com.cesaas.android.counselor.order.widget.RefreshAndLoadMoreView;
import com.flybiao.adapterlibrary.ViewHolder;
import com.flybiao.adapterlibrary.abslistview.CommonAdapter;
/**
* 完成考试
* @author fgb
*
*/
public class CompleteTestFragment extends BaseFragment{
private LoadMoreListView mLoadMoreListView;//加载更多
private RefreshAndLoadMoreView mRefreshAndLoadMoreView;//下拉刷新
private boolean refresh=false;
private static int pageIndex = 1;//当前页
private View view;
private StaffCompleteTestNet staffTestNet;
private ArrayList<StaffTestCompleteBean> testLis= new ArrayList<StaffTestCompleteBean>();
/**
* 单例
*/
public static CompleteTestFragment instance=null;
public static CompleteTestFragment getInstance(){
if(instance==null){
instance=new CompleteTestFragment();
}
return instance;
}
@Override
@Nullable
public View onCreateView(LayoutInflater inflater,
@Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
view = inflater.inflate(R.layout.activity_complete_test, container,false);
mLoadMoreListView=(LoadMoreListView) view.findViewById(R.id.load_more_complete_test_list);
mRefreshAndLoadMoreView=(RefreshAndLoadMoreView) view.findViewById(R.id.refresh_complete_test_and_load_more);
setAdapter();
return view;
}
/**
* 设置Adapter数据适配器
*/
public void setAdapter(){
mLoadMoreListView.setAdapter(new CommonAdapter<StaffTestCompleteBean>(getContext(),R.layout.item_complete_test,testLis) {
@SuppressLint("ResourceAsColor")
@Override
public void convert(ViewHolder holder, StaffTestCompleteBean bean,int postion) {
holder.setText(R.id.tv_complete_test_title, bean.Title);
holder.setText(R.id.tv_complete_test_fullscore, bean.FullScore+"");
holder.setText(R.id.tv_test_complete_count, bean.Nums+"");
if(bean.IsMust==1){//必考
holder.getView(R.id.tv_test_complete_ismust).setBackgroundDrawable(getActivity().getResources().getDrawable(R.drawable.button_ellipse_red_bg));
}else{
holder.getView(R.id.tv_test_complete_ismust).setBackgroundDrawable(getActivity().getResources().getDrawable(R.drawable.button_ellipse_orange_bg));
}
if(bean.Score>=bean.PassScore){//通过考试
holder.setText(R.id.tv_complete_passscore, bean.Score+" 已通过");
holder.setTextColor(R.id.tv_passscore, getContext().getResources().getColor(R.color.test_color));
holder.setTextColor(R.id.tv_complete_passscore, getContext().getResources().getColor(R.color.test_color));
}else{//未通过考试
holder.setText(R.id.tv_complete_passscore, bean.Score+" 未通过");
holder.setTextColor(R.id.tv_passscore, getContext().getResources().getColor(R.color.red));
holder.setTextColor(R.id.tv_complete_passscore, getContext().getResources().getColor(R.color.red));
}
}
});
initData();
initItemClickListener();
}
public void onEventMainThread(ResultStaffTestCompleteBean msg) {
if (msg.IsSuccess==true && msg != null) {
testLis.addAll(msg.TModel);
if (testLis.size() > 0&& testLis.size()==20) {
mLoadMoreListView.setHaveMoreData(true);
} else {
mLoadMoreListView.setHaveMoreData(false);
}
mRefreshAndLoadMoreView.setRefreshing(false);
mLoadMoreListView.onLoadComplete();
}
}
/**
* 初始化ItemClick点击事件
*/
private void initItemClickListener() {
mLoadMoreListView.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view,
final int position, long id) {
ToastFactory.getLongToast(getContext(), "position:"+position);
}
});
}
/**
* 初始化数据
*/
private void initData() {
loadData(1);
mRefreshAndLoadMoreView.setLoadMoreListView(mLoadMoreListView);
mLoadMoreListView.setRefreshAndLoadMoreView(mRefreshAndLoadMoreView);
// 设置下拉刷新监听
mRefreshAndLoadMoreView
.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
refresh=true;
pageIndex = 1;
loadData(pageIndex);
}
});
// 设置加载监听
mLoadMoreListView
.setOnLoadMoreListener(new LoadMoreListView.OnLoadMoreListener() {
@Override
public void onLoadMore() {
refresh=false;
loadData(pageIndex + 1);
}
});
}
/**
* 加载数据
* @param page 当前页
*/
protected void loadData(final int page) {
if (page == 1) {
testLis.clear();
}
staffTestNet = new StaffCompleteTestNet(getContext());
staffTestNet.setData(2,page);
pageIndex = page;
}
@Override
protected void lazyLoad() {
// TODO Auto-generated method stub
}
}
| [
"fengguangbiao@163.com"
] | fengguangbiao@163.com |
961673ff636f794871878429e6baafe519aff9d3 | c8ee6fc67d3c1e55e1bd81f2089004ded8902bae | /cw-app-biz/src/main/java/com/cw/biz/log/app/dto/SystemLogDto.java | c5dd0f370c60418b58f7d5b8cd58ea313da3a1fd | [] | no_license | Away-Leo/cw-app | 3f08e69355b8dbda10c36b606ae22f518df07ba7 | 034dfe5534ace27e75e2af680d4e43c95758672e | refs/heads/master | 2022-10-26T21:19:36.461487 | 2019-08-10T21:21:38 | 2019-08-10T21:21:38 | 196,578,757 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 613 | java | package com.cw.biz.log.app.dto;
import com.cw.biz.common.dto.BaseDto;
import com.cw.biz.common.entity.AggEntity;
import lombok.Getter;
import lombok.Setter;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
/**
* 系统操作日志
* Created by Administrator on 2017/6/1.
*/
@Setter
@Getter
public class SystemLogDto extends BaseDto {
private Long userId;
private Date logDate;
private String url;
private String operateArg;
private String action;
private String name;
private String remoteAddress;
}
| [
"781720639@qq.com"
] | 781720639@qq.com |
80be1e1b3c99b72242d5d37bcc7cdb42dbd9e640 | d98ed4986ecdd7df4c04e4ad09f38fdb7a7043e8 | /Hero_Spells/src/main/java/net/sf/anathema/hero/spells/sheet/content/SpellStats.java | dbaf77027c47794237ae4c1ade673cd257c6ba7d | [] | no_license | bjblack/anathema_3e | 3d1d42ea3d9a874ac5fbeed506a1a5800e2a99ac | 963f37b64d7cf929f086487950d4870fd40ac67f | refs/heads/master | 2021-01-19T07:12:42.133946 | 2018-12-18T23:57:41 | 2018-12-18T23:57:41 | 67,353,965 | 0 | 0 | null | 2016-09-04T15:47:48 | 2016-09-04T15:47:48 | null | UTF-8 | Java | false | false | 2,477 | java | package net.sf.anathema.hero.spells.sheet.content;
import com.google.common.collect.Lists;
import net.sf.anathema.hero.magic.display.tooltip.IMagicSourceStringBuilder;
import net.sf.anathema.hero.magic.display.tooltip.source.MagicSourceContributor;
import net.sf.anathema.hero.magic.sheet.content.stats.AbstractMagicStats;
import net.sf.anathema.hero.spells.data.Spell;
import net.sf.anathema.library.resources.Resources;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import java.util.ArrayList;
import java.util.Collection;
import java.util.stream.Collectors;
import java.util.stream.Stream;
public class SpellStats extends AbstractMagicStats<Spell>
{
public SpellStats (Spell spell)
{
super (spell);
}
@Override
public String getGroupName (Resources resources)
{
return resources.getString ("Sheet.Magic.Group.Sorcery");
}
@Override
public String getType (Resources resources)
{
return resources.getString (getMagic ().getCircleType ().getId ());
}
@Override
public String getDurationString (Resources resources)
{
return "-";
}
@Override
public String getSourceString (Resources resources)
{
IMagicSourceStringBuilder<Spell> stringBuilder = new MagicSourceContributor<> (resources);
return stringBuilder.createShortSourceString (getMagic ());
}
protected Collection<String> getDetailKeys ()
{
String duration = getMagic ().getDuration ();
if (duration != null)
{
return Lists.newArrayList ("Spells.Duration." + duration);
}
return new ArrayList<> ();
}
@Override
public Collection<String> getDetailStrings (final Resources resources)
{
Stream<String> keys = getDetailKeys ().stream ();
return keys.map (resources::getString).collect (Collectors.toList ());
}
@Override
public String getNameString (Resources resources)
{
return resources.getString (getMagic ().getName ().text);
}
@SuppressWarnings ("SimplifiableIfStatement")
@Override
public boolean equals (Object obj)
{
if (! (obj instanceof SpellStats))
{
return false;
}
SpellStats other = (SpellStats) obj;
return other.getMagic ().getCircleType ().equals (getMagic ().getCircleType ()) && other.getMagic ().getName ().equals (
getMagic ().getName ());
}
@Override
public int hashCode ()
{
return new HashCodeBuilder ().append (getMagic ().getCircleType ()).append (getMagic ().getName ().text).build ();
}
}
| [
"BJ@BJ-PC"
] | BJ@BJ-PC |
f1276c75603f36fb76679e9d1882bb4e000b95b9 | 5aa194875f7ee1f22501a3d72afbf7f4d47c3402 | /nd4j-tests/src/test/java/org/nd4j/linalg/shape/indexing/IndexingTests.java | 095cbfc43f5904979455a0cf2a15bd3b3ab00fe9 | [
"Apache-2.0"
] | permissive | sidec/nd4j | 8437da6a1d1cebbafc2b456714c8bc1ca2f2d7bd | 1e852f864a82d1ae91274240dd79d279a1fd2a02 | refs/heads/master | 2021-01-18T10:44:21.622867 | 2015-08-20T05:55:48 | 2015-08-20T05:55:48 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,441 | java | package org.nd4j.linalg.shape.indexing;
import org.junit.Test;
import org.nd4j.linalg.BaseNd4jTest;
import org.nd4j.linalg.api.ndarray.INDArray;
import org.nd4j.linalg.factory.Nd4j;
import org.nd4j.linalg.factory.Nd4jBackend;
import org.nd4j.linalg.indexing.NDArrayIndex;
import org.nd4j.linalg.indexing.SpecifiedIndex;
/**
* @author Adam Gibson
*/
public class IndexingTests extends BaseNd4jTest {
public IndexingTests() {
}
public IndexingTests(String name) {
super(name);
}
public IndexingTests(String name, Nd4jBackend backend) {
super(name, backend);
}
public IndexingTests(Nd4jBackend backend) {
super(backend);
}
@Test
public void testTensorGet() {
INDArray threeTwoTwo = Nd4j.linspace(1, 12, 12).reshape(3,2,2);
/*
* [[[ 1., 7.],
[ 4., 10.]],
[[ 2., 8.],
[ 5., 11.]],
[[ 3., 9.],
[ 6., 12.]]])
*/
INDArray firstAssertion = Nd4j.create(new double[]{1,7});
INDArray firstTest = threeTwoTwo.get(NDArrayIndex.point(0), NDArrayIndex.point(0), NDArrayIndex.all());
assertEquals(firstAssertion,firstTest);
INDArray secondAssertion = Nd4j.create(new double[]{3,9});
INDArray secondTest = threeTwoTwo.get(NDArrayIndex.point(2), NDArrayIndex.point(0), NDArrayIndex.all());
assertEquals(secondAssertion, secondTest);
}
@Test
public void testGetRows() {
INDArray arr = Nd4j.linspace(1,9,9).reshape(3,3);
INDArray testAssertion = Nd4j.create(new double[][]{
{5, 8},
{6, 9}
});
INDArray test = arr.get(new SpecifiedIndex(1, 2), new SpecifiedIndex(1, 2));
assertEquals(testAssertion, test);
}
@Test
public void testFirstColumn() {
INDArray arr = Nd4j.create(new double[][]{
{5, 6},
{7, 8}
});
INDArray assertion = Nd4j.create(new double[]{5,7});
INDArray test = arr.get(NDArrayIndex.all(), NDArrayIndex.point(0));
assertEquals(assertion,test);
}
@Test
public void testLinearIndex() {
INDArray linspace = Nd4j.linspace(1,4,4).reshape(2,2);
for(int i = 0; i < linspace.length(); i++) {
assertEquals(i + 1,linspace.getDouble(i),1e-1);
}
}
@Override
public char ordering() {
return 'f';
}
}
| [
"adam@skymind.io"
] | adam@skymind.io |
8bfc94c87d1a6b8e15a555aa833b1187b89fff70 | ea87e7258602e16675cec3e29dd8bb102d7f90f8 | /fest-swing/src/test/java/org/fest/swing/driver/AbstractButtonDriver_TestCase.java | e531b39e92f80eace2a1072d01cc651b60bb6182 | [
"Apache-2.0"
] | permissive | codehaus/fest | 501714cb0e6f44aa1b567df57e4f9f6586311862 | a91c0c0585c2928e255913f1825d65fa03399bc6 | refs/heads/master | 2023-07-20T01:30:54.762720 | 2010-09-02T00:56:33 | 2010-09-02T00:56:33 | 36,525,844 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,859 | java | /*
* Created on Apr 5, 2008
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*
* Copyright @2008-2010 the original author or authors.
*/
package org.fest.swing.driver;
import static org.fest.assertions.Assertions.assertThat;
import static org.fest.swing.driver.AbstractButtonSelectedQuery.isSelected;
import static org.fest.swing.edt.GuiActionRunner.execute;
import static org.fest.swing.test.task.AbstractButtonSetSelectedTask.setSelected;
import static org.fest.swing.test.task.ComponentSetEnabledTask.disable;
import javax.swing.JCheckBox;
import org.fest.swing.annotation.RunsInEDT;
import org.fest.swing.edt.GuiQuery;
import org.fest.swing.test.core.RobotBasedTestCase;
import org.fest.swing.test.swing.TestWindow;
import org.fest.swing.test.task.ComponentSetVisibleTask;
/**
* Base test case for <code>{@link AbstractButtonDriver}</code>.
*
* @author Alex Ruiz
* @author Yvonne Wang
*/
public abstract class AbstractButtonDriver_TestCase extends RobotBasedTestCase {
AbstractButtonDriver driver;
MyWindow window;
JCheckBox checkBox;
@Override protected final void onSetUp() {
driver = new AbstractButtonDriver(robot);
window = MyWindow.createNew(getClass());
checkBox = window.checkBox;
}
@RunsInEDT
final void disableCheckBox() {
disable(checkBox);
robot.waitForIdle();
}
@RunsInEDT
final void showWindow() {
robot.showWindow(window);
}
@RunsInEDT
final void hideWindow() {
ComponentSetVisibleTask.hide(window);
robot.waitForIdle();
}
@RunsInEDT
final void assertThatCheckBoxIsNotSelected() {
assertThat(isSelected(checkBox)).isFalse();
}
@RunsInEDT
final void selectCheckBox() {
setSelected(checkBox, true);
robot.waitForIdle();
}
@RunsInEDT
final void unselectCheckBox() {
setSelected(checkBox, false);
robot.waitForIdle();
}
static class MyWindow extends TestWindow {
private static final long serialVersionUID = 1L;
@RunsInEDT
static MyWindow createNew(final Class<?> testClass) {
return execute(new GuiQuery<MyWindow>() {
@Override protected MyWindow executeInEDT() {
return new MyWindow(testClass);
}
});
}
final JCheckBox checkBox = new JCheckBox("Hello", true);
private MyWindow(Class<?> testClass) {
super(testClass);
add(checkBox);
}
}
}
| [
"alexruiz@0e018e5f-c563-0410-a877-f7675914c6cc"
] | alexruiz@0e018e5f-c563-0410-a877-f7675914c6cc |
634f175709d52c9b7bc96b31ada32d06e867413b | c0635f0cba455fffddd64277d3a1a46fc26b49bf | /project/web/src/main/java/de/mobanisto/covidplz/PathHelper.java | a025dbbcd11ed35c8e267236bc900f520f951e6a | [
"MIT"
] | permissive | mobanisto/covid-plz | 1780a458d62a9984095609990fa0fe95806f2e63 | 29ba68169bd7ea0b45d329c21a9b10f804b0402a | refs/heads/master | 2023-02-16T04:05:16.024263 | 2020-10-24T17:14:47 | 2020-10-24T17:14:47 | 302,289,535 | 15 | 1 | null | 2021-02-07T19:11:50 | 2020-10-08T09:20:22 | HTML | UTF-8 | Java | false | false | 1,465 | java | // Copyright (c) 2020 Mobanisto UG (haftungsbeschränkt)
//
// This file is part of covid-plz.
//
// 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.
package de.mobanisto.covidplz;
import de.topobyte.webpaths.WebPath;
import de.topobyte.webpaths.WebPaths;
public class PathHelper
{
public static WebPath imprint()
{
return WebPaths.get("impressum");
}
public static WebPath privacy()
{
return WebPaths.get("privacy-policy");
}
}
| [
"sebastian@topobyte.de"
] | sebastian@topobyte.de |
99748a47bfc23416cbc3b5063467b04f6abd4702 | 1d6f626cb42f06d6180ef88fababc9c4269f1133 | /api-model/src/gen/java/au/org/consumerdatastandards/api/v1_0_0/banking/models/BankingProductDiscountEligibility.java | e6079bdfebe3eabb1cafbcf7cfd81b22832b13b0 | [
"MIT"
] | permissive | darkedges/java-artefacts | 4ea573851a2b8cca279db97a0765e4860fe1c805 | 2caf60bc8889f3633172582386d77ccc9f303cc4 | refs/heads/master | 2021-01-06T03:38:05.131236 | 2020-02-03T04:50:58 | 2020-02-03T04:50:58 | 241,213,471 | 0 | 0 | MIT | 2020-02-17T21:39:35 | 2020-02-17T21:39:34 | null | UTF-8 | Java | false | false | 2,546 | java | package au.org.consumerdatastandards.api.v1_0_0.banking.models;
import au.org.consumerdatastandards.support.data.*;
@DataDefinition
@CustomAttributes({
@CustomAttribute(name = "x-conditional", value = "additionalValue", multiple = true)
})
public class BankingProductDiscountEligibility {
public enum DiscountEligibilityType {
BUSINESS,
PENSION_RECIPIENT,
MIN_AGE,
MAX_AGE,
MIN_INCOME,
MIN_TURNOVER,
STAFF,
STUDENT,
EMPLOYMENT_STATUS,
RESIDENCY_STATUS,
NATURAL_PERSON,
INTRODUCTORY,
OTHER
}
@Property(
description = "The type of the specific eligibility constraint for a discount",
required = true
)
DiscountEligibilityType discountEligibilityType;
@Property(
description = "Generic field containing additional information relevant to the [discountEligibilityType](#tocSproductdiscounteligibilitydoc) specified. Whether mandatory or not is dependent on the value of [discountEligibilityType](#tocSproductdiscounteligibilitydoc)",
requiredIf = {
@Condition(
propertyName = "discountEligibilityType",
values = {
"MIN_AGE",
"MAX_AGE",
"MIN_INCOME",
"MIN_TURNOVER",
"EMPLOYMENT_STATUS",
"RESIDENCY_STATUS",
"INTRODUCTORY"
},
conditionalCDSDataTypes = {
@ConditionalCDSDataType(value = "MIN_AGE", cdsDataType = @CDSDataType(CustomDataType.PositiveInteger)),
@ConditionalCDSDataType(value = "MAX_AGE", cdsDataType = @CDSDataType(CustomDataType.PositiveInteger)),
@ConditionalCDSDataType(value = "MIN_INCOME", cdsDataType = @CDSDataType(CustomDataType.Amount)),
@ConditionalCDSDataType(value = "MAX_INCOME", cdsDataType = @CDSDataType(CustomDataType.Amount)),
@ConditionalCDSDataType(value = "INTRODUCTORY", cdsDataType = @CDSDataType(CustomDataType.Duration))
}
)
}
)
String additionalValue;
@Property(
description = "Display text providing more information on this eligibility constraint"
)
String additionalInfo;
@Property(
description = "Link to a web page with more information on this eligibility constraint"
)
@CDSDataType(CustomDataType.URI)
String additionalInfoUri;
}
| [
"fyang1024@gmail.com"
] | fyang1024@gmail.com |
6f3aaa2cb61f7c3a6fe4f649e79efa8a4569ba85 | f7a25da32609d722b7ac9220bf4694aa0476f7b2 | /net/minecraft/client/model/ElytraModel.java | f25228686f3480c9c6142c3ccd7155cbd83c5847 | [] | no_license | basaigh/temp | 89e673227e951a7c282c50cce72236bdce4870dd | 1c3091333f4edb2be6d986faaa026826b05008ab | refs/heads/master | 2023-05-04T22:27:28.259481 | 2021-05-31T17:15:09 | 2021-05-31T17:15:09 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,734 | java | package net.minecraft.client.model;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.phys.Vec3;
import net.minecraft.client.player.AbstractClientPlayer;
import com.mojang.blaze3d.platform.GlStateManager;
import net.minecraft.client.model.geom.ModelPart;
import net.minecraft.world.entity.LivingEntity;
public class ElytraModel<T extends LivingEntity> extends EntityModel<T> {
private final ModelPart rightWing;
private final ModelPart leftWing;
public ElytraModel() {
(this.leftWing = new ModelPart(this, 22, 0)).addBox(-10.0f, 0.0f, 0.0f, 10, 20, 2, 1.0f);
this.rightWing = new ModelPart(this, 22, 0);
this.rightWing.mirror = true;
this.rightWing.addBox(0.0f, 0.0f, 0.0f, 10, 20, 2, 1.0f);
}
@Override
public void setupAnim(final T aix, final float float2, final float float3, final float float4, final float float5, final float float6, final float float7) {
GlStateManager.disableRescaleNormal();
GlStateManager.disableCull();
if (aix.isBaby()) {
GlStateManager.pushMatrix();
GlStateManager.scalef(0.5f, 0.5f, 0.5f);
GlStateManager.translatef(0.0f, 1.5f, -0.1f);
this.leftWing.render(float7);
this.rightWing.render(float7);
GlStateManager.popMatrix();
}
else {
this.leftWing.render(float7);
this.rightWing.render(float7);
}
}
@Override
public void setupAnim(final T aix, final float float2, final float float3, final float float4, final float float5, final float float6, final float float7) {
super.setupAnim(aix, float2, float3, float4, float5, float6, float7);
float float8 = 0.2617994f;
float float9 = -0.2617994f;
float float10 = 0.0f;
float float11 = 0.0f;
if (aix.isFallFlying()) {
float float12 = 1.0f;
final Vec3 csi14 = aix.getDeltaMovement();
if (csi14.y < 0.0) {
final Vec3 csi15 = csi14.normalize();
float12 = 1.0f - (float)Math.pow(-csi15.y, 1.5);
}
float8 = float12 * 0.34906584f + (1.0f - float12) * float8;
float9 = float12 * -1.5707964f + (1.0f - float12) * float9;
}
else if (aix.isVisuallySneaking()) {
float8 = 0.6981317f;
float9 = -0.7853982f;
float10 = 3.0f;
float11 = 0.08726646f;
}
this.leftWing.x = 5.0f;
this.leftWing.y = float10;
if (aix instanceof AbstractClientPlayer) {
final AbstractClientPlayer abstractClientPlayer;
final AbstractClientPlayer dmm13 = abstractClientPlayer = (AbstractClientPlayer)aix;
abstractClientPlayer.elytraRotX += (float)((float8 - dmm13.elytraRotX) * 0.1);
final AbstractClientPlayer abstractClientPlayer2 = dmm13;
abstractClientPlayer2.elytraRotY += (float)((float11 - dmm13.elytraRotY) * 0.1);
final AbstractClientPlayer abstractClientPlayer3 = dmm13;
abstractClientPlayer3.elytraRotZ += (float)((float9 - dmm13.elytraRotZ) * 0.1);
this.leftWing.xRot = dmm13.elytraRotX;
this.leftWing.yRot = dmm13.elytraRotY;
this.leftWing.zRot = dmm13.elytraRotZ;
}
else {
this.leftWing.xRot = float8;
this.leftWing.zRot = float9;
this.leftWing.yRot = float11;
}
this.rightWing.x = -this.leftWing.x;
this.rightWing.yRot = -this.leftWing.yRot;
this.rightWing.y = this.leftWing.y;
this.rightWing.xRot = this.leftWing.xRot;
this.rightWing.zRot = -this.leftWing.zRot;
}
}
| [
"mark70326511@gmail.com"
] | mark70326511@gmail.com |
0b0f3637325cf104ec3ae6773c1e4e2bc3ba7df4 | ca0e9689023cc9998c7f24b9e0532261fd976e0e | /src/com/tencent/mm/d/a/ic$a.java | 0aa02a91a3ebe482a91fdf39b9d3edb5865515b5 | [] | no_license | honeyflyfish/com.tencent.mm | c7e992f51070f6ac5e9c05e9a2babd7b712cf713 | ce6e605ff98164359a7073ab9a62a3f3101b8c34 | refs/heads/master | 2020-03-28T15:42:52.284117 | 2016-07-19T16:33:30 | 2016-07-19T16:33:30 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 302 | java | package com.tencent.mm.d.a;
public final class ic$a
{
public String aBB;
public int aBw;
public String alN;
public int avD;
public int op = 0;
public String url;
}
/* Location:
* Qualified Name: com.tencent.mm.d.a.ic.a
* Java Class Version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | [
"reverseengineeringer@hackeradmin.com"
] | reverseengineeringer@hackeradmin.com |
8afd75785dd2c9f9d8078ace59a6f7c2c22bd7e3 | 3348bfcf67a9bc6be967ed45b9b2e5d741decd96 | /app/src/main/java/com/yibao/music/fragment/AlbumCategoryFragment.java | 7c1f4ec27a5e369502bed133ed8227d9a16c6ffa | [] | no_license | dwlcrr/SmartisanMusicPlayer | bbf03d2b490bc0a8f938d11914c30909dc84d745 | 350afee91b0afe1701acc5fe761c02d5b26f8657 | refs/heads/master | 2020-07-26T05:10:42.329921 | 2019-07-21T14:35:48 | 2019-07-21T14:35:48 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,770 | java | package com.yibao.music.fragment;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.yibao.music.R;
import com.yibao.music.adapter.AlbumAdapter;
import com.yibao.music.base.BaseMusicFragment;
import com.yibao.music.model.AlbumInfo;
import com.yibao.music.model.MusicBean;
import com.yibao.music.model.greendao.AlbumInfoDao;
import com.yibao.music.model.greendao.MusicBeanDao;
import com.yibao.music.util.Constants;
import com.yibao.music.util.LogUtil;
import com.yibao.music.util.MusicListUtil;
import com.yibao.music.util.SnakbarUtil;
import com.yibao.music.view.music.MusicView;
import java.util.Collections;
import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;
/**
* @author Luoshipeng
* @ author: Luoshipeng
* @ Name: AlbumCategoryFragment
* @ Email: strangermy98@gmail.com
* @ Time: 2018/9/11/ 23:47
* @ Des: TODO
*/
public class AlbumCategoryFragment extends BaseMusicFragment {
@BindView(R.id.musci_view)
MusicView mMusicView;
private int mPosition;
private List<AlbumInfo> mAlbumList;
private boolean isItemSelectStatus = true;
private AlbumAdapter mAlbumAdapter;
private int mSelectCount;
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Bundle arguments = getArguments();
if (arguments != null) {
mPosition = arguments.getInt("position");
}
mAlbumList = MusicListUtil.getAlbumList(mSongList);
}
@Override
protected boolean getIsOpenDetail() {
return !isItemSelectStatus;
}
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.category_fragment, container, false);
unbinder = ButterKnife.bind(this, view);
return view;
}
private void initData() {
mAlbumAdapter = new AlbumAdapter(mActivity, mAlbumList, mPosition);
mMusicView.setAdapter(mActivity, mPosition == 0 ? 3 : 4, mPosition == 0, mAlbumAdapter);
mAlbumAdapter.setItemListener((bean, position,isEditStatus) -> {
if (isEditStatus) {
mSelectCount = bean.isSelected() ? mSelectCount-- : mSelectCount++;
bean.setSelected(!bean.isSelected());
LogUtil.d("=========== album list 选中 " + mSelectCount);
mAlbumAdapter.notifyDataSetChanged();
} else {
mBus.post(bean);
}
});
}
@Override
public void onResume() {
super.onResume();
initData();
initRxBusData();
}
private void initRxBusData() {
disposeToolbar();
if (mEditDisposable == null) {
mEditDisposable = mBus.toObservableType(Constants.ALBUM_FAG_EDIT, Object.class).subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(o -> AlbumCategoryFragment.this.changeEditStatus((Integer) o));
}
}
protected void changeEditStatus(int currentIndex) {
if (currentIndex == Constants.NUMBER_THRRE) {
closeEditStatus();
} else if (currentIndex == Constants.NUMBER_FOUR) {
// 删除已选择的条目
List<MusicBean> musicBeanList = mMusicBeanDao.queryBuilder().where(MusicBeanDao.Properties.IsSelected.eq(true)).build().list();
if (musicBeanList.size() > Constants.NUMBER_ZERO) {
LogUtil.d("======== Size " + musicBeanList.size());
for (MusicBean musicBean : musicBeanList) {
mMusicBeanDao.delete(musicBean);
}
mAlbumAdapter.setItemSelectStatus(false);
mAlbumAdapter.setNewData(getAlbumList());
interceptBackEvent(Constants.NUMBER_TEN);
} else {
SnakbarUtil.favoriteSuccessView(mMusicView, "没有选中条目");
}
}
}
private void closeEditStatus() {
mAlbumAdapter.setItemSelectStatus(isItemSelectStatus);
isItemSelectStatus = !isItemSelectStatus;
interceptBackEvent(Constants.NUMBER_TEN);
if (!isItemSelectStatus && mSelectCount > 0) {
cancelAllSelected();
}
}
@Override
protected void handleDetailsBack(int detailFlag) {
if (detailFlag == Constants.NUMBER_TEN) {
mAlbumAdapter.setItemSelectStatus(false);
mBus.post(Constants.FRAGMENT_ALBUM, Constants.NUMBER_ZERO);
isItemSelectStatus = true;
}
}
/**
* 取消所有已选
*/
private void cancelAllSelected() {
List<AlbumInfo> albumInfoList = mAlbumDao.queryBuilder().where(AlbumInfoDao.Properties.MSelected.eq(true)).build().list();
Collections.sort(albumInfoList);
for (AlbumInfo albumInfo : albumInfoList) {
mAlbumDao.delete(albumInfo);
}
mSelectCount = 0;
mAlbumAdapter.setNewData(getAlbumList());
}
private List<AlbumInfo> getAlbumList() {
return mAlbumDao.queryBuilder().list();
}
public static AlbumCategoryFragment newInstance(int position) {
Bundle args = new Bundle();
AlbumCategoryFragment fragment = new AlbumCategoryFragment();
args.putInt("position", position);
fragment.setArguments(args);
return fragment;
}
}
| [
"strangermy98@gmail.com"
] | strangermy98@gmail.com |
ddf8f9b3fbb98545809bafd2e9ba4c71e7ec0b59 | 79123dbf1d615d50f242e5cc0e720ab40e9ce880 | /src/main/java/me/hsgamer/bettergui/api/menu/Menu.java | f3e9f6af1c70ee24a84fea602736af2cb5196a1c | [
"MIT"
] | permissive | Faithgel/BetterGUI | 50b267212f060abd88632b0f058554dec3923d1b | 7c4d0b2bacd72696af42e41ae5b39c0980c257ee | refs/heads/master | 2023-03-03T12:58:51.301607 | 2021-01-27T15:21:37 | 2021-01-27T15:21:37 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,049 | java | package me.hsgamer.bettergui.api.menu;
import org.bukkit.entity.Player;
import org.simpleyaml.configuration.file.FileConfiguration;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
import java.util.UUID;
/**
* The menu
*/
public abstract class Menu {
private final String name;
private final Map<UUID, Menu> parentMenu = new HashMap<>();
/**
* Create a new menu
*
* @param name the name of the menu
*/
public Menu(String name) {
this.name = name;
}
/**
* Get the name
*
* @return the name
*/
public String getName() {
return name;
}
/**
* Called when setting options
*
* @param file the file of the menu
*/
public abstract void setFromFile(FileConfiguration file);
/**
* Called when opening the menu for the player
*
* @param player the player involved in
* @param args the arguments from the open command
* @param bypass whether the plugin ignores the permission check
*
* @return Whether it's successful
*/
public abstract boolean createInventory(Player player, String[] args, boolean bypass);
/**
* Called when updating the menu
*
* @param player the player involved in
*/
public abstract void updateInventory(Player player);
/**
* Close the inventory
*
* @param player the player involved in
*/
public abstract void closeInventory(Player player);
/**
* Close/Clear all inventories of the type
*/
public abstract void closeAll();
/**
* Get the original
*
* @return the original
*/
public abstract Object getOriginal();
/**
* Get the former menu that opened this menu
*
* @param uuid the unique id
*
* @return the former menu
*/
public Optional<Menu> getParentMenu(UUID uuid) {
return Optional.ofNullable(parentMenu.get(uuid));
}
/**
* Set the former menu
*
* @param uuid the unique id
* @param menu the former menu
*/
public void setParentMenu(UUID uuid, Menu menu) {
parentMenu.put(uuid, menu);
}
} | [
"huynhqtienvtag@gmail.com"
] | huynhqtienvtag@gmail.com |
e9e2d595abc4e8d9b196de3c5c6a96b5365f20c5 | 8bc32e369c5cac49a9f118bd95aa7af37869a3c2 | /accessoriesSeller/src/main/java/io/jchat/android/chatting/utils/FileHelper.java | f2d088f5e88590e8843bc26015c1c64ac4840cfc | [] | no_license | czqaiwsm/ASAccessor | d85e3f3e840cb3b2644027f23fb770ba54fe1432 | 5ca1d775a9ab4b95329e455d040a1cac97d1f539 | refs/heads/master | 2021-01-12T18:26:04.435017 | 2017-03-22T15:16:47 | 2017-03-22T15:16:47 | 71,376,016 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,873 | java | package io.jchat.android.chatting.utils;
import android.app.Activity;
import android.app.Dialog;
import android.net.Uri;
import android.os.Environment;
import android.text.format.DateFormat;
import android.widget.Toast;
import com.accessories.seller.R;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Calendar;
import java.util.Locale;
import cn.jpush.im.android.api.JMessageClient;
import io.jchat.android.application.JChatDemoApplication;
/**
* Created by Ken on 2015/11/13.
*/
public class FileHelper {
private static FileHelper mInstance = new FileHelper();
public static FileHelper getInstance() {
return mInstance;
}
public static boolean isSdCardExist() {
return Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED);
}
public static String createAvatarPath(String userName) {
String dir = JChatDemoApplication.PICTURE_DIR;
File destDir = new File(dir);
if (!destDir.exists()) {
destDir.mkdirs();
}
File file;
if (userName != null) {
file = new File(dir, userName + ".png");
}else {
file = new File(dir, new DateFormat().format("yyyy_MMdd_hhmmss",
Calendar.getInstance(Locale.CHINA)) + ".png");
}
return file.getAbsolutePath();
}
public static String getUserAvatarPath(String userName) {
return JChatDemoApplication.PICTURE_DIR + userName + ".png";
}
public interface CopyFileCallback {
public void copyCallback(Uri uri);
}
/**
* 复制后裁剪文件
* @param file 要复制的文件
*/
public void copyAndCrop(final File file, final Activity context, final CopyFileCallback callback) {
if (isSdCardExist()) {
final Dialog dialog = DialogCreator.createLoadingDialog(context,
context.getString(R.string.jmui_loading));
dialog.show();
Thread thread = new Thread(new Runnable() {
@Override
public void run() {
try {
FileInputStream fis = new FileInputStream(file);
String path = createAvatarPath(JMessageClient.getMyInfo().getUserName());
final File tempFile = new File(path);
FileOutputStream fos = new FileOutputStream(tempFile);
byte[] bt = new byte[1024];
int c;
while((c = fis.read(bt)) > 0) {
fos.write(bt,0,c);
}
//关闭输入、输出流
fis.close();
fos.close();
context.runOnUiThread(new Runnable() {
@Override
public void run() {
callback.copyCallback(Uri.fromFile(tempFile));
}
});
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}finally {
context.runOnUiThread(new Runnable() {
@Override
public void run() {
dialog.dismiss();
}
});
}
}
});
thread.start();
}else {
Toast.makeText(context, context.getString(R.string.jmui_sdcard_not_exist_toast), Toast.LENGTH_SHORT).show();
}
}
}
| [
"1148392049@qq.com"
] | 1148392049@qq.com |
99fe8425aa9411a4b26d143afe36a4e6aad50f08 | 2bdedcda705f6dcf45a1e9a090377f892bcb58bb | /src/main/output/point_others_war_way_eye_question/month_air/error/game/mother.java | 5ee7af57c93e8492b335a24f39f242c14406fa1a | [] | no_license | matkosoric/GenericNameTesting | 860a22af1098dda9ea9e24a1fc681bb728aa2d69 | 03f4a38229c28bc6d83258e5a84fce4b189d5f00 | refs/heads/master | 2021-01-08T22:35:20.022350 | 2020-02-21T11:28:21 | 2020-02-21T11:28:21 | 242,123,053 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 845 | java | import { v4 as uuid } from 'uuid'
const subscriptionKey = process.env.MICROSOFT_TRANSLATE_KEY_1
if (!subscriptionKey) {
throw new Error('Environment variable for your subscription key is not set.')
}
// endpoints: dictionary/examples dictionary/lookup translate
const options = (from, to, text, endpoint, translation) => {
const json = {
method: 'POST',
baseUrl: 'https://api.cognitive.microsofttranslator.com/',
url: endpoint === 'translate' ? 'translate' : `dictionary/${endpoint}`,
qs: {
'api-version': '3.0',
from: from,
to: to
},
headers: {
'2539da9298dd8e7f06ad2e9b5130d7ae': "43cd447af187608bd3cf00cde7c96f89",
'Content-type': 'application/json',
'X-ClientTraceId': uuid().toString()
},
body: [{ Text: text, Translation: translation || '' }],
json: true
}
return json
}
export default options
| [
"soric.matko@gmail.com"
] | soric.matko@gmail.com |
f92c6145cdb6de448954abec6a313f697bdbfeca | a8272d3051c5f360688fac90ecd96919d3e9a822 | /src/javamail/SendMailWithAuth.java | 49bd91398349beca1f71bf8e7a3a0180cafa91c8 | [] | no_license | srikanthpragada/JAVAEE_27_APR_2018_DEMO | 5ddedfdbd80cf7b18ea6e0a5339e530c7e8be404 | eb91788aed91473bffed8b208d9d8acd81b59e9b | refs/heads/master | 2020-03-15T06:20:39.467668 | 2018-05-30T14:33:21 | 2018-05-30T14:33:21 | 132,005,565 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,505 | java | package javamail;
import java.util.Date;
import java.util.Properties;
import javax.activation.DataHandler;
import javax.mail.Authenticator;
import javax.mail.Message;
import javax.mail.PasswordAuthentication;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;
public class SendMailWithAuth {
public static void main(String args[])
{
Properties props = System.getProperties();
props.setProperty("mail.smtp.auth","true");
Session session = Session.getDefaultInstance(props,
new Authenticator() {
@Override
public PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication("jerry@demo.com","jerry");
}
});
try {
// construct the message
Message msg = new MimeMessage(session);
msg.setFrom(new InternetAddress("jerry@demo.com"));
msg.setRecipient(Message.RecipientType.TO, new InternetAddress("tom@demo.com"));
msg.setDataHandler( new DataHandler("<h1>Good Morning</h1>", "text/html"));
msg.setSubject("Test");
msg.setSentDate(new Date());
Transport.send(msg); // send message
System.out.println("Mail sent successfully!");
} catch (Exception ex) {
System.out.println("Error --> " + ex.getMessage());
}
}
}
| [
"srikanthpragada@gmail.com"
] | srikanthpragada@gmail.com |
3e1811e5a5bc25929e15f406aa662a38d4253965 | b89ac156bd3e5231599ef0c708bba19419e77e18 | /app/src/main/java/com/wangdaye/mysplash/photo/presenter/widget/PhotoDetailsImplementor.java | d1845714b8e1cb22452ddb6e1c8f8a355b85a278 | [] | no_license | dainguyen2193/Mysplash | fe8c409d0290fc353be74dbb1032e5d92a164844 | 9f7722f35e62131f1b1cdef553e4614ed743920f | refs/heads/master | 2020-12-25T23:19:56.920176 | 2016-09-15T03:05:28 | 2016-09-15T03:05:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,954 | java | package com.wangdaye.mysplash.photo.presenter.widget;
import android.content.Context;
import android.support.design.widget.Snackbar;
import com.wangdaye.mysplash.Mysplash;
import com.wangdaye.mysplash._common.data.data.PhotoDetails;
import com.wangdaye.mysplash._common.data.service.PhotoService;
import com.wangdaye.mysplash._common.i.model.PhotoDetailsModel;
import com.wangdaye.mysplash._common.i.presenter.PhotoDetailsPresenter;
import com.wangdaye.mysplash._common.i.view.PhotoDetailsView;
import com.wangdaye.mysplash._common.ui.dialog.RateLimitDialog;
import com.wangdaye.mysplash._common.utils.NotificationUtils;
import com.wangdaye.mysplash._common.utils.ValueUtils;
import retrofit2.Call;
import retrofit2.Response;
/**
* Photo details implementor.
* */
public class PhotoDetailsImplementor
implements PhotoDetailsPresenter {
// model & view.
private PhotoDetailsModel model;
private PhotoDetailsView view;
/** <br> life cycle. */
public PhotoDetailsImplementor(PhotoDetailsModel model, PhotoDetailsView view) {
this.model = model;
this.view = view;
}
/** <br> presenter. */
@Override
public void requestPhotoDetails(Context c) {
view.initRefreshStart();
model.getService()
.requestPhotoDetails(model.getPhoto(), new OnRequestPhotoDetailsListener(c));
}
@Override
public void cancelRequest() {
model.getService().cancel();
}
@Override
public void showExifDescription(Context c, String title, String content) {
NotificationUtils.showSnackbar(
title + " : " + content,
Snackbar.LENGTH_SHORT);
}
/** <br> interface. */
private class OnRequestPhotoDetailsListener implements PhotoService.OnRequestPhotoDetailsListener {
// data
private Context c;
public OnRequestPhotoDetailsListener(Context c) {
this.c = c;
}
@Override
public void onRequestPhotoDetailsSuccess(Call<PhotoDetails> call, Response<PhotoDetails> response) {
if (response.isSuccessful() && response.body() != null) {
ValueUtils.writePhotoCount(
c,
response.body());
model.setPhotoDetails(response.body());
view.drawExif(model.getPhotoDetails());
view.requestDetailsSuccess();
} else {
requestPhotoDetails(c);
RateLimitDialog.checkAndNotify(
Mysplash.getInstance().getActivityList().get(
Mysplash.getInstance().getActivityList().size() - 1),
response.headers().get("X-Ratelimit-Remaining"));
}
}
@Override
public void onRequestPhotoDetailsFailed(Call<PhotoDetails> call, Throwable t) {
requestPhotoDetails(c);
}
}
}
| [
"wangdayeeeeee@gmail.com"
] | wangdayeeeeee@gmail.com |
3cc02f044c284723285996e5460638b80e9fbff7 | db05d9d157f9497f99ef0f25d82658fe4c4b9ba3 | /jeegem-core/src/main/java/com/jeegem/common/utils/weixin/core/MessageHandler.java | 7013987c700bdecd994b68f16851ab233fd1748a | [
"MIT"
] | permissive | nwpuxiaozhi/jeegem | bfa3676e24cc188214c1473c492820a39fb65abc | 773739569d883513ffe91889826d407b415e7cde | refs/heads/master | 2021-09-23T15:34:47.822024 | 2018-09-25T09:13:03 | 2018-09-25T09:13:03 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,555 | java | package com.jeegem.common.utils.weixin.core;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import org.nutz.lang.Strings;
import org.nutz.log.Log;
import org.nutz.log.Logs;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.ext.DefaultHandler2;
/**
* 采用驱动式处理微信消息
*
* @author
* @since 2.0
*/
public class MessageHandler extends DefaultHandler2 {
private static final Log log = Logs.get();
// 节点属性值
private String attrVal;
static Map<String, String> _vals = new ConcurrentHashMap<String, String>();
static StringBuffer _sb = new StringBuffer();
public Map<String, String> getValues() {
return _vals;
}
@Override
public void startDocument() throws SAXException {
_vals.clear();
_sb.setLength(0);
}
@Override
public void startElement(String uri, String localName, String qName, Attributes attributes)
throws SAXException {
if ("PicList".equals(qName)) {
_sb.append("[");
return;
}
}
@Override
public void endElement(String uri, String localName, String qName) throws SAXException {
if (log.isDebugEnabled()) {
if (!Strings.equals("xml", qName)
&& !Strings.equals("ScanCodeInfo", qName)
&& !Strings.equals("SendLocationInfo", qName)
&& !Strings.equals("SendPicsInfo", qName)
&& !Strings.equals("PicList", qName)
&& !Strings.equals("item", qName)) {
log.debugf("Current node vaule: [%s-%s]", qName, attrVal);
}
}
// 暂存为map集合
if ("ToUserName".equals(qName)) {
_vals.put("toUserName", attrVal);
return;
}
if ("FromUserName".equals(qName)) {
_vals.put("fromUserName", attrVal);
return;
}
if ("CreateTime".equals(qName)) {
_vals.put("createTime", attrVal);
return;
}
if ("MsgType".equals(qName)) {
_vals.put("msgType", attrVal);
return;
}
if ("Content".equals(qName)) {
_vals.put("content", attrVal);
return;
}
if ("PicUrl".equals(qName)) {
_vals.put("picUrl", attrVal);
return;
}
if ("MediaId".equals(qName)) {
_vals.put("mediaId", attrVal);
return;
}
if ("Format".equals(qName)) {
_vals.put("format", attrVal);
return;
}
if ("Recognition".equals(qName)) {
_vals.put("recognition", attrVal);
return;
}
if ("ThumbMediaId".equals(qName)) {
_vals.put("thumbMediaId", attrVal);
return;
}
if ("Location_X".equals(qName)) {
_vals.put("locationX", attrVal);
return;
}
if ("Location_Y".equals(qName)) {
_vals.put("locationY", attrVal);
return;
}
if ("Scale".equals(qName)) {
_vals.put("scale", attrVal);
return;
}
if ("Label".equals(qName)) {
_vals.put("label", attrVal);
return;
}
if ("Title".equals(qName)) {
_vals.put("title", attrVal);
return;
}
if ("Description".equals(qName)) {
_vals.put("description", attrVal);
return;
}
if ("Url".equals(qName)) {
_vals.put("url", attrVal);
return;
}
if ("MsgId".equals(qName) || "MsgID".equals(qName)) {
_vals.put("msgId", attrVal);
return;
}
if ("Event".equals(qName)) {
_vals.put("event", attrVal);
return;
}
if ("EventKey".equals(qName)) {
_vals.put("eventKey", attrVal);
return;
}
if ("ScanType".equals(qName)) {
_vals.put("scanType", attrVal);
return;
}
if ("ScanResult".equals(qName)) {
_vals.put("scanResult", attrVal);
return;
}
if ("Poiname".equals(qName)) {
_vals.put("poiname", attrVal);
return;
}
if ("Count".equals(qName)) {
_vals.put("count", attrVal);
return;
}
if ("PicMd5Sum".equals(qName)) {
_sb.append("{\"picMd5Sum\":\"").append(attrVal).append("\"},");
return;
}
if ("PicList".equals(qName)) {
_sb.deleteCharAt(_sb.lastIndexOf(","));
_sb.append("]");
_vals.put("picList", _sb.toString());
return;
}
if ("Status".equals(qName)) {
_vals.put("status", attrVal);
return;
}
if ("TotalCount".equals(qName)) {
_vals.put("totalCount", attrVal);
return;
}
if ("FilterCount".equals(qName)) {
_vals.put("filterCount", attrVal);
return;
}
if ("SentCount".equals(qName)) {
_vals.put("sentCount", attrVal);
return;
}
if ("ErrorCount".equals(qName)) {
_vals.put("errorCount", attrVal);
return;
}
}
@Override
public void characters(char[] ch, int start, int length) throws SAXException {
this.attrVal = new String(ch, start, length);
}
}
| [
"4407509@qq.com"
] | 4407509@qq.com |
97a1a0b0062bd05eb21a1fdddfc9275c1124abd3 | b1c1f87e19dec3e06b66b60ea32943ca9fceba81 | /spring-expression/src/main/java/org/springframework/expression/spel/ast/Identifier.java | 064bb41f9f6bf5a7f2c833cb74cb2afcae665dde | [
"Apache-2.0"
] | permissive | JunMi/SpringFramework-SourceCode | d50751f79803690301def6478e198693e2ff7348 | 4918e0e6a0676a62fd2a9d95acf6eb4fa5edb82b | refs/heads/master | 2020-06-19T10:55:34.451834 | 2019-07-13T04:32:14 | 2019-07-13T13:11:54 | 196,678,387 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,372 | java | /*
* Copyright 2002-2019 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.expression.spel.ast;
import org.springframework.expression.TypedValue;
import org.springframework.expression.spel.ExpressionState;
import org.springframework.expression.spel.SpelNode;
/**
* An 'identifier' {@link SpelNode}.
*
* @author Andy Clement
* @since 3.0
*/
public class Identifier extends SpelNodeImpl {
private final TypedValue id;
public Identifier(String payload, int startPos, int endPos) {
super(startPos, endPos);
this.id = new TypedValue(payload);
}
@Override
public String toStringAST() {
return String.valueOf(this.id.getValue());
}
@Override
public TypedValue getValueInternal(ExpressionState state) {
return this.id;
}
}
| [
"648326357@qq.com"
] | 648326357@qq.com |
85823a8104f9298dd1821c4792ec2191f67ac364 | 855b4041b6a7928988a41a5f3f7e7c7ae39565e4 | /hk-core/src/main/java/com/hk/svr/pub/rowmapper/IpUserMapper.java | acebff6a66d7161d34158e512221fbc2dda131d5 | [] | no_license | mestatrit/newbyakwei | 60dca96c4c21ae5fcf6477d4627a0eac0f76df35 | ea9a112ac6fcbc2a51dbdc79f417a1d918aa4067 | refs/heads/master | 2021-01-10T06:29:50.466856 | 2013-03-07T08:09:58 | 2013-03-07T08:09:58 | 36,559,185 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 512 | java | package com.hk.svr.pub.rowmapper;
import java.sql.ResultSet;
import java.sql.SQLException;
import com.hk.bean.IpUser;
import com.hk.frame.dao.rowmapper.HkRowMapper;
public class IpUserMapper extends HkRowMapper<IpUser> {
@Override
public Class<IpUser> getMapperClass() {
return IpUser.class;
}
public IpUser mapRow(ResultSet rs, int rowNum) throws SQLException {
IpUser o = new IpUser();
o.setIpnumber(rs.getLong("ipnumber"));
o.setUserId(rs.getLong("userid"));
return o;
}
} | [
"ak478288@gmail.com"
] | ak478288@gmail.com |
1ca755744931d7abe26075c82a5f76b359b7588a | eb1147a40945cc8cfecf75d01b026d84e56aa3a7 | /src/test/java/com/linghushaoxia/http/parse/WrongContentLength.java | 177a175b416fbf5e7ffc0f4ff632eb62fe1f5b4c | [] | no_license | linghushaoxia/http-parse-java | 1846a4fe14fb9cbc3af84e1ba8341ea9bfbc66d1 | 1814721ff13ebe07c814a619e6034b042108ce40 | refs/heads/master | 2021-01-22T23:05:29.301184 | 2017-06-04T11:43:21 | 2017-06-04T11:43:21 | 92,797,549 | 5 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,667 | java | package com.linghushaoxia.http.parse;
import java.nio.ByteBuffer;
import com.linghushaoxia.http.parse.impl.ParserType;
import static com.linghushaoxia.http.parse.Util.*;
public class WrongContentLength {
static final String contentLength = "GET / HTTP/1.0\r\n" +
"Content-Length: 5\r\n" +
"\r\n" +
"hello" +
"hello_again";
static void test () {
p(WrongContentLength.class);
HTTPParser parser = new HTTPParser(ParserType.HTTP_REQUEST);
ByteBuffer buf = buffer(contentLength);
Settings settings = new Settings();
int read = parser.execute(settings, buf);
check (settings.msg_cmplt_called);
check ("invalid method".equals(settings.err));
}
public static void main(String [] args) {
test();
}
static class Settings extends ParserSettings {
public int bodyCount;
public boolean msg_cmplt_called;
public String err;
Settings () {
this.on_message_complete = new IHTTPCallback () {
public int cb (HTTPParser p) {
check (5 == bodyCount);
msg_cmplt_called = true;
return 0;
}
};
this.on_body = new IHTTPDataCallback() {
public int cb (HTTPParser p, ByteBuffer b, int pos, int len) {
bodyCount += len;
check ("hello".equals(str(b, pos, len)));
return 0;
}
};
this.on_error = new IHTTPErrorCallback() {
public void cb (HTTPParser p, String mes, ByteBuffer b, int i) {
err = mes;
}
};
}
}
}
| [
"linghushaoxialove@163.com"
] | linghushaoxialove@163.com |
489cc86103fa33a22991e73b6827ea9b015bd1c8 | 5b55c12f1e60ea2c0f094bf6e973e9150bbda57f | /cloudviewservice_graphshow/src/main/java/com/ssit/Entity/CirculateEntity.java | c582ab2b392a4dbb06050079739206649f56a9c4 | [] | no_license | huguodong/Cloud-4 | f18a8f471efbb2167e639e407478bf808d1830c2 | 3facaf5fc3d585c938ecc93e89a6a4a7d35e5bcc | refs/heads/master | 2020-03-27T22:59:41.109723 | 2018-08-24T01:42:39 | 2018-08-24T01:43:04 | 147,279,899 | 0 | 0 | null | 2018-09-04T02:54:28 | 2018-09-04T02:54:28 | null | UTF-8 | Java | false | false | 1,014 | java | package com.ssit.Entity;
public class CirculateEntity {
private String type;
private String time;// 时间点
private long type1_total;
private long type2_total;
private long type3_total;
private long type4_total;
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getTime() {
return time;
}
public void setTime(String time) {
this.time = time;
}
public long getType1_total() {
return type1_total;
}
public void setType1_total(long type1_total) {
this.type1_total = type1_total;
}
public long getType2_total() {
return type2_total;
}
public void setType2_total(long type2_total) {
this.type2_total = type2_total;
}
public long getType3_total() {
return type3_total;
}
public void setType3_total(long type3_total) {
this.type3_total = type3_total;
}
public long getType4_total() {
return type4_total;
}
public void setType4_total(long type4_total) {
this.type4_total = type4_total;
}
}
| [
"chenkun141@163com"
] | chenkun141@163com |
7f9132e387d5b26b28371aeab75a89951ec599b9 | 8dcd6fac592760c5bff55349ffb2d7ce39d485cc | /org/jboss/netty/channel/local/DefaultLocalServerChannel.java | a5e54835664ce2e3f079a6a7d2587c4be7cb0f56 | [] | no_license | andrepcg/hikam-android | 9e3a02e0ba9a58cf8a17c5e76e2f3435969e4b3a | bf39e345a827c6498052d9df88ca58d8823178d9 | refs/heads/master | 2021-09-01T11:41:10.726066 | 2017-12-26T19:04:42 | 2017-12-26T19:04:42 | 115,447,829 | 2 | 2 | null | null | null | null | UTF-8 | Java | false | false | 1,354 | java | package org.jboss.netty.channel.local;
import java.util.concurrent.atomic.AtomicBoolean;
import org.jboss.netty.channel.AbstractServerChannel;
import org.jboss.netty.channel.Channel;
import org.jboss.netty.channel.ChannelConfig;
import org.jboss.netty.channel.ChannelFactory;
import org.jboss.netty.channel.ChannelPipeline;
import org.jboss.netty.channel.ChannelSink;
import org.jboss.netty.channel.Channels;
import org.jboss.netty.channel.DefaultServerChannelConfig;
final class DefaultLocalServerChannel extends AbstractServerChannel implements LocalServerChannel {
final AtomicBoolean bound = new AtomicBoolean();
final ChannelConfig channelConfig = new DefaultServerChannelConfig();
volatile LocalAddress localAddress;
DefaultLocalServerChannel(ChannelFactory factory, ChannelPipeline pipeline, ChannelSink sink) {
super(factory, pipeline, sink);
Channels.fireChannelOpen((Channel) this);
}
public ChannelConfig getConfig() {
return this.channelConfig;
}
public boolean isBound() {
return isOpen() && this.bound.get();
}
public LocalAddress getLocalAddress() {
return isBound() ? this.localAddress : null;
}
public LocalAddress getRemoteAddress() {
return null;
}
protected boolean setClosed() {
return super.setClosed();
}
}
| [
"andrepcg@gmail.com"
] | andrepcg@gmail.com |
a996df9c790fb45804f4fb97ecef114f3a4bd9fd | 799385037ae43ec5ba05544005e11d5b0fdddcba | /com/company/Lesson31/Task03.java | a8e751246754d65b3afeffdb84fa26d715229dec | [] | no_license | AnatolSich/Java_Home | 27b298217a851637589901c084c9e9b6ec1b5c5c | 965e87996fb136110292f22c92b52677ffb362e2 | refs/heads/master | 2021-09-18T01:01:33.755962 | 2018-07-07T18:59:24 | 2018-07-07T18:59:24 | 106,386,857 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,987 | java | package com.company.Lesson31;
import java.util.Date;
import static java.lang.Thread.sleep;
/**
* Created by Toll on 04.11.2017.
*/
/*
1. Создать интерфейс MusicalInstrument с методами: Date startPlaying() и Date stopPlaying()
2. Сделать интерфейс MusicalInstrument таском для нити.
3. В выполняющем классе создать переменную типа int с названием delay и значением 1000
4. В выполняющем классе создать метод sleepNSeconds(int n), который должен погружать в сон нить на n * delay миллисекунд
5. Создать класс Violin так, чтоб он стал таском для нити. Используйте интерфейс MusicalInstrument
5.1 Создать приватную переменную private String musician;
5.2 Создать конструктор.
6. Реализуй необходимые методы в нити Violin. Реализация должна быть следующей:
6.1. Метод startPlaying() должен возвращать время начала игры.
6.2. Метод stopPlaying() должен возвращать время окончания игры.
7. Создать метод run() и выполнить в нём следующее:
7.1. Считай время начала игры - метод startPlaying().
7.2. Подожди 1 секунду - метод sleepNSeconds(int n), где n - количество секунд.
7.3. Считай время окончания игры - метод stopPlaying().
7.4. Выведи на консоль продолжительность игры в миллисекундах. Пример "Playing 1002 ms".
8. В выполняющем классе создать метод main и зпустить таск класса Violin.
*/
public class Task03 {
static int delay = 1000;
static void sleepNSeconds(int n) {
try {
Thread.sleep(n * delay);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
public static void main(String[] args) {
Thread my = new Thread(new Violin("Paganini"));
my.start();
}
}
interface MusicalInstrument extends Runnable {
Date startPlaying();
Date stopPlaying();
}
class Violin implements MusicalInstrument {
private String musician;
public Violin(String musician) {
this.musician = musician;
}
@Override
public Date startPlaying() {
return new Date();
}
@Override
public Date stopPlaying() {
return new Date();
}
@Override
public void run() {
Date start = startPlaying();
Task03.sleepNSeconds(2);
Date stop = stopPlaying();
System.out.println("Playing " + this.musician + " " + (stop.getTime() - start.getTime()) + "ms");
}
} | [
"tip-77@ukr.net"
] | tip-77@ukr.net |
f96334f25c3971d7b25ba8252bc5c157d66fb741 | 5f53b1ea0bbb537188aa6110db524bc7f1926def | /header/src/main/java/org/zstack/header/allocator/AbstractHostAllocatorFlow.java | 0b1a6644131a5e654a7fadcfa0ea24c4b2b6a836 | [
"Apache-2.0"
] | permissive | dangpf/zstack | 86293e2a5b479cf70c96a903c90523f29e41fd22 | 8db5d96d06f961d366c67c16394f4e4572c02115 | refs/heads/master | 2021-01-18T13:06:11.080079 | 2016-09-01T09:57:37 | 2016-09-01T09:58:40 | 56,648,736 | 1 | 0 | null | 2016-04-20T02:28:56 | 2016-04-20T02:28:55 | null | UTF-8 | Java | false | false | 3,528 | java | package org.zstack.header.allocator;
import org.springframework.beans.factory.annotation.Autowire;
import org.springframework.beans.factory.annotation.Configurable;
import org.zstack.header.errorcode.ErrorCode;
import org.zstack.header.errorcode.OperationFailureException;
import org.zstack.header.exception.CloudRuntimeException;
import org.zstack.header.host.HostVO;
import java.util.ArrayList;
import java.util.List;
/**
*/
@Configurable(preConstruction = true, autowire = Autowire.BY_TYPE)
public abstract class AbstractHostAllocatorFlow {
protected List<HostVO> candidates;
protected HostAllocatorSpec spec;
private HostAllocatorTrigger trigger;
protected HostAllocationPaginationInfo paginationInfo;
public abstract void allocate();
public List<HostVO> getCandidates() {
return candidates;
}
public void setCandidates(List<HostVO> candidates) {
this.candidates = candidates;
}
public HostAllocatorSpec getSpec() {
return spec;
}
public void setSpec(HostAllocatorSpec spec) {
this.spec = spec;
}
public void setTrigger(HostAllocatorTrigger trigger) {
this.trigger = trigger;
}
public HostAllocationPaginationInfo getPaginationInfo() {
return paginationInfo;
}
public void setPaginationInfo(HostAllocationPaginationInfo paginationInfo) {
this.paginationInfo = paginationInfo;
}
protected void next(List<HostVO> candidates) {
if (usePagination()) {
paginationInfo.setOffset(paginationInfo.getOffset() + paginationInfo.getLimit());
}
trigger.next(candidates);
}
protected void skip() {
if (usePagination()) {
paginationInfo.setOffset(paginationInfo.getOffset() + paginationInfo.getLimit());
}
trigger.skip();
}
protected void fail(String reason) {
if (paginationInfo != null && trigger.indexOfFlow(this) != 0) {
// in pagination, and a middle flow fails, we can continue
ErrorCode errorCode = new ErrorCode();
errorCode.setCode(HostAllocatorConstant.PAGINATION_INTERMEDIATE_ERROR.getCode());
errorCode.setDetails(reason);
errorCode.setDescription(HostAllocatorConstant.PAGINATION_INTERMEDIATE_ERROR.getDescription());
throw new OperationFailureException(errorCode);
} else {
// no host found, stop allocating
ErrorCode errorCode = new ErrorCode();
errorCode.setCode(HostAllocatorError.NO_AVAILABLE_HOST.toString());
errorCode.setDetails(reason);
throw new OperationFailureException(errorCode);
}
}
protected boolean usePagination() {
return paginationInfo != null && trigger.indexOfFlow(this) == 0;
}
protected void throwExceptionIfIAmTheFirstFlow() {
if (candidates == null || candidates.isEmpty()) {
throw new CloudRuntimeException(String.format("%s cannot be the first flow in the allocation chain", this.getClass().getName()));
}
}
protected List<String> getHostUuidsFromCandidates() {
List<String> huuids = new ArrayList<String>(candidates.size());
for (HostVO vo : candidates) {
huuids.add(vo.getUuid());
}
return huuids;
}
protected boolean amITheFirstFlow() {
return candidates == null;
}
}
| [
"xing5820@gmail.com"
] | xing5820@gmail.com |
45125612d814c8a22f8f8a32a0b39f1375bcab52 | 251b400011c963b9eebe36ae918324e611ec1973 | /sofa-dbus/src/main/java/se/l4/sofa/dbus/BusAddress.java | 86e7cd084921675bf07f0f7bd2a190ef6a16f085 | [] | no_license | aholstenson/sofa-dbus | f18a71f668647c16a8a12d6f6d6e7e5ebc370d38 | 63fdc2c081ad9c6b1bdbeacdbfa9734485d11cf1 | refs/heads/master | 2021-01-20T22:40:24.464982 | 2010-01-12T14:28:54 | 2010-01-12T14:28:54 | 468,526 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,727 | java | package se.l4.sofa.dbus;
import java.util.HashMap;
import java.util.Map;
/**
* Address for a DBus connection, has a protocol and zero or more parameters.
*
* Example of addresses:
*
* <ul>
* <li>
* {@code unix:abstract=/tmp/dbus-YJifTziglB} - connection to a Unix socket
* </li>
* <li>
* {@code tcp:host=localhost,port=4000} - TCP connection
* </li>
* <li>
* {@code tcp:host=localhost,port=4000,listen=true} - connection with TCP,
* acting as a server
* </li>
* </ul>
*
* @author Andreas Holstenson
*
*/
public class BusAddress
{
private final String protocol;
private final Map<String, String> parameters;
public BusAddress(String address)
{
parameters = new HashMap<String, String>();
int idx = address.indexOf(':');
if(idx < 0)
{
// Assuming that only protocol was given
//throw new IllegalArgumentException("Invalid DBus address");
protocol = address;
return;
}
// Parse the string
protocol = address.substring(0, idx);
if(address.length() > idx+1)
{
String[] split = address.substring(idx + 1).split(",");
for(String arg : split)
{
idx = arg.indexOf('=');
if(idx > 0)
{
parameters.put(
arg.substring(0, idx),
arg.substring(idx + 1)
);
}
else
{
parameters.put(arg, "true");
}
}
}
}
/**
* Get the protocol of the address.
*
* @return
*/
public String getProtocol()
{
return protocol;
}
/**
* Set the value of a given parameter.
*
* @param key
* @param value
*/
public void setParameter(String key, String value)
{
parameters.put(key, value);
}
/**
* Check if the address has the given parameter.
*
* @param key
* @return
*/
public boolean hasParameter(String key)
{
return parameters.containsKey(key);
}
/**
* Get the string value of the given parameter. Will return {@code null}
* if the parameter is not set.
*
* @param key
* @return
*/
public String getParameter(String key)
{
return parameters.get(key);
}
/**
* Get the given parameter as an integer. If the parameter is not set or
* if it can't be converted {@code 0} will be returned.
*
* @param key
* @return
*/
public int getIntParameter(String key)
{
String value = parameters.get(key);
if(value != null)
{
try
{
return Integer.parseInt(value);
}
catch(NumberFormatException e)
{
}
}
return 0;
}
/**
* Get the given parameter as a boolean.
*
* @param key
* @return
* {@code true} if the parameter has the String-value {@code true},
* otherwise {@code false}
*/
public boolean getBooleanParameter(String key)
{
return "true".equals(parameters.get(key));
}
}
| [
"a@holstenson.se"
] | a@holstenson.se |
71e1f110d97a69abcb4aab80aa6563115d55f379 | 73330e56d0ba0b73ae104a1ee3e5642e5fcb0713 | /src/main/java/com/supinfo/supbank/web/rest/errors/EmailNotFoundException.java | 45036fadc701e3d0488cd882668393c91528841b | [] | no_license | Duffy59/supbank-api | be0b05c78267ce8588a6167b30777a8286513044 | 6b9618ade2de78c61f221eab3539a32112e79381 | refs/heads/master | 2020-04-07T17:01:45.985895 | 2018-11-21T13:39:13 | 2018-11-21T13:39:13 | 158,553,473 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 411 | java | package com.supinfo.supbank.web.rest.errors;
import org.zalando.problem.AbstractThrowableProblem;
import org.zalando.problem.Status;
public class EmailNotFoundException extends AbstractThrowableProblem {
private static final long serialVersionUID = 1L;
public EmailNotFoundException() {
super(ErrorConstants.EMAIL_NOT_FOUND_TYPE, "Email address not registered", Status.BAD_REQUEST);
}
}
| [
"jhipster-bot@jhipster.tech"
] | jhipster-bot@jhipster.tech |
ffb709966ee7be709ea1ed83d0fba76cd9eff11e | 333595f031dd7bc736f63ea6ed6d24538d8c186d | /service/pipeline/src/main/java/com/alibaba/citrus/service/pipeline/support/AbstractCompositeConditionDefinitionParser.java | fa09d7ade2b96a7ea0e1bf0cefbb0c0e37a5ed7e | [
"Apache-2.0"
] | permissive | iamacnhero/citrus | 81e0ab8a3f9ae32c47ecbd62cde2be6e89cb4f0d | f989dd526ad11cf7843dfcf2e10cee4e12daf181 | refs/heads/master | 2022-04-17T20:00:45.850226 | 2020-03-07T02:49:20 | 2020-03-07T02:49:20 | 103,656,833 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,515 | java | /*
* Copyright (c) 2002-2012 Alibaba Group Holding Limited.
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.alibaba.citrus.service.pipeline.support;
import static com.alibaba.citrus.springext.util.DomUtil.*;
import static com.alibaba.citrus.springext.util.SpringExtUtil.*;
import java.util.List;
import com.alibaba.citrus.springext.ConfigurationPoint;
import com.alibaba.citrus.springext.Contribution;
import com.alibaba.citrus.springext.ContributionAware;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.xml.ParserContext;
import org.w3c.dom.Element;
/**
* <code>AbstractCompositeCondition</code>解析器的基类。
*
* @author Michael Zhou
*/
public class AbstractCompositeConditionDefinitionParser<C extends AbstractCompositeCondition> extends
AbstractConditionDefinitionParser<C>
implements ContributionAware {
private ConfigurationPoint conditionConfigurationPoint;
public void setContribution(Contribution contrib) {
this.conditionConfigurationPoint = getSiblingConfigurationPoint("services/pipeline/conditions", contrib);
}
@Override
protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) {
super.doParse(element, parserContext, builder);
List<Object> conditions = createManagedList(element, parserContext);
for (Element subElement : subElements(element)) {
Object condition = parseConfigurationPointBean(subElement, conditionConfigurationPoint, parserContext,
builder);
if (condition != null) {
conditions.add(condition);
}
}
builder.addPropertyValue("conditions", conditions);
}
}
| [
"yizhi@taobao.com"
] | yizhi@taobao.com |
548f2eba4a1164d5bbff87d9a7cf2cc0a1cc2ce8 | a2df6764e9f4350e0d9184efadb6c92c40d40212 | /aliyun-java-sdk-retailcloud/src/main/java/com/aliyuncs/retailcloud/model/v20180313/DescribeJobLogResponse.java | 53077fa8d0874461b4438146d676e21aa7d319ff | [
"Apache-2.0"
] | permissive | warriorsZXX/aliyun-openapi-java-sdk | 567840c4bdd438d43be6bd21edde86585cd6274a | f8fd2b81a5f2cd46b1e31974ff6a7afed111a245 | refs/heads/master | 2022-12-06T15:45:20.418475 | 2020-08-20T08:37:31 | 2020-08-26T06:17:49 | 290,450,773 | 1 | 0 | NOASSERTION | 2020-08-26T09:15:48 | 2020-08-26T09:15:47 | null | UTF-8 | Java | false | false | 4,177 | java | /*
* 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.aliyuncs.retailcloud.model.v20180313;
import java.util.List;
import com.aliyuncs.AcsResponse;
import com.aliyuncs.retailcloud.transform.v20180313.DescribeJobLogResponseUnmarshaller;
import com.aliyuncs.transform.UnmarshallerContext;
/**
* @author auto create
* @version
*/
public class DescribeJobLogResponse extends AcsResponse {
private Integer code;
private String requestId;
private String errMsg;
private Result result;
public Integer getCode() {
return this.code;
}
public void setCode(Integer code) {
this.code = code;
}
public String getRequestId() {
return this.requestId;
}
public void setRequestId(String requestId) {
this.requestId = requestId;
}
public String getErrMsg() {
return this.errMsg;
}
public void setErrMsg(String errMsg) {
this.errMsg = errMsg;
}
public Result getResult() {
return this.result;
}
public void setResult(Result result) {
this.result = result;
}
public static class Result {
private Long appId;
private Long envId;
private String podName;
private String jobLog;
private List<Event> events;
public Long getAppId() {
return this.appId;
}
public void setAppId(Long appId) {
this.appId = appId;
}
public Long getEnvId() {
return this.envId;
}
public void setEnvId(Long envId) {
this.envId = envId;
}
public String getPodName() {
return this.podName;
}
public void setPodName(String podName) {
this.podName = podName;
}
public String getJobLog() {
return this.jobLog;
}
public void setJobLog(String jobLog) {
this.jobLog = jobLog;
}
public List<Event> getEvents() {
return this.events;
}
public void setEvents(List<Event> events) {
this.events = events;
}
public static class Event {
private String action;
private Integer count;
private String eventTime;
private String firstTimestamp;
private String lastTimestamp;
private String mesage;
private String reason;
private String type;
public String getAction() {
return this.action;
}
public void setAction(String action) {
this.action = action;
}
public Integer getCount() {
return this.count;
}
public void setCount(Integer count) {
this.count = count;
}
public String getEventTime() {
return this.eventTime;
}
public void setEventTime(String eventTime) {
this.eventTime = eventTime;
}
public String getFirstTimestamp() {
return this.firstTimestamp;
}
public void setFirstTimestamp(String firstTimestamp) {
this.firstTimestamp = firstTimestamp;
}
public String getLastTimestamp() {
return this.lastTimestamp;
}
public void setLastTimestamp(String lastTimestamp) {
this.lastTimestamp = lastTimestamp;
}
public String getMesage() {
return this.mesage;
}
public void setMesage(String mesage) {
this.mesage = mesage;
}
public String getReason() {
return this.reason;
}
public void setReason(String reason) {
this.reason = reason;
}
public String getType() {
return this.type;
}
public void setType(String type) {
this.type = type;
}
}
}
@Override
public DescribeJobLogResponse getInstance(UnmarshallerContext context) {
return DescribeJobLogResponseUnmarshaller.unmarshall(this, context);
}
@Override
public boolean checkShowJsonItemName() {
return false;
}
}
| [
"sdk-team@alibabacloud.com"
] | sdk-team@alibabacloud.com |
8986a55223f2ff94d74e42901e696ebb001ed6b4 | cfe621e8c36e6ac5053a2c4f7129a13ea9f9f66b | /apps_final/names.of.allah/apk/com/google/android/gms/drive/internal/OnLoadRealtimeResponse.java | d390ddb44ef796202dcbc5c546abbb51989ea61a | [] | no_license | linux86/AndoirdSecurity | 3165de73b37f53070cd6b435e180a2cb58d6f672 | 1e72a3c1f7a72ea9cd12048d9874a8651e0aede7 | refs/heads/master | 2021-01-11T01:20:58.986651 | 2016-04-05T17:14:26 | 2016-04-05T17:14:26 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 820 | java | package com.google.android.gms.drive.internal;
import android.os.Parcel;
import android.os.Parcelable.Creator;
import com.google.android.gms.common.internal.safeparcel.SafeParcelable;
public class OnLoadRealtimeResponse
implements SafeParcelable
{
public static final Parcelable.Creator<OnLoadRealtimeResponse> CREATOR = new an();
final boolean Jz;
final int xJ;
OnLoadRealtimeResponse(int paramInt, boolean paramBoolean)
{
xJ = paramInt;
Jz = paramBoolean;
}
public int describeContents()
{
return 0;
}
public void writeToParcel(Parcel paramParcel, int paramInt)
{
an.a(this, paramParcel, paramInt);
}
}
/* Location:
* Qualified Name: com.google.android.gms.drive.internal.OnLoadRealtimeResponse
* Java Class Version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | [
"i@xuzhao.net"
] | i@xuzhao.net |
2bf45773695604be5ba1ed1a76e23ee1d5cc3c35 | 5182c0b7d67100794ea64882a4bfdfbe04389a12 | /kieker.develop.rl/xtend-gen/kieker/develop/rl/generator/java/record/NameResolver.java | eeb122a0e83e6ab95c532abd23a05929add9ee3b | [] | no_license | DanielMSchmidt/instrumentation-languages | 2e30632fc9c836031136d675f4b4556371881715 | 9f390bbcbadd32764b68fd471ec24d707e2a5956 | refs/heads/master | 2023-04-12T01:05:11.870569 | 2016-07-25T10:10:23 | 2016-07-25T10:10:23 | 64,672,325 | 0 | 0 | null | 2023-04-04T01:11:13 | 2016-08-01T14:11:13 | Java | UTF-8 | Java | false | false | 2,912 | java | package kieker.develop.rl.generator.java.record;
import java.util.Collections;
import java.util.List;
import kieker.develop.rl.recordLang.BaseType;
import kieker.develop.rl.recordLang.Classifier;
import kieker.develop.rl.recordLang.Property;
import kieker.develop.rl.validation.PropertyEvaluation;
import org.eclipse.xtend2.lib.StringConcatenation;
import org.eclipse.xtext.xbase.lib.CollectionLiterals;
import org.eclipse.xtext.xbase.lib.Functions.Function1;
import org.eclipse.xtext.xbase.lib.IterableExtensions;
import org.eclipse.xtext.xbase.lib.StringExtensions;
@SuppressWarnings("all")
public class NameResolver {
/**
* Returns the correct name for a getter following Java conventions.
*
* @param property
* a property of a record type
*
* @returns the name of the getter of the property
*/
public static CharSequence createGetterName(final Property property) {
CharSequence _xifexpression = null;
Classifier _findType = PropertyEvaluation.findType(property);
BaseType _type = _findType.getType();
String _name = _type.getName();
boolean _equals = _name.equals("boolean");
if (_equals) {
StringConcatenation _builder = new StringConcatenation();
_builder.append("is");
String _name_1 = property.getName();
String _firstUpper = StringExtensions.toFirstUpper(_name_1);
_builder.append(_firstUpper, "");
_xifexpression = _builder;
} else {
StringConcatenation _builder_1 = new StringConcatenation();
_builder_1.append("get");
String _name_2 = property.getName();
String _firstUpper_1 = StringExtensions.toFirstUpper(_name_2);
_builder_1.append(_firstUpper_1, "");
_xifexpression = _builder_1;
}
return _xifexpression;
}
/**
* create a constant name from a standard name camel case name.
*/
public static String createConstantName(final String name) {
String _replaceAll = name.replaceAll("([a-z])([A-Z])", "$1_$2");
return _replaceAll.toUpperCase();
}
/**
* Check whether a given name is identical to a keyword of the target language and prepends an _.
*/
public static String protectKeywords(final String name) {
String _xblockexpression = null;
{
final List<String> keywords = Collections.<String>unmodifiableList(CollectionLiterals.<String>newArrayList("interface", "class", "private", "protected", "public", "return", "final", "volatile", "if", "else", "for", "foreach"));
String _xifexpression = null;
final Function1<String, Boolean> _function = (String it) -> {
return Boolean.valueOf(it.equals(name));
};
boolean _exists = IterableExtensions.<String>exists(keywords, _function);
if (_exists) {
_xifexpression = ("_" + name);
} else {
_xifexpression = name;
}
_xblockexpression = _xifexpression;
}
return _xblockexpression;
}
}
| [
"reiner.jung@email.uni-kiel.de"
] | reiner.jung@email.uni-kiel.de |
967dd0b004bdc82c57d8a9dd261001ba95560425 | 8af1164bac943cef64e41bae312223c3c0e38114 | /results-java/JetBrains--intellij-community/fcb46f1421fcafe5c0d1d87549254fac99d355c9/after/NegatedConditionalInspection.java | 2f372328c8884c08c4237da9bbc08ceedaa01da9 | [] | 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 | 6,129 | java | /*
* Copyright 2003-2006 Dave Griffith, Bas Leijdekkers
*
* 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.siyeh.ig.controlflow;
import com.intellij.codeInsight.daemon.GroupNames;
import com.intellij.codeInspection.ProblemDescriptor;
import com.intellij.openapi.project.Project;
import com.intellij.psi.*;
import com.intellij.psi.tree.IElementType;
import com.intellij.util.IncorrectOperationException;
import com.siyeh.ig.BaseInspectionVisitor;
import com.siyeh.ig.ExpressionInspection;
import com.siyeh.ig.InspectionGadgetsFix;
import com.siyeh.ig.psiutils.BoolUtils;
import com.siyeh.ig.ui.SingleCheckboxOptionsPanel;
import com.siyeh.InspectionGadgetsBundle;
import javax.swing.*;
import org.jetbrains.annotations.NotNull;
public class NegatedConditionalInspection extends ExpressionInspection {
/**
* @noinspection PublicField
*/
public boolean m_ignoreNegatedNullComparison = true;
public String getID() {
return "ConditionalExpressionWithNegatedCondition";
}
public String getGroupDisplayName() {
return GroupNames.CONTROL_FLOW_GROUP_NAME;
}
@NotNull
protected String buildErrorString(Object... infos) {
return InspectionGadgetsBundle.message(
"negated.conditional.problem.descriptor");
}
public BaseInspectionVisitor buildVisitor() {
return new NegatedConditionalVisitor();
}
public JComponent createOptionsPanel() {
return new SingleCheckboxOptionsPanel(InspectionGadgetsBundle.message(
"negated.conditional.ignore.option"), this,
"m_ignoreNegatedNullComparison");
}
protected InspectionGadgetsFix buildFix(PsiElement location) {
return new NegatedConditionalFix();
}
private static class NegatedConditionalFix extends InspectionGadgetsFix {
public String getName() {
return InspectionGadgetsBundle.message(
"negated.conditional.invert.quickfix");
}
public void doFix(Project project,
ProblemDescriptor descriptor)
throws IncorrectOperationException {
final PsiElement element = descriptor.getPsiElement();
final PsiConditionalExpression exp =
(PsiConditionalExpression)element.getParent();
assert exp != null;
final PsiExpression elseBranch = exp.getElseExpression();
final PsiExpression thenBranch = exp.getThenExpression();
final PsiExpression condition = exp.getCondition();
final String negatedCondition =
BoolUtils.getNegatedExpressionText(condition);
assert elseBranch != null;
assert thenBranch != null;
final String newStatement =
negatedCondition + '?' + elseBranch.getText() + ':' +
thenBranch.getText();
replaceExpression(exp, newStatement);
}
}
private class NegatedConditionalVisitor extends BaseInspectionVisitor {
public void visitConditionalExpression(
PsiConditionalExpression expression) {
super.visitConditionalExpression(expression);
final PsiExpression thenBranch = expression.getThenExpression();
if (thenBranch == null) {
return;
}
final PsiExpression elseBranch = expression.getElseExpression();
if (elseBranch == null) {
return;
}
final PsiExpression condition = expression.getCondition();
if (!isNegation(condition)) {
return;
}
registerError(condition);
}
private boolean isNegation(PsiExpression condition) {
if (condition instanceof PsiPrefixExpression) {
final PsiPrefixExpression prefixExpression =
(PsiPrefixExpression)condition;
final PsiJavaToken sign = prefixExpression.getOperationSign();
final IElementType tokenType = sign.getTokenType();
return tokenType.equals(JavaTokenType.EXCL);
} else if (condition instanceof PsiBinaryExpression) {
final PsiBinaryExpression binaryExpression =
(PsiBinaryExpression)condition;
final PsiJavaToken sign = binaryExpression.getOperationSign();
final PsiExpression lhs = binaryExpression.getLOperand();
final PsiExpression rhs = binaryExpression.getROperand();
if (rhs == null) {
return false;
}
final IElementType tokenType = sign.getTokenType();
if (tokenType.equals(JavaTokenType.NE)) {
if (m_ignoreNegatedNullComparison) {
final String lhsText = lhs.getText();
final String rhsText = rhs.getText();
return !PsiKeyword.NULL.equals(lhsText) &&
!PsiKeyword.NULL.equals(rhsText);
} else {
return true;
}
} else {
return false;
}
} else if (condition instanceof PsiParenthesizedExpression) {
final PsiExpression expression =
((PsiParenthesizedExpression)condition).getExpression();
return isNegation(expression);
} else {
return false;
}
}
}
} | [
"fraczwojciech@gmail.com"
] | fraczwojciech@gmail.com |
6e3cf43395c68fb487c563690e3c9ae08569cf03 | f16f3b0733e393452fe6dcae75cdf8f43819c6e4 | /spring-integration-core/src/main/java/org/springframework/integration/expression/ExpressionSource.java | fca593da59d36e98b699a7973daf721d604fdf88 | [] | no_license | mekeerati/spring-integration | 265ed2c0471fe825a6970b8a7623580d629c67b3 | df492e18fae0744b3fab57886ed3880c87755898 | refs/heads/master | 2020-05-29T11:37:05.396145 | 2013-12-20T19:07:56 | 2013-12-21T15:46:14 | 15,449,227 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 945 | java | /*
* Copyright 2002-2010 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.integration.expression;
import java.util.Locale;
import org.springframework.expression.Expression;
/**
* Strategy interface for retrieving Expressions.
*
* @author Mark Fisher
* @since 2.0
*/
public interface ExpressionSource {
Expression getExpression(String key, Locale locale);
}
| [
"markfisher@vmware.com"
] | markfisher@vmware.com |
b0c75c13b88f4d7f707a6af40844026fc7039f02 | 30e1ef3e25eda75c20e34818e01276331bd4aab5 | /cleanapp/app/src/main/java/com/nuon/peter/demoapp/ui/movielist/entity/ResultsItem.java | 1bf261aeb28d997613ab2c099798281e0fe2ca72 | [] | no_license | chhai-chivon-android/Basic-Advance-CKCC | c3b53b770e9ae932d0a2c23ec0ee01c4df41e713 | bc90e7565aefbe51be1b3757ccd67f7e0a6e05a0 | refs/heads/master | 2021-06-20T14:39:58.612786 | 2017-08-14T10:14:05 | 2017-08-14T10:14:05 | 100,254,685 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,019 | java | package com.nuon.peter.demoapp.ui.movielist.entity;
import java.util.List;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
public class ResultsItem{
@SerializedName("overview")
@Expose
private String overview;
@SerializedName("original_language")
@Expose
private String originalLanguage;
@SerializedName("original_title")
@Expose
private String originalTitle;
@SerializedName("video")
@Expose
private boolean video;
@SerializedName("title")
@Expose
private String title;
@SerializedName("genre_ids")
@Expose
private List<Integer> genreIds;
@SerializedName("poster_path")
@Expose
private String posterPath;
@SerializedName("backdrop_path")
@Expose
private String backdropPath;
@SerializedName("release_date")
@Expose
private String releaseDate;
@SerializedName("popularity")
@Expose
private double popularity;
@SerializedName("vote_average")
@Expose
private double voteAverage;
@SerializedName("id")
@Expose
private int id;
@SerializedName("adult")
@Expose
private boolean adult;
@SerializedName("vote_count")
@Expose
private int voteCount;
public void setOverview(String overview){
this.overview = overview;
}
public String getOverview(){
return overview;
}
public void setOriginalLanguage(String originalLanguage){
this.originalLanguage = originalLanguage;
}
public String getOriginalLanguage(){
return originalLanguage;
}
public void setOriginalTitle(String originalTitle){
this.originalTitle = originalTitle;
}
public String getOriginalTitle(){
return originalTitle;
}
public void setVideo(boolean video){
this.video = video;
}
public boolean isVideo(){
return video;
}
public void setTitle(String title){
this.title = title;
}
public String getTitle(){
return title;
}
public void setGenreIds(List<Integer> genreIds){
this.genreIds = genreIds;
}
public List<Integer> getGenreIds(){
return genreIds;
}
public void setPosterPath(String posterPath){
this.posterPath = posterPath;
}
public String getPosterPath(){
return posterPath;
}
public void setBackdropPath(String backdropPath){
this.backdropPath = backdropPath;
}
public String getBackdropPath(){
return backdropPath;
}
public void setReleaseDate(String releaseDate){
this.releaseDate = releaseDate;
}
public String getReleaseDate(){
return releaseDate;
}
public void setPopularity(double popularity){
this.popularity = popularity;
}
public double getPopularity(){
return popularity;
}
public void setVoteAverage(double voteAverage){
this.voteAverage = voteAverage;
}
public double getVoteAverage(){
return voteAverage;
}
public void setId(int id){
this.id = id;
}
public int getId(){
return id;
}
public void setAdult(boolean adult){
this.adult = adult;
}
public boolean isAdult(){
return adult;
}
public void setVoteCount(int voteCount){
this.voteCount = voteCount;
}
public int getVoteCount(){
return voteCount;
}
} | [
"chivonchhai@hotmail.com"
] | chivonchhai@hotmail.com |
b4ab0f2191b9f3bdd118bedc2a22adc2d8a20b97 | a6fabd996f170d33ee5d4b333fda1fbc6c5f17b8 | /chipro-manage/chipro-manage-biz/src/main/java/cn/spark/chipro/manage/biz/service/impl/ClassUserServiceImpl.java | 59579190a3fa8bb861604569b1da4aa2d8ce63de | [] | no_license | 16GCC-SE/chipro | b788f7c5441eb28b63ebf55d698b0e77de55520d | a6e36eb1cfd150d7c2edde9c8e9827d72aa95cd2 | refs/heads/master | 2022-04-10T03:16:21.248897 | 2020-03-22T17:04:38 | 2020-03-22T17:04:38 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,132 | java | package cn.spark.chipro.manage.biz.service.impl;
import cn.spark.chipro.manage.biz.entity.ClassUser;
import cn.spark.chipro.manage.biz.mapper.ClassUserMapper;
import cn.spark.chipro.manage.api.model.params.ClassUserParam;
import cn.spark.chipro.manage.api.model.result.ClassUserResult;
import cn.spark.chipro.manage.biz.service.ClassUserService;
import cn.spark.chipro.core.page.PageFactory;
import cn.spark.chipro.core.page.PageInfo;
import cn.spark.chipro.core.util.ToolUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
* <p>
* 课室老师 服务实现类
* </p>
*
* @author 李利光
* @since 2020-02-07
*/
@Service
public class ClassUserServiceImpl extends ServiceImpl<ClassUserMapper, ClassUser> implements ClassUserService {
@Override
public void add(ClassUserParam param){
ClassUser entity = getEntity(param);
this.save(entity);
}
public void batchAdd(List<ClassUserParam> classUserParamList){
if(classUserParamList!=null){
List<ClassUser> classUserList = new ArrayList<>();
classUserParamList.forEach(classUserParam->{
ClassUser classUser = new ClassUser();
classUser.setUserId(classUserParam.getUserId());
classUser.setClassRoomId(classUserParam.getClassRoomId());
classUserList.add(classUser);
});
this.saveBatch(classUserList);
}
}
@Override
public void delete(ClassUserParam param){
this.removeById(getKey(param));
}
@Override
public void update(ClassUserParam param){
ClassUser oldEntity = getOldEntity(param);
ClassUser newEntity = getEntity(param);
ToolUtil.copyProperties(newEntity, oldEntity);
this.updateById(newEntity);
}
@Override
public ClassUserResult findBySpec(ClassUserParam param){
return null;
}
@Override
public List<ClassUserResult> findListBySpec(ClassUserParam param){
return null;
}
@Override
public PageInfo findPageBySpec(ClassUserParam param){
Page pageContext=getPageContext();
QueryWrapper<ClassUser>objectQueryWrapper=new QueryWrapper<>();
IPage page=this.page(pageContext,objectQueryWrapper);
return PageFactory.createPageInfo(page);
}
private Serializable getKey(ClassUserParam param){
return param.getClassUserId();
}
private Page getPageContext() {
return new PageFactory().defaultPage();
}
private ClassUser getOldEntity(ClassUserParam param) {
return this.getById(getKey(param));
}
private ClassUser getEntity(ClassUserParam param) {
ClassUser entity = new ClassUser();
ToolUtil.copyProperties(param, entity);
return entity;
}
}
| [
"903857227@qq.com"
] | 903857227@qq.com |
1768da58262869d345b1c34d8d48c3d31132566d | 0f11a58f4f8957d611e03b6a7ba200105332bcca | /oiscn-common/src/main/java/com/varian/oiscn/core/targetvolume/PlanTargetVolumeInfo.java | e4e84ccf69d567952fcb4cae6e30cd85cd2daca2 | [] | no_license | yugezi-gjw/SDCH-server-release-2 | 955c82dac6c888c2c69e80146476245607af1237 | d78aa8a0ee0376aaf688201688ef009ec4179b65 | refs/heads/master | 2020-03-25T04:11:43.980187 | 2018-08-03T07:04:45 | 2018-08-03T07:04:45 | 143,382,229 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 397 | java | package com.varian.oiscn.core.targetvolume;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.List;
/**
* Created by bhp9696 on 2018/3/1.
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class PlanTargetVolumeInfo implements Serializable{
private String planId;
private List<String> nameList;
}
| [
"gbt1220@varian.com"
] | gbt1220@varian.com |
23ec512c58c6544520d366af5c65ad1cfa1dd40e | 54f352a242a8ad6ff5516703e91da61e08d9a9e6 | /Source Codes/CodeJamData/16/02/19.java | 0847aaf07f9f9ef5b2f5c815f5ce189082c37dd5 | [] | no_license | Kawser-nerd/CLCDSA | 5cbd8a4c3f65173e4e8e0d7ed845574c4770c3eb | aee32551795763b54acb26856ab239370cac4e75 | refs/heads/master | 2022-02-09T11:08:56.588303 | 2022-01-26T18:53:40 | 2022-01-26T18:53:40 | 211,783,197 | 23 | 9 | null | null | null | null | UTF-8 | Java | false | false | 2,985 | java | import java.io.*;
import java.util.*;
public class _2016QualQB {
public static void main(String args[]) throws Exception {
InputReader in;
PrintWriter w;
boolean online = true;
String fileName = "B-large";
if (online) {
in = new InputReader(new FileInputStream(new File(fileName + ".in")));
w = new PrintWriter(new FileWriter(fileName + "out.txt"));
} else {
in = new InputReader(System.in);
w = new PrintWriter(System.out);
}
int T = in.nextInt();
for (int t = 1; t <= T; t++) {
char s[] = in.readString().toCharArray();
int c = 1;
for(int i = 1; i < s.length; i++)
if(s[i] != s[i - 1])
c++;
int ans = 0;
if(c % 2 == 0){
if(s[0] == '-')
ans = c - 1;
else
ans = c;
}
else{
if(s[0] == '-')
ans = c;
else
ans = c - 1;
}
w.println("Case #" + t + ": " + ans);
}
w.close();
}
static class InputReader {
private InputStream stream;
private byte[] buf = new byte[8192];
private int curChar, snumChars;
private SpaceCharFilter filter;
public InputReader(InputStream stream) {
this.stream = stream;
}
public int snext() {
if (snumChars == -1)
throw new InputMismatchException();
if (curChar >= snumChars) {
curChar = 0;
try {
snumChars = stream.read(buf);
} catch (IOException e) {
throw new InputMismatchException();
}
if (snumChars <= 0)
return -1;
}
return buf[curChar++];
}
public int nextInt() {
int c = snext();
while (isSpaceChar(c))
c = snext();
int sgn = 1;
if (c == '-') {
sgn = -1;
c = snext();
}
int res = 0;
do {
if (c < '0' || c > '9')
throw new InputMismatchException();
res *= 10;
res += c - '0';
c = snext();
} while (!isSpaceChar(c));
return res * sgn;
}
public long nextLong() {
int c = snext();
while (isSpaceChar(c))
c = snext();
int sgn = 1;
if (c == '-') {
sgn = -1;
c = snext();
}
long res = 0;
do {
if (c < '0' || c > '9')
throw new InputMismatchException();
res *= 10;
res += c - '0';
c = snext();
} while (!isSpaceChar(c));
return res * sgn;
}
public int[] nextIntArray(int n) {
int a[] = new int[n];
for (int i = 0; i < n; i++)
a[i] = nextInt();
return a;
}
public String readString() {
int c = snext();
while (isSpaceChar(c))
c = snext();
StringBuilder res = new StringBuilder();
do {
res.appendCodePoint(c);
c = snext();
} while (!isSpaceChar(c));
return res.toString();
}
public boolean isSpaceChar(int c) {
if (filter != null)
return filter.isSpaceChar(c);
return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
}
public interface SpaceCharFilter {
public boolean isSpaceChar(int ch);
}
}
}
| [
"kwnafi@yahoo.com"
] | kwnafi@yahoo.com |
38eb2ddc9dd2f27595aed968b645c8a7685e176f | df5d45b0c4fa86671f987661a0c88c91e90a3c5e | /EjerciciosParaConceptos/Hilos/src/tienda/cliente/Cliente.java | 5ae89b761666e1e5ba6c9296715264221668893e | [] | no_license | BryanBmmF/RespaldoProyectosGit | e0d8e6416853fe7b103069fa49d086c3bdfd2b55 | 69c922f96fe8f9749d7b135454095a6974f733d7 | refs/heads/master | 2020-04-22T09:05:12.406652 | 2020-03-06T06:09:49 | 2020-03-06T06:09:49 | 170,260,016 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 601 | java | package tienda.cliente;
/**
* Hilos
*
* @author jose - 14.03.2017
* @Title: Cliente
* @Description: description
*
* Changes History
*/
public class Cliente {
private String nombre;
private int[] carroCompra;
public Cliente(String nombre, int[] carroCompra) {
this.nombre = nombre;
this.carroCompra = carroCompra;
}
public String getNombre() {
return nombre;
}
public void setNombre(String nombre) {
this.nombre = nombre;
}
public int[] getCarroCompra() {
return carroCompra;
}
public void setCarroCompra(int[] carroCompra) {
this.carroCompra = carroCompra;
}
}
| [
"bryan.bmmf@gmail.com"
] | bryan.bmmf@gmail.com |
6db4d08eb9da604d5fef141701dab05a6a4d9036 | 84ae31dc976591cb6bba67637757127b8424d136 | /src/test/java/net/imagej/ops/transform/extendRandomView/ExtendRandomViewTest.java | c6af5edf84ae6f2ca9cf08091f06334ff56d7a64 | [
"BSD-2-Clause"
] | permissive | frauzufall/imagej-ops | 5055b06143518715179e2f6f2feed68affb03af0 | b4a2db25ba4865a1c63e3555c867d9f0e51f4622 | refs/heads/master | 2020-12-03T06:35:17.014075 | 2017-06-23T15:55:38 | 2017-06-23T15:55:38 | 95,703,030 | 0 | 0 | null | 2017-06-28T19:12:10 | 2017-06-28T19:12:10 | null | UTF-8 | Java | false | false | 2,909 | java | /*
* #%L
* ImageJ software for multidimensional image processing and analysis.
* %%
* Copyright (C) 2014 - 2017 Board of Regents of the University of
* Wisconsin-Madison, University of Konstanz and Brian Northan.
* %%
* 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 HOLDERS 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.
* #L%
*/
package net.imagej.ops.transform.extendRandomView;
import static org.junit.Assert.assertEquals;
import net.imagej.ops.AbstractOpTest;
import net.imglib2.img.Img;
import net.imglib2.img.array.ArrayImgFactory;
import net.imglib2.outofbounds.OutOfBounds;
import net.imglib2.type.numeric.real.DoubleType;
import net.imglib2.view.Views;
import org.junit.Test;
/**
* Tests {@link net.imagej.ops.Ops.Transform.ExtendRandomView} ops.
* <p>
* This test only checks if the op call works with all parameters and that the
* result is equal to that of the {@link Views} method call. It is not a
* correctness test of {@link Views} itself.
* </p>
*
* @author Tim-Oliver Buchholz (University of Konstanz)
*/
public class ExtendRandomViewTest extends AbstractOpTest {
@Test
public void extendRandomTest() {
Img<DoubleType> img = new ArrayImgFactory<DoubleType>().create(new int[] { 10, 10 }, new DoubleType());
OutOfBounds<DoubleType> il2 = Views.extendRandom(img, 0, 0).randomAccess();
OutOfBounds<DoubleType> opr = ops.transform().extendRandom(img, 0, 0).randomAccess();
il2.setPosition(new int[] { -1, -1 });
opr.setPosition(new int[] { -1, -1 });
assertEquals(il2.get().get(), opr.get().get(), 1e-10);
il2.setPosition(new int[] { 11, 11 });
opr.setPosition(new int[] { 11, 11 });
assertEquals(il2.get().get(), opr.get().get(), 1e-10);
}
}
| [
"ctrueden@wisc.edu"
] | ctrueden@wisc.edu |
5ee80784dd95512eeb756f015057b72760e64e63 | 620a1826d1d66ddc7903d7f3d9c5060e8e022ad2 | /src/main/java/com/soluciones/config/LoggingConfiguration.java | e6a0214c63af902d8b8b6becf7d3a64a380a0483 | [] | no_license | BulkSecurityGeneratorProject22/JHipster | 1efa3689472aa3c8963591b66c3613820e96a439 | 2773ab4268c49a990e1c2017a2ebde24380b5636 | refs/heads/master | 2022-12-11T23:44:30.033682 | 2017-11-23T23:56:47 | 2017-11-23T23:56:47 | 296,687,315 | 0 | 0 | null | 2020-09-18T17:26:34 | 2020-09-18T17:26:33 | null | UTF-8 | Java | false | false | 6,938 | java | package com.soluciones.config;
import java.net.InetSocketAddress;
import java.util.Iterator;
import io.github.jhipster.config.JHipsterProperties;
import ch.qos.logback.classic.AsyncAppender;
import ch.qos.logback.classic.Level;
import ch.qos.logback.classic.LoggerContext;
import ch.qos.logback.classic.boolex.OnMarkerEvaluator;
import ch.qos.logback.classic.spi.ILoggingEvent;
import ch.qos.logback.classic.spi.LoggerContextListener;
import ch.qos.logback.core.Appender;
import ch.qos.logback.core.filter.EvaluatorFilter;
import ch.qos.logback.core.spi.ContextAwareBase;
import ch.qos.logback.core.spi.FilterReply;
import net.logstash.logback.appender.LogstashTcpSocketAppender;
import net.logstash.logback.encoder.LogstashEncoder;
import net.logstash.logback.stacktrace.ShortenedThrowableConverter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.cloud.netflix.eureka.EurekaInstanceConfigBean;
import org.springframework.context.annotation.Configuration;
@Configuration
@ConditionalOnProperty("eureka.client.enabled")
public class LoggingConfiguration {
private static final String LOGSTASH_APPENDER_NAME = "LOGSTASH";
private static final String ASYNC_LOGSTASH_APPENDER_NAME = "ASYNC_LOGSTASH";
private final Logger log = LoggerFactory.getLogger(LoggingConfiguration.class);
private LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory();
private final String appName;
private final String serverPort;
private final EurekaInstanceConfigBean eurekaInstanceConfigBean;
private final JHipsterProperties jHipsterProperties;
public LoggingConfiguration(@Value("${spring.application.name}") String appName, @Value("${server.port}") String serverPort,
EurekaInstanceConfigBean eurekaInstanceConfigBean, JHipsterProperties jHipsterProperties) {
this.appName = appName;
this.serverPort = serverPort;
this.eurekaInstanceConfigBean = eurekaInstanceConfigBean;
this.jHipsterProperties = jHipsterProperties;
if (jHipsterProperties.getLogging().getLogstash().isEnabled()) {
addLogstashAppender(context);
addContextListener(context);
}
if (jHipsterProperties.getMetrics().getLogs().isEnabled()) {
setMetricsMarkerLogbackFilter(context);
}
}
private void addContextListener(LoggerContext context) {
LogbackLoggerContextListener loggerContextListener = new LogbackLoggerContextListener();
loggerContextListener.setContext(context);
context.addListener(loggerContextListener);
}
private void addLogstashAppender(LoggerContext context) {
log.info("Initializing Logstash logging");
LogstashTcpSocketAppender logstashAppender = new LogstashTcpSocketAppender();
logstashAppender.setName("LOGSTASH");
logstashAppender.setContext(context);
String customFields = "{\"app_name\":\"" + appName + "\",\"app_port\":\"" + serverPort + "\"}";
// More documentation is available at: https://github.com/logstash/logstash-logback-encoder
LogstashEncoder logstashEncoder=new LogstashEncoder();
// Set the Logstash appender config from JHipster properties
logstashEncoder.setCustomFields(customFields);
// Set the Logstash appender config from JHipster properties
logstashAppender.addDestinations(new InetSocketAddress(jHipsterProperties.getLogging().getLogstash().getHost(),jHipsterProperties.getLogging().getLogstash().getPort()));
ShortenedThrowableConverter throwableConverter = new ShortenedThrowableConverter();
throwableConverter.setRootCauseFirst(true);
logstashEncoder.setThrowableConverter(throwableConverter);
logstashEncoder.setCustomFields(customFields);
logstashAppender.setEncoder(logstashEncoder);
logstashAppender.start();
// Wrap the appender in an Async appender for performance
AsyncAppender asyncLogstashAppender = new AsyncAppender();
asyncLogstashAppender.setContext(context);
asyncLogstashAppender.setName("ASYNC_LOGSTASH");
asyncLogstashAppender.setQueueSize(jHipsterProperties.getLogging().getLogstash().getQueueSize());
asyncLogstashAppender.addAppender(logstashAppender);
asyncLogstashAppender.start();
context.getLogger("ROOT").addAppender(asyncLogstashAppender);
}
// Configure a log filter to remove "metrics" logs from all appenders except the "LOGSTASH" appender
private void setMetricsMarkerLogbackFilter(LoggerContext context) {
log.info("Filtering metrics logs from all appenders except the {} appender", LOGSTASH_APPENDER_NAME);
OnMarkerEvaluator onMarkerMetricsEvaluator = new OnMarkerEvaluator();
onMarkerMetricsEvaluator.setContext(context);
onMarkerMetricsEvaluator.addMarker("metrics");
onMarkerMetricsEvaluator.start();
EvaluatorFilter<ILoggingEvent> metricsFilter = new EvaluatorFilter<>();
metricsFilter.setContext(context);
metricsFilter.setEvaluator(onMarkerMetricsEvaluator);
metricsFilter.setOnMatch(FilterReply.DENY);
metricsFilter.start();
for (ch.qos.logback.classic.Logger logger : context.getLoggerList()) {
for (Iterator<Appender<ILoggingEvent>> it = logger.iteratorForAppenders(); it.hasNext(); ) {
Appender<ILoggingEvent> appender = it.next();
if (!appender.getName().equals(ASYNC_LOGSTASH_APPENDER_NAME)) {
log.debug("Filter metrics logs from the {} appender", appender.getName());
appender.setContext(context);
appender.addFilter(metricsFilter);
appender.start();
}
}
}
}
/**
* Logback configuration is achieved by configuration file and API.
* When configuration file change is detected, the configuration is reset.
* This listener ensures that the programmatic configuration is also re-applied after reset.
*/
class LogbackLoggerContextListener extends ContextAwareBase implements LoggerContextListener {
@Override
public boolean isResetResistant() {
return true;
}
@Override
public void onStart(LoggerContext context) {
addLogstashAppender(context);
}
@Override
public void onReset(LoggerContext context) {
addLogstashAppender(context);
}
@Override
public void onStop(LoggerContext context) {
// Nothing to do.
}
@Override
public void onLevelChange(ch.qos.logback.classic.Logger logger, Level level) {
// Nothing to do.
}
}
}
| [
"jhipster-bot@users.noreply.github.com"
] | jhipster-bot@users.noreply.github.com |
743d7b587c6cb86f592cdf7814fe2d38a37898ea | 2c8b5f1bbc4cb5132387c19810173c0f35973911 | /app/src/main/java/com/example/chatdemo/FaqActivity.java | 45228f274ee0f8068b14b6fd4eaa844d70afb20b | [] | no_license | MohamedAliArafa/ChatDemoDED | e6d5ea267dc42482230d4ec15cc5860a185de484 | da603648dcc0f9d150bb2649924cc290eb23945f | refs/heads/master | 2020-12-13T21:27:48.744476 | 2020-01-17T11:30:32 | 2020-01-17T11:30:32 | 234,535,187 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,591 | java | package com.example.chatdemo;
import android.os.Bundle;
import android.os.Handler;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.TextView;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.example.chatdemo.ChatSplash.Message;
import com.example.chatdemo.ChatSplash.Option;
import com.example.chatdemo.ChatSplash.ResultModel;
import com.example.chatdemo.ChatSplash.SplashChatAdapter;
import com.google.android.flexbox.FlexDirection;
import com.google.android.flexbox.FlexboxLayout;
import com.google.gson.Gson;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
import java.util.List;
import jp.wasabeef.recyclerview.animators.SlideInUpAnimator;
public class FaqActivity extends AppCompatActivity {
RecyclerView rv;
FlexboxLayout flexboxLayout;
SplashChatAdapter adapter;
ResultModel[] mModel;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_faq);
rv = findViewById(R.id.recycler_view);
flexboxLayout = findViewById(R.id.option_container);
adapter = new SplashChatAdapter();
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);
linearLayoutManager.setStackFromEnd(true);
rv.setLayoutManager(linearLayoutManager);
rv.setItemAnimator(new SlideInUpAnimator());
rv.setAdapter(adapter);
InputStream raw = getResources().openRawResource(R.raw.chat_json);
Reader rd = new BufferedReader(new InputStreamReader(raw));
Gson gson = new Gson();
mModel = gson.fromJson(rd, ResultModel[].class);
loadModel(0, false);
}
void loadModel(int modelID, boolean replay) {
if (modelID == -1 || modelID == -2) {
Toast.makeText(this, "سوف يتم إضافة المزيد لاحقا", Toast.LENGTH_LONG).show();
// startActivity(new Intent(this, HomeActivity.class).putExtra("param", modelID));
modelID = 0;
}
Handler handler = new Handler();
final List<Message> messages = mModel[modelID].getMessages();
if (!replay) {
for (int i = 0; i < messages.size() * 2; i++) {
final int finalI = i;
handler.postDelayed(() -> {
if (finalI % 2 == 0) {
adapter.add(adapter.getItemCount(), "...", null, false);
} else {
adapter.delete(adapter.getItemCount() - 1);
adapter.add(adapter.getItemCount(), messages.get(finalI / 2).getText(), null, false);
}
rv.scrollToPosition(adapter.getItemCount() - 1);
}, 1000 * i);
}
}
List<Option> options = mModel[modelID].getOptions();
List<Message> replies = mModel[modelID].getReplies();
final TextView[] textViews = new TextView[options.size()];
for (int i = 0; i < options.size(); i++) {
TextView newTextView = new TextView(this);
newTextView.setText(options.get(i).getMessage());
newTextView.setId(View.generateViewId());
newTextView.setLayoutParams(new FlexboxLayout.LayoutParams(
FlexboxLayout.LayoutParams.WRAP_CONTENT,
FlexboxLayout.LayoutParams.WRAP_CONTENT));
// if (Objects.equals(LocaleManager.getLanguage(this), LocaleManager.LANGUAGE_ARABIC))
newTextView.setBackgroundResource(R.drawable.bg_rounded_right);
// else newTextView.setBackgroundResource(R.drawable.bg_rounded_left);
newTextView.setTextColor(getResources().getColor(android.R.color.black));
float scale = getResources().getDisplayMetrics().density;
int dp = (int) (10 * scale + 0.5f);
newTextView.setPadding(dp, dp, dp, dp);
flexboxLayout.setFlexDirection(FlexDirection.ROW);
FlexboxLayout.LayoutParams lp = (FlexboxLayout.LayoutParams) newTextView.getLayoutParams();
lp.setMargins(dp, dp / 2, dp, dp / 2);
newTextView.setLayoutParams(lp);
final int finalI = i;
newTextView.setOnClickListener(view -> {
adapter.add(adapter.getItemCount(), options.get(finalI).getMessage(), null, true);
rv.scrollToPosition(adapter.getItemCount() - 1);
Animation animation = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.fad_in_out);
view.startAnimation(animation);
flexboxLayout.removeAllViews();
if (options.get(finalI).getCode() == 0)
loadModel(options.get(finalI).getCode(), true);
else
loadModel(options.get(finalI).getCode(), false);
});
textViews[i] = newTextView;
}
if (replay) {
handler.postDelayed(() -> {
for (int i = 0; i < options.size(); i++) {
flexboxLayout.addView(textViews[i]);
}
}, 1000);
} else {
handler.postDelayed(() -> {
for (int i = 0; i < options.size(); i++) {
flexboxLayout.addView(textViews[i]);
}
}, 1000 * messages.size() * 2);
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
MenuInflater inflater = getMenuInflater();
return true;
}
/* Called whenever we call invalidateOptionsMenu() */
@Override
public boolean onPrepareOptionsMenu(Menu menu) {
// If the nav drawer is open, hide action items related to the content view
return super.onPrepareOptionsMenu(menu);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
// switch (id) {
// case R.id.action_call:
//// startActivity(new Intent(DashBoardActivity.this, FaqActivity.class));
// break;
// }
return super.onOptionsItemSelected(item);
}
}
| [
"ghostarafa@gmail.com"
] | ghostarafa@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.