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
bc3ccb1612d23f3a3d1259cc2143e21f016a1888
48e835e6f176a8ac9ae3ca718e8922891f1e5a18
/benchmark/training/org/apache/hadoop/hbase/backup/TestBackupShowHistory.java
e2fe1689ed55bd5cf0f575863dda59513486904a
[]
no_license
STAMP-project/dspot-experiments
f2c7a639d6616ae0adfc491b4cb4eefcb83d04e5
121487e65cdce6988081b67f21bbc6731354a47f
refs/heads/master
2023-02-07T14:40:12.919811
2019-11-06T07:17:09
2019-11-06T07:17:09
75,710,758
14
19
null
2023-01-26T23:57:41
2016-12-06T08:27:42
null
UTF-8
Java
false
false
5,292
java
/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.hadoop.hbase.backup; import BackupInfo.Filter; import java.io.ByteArrayOutputStream; import java.io.PrintStream; import java.util.List; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.backup.util.BackupUtils; import org.apache.hadoop.hbase.testclassification.LargeTests; import org.apache.hadoop.util.ToolRunner; import org.apache.hbase.thirdparty.com.google.common.collect.Lists; import org.junit.Assert; import org.junit.ClassRule; import org.junit.Test; import org.junit.experimental.categories.Category; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @Category(LargeTests.class) public class TestBackupShowHistory extends TestBackupBase { @ClassRule public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestBackupShowHistory.class); private static final Logger LOG = LoggerFactory.getLogger(TestBackupShowHistory.class); /** * Verify that full backup is created on a single table with data correctly. Verify that history * works as expected. * * @throws Exception * if doing the backup or an operation on the tables fails */ @Test public void testBackupHistory() throws Exception { TestBackupShowHistory.LOG.info("test backup history on a single table with data"); List<TableName> tableList = Lists.newArrayList(TestBackupBase.table1); String backupId = fullTableBackup(tableList); Assert.assertTrue(checkSucceeded(backupId)); TestBackupShowHistory.LOG.info("backup complete"); List<BackupInfo> history = getBackupAdmin().getHistory(10); Assert.assertTrue(findBackup(history, backupId)); BackupInfo.Filter nullFilter = ( info) -> true; history = BackupUtils.getHistory(TestBackupBase.conf1, 10, new Path(TestBackupBase.BACKUP_ROOT_DIR), nullFilter); Assert.assertTrue(findBackup(history, backupId)); ByteArrayOutputStream baos = new ByteArrayOutputStream(); System.setOut(new PrintStream(baos)); String[] args = new String[]{ "history", "-n", "10", "-p", TestBackupBase.BACKUP_ROOT_DIR }; // Run backup int ret = ToolRunner.run(TestBackupBase.conf1, new BackupDriver(), args); Assert.assertTrue((ret == 0)); TestBackupShowHistory.LOG.info("show_history"); String output = baos.toString(); TestBackupShowHistory.LOG.info(output); baos.close(); Assert.assertTrue(((output.indexOf(backupId)) > 0)); tableList = Lists.newArrayList(TestBackupBase.table2); String backupId2 = fullTableBackup(tableList); Assert.assertTrue(checkSucceeded(backupId2)); TestBackupShowHistory.LOG.info(("backup complete: " + (TestBackupBase.table2))); BackupInfo.Filter tableNameFilter = ( image) -> { if ((TestBackupBase.table1) == null) { return true; } List<TableName> names = image.getTableNames(); return names.contains(TestBackupBase.table1); }; BackupInfo.Filter tableSetFilter = ( info) -> { String backupId1 = info.getBackupId(); return backupId1.startsWith("backup"); }; history = getBackupAdmin().getHistory(10, tableNameFilter, tableSetFilter); Assert.assertTrue(((history.size()) > 0)); boolean success = true; for (BackupInfo info : history) { if (!(info.getTableNames().contains(TestBackupBase.table1))) { success = false; break; } } Assert.assertTrue(success); history = BackupUtils.getHistory(TestBackupBase.conf1, 10, new Path(TestBackupBase.BACKUP_ROOT_DIR), tableNameFilter, tableSetFilter); Assert.assertTrue(((history.size()) > 0)); success = true; for (BackupInfo info : history) { if (!(info.getTableNames().contains(TestBackupBase.table1))) { success = false; break; } } Assert.assertTrue(success); args = new String[]{ "history", "-n", "10", "-p", TestBackupBase.BACKUP_ROOT_DIR, "-t", "table1", "-s", "backup" }; // Run backup ret = ToolRunner.run(TestBackupBase.conf1, new BackupDriver(), args); Assert.assertTrue((ret == 0)); TestBackupShowHistory.LOG.info("show_history"); } }
[ "benjamin.danglot@inria.fr" ]
benjamin.danglot@inria.fr
40e6b12c97024ee0934b8f0c936d1a956d33cfc3
fa1408365e2e3f372aa61e7d1e5ea5afcd652199
/src/testcases/CWE78_OS_Command_Injection/CWE78_OS_Command_Injection__connect_tcp_42.java
7c80c5228d3f23ec9011319c9e198f5d15e97077
[]
no_license
bqcuong/Juliet-Test-Case
31e9c89c27bf54a07b7ba547eddd029287b2e191
e770f1c3969be76fdba5d7760e036f9ba060957d
refs/heads/master
2020-07-17T14:51:49.610703
2019-09-03T16:22:58
2019-09-03T16:22:58
206,039,578
1
2
null
null
null
null
UTF-8
Java
false
false
5,289
java
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE78_OS_Command_Injection__connect_tcp_42.java Label Definition File: CWE78_OS_Command_Injection.label.xml Template File: sources-sink-42.tmpl.java */ /* * @description * CWE: 78 OS Command Injection * BadSource: connect_tcp Read data using an outbound tcp connection * GoodSource: A hardcoded string * BadSink: exec dynamic command execution with Runtime.getRuntime().exec() * Flow Variant: 42 Data flow: data returned from one method to another in the same class * * */ package testcases.CWE78_OS_Command_Injection; import testcasesupport.*; import javax.servlet.http.*; import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.IOException; import java.net.Socket; import java.util.logging.Level; public class CWE78_OS_Command_Injection__connect_tcp_42 extends AbstractTestCase { private String badSource() throws Throwable { String data; data = ""; /* Initialize data */ /* Read data using an outbound tcp connection */ { Socket socket = null; BufferedReader readerBuffered = null; InputStreamReader readerInputStream = null; try { /* Read data using an outbound tcp connection */ socket = new Socket("host.example.org", 39544); /* read input from socket */ readerInputStream = new InputStreamReader(socket.getInputStream(), "UTF-8"); readerBuffered = new BufferedReader(readerInputStream); /* POTENTIAL FLAW: Read data using an outbound tcp connection */ data = readerBuffered.readLine(); } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error with stream reading", exceptIO); } finally { /* clean up stream reading objects */ try { if (readerBuffered != null) { readerBuffered.close(); } } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error closing BufferedReader", exceptIO); } try { if (readerInputStream != null) { readerInputStream.close(); } } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error closing InputStreamReader", exceptIO); } /* clean up socket objects */ try { if (socket != null) { socket.close(); } } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error closing Socket", exceptIO); } } } return data; } /* use badsource and badsink */ public void bad() throws Throwable { String data = badSource(); String osCommand; if(System.getProperty("os.name").toLowerCase().indexOf("win") >= 0) { /* running on Windows */ osCommand = "c:\\WINDOWS\\SYSTEM32\\cmd.exe /c dir "; } else { /* running on non-Windows */ osCommand = "/bin/ls "; } /* POTENTIAL FLAW: command injection */ Process process = Runtime.getRuntime().exec(osCommand + data); process.waitFor(); } private String goodG2BSource() throws Throwable { String data; /* FIX: Use a hardcoded string */ data = "foo"; return data; } /* goodG2B() - use goodsource and badsink */ private void goodG2B() throws Throwable { String data = goodG2BSource(); String osCommand; if(System.getProperty("os.name").toLowerCase().indexOf("win") >= 0) { /* running on Windows */ osCommand = "c:\\WINDOWS\\SYSTEM32\\cmd.exe /c dir "; } else { /* running on non-Windows */ osCommand = "/bin/ls "; } /* POTENTIAL FLAW: command injection */ Process process = Runtime.getRuntime().exec(osCommand + data); process.waitFor(); } public void good() throws Throwable { goodG2B(); } /* Below is the main(). It is only used when building this testcase on * its own for testing or for building a binary to use in testing binary * analysis tools. It is not used when compiling all the testcases as one * application, which is how source code analysis tools are tested. */ public static void main(String[] args) throws ClassNotFoundException, InstantiationException, IllegalAccessException { mainFromParent(args); } }
[ "bqcuong2212@gmail.com" ]
bqcuong2212@gmail.com
4165aabf233f2ce0aa4a1afd636bee1ba2abfaa0
d86053c35c1d1b7a91cd4debaeabca9815b50dd3
/Samite/src/main/java/com/cmcc/slience/datastructures/queue/CircleQueue.java
311348f927195bd00487a07b2ff7b9f3427611ea
[]
no_license
zrbsprite/Git
63bc7cae4e0d3a38bc5c9fe4926e0c29d3eaff55
5755433a67e209f60cd5d0228ab8f6f194b46734
refs/heads/master
2020-04-12T09:42:19.081830
2017-05-09T07:06:29
2017-05-09T07:06:29
32,311,426
0
0
null
null
null
null
UTF-8
Java
false
false
2,309
java
package com.cmcc.slience.datastructures.queue; import java.security.InvalidParameterException; /**描述:循环队列<br> * 作者:ZRB <br> * 修改日期:2016年11月14日下午3:39:43 <br> * @param <T> */ public class CircleQueue<T> implements Queue<T> { private final int defaultSize = 10; private int head = 0; private int tail = 0; private Object[] array; private int capacity = 0; public CircleQueue(){ array = new Object[defaultSize]; capacity = defaultSize; } public CircleQueue(int length){ array = new Object[length]; capacity = length; } public CircleQueue(Object[] array){ this.array = array; capacity = array.length; } /**方法名称:push <br> * 描述: <br> * 作者:ZRB <br> * 修改日期:2016年11月14日下午3:39:50 * @see com.cmcc.slience.datastructures.queue.Queue#push(java.lang.Object) * @param object * @return */ @Override public T push(T object) { if(null==object) throw new InvalidParameterException("The parameter is invalid:null"); //如果队列已经满了 if(head == tail && array[tail]!=null) throw new IndexOutOfBoundsException("The queue is full"); array[tail++] = object; tail = tail == capacity?0:tail; return object; } /**方法名称:pop <br> * 描述: <br> * 作者:ZRB <br> * 修改日期:2016年11月14日下午3:39:50 * @see com.cmcc.slience.datastructures.queue.Queue#pop() * @return */ @SuppressWarnings("unchecked") @Override public T pop() { if(isEmpty()) throw new IndexOutOfBoundsException("The queue is empty"); T element = (T) array[head]; array[head++] = null; head = head==capacity?0:head; return element; } /**方法名称:size <br> * 描述: <br> * 作者:ZRB <br> * 修改日期:2016年11月14日下午3:39:50 * @see com.cmcc.slience.datastructures.queue.Queue#size() * @return */ @Override public int size() { if(isEmpty()) return 0; return tail>head?tail-head:capacity-(head-tail); } /**方法名称:isEmpty <br> * 描述: <br> * 作者:ZRB <br> * 修改日期:2016年11月14日下午3:39:50 * @see com.cmcc.slience.datastructures.queue.Queue#isEmpty() * @return */ @Override public boolean isEmpty() { return head==tail && null==array[tail]; } }
[ "zhangribo@sina.cn" ]
zhangribo@sina.cn
2cf68af8b72c9096a678fde5011f50ee226a54f8
7cc9b6dc95111622c6e7ec0060c9e4f7e11c6d4b
/src/main/java/xbl/bagprg/Prg.java
b13cdf6b44df24f6fa2fcafcdc9c5f89640de481
[]
no_license
zzx-ann/mr_example
a83a08bdd90d744f635a4df531c92afef5a395b5
db5af6533fc40f1246498c4eb7da0919f192aeff
refs/heads/master
2020-03-10T22:16:35.014286
2018-05-18T06:54:08
2018-05-18T06:54:08
129,615,596
0
0
null
null
null
null
UTF-8
Java
false
false
1,323
java
package xbl.bagprg; import java.io.DataInput; import java.io.DataOutput; import java.io.IOException; import org.apache.hadoop.io.Text; import org.apache.hadoop.io.Writable; public class Prg implements Writable { private Text info; //private int Sum; private Text uid; private int Sum; private String ip; public Text getInfo() { return info; } public void setInfo(Text info) { this.info = info; } public int getSum() { return Sum; } public void setSum(int Sum) { this.Sum = Sum;} public Text getuid() { return uid; } public void setuid(Text uid) { this.uid = uid;} public String getIp() { return ip; } public void setIp(String ip) { this.ip = ip;} public void readFields(DataInput in) throws IOException { this.info = new Text(in.readUTF()); this.uid = new Text(in.readUTF()); Sum = in.readInt(); ip = in.readUTF(); } public void write(DataOutput out) throws IOException { out.writeUTF(info.toString()); out.writeUTF(uid.toString()); out.writeInt(Sum); out.writeUTF(ip); } /*mr 输出到文件的的时候调用*/ @Override public String toString() { return info.toString() + "\t" + uid.toString() + "\t" + Sum + "\t ip=" + ip; } }
[ "you@example.com" ]
you@example.com
13e12f50de23d7af35fa049fb274cc57abd33eba
61e3ff6d34297cf444e5749c1e1d7ed5ba93cecd
/com/nubia/camera/common/Native/PrettyWaterMarkEffect.java
cf8361ee480f6a59d3c97ea72ff60d527c1e4238
[]
no_license
BeYkeRYkt/nubia_cam_smali
b49beafe60b989fab02753601735e493f2f72d16
39dad22d05b0a2dfd4e9d04acad9673ac1add410
refs/heads/master
2020-03-17T18:31:12.851246
2018-05-17T15:24:14
2018-05-17T15:24:14
133,825,725
2
0
null
null
null
null
UTF-8
Java
false
false
717
java
package com.nubia.camera.common.Native; import java.nio.ByteBuffer; public class PrettyWaterMarkEffect { public static native void nativeAddWaterMark(ByteBuffer byteBuffer, int i, int i2, int i3, int i4); public static native void nativeApplyPrettyEffect(ByteBuffer byteBuffer, int i, int i2, int i3, int i4, int i5); static { System.loadLibrary("PrettyWaterMark"); } public static void btK(BufferCell bufferCell, int i, int i2, int i3, int i4, int i5) { nativeApplyPrettyEffect(bufferCell.btE(), i, i2, i3, i4, i5); } public static void btL(BufferCell bufferCell, int i, int i2, int i3, int i4) { nativeAddWaterMark(bufferCell.btE(), i, i2, i3, i4); } }
[ "beykerykt@gmail.com" ]
beykerykt@gmail.com
1f0ca5b34871adcfaf6f9559abb922d232747be1
9b294c3bf262770e9bac252b018f4b6e9412e3ee
/camerazadas/source/apk/com.sonyericsson.android.camera/src-cfr/com/google/android/gms/internal/ob.java
602820a15585289de941c3852ff0493af91829d8
[]
no_license
h265/camera
2c00f767002fd7dbb64ef4dc15ff667e493cd937
77b986a60f99c3909638a746c0ef62cca38e4235
refs/heads/master
2020-12-30T22:09:17.331958
2015-08-25T01:22:25
2015-08-25T01:22:25
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,084
java
/* * Decompiled with CFR 0_100. */ package com.google.android.gms.internal; import android.os.Parcel; import android.os.Parcelable; import com.google.android.gms.common.internal.safeparcel.a; import com.google.android.gms.common.internal.safeparcel.b; import com.google.android.gms.internal.nz; import java.util.HashSet; import java.util.Set; public class ob implements Parcelable.Creator<nz.a> { static void a(nz.a a, Parcel parcel, int n) { n = b.D(parcel); Set<Integer> set = a.amc; if (set.contains(1)) { b.c(parcel, 1, a.BR); } if (set.contains(2)) { b.c(parcel, 2, a.ant); } if (set.contains(3)) { b.c(parcel, 3, a.anu); } b.H(parcel, n); } @Override public /* synthetic */ Object createFromParcel(Parcel parcel) { return this.de(parcel); } public nz.a de(Parcel parcel) { int n = 0; int n2 = a.C(parcel); HashSet<Integer> hashSet = new HashSet<Integer>(); int n3 = 0; int n4 = 0; block5 : while (parcel.dataPosition() < n2) { int n5 = a.B(parcel); switch (a.aD(n5)) { default: { a.b(parcel, n5); continue block5; } case 1: { n4 = a.g(parcel, n5); hashSet.add(1); continue block5; } case 2: { n3 = a.g(parcel, n5); hashSet.add(2); continue block5; } case 3: } n = a.g(parcel, n5); hashSet.add(3); } if (parcel.dataPosition() != n2) { throw new a.a("Overread allowed size end=" + n2, parcel); } return new nz.a(hashSet, n4, n3, n); } public nz.a[] eW(int n) { return new nz.a[n]; } @Override public /* synthetic */ Object[] newArray(int n) { return this.eW(n); } }
[ "jmrm@ua.pt" ]
jmrm@ua.pt
b2afbf9884873350c6f37eeaf7a65cfde4a574eb
95b04aa8628883558f9612e32dddf7219d9809de
/core/common/src/test/java/org/onosproject/codec/impl/ApplicationIdCodecTest.java
b246939994d780552531fd064a6667881a6c818d
[ "Apache-2.0" ]
permissive
lsinfo3/nms-aware-onos
fb27413064dfc748e1c526e6c057805d0d5575d1
bae0eeb10d6ae7559e0996535308039e9f0bc3c1
refs/heads/master
2021-09-04T03:28:29.001190
2016-11-30T06:29:48
2016-12-02T09:45:13
104,461,102
0
2
Apache-2.0
2017-12-12T08:09:49
2017-09-22T10:10:55
Java
UTF-8
Java
false
false
4,538
java
/* * Copyright 2016-present Open Networking Laboratory * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.onosproject.codec.impl; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.ObjectNode; import org.hamcrest.Description; import org.hamcrest.TypeSafeDiagnosingMatcher; import org.junit.Before; import org.junit.Test; import org.onosproject.codec.JsonCodec; import org.onosproject.core.ApplicationId; import org.onosproject.core.DefaultApplicationId; import java.io.IOException; import java.io.InputStream; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.notNullValue; /** * Unit tests for ApplicationId codec. */ public final class ApplicationIdCodecTest { MockCodecContext context; JsonCodec<ApplicationId> applicationIdCodec; /** * Sets up for each test. Creates a context and fetches the applicationId * codec. */ @Before public void setUp() { context = new MockCodecContext(); applicationIdCodec = context.codec(ApplicationId.class); assertThat(applicationIdCodec, notNullValue()); } /** * Tests encoding of an application id object. */ @Test public void testApplicationIdEncode() { int id = 1; String name = "org.onosproject.foo"; ApplicationId appId = new DefaultApplicationId(id, name); ObjectNode applicationIdJson = applicationIdCodec.encode(appId, context); assertThat(applicationIdJson, ApplicationIdJsonMatcher.matchesApplicationId(appId)); } /** * Tests decoding of an application id object. */ @Test public void testApplicationIdDecode() throws IOException { ApplicationId appId = getApplicationId("ApplicationId.json"); assertThat((int) appId.id(), is(1)); assertThat(appId.name(), is("org.onosproject.foo")); } private static final class ApplicationIdJsonMatcher extends TypeSafeDiagnosingMatcher<JsonNode> { private final ApplicationId applicationId; private ApplicationIdJsonMatcher(ApplicationId applicationId) { this.applicationId = applicationId; } @Override protected boolean matchesSafely(JsonNode jsonNode, Description description) { // check application role int jsonAppId = jsonNode.get("id").asInt(); int appId = applicationId.id(); if (jsonAppId != appId) { description.appendText("application ID was " + jsonAppId); return false; } String jsonAppName = jsonNode.get("name").asText(); String appName = applicationId.name(); if (!jsonAppName.equals(appName)) { description.appendText("application name was " + jsonAppName); return false; } return true; } @Override public void describeTo(Description description) { description.appendText(applicationId.toString()); } static ApplicationIdJsonMatcher matchesApplicationId(ApplicationId applicationId) { return new ApplicationIdJsonMatcher(applicationId); } } /** * Reads in a application id from the given resource and decodes it. * * @param resourceName resource to use to read the JSON for the rule * @return decoded application id * @throws IOException if processing the resource fails */ private ApplicationId getApplicationId(String resourceName) throws IOException { InputStream jsonStream = ApplicationIdCodecTest.class.getResourceAsStream(resourceName); JsonNode json = context.mapper().readTree(jsonStream); assertThat(json, notNullValue()); ApplicationId applicationId = applicationIdCodec.decode((ObjectNode) json, context); assertThat(applicationId, notNullValue()); return applicationId; } }
[ "gerrit@onlab.us" ]
gerrit@onlab.us
b17e70c93b1e3d73a8a8b8f358cf6e868a6760be
b47489e86b1779013a98b18eb8430030dd7afb83
/spring3.x/chapter3/src/com/baobaotao/Car.java
9978b894039601fb8de98fbdd5c8fb2cd4681b1c
[ "Apache-2.0" ]
permissive
cuiyuemin365/books
66be7059d309745a8045426fc193439b95a288e4
4ffdd959b4fc894f085ee5e80031ff8f77d475e6
refs/heads/master
2023-01-09T19:30:48.718134
2021-04-08T07:52:00
2021-04-08T07:52:00
120,096,744
0
0
Apache-2.0
2023-01-02T21:56:51
2018-02-03T14:08:45
Java
UTF-8
Java
false
false
2,247
java
package com.baobaotao; import org.springframework.beans.BeansException; import org.springframework.beans.factory.BeanFactory; import org.springframework.beans.factory.BeanFactoryAware; import org.springframework.beans.factory.BeanNameAware; import org.springframework.beans.factory.DisposableBean; import org.springframework.beans.factory.InitializingBean; public class Car implements BeanFactoryAware, BeanNameAware, InitializingBean, DisposableBean { private String brand; private String color; private int maxSpeed; private String name; private BeanFactory beanFactory; private String beanName; public Car() { System.out.println("调用Car()构造函数。"); } public String getBrand() { return brand; } public void setBrand(String brand) { System.out.println("调用setBrand()设置属性。"); this.brand = brand; } public String getColor() { return color; } public String toString() { return "brand:" + brand + "/color:" + color + "/maxSpeed:"+ maxSpeed; } public void setColor(String color) { this.color = color; } public int getMaxSpeed() { return maxSpeed; } public void setMaxSpeed(int maxSpeed) { this.maxSpeed = maxSpeed; } public void introduce(){ System.out.println("introduce:"+this.toString()); } // BeanFactoryAware接口方法 public void setBeanFactory(BeanFactory beanFactory) throws BeansException { System.out.println("调用BeanFactoryAware.setBeanFactory()。"); this.beanFactory = beanFactory; } // BeanNameAware接口方法 public void setBeanName(String beanName) { System.out.println("调用BeanNameAware.setBeanName()。"); this.beanName = beanName; } // InitializingBean接口方法 public void afterPropertiesSet() throws Exception { System.out.println("调用InitializingBean.afterPropertiesSet()。"); } // DisposableBean接口方法 public void destroy() throws Exception { System.out.println("调用DisposableBean.destory()。"); } public void myInit() { System.out.println("调用myInit(),将maxSpeed设置为240。"); this.maxSpeed = 240; } public void myDestory() { System.out.println("调用myDestroy()。"); } }
[ "cuiyuemin@mofanghr.com" ]
cuiyuemin@mofanghr.com
b6dc101f396b3f69c14441c8eebe1981d848539b
ae5eb1a38b4d22c82dfd67c86db73592094edc4b
/project249/src/main/java/org/gradle/test/performance/largejavamultiproject/project249/p1248/Production24965.java
f08bdaacfd7ad548a53d6adf2ea36ee1127d2569
[]
no_license
big-guy/largeJavaMultiProject
405cc7f55301e1fd87cee5878a165ec5d4a071aa
1cd6a3f9c59e9b13dffa35ad27d911114f253c33
refs/heads/main
2023-03-17T10:59:53.226128
2021-03-04T01:01:39
2021-03-04T01:01:39
344,307,977
0
0
null
null
null
null
UTF-8
Java
false
false
2,417
java
package org.gradle.test.performance.largejavamultiproject.project249.p1248; import org.gradle.test.performance.largejavamultiproject.project249.p1247.Production24956; import org.gradle.test.performance.largejavamultiproject.project246.p1233.Production24665; import org.gradle.test.performance.largejavamultiproject.project247.p1238.Production24765; import org.gradle.test.performance.largejavamultiproject.project248.p1243.Production24865; public class Production24965 { private Production24956 property0; public Production24956 getProperty0() { return property0; } public void setProperty0(Production24956 value) { property0 = value; } private Production24960 property1; public Production24960 getProperty1() { return property1; } public void setProperty1(Production24960 value) { property1 = value; } private Production24964 property2; public Production24964 getProperty2() { return property2; } public void setProperty2(Production24964 value) { property2 = value; } private Production24665 property3; public Production24665 getProperty3() { return property3; } public void setProperty3(Production24665 value) { property3 = value; } private Production24765 property4; public Production24765 getProperty4() { return property4; } public void setProperty4(Production24765 value) { property4 = value; } private Production24865 property5; public Production24865 getProperty5() { return property5; } public void setProperty5(Production24865 value) { property5 = value; } private String property6; public String getProperty6() { return property6; } public void setProperty6(String value) { property6 = value; } private String property7; public String getProperty7() { return property7; } public void setProperty7(String value) { property7 = value; } private String property8; public String getProperty8() { return property8; } public void setProperty8(String value) { property8 = value; } private String property9; public String getProperty9() { return property9; } public void setProperty9(String value) { property9 = value; } }
[ "sterling.greene@gmail.com" ]
sterling.greene@gmail.com
d7d82d74e7e78b21c4afd7a33bcf9feaae6b9fa1
e0ff915d168b6858f6a720286ec35e8b137a3daa
/springAop/src/main/java/com/xiaojihua/domain/UserForDtdlImpl.java
7571e09eae4cbfbd743f645fb8c73fea301253fb
[]
no_license
githubxiaojihua/javaweb
278f98da5cd49519bed9af312d96b987395cdb00
8dd9467fb82f70b0eb079121a3bdd7b61236cda1
refs/heads/master
2022-12-01T13:27:26.917172
2020-08-25T02:49:08
2020-08-25T02:49:08
199,839,403
0
0
null
2022-11-24T10:17:59
2019-07-31T11:04:36
Java
UTF-8
Java
false
false
502
java
package com.xiaojihua.domain; public class UserForDtdlImpl implements UserForDtdl { @Override public void save() { System.out.println("普通的保存方法..."); } @Override public void delete() { System.out.println("普通的删除方法..."); } @Override public void update() { System.out.println("普通的修改方法..."); } @Override public void find() { System.out.println("普通的查询方法..."); } }
[ "2542213767@qq.com" ]
2542213767@qq.com
3193e21ebf08b8747bca90d2aac185f8de87e71d
dafdbbb0234b1f423970776259c985e6b571401f
/allbinary_src/BlisketVOJavaLibraryM/src/main/java/allbinary/logic/control/contraints/size/TwoDimensionalConstraintInterface.java
bd46707a764565bfa2376bd290e98b522f1da296
[ "LicenseRef-scancode-warranty-disclaimer" ]
no_license
biddyweb/AllBinary-Platform
3581664e8613592b64f20fc3f688dc1515d646ae
9b61bc529b0a5e2c647aa1b7ba59b6386f7900ad
refs/heads/master
2020-12-03T10:38:18.654527
2013-11-17T11:17:35
2013-11-17T11:17:35
null
0
0
null
null
null
null
UTF-8
Java
false
false
778
java
/* * AllBinary Open License Version 1 * Copyright (c) 2011 AllBinary * * By agreeing to this license you and any business entity you represent are * legally bound to the AllBinary Open License Version 1 legal agreement. * * You may obtain the AllBinary Open License Version 1 legal agreement from * AllBinary or the root directory of AllBinary's AllBinary Platform repository. * * Created By: Travis Berthelot * */ package allbinary.logic.control.contraints.size; public interface TwoDimensionalConstraintInterface { public SizeConstraintInterface getHeight(); public SizeConstraintInterface getWidth(); public void setHeight(SizeConstraintInterface heightSizeConstraintInterface); public void setWidth(SizeConstraintInterface widthSizeConstraintInterface); }
[ "travisberthelot@hotmail.com" ]
travisberthelot@hotmail.com
c823547a2cf1e827c216e1f46aa0f8b84b9c6ff4
1942e3fdb6aff9634da3af7b3191c2dec36a7446
/app/src/main/java/dto/DepartmentDto.java
c3c0571de0473dacc899fc14ab7fe9473cbf4996
[]
no_license
OldMonsters/Schoolsecond
85f6bb263bac69c33cf67225da8da127719cc8d5
4c546782c2390600020079f26c6d29492c9debc5
refs/heads/master
2020-05-09T14:43:30.427381
2019-04-13T17:23:51
2019-04-13T17:23:51
181,205,417
0
0
null
null
null
null
UTF-8
Java
false
false
439
java
package dto; public class DepartmentDto { private String departmentName; public String getDepartmentName() { return departmentName; } public void setDepartmentName(String departmentName) { this.departmentName = departmentName; } @Override public String toString() { return "DepartmentDto{" + "departmentName='" + departmentName + '\'' + '}'; } }
[ "you@example.com" ]
you@example.com
896f57aba851ca415a829d1e208b246688911c23
6fa72addb13e601f7babdc4aa5f2dd76eead5a03
/session/src/mall/TechBooksPage.java
a4a6049360fe105fcd63068b464fd378d73bbac3
[]
no_license
KronosOceanus/servlet_jsp
f0c019d1e5d814505632566e9abf0856a3178bce
16c89d105a61d5500d5b11590dd9bc8833ca4308
refs/heads/master
2020-05-22T02:26:23.630946
2019-10-27T06:36:50
2019-10-27T06:36:50
186,197,231
2
0
null
null
null
null
UTF-8
Java
false
false
270
java
package mall; /** * 该页面展示老师书籍产品 */ public class TechBooksPage extends CatalogPage { public void init(){ String[] ids = {"id_5", "id_6", "id_7","id_8"}; setItems(ids); setTitle("All-Time Best Computer Books"); } }
[ "704690152@qq.com" ]
704690152@qq.com
c403ef92d48510f957d12a76142db53249a28bf0
329b967bb8e341000cd7cb36799ea0bab3b4fd57
/test/src/main/java/cn/test/lms/controller/PageController.java
e4dc88f89f4f845586616465c1982112b1c00d4e
[]
no_license
zhouwenbin00/Library-Management-System
f4e18d6fb1e73c6566c23bf369aae10c7573bfc4
1adab36d7d7ea5b59a529d162ff63f0fde92af5b
refs/heads/master
2020-04-24T12:48:26.767700
2019-02-27T10:57:32
2019-02-27T10:57:32
171,967,057
1
0
null
null
null
null
UTF-8
Java
false
false
2,208
java
package cn.test.lms.controller; import cn.test.lms.bean.Result; import cn.test.lms.bean.TbUser; import cn.test.lms.service.UserService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.servlet.ModelAndView; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import java.io.IOException; @Controller public class PageController { @Autowired private UserService service; @RequestMapping("/") public String showIndex(){ return "index"; } @RequestMapping("/{page}") public String showPage(@PathVariable String page) { return page; } @RequestMapping("toLogin") @ResponseBody public Result login(String username , String password, String remember,HttpServletRequest request,HttpServletResponse response) { TbUser user = service.login(username, password); if (user!=null){ if (remember.equals("on")){ String loginInfo = username + "," + password; Cookie userCookie = new Cookie("loginInfo",loginInfo); userCookie.setMaxAge(7 * 24 * 60 * 60); // 存活期为7天 userCookie.setPath("/"); response.addCookie(userCookie); } HttpSession session = request.getSession(); session.setAttribute("user",user); return Result.ok(); }else { return new Result(100,"登陆失败"); } } @RequestMapping("outLogin") @ResponseBody public void login(HttpServletRequest request,HttpServletResponse response) throws IOException { request.getSession().removeAttribute("user"); request.getSession().invalidate(); response.sendRedirect("login"); } }
[ "2825075112@qq.com" ]
2825075112@qq.com
7a1fe8ceff7037d498da86a296aeadd9099e8535
ed5159d056e98d6715357d0d14a9b3f20b764f89
/src/irvine/oeis/a150/A150821.java
fc970b852f22373c465c5638b5b5529235565650
[]
no_license
flywind2/joeis
c5753169cf562939b04dd246f8a2958e97f74558
e5efd6971a0062ac99f4fae21a7c78c9f9e74fea
refs/heads/master
2020-09-13T18:34:35.080552
2019-11-19T05:40:55
2019-11-19T05:40:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
586
java
package irvine.oeis.a150; // Generated by gen_seq4.pl walk23 3 5 1 220211102100111 at 2019-07-08 22:06 // DO NOT EDIT here! import irvine.oeis.WalkCubeSequence; /** * A150821 Number of walks within <code>N^3</code> (the first octant of <code>Z^3)</code> starting at <code>(0,0,0)</code> and consisting of n steps taken from <code>{(-1, -1, 0), (-1, 1, 1), (1, 0, -1), (1, 0, 0), (1, 1, 1)}</code>. * @author Georg Fischer */ public class A150821 extends WalkCubeSequence { /** Construct the sequence. */ public A150821() { super(0, 3, 5, "", 1, "220211102100111"); } }
[ "sairvin@gmail.com" ]
sairvin@gmail.com
946afbaa5840ee12d78348dba045d918a9bb92a0
cdc4c07cc87c88ccca9585a40a3600ce92c5e147
/ssia-ch5-ex4/src/main/java/uk/me/uohiro/ssia/handlers/CustomAuthenticationSuccessHandler.java
fedc1323f59871011d6f51cbea724c4e2d8b4b53
[]
no_license
osakanaya/Spring-Security-in-Action
ec587d617092747bb7f347161d3115bc6b14c3f3
968af23e16d7469216777c0924c259f6bbea716d
refs/heads/main
2023-03-14T12:52:55.367766
2021-03-08T14:01:57
2021-03-08T14:01:57
345,674,746
2
1
null
null
null
null
UTF-8
Java
false
false
1,160
java
package uk.me.uohiro.ssia.handlers; import java.io.IOException; import java.util.Collection; import java.util.Optional; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.springframework.security.core.Authentication; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.web.authentication.AuthenticationSuccessHandler; import org.springframework.stereotype.Component; @Component public class CustomAuthenticationSuccessHandler implements AuthenticationSuccessHandler { @Override public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws IOException, ServletException { Collection<? extends GrantedAuthority> authorities = authentication.getAuthorities(); Optional<? extends GrantedAuthority> auth = authorities.stream().filter(a -> a.getAuthority().equals("read")).findFirst(); if (auth.isPresent()) { response.sendRedirect("/read"); } else { response.sendRedirect("/none"); } } }
[ "sashida@primagest.co.jp" ]
sashida@primagest.co.jp
063e2d49fa6ba8b1a5d34a2c6cfc9f0f509e86b3
0175a417f4b12b80cc79edbcd5b7a83621ee97e5
/flexodesktop/model/flexoutils/src/main/java/org/openflexo/letparser/BooleanValue.java
fdb2afbb46693d9659e4902b6959d61350816b2d
[]
no_license
agilebirds/openflexo
c1ea42996887a4a171e81ddbd55c7c1e857cbad0
0250fc1061e7ae86c9d51a6f385878df915db20b
refs/heads/master
2022-08-06T05:42:04.617144
2013-05-24T13:15:58
2013-05-24T13:15:58
2,372,131
11
6
null
2022-07-06T19:59:55
2011-09-12T15:44:45
Java
UTF-8
Java
false
false
1,483
java
/* * (c) Copyright 2010-2011 AgileBirds * * This file is part of OpenFlexo. * * OpenFlexo is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * OpenFlexo 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 OpenFlexo. If not, see <http://www.gnu.org/licenses/>. * */ package org.openflexo.letparser; public class BooleanValue extends Value { private boolean _value; public BooleanValue(boolean value) { super(); _value = value; } public boolean getBooleanValue() { return _value; } @Override public String toString() { return getPrefix() + "Bool[" + _value + "]"; } @Override public String getStringValue() { return String.valueOf(_value); } @Override public String getSerializationValue() { return "$" + getStringValue(); } @Override public int hashCode() { return Boolean.valueOf(_value).hashCode(); } @Override public boolean equals(Object obj) { if (obj instanceof BooleanValue) { return getBooleanValue() == ((BooleanValue) obj).getBooleanValue(); } return false; } }
[ "guillaume.polet@gmail.com" ]
guillaume.polet@gmail.com
a1c194841061db934af22a4af2ac21d315ccb036
3f87df2a878de64eccdcac22bb09b8944ba06fd4
/java/spring/unofficial/chariotsolutions/back-end/src/main/java/com/heroes/model/security/AuthorityName.java
28b052942d4018c61860e8891a40d2b5503129c1
[]
no_license
juncevich/workshop
621d1262a616ea4664198338b712898af9e61a76
fbaeecfb399be65a315c60d0aa24ecae4067918d
refs/heads/master
2023-04-30T14:53:43.154005
2023-04-15T17:26:53
2023-04-15T17:26:53
78,441,425
0
0
null
2023-03-28T20:52:35
2017-01-09T15:27:29
JavaScript
UTF-8
Java
false
false
137
java
package com.heroes.model.security; /** * Created by juncevich on 30.04.17. */ public enum AuthorityName { ROLE_USER, ROLE_ADMIN }
[ "a.juncevich@gmail.com" ]
a.juncevich@gmail.com
6c7174ea5cb76d466a7b9c5c4d860dc01cdd1bda
be609a4c07073521cd84c09ef242690cf45a583d
/schedule-console/src/main/java/com/asiainfo/monitor/busi/service/interfaces/IAIMonMemoSV.java
851ec204c96787467f1213e9e29fcd12ecaed002
[ "Apache-2.0" ]
permissive
zhengpeng2006/aischedule
23d852ae656f0674684fec39c393c7b1f67af931
5ff3138b8efb6f7c6f365dcdf34fc3d40400877b
refs/heads/master
2020-04-23T01:32:47.970514
2019-01-10T08:45:45
2019-01-10T08:45:45
170,816,132
0
1
Apache-2.0
2019-02-15T06:52:34
2019-02-15T06:52:32
null
UTF-8
Java
false
false
614
java
package com.asiainfo.monitor.busi.service.interfaces; import java.rmi.RemoteException; import com.asiainfo.monitor.exeframe.config.ivalues.IBOAIMonMemoValue; public interface IAIMonMemoSV { /** * 根据条件取得备忘录信息 * @param startDate * @param endDate * @return * @throws RemoteException * @throws Exception */ public IBOAIMonMemoValue[] getMemoByCond(String startDate, String endDate) throws RemoteException,Exception; /** * 保存备忘录 * * @param value * @throws Exception */ public void saveMemo(IBOAIMonMemoValue value) throws RemoteException,Exception; }
[ "wangfeng3@asiainfo.com" ]
wangfeng3@asiainfo.com
65515ad72bb4eda2753a38259b6425241ebea2ff
0d97f915c252dc6b28b7504f3b48d618be32bcf2
/app/src/main/java/com/endpoint/golden_bench/activities_fragments/activity_home_player/fragments/fragment_bench/fragments/FragmentAgents.java
bc21200383ee21b3d12e6127464c86e2b89b662e
[]
no_license
freelanceapp/Golden_Bench
5e0f1ce422c6fcf33e895da810aee8374766d11c
5b9662e1ecce24389e7b5a786fec5c0373ae7433
refs/heads/master
2022-07-04T18:40:29.493635
2020-05-06T13:05:13
2020-05-06T13:05:13
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,924
java
package com.endpoint.golden_bench.activities_fragments.activity_home_player.fragments.fragment_bench.fragments; import android.graphics.PorterDuff; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.core.content.ContextCompat; import androidx.databinding.DataBindingUtil; import androidx.fragment.app.Fragment; import androidx.recyclerview.widget.LinearLayoutManager; import com.endpoint.golden_bench.R; import com.endpoint.golden_bench.activities_fragments.activity_home_player.HomeplayerActivity; import com.endpoint.golden_bench.adapter.Agent_Adapter; import com.endpoint.golden_bench.databinding.FragmentOrdersBinding; import com.endpoint.golden_bench.models.MarketCatogryModel; import com.endpoint.golden_bench.preferences.Preferences; import java.util.ArrayList; import java.util.List; import java.util.Locale; import io.paperdb.Paper; public class FragmentAgents extends Fragment { private HomeplayerActivity activity; private FragmentOrdersBinding binding; private Preferences preferences; private String lang; private List<MarketCatogryModel.Data> dataList; private Agent_Adapter categorys_adapter; public static FragmentAgents newInstance() { return new FragmentAgents(); } @Nullable @Override public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { binding = DataBindingUtil.inflate(inflater, R.layout.fragment_orders,container,false); initView(); return binding.getRoot(); } private void initView() { dataList = new ArrayList<>(); preferences = Preferences.getInstance(); activity = (HomeplayerActivity) getActivity(); Paper.init(activity); lang = Paper.book().read("lang", Locale.getDefault().getLanguage()); categorys_adapter = new Agent_Adapter(dataList, activity); binding.recView.setLayoutManager(new LinearLayoutManager(activity)); binding.recView.setAdapter(categorys_adapter); binding.progBar.getIndeterminateDrawable().setColorFilter(ContextCompat.getColor(activity, R.color.colorPrimary), PorterDuff.Mode.SRC_IN); binding.progBar.setVisibility(View.GONE); Adddata(); } private void Adddata() { dataList.add(new MarketCatogryModel.Data()); dataList.add(new MarketCatogryModel.Data()); dataList.add(new MarketCatogryModel.Data()); dataList.add(new MarketCatogryModel.Data()); dataList.add(new MarketCatogryModel.Data()); dataList.add(new MarketCatogryModel.Data()); dataList.add(new MarketCatogryModel.Data()); dataList.add(new MarketCatogryModel.Data()); categorys_adapter.notifyDataSetChanged(); } }
[ "ahmedmohamed23345@gmail.com" ]
ahmedmohamed23345@gmail.com
25a2deb4f0d42f541a83a4d81d442d3a61969612
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/12/12_7091e41b99659ee2b3da42f125044f7dc5d17236/Alert/12_7091e41b99659ee2b3da42f125044f7dc5d17236_Alert_t.java
ee39e7cab293ca8c0ee9cea74f8447bebb09cca2
[]
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
2,728
java
/* * Copyright (c) 2012-2013 Malhar, Inc. * All Rights Reserved. */ package com.malhartech.lib.util; import com.malhartech.annotation.InputPortFieldAnnotation; import com.malhartech.annotation.OutputPortFieldAnnotation; import com.malhartech.api.BaseOperator; import com.malhartech.api.DefaultInputPort; import com.malhartech.api.DefaultOutputPort; /** * * @author David Yan <davidyan@malhar-inc.com> */ public class Alert<T> extends BaseOperator { protected long lastAlertTimeStamp = -1; protected long inAlertSince = -1; protected long lastTupleTimeStamp = -1; protected long timeout = 5000; // 5 seconds protected long alertFrequency = 0; protected long levelOneTimeStamp = 0; protected long levelTwoTimeStamp = 0; protected long levelThreeTimeStamp = 0; @InputPortFieldAnnotation(name = "in", optional = false) public final transient DefaultInputPort<T> in = new DefaultInputPort<T>(this) { @Override public void process(T tuple) { long now = System.currentTimeMillis(); if (inAlertSince < 0) { inAlertSince = now; } lastTupleTimeStamp = now; if (lastAlertTimeStamp + alertFrequency < now) { if (inAlertSince >= levelOneTimeStamp) { alert1.emit(tuple); } if (inAlertSince >= levelTwoTimeStamp) { alert2.emit(tuple); } if (inAlertSince >= levelThreeTimeStamp) { alert3.emit(tuple); } lastAlertTimeStamp = now; } } }; @OutputPortFieldAnnotation(name = "alert1", optional = false) public final transient DefaultOutputPort<T> alert1 = new DefaultOutputPort<T>(this); @OutputPortFieldAnnotation(name = "alert2", optional = true) public final transient DefaultOutputPort<T> alert2 = new DefaultOutputPort<T>(this); @OutputPortFieldAnnotation(name = "alert3", optional = true) public final transient DefaultOutputPort<T> alert3 = new DefaultOutputPort<T>(this); public void setAlertFrequency(long millis) { alertFrequency = millis; } public void setLevelOneAlertTimeStamp(long millis) { levelOneTimeStamp = millis; } public void setLevelTwoAlertTimeStamp(long millis) { levelTwoTimeStamp = millis; } public void setLevelThreeAlertTimeStamp(long millis) { levelThreeTimeStamp = millis; } public void setTimeout(long millis) { timeout = millis; } @Override public void endWindow() { checkTimeout(); } protected void checkTimeout() { if (System.currentTimeMillis() - lastTupleTimeStamp > timeout) { inAlertSince = -1; lastAlertTimeStamp = -1; } } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
5c49042db70add997685cb61fad1d8d6d9a56955
ab950cdc8e59165e341c838053c4811caf30eec8
/jOOQ/src/main/java/org/jooq/impl/TrueCondition.java
33b9310050842a9f67246675fcaf9061b37a5385
[ "Apache-2.0" ]
permissive
cdalexndr/jOOQ
12e408df7d9ce9393f506120d5d69a8154f4419c
b91e9235b30d07db4091583e30e21198f5d919c7
refs/heads/main
2023-08-12T12:57:52.911066
2021-09-29T15:59:01
2021-09-29T15:59:01
411,799,887
0
0
NOASSERTION
2021-09-29T19:12:38
2021-09-29T19:12:37
null
UTF-8
Java
false
false
2,260
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. * * Other licenses: * ----------------------------------------------------------------------------- * Commercial licenses for this work are available. These replace the above * ASL 2.0 and offer limited warranties, support, maintenance, and commercial * database integrations. * * For more information, please visit: http://www.jooq.org/licenses * * * * * * * * * * * * * * * * */ package org.jooq.impl; import static org.jooq.Clause.CONDITION; import static org.jooq.Clause.CONDITION_COMPARISON; // ... // ... // ... // ... import static org.jooq.SQLDialect.FIREBIRD; // ... // ... // ... // ... // ... // ... // ... // ... import static org.jooq.SQLDialect.SQLITE; // ... // ... // ... // ... import static org.jooq.impl.Keywords.K_TRUE; import java.util.Set; import org.jooq.Clause; import org.jooq.Context; import org.jooq.SQLDialect; import org.jooq.True; import org.jooq.impl.QOM.MTrue; /** * @author Lukas Eder */ final class TrueCondition extends AbstractCondition implements True, MTrue { private static final Clause[] CLAUSES = { CONDITION, CONDITION_COMPARISON }; static final TrueCondition INSTANCE = new TrueCondition(); static final Set<SQLDialect> NO_SUPPORT_BOOLEAN = SQLDialect.supportedBy(FIREBIRD, SQLITE); @Override final boolean isNullable() { return false; } @Override public final void accept(Context<?> ctx) { if (NO_SUPPORT_BOOLEAN.contains(ctx.dialect())) ctx.sql("1 = 1"); else ctx.visit(K_TRUE); } @Override public final Clause[] clauses(Context<?> ctx) { return CLAUSES; } private TrueCondition() {} }
[ "lukas.eder@gmail.com" ]
lukas.eder@gmail.com
acae799c8b8c219e6c55db82a0a9a591783f2540
b1be01d222e2163327b5bb31b94c9a52bec497c5
/src/org/apophysis/variations/ExVariation.java
00b2696286315cd542d6f164d7e344641a15e359
[]
no_license
cleoag/apophysis-j
9cdde1832db49f4d68d3813a5665fd615c15db14
a6f17b3fb3582973f2da641888779b3461889c31
refs/heads/master
2021-01-25T14:11:24.095204
2017-12-31T19:37:52
2017-12-31T19:37:52
123,667,549
1
0
null
2018-03-03T06:50:39
2018-03-03T06:50:39
null
UTF-8
Java
false
false
2,129
java
/* Apophysis-j Copyright (C) 2008 Jean-Francois Bouzereau based on Apophysis ( http://www.apophysis.org ) Apophysis Copyright (C) 2001-2004 Mark Townsend Apophysis Copyright (C) 2005-2006 Ronald Hordijk, Piotr Borys, Peter Sdobnov Apophysis Copyright (C) 2007 Piotr Borys, Peter Sdobnov based on Flam3 ( http://www.flam3.com ) Copyright (C) 1992-2006 Scott Draves <source@flam3.com> it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 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, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ package org.apophysis.variations; import org.apophysis.Variation; import org.apophysis.XForm; public class ExVariation extends Variation { /*****************************************************************************/ @Override public String getName() { return "ex"; } /*****************************************************************************/ @Override public boolean isSheepCompatible() { return true; } /*****************************************************************************/ @Override public boolean needAngle() { return true; } @Override public boolean needLength() { return true; } /*****************************************************************************/ @Override public void compute(XForm xform) { double r = xform.flength; double n0 = Math.sin(xform.fangle + r); double n1 = Math.cos(xform.fangle - r); double m0 = n0 * n0 * n0; double m1 = n1 * n1 * n1; r = r * weight; xform.fpx += r * (m0 + m1); xform.fpy += r * (m0 - m1); } /*****************************************************************************/ } // End of class ExVariation
[ "dbrosius@mebigfatguy.com" ]
dbrosius@mebigfatguy.com
b4c3fb49dd7bd5de9e35dcd03f7438c5d2c9ffb8
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/2/2_928bddefedc2cab7adbcd7fad5dc016b4864ed06/BluetoothList/2_928bddefedc2cab7adbcd7fad5dc016b4864ed06_BluetoothList_s.java
cd63a0092ae9b589e08fac6ba2da4ce4a3da6daa
[]
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
5,352
java
package org.darksoft.android.multimedia.remotecontrol; import org.darksoft.android.lib.widget.ExpandListAdapter; import org.darksoft.android.lib.widget.ExpandListChild; import org.darksoft.android.lib.widget.ExpandListGroup; import java.util.ArrayList; import java.util.Iterator; import java.util.Set; import android.os.Bundle; import android.app.Activity; import android.bluetooth.BluetoothDevice; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.ExpandableListView; /** * A {@link android.app.Activity Activity} used for get a list of paired and discovered * Bluetooth Devices. Only call it by a Intent. * * @author Joel Pelaez Jorge * */ public class BluetoothList extends Activity implements ExpandableListView.OnChildClickListener{ @SuppressWarnings("unused") private final int BOUNDED_DEVICE_GROUP = 0; private final int DISCOVER_DEVICE_GROUP = 1; private ExpandListAdapter mAdapter; private ExpandableListView mDeviceList; private ArrayList<ExpandListGroup> mGroup; private String mNameDevice; private String mAddrDevice; // Create a BroadcastReceiver for ACTION_FOUND private final BroadcastReceiver mReceiver = new BroadcastReceiver() { public void onReceive(Context context, Intent intent) { String action = intent.getAction(); // When discovery finds a device if (BluetoothDevice.ACTION_FOUND.equals(action)) { // Get the BluetoothDevice object from the Intent BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE); // Add the name and address to an array adapter to show in a ExpandableListView ExpandListGroup group = mGroup.get(DISCOVER_DEVICE_GROUP); BluetoothExpandListChild child = new BluetoothExpandListChild(); child.setName(device.getName()); child.setAddress(device.getAddress()); group.getItems().add(child); mDeviceList.setAdapter(mAdapter); } } }; // Get Bluetooth Device information and Send it to BluetoothClient @Override public boolean onChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id) { // Cancel the current discovery for avoid connection errors. BluetoothClient.cancelDiscoveredDevices(); // Get the selected element from the list and get its name and address. BluetoothExpandListChild dev = (BluetoothExpandListChild) mGroup.get(groupPosition).getItems().get(childPosition); mNameDevice = dev.getName(); mAddrDevice = dev.getAddress(); // Put the data in a Intent and send to RemoteControl class. Intent data = new Intent(); data.putExtra("name", mNameDevice); data.putExtra("address", mAddrDevice); setResult(RESULT_OK, data); finish(); return false; } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_bluetooth_list); // Register the BroadcastReceiver IntentFilter filter = new IntentFilter(BluetoothDevice.ACTION_FOUND); registerReceiver(mReceiver, filter); // Don't forget to unregister during onDestroy mDeviceList = (ExpandableListView) findViewById(R.id.list_devices); mGroup = setDevicesList(); mAdapter = new ExpandListAdapter(this, mGroup); mDeviceList.setAdapter(mAdapter); mDeviceList.setOnChildClickListener(this); } @Override protected void onDestroy() { // Cancel Discover and Unregister Broadcast Receiver BluetoothClient.cancelDiscoveredDevices(); unregisterReceiver(mReceiver); super.onDestroy(); } private ArrayList<ExpandListGroup> setDevicesList() { ArrayList<ExpandListGroup> mRootList = new ArrayList<ExpandListGroup>(); ExpandListGroup bounded = new ExpandListGroup(); ExpandListGroup discovered = new ExpandListGroup(); ArrayList<ExpandListChild> list_bounded = new ArrayList<ExpandListChild>(); ArrayList<ExpandListChild> list_discovered = new ArrayList<ExpandListChild>(); bounded.setName(getResources().getString(R.string.list_devices_bounded)); discovered.setName(getResources().getString(R.string.list_devices_discovered)); Set<BluetoothDevice> devices = BluetoothClient.getDeviceList(); Iterator<BluetoothDevice> it = devices.iterator(); while (it.hasNext()) { BluetoothExpandListChild child = new BluetoothExpandListChild(); BluetoothDevice device = it.next(); child.setName(device.getName()); child.setAddress(device.getAddress()); list_bounded.add(child); } bounded.setItems(list_bounded); discovered.setItems(list_discovered); mRootList.add(bounded); mRootList.add(discovered); return mRootList; } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.activity_bluetooth_list, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.menu_discover_devices: BluetoothClient.getDiscoveredDevices(); } return super.onOptionsItemSelected(item); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
7a43f83eb131f01bf02f0464559d3a809a75f23b
786d426d404ece478fa99ba4caf1c07dc9177531
/shaderlab/src/org/mustbe/consulo/unity3d/shaderlab/lang/psi/ShaderPropertyValue.java
319b96fb43af92377a5b59a492e9faf0241c553c
[ "Apache-2.0" ]
permissive
mefilt/consulo-unity3d
a4818e1ef320b0f744517c26d539dbaaac27f98c
9dc98cee2362c3e4c6f71679e10208b79f2e7991
refs/heads/master
2021-01-17T08:48:12.543321
2015-10-26T18:53:07
2015-10-26T18:53:07
46,150,303
0
1
null
2015-11-13T22:18:09
2015-11-13T22:18:09
null
UTF-8
Java
false
false
1,243
java
/* * Copyright 2013-2015 must-be.org * * 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.mustbe.consulo.unity3d.shaderlab.lang.psi; import java.util.List; import org.jetbrains.annotations.NotNull; import com.intellij.lang.ASTNode; import com.intellij.psi.PsiElement; import com.intellij.psi.tree.IElementType; /** * @author VISTALL * @since 08.05.2015 */ public class ShaderPropertyValue extends ShaderLabElement { public ShaderPropertyValue(@NotNull ASTNode node) { super(node); } @NotNull public List<PsiElement> getElements(IElementType elementType) { return findChildrenByType(elementType); } @Override public void accept(SharpLabElementVisitor visitor) { visitor.visitPropertyValue(this); } }
[ "vistall.valeriy@gmail.com" ]
vistall.valeriy@gmail.com
4d81b331815e14d909d1ce47476396316d3b745c
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/3/3_23fcf36036c39ac146d4a459bfbc1fe6a87a4f51/DownloadTask/3_23fcf36036c39ac146d4a459bfbc1fe6a87a4f51_DownloadTask_s.java
d6b8677b565aed918509cb291324d1f87a5f256a
[]
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
8,073
java
package com.scurab.java.ftpleecher; import org.apache.commons.io.IOUtils; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.util.*; /** * Base class representing one particular task<br/> * Task can contain n files/folders */ public class DownloadTask implements FTPDownloadListener { /** * collections where are all working threads * */ private List<FTPDownloadThread> mData; /** * collection of active working threads * */ private List<FTPDownloadThread> mWorkingThreads; private boolean mDeleteAfterMerge; public DownloadTask(Collection<FTPDownloadThread> data) { mData = new ArrayList<FTPDownloadThread>(data); mWorkingThreads = new ArrayList<FTPDownloadThread>(data); bind(); } private void bind() { for (FTPDownloadThread t : mData) { t.registerListener(this); t.setParentTask(this); } } //region notification @Override public void onError(FTPDownloadThread source, Exception e) { } @Override public void onFatalError(FTPDownloadThread source, FatalFTPException e) { } @Override public void onDownloadProgress(FTPDownloadThread source, double down, double downPerSec) { } @Override public void onStatusChange(FTPDownloadThread source, FTPDownloadThread.State state) { performStatusChange(source, state); } //endregion notification private void performStatusChange(final FTPDownloadThread source, final FTPDownloadThread.State state) { final boolean finished = (state == FTPDownloadThread.State.Finished); boolean merge = false; //ignore these states, because they are set from this class if (state != FTPDownloadThread.State.Merging) { if (finished) { synchronized (mWorkingThreads) { mWorkingThreads.remove(source); } //finished is called here or in download thread if not separated and file with same size is found //on local drive } else { synchronized (mWorkingThreads) { if (source.getParentTask() != this) { System.err.println("This thread is not from this task!" + source.getContext().toString()); return; } else { if (state == FTPDownloadThread.State.Downloaded) { mWorkingThreads.remove(source); } else { if (!mWorkingThreads.contains(source)) { //can be restarted, finished are handled before mWorkingThreads.add(source); } } } } } merge = mWorkingThreads.size() == 0 && mData.size() > 1; //we are done in this task, now is time to merge if (merge) { //must be called in diff thread to let finish current downloading thread performMerge(); } } } private void performMerge() { Thread t = new Thread(new Runnable() { @Override public void run() { /* * wait for sec to finish last thread */ try { Thread.sleep(1000); } catch (InterruptedException e) { e.printStackTrace(); } onMergeFiles(); } }); t.setName("MergeThread"); t.start(); } public void onMergeFiles() { HashMap<Long, FTPDownloadThread[]> subGroups = getSubGroups(); for (Long l : subGroups.keySet()) { try { FTPDownloadThread[] arr = subGroups.get(l); //if it's null it's still not ready if (arr != null) { mergeFiles(arr); } } catch (Exception e) { e.printStackTrace(); } } } private void unregisterListener(FTPDownloadThread[] parts) { for (FTPDownloadThread ft : parts) { ft.unregisterListener(this); } } private void mergeFiles(FTPDownloadThread[] parts) throws Exception { final String sep = System.getProperty("file.separator"); FTPContext context = parts[0].getContext(); //create output file and rename it if exists File outputFile = new File(context.outputDirectory + sep + context.fileName); if (outputFile.exists()) { outputFile.renameTo(new File(context.outputDirectory + sep + context.fileName + ".old" + System.currentTimeMillis())); } //final output stream FileOutputStream fos = new FileOutputStream(outputFile); for (int i = 0, n = parts.length; i < n; i++) { FTPDownloadThread thread = parts[i]; try { //set state thread.setFtpState(FTPDownloadThread.State.Merging); context = thread.getContext(); //region copy FileInputStream fis = new FileInputStream(context.localFile); int copied = IOUtils.copy(fis, fos); if (context.currentPieceLength != copied) { System.err.println(String.format("Copied:%s, Should be:%s", copied, context.currentPieceLength)); } fis.close(); //end region //set final state thread.setFtpState(FTPDownloadThread.State.Finished); } catch (Exception e) { thread.setFtpState(FTPDownloadThread.State.Error); throw e; } } try { fos.close(); } catch (Exception e) { e.printStackTrace(); } if (mDeleteAfterMerge) { for (int i = 0, n = parts.length; i < n; i++) { FTPDownloadThread thread = parts[i]; context = thread.getContext(); try { context.localFile.delete(); } catch (Exception e) { e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates. } } } } /** * Get subgroup, each soubgroup is one file separated to parts * * @return */ private HashMap<Long, FTPDownloadThread[]> getSubGroups() { boolean someNotFinished = false; HashMap<Long, FTPDownloadThread[]> result = new HashMap<Long, FTPDownloadThread[]>(); for (FTPDownloadThread ft : mData) { FTPContext c = ft.getContext(); //ignore files which are not separated if (c.parts > 1) { FTPDownloadThread[] arr = result.get(c.groupId); if (arr == null) { arr = new FTPDownloadThread[c.parts]; result.put(c.groupId, arr); } arr[c.part] = ft; someNotFinished |= ft.getFtpState() != FTPDownloadThread.State.Downloaded; } } //this can happend for example if someone restarted download in the middle of checking if (someNotFinished) { return null; } return result; } public List<FTPDownloadThread> getData() { return Collections.unmodifiableList(mData); } public void setDeleteAfterMerge(boolean b) { mDeleteAfterMerge = b; } public boolean getDeleteAfterMeger() { return mDeleteAfterMerge; } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
36c2183f04045d8b8e2c32ae28e0313e24dd2b51
89cf7c2054c78b6754b3d022f181f14605449f69
/app/src/main/java/com/iplay/jread/commons/api/ApiConstants.java
0787f6e7d879a9b57b610090af5788e9eed4fad6
[]
no_license
iplaycloud/JRead
1a1623bea90a860f4dbb159335cabdfc7679cc4e
4243b4db794171b915b4dc3800220d2280f6a37b
refs/heads/master
2021-01-13T11:50:37.208244
2017-01-16T09:56:00
2017-01-16T09:56:00
77,578,972
1
0
null
null
null
null
UTF-8
Java
false
false
6,128
java
/* * Copyright (c) 2016 咖枯 <kaku201313@163.com | 3772304@qq.com> * * 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.iplay.jread.commons.api; public class ApiConstants { public static final String NETEAST_HOST = "http://c.m.163.com/"; public static final String END_URL = "-20.html"; public static final String ENDDETAIL_URL = "/full.html"; // 新闻详情 public static final String NEWS_DETAIL = NETEAST_HOST + "nc/article/"; // 头条TYPE public static final String HEADLINE_TYPE = "headline"; // 房产TYPE public static final String HOUSE_TYPE = "house"; // 其他TYPE public static final String OTHER_TYPE = "list"; // // 北京 // public static final String LOCAL_TYPE = "local"; // // 北京的Id // public static final String BEIJING_ID = "5YyX5Lqs"; //example:http://c.m.163.com/nc/article/headline/T1348647909107/0-20.html // 头条id public static final String HEADLINE_ID = "T1348647909107"; // 房产id public static final String HOUSE_ID = "5YyX5Lqs"; // 足球 public static final String FOOTBALL_ID = "T1399700447917"; // 娱乐 public static final String ENTERTAINMENT_ID = "T1348648517839"; // 体育 public static final String SPORTS_ID = "T1348649079062"; // 财经 public static final String FINANCE_ID = "T1348648756099"; // 科技 public static final String TECH_ID = "T1348649580692"; // 电影 public static final String MOVIE_ID = "T1348648650048"; // 汽车 public static final String CAR_ID = "T1348654060988"; // 笑话 public static final String JOKE_ID = "T1350383429665"; // 游戏 public static final String GAME_ID = "T1348654151579"; // 时尚 public static final String FASHION_ID = "T1348650593803"; // 情感 public static final String EMOTION_ID = "T1348650839000"; // 精选 public static final String CHOICE_ID = "T1370583240249"; // 电台 public static final String RADIO_ID = "T1379038288239"; // nba public static final String NBA_ID = "T1348649145984"; // 数码 public static final String DIGITAL_ID = "T1348649776727"; // 移动 public static final String MOBILE_ID = "T1351233117091"; // 彩票 public static final String LOTTERY_ID = "T1356600029035"; // 教育 public static final String EDUCATION_ID = "T1348654225495"; // 论坛 public static final String FORUM_ID = "T1349837670307"; // 旅游 public static final String TOUR_ID = "T1348654204705"; // 手机 public static final String PHONE_ID = "T1348649654285"; // 博客 public static final String BLOG_ID = "T1349837698345"; // 社会 public static final String SOCIETY_ID = "T1348648037603"; // 家居 public static final String FURNISHING_ID = "T1348654105308"; // 暴雪游戏 public static final String BLIZZARD_ID = "T1397016069906"; // 亲子 public static final String PATERNITY_ID = "T1397116135282"; // CBA public static final String CBA_ID = "T1348649475931"; // 消息 public static final String MSG_ID = "T1371543208049"; // 军事 public static final String MILITARY_ID = "T1348648141035"; /** * 视频 http://c.3g.163.com/nc/video/list/V9LG4CHOR/n/10-10.html */ public static final String Video = "nc/video/list/"; public static final String VIDEO_CENTER = "/n/"; public static final String VIDEO_END_URL = "-10.html"; // 热点视频 public static final String VIDEO_HOT_ID = "V9LG4B3A0"; // 娱乐视频 public static final String VIDEO_ENTERTAINMENT_ID = "V9LG4CHOR"; // 搞笑视频 public static final String VIDEO_FUN_ID = "V9LG4E6VR"; // 精品视频 public static final String VIDEO_CHOICE_ID = "00850FRB"; /** * 天气预报url */ public static final String WEATHER_HOST = "http://wthrcdn.etouch.cn/"; /** * 新浪图片新闻 * http://gank.io/api/data/福利/{size}/{page} */ public static final String SINA_PHOTO_HOST = "http://gank.io/api/"; // 精选列表 public static final String SINA_PHOTO_CHOICE_ID = "hdpic_toutiao"; // 趣图列表 public static final String SINA_PHOTO_FUN_ID = "hdpic_funny"; // 美图列表 public static final String SINA_PHOTO_PRETTY_ID = "hdpic_pretty"; // 故事列表 public static final String SINA_PHOTO_STORY_ID = "hdpic_story"; // 图片详情 public static final String SINA_PHOTO_DETAIL_ID = "hdpic_hdpic_toutiao_4"; /** * 新闻id获取类型 * * @param id 新闻id * @return 新闻类型 */ public static String getType(String id) { switch (id) { case HEADLINE_ID: return HEADLINE_TYPE; case HOUSE_ID: return HOUSE_TYPE; default: break; } return OTHER_TYPE; } /** * 获取对应的host * * @param hostType host类型 * @return host */ public static String getHost(int hostType) { String host; switch (hostType) { case HostType.NETEASE_NEWS_VIDEO: host = NETEAST_HOST; break; case HostType.GANK_GIRL_PHOTO: host = SINA_PHOTO_HOST; break; case HostType.NEWS_DETAIL_HTML_PHOTO: host = "http://kaku.com/"; break; default: host = ""; break; } return host; } }
[ "iplaycloud@gmail.com" ]
iplaycloud@gmail.com
3456034b497096a24a757f6b749f6ad7ded907d5
951a2cebfb3b742a0b9da0dee787f4610505292c
/toq/Misc/JavaSrc/android/support/v4/util/AtomicFile.java
3d7e9019263c0f309f325bc0074a7ebd1c624550
[]
no_license
marciallus/mytoqmanager
eca30683508878b712e9c1c6642f39f34c2e257b
65fe1d54e8593900262d5b263d75feb646c015e6
refs/heads/master
2020-05-17T01:03:44.121469
2014-12-10T07:22:14
2014-12-10T07:22:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,263
java
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.kpdus.com/jad.html // Decompiler options: packimports(3) fieldsfirst noctor space package android.support.v4.util; import android.util.Log; import java.io.*; public class AtomicFile { private final File mBackupName; private final File mBaseName; public AtomicFile(File file) { mBaseName = file; mBackupName = new File((new StringBuilder()).append(file.getPath()).append(".bak").toString()); } static boolean sync(FileOutputStream fileoutputstream) { if (fileoutputstream != null) try { fileoutputstream.getFD().sync(); } catch (IOException ioexception) { return false; } return true; } public void delete() { mBaseName.delete(); mBackupName.delete(); } public void failWrite(FileOutputStream fileoutputstream) { if (fileoutputstream == null) break MISSING_BLOCK_LABEL_33; sync(fileoutputstream); fileoutputstream.close(); mBaseName.delete(); mBackupName.renameTo(mBaseName); return; IOException ioexception; ioexception; Log.w("AtomicFile", "failWrite: Got exception:", ioexception); return; } public void finishWrite(FileOutputStream fileoutputstream) { if (fileoutputstream == null) break MISSING_BLOCK_LABEL_21; sync(fileoutputstream); fileoutputstream.close(); mBackupName.delete(); return; IOException ioexception; ioexception; Log.w("AtomicFile", "finishWrite: Got exception:", ioexception); return; } public File getBaseFile() { return mBaseName; } public FileInputStream openRead() throws FileNotFoundException { if (mBackupName.exists()) { mBaseName.delete(); mBackupName.renameTo(mBaseName); } return new FileInputStream(mBaseName); } public byte[] readFully() throws IOException { FileInputStream fileinputstream; int i; fileinputstream = openRead(); i = 0; byte abyte0[] = new byte[fileinputstream.available()]; _L2: int j = fileinputstream.read(abyte0, i, abyte0.length - i); if (j <= 0) { fileinputstream.close(); return abyte0; } i += j; int k = fileinputstream.available(); if (k <= abyte0.length - i) goto _L2; else goto _L1 _L1: byte abyte1[]; abyte1 = new byte[i + k]; System.arraycopy(abyte0, 0, abyte1, 0, i); abyte0 = abyte1; goto _L2 Exception exception; exception; fileinputstream.close(); throw exception; } public FileOutputStream startWrite() throws IOException { FileOutputStream fileoutputstream; if (mBaseName.exists()) if (!mBackupName.exists()) { if (!mBaseName.renameTo(mBackupName)) Log.w("AtomicFile", (new StringBuilder()).append("Couldn't rename file ").append(mBaseName).append(" to backup file ").append(mBackupName).toString()); } else { mBaseName.delete(); } try { fileoutputstream = new FileOutputStream(mBaseName); } catch (FileNotFoundException filenotfoundexception) { if (!mBaseName.getParentFile().mkdir()) throw new IOException((new StringBuilder()).append("Couldn't create directory ").append(mBaseName).toString()); FileOutputStream fileoutputstream1; try { fileoutputstream1 = new FileOutputStream(mBaseName); } catch (FileNotFoundException filenotfoundexception1) { throw new IOException((new StringBuilder()).append("Couldn't create ").append(mBaseName).toString()); } return fileoutputstream1; } return fileoutputstream; } }
[ "marc.lanouiller@gmail.com" ]
marc.lanouiller@gmail.com
9ccb4dc42f6d99c7f8118e6bb8c8c1dd85df225c
b77bf23ba60db5794445b8204317ed8b7388a2fd
/shadersmod/client/ShaderPackZip.java
b631fd344b7279eb151654bc9c07d7b272f63b58
[]
no_license
SulfurClient/Sulfur
f41abb5335ae9617a629ced0cde4703ef7cc5f2c
e54efe14bb52d09752f9a38d7282f0d1cd81e469
refs/heads/main
2022-07-29T03:18:53.078298
2022-02-02T15:09:34
2022-02-02T15:09:34
426,418,356
2
0
null
null
null
null
UTF-8
Java
false
false
1,662
java
package shadersmod.client; import optifine.StrUtils; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; public class ShaderPackZip implements IShaderPack { protected File packFile; protected ZipFile packZipFile; public ShaderPackZip(String name, File file) { this.packFile = file; this.packZipFile = null; } public void close() { if (this.packZipFile != null) { try { this.packZipFile.close(); } catch (Exception var2) { ; } this.packZipFile = null; } } public InputStream getResourceAsStream(String resName) { try { if (this.packZipFile == null) { this.packZipFile = new ZipFile(this.packFile); } String excp = StrUtils.removePrefix(resName, "/"); ZipEntry entry = this.packZipFile.getEntry(excp); return entry == null ? null : this.packZipFile.getInputStream(entry); } catch (Exception var4) { return null; } } public boolean hasDirectory(String resName) { try { if (this.packZipFile == null) { this.packZipFile = new ZipFile(this.packFile); } String e = StrUtils.removePrefix(resName, "/"); ZipEntry entry = this.packZipFile.getEntry(e); return entry != null; } catch (IOException var4) { return false; } } public String getName() { return this.packFile.getName(); } }
[ "45654930+Kansioo@users.noreply.github.com" ]
45654930+Kansioo@users.noreply.github.com
ec6851fdff7d9895c7f68a6c331ace01768dedea
6cff23733e6dd7a546b570bad530ee44a518f732
/sample/src/main/java/fake/package_8/Foo84.java
04b2ea2febd0e1872755cce47f6256e71a0145e2
[ "Apache-2.0" ]
permissive
hacktons/dexing
940248a0501255cc2939eecef63b57735f811b06
e774aaa3a562514bb59634c932aa85a1578a5182
refs/heads/master
2020-09-05T05:12:52.749052
2020-04-07T07:08:42
2020-04-07T07:08:42
219,990,044
5
0
Apache-2.0
2020-04-07T07:08:43
2019-11-06T12:19:38
Java
UTF-8
Java
false
false
1,638
java
package fake.package_8; public class Foo84 { public void foo0(){ new Foo83().foo49(); } public void foo1(){ foo0(); } public void foo2(){ foo1(); } public void foo3(){ foo2(); } public void foo4(){ foo3(); } public void foo5(){ foo4(); } public void foo6(){ foo5(); } public void foo7(){ foo6(); } public void foo8(){ foo7(); } public void foo9(){ foo8(); } public void foo10(){ foo9(); } public void foo11(){ foo10(); } public void foo12(){ foo11(); } public void foo13(){ foo12(); } public void foo14(){ foo13(); } public void foo15(){ foo14(); } public void foo16(){ foo15(); } public void foo17(){ foo16(); } public void foo18(){ foo17(); } public void foo19(){ foo18(); } public void foo20(){ foo19(); } public void foo21(){ foo20(); } public void foo22(){ foo21(); } public void foo23(){ foo22(); } public void foo24(){ foo23(); } public void foo25(){ foo24(); } public void foo26(){ foo25(); } public void foo27(){ foo26(); } public void foo28(){ foo27(); } public void foo29(){ foo28(); } public void foo30(){ foo29(); } public void foo31(){ foo30(); } public void foo32(){ foo31(); } public void foo33(){ foo32(); } public void foo34(){ foo33(); } public void foo35(){ foo34(); } public void foo36(){ foo35(); } public void foo37(){ foo36(); } public void foo38(){ foo37(); } public void foo39(){ foo38(); } public void foo40(){ foo39(); } public void foo41(){ foo40(); } public void foo42(){ foo41(); } public void foo43(){ foo42(); } public void foo44(){ foo43(); } public void foo45(){ foo44(); } public void foo46(){ foo45(); } public void foo47(){ foo46(); } public void foo48(){ foo47(); } public void foo49(){ foo48(); } }
[ "chaobinwu89@gmail.com" ]
chaobinwu89@gmail.com
fc8bfb62d93a435a3b352c69688ddc0ed8b6ba2d
d00be105055225808a242cd6bd8411b376c4f4e1
/test/net/java/sip/communicator/slick/protocol/msn/MsnProtocolProviderServiceLick.java
582229b8e7a976fffc6760f14e1f696a6e65e898
[]
no_license
zhiji6/sip-comm-jn
bae7d463353de91a5e95bfb4ea5bb85e42c7609c
8259cf641bd4d868481c0ef4785a5ce75aac098d
refs/heads/master
2020-04-29T02:52:02.743960
2010-11-08T19:48:29
2010-11-08T19:48:29
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,526
java
/* * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client. * * Distributable under LGPL license. * See terms of license at gnu.org. */ package net.java.sip.communicator.slick.protocol.msn; import java.util.*; import org.osgi.framework.*; import junit.framework.*; /** * Msn specific testing for a Msn Protocol Provider Service implementation. * The test suite registers three accounts for * * @author Damian Minkov * @author Valentin Martinet */ public class MsnProtocolProviderServiceLick extends TestSuite implements BundleActivator { /** * The prefix used for property names containing settings for our first * testing account. */ public static final String ACCOUNT_1_PREFIX = "accounts.msn.account1."; /** * The prefix used for property names containing settings for our second * testing account. */ public static final String ACCOUNT_2_PREFIX = "accounts.msn.account2."; /** * The prefix used for property names containing settings for our third * testing account. */ public static final String ACCOUNT_3_PREFIX = "accounts.msn.account3."; /** * The name of the property that indicates whether the user would like to * only run the offline tests. */ public static final String DISABLE_ONLINE_TESTS_PROPERTY_NAME = "accounts.msn.DISABLE_ONLINE_TESTING"; /** * The name of the property the value of which is a formatted string that * contains the contact list that. */ public static final String CONTACT_LIST_PROPERTY_NAME = "accounts.msn.CONTACT_LIST"; /** * Initializes and registers all tests that we'll run as a part of this * slick. * * @param context a currently valid bundle context. */ public void start(BundleContext context) { setName("MsnProtocolProviderSlick"); Hashtable<String, String> properties = new Hashtable<String, String>(); properties.put("service.pid", getName()); MsnSlickFixture.bc = context; // verify whether the user wants to avoid online testing String offlineMode = System.getProperty( DISABLE_ONLINE_TESTS_PROPERTY_NAME, null); if (offlineMode != null && offlineMode.equalsIgnoreCase("true")) MsnSlickFixture.onlineTestingDisabled = true; addTestSuite(TestAccountInstallation.class); addTestSuite(TestProtocolProviderServiceMsnImpl.class); addTest(TestOperationSetPresence.suite()); //the following should only be run when we want online testing. if(!MsnSlickFixture.onlineTestingDisabled) { addTest(TestOperationSetPersistentPresence.suite()); addTest(TestOperationSetBasicInstantMessaging.suite()); addTest(TestOperationSetInstantMessageTransformMsnImpl.suite()); addTest(TestOperationSetTypingNotifications.suite()); addTestSuite(TestOperationSetFileTransferImpl.class); addTest(TestOperationSetAdHocMultiUserChatMsnImpl.suite()); } addTest(TestAccountUninstallation.suite()); addTestSuite(TestAccountUninstallationPersistence.class); context.registerService(getClass().getName(), this, properties); } /** * Prepares the slick for shutdown. * * @param context a currently valid bundle context. */ public void stop(BundleContext context) { } }
[ "barata7@gmail.com" ]
barata7@gmail.com
dea1242e6f59fc2dab204000ca9120e1b3981866
8727b1cbb8ca63d30340e8482277307267635d81
/PolarServer/src/com/game/task/message/ResTargetMonsterChangeMessage.java
e8a4178939eb03445ce31f0e6f29ebb77c8e5d2b
[]
no_license
taohyson/Polar
50026903ded017586eac21a7905b0f1c6b160032
b0617f973fd3866bed62da14f63309eee56f6007
refs/heads/master
2021-05-08T12:22:18.884688
2015-12-11T01:44:18
2015-12-11T01:44:18
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,443
java
package com.game.task.message; import com.game.task.bean.TargetMonsterInfo; import com.game.message.Message; import org.apache.mina.core.buffer.IoBuffer; /** * @author Commuication Auto Maker * * @version 1.0.0 * * 讨伐任务怪物状态变化消息 */ public class ResTargetMonsterChangeMessage extends Message{ //怪物信息 private TargetMonsterInfo monsterInfo; /** * 写入字节缓存 */ public boolean write(IoBuffer buf){ //怪物信息 writeBean(buf, this.monsterInfo); return true; } /** * 读取字节缓存 */ public boolean read(IoBuffer buf){ //怪物信息 this.monsterInfo = (TargetMonsterInfo)readBean(buf, TargetMonsterInfo.class); return true; } /** * get 怪物信息 * @return */ public TargetMonsterInfo getMonsterInfo(){ return monsterInfo; } /** * set 怪物信息 */ public void setMonsterInfo(TargetMonsterInfo monsterInfo){ this.monsterInfo = monsterInfo; } @Override public int getId() { return 120110; } @Override public String getQueue() { return null; } @Override public String getServer() { return null; } @Override public String toString(){ StringBuffer buf = new StringBuffer("["); //怪物信息 if(this.monsterInfo!=null) buf.append("monsterInfo:" + monsterInfo.toString() +","); if(buf.charAt(buf.length()-1)==',') buf.deleteCharAt(buf.length()-1); buf.append("]"); return buf.toString(); } }
[ "zhuyuanbiao@ZHUYUANBIAO.rd.com" ]
zhuyuanbiao@ZHUYUANBIAO.rd.com
4141b5bb20ce194e8c18cdd317d451260a13e2ef
fb3fe27ade2c8c4a9809797a25f833918a3945cc
/akka-quickstart-java/src/main/java/com/lightbend/akka/sample/GreeterMain.java
896b76fa6c96a21224cf52141017314a1a2df3fa
[]
no_license
sebChevre/AKKA
462f9a07289073f3aeeca2333331051e3e3d9e76
bd965553dffd45fd14d608a1296fd0892f0b177f
refs/heads/master
2020-12-06T06:04:10.259383
2020-01-13T11:44:54
2020-01-13T11:44:54
232,367,710
0
0
null
2020-10-13T18:41:29
2020-01-07T16:32:00
Java
UTF-8
Java
false
false
1,160
java
package com.lightbend.akka.sample; import akka.actor.typed.ActorRef; import akka.actor.typed.Behavior; import akka.actor.typed.javadsl.*; public class GreeterMain extends AbstractBehavior<GreeterMain.Start> { public static class Start { public final String name; public Start(String name) { this.name = name; } } private final ActorRef<Salutations> greeter; public static Behavior<Start> create() { return Behaviors.setup(GreeterMain::new); } private GreeterMain(ActorContext<Start> context) { super(context); //#create-actors greeter = context.spawn(Saluer.create(), "greeter"); //#create-actors } @Override public Receive<Start> createReceive() { return newReceiveBuilder().onMessage(Start.class, this::onStart).build(); } private Behavior<Start> onStart(Start command) { //#create-actors ActorRef<Salue> replyTo = getContext().spawn(GreeterBot.create(3), command.name); greeter.tell(new Salutations(command.name, replyTo)); //#create-actors return this; } }
[ "seb.chevre@gmail.com" ]
seb.chevre@gmail.com
086a0213e4ff5d70e4a1fa1696ff7e984d8d795c
44ce357ee9ca8df2f399f7e0fcdf385b7b34c245
/src/main/java/com/lavadip/skeye/config/WorldMapView.java
f368ec144f46cb6c47b78f523e5d095139c2f46a
[]
no_license
silas1037/SkEye
a8712f273e1cadd69e0be7d993963016df227cb5
ed0ede814ee665317dab3209b8a33e38df24a340
refs/heads/master
2023-01-20T20:25:00.940114
2020-11-29T04:01:05
2020-11-29T04:01:05
315,267,911
0
0
null
null
null
null
UTF-8
Java
false
false
5,831
java
package com.lavadip.skeye.config; import android.animation.ValueAnimator; import android.content.Context; import android.graphics.Canvas; import android.graphics.Matrix; import android.graphics.Paint; import android.graphics.Rect; import android.util.AttributeSet; import android.view.MotionEvent; import android.view.View; import android.widget.ImageView; public final class WorldMapView extends ImageView { private static final float SCALE_MARKER_CROSSHAIRS = 1.5f; private float latitude; private float longitude; private ValueAnimator mMarkerAnimator; private float mMarkerRadius; private float mStrokeWidth; private Paint markerBorderDarkPaint; private Paint markerBorderPaint; private Paint markerBorderShadowPaint; private Paint markerFillPaint; private OnTapListener onTapListener; public interface OnTapListener { void publishLatLong(float f, float f2); } public WorldMapView(Context context, AttributeSet attrs) { super(context, attrs); init(context); } public WorldMapView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); init(context); } private void init(Context context) { float density = context.getResources().getDisplayMetrics().density; this.mStrokeWidth = 4.0f * density; this.mMarkerRadius = 20.0f * density; this.markerBorderPaint = new Paint(); this.markerBorderPaint.setColor(-8140494); this.markerBorderPaint.setStyle(Paint.Style.STROKE); this.markerBorderPaint.setStrokeWidth(this.mStrokeWidth); this.markerBorderDarkPaint = new Paint(); this.markerBorderDarkPaint.setColor(-14798840); this.markerBorderDarkPaint.setStyle(Paint.Style.STROKE); this.markerBorderDarkPaint.setStrokeWidth(this.mStrokeWidth); this.markerBorderShadowPaint = new Paint(); this.markerBorderShadowPaint.setColor(-1716868438); this.markerBorderShadowPaint.setStyle(Paint.Style.STROKE); this.markerBorderShadowPaint.setStrokeWidth(this.mStrokeWidth * SCALE_MARKER_CROSSHAIRS); this.markerFillPaint = new Paint(); this.markerFillPaint.setColor(894600726); this.markerFillPaint.setStyle(Paint.Style.FILL); this.mMarkerAnimator = ValueAnimator.ofFloat(0.0f, 360.0f).setDuration(5000L); this.mMarkerAnimator.setInterpolator(null); this.mMarkerAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() { /* class com.lavadip.skeye.config.WorldMapView.C01201 */ public void onAnimationUpdate(ValueAnimator animation) { WorldMapView.this.invalidate(); } }); this.mMarkerAnimator.setRepeatCount(-1); this.mMarkerAnimator.start(); setOnTouchListener(new View.OnTouchListener() { /* class com.lavadip.skeye.config.WorldMapView.View$OnTouchListenerC01212 */ public boolean onTouch(View v, MotionEvent event) { if (event.getActionMasked() == 0) { float x = event.getX(event.getActionIndex()); float y = event.getY(event.getActionIndex()); Rect bounds = WorldMapView.this.getDrawable().getBounds(); Matrix matrix = WorldMapView.this.getImageMatrix(); float[] pts = {0.0f, 0.0f, (float) bounds.width(), (float) bounds.height()}; matrix.mapPoints(pts); float lat = 90.0f - (((y - pts[1]) / (pts[3] - pts[1])) * 180.0f); float lng = (((x - pts[0]) / (pts[2] - pts[0])) * 360.0f) - 180.0f; if (lat >= -90.0f && lat <= 90.0f && lng >= -180.0f && lng <= 180.0f) { WorldMapView.this.onTapListener.publishLatLong(lat, lng); } } return false; } }); } public void setLatLong(double latitude2, double longitude2) { this.latitude = (float) latitude2; this.longitude = (float) longitude2; } /* access modifiers changed from: protected */ public void onDraw(Canvas canvas) { super.onDraw(canvas); canvas.save(); canvas.concat(getImageMatrix()); Rect bounds = getDrawable().getBounds(); float centerX = bounds.exactCenterX(); float centerY = bounds.exactCenterY(); float x = centerX + (((this.longitude / 180.0f) * ((float) bounds.width())) / 2.0f); float y = centerY - (((this.latitude / 90.0f) * ((float) bounds.height())) / 2.0f); canvas.rotate(((Float) this.mMarkerAnimator.getAnimatedValue()).floatValue(), x, y); drawMarker(canvas, x, y, this.markerBorderShadowPaint, this.markerBorderShadowPaint, null); drawMarker(canvas, x, y, this.markerBorderPaint, this.markerBorderDarkPaint, this.markerFillPaint); canvas.restore(); } private void drawMarker(Canvas canvas, float x, float y, Paint borderPaint, Paint borderDarkPaint, Paint fillPaint) { if (fillPaint != null) { canvas.drawCircle(x, y, this.mMarkerRadius, fillPaint); } canvas.drawCircle(x, y, this.mMarkerRadius, borderPaint); canvas.drawLine(x - (this.mMarkerRadius * SCALE_MARKER_CROSSHAIRS), y, x + (this.mMarkerRadius * SCALE_MARKER_CROSSHAIRS), y, borderDarkPaint); canvas.drawLine(x, y - (this.mMarkerRadius * SCALE_MARKER_CROSSHAIRS), x, y + (this.mMarkerRadius * SCALE_MARKER_CROSSHAIRS), borderDarkPaint); } public void setOnTapListener(OnTapListener onTapListener2) { this.onTapListener = onTapListener2; } }
[ "silas1037@163.com" ]
silas1037@163.com
94e291519cd8374a7ee0e3b1920bb243222afaeb
206d15befecdfb67a93c61c935c2d5ae7f6a79e9
/DAOFUSION/samples/hello-dao/src/main/java/com/anasoft/os/daofusion/sample/hellodao/server/dao/impl/CountryDaoImpl.java
35deabfef48f5eaf45427dcb4779fc6d361b82fb
[]
no_license
MarkChege/micandroid
2e4d2884929548a814aa0a7715727c84dc4dcdab
0b0a6dee39cf7e258b6f54e1103dcac8dbe1c419
refs/heads/master
2021-01-10T19:15:34.994670
2013-05-16T05:56:21
2013-05-16T05:56:21
34,704,029
0
1
null
null
null
null
UTF-8
Java
false
false
530
java
package com.anasoft.os.daofusion.sample.hellodao.server.dao.impl; import com.anasoft.os.daofusion.sample.hellodao.server.dao.CountryDao; import com.anasoft.os.daofusion.sample.hellodao.server.dao.entity.Country; public class CountryDaoImpl extends EntityManagerAwareEnumerationDao<Country> implements CountryDao { // instances are created via DaoManager CountryDaoImpl() { super(); } public Class<Country> getEntityClass() { return Country.class; } }
[ "zoopnin@29cfa68c-37ae-8048-bc30-ccda835e92b1" ]
zoopnin@29cfa68c-37ae-8048-bc30-ccda835e92b1
35635609d235e3488e252da81a60f54dc6a7ac3e
70d838e359599899e303dcabf83de8721748e186
/Imagine/vector-editor-ui/src/main/java/org/imagine/vector/editor/ui/tools/inspectors/ShapeElementInspector.java
029763ba56510ef7c974142f353622b6cd51b0f2
[]
no_license
timboudreau/imagine
b30fd24351a2cb6473db00e4a4b04b844a79445b
294317a0a4ae7cf1db2d423c2974bef237147650
refs/heads/master
2023-08-31T09:38:52.324126
2023-06-12T04:16:59
2023-06-12T04:16:59
95,410,344
5
0
null
2023-08-23T17:54:31
2017-06-26T05:07:57
Java
UTF-8
Java
false
false
1,762
java
package org.imagine.vector.editor.ui.tools.inspectors; import java.awt.Component; import java.awt.Font; import javax.swing.JLabel; import javax.swing.JPanel; import net.java.dev.imagine.api.vector.design.ShapeNames; import com.mastfrog.geometry.util.PooledTransform; import org.imagine.inspectors.spi.InspectorFactory; import org.imagine.vector.editor.ui.spi.ShapeElement; import com.mastfrog.swing.layout.VerticalFlowLayout; import org.openide.util.Lookup; import org.openide.util.NbBundle.Messages; import org.openide.util.lookup.ServiceProvider; /** * * @author Tim Boudreau */ @Messages({ "triangle=Triangle", "oval=Oval", "rectangle=Rectangle", "path=Path", "roundRect=Round Rectangle", "shape=Shape", "string=Text" }) @ServiceProvider(service = InspectorFactory.class, position = 0) public class ShapeElementInspector extends InspectorFactory<ShapeElement> { public ShapeElementInspector() { super(ShapeElement.class); } @Override public Component get(ShapeElement obj, Lookup lookup, int item, int of) { JLabel lbl = new JLabel(); lbl.setText(ShapeNames.nameOf(obj.item())); lbl.setFont(lbl.getFont().deriveFont(Font.BOLD)); String info = ShapeNames.infoString(obj.item()); if (info.isEmpty()) { return lbl; } JPanel result = new JPanel(new VerticalFlowLayout()); result.add(lbl); JLabel details = new JLabel(info); result.add(details); PooledTransform.withScaleInstance(0.9, 0.9, xf -> { details.setFont(details.getFont().deriveFont(xf)); }); // details.setFont(details.getFont().deriveFont(AffineTransform.getScaleInstance(0.9, 0.9))); return result; } }
[ "tim@timboudreau.com" ]
tim@timboudreau.com
0058ac9c4b68c4bc7854a65af570f3a9ddd89785
8404043e222d2f7725ec37be5a147765d3eacaab
/src/main/java/com/example/demo/ProductService.java
5ebd810aa9a2eff7072eae11bbcc6eb43f5dac52
[]
no_license
nguyentiendong99/ChangeLanguageInSpringboot
cb2117ae5de3978098f64babdf439d92b4f1e978
0c9b870e774eb958615d13f9c3cb9c8ceae93875
refs/heads/master
2022-11-08T15:22:49.278022
2020-06-14T02:00:29
2020-06-14T02:00:29
272,116,381
0
0
null
null
null
null
UTF-8
Java
false
false
662
java
package com.example.demo; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Sort; import org.springframework.stereotype.Service; import java.util.List; @Service public class ProductService { @Autowired private ProductRepository repository; public List<Product> listAll(){ return repository.findAll(Sort.by("email").ascending()); } public void SaveProduct(Product product){ repository.save(product); } public void DeleteProduct(int id){ repository.deleteById(id); } public Product get(int id){ return repository.findById(id).get(); } }
[ "=" ]
=
8384df9f7f27864c13d02a9e3f442964a6b0f6d3
3f45002a3eeb7176bada33a0af61060b8fbd5642
/src/main/java/puzzles/graph_coloring/GraphColoringPuzzle.java
7c574c4b14029bb11ed21e45ae618f7e3fc7369e
[]
no_license
Habitats/AI-Programming
b16ab3aeb43491d510ebe945deb65ecbad9bc4f3
6fb98019aa133ecdac668adef6c8395d36df3aef
refs/heads/master
2021-01-02T23:07:08.343917
2014-11-26T13:31:24
2014-11-26T13:31:24
23,257,933
1
0
null
null
null
null
UTF-8
Java
false
false
2,212
java
package puzzles.graph_coloring; import java.util.Collection; import java.util.List; import ai.models.graph.ColorNode; import algorithms.a_star_csp.AStarCsp; import algorithms.a_star_csp.AStarCspPuzzle; import algorithms.a_star_csp.SimpleAStarCspPuzzle; import algorithms.csp.canonical_utils.Constraint; import algorithms.csp.canonical_utils.Variable; import algorithms.csp.canonical_utils.VariableList; /** * Created by Patrick on 08.09.2014. */ public class GraphColoringPuzzle extends SimpleAStarCspPuzzle { public static int K = 6; public GraphColoringPuzzle(AStarCsp<ColorNode> graphColoring) { super(graphColoring); } private VariableList getMostConstrained() { int max = Integer.MIN_VALUE; for (Variable var : getVariables()) { if (var.getDomain().getSize() == 1) { continue; } int constrainedCount = GraphColoringConstraintManager.getManager().getConstrainedCount(var); if (constrainedCount > max) { max = constrainedCount; } } VariableList mostContrained = new VariableList(); for (Variable var : getVariables()) { if (GraphColoringConstraintManager.getManager().getConstrainedCount(var) == max) { mostContrained.put(var); } } return mostContrained; } // GraphColoringButtonListener /////////////////////// // CspPuzzle ///////////////////////////////////////////////////////////// @Override public List<Constraint> getConstraints() { return GraphColoringConstraintManager.getManager().getConstraints(); } @Override protected int getInitialDomainSize() { return GraphColoringPuzzle.K; } @Override protected AStarCspPuzzle newInstance() { return new GraphColoringPuzzle(getAstarCsp()); } @Override public VariableList generateVariables() { VariableList variables = new VariableList(); Collection<ColorNode> items = getAstarCsp().getAdapter().getItems(); for (ColorNode node : items) { Variable var = new Variable(node.getId(), getInitialDomain()); if (!node.isEmpty()) { var.setAssumption(node.getInitialValue()); } variables.put(var); var.addListener(node); } return variables; } }
[ "mail@habitats.no" ]
mail@habitats.no
517a5910f988011bc8cd7506782768ca78a1cfd7
69c00032e21079eb41b86c2085d38b8ba3e6e5cb
/Development_library/05Coding/安卓/andr_c/src/com/huift/hfq/cust/model/GetUserActivityInfoTask.java
019a90796ff7158158d037f0864782755e6c38f2
[]
no_license
qiaobenlaing/coupon
476b90ac9c8a9bb56f4c481c3e0303adc9575133
32a53667f0c496cda0d7df71651e07f0138001d3
refs/heads/master
2023-01-20T03:40:42.118722
2020-11-20T00:59:29
2020-11-20T01:13:28
312,522,162
0
0
null
null
null
null
UTF-8
Java
false
false
2,372
java
package com.huift.hfq.cust.model; import java.util.LinkedHashMap; import net.minidev.json.JSONObject; import android.app.Activity; import com.huift.hfq.base.ErrorCode; import com.huift.hfq.base.SzException; import com.huift.hfq.base.api.API; import com.huift.hfq.base.data.DB; import com.huift.hfq.base.model.SzAsyncTask; import com.huift.hfq.base.pojo.UserToken; /** * 用户活动报名详情 * @author yanfang.li */ public class GetUserActivityInfoTask extends SzAsyncTask<String, String, Integer> { private final static String TAG = GetUserActivityInfoTask.class.getSimpleName(); /** 调用API返回对象*/ private JSONObject mResult; /** 回调方法 **/ private Callback mCallback; /** * 回调方法的接口 */ public interface Callback { public void getResult(JSONObject jsonobject) ; } /** * 构造函数 * @param acti */ public GetUserActivityInfoTask(Activity acti) { super(acti); } /** * @param acti 上下文 * @param mCallback 回调方法 */ public GetUserActivityInfoTask(Activity acti, Callback mCallback) { super(acti); this.mCallback = mCallback; } @Override protected void onPreExecute() { if (null != mActivity && null != mProcessDialog) { mProcessDialog.dismiss(); } } /** * 业务逻辑操作 */ @Override protected void handldBuziRet(int retCode) { if (retCode == ErrorCode.RIGHT_RET_CODE) { mCallback.getResult(mResult) ; }else { mCallback.getResult(null); } } /** * 调用Api */ @Override protected Integer doInBackground(String... params) { UserToken userToken = DB.getObj(DB.Key.CUST_USER_TOKEN, UserToken.class); String tokenCode = userToken.getTokenCode();// 用户登录后获得的令牌 // 请求参数 LinkedHashMap<String, Object> reqParams = new LinkedHashMap<String, Object>() ; reqParams.put("userActivityCode" , params[0]) ; reqParams.put("tokenCode", tokenCode) ; try { int retCode = ErrorCode.ERROR_RET_CODE; mResult = (JSONObject)API.reqCust("getUserActivityInfo", reqParams); //判断查询的一个对象不为空为空 就返回一个正确的编码 if ( mResult != null || !"".equals(mResult.toJSONString())) { retCode = ErrorCode.RIGHT_RET_CODE; //1 代表访问成功 } return retCode; } catch (SzException e) { this.mErrCode = e.getErrCode() ; return this.mErrCode.getCode() ; } } }
[ "980415842@qq.com" ]
980415842@qq.com
d2bc3436fd238edf0fe3f98915f5057b15f4e5c5
1ebd71e2179be8a2baec90ff3f326a3f19b03a54
/hybris/bin/modules/core-accelerator/acceleratorcms/gensrc/de/hybris/platform/acceleratorcms/jalo/components/GeneratedSimpleResponsiveBannerComponent.java
9dbcb35796092a4452e80ddd1cbc896ceac88a5c
[]
no_license
shaikshakeeb785/hybrisNew
c753ac45c6ae264373e8224842dfc2c40a397eb9
228100b58d788d6f3203333058fd4e358621aba1
refs/heads/master
2023-08-15T06:31:59.469432
2021-09-03T09:02:04
2021-09-03T09:02:04
402,680,399
0
0
null
null
null
null
UTF-8
Java
false
false
1,382
java
/* * ---------------------------------------------------------------- * --- WARNING: THIS FILE IS GENERATED AND WILL BE OVERWRITTEN! --- * --- Generated at Jul 14, 2021, 3:42:56 PM --- * ---------------------------------------------------------------- * * Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. */ package de.hybris.platform.acceleratorcms.jalo.components; import de.hybris.platform.acceleratorcms.jalo.components.AbstractResponsiveBannerComponent; import de.hybris.platform.jalo.Item.AttributeMode; import java.util.Collections; import java.util.HashMap; import java.util.Map; /** * Generated class for type {@link de.hybris.platform.acceleratorcms.jalo.components.SimpleResponsiveBannerComponent SimpleResponsiveBannerComponent}. */ @SuppressWarnings({"deprecation","unused","cast"}) public abstract class GeneratedSimpleResponsiveBannerComponent extends AbstractResponsiveBannerComponent { protected static final Map<String, AttributeMode> DEFAULT_INITIAL_ATTRIBUTES; static { final Map<String, AttributeMode> tmp = new HashMap<String, AttributeMode>(AbstractResponsiveBannerComponent.DEFAULT_INITIAL_ATTRIBUTES); DEFAULT_INITIAL_ATTRIBUTES = Collections.unmodifiableMap(tmp); } @Override protected Map<String, AttributeMode> getDefaultAttributeModes() { return DEFAULT_INITIAL_ATTRIBUTES; } }
[ "sauravkr82711@gmail.com" ]
sauravkr82711@gmail.com
b71c6355a63af64fb64ae7e8f418fda71a02370b
40665051fadf3fb75e5a8f655362126c1a2a3af6
/geosolutions-it-mapsforge/b99010b604e3a48b4dbc1e5acc00afce42dacada/305/AndroidUtil.java
c93a0e7471ce3e4104b41d4a9ef98c588cdbb579
[]
no_license
fermadeiral/StyleErrors
6f44379207e8490ba618365c54bdfef554fc4fde
d1a6149d9526eb757cf053bc971dbd92b2bfcdf1
refs/heads/master
2020-07-15T12:55:10.564494
2019-10-24T02:30:45
2019-10-24T02:30:45
205,546,543
2
0
null
null
null
null
UTF-8
Java
false
false
6,583
java
/* * Copyright 2010, 2011, 2012, 2013 mapsforge.org * * This program is free software: you can redistribute it and/or modify it under the * terms of the GNU Lesser General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License along with * this program. If not, see <http://www.gnu.org/licenses/>. */ package org.mapsforge.map.android.util; import android.annotation.TargetApi; import android.content.Context; import android.os.Build; import android.os.Looper; import android.os.StatFs; import android.util.Log; import android.view.Display; import android.view.WindowManager; import org.mapsforge.core.graphics.GraphicFactory; import org.mapsforge.map.layer.cache.FileSystemTileCache; import org.mapsforge.map.layer.cache.InMemoryTileCache; import org.mapsforge.map.layer.cache.TileCache; import org.mapsforge.map.layer.cache.TwoLevelTileCache; import java.io.File; public class AndroidUtil { private AndroidUtil() { // noop, for privacy } public static final boolean honeyCombPlus = Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB; /** * @return true if the current thread is the UI thread, false otherwise. */ public static boolean currentThreadIsUiThread() { return Looper.getMainLooper().getThread() == Thread.currentThread(); } /** * Utility function to create a two-level tile cache with the right size. When the cache * is created we do not actually know the size of the mapview, so the screenRatio is an * approximation of the required size * @param c the Android context * @param id name for the storage directory * @param screenRatio part of the screen the view takes up * @param overdraw overdraw allowance * @return a new cache created on the external storage */ public static TileCache createTileCache(Context c, String id, float screenRatio, double overdraw) { int cacheSize = (int) Math.round(AndroidUtil.getMinimumCacheSize(c, overdraw, screenRatio)); return createExternalStorageTileCache(c, id, cacheSize); } /** * @param c the Android context * @param id name for the directory * @param firstLevelSize size of the first level cache * @return a new cache created on the external storage */ public static TileCache createExternalStorageTileCache(Context c, String id, int firstLevelSize) { Log.d("TILECACHE INMEMORY SIZE", Integer.toString(firstLevelSize)); TileCache firstLevelTileCache = new InMemoryTileCache(firstLevelSize); String cacheDirectoryName = c.getExternalCacheDir().getAbsolutePath() + File.separator + id; File cacheDirectory = new File(cacheDirectoryName); if (!cacheDirectory.exists()) { cacheDirectory.mkdir(); } int tileCacheFiles = estimateSizeOfFileSystemCache(cacheDirectoryName, firstLevelSize); if (cacheDirectory.canWrite() && tileCacheFiles > 0) { try { Log.d("TILECACHE FILECACHE SIZE", Integer.toString(firstLevelSize)); TileCache secondLevelTileCache = new FileSystemTileCache(tileCacheFiles, cacheDirectory, org.mapsforge.map.android.graphics.AndroidGraphicFactory.INSTANCE); return new TwoLevelTileCache(firstLevelTileCache, secondLevelTileCache); } catch (IllegalArgumentException e) { Log.w("TILECACHE", e.toString()); } } return firstLevelTileCache; } /** * @param cacheDirectoryName where the file system tile cache will be located * @param firstLevelSize size of the first level cache, no point cache being smaller * @return recommended number of files in FileSystemTileCache */ public static int estimateSizeOfFileSystemCache(String cacheDirectoryName, int firstLevelSize) { // assumption on size of files in cache, on the large side as not to eat // up all free space, real average probably 50K compressed final int tileCacheFileSize = 4 * GraphicFactory.getTileSize() * GraphicFactory.getTileSize(); final int maxCacheFiles = 2000; // arbitrary, probably too high // result cannot be bigger than maxCacheFiles int result = (int) Math.min(maxCacheFiles, getAvailableCacheSlots(cacheDirectoryName, tileCacheFileSize)); if (firstLevelSize > result) { // no point having a file system cache that does not even hold the memory cache result = 0; } return result; } /** * Get the number of tiles that can be stored on the file system * * @param directory where the cache will reside * @param fileSize average size of tile to be cached * @return number of tiles that can be stored without running out of space */ @SuppressWarnings("deprecation") @TargetApi(18) public static long getAvailableCacheSlots(String directory, int fileSize) { StatFs statfs = new StatFs(directory); if (android.os.Build.VERSION.SDK_INT >= 18){ return statfs.getAvailableBytes() / fileSize; } // problem is overflow with devices with large storage, so order is important here int result = statfs.getAvailableBlocks() / (fileSize / statfs.getBlockSize()); return result; } /** * Compute the minimum cache size for a view * * @param c the context. * @param overdrawFactor the overdraw factor applied to the mapview. * @param screenRatio the part of the screen the view covers. * @return the minimum cache size for the view. */ public static int getMinimumCacheSize(Context c, double overdrawFactor, float screenRatio) { WindowManager wm = (WindowManager) c.getSystemService(Context.WINDOW_SERVICE); Display display = wm.getDefaultDisplay(); return (int)(screenRatio * Math.ceil(1 + (display.getHeight() * overdrawFactor / GraphicFactory.getTileSize())) * Math.ceil(1 + (display.getWidth() * overdrawFactor / GraphicFactory.getTileSize()))); } }
[ "fer.madeiral@gmail.com" ]
fer.madeiral@gmail.com
bf0a586db69bc376197d6244910c173d4edcaf49
6889551483fe369fefe4d6f73c0740b4b21e1e2f
/src/de/jtem/halfedgetools/plugin/algorithm/geometry/SwapPosTexPos.java
46f9388cc706e5f45dc1e2f3382d7aaf97506cb8
[ "BSD-3-Clause", "BSD-2-Clause-Views", "BSD-2-Clause" ]
permissive
sechel/jtem-halfedgetools
ff0b3f09fed27bd45bb3b10084f8d1ae779a9672
de86334e2d7bd6df3e8bcae649f19880852a66f0
refs/heads/master
2021-01-10T04:12:24.685470
2018-07-17T10:59:44
2018-07-17T10:59:44
36,927,324
3
0
null
null
null
null
UTF-8
Java
false
false
1,288
java
package de.jtem.halfedgetools.plugin.algorithm.geometry; import de.jtem.halfedge.Edge; import de.jtem.halfedge.Face; import de.jtem.halfedge.HalfEdgeDataStructure; import de.jtem.halfedge.Vertex; import de.jtem.halfedgetools.adapter.AdapterSet; import de.jtem.halfedgetools.adapter.type.Position; import de.jtem.halfedgetools.adapter.type.TexturePosition; import de.jtem.halfedgetools.plugin.HalfedgeInterface; import de.jtem.halfedgetools.plugin.algorithm.AlgorithmCategory; import de.jtem.halfedgetools.plugin.algorithm.AlgorithmPlugin; public class SwapPosTexPos extends AlgorithmPlugin { @Override public AlgorithmCategory getAlgorithmCategory() { return AlgorithmCategory.Geometry; } @Override public String getAlgorithmName() { return "Swap Vertex Texture Positions"; } @Override public < V extends Vertex<V, E, F>, E extends Edge<V, E, F>, F extends Face<V, E, F>, HDS extends HalfEdgeDataStructure<V, E, F> > void execute(HDS hds, AdapterSet a, HalfedgeInterface hi) { for (V v : hds.getVertices()) { double[] p = a.getD(Position.class, v).clone(); double[] t = a.getD(TexturePosition.class, v).clone(); a.set(Position.class, v, t); a.set(TexturePosition.class, v, p); } hi.update(); } }
[ "sechel@math.tu-berlin.de" ]
sechel@math.tu-berlin.de
bdc7de046e587f36a82db57e44a190a9d76615f0
1841fca79c91b2251fa66ed9ebe3dd992a241c0e
/src/main/entry/webapp/data/PosController.java
ed8b86bdba7fcfd635def73d4cfd5ec9401588bb
[]
no_license
Jinx009/pro_parking
f6484560d9ab8f31d704afcad295949b259794da
e76991846d00921756a3c6fb418155782b6c371c
refs/heads/master
2021-01-25T06:36:28.120894
2018-06-12T05:18:29
2018-06-12T05:18:29
93,596,445
0
0
null
null
null
null
UTF-8
Java
false
false
1,806
java
package main.entry.webapp.data; import java.io.IOException; import javax.servlet.http.HttpServletResponse; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import com.alibaba.fastjson.JSONObject; import common.helper.HttpWebIOHelper; import database.RestResponse; import lombok.Setter; import main.entry.webapp.BaseController; import service.basicFunctions.HttpService; import utils.BaseConstant; import utils.HttpDataUtil; @Controller @Setter public class PosController extends BaseController{ private static final Logger logger = LoggerFactory.getLogger(PosController.class); @Autowired private HttpService httpService; private RestResponse<?> restResponse; @RequestMapping(value = "rest/poss",method = RequestMethod.GET) public void getPos(@RequestParam(value = "area",required = false)Integer area, @RequestParam(value = "appId",required = false)String appId, HttpServletResponse response) throws IOException{ restResponse = new RestResponse<>(BaseConstant.HTTP_ERROR_CODE,BaseConstant.HTTP_ERROR_MSG,null); try { if(area!=null){ String token = getToken(appId); if(token!=null){ String result = httpService.get(HttpDataUtil.getPosUrl(token,area)); if(!BaseConstant.HTTP_ERROR_CODE.equals(result)){ restResponse = JSONObject.parseObject(result, RestResponse.class); } } } } catch (Exception e) { logger.error("PosController.getPos[error:{}]", e); } HttpWebIOHelper._printWebJson(restResponse, response); } }
[ "jinxlovejinx@vip.qq.com" ]
jinxlovejinx@vip.qq.com
3718a290117b252a410e2fa351b30da3c1e2c481
d376366b7891db88b044b3a8bc7bd6feb4cd7c56
/r01f/r01fHttpClient/r01fHttpClientClasses/src/main/java/r01f/httpclient/jsse/security/krb5/internal/AuthorizationData.java
d85962e58473961cb518406eb9f991631d0afc03
[]
no_license
opendata-euskadi/java-utils
b3b7ec4a4e7f2d55832d572e8a12fdfe8dde2144
6f66dc26c2bd0dc136742e27a2214f2f2b43d938
refs/heads/master
2022-12-24T22:54:31.220835
2019-07-29T23:32:29
2019-07-29T23:32:29
133,263,797
0
0
null
2022-12-16T04:56:14
2018-05-13T18:28:24
Java
UTF-8
Java
false
false
7,491
java
/* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Sun designates this * particular file as subject to the "Classpath" exception as provided * by Sun in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, * CA 95054 USA or visit www.sun.com if you need additional information or * have any questions. */ /* * (C) Copyright IBM Corp. 1999 All Rights Reserved. * Copyright 1997 The Open Group Research Institute. All rights reserved. */ package r01f.httpclient.jsse.security.krb5.internal; import java.util.Vector; import java.io.IOException; import r01f.httpclient.jsse.security.krb5.Asn1Exception; import r01f.httpclient.jsse.security.krb5.internal.ccache.CCacheOutputStream; import r01f.httpclient.jsse.security.util.*; /** * In RFC4120, the ASN.1 AuthorizationData is defined as: * * AuthorizationData ::= SEQUENCE OF SEQUENCE { * ad-type [0] Int32, * ad-data [1] OCTET STRING * } * * Here, two classes are used to implement it and they can be represented as follows: * * AuthorizationData ::= SEQUENCE OF AuthorizationDataEntry * AuthorizationDataEntry ::= SEQUENCE { * ad-type[0] Int32, * ad-data[1] OCTET STRING * } */ public class AuthorizationData implements Cloneable { private AuthorizationDataEntry[] entry = null; private AuthorizationData() { } public AuthorizationData( AuthorizationDataEntry[] new_entries ) throws IOException { if (new_entries != null) { entry = new AuthorizationDataEntry[new_entries.length]; for (int i = 0; i < new_entries.length; i++) { if (new_entries[i] == null) { throw new IOException("Cannot create an AuthorizationData"); } else { entry[i] = (AuthorizationDataEntry)new_entries[i].clone(); } } } } public AuthorizationData( AuthorizationDataEntry new_entry ) { entry = new AuthorizationDataEntry[1]; entry[0] = new_entry; } public Object clone() { AuthorizationData new_authorizationData = new AuthorizationData(); if (entry != null) { new_authorizationData.entry = new AuthorizationDataEntry[entry.length]; for (int i = 0; i < entry.length; i++) new_authorizationData.entry[i] = (AuthorizationDataEntry)entry[i].clone(); } return new_authorizationData; } /** * Constructs a new <code>AuthorizationData,</code> instance. * @param der a single DER-encoded value. * @exception Asn1Exception if an error occurs while decoding an ASN1 encoded data. * @exception IOException if an I/O error occurs while reading encoded data. */ public AuthorizationData(DerValue der) throws Asn1Exception, IOException { Vector<AuthorizationDataEntry> v = new Vector<AuthorizationDataEntry> (); if (der.getTag() != DerValue.tag_Sequence) { throw new Asn1Exception(Krb5.ASN1_BAD_ID); } while (der.getData().available() > 0) { v.addElement(new AuthorizationDataEntry(der.getData().getDerValue())); } if (v.size() > 0) { entry = new AuthorizationDataEntry[v.size()]; v.copyInto(entry); } } /** * Encodes an <code>AuthorizationData</code> object. * @return byte array of encoded <code>AuthorizationData</code> object. * @exception Asn1Exception if an error occurs while decoding an ASN1 encoded data. * @exception IOException if an I/O error occurs while reading encoded data. */ @SuppressWarnings("resource") public byte[] asn1Encode() throws Asn1Exception, IOException { DerOutputStream bytes = new DerOutputStream(); DerValue der[] = new DerValue[entry.length]; for (int i = 0; i < entry.length; i++) { der[i] = new DerValue(entry[i].asn1Encode()); } bytes.putSequence(der); return bytes.toByteArray(); } /** * Parse (unmarshal) an <code>AuthorizationData</code> object from a DER input stream. * This form of parsing might be used when expanding a value which is part of * a constructed sequence and uses explicitly tagged type. * * @exception Asn1Exception if an error occurs while decoding an ASN1 encoded data. * @exception IOException if an I/O error occurs while reading encoded data. * @param data the Der input stream value, which contains one or more marshaled value. * @param explicitTag tag number. * @param optional indicates if this data field is optional * @return an instance of AuthorizationData. * */ public static AuthorizationData parse(DerInputStream data, byte explicitTag, boolean optional) throws Asn1Exception, IOException{ if ((optional) && (((byte)data.peekByte() & (byte)0x1F) != explicitTag)) { return null; } DerValue der = data.getDerValue(); if (explicitTag != (der.getTag() & (byte)0x1F)) { throw new Asn1Exception(Krb5.ASN1_BAD_ID); } else { DerValue subDer = der.getData().getDerValue(); return new AuthorizationData(subDer); } } /** * Writes <code>AuthorizationData</code> data fields to a output stream. * * @param cos a <code>CCacheOutputStream</code> to be written to. * @exception IOException if an I/O exception occurs. */ public void writeAuth(CCacheOutputStream cos) throws IOException { for (int i = 0; i < entry.length; i++) { entry[i].writeEntry(cos); } } public String toString() { String retVal = "AuthorizationData:\n"; for (int i = 0; i < entry.length; i++) { retVal += entry[i].toString(); } return retVal; } }
[ "futuretelematics@gmail.com" ]
futuretelematics@gmail.com
8523bc743009321119912162ffcafbfad1bc9359
58df55b0daff8c1892c00369f02bf4bf41804576
/src/com/google/android/gms/panorama/internal/IPanoramaCallbacks$Stub$Proxy.java
5ce9d9360bfa51b3185198f58ba91bf7680271b7
[]
no_license
gafesinremedio/com.google.android.gm
0b0689f869a2a1161535b19c77b4b520af295174
278118754ea2a262fd3b5960ef9780c658b1ce7b
refs/heads/master
2020-05-04T15:52:52.660697
2016-07-21T03:39:17
2016-07-21T03:39:17
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,710
java
package com.google.android.gms.panorama.internal; import android.content.Intent; import android.os.Bundle; import android.os.IBinder; import android.os.Parcel; import android.os.RemoteException; class IPanoramaCallbacks$Stub$Proxy implements IPanoramaCallbacks { private IBinder mRemote; IPanoramaCallbacks$Stub$Proxy(IBinder paramIBinder) { mRemote = paramIBinder; } public IBinder asBinder() { return mRemote; } public void onPanoramaInfoLoaded(int paramInt1, Bundle paramBundle, int paramInt2, Intent paramIntent) throws RemoteException { Parcel localParcel1 = Parcel.obtain(); Parcel localParcel2 = Parcel.obtain(); for (;;) { try { localParcel1.writeInterfaceToken("com.google.android.gms.panorama.internal.IPanoramaCallbacks"); localParcel1.writeInt(paramInt1); if (paramBundle != null) { localParcel1.writeInt(1); paramBundle.writeToParcel(localParcel1, 0); localParcel1.writeInt(paramInt2); if (paramIntent != null) { localParcel1.writeInt(1); paramIntent.writeToParcel(localParcel1, 0); mRemote.transact(1, localParcel1, localParcel2, 0); localParcel2.readException(); } } else { localParcel1.writeInt(0); continue; } localParcel1.writeInt(0); } finally { localParcel2.recycle(); localParcel1.recycle(); } } } } /* Location: * Qualified Name: com.google.android.gms.panorama.internal.IPanoramaCallbacks.Stub.Proxy * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "reverseengineeringer@hackeradmin.com" ]
reverseengineeringer@hackeradmin.com
55b5f2a18341e60b66b0cb26a463f86a04cc1f42
280f407df0b7d3c80eea26552491ba256eac4761
/src/test/java/org/assertj/core/data/MapEntry_toString_Test.java
a3f91f47b90eb64f869424c0e10b25a548100cc1
[ "Apache-2.0" ]
permissive
szpak-forks/assertj-core
37be458d067dff9a84d57effd3036de2e4ded1cc
94a2fbbc2b689445a02613e36b5178cac06ecd5f
refs/heads/master
2021-06-21T00:24:00.993909
2014-12-22T10:05:20
2014-12-22T10:12:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,173
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. * * Copyright 2012-2014 the original author or authors. */ package org.assertj.core.data; import static junit.framework.Assert.assertEquals; import static org.assertj.core.data.MapEntry.entry; import org.assertj.core.data.MapEntry; import org.junit.*; /** * Tests for <{@link MapEntry#toString()}. * * @author Alex Ruiz */ public class MapEntry_toString_Test { private static MapEntry entry; @BeforeClass public static void setUpOnce() { entry = entry("name", "Yoda"); } @Test public void should_implement_toString() { assertEquals("MapEntry[key='name', value='Yoda']", entry.toString()); } }
[ "joel.costigliola@gmail.com" ]
joel.costigliola@gmail.com
5c9902df172ed30703693b9b6293ebf2a7990a5e
289b07dcae8ee4fa203cd33071430940c464ea16
/Mate20_9_0_0/src/main/java/com/android/server/policy/RestartAction.java
82c18e0a2a34e1b6c829bab67846afb89897ed3c
[]
no_license
hsymhsym/HwFrameWorkSource
c892bc24392777fa36dc4eacfb92df379c9e9d90
001d8c0db514d94724783b97ebba89c9dd44c75e
refs/heads/master
2021-09-28T07:55:43.589992
2018-11-15T15:10:38
2018-11-15T15:10:38
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,187
java
package com.android.server.policy; import android.content.Context; import android.os.UserManager; import com.android.internal.globalactions.LongPressAction; import com.android.internal.globalactions.SinglePressAction; import com.android.server.policy.WindowManagerPolicy.WindowManagerFuncs; public final class RestartAction extends SinglePressAction implements LongPressAction { private final Context mContext; private final WindowManagerFuncs mWindowManagerFuncs; public RestartAction(Context context, WindowManagerFuncs windowManagerFuncs) { super(17302741, 17040129); this.mContext = context; this.mWindowManagerFuncs = windowManagerFuncs; } public boolean onLongPress() { if (((UserManager) this.mContext.getSystemService(UserManager.class)).hasUserRestriction("no_safe_boot")) { return false; } this.mWindowManagerFuncs.rebootSafeMode(true); return true; } public boolean showDuringKeyguard() { return true; } public boolean showBeforeProvisioning() { return true; } public void onPress() { this.mWindowManagerFuncs.reboot(false); } }
[ "lygforbs0@mail.com" ]
lygforbs0@mail.com
6538836adfe53b2f3e678f13af4195adbfe1e5ba
75ae440466edf001ab811878619d9abab9e64e3a
/Investigacion/Investigacion-ejb/src/java/ec/edu/espe_ctt_investigacion/session/SeaEstrategiaFacade.java
88f7dc765280898924a2f53b58988bd101bf97d3
[]
no_license
developerJhonAlon/ProyectosSociales
deefdbd3a5f512a11439c1cc53d785032d9a8133
70100377499be092460e0578478b9ceefa92464b
refs/heads/master
2020-03-26T03:54:33.641829
2020-03-22T02:20:12
2020-03-22T02:20:12
144,476,444
0
0
null
null
null
null
UTF-8
Java
false
false
1,704
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package ec.edu.espe_ctt_investigacion.session; import ec.edu.espe_ctt_investigacion.entity.SeaEstrategia; import java.math.BigDecimal; import java.util.List; import javax.ejb.Stateless; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; import javax.persistence.Query; /** * * @author Administrador */ @Stateless public class SeaEstrategiaFacade extends AbstractFacade<SeaEstrategia> { @PersistenceContext(unitName = "Investigacion-ejbPU") private EntityManager em; @Override protected EntityManager getEntityManager() { return em; } public SeaEstrategiaFacade() { super(SeaEstrategia.class); } public List<SeaEstrategia> findEstrategia(){ List<SeaEstrategia> result = null; Query query = em.createQuery("SELECT o FROM SeaEstrategia o where o.estrategIdPadre is null"); query.setHint("eclipselink.refresh",true); result = query.getResultList(); return result == null || result.isEmpty() ? null : result; } public List<SeaEstrategia> findEstrategiaByEstrat(BigDecimal codEst){ List<SeaEstrategia> result = null; Query query = em.createQuery("SELECT o FROM SeaEstrategia o WHERE o.estrategIdPadre.estrategId =:codEst AND o.estrategIdPadre is not null"); query.setParameter("codEst", codEst); query.setHint("eclipselink.refresh", true); result = query.getResultList(); return result == null || result.isEmpty() ? null : result; } }
[ "jhonalonjami@gmail.com" ]
jhonalonjami@gmail.com
50f74071f976c0157e934a2b712b4ea66a0ebcb7
ee99c44457879e56bdfdb9004072bd088aa85b15
/live-service/src/main/java/cn/idongjia/live/restructure/query/LiveESQueryHandler.java
5f97217189a06f67905ec39559c76c3d70273361
[]
no_license
maikezhang/maike_live
b91328b8694877f3a2a8132dcdd43c130b66e632
a16be995e4e3f8627a6168d348f8fefd1a205cb3
refs/heads/master
2020-04-07T15:10:52.210492
2018-11-21T03:21:18
2018-11-21T03:21:18
158,475,020
0
0
null
null
null
null
UTF-8
Java
false
false
4,945
java
package cn.idongjia.live.restructure.query; import cn.idongjia.live.db.mybatis.po.LiveBookCountPO; import cn.idongjia.live.db.mybatis.query.DBUserStageLiveQuery; import cn.idongjia.live.restructure.domain.entity.live.UserStageLiveE; import cn.idongjia.live.restructure.domain.entity.user.LiveAnchor; import cn.idongjia.live.restructure.domain.entity.zoo.LiveZoo; import cn.idongjia.live.restructure.dto.LiveBookCountDTO; import cn.idongjia.live.restructure.dto.LiveShow4IndexDTO; import cn.idongjia.live.restructure.manager.OutcryManager; import cn.idongjia.live.restructure.manager.UserManager; import cn.idongjia.live.restructure.manager.ZooManager; import cn.idongjia.live.restructure.pojo.co.LiveWithCategoryCO; import cn.idongjia.live.restructure.pojo.query.ESLiveQry; import cn.idongjia.live.restructure.repo.LiveShowRepo; import cn.idongjia.live.restructure.repo.UserStageLiveRepo; import cn.idongjia.live.support.BaseEnum; import cn.idongjia.util.Utils; import org.springframework.stereotype.Component; import javax.annotation.Resource; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.stream.Collectors; /** * @author lc * @create at 2018/7/19. */ @Component public class LiveESQueryHandler { @Resource private LiveShowRepo liveShowRepo; @Resource private ZooManager zooManager; @Resource private UserManager userManager; @Resource private LiveBookQueryHandler liveBookQueryHandler; @Resource private UserStageLiveRepo userStageLiveRepo; @Resource private OutcryManager outcryManager; public List<LiveWithCategoryCO> searchLiveWithCategroy(ESLiveQry esLiveQry) { List<LiveShow4IndexDTO> liveShow4IndexDTOS = liveShowRepo.searchLiveWithCategory(esLiveQry.getIds(), esLiveQry.getUpdateTime(), esLiveQry.getOffset(), esLiveQry.getLimit()); if (Utils.isEmpty(liveShow4IndexDTOS)) { return new ArrayList<>(); } List<Long> liveIds = new ArrayList<>(); List<Long> sessionIds = new ArrayList<>(); List<Long> pureLiveIds = new ArrayList<>(); Map<Long, Long> sessionLiveIdMap = new HashMap<>(); liveShow4IndexDTOS.stream().forEach(liveShow4IndexDTO -> { liveIds.add(liveShow4IndexDTO.getId()); if (liveShow4IndexDTO.getSessionId() != null) { sessionIds.add(liveShow4IndexDTO.getSessionId()); sessionLiveIdMap.put(liveShow4IndexDTO.getSessionId(), liveShow4IndexDTO.getId()); } else { pureLiveIds.add(liveShow4IndexDTO.getId()); } }); List<Long> zids = liveShow4IndexDTOS.stream().map(LiveShow4IndexDTO::getZooId).collect(Collectors.toList()); Map<Long, LiveZoo> zooMap = zooManager.map(zids); Map<Long, LiveAnchor> liveAnchorMap = userManager.takeCraftmsnWithCategoryList(liveShow4IndexDTOS.stream() .map(LiveShow4IndexDTO::getUserId).collect(Collectors.toList())); Map<Long, LiveBookCountDTO> bookCountDTOMap = new HashMap<>(); //批量获取专场的订阅人数 Map<Long, Integer> sessionUidBySessionIdMap = outcryManager.mapBookSessionUidBySessionId(sessionIds); sessionIds.stream().forEach(sessionId -> { LiveBookCountDTO liveBookCountDTO = new LiveBookCountDTO(new LiveBookCountPO()); Long liveId = sessionLiveIdMap.get(sessionId); Integer count=sessionUidBySessionIdMap.get(sessionId); liveBookCountDTO.setCount(count==null ? 0 : count); liveBookCountDTO.setLiveId(liveId); bookCountDTOMap.put(liveId, liveBookCountDTO); }); if (!Utils.isEmpty(pureLiveIds)) { Map<Long, LiveBookCountDTO> liveBookCountDTOMap = liveBookQueryHandler.countMap(pureLiveIds); if (!Utils.isEmpty(liveBookCountDTOMap)) { bookCountDTOMap.putAll(liveBookCountDTOMap); } } List<UserStageLiveE> userStageLiveES = userStageLiveRepo.list(DBUserStageLiveQuery.builder().status(BaseEnum.DataStatus.NORMAL_STATUS.getCode()).liveIds(liveIds).build()); Map<Long, List<UserStageLiveE>> liveUserStageMap = userStageLiveES.stream().collect(Collectors.groupingBy(UserStageLiveE::getLiveId)); return liveShow4IndexDTOS.stream().map(liveShow4IndexDTO -> { List<UserStageLiveE> stageLiveES = liveUserStageMap.get(liveShow4IndexDTO.getId()); Long userId = liveShow4IndexDTO.getUserId(); LiveAnchor liveAnchor = liveAnchorMap.get(userId); return liveShow4IndexDTO.assembleLiveWithCategory(zooMap.getOrDefault(liveShow4IndexDTO.getZooId(), null), liveAnchor, bookCountDTOMap.get(liveShow4IndexDTO.getId()), stageLiveES); }).collect(Collectors.toList()); } }
[ "zhangyingjie@idongjia.cn" ]
zhangyingjie@idongjia.cn
372b970e4df8cfab2c5b619dc64c5be9cbec60e8
a6fd8f81b4e690dae5561b85e602a344ea2eb9c3
/src/com/like/entity/RegResult.java
64a51b50b65d89b5c11081e2d8295cc3ce4fbd6c
[]
no_license
lk5103613/Fitness
e79a939acd5bddc67fcfb5691c325f866b02bfea
17914a04f0d9100d75b3bf185de8587e88744581
refs/heads/master
2020-05-17T08:16:17.814233
2015-09-18T01:30:42
2015-09-18T01:30:42
42,403,075
0
0
null
null
null
null
UTF-8
Java
false
false
588
java
package com.like.entity; public class RegResult { public String coachid; public int code; public String truename; public String weight; public String avatar; public String mp; public String pwd; public int gender; public String nickname; public String height; public int status; public String tag; public String idcard; public int score; public int click_cnt; public String skill; public String lng; public String lat; public String add_time; public String coach_description; public String work_experience; public String self_evaluate; public String address; }
[ "524148211@qq.com" ]
524148211@qq.com
15c67c0c592b3e1d8b12bd357b84fab550bc6e20
a33deb2047bd6939a0ca085a12fe861a9893abe6
/Heightmap/src/main/java/com/roger/heightmap/util/ShaderHelper.java
074d0b238ce5b9c225fe8463f15d052dec9fc8c4
[]
no_license
rgr19/OpenGLDemo
addcdf1582ffa94794c93fc3bb8ddebb21b7a044
1f2a1deabcefc0b955e0c11f64a8e0c1de8ba7af
refs/heads/master
2021-09-05T14:47:10.538974
2018-01-29T02:09:25
2018-01-29T02:09:25
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,359
java
package com.roger.heightmap.util; import android.opengl.GLES20; import android.util.Log; /** * Created by Administrator on 2016/6/30. */ public class ShaderHelper { private static final String TAG = "ShaderHelper"; public static int compileVertexShader(String shaderCode) { return compileShader(GLES20.GL_VERTEX_SHADER, shaderCode); } public static int compileFragmentShader(String shaderCode) { return compileShader(GLES20.GL_FRAGMENT_SHADER, shaderCode); } private static int compileShader(int type, String shaderCode) { final int shaderObjectId = GLES20.glCreateShader(type); if (shaderObjectId == 0) { if (LoggerConfig.ON) { Log.w(TAG, "Could not create new shader."); } } GLES20.glShaderSource(shaderObjectId, shaderCode); GLES20.glCompileShader(shaderObjectId); final int[] compileStatus = new int[1]; GLES20.glGetShaderiv(shaderObjectId, GLES20.GL_COMPILE_STATUS, compileStatus, 0); if (LoggerConfig.ON) { Log.v(TAG, "Results of compiling source:" + "\n" + shaderCode + "\n:" + GLES20.glGetShaderInfoLog( shaderObjectId)); } if (compileStatus[0] == 0) { GLES20.glDeleteShader(shaderObjectId); if (LoggerConfig.ON) { Log.w(TAG, "Compilation of shader failed"); } } return shaderObjectId; } public static int linkProgram(int vertexShaderId, int fragmentShaderId) { final int programObjectId = GLES20.glCreateProgram(); if (programObjectId == 0) { Log.w(TAG, "Could not create new program"); } GLES20.glAttachShader(programObjectId, vertexShaderId); GLES20.glAttachShader(programObjectId, fragmentShaderId); GLES20.glLinkProgram(programObjectId); final int[] linkStatus = new int[1]; GLES20.glGetProgramiv(programObjectId, GLES20.GL_LINK_STATUS, linkStatus, 0); if (LoggerConfig.ON) { Log.v(TAG, "Results of linking program:\n" + GLES20.glGetProgramInfoLog(programObjectId)); } if (linkStatus[0] == 0) { GLES20.glDeleteProgram(programObjectId); if (LoggerConfig.ON) { Log.w(TAG, "Linking of program failed."); } } return programObjectId; } public static boolean validateProgram(int programObjectId) { GLES20.glValidateProgram(programObjectId); final int[] validateStatus = new int[1]; GLES20.glGetProgramiv(programObjectId, GLES20.GL_VALIDATE_STATUS, validateStatus, 0); Log.v(TAG, "Results of validating program:" + validateStatus[0] + "\nLog:" + GLES20.glGetProgramInfoLog(programObjectId)); return validateStatus[0] != 0; } public static int buildProgram(String vertexShaderSource, String fragmentShaderSource) { int program; int vertexShader = compileVertexShader(vertexShaderSource); int fragmentShader = compileFragmentShader(fragmentShaderSource); program = linkProgram(vertexShader, fragmentShader); if (LoggerConfig.ON) { validateProgram(program); } return program; } }
[ "765151629@qq.com" ]
765151629@qq.com
405bd7ad07d685bdbf9d11a400b048cbe6565be1
863b8e2248130f75743ebd2a457a87cbd8ffd913
/08_ObjectCommunicationsAndEvents/src/lab_exercise/commands/GroupAttackCommand.java
d9bed122359692e3583453086cf61db0901f711e
[ "MIT" ]
permissive
itonov/Java-OOP-Advanced
23f97f547e6b04653bc7116bdd068c230bf25131
b0053e4e2d990058f49dbb8c3c29c5fa35227692
refs/heads/master
2020-03-08T20:52:37.988644
2018-04-06T13:03:03
2018-04-06T13:03:03
128,393,797
0
0
null
null
null
null
UTF-8
Java
false
false
339
java
package lab_exercise.commands; import lab_exercise.interfaces.AttackGroup; import lab_exercise.interfaces.Command; public class GroupAttackCommand implements Command { private AttackGroup group; public GroupAttackCommand(AttackGroup group) { this.group = group; } @Override public void execute() { } }
[ "itonov3@gmail.com" ]
itonov3@gmail.com
c635524789452c5dc1e1889c1ec9511474319465
589bbf1b096ee6f1e55b644777651ccb819fe631
/ImageViewTouch/src/main/java/it/sephiroth/android/library/imagezoom/ImageViewTouchPanable.java
4034ccd8b986b315a49cd9e834018dcf46f259a1
[]
no_license
jmmrrsn/silent-phone-android
d2a2cd7c4ef8eb2ff2faeb4d4668452f8711fca0
a69c2ed1b82d830891aad5e6dcbd7cc80bc3a3c8
refs/heads/master
2023-03-24T15:50:33.356228
2017-10-13T21:25:09
2017-10-16T12:54:06
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,112
java
package it.sephiroth.android.library.imagezoom; import android.content.Context; import android.graphics.RectF; import android.util.AttributeSet; import android.util.Log; import android.view.MotionEvent; /** * ImageTouchView which can be dragged to a position around a crop rectangle. */ public class ImageViewTouchPanable extends ImageViewTouch { protected RectF mCropRect = new RectF(0.0f, 0.0f, 0.0f, 0.0f); public ImageViewTouchPanable(Context context) { this(context, null); } public ImageViewTouchPanable(Context context, AttributeSet attrs) { super(context, attrs); } @Override public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) { if (!mScrollEnabled) return false; if (e1 == null || e2 == null) return false; if (e1.getPointerCount() > 1 || e2.getPointerCount() > 1) return false; if (mScaleDetector.isInProgress()) return false; mUserScaled = true; scrollBy(-distanceX, -distanceY); invalidate(); return true; } public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) { return false; } public void setCropRect(RectF cropRect) { if (cropRect != null) { mCropRect = cropRect; } } @Override protected void panBy(double dx, double dy) { RectF rect = getBitmapRect(); mScrollRect.set((float) dx, (float) dy, 0, 0); updateRect(rect, mScrollRect); postTranslate(mScrollRect.left, mScrollRect.top); } @Override protected void updateRect(RectF bitmapRect, RectF scrollRect) { if (bitmapRect == null) { return; } if (LOG_ENABLED) { Log.d(LOG_TAG, "updateRect w, h " + getCurrentWidth() + ", " + getCurrentHeight()); Log.d(LOG_TAG, "updateRect bitmapRect " + bitmapRect.left + ", " + bitmapRect.top + ", " + bitmapRect.right + ", " + bitmapRect.bottom); Log.d(LOG_TAG, "updateRect cropRect " + mCropRect.left + ", " + mCropRect.top + ", " + mCropRect.right + ", " + mCropRect.bottom); Log.d(LOG_TAG, "updateRect b scrollRect " + scrollRect.left + ", " + scrollRect.top + ", " + scrollRect.right + ", " + scrollRect.bottom); } float bitmapWidth = bitmapRect.right - bitmapRect.left; float bitmapHeight = bitmapRect.bottom - bitmapRect.top; float cropRectWidth = mCropRect.right - mCropRect.left; float cropRectHeight = mCropRect.bottom - mCropRect.top; // FIXME normalize if (bitmapHeight <= cropRectHeight) { if (bitmapRect.top + scrollRect.top < mCropRect.top) { scrollRect.top = (int) (mCropRect.top - bitmapRect.top); } else if (bitmapRect.bottom + scrollRect.top > mCropRect.bottom) { scrollRect.top = (int) (mCropRect.bottom - bitmapRect.bottom); } } else { if (bitmapRect.top + scrollRect.top < mCropRect.top) { if (scrollRect.top <= 0) { if (bitmapRect.bottom > mCropRect.bottom) { // move up by as much as bottom is below lower crop border scrollRect.top = Math.max(scrollRect.top, mCropRect.bottom - bitmapRect.bottom); } else { // move down by as much as bottom is above lower crop border scrollRect.top = mCropRect.bottom - bitmapRect.bottom; } } } else if (bitmapRect.bottom + scrollRect.top > mCropRect.bottom) { if (scrollRect.top >= 0) { if (bitmapRect.top < mCropRect.top) { // move down by as much as top is over upper crop border scrollRect.top = Math.min(scrollRect.top, mCropRect.top - bitmapRect.top); } else { // move up by as much as top is below of upper crop border scrollRect.top = mCropRect.top - bitmapRect.top; } } } } if (bitmapWidth <= cropRectWidth) { if (bitmapRect.left + scrollRect.left < mCropRect.left) { scrollRect.left = (int) (mCropRect.left - bitmapRect.left); } else if (bitmapRect.right + scrollRect.left > mCropRect.right) { scrollRect.left = (int) (mCropRect.right - bitmapRect.right); } } else { if (bitmapRect.left + scrollRect.left < mCropRect.left) { if (scrollRect.left <= 0) { if (bitmapRect.right > mCropRect.right) { // allow move left as much as right is over right side of screen scrollRect.left = Math.max(scrollRect.left, mCropRect.right - bitmapRect.right); } else { // move right by as much as right is to left of right crop border scrollRect.left = mCropRect.right - bitmapRect.right; } } } else if (bitmapRect.right + scrollRect.left > mCropRect.right) { if (scrollRect.left >= 0) { if (bitmapRect.left < mCropRect.left) { // allow move right by as much as left is over left side of screen scrollRect.left = Math.min(scrollRect.left, mCropRect.left - bitmapRect.left); } else { // move left by as much as left is to right of left crop border scrollRect.left = mCropRect.left - bitmapRect.left; } } } } if (LOG_ENABLED) { Log.d(LOG_TAG, "updateRect a scrollRect " + scrollRect.left + ", " + scrollRect.top + ", " + scrollRect.right + ", " + scrollRect.bottom); } } @Override protected void zoomTo(float scale, float centerX, float centerY) { if (LOG_ENABLED) { Log.d(LOG_TAG, "zoomTo old scale: " + getScale() + ", max scale: " + getMaxScale() + ", min scale: " + getMinScale() + ", centerX: " + centerX + ", centerY: " + centerY); } if (scale > getMaxScale()) scale = getMaxScale(); if (scale < getMinScale()) scale = getMinScale(); float oldScale = getScale(); float deltaScale = scale / oldScale; postScale(deltaScale, centerX, centerY); onZoom(getScale()); panBy(0, 0); } protected float computeMinZoom() { float scale = 1F; if (LOG_ENABLED) { Log.i(LOG_TAG, "computeMinZoom: " + scale); } return scale; } }
[ "rkrueger@silentcircle.com" ]
rkrueger@silentcircle.com
b7b26678acdf318fcb19d355ca9bb3f2b455baa4
c343a0ef45405fb447d6a8735509efe2c1d6febf
/Pucho Codes/Pucho/app/src/main/java/com/indiainnovates/pucho/utils/FontUtil.java
91b37c5363ea6e1a939dc32c800ce4596e93bccc
[]
no_license
MouleshS/SamplesAndroid
89fcc15efb707e63fcf01adf5b02a33f9a5f39c4
8342cc4a5d596a4ac33db12a3c2aa4ef3aaea83e
refs/heads/master
2020-03-18T21:02:51.889155
2018-05-26T16:50:58
2018-05-26T16:50:58
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,465
java
/* * Copyright 2015 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.indiainnovates.pucho.utils; import android.content.Context; import android.graphics.Typeface; import java.util.HashMap; import java.util.Map; /** * Adapted from github.com/romannurik/muzei/ * <p/> * Also see https://code.google.com/p/android/issues/detail?id=9904 */ public class FontUtil { private FontUtil() { } private static final Map<String, Typeface> sTypefaceCache = new HashMap<String, Typeface>(); public static Typeface get(Context context, String font) { synchronized (sTypefaceCache) { if (!sTypefaceCache.containsKey(font)) { Typeface tf = Typeface.createFromAsset( context.getApplicationContext().getAssets(), "fonts/" + font + ".ttf"); sTypefaceCache.put(font, tf); } return sTypefaceCache.get(font); } } }
[ "raghunandankavi2010@gmail.com" ]
raghunandankavi2010@gmail.com
030cc1e1542917881b3511b85fd800b07cc9dc25
6a08f139bf1c988740dfa0e311d17711ba123d01
/org/apache/http/conn/ssl/TrustSelfSignedStrategy.java
5fcff19cfa758c2471a620afe9b46bb3cb174e31
[ "NAIST-2003", "LicenseRef-scancode-unicode", "ICU", "BSD-3-Clause", "LicenseRef-scancode-public-domain" ]
permissive
IceCruelStuff/badlion-src
61e5b927e75ed5b895cb2fff2c2b95668468c7f7
18e0579874b8b55fd765be9c60f2b17d4766d504
refs/heads/master
2022-12-31T00:30:26.246407
2020-06-30T16:50:49
2020-06-30T16:50:49
297,207,115
0
0
NOASSERTION
2020-10-15T06:27:58
2020-09-21T02:23:57
null
UTF-8
Java
false
false
377
java
package org.apache.http.conn.ssl; import java.security.cert.CertificateException; import java.security.cert.X509Certificate; import org.apache.http.conn.ssl.TrustStrategy; public class TrustSelfSignedStrategy implements TrustStrategy { public boolean isTrusted(X509Certificate[] chain, String authType) throws CertificateException { return chain.length == 1; } }
[ "50463419+routerabfrage@users.noreply.github.com" ]
50463419+routerabfrage@users.noreply.github.com
3124bb0b7f97a12771e081914d55be2269d778f8
6602ebf7ad0049bd8816aa3d4d7beb170084f505
/activemqdemo/pay-service/src/main/java/com/tgy/pay/Application.java
d193b20c5aa51b8d013446bd0844529e95199b84
[]
no_license
tgy616/framework
7115880fa6a42206806237f2c5a15ad035e870c9
ebe7a0c3453e05b6def806c8ce423e661f2cdad7
refs/heads/master
2022-12-21T22:44:09.670187
2020-10-24T06:08:49
2020-10-24T06:08:49
198,574,960
0
1
null
2022-12-16T15:17:05
2019-07-24T06:44:41
CSS
UTF-8
Java
false
false
474
java
package com.tgy.pay; import org.mybatis.spring.annotation.MapperScan; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; /** * @author DragonSwimDiving * @program activemqdemo * @Date 2019-07-12 14:26 **/ @SpringBootApplication @MapperScan("com.tgy.pay.mapper") public class Application { public static void main(String[] args) { SpringApplication.run(Application.class, args); } }
[ "418982690@qq.com" ]
418982690@qq.com
4c605853a23ad36b2f12ffbfed2a118be864471b
e412a1dd2f3769fd7824c22cc4da2dae80d223ef
/src/main/java/com/douyin/open/model/MusicTmeSyncBody.java
dd6bc12f0a21cf07f66ec6c6833b15848c879e7e
[]
no_license
jefth/java-sdk-douyin
0f6952a795d417e4d6f46d3b744eab8cc0b5723d
219e8c272d9aad13e7297fc9fc704c507abc1914
refs/heads/master
2022-07-17T12:16:06.720247
2020-05-20T03:44:29
2020-05-20T03:44:29
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,920
java
/* * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * * OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ package com.douyin.open.model; import java.util.Objects; import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import io.swagger.v3.oas.annotations.media.Schema; import java.io.IOException; import java.util.ArrayList; import java.util.List; /** * MusicTmeSyncBody */ public class MusicTmeSyncBody { @SerializedName("songids") private List<String> songids = new ArrayList<String>(); /** * 操作类型: * &#x60;1&#x60; - insert * &#x60;2&#x60; - update * &#x60;3&#x60; - delete */ @JsonAdapter(CmdEnum.Adapter.class) public enum CmdEnum { NUMBER_1(1), NUMBER_2(2), NUMBER_3(3); private Integer value; CmdEnum(Integer value) { this.value = value; } public Integer getValue() { return value; } @Override public String toString() { return String.valueOf(value); } public static CmdEnum fromValue(String text) { for (CmdEnum b : CmdEnum.values()) { if (String.valueOf(b.value).equals(text)) { return b; } } return null; } public static class Adapter extends TypeAdapter<CmdEnum> { @Override public void write(final JsonWriter jsonWriter, final CmdEnum enumeration) throws IOException { jsonWriter.value(enumeration.getValue()); } @Override public CmdEnum read(final JsonReader jsonReader) throws IOException { Integer value = jsonReader.nextInt(); return CmdEnum.fromValue(String.valueOf(value)); } } } @SerializedName("cmd") private CmdEnum cmd = null; public MusicTmeSyncBody songids(List<String> songids) { this.songids = songids; return this; } public MusicTmeSyncBody addSongidsItem(String songidsItem) { this.songids.add(songidsItem); return this; } /** * 歌曲id列表 * @return songids **/ public List<String> getSongids() { return songids; } public void setSongids(List<String> songids) { this.songids = songids; } public MusicTmeSyncBody cmd(CmdEnum cmd) { this.cmd = cmd; return this; } /** * 操作类型: * &#x60;1&#x60; - insert * &#x60;2&#x60; - update * &#x60;3&#x60; - delete * @return cmd **/ public CmdEnum getCmd() { return cmd; } public void setCmd(CmdEnum cmd) { this.cmd = cmd; } @Override public boolean equals(java.lang.Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } MusicTmeSyncBody musicTmeSyncBody = (MusicTmeSyncBody) o; return Objects.equals(this.songids, musicTmeSyncBody.songids) && Objects.equals(this.cmd, musicTmeSyncBody.cmd); } @Override public int hashCode() { return Objects.hash(songids, cmd); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class MusicTmeSyncBody {\n"); sb.append(" songids: ").append(toIndentedString(songids)).append("\n"); sb.append(" cmd: ").append(toIndentedString(cmd)).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 "); } }
[ "lin.wu@landasoft.com" ]
lin.wu@landasoft.com
1cc20a450178e28b3a24afd6e5be3b8686fadd5e
9b7780f95ef454fc586d914263aa7baf15196f56
/ADSI_1349397_trimestre_5/EON/03-Desarrollo/05_JPA_EON/EONJPA/target/generated-sources/annotations/co/edu/sena/eon_jpa/model/jpa/entities/LearningResult_.java
458beeac163a700c8b7b4f6a618b0f108f55eca7
[]
no_license
davidbcaro/ADSI
eaa3cddc4c7225e2fa90bb6c34b792f711294609
5fab220093b0cf3a1d495baa072c3f18107aedb4
refs/heads/master
2022-09-15T14:21:47.912849
2019-06-23T13:02:05
2019-06-23T13:02:05
179,738,287
1
1
null
2022-08-31T23:05:47
2019-04-05T18:54:09
HTML
UTF-8
Java
false
false
1,267
java
package co.edu.sena.eon_jpa.model.jpa.entities; import co.edu.sena.eon_jpa.model.jpa.entities.Activity; import co.edu.sena.eon_jpa.model.jpa.entities.Competition; import co.edu.sena.eon_jpa.model.jpa.entities.FichaHasTrimester; import co.edu.sena.eon_jpa.model.jpa.entities.LearningResultPK; import co.edu.sena.eon_jpa.model.jpa.entities.Trimester; import javax.annotation.Generated; import javax.persistence.metamodel.CollectionAttribute; import javax.persistence.metamodel.SingularAttribute; import javax.persistence.metamodel.StaticMetamodel; @Generated(value="EclipseLink-2.5.2.v20140319-rNA", date="2017-12-06T09:21:14") @StaticMetamodel(LearningResult.class) public class LearningResult_ { public static volatile CollectionAttribute<LearningResult, FichaHasTrimester> fichaHasTrimesterCollection; public static volatile CollectionAttribute<LearningResult, Trimester> trimesterCollection; public static volatile SingularAttribute<LearningResult, String> description; public static volatile SingularAttribute<LearningResult, Competition> competition; public static volatile SingularAttribute<LearningResult, LearningResultPK> learningResultPK; public static volatile CollectionAttribute<LearningResult, Activity> activityCollection; }
[ "davidbcaro@gmail.com" ]
davidbcaro@gmail.com
42c3155f77be9403d971f6ccfb4d3ca538c48d04
92f4b232fde9eb1ae078f55c33f5fc8efbc813be
/multi-datasource/src/main/java/com/learn/action/multidatasource/MultiDatasourceApplication.java
77296c74471de37c010eb73882b1c20a6cdd3f2c
[]
no_license
lastFeng/CollectionMixedCode
0da2b91ccbd4099a604126eb2de96ccf853c937c
f09558c37f3f7d628676525ea7b051f1e5802285
refs/heads/master
2022-12-21T01:07:39.433452
2019-11-01T03:26:02
2019-11-01T03:26:02
199,559,199
0
0
null
2022-12-16T04:58:00
2019-07-30T02:26:21
Java
UTF-8
Java
false
false
355
java
package com.learn.action.multidatasource; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class MultiDatasourceApplication { public static void main(String[] args) { SpringApplication.run(MultiDatasourceApplication.class, args); } }
[ "563805728@qq.com" ]
563805728@qq.com
0b3bf6a9eda3cacf5c8fde36d4b956e222858f36
8eb5f178fe8b7ee19539e7679ee771bf461bb7a9
/src/main/hibernate/demo/CreateStudentDemo.java
23014c63702f408bd8b71ecc87681687e208591f
[]
no_license
demotivirus/HibernateDemo
ff1910da268ac75930f5e886dba458f07b821340
04f21f632c87d00b28fe9ba9da79641dbe670d1f
refs/heads/master
2020-05-18T16:30:21.347659
2019-05-02T13:44:17
2019-05-02T13:44:17
184,528,315
1
0
null
null
null
null
UTF-8
Java
false
false
1,097
java
package main.hibernate.demo; import main.hibernate.entity.Student; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.hibernate.cfg.Configuration; public class CreateStudentDemo { public static void main(String[] args) { //Create session factory SessionFactory sessionFactory = new Configuration() .configure("hibernate.cfg.xml") .addAnnotatedClass(Student.class) .buildSessionFactory(); //Create session Session session = sessionFactory.getCurrentSession(); try{ //Create object System.out.println("Creating new object..."); Student student = new Student("Peter", "Wallker", "peter@gmail.com"); //Start transaction session.beginTransaction(); //Save the object session.save(student); //Commit transaction session.getTransaction().commit(); System.out.println("Done!"); } finally { sessionFactory.close(); } } }
[ "demotivirus@gmail.com" ]
demotivirus@gmail.com
3953c2be27493026bcf1eb342c7f65dcfac6de26
4b8b83e997c046771c2ba8949d1f8744958e36e9
/app/src/main/java/org/jf/dexlib2/immutable/reference/ImmutableFieldReference.java
d3c87968490aee5df98bbf9c81b7e901729c2f00
[ "Apache-2.0", "LicenseRef-scancode-free-unknown" ]
permissive
vaginessa/show-java
978fcf3cfc5e875e3f5f81ad9e47ceb2d60b2dc2
31f540fb9e13a74e0a0ead27715888f022bff14c
refs/heads/master
2021-01-18T04:09:53.521444
2015-12-09T20:58:32
2015-12-09T20:58:32
42,273,420
0
0
Apache-2.0
2019-01-18T07:06:51
2015-09-10T22:12:08
Java
UTF-8
Java
false
false
2,939
java
/* * Copyright 2012, Google Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following disclaimer * in the documentation and/or other materials provided with the * distribution. * * Neither the name of Google Inc. nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jf.dexlib2.immutable.reference; import org.jf.dexlib2.base.reference.BaseFieldReference; import org.jf.dexlib2.iface.reference.FieldReference; import javax.annotation.Nonnull; public class ImmutableFieldReference extends BaseFieldReference implements ImmutableReference { @Nonnull protected final String definingClass; @Nonnull protected final String name; @Nonnull protected final String type; public ImmutableFieldReference(@Nonnull String definingClass, @Nonnull String name, @Nonnull String type) { this.definingClass = definingClass; this.name = name; this.type = type; } @Nonnull public static ImmutableFieldReference of(@Nonnull FieldReference fieldReference) { if (fieldReference instanceof ImmutableFieldReference) { return (ImmutableFieldReference) fieldReference; } return new ImmutableFieldReference( fieldReference.getDefiningClass(), fieldReference.getName(), fieldReference.getType()); } @Nonnull public String getDefiningClass() { return definingClass; } @Nonnull public String getName() { return name; } @Nonnull public String getType() { return type; } }
[ "niranjan94@yahoo.com" ]
niranjan94@yahoo.com
8efef5f25a3f59a8d17a0979efc52266f5fd94ef
c35894bc2cc7d38d01295d81baee76a7dce10b20
/JDBC_ORACLE/src/p01/connections/UpdateExample01.java
f295dc88fcac05f733bd2749cad7d7ef5fbc432f
[]
no_license
jongtix/JAVA_jongtix
93e5c289ed3e514cd481373988f18904b8c698cf
4f9f29456ac3956a34d05428c9bf7df14bb7b718
refs/heads/master
2021-08-29T23:14:02.840808
2017-12-15T07:43:22
2017-12-15T07:43:22
107,648,776
0
0
null
null
null
null
UTF-8
Java
false
false
754
java
package p01.connections; import java.sql.Connection; import java.sql.PreparedStatement; import java.util.Scanner; public class UpdateExample01 { public static void main(String[] args) { try { Scanner scanner = new Scanner(System.in); Connection conn = Connections.getInstance().getConnections(); String sql = "update emp set sal = sal * 1.05 where deptno = ?"; PreparedStatement pstmt = conn.prepareStatement(sql); System.out.println("부서번호를 입력하세요."); pstmt.setInt(1, scanner.nextInt()); int result = pstmt.executeUpdate(); if (result > 0) { System.out.println("업데이트 성공"); } pstmt.close(); conn.close(); } catch (Exception e) { System.out.println(e.getMessage()); } } }
[ "jong1145@naver.com" ]
jong1145@naver.com
0ee4108b987327a6fe60a39a83a3888645534c1d
5a86421f61da5c7faf7443defb06423f18565332
/linguistics/src/main/java/com/yahoo/language/simple/SimpleToken.java
20c41d657e1490d9af09c1cb9be0b304201534ca
[ "LicenseRef-scancode-unknown-license-reference", "Apache-2.0" ]
permissive
t1707/vespa
1d62116f4345dbc5020dbfcab1fc2934e82e5d68
9f4859e9996ac9913ce80ed9b209f683507fe157
refs/heads/master
2021-04-03T06:24:10.556834
2018-03-08T17:02:09
2018-03-08T17:02:09
124,473,863
0
0
Apache-2.0
2018-03-15T06:06:27
2018-03-09T02:07:53
Java
UTF-8
Java
false
false
5,254
java
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.language.simple; import com.yahoo.language.process.Token; import com.yahoo.language.process.TokenScript; import com.yahoo.language.process.TokenType; import java.util.ArrayList; import java.util.List; /** * @author <a href="mailto:mathiasm@yahoo-inc.com">Mathias Mølster Lidal</a> */ public class SimpleToken implements Token { private final List<Token> components = new ArrayList<>(); private final String orig; private TokenType type = TokenType.UNKNOWN; private TokenScript script = TokenScript.UNKNOWN; private String tokenString = null; private boolean specialToken = false; private long offset = 0; public SimpleToken(String orig) { this.orig = orig; } @Override public String getOrig() { return orig; } @Override public int getNumStems() { return tokenString != null ? 1 : 0; } @Override public String getStem(int i) { return tokenString; } @Override public int getNumComponents() { return components.size(); } @Override public Token getComponent(int i) { return components.get(i); } public SimpleToken addComponent(Token token) { components.add(token); return this; } @Override public String getTokenString() { return tokenString; } public SimpleToken setTokenString(String str) { tokenString = str; return this; } @Override public TokenType getType() { return type; } public SimpleToken setType(TokenType type) { this.type = type; return this; } @Override public TokenScript getScript() { return script; } public SimpleToken setScript(TokenScript script) { this.script = script; return this; } @Override public boolean isSpecialToken() { return specialToken; } public SimpleToken setSpecialToken(boolean specialToken) { this.specialToken = specialToken; return this; } @Override public long getOffset() { return offset; } public SimpleToken setOffset(long offset) { this.offset = offset; return this; } @Override public int hashCode() { return orig.hashCode(); } @Override public boolean equals(Object obj) { if (!(obj instanceof Token)) { return false; } Token rhs = (Token)obj; if (!getType().equals(rhs.getType())) { return false; } if (!equalsOpt(getOrig(), rhs.getOrig())) { return false; } if (getOffset() != rhs.getOffset()) { return false; } if (!equalsOpt(getScript(), rhs.getScript())) { return false; } if (!equalsOpt(getTokenString(), rhs.getTokenString())) { return false; } if (isSpecialToken() != rhs.isSpecialToken()) { return false; } if (getNumComponents() != rhs.getNumComponents()) { return false; } for (int i = 0, len = getNumComponents(); i < len; ++i) { if (!equalsOpt(getComponent(i), rhs.getComponent(i))) { return false; } } return true; } private static boolean equalsOpt(Object lhs, Object rhs) { if (lhs == null || rhs == null) { return lhs == rhs; } return lhs.equals(rhs); } @Override public String toString() { return "token : " + getClass().getSimpleName() + " {\n" + toString(this, " ") + "}"; } private static String toString(Token token, String indent) { StringBuilder builder = new StringBuilder(); builder.append(indent).append("components : {\n"); for (int i = 0, len = token.getNumComponents(); i < len; ++i) { Token comp = token.getComponent(i); builder.append(indent).append(" [").append(i).append("] : ").append(comp.getClass().getSimpleName()); builder.append(" {\n").append(toString(comp, indent + " ")); builder.append(indent).append(" }\n"); } builder.append(indent).append("}\n"); builder.append(indent).append("offset : ").append(token.getOffset()).append("\n"); builder.append(indent).append("orig : ").append(quoteString(token.getOrig())).append("\n"); builder.append(indent).append("script : ").append(token.getScript()).append("\n"); builder.append(indent).append("special : ").append(token.isSpecialToken()).append("\n"); builder.append(indent).append("token string : ").append(quoteString(token.getTokenString())).append("\n"); builder.append(indent).append("type : ").append(token.getType()).append("\n"); return builder.toString(); } private static String quoteString(String str) { return str != null ? "'" + str + "'" : null; } @Override public boolean isIndexable() { return getType().isIndexable() && (getOrig().length() > 0); } }
[ "bratseth@yahoo-inc.com" ]
bratseth@yahoo-inc.com
bcd5e3ad5863b09f44829e5bfa9aae1d132edf4f
e91a15900a2049d70be4f01014f345fd227172d7
/src/day21/LoopControl2repeat.java
ac8de3e500317578f7672702fcf66f030daa6d74
[]
no_license
AliceGitProj/day01
67be3589ffbd53ddfd3a4b66f8c621b57edd10b2
27d5126c078d9d1123e958337a734727469fda56
refs/heads/master
2022-04-04T16:55:43.051688
2020-02-23T22:32:35
2020-02-23T22:32:35
null
0
0
null
null
null
null
UTF-8
Java
false
false
283
java
package day21; public class LoopControl2repeat { public static void main(String[] args) { for (int x = 1 ; x <= 10 ; x++) { if(x%2==0){ continue; } System.out.println(x); } } }
[ "hi.alesya@gmail.com" ]
hi.alesya@gmail.com
3fdea303915919bac4c215ed340e06aeea7bc8df
fbc78e5eef0ec352ff501359f47cf3664239d9ea
/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/android12/ImageSections_12.java
a16929d28552430438cd407427a78b9fbcc331f6
[ "Apache-2.0", "GPL-1.0-or-later", "GPL-3.0-only", "LicenseRef-scancode-public-domain", "LGPL-2.1-only", "LicenseRef-scancode-unknown-license-reference" ]
permissive
AYIDouble/ghidra
a6b218b823bf475ac010a82840bf99e09dfc14e5
3066bc941ce89a66e8dced1f558cc352a6f38fdd
refs/heads/master
2022-05-27T04:09:13.440867
2022-04-30T23:25:27
2022-04-30T23:25:27
203,525,745
20
2
Apache-2.0
2019-08-21T07:02:35
2019-08-21T06:58:25
Java
UTF-8
Java
false
false
2,906
java
/* ### * IP: GHIDRA * * 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 ghidra.file.formats.android.art.android12; import ghidra.app.util.bin.BinaryReader; import ghidra.file.formats.android.art.ArtHeader; import ghidra.file.formats.android.art.ArtImageSections; /** * https://android.googlesource.com/platform/art/+/refs/heads/android-s-beta-4/runtime/image.h#254 * * https://android.googlesource.com/platform/art/+/refs/heads/android-s-beta-4/runtime/image.h#254 */ public class ImageSections_12 extends ArtImageSections { public final static int kSectionObjects = 0; public final static int kSectionArtFields = 1; public final static int kSectionArtMethods = 2; public final static int kSectionRuntimeMethods = 3; public final static int kSectionImTables = 4; public final static int kSectionIMTConflictTables = 5; public final static int kSectionInternedStrings = 6; public final static int kSectionClassTable = 8; public final static int kSectionStringReferenceOffsets = 9; public final static int kSectionMetadata = 10; public final static int kSectionImageBitmap = 11; public final static int kSectionCount = 12; // Number of elements in enum. public ImageSections_12(BinaryReader reader, ArtHeader header) { super(reader, header); } @Override public int get_kSectionObjects() { return kSectionObjects; } @Override public int get_kSectionArtFields() { return kSectionArtFields; } @Override public int get_kSectionArtMethods() { return kSectionArtMethods; } @Override public int get_kSectionRuntimeMethods() { return kSectionRuntimeMethods; } @Override public int get_kSectionImTables() { return kSectionImTables; } @Override public int get_kSectionIMTConflictTables() { return kSectionIMTConflictTables; } @Override public int get_kSectionDexCacheArrays() { return UNSUPPORTED_SECTION; } @Override public int get_kSectionInternedStrings() { return kSectionInternedStrings; } @Override public int get_kSectionClassTable() { return kSectionClassTable; } @Override public int get_kSectionStringReferenceOffsets() { return kSectionStringReferenceOffsets; } @Override public int get_kSectionMetadata() { return kSectionMetadata; } @Override public int get_kSectionImageBitmap() { return kSectionImageBitmap; } @Override public int get_kSectionCount() { return kSectionCount; } }
[ "ryanmkurtz@users.noreply.github.com" ]
ryanmkurtz@users.noreply.github.com
e943f0c0f97fb09042cc002988d0d1acadc76628
b4f5832a68409b826e3c6579b890f9025b4e82ef
/Android/File/app/src/main/java/com/example/vaith/file/MainActivity.java
284efcfc917d4a3d3cd8e1c984ae7a9a665a9cd2
[]
no_license
vaithwee/Learning-And-Learning
bce96a6ff90804a44864577a6e388d7e2e0be8ba
b88d2cfbb7539c4b73f0a6a9dfa7e857a3274c15
refs/heads/master
2020-04-16T08:24:26.074921
2016-09-22T02:13:21
2016-09-22T02:13:21
63,850,874
0
0
null
null
null
null
UTF-8
Java
false
false
2,391
java
package com.example.vaith.file; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.EditText; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.PrintStream; public class MainActivity extends AppCompatActivity { final String FILE_NAME = "com.vaith.file"; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); System.out.println(new StringBuilder("a").append("b").append("c").toString()); Button read = (Button) findViewById(R.id.read); final Button write = (Button) findViewById(R.id.write); final EditText editText1 = (EditText) findViewById(R.id.edit1); final EditText editText2 = (EditText) findViewById(R.id.edit2); assert write != null; write.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { assert editText1 != null; write(editText1.getText().toString()); editText1.setText(""); } }); assert read != null; read.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { assert editText2 != null; editText2.setText(read()); } }); } public String read() { try { FileInputStream fis = openFileInput(FILE_NAME); byte[] buff = new byte[1024]; int hasRead = 0; StringBuffer stringBuffer = new StringBuffer(""); while ((hasRead = fis.read(buff)) > 0) { stringBuffer.append(new String(buff, 0, hasRead)); } fis.close(); return stringBuffer.toString(); } catch (Exception e) { e.printStackTrace(); } return null; } public void write(String string) { try { FileOutputStream fos = openFileOutput(FILE_NAME, MODE_PRIVATE); PrintStream ps = new PrintStream(fos); ps.println(string); ps.close(); } catch (Exception e) { e.printStackTrace(); } } }
[ "vaithwee@yeah.net" ]
vaithwee@yeah.net
3cfb1adf7772e829db8e67ba20a8a7681145ebdc
ee042835b7142607f862ce2e06c473a52468d5c0
/JavaWeb_Pro30_Board/src/main/java/com/javaweb/bcjin/member/controller/MemberController.java
594e94764bc15a967755db1961b0495ffb7142a6
[]
no_license
bc0086/Study_JavaWeb_Gilbut
ca8ea468526ca1a0e186615741ada240448960d9
95cfa753a3136fdfd2dce06f15502569fa6be682
refs/heads/main
2023-03-21T14:10:45.133838
2021-03-12T10:55:09
2021-03-12T10:55:09
343,346,095
0
0
null
null
null
null
UTF-8
Java
false
false
1,203
java
package com.javaweb.bcjin.member.controller; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.mvc.support.RedirectAttributes; import com.javaweb.bcjin.member.vo.MemberVO; public interface MemberController { public ModelAndView listMembers(HttpServletRequest request, HttpServletResponse response) throws Exception; ModelAndView addMember(@ModelAttribute("info") MemberVO memberVO, HttpServletRequest request, HttpServletResponse response) throws Exception; ModelAndView removeMember(@RequestParam("id") String id, HttpServletRequest request, HttpServletResponse response) throws Exception; ModelAndView login(MemberVO member, RedirectAttributes rAttr, HttpServletRequest request, HttpServletResponse response) throws Exception; ModelAndView logout(HttpServletRequest request, HttpServletResponse response) throws Exception; }
[ "bc0086@naver.com" ]
bc0086@naver.com
856b3b615343d0a1bb435d8d6fa21cd60f691468
0f78654f9cc5141da190d62e2200dc14343322ab
/leopard-data/src/main/java/io/leopard/schema/MemcacheDsnBeanDefinitionParser.java
7f17163503393980e1d05c2f4f293696d9fcbbb1
[ "Apache-2.0" ]
permissive
xinhuayw/leopard
ae8294c83ef693a8374e782a1563f81c29eab40c
88d4e56c4851a80a1a35b87a7fa283c31c33fd21
refs/heads/master
2021-08-15T20:46:51.144821
2017-11-18T08:26:46
2017-11-18T08:26:46
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,151
java
package io.leopard.schema; import org.apache.commons.lang.StringUtils; import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.beans.factory.support.BeanDefinitionBuilder; import org.springframework.beans.factory.xml.BeanDefinitionParser; import org.springframework.beans.factory.xml.ParserContext; import org.w3c.dom.Element; import io.leopard.data.schema.RegisterComponentUtil; /** * Redis数据源标签 * * @author 阿海 * */ public class MemcacheDsnBeanDefinitionParser implements BeanDefinitionParser { @Override public BeanDefinition parse(Element element, ParserContext parserContext) { // BeanDefinitionParserUtil.printParserContext(MemcacheDsnBeanDefinitionParser.class, parserContext); String id = element.getAttribute("id"); String name = element.getAttribute("name"); String maxActive = element.getAttribute("maxActive"); String initialPoolSize = element.getAttribute("initialPoolSize"); String timeout = element.getAttribute("timeout"); BeanDefinitionBuilder builder = BeanDefinitionBuilder.genericBeanDefinition(DataSourceManager.getMemcacheRedisImpl()); String server = this.getServer(name); builder.addPropertyValue("server", server); if (StringUtils.isNotEmpty(maxActive)) { builder.addPropertyValue("maxActive", Integer.valueOf(maxActive)); } if (StringUtils.isNotEmpty(initialPoolSize)) { builder.addPropertyValue("initialPoolSize", Integer.valueOf(initialPoolSize)); } if (StringUtils.isNotEmpty(timeout)) { builder.addPropertyValue("timeout", Integer.valueOf(timeout)); } builder.setScope(BeanDefinition.SCOPE_SINGLETON); builder.setLazyInit(false); builder.setInitMethodName("init"); builder.setDestroyMethodName("destroy"); return RegisterComponentUtil.registerComponent(parserContext, builder, id); } protected String getServer(String name) { // active1.redis.host=172.17.1.236 // active1.redis.port=6311 return "${" + name + ".redis}"; // return "${" + name + ".redis.host}"; // return "${" + name + ".redis.host}:${" + name + ".redis.port}"; } }
[ "tanhaichao@gmail.com" ]
tanhaichao@gmail.com
0bb70a8f9af262a8c3dbc60228ac6830f2165f0d
4d6b71ba7e67e2328f0a96d4fc9519e14d903019
/src/main/java/com/resource/server/service/mapper/PhoneNumberTypeMapper.java
a06547d61459ef900716f939bd995287de76dcc6
[]
no_license
thetlwinoo/resource-server
5de0b6de8ab86833a2e309dd4d4f237cb6642139
c0c2e6e064e646559461f8058cd74dde04e42dac
refs/heads/master
2023-05-14T17:23:55.921409
2019-10-22T02:44:27
2019-10-22T02:44:27
199,976,332
0
1
null
2023-05-06T10:38:19
2019-08-01T04:27:00
Java
UTF-8
Java
false
false
643
java
package com.resource.server.service.mapper; import com.resource.server.domain.*; import com.resource.server.service.dto.PhoneNumberTypeDTO; import org.mapstruct.*; /** * Mapper for the entity PhoneNumberType and its DTO PhoneNumberTypeDTO. */ @Mapper(componentModel = "spring", uses = {}) public interface PhoneNumberTypeMapper extends EntityMapper<PhoneNumberTypeDTO, PhoneNumberType> { default PhoneNumberType fromId(Long id) { if (id == null) { return null; } PhoneNumberType phoneNumberType = new PhoneNumberType(); phoneNumberType.setId(id); return phoneNumberType; } }
[ "thetlwinoo85@yahoo.com" ]
thetlwinoo85@yahoo.com
d72b692cb98f5f8fa09ead43d695d033014b95ec
5e3235edf3de262f4d10b9e9e1fcc3bd13d6b8b1
/Code Snippet Repository/Maven/Maven580.java
995a4d690a8ac182586bc0fb6c11578a4457f8b0
[]
no_license
saber13812002/DeepCRM
3336a244d4852a364800af3181e03e868cf6f9f5
be3e5e50e34a042d5ba7259ff5ff75c08ab32bb9
refs/heads/master
2023-03-16T00:08:06.473699
2018-04-18T05:29:50
2018-04-18T05:29:50
null
0
0
null
null
null
null
UTF-8
Java
false
false
758
java
public File translatePath( File path ) { File result = path; if ( path != null && basedir != null ) { if ( path.isAbsolute() ) { // path is already absolute, we're done } else if ( path.getPath().startsWith( File.separator ) ) { // drive-relative Windows path, don't align with base dir but with drive root result = path.getAbsoluteFile(); } else { // an ordinary relative path, align with base dir result = new File( new File( basedir, path.getPath() ).toURI().normalize() ).getAbsoluteFile(); } } return result; }
[ "Qing.Mi@my.cityu.edu.hk" ]
Qing.Mi@my.cityu.edu.hk
2a1bfd101f711b2be33913a57bbb89fe272f43c7
5617ca5c5314bd1dd7813190c134accb4bb3d690
/src/ReversedLinkedList.java
e2b6e65a5b26c75e4341c25d6da30db208762919
[]
no_license
LYDongD/leetcode
97b51766a91aacd8c19baafc71ab25a779f3a951
4821c38d6027c90a2f1b636b41f7bb8b8880d03d
refs/heads/master
2020-03-26T14:21:16.271612
2018-11-01T13:57:18
2018-11-01T13:57:18
144,983,842
4
0
null
null
null
null
UTF-8
Java
false
false
1,233
java
public class ReversedLinkedList { // Reverse a singly linked list. // // Example: // // Input: 1->2->3->4->5->NULL // Output: 5->4->3->2->1->NULL // Follow up: // // A linked list can be reversed either iteratively or recursively. Could you implement both? private static class ListNode { int val; ListNode next; ListNode(int x) { this.val = x; } } public ListNode reverseListIteratively(ListNode head) { if (head == null) return null; ListNode cursor = head; ListNode prevCursor = null; while (cursor != null){ ListNode succeedCursor = cursor.next; cursor.next = prevCursor; prevCursor = cursor; cursor = succeedCursor; } head = prevCursor; return head; } public ListNode reverseListRecursively(ListNode head) { return reverse(null, head); } private ListNode reverse(ListNode prevCursor, ListNode cursor){ if (cursor == null){ return prevCursor; } ListNode succceedCursor = cursor.next; cursor.next = prevCursor; return reverse(cursor, succceedCursor); } }
[ "554050334@qq.com" ]
554050334@qq.com
3a5c65d8d31b621beff7c690301e2adeecac4bcf
d85028f6a7c72c6e6daa1dd9c855d4720fc8b655
/net/md_5/bungee/protocol/packet/KeepAlive.java
4534387be4034e8dd8222deb82477b335c2ebf5c
[]
no_license
RavenLeaks/Aegis-src-cfr
85fb34c2b9437adf1631b103f555baca6353e5d5
9815c07b0468cbba8d1efbfe7643351b36665115
refs/heads/master
2022-10-13T02:09:08.049217
2020-06-09T15:31:27
2020-06-09T15:31:27
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,127
java
/* * Decompiled with CFR <Could not determine version>. */ package net.md_5.bungee.protocol.packet; import io.netty.buffer.ByteBuf; import net.md_5.bungee.protocol.AbstractPacketHandler; import net.md_5.bungee.protocol.DefinedPacket; import net.md_5.bungee.protocol.ProtocolConstants; public class KeepAlive extends DefinedPacket { private long randomId; @Override public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { this.randomId = protocolVersion >= 340 ? buf.readLong() : (long)KeepAlive.readVarInt((ByteBuf)buf); } @Override public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { if (protocolVersion >= 340) { buf.writeLong((long)this.randomId); return; } KeepAlive.writeVarInt((int)((int)this.randomId), (ByteBuf)buf); } @Override public void handle(AbstractPacketHandler handler) throws Exception { handler.handle((KeepAlive)this); } public long getRandomId() { return this.randomId; } public void setRandomId(long randomId) { this.randomId = randomId; } @Override public String toString() { return "KeepAlive(randomId=" + this.getRandomId() + ")"; } public KeepAlive() { } public KeepAlive(long randomId) { this.randomId = randomId; } @Override public boolean equals(Object o) { if (o == this) { return true; } if (!(o instanceof KeepAlive)) { return false; } KeepAlive other = (KeepAlive)o; if (!other.canEqual((Object)this)) { return false; } if (this.getRandomId() == other.getRandomId()) return true; return false; } protected boolean canEqual(Object other) { return other instanceof KeepAlive; } @Override public int hashCode() { int PRIME = 59; int result = 1; long $randomId = this.getRandomId(); return result * 59 + (int)($randomId >>> 32 ^ $randomId); } }
[ "emlin2021@gmail.com" ]
emlin2021@gmail.com
8ed0e8ffe5b5d277574b4acaca6fbad806f11697
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/30/30_2a75558b051f17f61fe2d9ed605a518729c26caf/UploadFile/30_2a75558b051f17f61fe2d9ed605a518729c26caf_UploadFile_t.java
7ff89127c81266022b4343f3531fe61c977f906c
[]
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
2,163
java
package marubinotto.piggydb.ui.page.partial; import java.io.File; import java.io.IOException; import marubinotto.piggydb.model.entity.RawFragment; import marubinotto.piggydb.ui.page.common.PageImports; import marubinotto.util.Size; import marubinotto.util.message.CodedException; import net.sf.click.util.ClickUtils; import org.apache.commons.fileupload.FileItem; import org.apache.commons.io.FileUtils; import org.apache.commons.io.FilenameUtils; public class UploadFile extends AbstractPartial { public final String jQueryPath = PageImports.JQUERY_PATH; public String fileName; public String fileType; public Size fileSize; public String uploadedFilePath; public boolean isImageFile = false; @Override protected void setModels() throws Exception { super.setModels(); if (!canUploadFile()) throw new CodedException("no-authority-for-page"); if (!getContext().isMultipartRequest()) { this.error = "Not a multipart content"; return; } FileItem fileItem = getContext().getFileItem("file"); if (fileItem == null) { this.error = "The file is missing"; return; } this.fileName = FilenameUtils.getName(fileItem.getName()); this.fileType = RawFragment.getFileType(this.fileName); this.fileSize = new Size(fileItem.getSize()); File file = createUploadFilePath(this.fileType); fileItem.write(file); this.uploadedFilePath = "/" + UPLOAD_DIR_NAME + "/" + file.getName(); String mimeType = ClickUtils.getMimeType(this.fileName); if (mimeType != null) { this.isImageFile = mimeType.startsWith("image/"); } } private static final String UPLOAD_DIR_NAME = "upload"; private File getUploadDir() throws IOException { File dir = new File(getContext().getServletContext().getRealPath("/" + UPLOAD_DIR_NAME)); if (!dir.isDirectory()) FileUtils.forceMkdir(dir); return dir; } private File createUploadFilePath(String fileType) throws IOException { return File.createTempFile( getContext().getSession().getId() + "_", (fileType != null ? ("." + fileType) : ""), getUploadDir()); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
3a77ee70d1c8d695dd72786bba2b204c958fb30a
9caaa729389a3f05cb2f35951efae53f253e727b
/src/test/java/test/PubTestDemoYouWuKu.java
27a586c70e06a1271e2dc97bd2754d23072384bf
[]
no_license
GSIL-Monitor/order
ed2123f2f973876865342bb60370616c11e0d0da
b52e384ff2455cacf55179eaf9d765f7a0eca454
refs/heads/master
2020-04-23T15:34:57.098968
2019-02-18T09:52:12
2019-02-18T09:52:12
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,426
java
package test; import java.util.ArrayList; import java.util.Collections; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; import org.junit.runner.RunWith; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.wildhorse.server.core.utils.encryptUtils.MD5; import com.emotte.order.util.DateUtil; import com.emotte.order.util.HttpUtil; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = { "classpath*:/application*.xml"}) public class PubTestDemoYouWuKu { public String getSign(String aa){ /*$tmp_param = $this->argSort($param) ; $tmp_param_str = $this->createLinkstring($tmp_param) ; $sign_param_str = $param["uid"].$tmp_param_str ; $sign = strtoupper(md5($sign_param_str)) ;*/ return null ; } /*@Resource TestService testService; @org.junit.Test public void testDubbo(){ String tt = testService.testDubbo("测试接口"); System.out.println(tt); }*/ @org.junit.Test public void testPiPei(){ System.out.println("测试匹配"); HashMap<String, String> map = new HashMap<String, String>(); map.put("USER_ID","123"); map.put("USER_NAME", ""); map.put("REAL_NAME", ""); String result = HttpUtil.post("http://hjcrm.95081.com/ekt_gjb/index.php/gjb/cc_interface/register_sync",map, null, null); net.sf.json.JSONObject jo = net.sf.json.JSONObject.fromObject(result); } @org.junit.Test public String sign(Map<String,String> map){ System.out.println("asdadasd"); map = new HashMap<String, String>(); map.put("zz", "23"); map.put("mm", "324"); map.put("ss", "234"); map.put("aa", "324"); map.put("bb", "234"); if(map==null||map.isEmpty()) return null; Set<String> set1 = map.keySet(); List ll = new ArrayList(set1); Collections.sort(ll); for (Object obj : ll) { System.out.println(obj); } return null; } public static void main(String[] args) { System.out.println(DateUtil.dateToTimeStamp(new Date())); String client_id="w29244"; //商家client_id,平台提供 String appscret="1df301128b42d4992ced511248fba350"; //商家密钥,平台提供 String v ="3.0"; //版本号 String platform = "sina"; //请求平台数据,目前仅支持sina String sign_type="md5"; //签名加密方式,目前仅支持md5加密方式,默认md5 String format = "json"; //数据返回格式,目前仅支持json格式 String timestamp=DateUtil.dateToTimeStamp(new Date()); String host = "http://bestweshop.dianking.cn/egou/index.php/api/uwuku/"; //请求主机地址请勿修改 String method = "youwuku.order.get"; String request_type = "order"; System.out.println("asdadasd"); HashMap<String,String> map = new HashMap<String, String>(); //map.put("appscret", appscret); map.put("uid", client_id); map.put("platform", platform); map.put("sign_type", sign_type); map.put("format", format); map.put("v", v); map.put("request_type", request_type); map.put("method", method); map.put("timestamp",timestamp); map.put("fields", "tid,status,payment,total_fee"); map.put("page", "1"); map.put("page_no", "5"); Set<String> set1 = map.keySet(); List ll = new ArrayList(set1); Collections.sort(ll); StringBuffer bf = new StringBuffer(""); StringBuffer bfSim = new StringBuffer(""); for (Object obj : ll) { System.out.println(obj+"="+map.get(obj)); //bf.append(obj+"="+map.get(obj)+"&"); bfSim.append(obj+map.get(obj)); } //String ss =bf.toString().substring(0,bf.toString().length()-1); //System.out.println(ss); String a ="appscret"+appscret+bfSim.toString(); System.out.println("::::::"+a); String canAndVal = client_id+a; System.out.println("11::::"+canAndVal); String sign = (MD5.MD5Encode(canAndVal).toUpperCase()); System.out.println(sign); map.put("sign", sign); //System.out.println(MD5.MD5Encode("123456").toUpperCase()); String url = host+request_type; String result = HttpUtil.post(url,map, null, null); System.out.println(result); net.sf.json.JSONObject jo = net.sf.json.JSONObject.fromObject(result); System.out.println(jo); } }
[ "you@example.com" ]
you@example.com
6966c0fb9b7594b20eb10b8f017733f2fcd53a5f
13ff7e1297b0afb829c19cf3a3ceb7c3496d8338
/ripple-bouncycastle/src/main/java/org/ripple/bouncycastle/crypto/agreement/jpake/JPAKEPrimeOrderGroup.java
58d64a09fd92b26489f3cb2f460899788ed11688
[ "ISC", "LicenseRef-scancode-unknown-license-reference", "MIT" ]
permissive
xuejue/radarj
78c2587e75ae8da6d37f5558768dcc5970f927d4
a4df68465e20d0ee9fce3a85e37c661eb2cec436
refs/heads/master
2020-06-19T13:25:26.057524
2016-05-12T08:45:28
2016-05-12T08:45:28
196,725,163
4
0
null
2019-07-13T13:32:15
2019-07-13T13:32:15
null
UTF-8
Java
false
false
3,826
java
package org.ripple.bouncycastle.crypto.agreement.jpake; import java.math.BigInteger; /** * A pre-computed prime order group for use during a J-PAKE exchange. * <p/> * <p/> * Typically a Schnorr group is used. In general, J-PAKE can use any prime order group * that is suitable for public key cryptography, including elliptic curve cryptography. * <p/> * <p/> * See {@link JPAKEPrimeOrderGroups} for convenient standard groups. * <p/> * <p/> * NIST <a href="http://csrc.nist.gov/groups/ST/toolkit/documents/Examples/DSA2_All.pdf">publishes</a> * many groups that can be used for the desired level of security. */ public class JPAKEPrimeOrderGroup { private final BigInteger p; private final BigInteger q; private final BigInteger g; /** * Constructs a new {@link JPAKEPrimeOrderGroup}. * <p/> * <p/> * In general, you should use one of the pre-approved groups from * {@link JPAKEPrimeOrderGroups}, rather than manually constructing one. * <p/> * <p/> * The following basic checks are performed: * <ul> * <li>p-1 must be evenly divisible by q</li> * <li>g must be in [2, p-1]</li> * <li>g^q mod p must equal 1</li> * <li>p must be prime (within reasonably certainty)</li> * <li>q must be prime (within reasonably certainty)</li> * </ul> * <p/> * <p/> * The prime checks are performed using {@link BigInteger#isProbablePrime(int)}, * and are therefore subject to the same probability guarantees. * <p/> * <p/> * These checks prevent trivial mistakes. * However, due to the small uncertainties if p and q are not prime, * advanced attacks are not prevented. * Use it at your own risk. * * @throws NullPointerException if any argument is null * @throws IllegalArgumentException if any of the above validations fail */ public JPAKEPrimeOrderGroup(BigInteger p, BigInteger q, BigInteger g) { /* * Don't skip the checks on user-specified groups. */ this(p, q, g, false); } /** * Internal package-private constructor used by the pre-approved * groups in {@link JPAKEPrimeOrderGroups}. * These pre-approved groups can avoid the expensive checks. */ JPAKEPrimeOrderGroup(BigInteger p, BigInteger q, BigInteger g, boolean skipChecks) { JPAKEUtil.validateNotNull(p, "p"); JPAKEUtil.validateNotNull(q, "q"); JPAKEUtil.validateNotNull(g, "g"); if (!skipChecks) { if (!p.subtract(JPAKEUtil.ONE).mod(q).equals(JPAKEUtil.ZERO)) { throw new IllegalArgumentException("p-1 must be evenly divisible by q"); } if (g.compareTo(BigInteger.valueOf(2)) == -1 || g.compareTo(p.subtract(JPAKEUtil.ONE)) == 1) { throw new IllegalArgumentException("g must be in [2, p-1]"); } if (!g.modPow(q, p).equals(JPAKEUtil.ONE)) { throw new IllegalArgumentException("g^q mod p must equal 1"); } /* * Note that these checks do not guarantee that p and q are prime. * We just have reasonable certainty that they are prime. */ if (!p.isProbablePrime(20)) { throw new IllegalArgumentException("p must be prime"); } if (!q.isProbablePrime(20)) { throw new IllegalArgumentException("q must be prime"); } } this.p = p; this.q = q; this.g = g; } public BigInteger getP() { return p; } public BigInteger getQ() { return q; } public BigInteger getG() { return g; } }
[ "boncrypto@gmail.com" ]
boncrypto@gmail.com
3b9b898c49937812492af81665945b9ecddb0003
523584d00978ce9398d0d4b5cf33a318110ddadb
/src-pos/uk/chromis/pos/printer/ScrollAnimator.java
29c62111d9bc3d075990f784a64128ce88655089
[]
no_license
zenonarg/Chromis
8bbd687d763f4bf258984e46825257486bc49265
8211d7e1f3aa0e5d858e105a392795bf05c39924
refs/heads/master
2023-04-26T09:31:06.394569
2021-01-12T15:26:15
2021-01-12T15:26:15
312,036,399
1
0
null
2021-01-12T14:57:42
2020-11-11T17:06:35
null
UTF-8
Java
false
false
1,949
java
/* ** Chromis POS - The New Face of Open Source POS ** Copyright (c)2015-2016 ** http://www.chromis.co.uk ** ** This file is part of Chromis POS Version V0.60.2 beta ** ** Chromis POS is free software: you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation, either version 3 of the License, or ** (at your option) any later version. ** ** Chromis POS 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 Chromis POS. If not, see <http://www.gnu.org/licenses/> ** ** */ package uk.chromis.pos.printer; /** * * @author adrianromero */ public class ScrollAnimator extends BaseAnimator { private int msglength; /** * * @param line1 * @param line2 */ public ScrollAnimator(String line1, String line2) { msglength = Math.max(line1.length(), line2.length()); baseLine1 = DeviceTicket.alignLeft(line1, msglength); baseLine2 = DeviceTicket.alignLeft(line2, msglength); } /** * * @param i */ @Override public void setTiming(int i) { int j = (i / 2) % (msglength + 20); if (j < 20) { currentLine1 = DeviceTicket.alignLeft(DeviceTicket.getWhiteString(20 - j) + baseLine1, 20); currentLine2 = DeviceTicket.alignLeft(DeviceTicket.getWhiteString(20 - j) + baseLine2, 20); } else { currentLine1 = DeviceTicket.alignLeft(baseLine1.substring(j - 20), 20); currentLine2 = DeviceTicket.alignLeft(baseLine2.substring(j - 20), 20); } } }
[ "john@chromis.co.uk" ]
john@chromis.co.uk
82414544555bb98621936844083ca612975dcc3b
7559bead0c8a6ad16f016094ea821a62df31348a
/src/com/vmware/vim25/ReplicationDiskConfigFault.java
69df5f0581877d00c2c9c861d4a1ecda857a7206
[]
no_license
ZhaoxuepengS/VsphereTest
09ba2af6f0a02d673feb9579daf14e82b7317c36
59ddb972ce666534bf58d84322d8547ad3493b6e
refs/heads/master
2021-07-21T13:03:32.346381
2017-11-01T12:30:18
2017-11-01T12:30:18
109,128,993
1
1
null
null
null
null
UTF-8
Java
false
false
2,638
java
package com.vmware.vim25; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for ReplicationDiskConfigFault complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="ReplicationDiskConfigFault"> * &lt;complexContent> * &lt;extension base="{urn:vim25}ReplicationConfigFault"> * &lt;sequence> * &lt;element name="reason" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="vmRef" type="{urn:vim25}ManagedObjectReference" minOccurs="0"/> * &lt;element name="key" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/> * &lt;/sequence> * &lt;/extension> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "ReplicationDiskConfigFault", propOrder = { "reason", "vmRef", "key" }) public class ReplicationDiskConfigFault extends ReplicationConfigFault { protected String reason; protected ManagedObjectReference vmRef; protected Integer key; /** * Gets the value of the reason property. * * @return * possible object is * {@link String } * */ public String getReason() { return reason; } /** * Sets the value of the reason property. * * @param value * allowed object is * {@link String } * */ public void setReason(String value) { this.reason = value; } /** * Gets the value of the vmRef property. * * @return * possible object is * {@link ManagedObjectReference } * */ public ManagedObjectReference getVmRef() { return vmRef; } /** * Sets the value of the vmRef property. * * @param value * allowed object is * {@link ManagedObjectReference } * */ public void setVmRef(ManagedObjectReference value) { this.vmRef = value; } /** * Gets the value of the key property. * * @return * possible object is * {@link Integer } * */ public Integer getKey() { return key; } /** * Sets the value of the key property. * * @param value * allowed object is * {@link Integer } * */ public void setKey(Integer value) { this.key = value; } }
[ "495149700@qq.com" ]
495149700@qq.com
b86f8fe4f8dd165590739665c71e4750044acc7f
8a43ca36a71b430096c609e96889aae94e93ddc9
/spincast-plugins/spincast-plugins-gson-parent/spincast-plugins-gson/src/main/java/org/spincast/plugins/gson/serializers/DateSerializer.java
ea5ec0ab7c3894bc3c79844aa5f8a167eb0469d6
[ "Apache-2.0" ]
permissive
spincast/spincast-framework
18163ee0d5ed3571113ad6f3112cf7f951eee910
fc25e6e61f1d20643662ed94e42003b23fe651f6
refs/heads/master
2022-10-20T11:20:43.008571
2022-10-11T23:21:41
2022-10-11T23:21:41
56,924,959
48
0
null
null
null
null
UTF-8
Java
false
false
755
java
package org.spincast.plugins.gson.serializers; import java.lang.reflect.Type; import java.util.Date; import org.spincast.core.utils.SpincastStatics; import com.google.gson.JsonElement; import com.google.gson.JsonPrimitive; import com.google.gson.JsonSerializationContext; import com.google.gson.JsonSerializer; public class DateSerializer implements JsonSerializer<Date> { @Override public JsonElement serialize(Date date, Type typeOfSrc, JsonSerializationContext context) { if (date == null) { return null; } String dateStr = SpincastStatics.getIso8601DateParserDefault().format(date); return new JsonPrimitive(dateStr); } }
[ "electrotype@gmail.com" ]
electrotype@gmail.com
e75089daa64d09ac5a74ea6aace8511eca0e76c4
d3f8ddafea7937c3fac918ddab50f5a21c2dc373
/app/src/main/java/com/simpletool/goodhabit/activities/about/AboutRootView.java
0c0ca5cd8757d1e143bf14aed80824f6c41c73a9
[]
no_license
hangocmaiii90/Habit-sample
872cf39cf7ea98517df8f4a1c24fbd02a23ac76f
66080e69467e0612d16ffbbbc3c81ff3e27ecf15
refs/heads/master
2020-04-13T05:30:12.887197
2018-12-24T13:42:14
2018-12-24T13:42:14
162,994,168
0
0
null
null
null
null
UTF-8
Java
false
false
3,262
java
/* * Copyright (C) 2016 Álinson Santos Xavier <isoron@gmail.com> * * This file is part of Loop Habit Tracker. * * Loop Habit Tracker is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by the * Free Software Foundation, either version 3 of the License, or (at your * option) any later version. * * Loop Habit Tracker is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see <http://www.gnu.org/licenses/>. */ package com.simpletool.goodhabit.activities.about; import android.content.*; import android.support.annotation.*; import android.support.v7.widget.Toolbar; import android.widget.*; import com.simpletool.goodhabit.BuildConfig; import com.simpletool.goodhabit.R; import com.simpletool.goodhabit.activities.*; import com.simpletool.goodhabit.intents.*; import com.simpletool.goodhabit.utils.*; import butterknife.*; public class AboutRootView extends BaseRootView { @BindView(R.id.tvVersion) TextView tvVersion; @BindView(R.id.tvRate) TextView tvRate; @BindView(R.id.tvFeedback) TextView tvFeedback; @BindView(R.id.tvSource) TextView tvSource; @BindView(R.id.toolbar) Toolbar toolbar; private final IntentFactory intents; public AboutRootView(Context context, IntentFactory intents) { super(context); this.intents = intents; addView(inflate(getContext(), R.layout.about, null)); ButterKnife.bind(this); tvVersion.setText( String.format(getResources().getString(R.string.version_n), BuildConfig.VERSION_NAME)); } @Override public boolean getDisplayHomeAsUp() { return true; } @NonNull @Override public Toolbar getToolbar() { return toolbar; } @Override public int getToolbarColor() { StyledResources res = new StyledResources(getContext()); if (!res.getBoolean(R.attr.useHabitColorAsPrimary)) return super.getToolbarColor(); return res.getColor(R.attr.aboutScreenColor); } @OnClick(R.id.tvFeedback) public void onClickFeedback() { Intent intent = intents.sendFeedback(getContext()); getContext().startActivity(intent); } @OnClick(R.id.tvTranslate) public void onClickTranslate() { Intent intent = intents.helpTranslate(getContext()); getContext().startActivity(intent); } @OnClick(R.id.tvRate) public void onClickRate() { Intent intent = intents.rateApp(getContext()); getContext().startActivity(intent); } @OnClick(R.id.tvSource) public void onClickSource() { Intent intent = intents.viewSourceCode(getContext()); getContext().startActivity(intent); } @Override protected void initToolbar() { super.initToolbar(); toolbar.setTitle(getResources().getString(R.string.about)); } }
[ "32545917+phuongbkatp@users.noreply.github.com" ]
32545917+phuongbkatp@users.noreply.github.com
6cebbb874b001e15da3ad918ae68386acae5fc47
b4c6a1d927219e92ca1ab891cd73a11003525439
/app/src/main/java/com/sk/weichat/ui/account/LoginHistoryActivity.java
11f7ce2751952ea38176cc2875073572a166c159
[]
no_license
gyymz1993/ZiChat1.0
be0ce74204ac92399f9d78de50d5431f0cadabc4
8196ba6ba3bea28793b1b19bec30bc02b322735d
refs/heads/master
2021-07-12T03:36:42.884776
2017-10-13T01:43:23
2017-10-13T01:43:23
104,311,662
0
0
null
null
null
null
UTF-8
Java
false
false
7,307
java
package com.sk.weichat.ui.account; import java.util.HashMap; import android.app.ProgressDialog; import android.content.DialogInterface; import android.content.Intent; import android.os.Bundle; import android.support.v4.content.IntentCompat; import android.text.TextUtils; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.EditText; import android.widget.ImageView; import android.widget.TextView; import com.android.volley.Response.ErrorListener; import com.android.volley.VolleyError; import com.sk.weichat.MyApplication; import com.sk.weichat.R; import com.sk.weichat.bean.LoginRegisterResult; import com.sk.weichat.bean.LoginRegisterResult.Login; import com.sk.weichat.bean.User; import com.sk.weichat.db.dao.UserDao; import com.sk.weichat.helper.AvatarHelper; import com.sk.weichat.helper.LoginHelper; import com.sk.weichat.sp.UserSp; import com.sk.weichat.ui.MainActivity; import com.sk.weichat.ui.base.ActivityStack; import com.sk.weichat.ui.base.BaseActivity; import com.sk.weichat.util.DeviceInfoUtil; import com.sk.weichat.util.Md5Util; import com.sk.weichat.util.ProgressDialogUtil; import com.sk.weichat.util.ToastUtil; import com.sk.weichat.volley.ObjectResult; import com.sk.weichat.volley.Result; import com.sk.weichat.volley.StringJsonObjectRequest; /** * 历史登陆界面 * * @author Dean Tao * @version 1.0 */ public class LoginHistoryActivity extends BaseActivity implements View.OnClickListener { private ImageView mAvatarImgView; private TextView mNickNameTv; private EditText mPasswordEdit; private User mLastLoginUser; private int mOldLoginStatus; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mOldLoginStatus = MyApplication.getInstance().mUserStatus; String userId = UserSp.getInstance(this).getUserId(""); mLastLoginUser = UserDao.getInstance().getUserByUserId(userId); if (!LoginHelper.isUserValidation(mLastLoginUser)) { Intent intent = new Intent(this, LoginActivity.class); overridePendingTransition(0, 0); startActivity(intent); finish(); return; } setContentView(R.layout.activity_login_history); getSupportActionBar().setIcon(0); getSupportActionBar().setDisplayHomeAsUpEnabled(false); initView(); } @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.menu_login_history, menu); return super.onCreateOptionsMenu(menu); } @Override public boolean onOptionsItemSelected(MenuItem item) { if (item.getItemId() == R.id.switch_account) { Intent intent = new Intent(this, LoginActivity.class); startActivity(intent); return true; } return super.onOptionsItemSelected(item); } @Override public void onBackPressed() { ActivityStack.getInstance().exit(); } private void initView() { mAvatarImgView = (ImageView) findViewById(R.id.avatar_img); mNickNameTv = (TextView) findViewById(R.id.nick_name_tv); mPasswordEdit = (EditText) findViewById(R.id.password_edit); findViewById(R.id.register_account_btn).setOnClickListener(this); findViewById(R.id.forget_password_btn).setOnClickListener(this); findViewById(R.id.login_btn).setOnClickListener(this); AvatarHelper.getInstance().displayAvatar(mLastLoginUser.getUserId(), mAvatarImgView, true); mNickNameTv.setText(mLastLoginUser.getNickName()); } private void login() { String password = mPasswordEdit.getText().toString().trim(); if (TextUtils.isEmpty(password)) { return; } final String digestPwd = new String(Md5Util.toMD5(password)); final String requestTag = "login"; final ProgressDialog dialog = ProgressDialogUtil.init(mContext, null, getString(R.string.please_wait), true); dialog.setOnCancelListener(new DialogInterface.OnCancelListener() { @Override public void onCancel(DialogInterface dialog) { cancelAll(requestTag); } }); ProgressDialogUtil.show(dialog); HashMap<String, String> params = new HashMap<String, String>(); params.put("telephone", Md5Util.toMD5(mLastLoginUser.getTelephone()));// 账号登陆的时候需要MD5以下,服务器需求 params.put("password", digestPwd); // 附加信息 params.put("model", DeviceInfoUtil.getModel()); params.put("osVersion", DeviceInfoUtil.getOsVersion()); params.put("serial", DeviceInfoUtil.getDeviceId(mContext)); // 地址信息 double latitude = MyApplication.getInstance().getBdLocationHelper().getLatitude(); double longitude = MyApplication.getInstance().getBdLocationHelper().getLongitude(); if (latitude != 0) params.put("latitude", String.valueOf(latitude)); if (longitude != 0) params.put("longitude", String.valueOf(longitude)); StringJsonObjectRequest<LoginRegisterResult> request = new StringJsonObjectRequest<LoginRegisterResult>(mConfig.USER_LOGIN, new ErrorListener() { @Override public void onErrorResponse(VolleyError arg0) { ProgressDialogUtil.dismiss(dialog); ToastUtil.showErrorNet(mContext); } }, new StringJsonObjectRequest.Listener<LoginRegisterResult>() { @Override public void onResponse(ObjectResult<LoginRegisterResult> result) { if (result == null) { ProgressDialogUtil.dismiss(dialog); ToastUtil.showErrorData(mContext); return; } boolean success = false; if (result.getResultCode() == Result.CODE_SUCCESS) { success = LoginHelper.setLoginUser(mContext, mLastLoginUser.getTelephone(), digestPwd, result);// 设置登陆用户信息 } if (success) {// 登陆成功 Login login = result.getData().getLogin(); if (login != null && login.getSerial() != null && login.getSerial().equals(DeviceInfoUtil.getDeviceId(mContext)) && mOldLoginStatus != LoginHelper.STATUS_USER_NO_UPDATE && mOldLoginStatus != LoginHelper.STATUS_NO_USER) {// 如果Token没变,上次更新也是完整更新,那么直接进入Main程序 // 其他的登陆地方都需进入DataDownloadActivity,在DataDownloadActivity里发送此广播 LoginHelper.broadcastLogin(mContext); Intent intent = new Intent(mContext, MainActivity.class); intent.setFlags(IntentCompat.FLAG_ACTIVITY_CLEAR_TASK); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(intent); } else {// 否则,进入数据下载界面 startActivity(new Intent(mContext, DataDownloadActivity.class)); } } else {// 登录失败 String message = TextUtils.isEmpty(result.getResultMsg()) ? getString(R.string.login_failed) : result.getResultMsg(); ToastUtil.showToast(mContext, message); } ProgressDialogUtil.dismiss(dialog); } }, LoginRegisterResult.class, params); request.setTag(requestTag); addDefaultRequest(request); } @Override public void onClick(View v) { switch (v.getId()) { case R.id.register_account_btn: startActivity(new Intent(LoginHistoryActivity.this, RegisterActivity.class)); break; case R.id.forget_password_btn: // Intent intent2 = new Intent(LoginHistoryActivity.this, // FindPwdActivity.class); // intent2.putExtra(FindPwdActivity.EXTRA_FROM_LOGIN, // this.getClass().getName()); // startActivity(intent2); break; case R.id.login_btn: login(); break; } } }
[ "gyymz1993@126.com" ]
gyymz1993@126.com
8f93ded893056d9a62c71243b0870d8e26547ef7
dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9
/data_defect4j/preprossed_method_corpus/Chart/4/org/jfree/chart/renderer/AbstractRenderer_setSeriesItemLabelPaint_1980.java
03abb4c25ee336939df8060c135451085b1718aa
[]
no_license
hvdthong/NetML
dca6cf4d34c5799b400d718e0a6cd2e0b167297d
9bb103da21327912e5a29cbf9be9ff4d058731a5
refs/heads/master
2021-06-30T15:03:52.618255
2020-10-07T01:58:48
2020-10-07T01:58:48
150,383,588
1
1
null
2018-09-26T07:08:45
2018-09-26T07:08:44
null
UTF-8
Java
false
false
3,822
java
org jfree chart render base provid common servic render method updat attribut render fire link render chang event rendererchangeev mean plot own render receiv notif render chang plot turn notifi chart abstract render abstractrender cloneabl serializ set item label paint seri send link render chang event rendererchangeev regist listen param seri seri base index param paint paint code code permit seri item label paint getseriesitemlabelpaint set seri item label paint setseriesitemlabelpaint seri paint paint set seri item label paint setseriesitemlabelpaint seri paint
[ "hvdthong@gmail.com" ]
hvdthong@gmail.com
bfe2ab72bfe1fced6649dd6b3b2887276169efea
1cedb98670494d598273ca8933b9d989e7573291
/ezyfox-server-common/src/main/java/com/tvd12/ezyfoxserver/io/EzyObjectSerializable.java
a5b52aa399a8c55b976baa3f6203b5ec524adcb8
[ "Apache-2.0" ]
permissive
thanhdatbkhn/ezyfox-server
ee00e1e23a2b38597bac94de7103bdc3a0e0bedf
069e70c8a7d962df8341444658b198ffadc3ce61
refs/heads/master
2020-03-10T11:08:10.921451
2018-01-14T16:50:37
2018-01-14T16:50:37
null
0
0
null
null
null
null
UTF-8
Java
false
false
167
java
package com.tvd12.ezyfoxserver.io; import com.tvd12.ezyfoxserver.entity.EzyObject; public interface EzyObjectSerializable extends EzyDataSerializable<EzyObject> { }
[ "itprono3@gmail.com" ]
itprono3@gmail.com
8ea60ceb24af3006876cc35388c07be269ff5c1e
b5389245f454bd8c78a8124c40fdd98fb6590a57
/simple_tree/androidAppModule6/src/main/java/androidAppModule6packageJava0/Foo0.java
fa7618714105a140e6b0c8190078936a615e912b
[]
no_license
jin/android-projects
3bbf2a70fcf9a220df3716b804a97b8c6bf1e6cb
a6d9f050388cb8af84e5eea093f4507038db588a
refs/heads/master
2021-10-09T11:01:51.677994
2018-12-26T23:10:24
2018-12-26T23:10:24
131,518,587
29
1
null
2018-12-26T23:10:25
2018-04-29T18:21:09
Java
UTF-8
Java
false
false
209
java
package androidAppModule6packageJava0; public class Foo0 { public void foo0() { } public void foo1() { foo0(); } public void foo2() { foo1(); } public void foo3() { foo2(); } }
[ "jingwen@google.com" ]
jingwen@google.com
d73f010f6db3fc6d45f5ace057b6b32edeeeccbe
95d20c83d8aff34e314c56a3ecb2b87c9fa9fc86
/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/hover/AbstractHover.java
16cf4ee29f155d21753e949ce2cf5e2b4dce3ed3
[ "GPL-1.0-or-later", "GPL-3.0-only", "Apache-2.0", "LicenseRef-scancode-public-domain", "LGPL-2.1-only", "LicenseRef-scancode-unknown-license-reference" ]
permissive
NationalSecurityAgency/ghidra
969fe0d2ca25cb8ac72f66f0f90fc7fb2dbfa68d
7cc135eb6bfabd166cbc23f7951dae09a7e03c39
refs/heads/master
2023-08-31T21:20:23.376055
2023-08-29T23:08:54
2023-08-29T23:08:54
173,228,436
45,212
6,204
Apache-2.0
2023-09-14T18:00:39
2019-03-01T03:27:48
Java
UTF-8
Java
false
false
2,002
java
/* ### * IP: GHIDRA * * 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 ghidra.app.plugin.core.hover; import javax.swing.JComponent; import javax.swing.JToolTip; import ghidra.app.services.HoverService; import ghidra.framework.plugintool.PluginTool; /** * Base class for listing hover extensions. */ public abstract class AbstractHover implements HoverService { protected final PluginTool tool; protected boolean enabled; protected final int priority; protected AbstractHover(PluginTool tool, int priority) { this.tool = tool; this.priority = priority; } @Override public final int getPriority() { return priority; } @Override public final boolean hoverModeSelected() { return enabled; } protected boolean isValidTooltipContent(String content) { if (content == null || content.length() == 0) { return false; } return true; } protected JComponent createTooltipComponent(String content) { if (!isValidTooltipContent(content)) { return null; } JToolTip tt = new JToolTip(); tt.setTipText(content); return tt; } //================================================================================================== // Stubbed Methods //================================================================================================== @Override public void scroll(int amount) { // stubbed } @Override public void componentHidden() { // don't care } @Override public void componentShown() { // don't care } }
[ "46821332+nsadeveloper789@users.noreply.github.com" ]
46821332+nsadeveloper789@users.noreply.github.com
f20403c828be3e13181c896612c404b76fd6cdb6
39df4ebdc529bd677017caf3fc2af20be3dd3538
/fap-common/src/main/java/eon/hg/fap/common/properties/ReportProperties.java
463f547dc8f21eeb700cfae007ea3f66d7134df5
[]
no_license
aeonj/eon-dmp
6d3580d758f697d407178175bb6bc532add8a85f
d1cfc867bb31833f5d4b7faa3146d468434f9fc5
refs/heads/master
2022-09-12T09:51:32.136245
2021-07-02T09:26:42
2021-07-02T09:26:42
141,535,375
0
0
null
2022-09-01T23:09:36
2018-07-19T06:39:51
Java
UTF-8
Java
false
false
263
java
package eon.hg.fap.common.properties; import lombok.Data; import org.springframework.boot.context.properties.ConfigurationProperties; @ConfigurationProperties(prefix = "eon.hg.report") @Data public class ReportProperties { private String server_url = ""; }
[ "aeonj@163.com" ]
aeonj@163.com
fa599ba9ac19f8a7f8081eb977938dc8d276c73c
5d18fdbe73d7e58d42862029655278608e56fec2
/src/main/java/com/dp2/parser/INodeWriter.java
83c6cc521bc95c771d89438da0aa79274a9d3126
[ "MIT" ]
permissive
6tail/dp2
245fccd246c6dca274873a217ac7f0c1aed31e23
e9ddbc100f406d310217c9bfb13c3cd8627e0512
refs/heads/master
2022-12-10T13:47:56.694888
2022-11-29T12:15:13
2022-11-29T12:15:13
247,664,021
1
2
MIT
2022-09-01T23:47:56
2020-03-16T09:43:15
Java
UTF-8
Java
false
false
415
java
package com.dp2.parser; import java.io.File; import java.io.IOException; import com.dp2.node.INode; /** * 节点写入器接口 * * @author 6tail * */ public interface INodeWriter{ /** * 保存到新文件 * @param file 文件 * @throws IOException IOException */ void save(File file) throws IOException; /** * 添加节点数据 * @param node 节点 */ void add(INode node); }
[ "6tail@6tail.cn" ]
6tail@6tail.cn
e52aabcab3678dd3a1cd56d3544f898ddd851d8d
533ff159f125813460432c8d43956788e6da045f
/HelloKHD/User/app/src/main/java/adapter/VideoList_Adapter.java
3adcc6c723a7dc20b7fa0d37da0d5ab39d104b06
[]
no_license
AitoApps/AndroidWorks
7747b084e84b8ad769f4552e8b2691d9cdec3f06
3c6c7d17f085ee3aa714e66f13fec2a4d8663ca3
refs/heads/master
2022-03-14T10:57:59.215113
2019-12-06T17:03:24
2019-12-06T17:03:24
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,599
java
package adapter; import android.app.Activity; import android.content.Context; import android.graphics.Typeface; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.RelativeLayout; import android.widget.TextView; import androidx.recyclerview.widget.RecyclerView.Adapter; import androidx.recyclerview.widget.RecyclerView.ViewHolder; import com.bumptech.glide.Glide; import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions; import com.bumptech.glide.request.RequestOptions; import com.bumptech.glide.signature.ObjectKey; import com.hellokhd.R; import com.hellokhd.Shops; import com.hellokhd.Temp; import com.hellokhd.UserDatabaseHandler; import com.hellokhd.Video_List; import java.util.List; import data.ShopsList_FeedItem; import data.Videolist_FeedItem; public class VideoList_Adapter extends Adapter<ViewHolder> { private static final int TYPE_FOOTER = 1; private static final int TYPE_ITEM = 0; private static final int TYPE_NULL = 2; private Activity activity; float ogheight; public Context context; Typeface face; public UserDatabaseHandler udb; public List<Videolist_FeedItem> feedItems; private LayoutInflater inflater; public VideoList_Adapter(Activity activity2, List<Videolist_FeedItem> feedItems2) { activity = activity2; feedItems = feedItems2; context = activity2.getApplicationContext(); udb=new UserDatabaseHandler(context); face=Typeface.createFromAsset(context.getAssets(), "proxibold.otf"); } public class viewHolder extends ViewHolder { RelativeLayout lytvide; ImageView videopic,playicon; TextView title,duration; public viewHolder(View itemView) { super(itemView); lytvide=itemView.findViewById(R.id.lytvideo); videopic=itemView.findViewById(R.id.videopic); playicon=itemView.findViewById(R.id.playicon); title=itemView.findViewById(R.id.title); duration=itemView.findViewById(R.id.duration); } } public class viewHolderFooter extends ViewHolder { RelativeLayout layout1; public viewHolderFooter(View itemView) { super(itemView); layout1 = (RelativeLayout) itemView.findViewById(R.id.layout1); } } public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { if (viewType == 0) { return new viewHolder(LayoutInflater.from(context).inflate(R.layout.custom_videos, parent, false)); } if (viewType == 1) { return new viewHolderFooter(LayoutInflater.from(context).inflate(R.layout.footerview, parent, false)); } if (viewType == 2) { return new viewHolderFooter(LayoutInflater.from(context).inflate(R.layout.fullloaded, parent, false)); } return null; } public int getItemViewType(int position) { if (position < feedItems.size()) { return 0; } return 2; } public int getItemCount() { return feedItems.size() + 1; } public void onBindViewHolder(ViewHolder holder, final int position) { if (holder instanceof viewHolder) { try { Videolist_FeedItem item = (Videolist_FeedItem)feedItems.get(position); viewHolder viewHolder2 = (viewHolder) holder; viewHolder2.title.setTypeface(face); viewHolder2.duration.setTypeface(face); viewHolder2.title.setText(item.getTitle()); viewHolder2.duration.setText(item.getDuration()); ogheight = Float.parseFloat(udb.getscreenwidth()) / 4.0f; ogheight *= 3.0f; viewHolder2.lytvide.getLayoutParams().height=Math.round(ogheight); Glide.with(context).load("https://img.youtube.com/vi/"+item.getVideoid()+"/0.jpg").transition(DrawableTransitionOptions.withCrossFade()).into(viewHolder2.videopic); viewHolder2.videopic.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { Video_List h=(Video_List)activity; h.watchYoutubeVideo(item.getVideoid()); } }); } catch (Exception e) { } } } }
[ "me.salmanponnani@gmail.com" ]
me.salmanponnani@gmail.com
9941d7534032b2192010fe7d9e7f590d021e6f9f
8cd0e77529345ae332241957cf43319ad7b59b9f
/google-api-grpc/proto-google-cloud-datacatalog-v1beta1/src/main/java/com/google/cloud/datacatalog/EntryType.java
7bec11c5e25fe379e400e70946b862e959e2b816
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
omrihq/google-cloud-java
bb59ce5578b81083e8d60a1b89ad347ba08ea690
57f23567cbdcb1f91deb36d8ba48ffff0f67e544
refs/heads/master
2020-06-01T16:22:28.653079
2019-06-10T19:16:32
2019-06-10T19:16:32
190,831,687
0
0
Apache-2.0
2019-06-10T19:16:34
2019-06-08T01:21:20
Java
UTF-8
Java
false
true
3,706
java
// Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/cloud/datacatalog/v1beta1/datacatalog.proto package com.google.cloud.datacatalog; /** * * * <pre> * Entry resources in Cloud Data Catalog can be of different types e.g. BigQuery * Table entry is of type 'TABLE'. This enum describes all the possible types * Cloud Data Catalog contains. * </pre> * * Protobuf enum {@code google.cloud.datacatalog.v1beta1.EntryType} */ public enum EntryType implements com.google.protobuf.ProtocolMessageEnum { /** * * * <pre> * Default unknown type * </pre> * * <code>ENTRY_TYPE_UNSPECIFIED = 0;</code> */ ENTRY_TYPE_UNSPECIFIED(0), /** * * * <pre> * The type of entry that has a GoogleSQL schema, including logical views. * </pre> * * <code>TABLE = 2;</code> */ TABLE(2), /** * * * <pre> * An entry type which is used for streaming entries. Example - Pub/Sub. * </pre> * * <code>DATA_STREAM = 3;</code> */ DATA_STREAM(3), UNRECOGNIZED(-1), ; /** * * * <pre> * Default unknown type * </pre> * * <code>ENTRY_TYPE_UNSPECIFIED = 0;</code> */ public static final int ENTRY_TYPE_UNSPECIFIED_VALUE = 0; /** * * * <pre> * The type of entry that has a GoogleSQL schema, including logical views. * </pre> * * <code>TABLE = 2;</code> */ public static final int TABLE_VALUE = 2; /** * * * <pre> * An entry type which is used for streaming entries. Example - Pub/Sub. * </pre> * * <code>DATA_STREAM = 3;</code> */ public static final int DATA_STREAM_VALUE = 3; public final int getNumber() { if (this == UNRECOGNIZED) { throw new java.lang.IllegalArgumentException( "Can't get the number of an unknown enum value."); } return value; } /** @deprecated Use {@link #forNumber(int)} instead. */ @java.lang.Deprecated public static EntryType valueOf(int value) { return forNumber(value); } public static EntryType forNumber(int value) { switch (value) { case 0: return ENTRY_TYPE_UNSPECIFIED; case 2: return TABLE; case 3: return DATA_STREAM; default: return null; } } public static com.google.protobuf.Internal.EnumLiteMap<EntryType> internalGetValueMap() { return internalValueMap; } private static final com.google.protobuf.Internal.EnumLiteMap<EntryType> internalValueMap = new com.google.protobuf.Internal.EnumLiteMap<EntryType>() { public EntryType findValueByNumber(int number) { return EntryType.forNumber(number); } }; public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { return getDescriptor().getValues().get(ordinal()); } public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { return getDescriptor(); } public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { return com.google.cloud.datacatalog.Datacatalog.getDescriptor().getEnumTypes().get(0); } private static final EntryType[] VALUES = values(); public static EntryType valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { if (desc.getType() != getDescriptor()) { throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); } if (desc.getIndex() == -1) { return UNRECOGNIZED; } return VALUES[desc.getIndex()]; } private final int value; private EntryType(int value) { this.value = value; } // @@protoc_insertion_point(enum_scope:google.cloud.datacatalog.v1beta1.EntryType) }
[ "45548808+kolea2@users.noreply.github.com" ]
45548808+kolea2@users.noreply.github.com
dc7b6964694280d4b53ad864054291c335b0b24b
7a255312e82a600abaae1ef4fd058d97353650c3
/lmt-mbsp-user-controller/src/main/java/com/lmt/mbsp/user/controller/TestController.java
b67984ae825351976eb80fa3425ccf776f554e35
[]
no_license
geeker-lait/user-center
4b82fc689ae6c2136f09e59094cdbc8537684000
41cadf260b5f201dc1b6c6b52f8c8b37299e01fd
refs/heads/master
2020-03-23T14:43:01.420845
2018-07-31T12:52:10
2018-07-31T12:52:12
141,694,830
0
0
null
null
null
null
UTF-8
Java
false
false
1,607
java
package com.lmt.mbsp.user.controller; import com.lmt.framework.core.exception.ControllerException; import com.lmt.framework.core.exception.code.ControllerErrorCode; import com.lmt.framework.support.model.message.ResponseMessage; import lombok.extern.slf4j.Slf4j; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; @RestController @Slf4j public class TestController { @RequestMapping(value = "/test1/{error}", method = RequestMethod.GET) public ResponseMessage test2(@PathVariable(value = "error") String error){ log.info("error={}",error); switch (error){ case "1": throw new ControllerException(ControllerErrorCode.CONTROLLER_ERROR, ControllerErrorCode.CONTROLLER_ERROR.toString()); case "2": throw new ControllerException(ControllerErrorCode.ILLEGAL_PARAMS, ControllerErrorCode.ILLEGAL_PARAMS.toString()); case "3": throw new ControllerException(ControllerErrorCode.NOT_FOUND, ControllerErrorCode.NOT_FOUND.toString()); case "4": throw new ControllerException(ControllerErrorCode.BUSINESS_ERROR, ControllerErrorCode.BUSINESS_ERROR.toString()); case "5": throw new ControllerException(ControllerErrorCode.DATABASE_ERROR, ControllerErrorCode.DATABASE_ERROR.toString()); } return ResponseMessage.error("悲剧啦"); } }
[ "lait.zhang@gmail.com" ]
lait.zhang@gmail.com
bb5c644e17b29a011b892ed558a114ab93e7e6a8
6fef7045d88e4d368db62c9e8e1998c9f114cab2
/src/main/java/org/liuzhugu/javastudy/sourcecode/jdk8/concurrent/ExecutorService_.java
c150fcd316ea794a1996ccb3d3bf68ced939e079
[]
no_license
liuzhugu/study
02a7a104b31507858dc8f91c1e852f6bbc83a68f
22f3fadf08b2c0a881a701a09e31c77b6907f113
refs/heads/master
2023-08-30T09:29:27.410391
2023-08-29T22:35:49
2023-08-29T22:35:49
151,524,422
0
0
null
2022-12-16T09:44:31
2018-10-04T05:47:49
Java
UTF-8
Java
false
false
1,182
java
package org.liuzhugu.javastudy.sourcecode.jdk8.concurrent; import java.util.Collection; import java.util.List; import java.util.concurrent.*; public interface ExecutorService_ extends Executor_ { void shutdown(); List<Runnable_> shutdownNow(); boolean isShutdown(); boolean isTerminated(); boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException; <T> Future_<T> submit(Callable_<T> task); <T> Future_<T> submit(Runnable_ task, T result); Future_<?> submit(Runnable_ task); <T> List<Future_<T>> invokeAll(Collection<? extends Callable_<T>> tasks) throws InterruptedException; <T> List<Future_<T>> invokeAll(Collection<? extends Callable_<T>> tasks, long timeout, TimeUnit unit) throws InterruptedException; <T> T invokeAny(Collection<? extends Callable_<T>> tasks) throws InterruptedException, ExecutionException; <T> T invokeAny(Collection<? extends Callable_<T>> tasks, long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException; }
[ "987685625@qq.com" ]
987685625@qq.com
c95f8375aeac36f9ecc66be28380e5d778e95c2f
026b5813fe021294da1570fd561d11ee9c1445d1
/src/com/randi/dyned5/model/BackgroundRealtimeClock.java
9386bcacf0b043cd880f146ab33d20575dd3fecb
[]
no_license
randiw/DynEdBBGE5
36c853957bb525ddd512767942b04d3e7e81bff8
3552c57100c268aea91fc557bde0c3194db97deb
refs/heads/master
2020-05-18T07:05:43.942640
2014-08-13T03:02:56
2014-08-13T03:02:56
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,192
java
package com.randi.dyned5.model; import net.rim.blackberry.api.homescreen.HomeScreen; import net.rim.blackberry.api.messagelist.ApplicationIcon; import net.rim.blackberry.api.messagelist.ApplicationIndicatorRegistry; import net.rim.device.api.system.Bitmap; import net.rim.device.api.system.EncodedImage; import net.rim.device.api.system.RealtimeClockListener; import com.randi.dyned5.model.persistable.EducationManager; import com.randi.dyned5.model.persistable.NotificationManager; public class BackgroundRealtimeClock implements RealtimeClockListener { NotificationManager notificationManager = NotificationManager.getInstance(); public void clockUpdated() { if(notificationManager.isCounting() && !notificationManager.isNotified()){ if(System.currentTimeMillis() > notificationManager.getNextUpdate()){ notifyIcon(); } } } private void notifyIcon() { //start next lesson EducationManager educationManager = EducationManager.getInstance(); if(notificationManager.getNextLesson() != null){ String unitId = notificationManager.getUnitId(); String lessonId = notificationManager.getNextLessonId(); LessonItem lessonItem = notificationManager.getNextLesson(); lessonItem.unlock(); educationManager.commitLesson(unitId, lessonId, lessonItem); } //start next unit if(notificationManager.getNextUnitId() != null && notificationManager.getNextUnitId().length() > 0){ educationManager.startUnit(notificationManager.getNextUnitId()); } notificationManager.setCounting(false); notificationManager.setNotified(true); notificationManager.setNewItem(true); //set icon notify here EncodedImage icon_indicator = EncodedImage.getEncodedImageResource("icon_indicator_notification.png"); ApplicationIcon applicationIcon = new ApplicationIcon(icon_indicator); Bitmap homeIcon = Bitmap.getBitmapResource("icon_notification.png"); try { ApplicationIndicatorRegistry indicatorRegistry = ApplicationIndicatorRegistry.getInstance(); indicatorRegistry.register(applicationIcon, true, true); HomeScreen.updateIcon(homeIcon, 0); } catch (Exception e) { } } }
[ "randi.waranugraha@gmail.com" ]
randi.waranugraha@gmail.com
de75a95b0e0cdce11c03f8c691acdaf1c6da8953
fb948da2bc528b37d0eae3eb118dfcf90a409a75
/src/main/java/stu/napls/clouderweb/service/impl/DepositoryServiceImpl.java
39ed0f9f54e8998c2b6e13d031a31ed4db89ade9
[ "Apache-2.0" ]
permissive
teimichael/ClouderWeb
2567b4e9c786ee6310921d91b0578ce683fe86a6
aa67f23791c66996f24cffbcc4247497c7db7b33
refs/heads/master
2021-03-12T02:16:14.234428
2020-03-25T06:39:51
2020-03-25T06:39:51
246,580,440
0
0
null
null
null
null
UTF-8
Java
false
false
586
java
package stu.napls.clouderweb.service.impl; import org.springframework.stereotype.Service; import stu.napls.clouderweb.model.Depository; import stu.napls.clouderweb.repository.DepositoryRepository; import stu.napls.clouderweb.service.DepositoryService; import javax.annotation.Resource; @Service("depositoryService") public class DepositoryServiceImpl implements DepositoryService { @Resource private DepositoryRepository depositoryRepository; @Override public Depository update(Depository depository) { return depositoryRepository.save(depository); } }
[ "teimichael@outlook.com" ]
teimichael@outlook.com
4a79c848d1f5fe99aa3133b5f6a655e6d6d1664f
1989c5cc23087cc425d29cb2ebb3376ff8cd85f4
/nandhi/module/App/Core/src/main/java/nandhi/app/transaction/AppTransactionManager.java
fcf9221d5dc39eb3da82debb4acd6b0ee72bb190
[]
no_license
sivarajs/Dewbag
8a6479cf87126b87652c3db8e2f43366a7713484
796dc4472e164959190e6fc7142e855b8b3587da
refs/heads/master
2021-03-12T23:58:25.243671
2015-07-26T15:36:07
2015-07-26T15:36:07
39,730,434
0
0
null
null
null
null
UTF-8
Java
false
false
2,702
java
package nandhi.app.transaction; import javax.transaction.HeuristicMixedException; import javax.transaction.HeuristicRollbackException; import javax.transaction.NotSupportedException; import javax.transaction.RollbackException; import javax.transaction.SystemException; public class AppTransactionManager implements AppTransaction { private ThreadLocal<AppTransactionRegistry> appTransactionRegistry = new ThreadLocal<AppTransactionRegistry>(); private static AppTransactionManager INSTANCE = new AppTransactionManager(); public static AppTransactionManager getInstance() { return INSTANCE; } private AppTransactionRegistry getAppTranasctionRegistry() { AppTransactionRegistry registry = appTransactionRegistry.get(); if (registry == null) { registry = new AppTransactionRegistry(); appTransactionRegistry.set(registry); } return registry; } public void enlistTransaction(AppTransaction appTransaction) { getAppTranasctionRegistry().addAppTransaction(appTransaction); } @Override public void begin() throws NotSupportedException, SystemException { getAppTranasctionRegistry().begin(); } @Override public void commit() throws RollbackException, HeuristicMixedException, HeuristicRollbackException, SecurityException, IllegalStateException, SystemException { try { getAppTranasctionRegistry().commit(); } finally { closeSession(); } } @Override public int getStatus() throws SystemException { return getAppTranasctionRegistry().getStatus(); } @Override public void rollback() throws IllegalStateException, SecurityException, SystemException { try { getAppTranasctionRegistry().rollback(); } catch (Exception e) { e.printStackTrace(); } finally { closeSession(); } } @Override public void setRollbackOnly() throws IllegalStateException, SystemException { } @Override public void setTransactionTimeout(int arg0) throws SystemException { } @Override public void closeSession() { AppTransactionRegistry registry = appTransactionRegistry.get(); if (registry != null) { try { registry.closeSession(); } finally { appTransactionRegistry.remove(); } } } }
[ "sivarajs@gmail.com" ]
sivarajs@gmail.com
a2cf3fee389e7f4345e29d1ffda1c092d1ecfe4b
8af1164bac943cef64e41bae312223c3c0e38114
/results-java/JetBrains--intellij-community/3e635f19ad42227510e9bc300ad7e975481a772c/before/TaskData.java
8e60bb845fa5cff3ba314ab8be84f39219def6e4
[]
no_license
fracz/refactor-extractor
3ae45c97cc63f26d5cb8b92003b12f74cc9973a9
dd5e82bfcc376e74a99e18c2bf54c95676914272
refs/heads/master
2021-01-19T06:50:08.211003
2018-11-30T13:00:57
2018-11-30T13:00:57
87,353,478
0
0
null
null
null
null
UTF-8
Java
false
false
1,693
java
/* * Copyright 2000-2013 JetBrains s.r.o. * * 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.intellij.openapi.externalSystem.model.task; import com.intellij.openapi.externalSystem.model.ProjectSystemId; import com.intellij.openapi.externalSystem.model.project.AbstractExternalEntityData; import com.intellij.util.containers.ContainerUtilRt; import org.jetbrains.annotations.NotNull; import java.util.List; /** * Container for external system task information. * * @author Denis Zhdanov * @since 5/15/13 10:59 AM */ public class TaskData extends AbstractExternalEntityData { @NotNull private final List<ExternalSystemTaskDescriptor> myTasks = ContainerUtilRt.newArrayList(); @NotNull private final String myLinkedProjectPath; public TaskData(@NotNull ProjectSystemId owner, @NotNull String linkedProjectPath) { super(owner); myLinkedProjectPath = linkedProjectPath; } @NotNull public String getLinkedProjectPath() { return myLinkedProjectPath; } public void addTask(@NotNull ExternalSystemTaskDescriptor task) { myTasks.add(task); } @NotNull public List<ExternalSystemTaskDescriptor> getTasks() { return myTasks; } }
[ "fraczwojciech@gmail.com" ]
fraczwojciech@gmail.com
c727e7207b24cff6c761009ac08f83b809befcb3
f91fe1065c172a24299146f685811db426ed732e
/mybatis-3-mybatis-3.4.2/src/main/java/org/apache/ibatis/cache/Cache.java
21a72a7ab9d52a4d365fb3d2383d6263a3133379
[ "Apache-2.0", "BSD-3-Clause" ]
permissive
xiaokukuo/soundcode-springmybatis
649c8c93141fd070a51c63543cd3d21b2b5e9338
87e1c24639b37b813ba41b1b6ad05387d1ea768f
refs/heads/master
2020-03-12T04:11:53.043180
2018-08-18T06:06:04
2018-08-18T06:06:04
130,440,014
0
0
null
null
null
null
UTF-8
Java
false
false
2,704
java
/** * Copyright 2010-2018 the original author or authors. * <p> * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * <p> * http://www.apache.org/licenses/LICENSE-2.0 * <p> * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.ibatis.cache; import java.util.concurrent.locks.ReadWriteLock; /** * SPI for cache providers. * * One instance of cache will be created for each namespace. * * The cache implementation must have a constructor that receives the cache id as an String parameter. * * MyBatis will pass the namespace as id to the constructor. * * <pre> * public MyCache(final String id) { * if (id == null) { * throw new IllegalArgumentException("Cache instances require an ID"); * } * this.id = id; * initialize(); * } * </pre> * * @author Clinton Begin */ public interface Cache { /** * @return The identifier of this cache */ String getId(); /** * @param key Can be any object but usually it is a {@link CacheKey} * @param value The result of a select. */ void putObject(Object key, Object value); /** * @param key The key * @return The object stored in the cache. */ Object getObject(Object key); /** * As of 3.3.0 this method is only called during a rollback * for any previous value that was missing in the cache. * This lets any blocking cache to release the lock that * may have previously put on the key. * A blocking cache puts a lock when a value is null * and releases it when the value is back again. * This way other threads will wait for the value to be * available instead of hitting the database. * * * @param key The key * @return Not used */ Object removeObject(Object key); /** * Clears this cache instance */ void clear(); /** * Optional. This method is not called by the core. * * @return The number of elements stored in the cache (not its capacity). */ int getSize(); /** * Optional. As of 3.2.6 this method is no longer called by the core. * * Any locking needed by the cache must be provided internally by the cache provider. * * @return A ReadWriteLock */ ReadWriteLock getReadWriteLock(); }
[ "976886537@qq.com" ]
976886537@qq.com
f8447731760ab163256c8e4aa2cac5a7ecb73b76
8275010778a54e22af7b4a909ba0037d8dcd3a39
/kp-pi-security/kp-pi-security-api/src/test/java/de/kaiserpfalzedv/paladinsinn/security/api/model/PersonaTest.java
4013448cdc0592c3fa00738b5fb4b75a29e402fa
[ "Apache-2.0" ]
permissive
klenkes74/kp-paladins-inn
4f6bdb1b9c220ea641d380d57bdcd3ad162ff999
e361906bd264afc198b6bdb68cebf062345f5764
refs/heads/master
2022-07-04T23:05:50.006104
2017-06-15T04:52:04
2017-06-15T04:52:04
53,771,143
0
0
Apache-2.0
2022-06-21T04:20:04
2016-03-13T06:36:40
Java
UTF-8
Java
false
false
6,131
java
/* * Copyright 2017 Kaiserpfalz EDV-Service, Roland T. Lichti * * 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 de.kaiserpfalzedv.paladinsinn.security.api.model; import java.time.LocalDate; import java.util.List; import java.util.Locale; import java.util.UUID; import de.kaiserpfalzedv.paladinsinn.commons.api.person.Gender; import de.kaiserpfalzedv.paladinsinn.commons.api.person.Name; import de.kaiserpfalzedv.paladinsinn.commons.api.person.NameBuilder; import org.junit.After; import org.junit.Before; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; /** * @author klenkes {@literal <rlichti@kaiserpfalz-edv.de>} * @version 1.0.0 * @since 2017-03-11 */ public class PersonaTest { private static final Logger LOG = LoggerFactory.getLogger(PersonaTest.class); private static final String PERSON_UNIQUE_ID_STRING = "0737074c-51a2-4d98-89a3-886c61d1ec1d"; private static final UUID PERSON_UNIQUE_ID = UUID.fromString(PERSON_UNIQUE_ID_STRING); private static final Gender PERSON_GENDER = Gender.gender_questioning; private static final LocalDate PERSON_DOB = LocalDate.parse("2000-12-31"); private static final int PERSON_AGE = LocalDate.ofEpochDay(LocalDate.now().toEpochDay() - PERSON_DOB.toEpochDay()) .getYear() - 1970; private static final Locale PERSON_COUNTRY = Locale.GERMANY; private static final Locale PERSON_LOCALE = Locale.GERMAN; private static final String GIVEN_NAME_PREFIX = "given_name_prefix"; private static final String GIVEN_NAME = "given_name"; private static final String GIVEN_NAME_POSTFIX = "given_name_postfix"; private static final String SN_PREFIX = "sn_prefix"; private static final String SN = "sn"; private static final String SN_POSTFIX = "sn_postfix"; private static final Name PERSON_NAME = new NameBuilder() .withGivenNamePrefix(GIVEN_NAME_PREFIX).withGivenName(GIVEN_NAME).withGivenNamePostfix(GIVEN_NAME_POSTFIX) .withSnPrefix(SN_PREFIX).withSn(SN).withSnPostfix(SN_POSTFIX) .build(); private static final String PERSON_STRING = new StringBuilder().append('{') .append(PERSON_UNIQUE_ID_STRING) .append(", ").append(PERSON_NAME.getInformalFullName()) .append(" (").append(PERSON_DOB) .append("), country: ").append(PERSON_COUNTRY) .append(", locale: ").append(PERSON_LOCALE) .append('}').toString(); private PersonaBuilder service; @Test public void shouldIncludeEverythingInToStringWhenGivenAFullPerson() { Persona person = generateFullPersona(); assertTrue( "Must contain the data: " + person.toString(), person.toString().contains(PERSON_STRING) ); } private Persona generateFullPersona() { return service .withUniqueId(PERSON_UNIQUE_ID) .withName(PERSON_NAME) .withGender(PERSON_GENDER) .withDateOfBirth(PERSON_DOB) .withCountry(PERSON_COUNTRY) .withLocale(PERSON_LOCALE) .build(); } @Test public void shouldReturnTheCorrectDOBWhenADateOfBirthIsSpecified() { Persona result = generateFullPersona(); assertEquals("The date of birth does not match!", PERSON_DOB, result.getDateOfBirth()); } @Test public void shouldReturnTheCorrectAgeWhenADateOfBirthIsSpecified() { Persona result = generateFullPersona(); assertEquals("Age does not match!", PERSON_AGE, result.getAge()); } @Test public void shouldReturnTheCorrectGenderWhenADateOfBirthIsSpecified() { Persona result = generateFullPersona(); assertEquals("Gender does not match!", PERSON_GENDER, result.getGender()); } @SuppressWarnings("EqualsWithItself") @Test public void shouldReturnTrueWhenGivenItselfAsComparison() { Persona result = generateFullPersona(); assertTrue("Comparing with itself should be true!", result.equals(result)); } @Test public void shouldReturnFalseWhenGivenAnotherObject() { Persona result = generateFullPersona(); assertFalse("Comparing with another classes object should fail!", result.equals(this)); } @Test public void shouldReturnTrueWhenGivenTheSameFullObject() { Persona personA = generateFullPersona(); Persona personB = new PersonaBuilder().withPerson(personA).build(); assertTrue("Two identical persons should match (personA=personB)!", personA.equals(personB)); assertTrue("Two identical persons should match (personB=personA)!", personB.equals(personA)); } @Test public void shouldGiveBackNonEmptyErrorListWithoutName() { service .withUniqueId(PERSON_UNIQUE_ID) .withGender(PERSON_GENDER) .withDateOfBirth(PERSON_DOB) .withCountry(PERSON_COUNTRY) .withLocale(PERSON_LOCALE); service.validate(); List<String> result = service.getValidationResults(); assertTrue("There should be at least one error (given name missing)", result.size() >= 1); } @Before public void setUpService() { service = new PersonaBuilder(); } @After public void tearDownService() { service = null; } }
[ "klenkes74@gmail.com" ]
klenkes74@gmail.com
c29af3256efbb9d31d591e643aefa7a29d8f47d3
3ed9acba396d1f245e5f4d3dfe97c8316c2fa25f
/src/main/java/com/cloudhg/myapp/security/jwt/TokenProvider.java
8ec7f24e4b36cbcbc1d211dc822f1a6d748d4fbe
[]
no_license
sherrerag/cloudhg-application
015166065777520febe0a2df9f4cd24a2eb0955c
6fef0fac26a67e131973f55de54513d65197b2aa
refs/heads/main
2023-05-06T01:29:29.114711
2021-06-05T10:57:25
2021-06-05T10:57:25
374,090,476
0
0
null
null
null
null
UTF-8
Java
false
false
4,036
java
package com.cloudhg.myapp.security.jwt; import io.jsonwebtoken.*; import io.jsonwebtoken.io.Decoders; import io.jsonwebtoken.security.Keys; import java.nio.charset.StandardCharsets; import java.security.Key; import java.util.*; import java.util.stream.Collectors; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; import org.springframework.security.core.Authentication; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.authority.SimpleGrantedAuthority; import org.springframework.security.core.userdetails.User; import org.springframework.stereotype.Component; import org.springframework.util.ObjectUtils; import tech.jhipster.config.JHipsterProperties; @Component public class TokenProvider { private final Logger log = LoggerFactory.getLogger(TokenProvider.class); private static final String AUTHORITIES_KEY = "auth"; private final Key key; private final JwtParser jwtParser; private final long tokenValidityInMilliseconds; private final long tokenValidityInMillisecondsForRememberMe; public TokenProvider(JHipsterProperties jHipsterProperties) { byte[] keyBytes; String secret = jHipsterProperties.getSecurity().getAuthentication().getJwt().getSecret(); if (!ObjectUtils.isEmpty(secret)) { log.warn( "Warning: the JWT key used is not Base64-encoded. " + "We recommend using the `jhipster.security.authentication.jwt.base64-secret` key for optimum security." ); keyBytes = secret.getBytes(StandardCharsets.UTF_8); } else { log.debug("Using a Base64-encoded JWT secret key"); keyBytes = Decoders.BASE64.decode(jHipsterProperties.getSecurity().getAuthentication().getJwt().getBase64Secret()); } key = Keys.hmacShaKeyFor(keyBytes); jwtParser = Jwts.parserBuilder().setSigningKey(key).build(); this.tokenValidityInMilliseconds = 1000 * jHipsterProperties.getSecurity().getAuthentication().getJwt().getTokenValidityInSeconds(); this.tokenValidityInMillisecondsForRememberMe = 1000 * jHipsterProperties.getSecurity().getAuthentication().getJwt().getTokenValidityInSecondsForRememberMe(); } public String createToken(Authentication authentication, boolean rememberMe) { String authorities = authentication.getAuthorities().stream().map(GrantedAuthority::getAuthority).collect(Collectors.joining(",")); long now = (new Date()).getTime(); Date validity; if (rememberMe) { validity = new Date(now + this.tokenValidityInMillisecondsForRememberMe); } else { validity = new Date(now + this.tokenValidityInMilliseconds); } return Jwts .builder() .setSubject(authentication.getName()) .claim(AUTHORITIES_KEY, authorities) .signWith(key, SignatureAlgorithm.HS512) .setExpiration(validity) .compact(); } public Authentication getAuthentication(String token) { Claims claims = jwtParser.parseClaimsJws(token).getBody(); Collection<? extends GrantedAuthority> authorities = Arrays .stream(claims.get(AUTHORITIES_KEY).toString().split(",")) .filter(auth -> !auth.trim().isEmpty()) .map(SimpleGrantedAuthority::new) .collect(Collectors.toList()); User principal = new User(claims.getSubject(), "", authorities); return new UsernamePasswordAuthenticationToken(principal, token, authorities); } public boolean validateToken(String authToken) { try { jwtParser.parseClaimsJws(authToken); return true; } catch (JwtException | IllegalArgumentException e) { log.info("Invalid JWT token."); log.trace("Invalid JWT token trace.", e); } return false; } }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
40af3cc33a54428c16cd9159e1db834519c05969
f77a9f006337e98d8d4991d4d54d6f0860c6d518
/src/test/java/Scenario_Component/Scenario_Login.java
80106625c8ca505ad0866df4248c7825ebbeb32c
[]
no_license
SaravananPushparaj/Framework_build
0c383cebc8563c9a3de47466680f13d923f76a6b
98d85bf8c36fdc2254e2ff432f6bf90843ef19da
refs/heads/master
2021-01-10T15:33:47.209939
2015-11-08T08:06:54
2015-11-08T08:06:54
45,763,447
0
0
null
null
null
null
UTF-8
Java
false
false
2,272
java
package Scenario_Component; import java.io.IOException; import org.apache.log4j.Logger; import org.openqa.selenium.WebDriver; import org.testng.annotations.Test; import org.testng.asserts.SoftAssert; import Generic_Component.Base_Class; import PageObject_Component.PageObject_Login; import junit.framework.Assert; public class Scenario_Login extends Base_Class { SoftAssert sAssert= new SoftAssert(); static Logger log=Logger.getLogger(Scenario_Login.class); @Test(dataProvider="dp_InvalidLogin",dataProviderClass=DataProviderComponent.DataProvider_Login.class,groups={"smoke"}) public void testLogin(String TC_ID,String Order,String Uname,String Pwd,String Exp_Res) throws IOException { log.info("Executing the testcase "+TC_ID+ " Order of "+Order); initBrowsersession(); PageObject_Login lpob= new PageObject_Login(browser); lpob.CommonprocessLogin(TC_ID, Uname, Pwd); String Actual_Res = lpob.getInvalidLoginResult(); //Assert.assertEquals(Exp_Res, Actual_Res); //sAssert.assertEquals(Exp_Res, Actual_Res); if(Actual_Res.equals(Exp_Res)) { log.info("Passed as Expected msg was Valid"); } else { log.info("Failed as Expected msg was "+Exp_Res +"Actual msg was "+Actual_Res); //sAssert.fail("Failed as Expected msg was "+Exp_Res +"Actual msg was "+Actual_Res); } tearDown(); //sAssert.assertAll(); log.info("******************************************"); } @Test(dataProvider="dp_ValidLogin",dataProviderClass=DataProviderComponent.DataProvider_Login.class,groups={"regression"}) public void testValid_Login(String TC_ID, String Order, String Uname, String Pwd, String Exp_Res) throws IOException { initBrowsersession(); PageObject_Login lpob= new PageObject_Login(browser); lpob.CommonprocessLogin(TC_ID, Uname, Pwd); String Actual_Result = lpob.getvalidLoginResult(); if(Actual_Result.equals(Exp_Res)) { log.info("Passed as Expected user logged in to app"); lpob.Click_Sigout(); } else { log.info("Failed as Expected user was " +Exp_Res+ " Actual Result is "+Actual_Result); sAssert.fail("Failed as Expected user was " +Exp_Res+ " Actual Result is "+Actual_Result); snapshot(TC_ID,Order); } tearDown(); sAssert.assertAll(); } }
[ "saravananpushparaj@gmail.com" ]
saravananpushparaj@gmail.com
380a0a8053d895369d06ae7f363d32e653a806da
610e3f2d3ee2d04241bc0d05dd91cef127d842c0
/src/com/ivend/iintegrationservice/_2010/_12/SaveDumpList.java
4d955b1b2da4d019005ec19f0cbbe286848b8a8f
[]
no_license
MasterInc/InventoryUpdateWS
5d9ff02b7cf868035e68a6410714b087edcde367
a768dfefc0ee4dc6b6e4467a0a74b49707846dcf
refs/heads/master
2021-01-10T16:16:46.270984
2015-11-27T21:34:01
2015-11-27T21:34:01
46,999,934
0
0
null
null
null
null
UTF-8
Java
false
false
2,052
java
package com.ivend.iintegrationservice._2010._12; import javax.xml.bind.JAXBElement; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElementRef; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="ReplicationSendDumpList" type="{http://www.iVend.com/IIntegrationService/2010/12}ArrayOfReplicationSendDump" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "replicationSendDumpList" }) @XmlRootElement(name = "SaveDumpList") public class SaveDumpList { @XmlElementRef(name = "ReplicationSendDumpList", namespace = "http://www.iVend.com/IIntegrationService/2010/12", type = JAXBElement.class, required = false) protected JAXBElement<ArrayOfReplicationSendDump> replicationSendDumpList; /** * Gets the value of the replicationSendDumpList property. * * @return * possible object is * {@link JAXBElement }{@code <}{@link ArrayOfReplicationSendDump }{@code >} * */ public JAXBElement<ArrayOfReplicationSendDump> getReplicationSendDumpList() { return replicationSendDumpList; } /** * Sets the value of the replicationSendDumpList property. * * @param value * allowed object is * {@link JAXBElement }{@code <}{@link ArrayOfReplicationSendDump }{@code >} * */ public void setReplicationSendDumpList(JAXBElement<ArrayOfReplicationSendDump> value) { this.replicationSendDumpList = value; } }
[ "jahir.nava@gmail.com" ]
jahir.nava@gmail.com
166251289eca4f909d70b445066bae14ba018f41
6e57bdc0a6cd18f9f546559875256c4570256c45
/cts/tests/autofillservice/src/android/autofillservice/cts/ValidatorTest.java
622e12775b0be69ac7a718502659d7b8982d1bc4
[]
no_license
dongdong331/test
969d6e945f7f21a5819cd1d5f536d12c552e825c
2ba7bcea4f9d9715cbb1c4e69271f7b185a0786e
refs/heads/master
2023-03-07T06:56:55.210503
2020-12-07T04:15:33
2020-12-07T04:15:33
134,398,935
2
1
null
2022-11-21T07:53:41
2018-05-22T10:26:42
null
UTF-8
Java
false
false
3,703
java
/* * Copyright (C) 2017 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.autofillservice.cts; import static android.autofillservice.cts.Helper.ID_PASSWORD; import static android.autofillservice.cts.Helper.ID_USERNAME; import static android.service.autofill.SaveInfo.SAVE_DATA_TYPE_GENERIC; import static com.google.common.truth.Truth.assertThat; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.mock; import android.platform.test.annotations.AppModeFull; import android.service.autofill.InternalValidator; import android.service.autofill.LuhnChecksumValidator; import android.service.autofill.ValueFinder; import android.view.View; import android.view.autofill.AutofillId; import org.junit.Before; import org.junit.Rule; import org.junit.Test; /** * Simple integration test to verify that the UI is only shown if the validator passes. */ @AppModeFull // Service-specific test public class ValidatorTest extends AutoFillServiceTestCase { @Rule public final AutofillActivityTestRule<LoginActivity> mActivityRule = new AutofillActivityTestRule<>(LoginActivity.class); private LoginActivity mActivity; @Before public void setActivity() { mActivity = mActivityRule.getActivity(); } @Test public void testShowUiWhenValidatorPass() throws Exception { integrationTest(true); } @Test public void testDontShowUiWhenValidatorFails() throws Exception { integrationTest(false); } private void integrationTest(boolean willSaveBeShown) throws Exception { enableService(); final AutofillId usernameId = mActivity.getUsername().getAutofillId(); final String username = willSaveBeShown ? "7992739871-3" : "4815162342-108"; final LuhnChecksumValidator validator = new LuhnChecksumValidator(usernameId); // Sanity check to make sure the validator is properly configured assertValidator(validator, usernameId, username, willSaveBeShown); // Set response sReplier.addResponse(new CannedFillResponse.Builder() .setRequiredSavableIds(SAVE_DATA_TYPE_GENERIC, ID_USERNAME, ID_PASSWORD) .setValidator(validator) .build()); // Trigger auto-fill mActivity.onPassword(View::requestFocus); // Wait for onFill() before proceeding. sReplier.getNextFillRequest(); // Trigger save. mActivity.onUsername((v) -> v.setText(username)); mActivity.onPassword((v) -> v.setText("pass")); mActivity.tapLogin(); if (willSaveBeShown) { mUiBot.saveForAutofill(true, SAVE_DATA_TYPE_GENERIC); sReplier.getNextSaveRequest(); } else { mUiBot.assertSaveNotShowing(SAVE_DATA_TYPE_GENERIC); } } private void assertValidator(InternalValidator validator, AutofillId id, String text, boolean valid) { final ValueFinder valueFinder = mock(ValueFinder.class); doReturn(text).when(valueFinder).findByAutofillId(id); assertThat(validator.isValid(valueFinder)).isEqualTo(valid); } }
[ "dongdong331@163.com" ]
dongdong331@163.com