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
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
db5b91183ab9cf85750da1a856c529af290de605
|
c04f812bea53c3d180baeea583f43176a6565005
|
/app/src/main/java/com/yuyh/github/widget/viewpager/viewpager/RecyclingPagerAdapter.java
|
5890e6660d7064f0b9c5ca2d8977dcc0614b115c
|
[
"Apache-2.0"
] |
permissive
|
tim0523/GithubClient
|
4fd83457be59e9c7124655c115d9dff2c189e2bc
|
2ab35289f21f9cb1cb7ee955c9df3c5577d5a139
|
refs/heads/master
| 2021-05-02T11:37:28.020500
| 2016-11-02T09:41:59
| 2016-11-02T09:41:59
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,213
|
java
|
package com.yuyh.github.widget.viewpager.viewpager;
import android.support.v4.view.PagerAdapter;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
/**
* 可回收view的PagerAdapter<br>
* A {@link PagerAdapter} which behaves like an {@link android.widget.Adapter}
* with view types and view recycling.
*/
public abstract class RecyclingPagerAdapter extends PagerAdapter {
static final int IGNORE_ITEM_VIEW_TYPE = AdapterView.ITEM_VIEW_TYPE_IGNORE;
private final RecycleBin recycleBin;
public RecyclingPagerAdapter() {
this(new RecycleBin());
}
RecyclingPagerAdapter(RecycleBin recycleBin) {
this.recycleBin = recycleBin;
recycleBin.setViewTypeCount(getViewTypeCount());
}
@Override
public void notifyDataSetChanged() {
recycleBin.scrapActiveViews();
super.notifyDataSetChanged();
}
@Override
public final Object instantiateItem(ViewGroup container, int position) {
int viewType = getItemViewType(position);
View view = null;
if (viewType != IGNORE_ITEM_VIEW_TYPE) {
view = recycleBin.getScrapView(position, viewType);
}
view = getView(position, view, container);
container.addView(view);
return view;
}
@Override
public final void destroyItem(ViewGroup container, int position, Object object) {
View view = (View) object;
container.removeView(view);
int viewType = getItemViewType(position);
if (viewType != IGNORE_ITEM_VIEW_TYPE) {
recycleBin.addScrapView(view, position, viewType);
}
}
@Override
public final boolean isViewFromObject(View view, Object object) {
return view == object;
}
/**
* <p>
* Returns the number of types of Views that will be created by
* {@link #getView}. Each type represents a set of views that can be
* converted in {@link #getView}. If the adapter always returns the same
* type of View for all items, this method should return 1.
* </p>
* <p>
* This method will only be called when when the adapter is set on the the
* {@link AdapterView}.
* </p>
*
* @return The number of types of Views that will be created by this adapter
*/
public int getViewTypeCount() {
return 1;
}
/**
* Get the type of View that will be created by {@link #getView} for the
* specified item.
*
* @param position
* The position of the item within the adapter's data set whose
* view type we want.
* @return An integer representing the type of View. Two views should share
* the same type if one can be converted to the other in
* {@link #getView}. Note: Integers must be in the range 0 to
* {@link #getViewTypeCount} - 1. {@link #IGNORE_ITEM_VIEW_TYPE} can
* also be returned.
* @see #IGNORE_ITEM_VIEW_TYPE
*/
// Argument potentially used by subclasses.
public int getItemViewType(int position) {
return 0;
}
/**
* Get a View that displays the data at the specified position in the data
* set. You can either create a View manually or inflate it from an XML
* layout file. When the View is inflated, the parent View (GridView,
* ListView...) will apply default layout parameters unless you use
* {@link android.view.LayoutInflater#inflate(int, ViewGroup, boolean)}
* to specify a root view and to prevent attachment to the root.
*
* @param position
* The position of the item within the adapter's data set of the
* item whose view we want.
* @param convertView
* The old view to reuse, if possible. Note: You should check
* that this view is non-null and of an appropriate type before
* using. If it is not possible to convert this view to display
* the correct data, this method can create a new view.
* Heterogeneous lists can specify their number of view types, so
* that this View is always of the right type (see
* {@link #getViewTypeCount()} and {@link #getItemViewType(int)}
* ).
* The parent that this view will eventually be attached to
* @return A View corresponding to the data at the specified position.
*/
public abstract View getView(int position, View convertView, ViewGroup container);
}
|
[
"352091626@qq.com"
] |
352091626@qq.com
|
61b248815c74fdafccb05c1ff797b507197155b9
|
26baa6a4f0bde23883e93309d9ad28e2feee23d1
|
/opennms-provision/opennms-mock-simpleserver/src/test/java/org/opennms/netmgt/provision/server/SimpleServerTest.java
|
e6c9c3143c094a62e7957a9a6f6dffb70254c84d
|
[] |
no_license
|
taochong123456/opennms-1.10.12-1
|
6532544405fff3dddd96f1250775e48f2aa38f0f
|
0f4c01a8e80e2144125eb189daac38a4e559421a
|
refs/heads/master
| 2020-03-18T12:37:27.510530
| 2018-09-20T17:00:28
| 2018-09-20T17:00:28
| 134,734,970
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 7,194
|
java
|
/*******************************************************************************
* This file is part of OpenNMS(R).
*
* Copyright (C) 2008-2012 The OpenNMS Group, Inc.
* OpenNMS(R) is Copyright (C) 1999-2012 The OpenNMS Group, Inc.
*
* OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc.
*
* OpenNMS(R) 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.
*
* OpenNMS(R) 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 OpenNMS(R). If not, see:
* http://www.gnu.org/licenses/
*
* For more information contact:
* OpenNMS(R) Licensing <license@opennms.org>
* http://www.opennms.org/
* http://www.opennms.com/
*******************************************************************************/
package org.opennms.netmgt.provision.server;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.Socket;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.opennms.test.mock.MockLogAppender;
public class SimpleServerTest {
private Socket m_socket;
private BufferedReader m_in;
private OutputStream m_out;
@Before
public void setUp() {
MockLogAppender.setupLogging();
}
@After
public void tearDown() throws IOException {
m_socket.close();
}
@Test
public void testServerTimeout() throws Exception {
SimpleServer server = new SimpleServer() {
public void onInit() {
setTimeout(500);
setBanner("+OK");
}
};
server.init();
server.startServer();
connectToServer(server);
String line = m_in.readLine();
assertEquals("+OK", line);
// don't send a command and verify the socket gets closed eventually
assertNull(m_in.readLine());
}
@Test
public void testServerWithCustomErrors() throws Exception {
SimpleServer server = new SimpleServer() {
public void onInit() {
setTimeout(1000);
setBanner("+OK");
addResponseHandler(matches("BING"), singleLineRequest("+GOT_BING"));
addResponseHandler(matches("QUIT"), shutdownServer("+OK"));
addResponseHandler(matches("APPLES"), singleLineRequest("+ORANGES"));
addErrorHandler(errorString("GOT ERROR"));
}
};
server.init();
server.startServer();
connectToServer(server);
String line = m_in.readLine();
assertEquals("+OK", line);
m_out.write("BING\r\n".getBytes());
line = m_in.readLine();
System.out.println("Line returned from Server: " + line);
assertEquals("+GOT_BING",line);
m_out.write("ORANGES\r\n".getBytes());
line = m_in.readLine();
System.out.println("Line returned from Server: " + line);
assertEquals("GOT ERROR",line);
m_out.write("APPLES\r\n".getBytes());
line = m_in.readLine();
System.out.println("Line returned from Server: " + line);
assertEquals("+ORANGES",line);
m_out.write("QUIT\r\n".getBytes());
line = m_in.readLine();
System.out.println("Line returned from Server: " + line);
assertEquals("+OK", line);
// don't send a command and verify the socket gets closed eventually
assertNull(m_in.readLine());
}
@Test
public void testMultipleRequestAndCloseServer() throws Exception {
SimpleServer server = new SimpleServer() {
public void onInit() {
setTimeout(1000);
setBanner("+OK");
addResponseHandler(matches("BING"), singleLineRequest("+GOT_BING"));
addResponseHandler(matches("QUIT"), shutdownServer("+OK"));
addResponseHandler(matches("APPLES"), singleLineRequest("+ORANGES"));
}
};
server.init();
server.startServer();
connectToServer(server);
String line = m_in.readLine();
assertEquals("+OK", line);
m_out.write("BING\r\n".getBytes());
line = m_in.readLine();
assertEquals("+GOT_BING",line);
m_out.write("APPLES\r\n".getBytes());
line = m_in.readLine();
assertEquals("+ORANGES",line);
m_out.write("QUIT\r\n".getBytes());
line = m_in.readLine();
assertEquals("+OK", line);
// don't send a command and verify the socket gets closed eventually
assertNull(m_in.readLine());
}
@Test
public void testServerQuitAndClose() throws Exception{
//TODO
SimpleServer server = new SimpleServer() {
public void onInit() {
setTimeout(500);
setBanner("+OK");
addResponseHandler(matches("QUIT"), shutdownServer("+OK"));
}
};
server.init();
server.startServer();
connectToServer(server);
String line = m_in.readLine();
assertEquals("+OK", line);
m_out.write("QUIT\r\n".getBytes());
line = m_in.readLine();
assertEquals("+OK", line);
// don't send a command and verify the socket gets closed eventually
assertNull(m_in.readLine());
}
@Test
public void testServerNoBannerTimeout() throws Exception{
SimpleServer server = new SimpleServer() {
public void onInit() {
setTimeout(500);
}
};
server.init();
server.startServer();
connectToServer(server);
// don't send a command and verify the socket gets closed eventually
assertNull(m_in.readLine());
}
private void connectToServer(SimpleServer server) throws IOException {
m_socket = createSocketConnection(server.getInetAddress(), server.getLocalPort(), 5000);
m_in = new BufferedReader(new InputStreamReader(m_socket.getInputStream()));
m_out = m_socket.getOutputStream();
}
protected Socket createSocketConnection(InetAddress host, int port, int timeout) throws IOException {
Socket socket = new Socket();
socket.connect(new InetSocketAddress(host, port), timeout);
socket.setSoTimeout(timeout);
return socket;
}
}
|
[
"2636757099@qq.com"
] |
2636757099@qq.com
|
c3da5561a882080acb3bdabb22482d9aa9b20383
|
ccdc52a6a64d9fb0698ae9dcf36c150f2f2b747d
|
/android/net/netlink/StructNlMsgHdr.java
|
5c012ef7690224a23cbd5f0977472245c2d47972
|
[
"Apache-2.0"
] |
permissive
|
headuck/SM-9750-TGY-Oct20-Network
|
192e6f8e66963de15ba83a52992c618f5a26f4fa
|
a0a85132d2f18be8fe44b8b3142e0ecd287d7930
|
refs/heads/main
| 2022-12-30T20:49:13.209492
| 2020-10-17T15:38:34
| 2020-10-17T15:38:34
| 304,911,332
| 2
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,686
|
java
|
package android.net.netlink;
import java.nio.ByteBuffer;
public class StructNlMsgHdr {
public short nlmsg_flags = 0;
public int nlmsg_len = 0;
public int nlmsg_pid = 0;
public int nlmsg_seq = 0;
public short nlmsg_type = 0;
public static String stringForNlMsgFlags(short s) {
StringBuilder sb = new StringBuilder();
if ((s & 1) != 0) {
sb.append("NLM_F_REQUEST");
}
if ((s & 2) != 0) {
if (sb.length() > 0) {
sb.append("|");
}
sb.append("NLM_F_MULTI");
}
if ((s & 4) != 0) {
if (sb.length() > 0) {
sb.append("|");
}
sb.append("NLM_F_ACK");
}
if ((s & 8) != 0) {
if (sb.length() > 0) {
sb.append("|");
}
sb.append("NLM_F_ECHO");
}
if ((s & 256) != 0) {
if (sb.length() > 0) {
sb.append("|");
}
sb.append("NLM_F_ROOT");
}
if ((s & 512) != 0) {
if (sb.length() > 0) {
sb.append("|");
}
sb.append("NLM_F_MATCH");
}
return sb.toString();
}
public static boolean hasAvailableSpace(ByteBuffer byteBuffer) {
return byteBuffer != null && byteBuffer.remaining() >= 16;
}
public static StructNlMsgHdr parse(ByteBuffer byteBuffer) {
if (!hasAvailableSpace(byteBuffer)) {
return null;
}
StructNlMsgHdr structNlMsgHdr = new StructNlMsgHdr();
structNlMsgHdr.nlmsg_len = byteBuffer.getInt();
structNlMsgHdr.nlmsg_type = byteBuffer.getShort();
structNlMsgHdr.nlmsg_flags = byteBuffer.getShort();
structNlMsgHdr.nlmsg_seq = byteBuffer.getInt();
structNlMsgHdr.nlmsg_pid = byteBuffer.getInt();
if (structNlMsgHdr.nlmsg_len < 16) {
return null;
}
return structNlMsgHdr;
}
public void pack(ByteBuffer byteBuffer) {
byteBuffer.putInt(this.nlmsg_len);
byteBuffer.putShort(this.nlmsg_type);
byteBuffer.putShort(this.nlmsg_flags);
byteBuffer.putInt(this.nlmsg_seq);
byteBuffer.putInt(this.nlmsg_pid);
}
public String toString() {
return "StructNlMsgHdr{ nlmsg_len{" + this.nlmsg_len + "}, nlmsg_type{" + ("" + ((int) this.nlmsg_type) + "(" + NetlinkConstants.stringForNlMsgType(this.nlmsg_type) + ")") + "}, nlmsg_flags{" + ("" + ((int) this.nlmsg_flags) + "(" + stringForNlMsgFlags(this.nlmsg_flags) + ")") + ")}, nlmsg_seq{" + this.nlmsg_seq + "}, nlmsg_pid{" + this.nlmsg_pid + "} }";
}
}
|
[
"headuck@users.noreply.github.com"
] |
headuck@users.noreply.github.com
|
33f486525c468cf66ebde5b4d747816e6e294915
|
8c0489d7874751af8830657624578085f0b5e029
|
/test/src/main/java/com/alibaba/druid/test/DruidTest.java
|
b2348e9c716fc95f114643d65049462427d4e391
|
[] |
no_license
|
pangziandapple/javabase
|
31b3f237fed8144d23bfeb4d03f9049a7345b3ff
|
acc1a5e720d2d5bc2e6ffd18e1d73ef346294084
|
refs/heads/master
| 2020-04-19T09:52:56.158533
| 2019-03-18T01:18:21
| 2019-03-18T01:18:21
| 168,123,124
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,191
|
java
|
package com.alibaba.druid.test;
import com.alibaba.druid.pool.DruidDataSource;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
/**
* @author zhangzhiheng
* @Date 2019-03-04
* @Description :
*/
public class DruidTest {
public static void main(String[] args) throws SQLException {
DruidDataSource druidDataSource = new DruidDataSource();
druidDataSource.setMaxActive(10);
druidDataSource.setInitialSize(10);
druidDataSource.setMaxWait(10000);
druidDataSource.setPassword("root");
druidDataSource.setUsername("root");
druidDataSource.setDriverClassName("com.mysql.jdbc.Driver");
druidDataSource.setUrl("jdbc:mysql://127.0.0.1:3306/test?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC");
Connection connection = druidDataSource.getConnection();
Statement statement = connection.createStatement();
ResultSet resultSet = statement.executeQuery("SELECT * FROM user limit 0,10");
while (resultSet.next()) {
System.out.println(resultSet.getInt("id"));
}
druidDataSource.close();
}
}
|
[
"123456"
] |
123456
|
0d93e25ee686454d3b248127bee0a916ec7db917
|
4a5b8ee0b25678265c2d818c11f902417b038dc6
|
/src/main/java/io/github/splotycode/tippy/parser/Token.java
|
b5586a62842cbae6639ea330eca020a2b021c2e5
|
[] |
no_license
|
SplotyCode/Tippy
|
41233bfc93429b08e59190edd84983cfd2df2973
|
33d9a4dece0a03e0e57c37f76e10af41a5e15d6d
|
refs/heads/master
| 2020-07-05T14:28:24.143131
| 2019-09-14T09:42:24
| 2019-09-14T09:42:24
| 202,673,055
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 463
|
java
|
package io.github.splotycode.tippy.parser;
import lombok.AllArgsConstructor;
import lombok.Data;
@AllArgsConstructor
@Data
public class Token {
private int start, end;
private TokenType type;
public Token(int start, TokenType type) {
this(start, start, type);
}
public String position() {
if (end - start > 0) {
return (start + 1) + " - " + (end + 1);
}
return String.valueOf(end + 1);
}
}
|
[
"davidscandurra@gmail.com"
] |
davidscandurra@gmail.com
|
4e9478b6649096685a197556517e1c4f6d7c6c1d
|
f10dc8fb4181c4865cd4797de9d5a79f2c98af7a
|
/src/yh/core/autorun/YHAutoRunConfig.java
|
626378b2ed8dcfc8c06fb878bce9ae7d0b467379
|
[] |
no_license
|
DennisAZ/NewtouchOA
|
b9c41cc1f4caac53b453c56952af0f5156b6c4fa
|
881d72d80c83e1f2ad578c92e37a3241498499fc
|
refs/heads/master
| 2020-03-30T05:37:21.900004
| 2018-09-29T02:11:34
| 2018-09-29T02:11:34
| 150,809,685
| 0
| 3
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 905
|
java
|
package yh.core.autorun;
/**
* 自动运行配置
* @author jpt
*
*/
public class YHAutoRunConfig {
private String name = null;
private String cls = null;
private int intervalSecond = 300;
private String runTime = null;
private String isUsed = "1";
public String getCls() {
return cls;
}
public void setCls(String cls) {
this.cls = cls;
}
public int getIntervalSecond() {
return intervalSecond;
}
public void setIntervalSecond(int intervalSecond) {
this.intervalSecond = intervalSecond;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getRunTime() {
return runTime;
}
public void setRunTime(String runTime) {
this.runTime = runTime;
}
public String getIsUsed() {
return isUsed;
}
public void setIsUsed(String isUsed) {
this.isUsed = isUsed;
}
}
|
[
"hao.duan@newtouch.cn"
] |
hao.duan@newtouch.cn
|
8f590b4e0d1d5ee85cf050ffc26e97afb3a6ba8a
|
9a68117c57f813c959bac2cebfd4f2b03e686aa6
|
/src/main/java/nl/webservices/www/soap/MetaMethodReference.java
|
ddc577ea26b9271b2438d5d7d6e405c225aaacb9
|
[] |
no_license
|
mytestrepofolder/cached-soap-webservices
|
dc394ba2cbabe58aca4516c623f46cf75021e46c
|
ce29a5e914b2f8e6963ef876d3558c74f0c47103
|
refs/heads/master
| 2020-12-02T16:22:55.920937
| 2017-07-07T13:55:41
| 2017-07-07T13:55:41
| 96,543,288
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 7,205
|
java
|
/**
* MetaMethodReference.java
*
* This file was auto-generated from WSDL
* by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
*/
package nl.webservices.www.soap;
public class MetaMethodReference implements java.io.Serializable {
private java.lang.String name;
private boolean deprecated;
private java.lang.String description;
private java.lang.String documentation_url;
public MetaMethodReference() {
}
public MetaMethodReference(
java.lang.String name,
boolean deprecated,
java.lang.String description,
java.lang.String documentation_url) {
this.name = name;
this.deprecated = deprecated;
this.description = description;
this.documentation_url = documentation_url;
}
/**
* Gets the name value for this MetaMethodReference.
*
* @return name
*/
public java.lang.String getName() {
return name;
}
/**
* Sets the name value for this MetaMethodReference.
*
* @param name
*/
public void setName(java.lang.String name) {
this.name = name;
}
/**
* Gets the deprecated value for this MetaMethodReference.
*
* @return deprecated
*/
public boolean isDeprecated() {
return deprecated;
}
/**
* Sets the deprecated value for this MetaMethodReference.
*
* @param deprecated
*/
public void setDeprecated(boolean deprecated) {
this.deprecated = deprecated;
}
/**
* Gets the description value for this MetaMethodReference.
*
* @return description
*/
public java.lang.String getDescription() {
return description;
}
/**
* Sets the description value for this MetaMethodReference.
*
* @param description
*/
public void setDescription(java.lang.String description) {
this.description = description;
}
/**
* Gets the documentation_url value for this MetaMethodReference.
*
* @return documentation_url
*/
public java.lang.String getDocumentation_url() {
return documentation_url;
}
/**
* Sets the documentation_url value for this MetaMethodReference.
*
* @param documentation_url
*/
public void setDocumentation_url(java.lang.String documentation_url) {
this.documentation_url = documentation_url;
}
private java.lang.Object __equalsCalc = null;
public synchronized boolean equals(java.lang.Object obj) {
if (!(obj instanceof MetaMethodReference)) return false;
MetaMethodReference other = (MetaMethodReference) obj;
if (obj == null) return false;
if (this == obj) return true;
if (__equalsCalc != null) {
return (__equalsCalc == obj);
}
__equalsCalc = obj;
boolean _equals;
_equals = true &&
((this.name==null && other.getName()==null) ||
(this.name!=null &&
this.name.equals(other.getName()))) &&
this.deprecated == other.isDeprecated() &&
((this.description==null && other.getDescription()==null) ||
(this.description!=null &&
this.description.equals(other.getDescription()))) &&
((this.documentation_url==null && other.getDocumentation_url()==null) ||
(this.documentation_url!=null &&
this.documentation_url.equals(other.getDocumentation_url())));
__equalsCalc = null;
return _equals;
}
private boolean __hashCodeCalc = false;
public synchronized int hashCode() {
if (__hashCodeCalc) {
return 0;
}
__hashCodeCalc = true;
int _hashCode = 1;
if (getName() != null) {
_hashCode += getName().hashCode();
}
_hashCode += (isDeprecated() ? Boolean.TRUE : Boolean.FALSE).hashCode();
if (getDescription() != null) {
_hashCode += getDescription().hashCode();
}
if (getDocumentation_url() != null) {
_hashCode += getDocumentation_url().hashCode();
}
__hashCodeCalc = false;
return _hashCode;
}
// Type metadata
private static org.apache.axis.description.TypeDesc typeDesc =
new org.apache.axis.description.TypeDesc(MetaMethodReference.class, true);
static {
typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.webservices.nl/soap/", "MetaMethodReference"));
org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("name");
elemField.setXmlName(new javax.xml.namespace.QName("http://www.webservices.nl/soap/", "name"));
elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("deprecated");
elemField.setXmlName(new javax.xml.namespace.QName("http://www.webservices.nl/soap/", "deprecated"));
elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "boolean"));
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("description");
elemField.setXmlName(new javax.xml.namespace.QName("http://www.webservices.nl/soap/", "description"));
elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
elemField.setMinOccurs(0);
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("documentation_url");
elemField.setXmlName(new javax.xml.namespace.QName("http://www.webservices.nl/soap/", "documentation_url"));
elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
}
/**
* Return type metadata object
*/
public static org.apache.axis.description.TypeDesc getTypeDesc() {
return typeDesc;
}
/**
* Get Custom Serializer
*/
public static org.apache.axis.encoding.Serializer getSerializer(
java.lang.String mechType,
java.lang.Class _javaType,
javax.xml.namespace.QName _xmlType) {
return
new org.apache.axis.encoding.ser.BeanSerializer(
_javaType, _xmlType, typeDesc);
}
/**
* Get Custom Deserializer
*/
public static org.apache.axis.encoding.Deserializer getDeserializer(
java.lang.String mechType,
java.lang.Class _javaType,
javax.xml.namespace.QName _xmlType) {
return
new org.apache.axis.encoding.ser.BeanDeserializer(
_javaType, _xmlType, typeDesc);
}
}
|
[
"Plabon.Kakoti@shell.com"
] |
Plabon.Kakoti@shell.com
|
2554ec6323a4d3fa74f2139426757ee5c4d7c1a6
|
33154930a5b04b864e2d3e683ab55a1020bfbb7c
|
/src/dave/lisp/detail/LispBuiltin.java
|
2525b7b76811b81d5cc3b3cf01dded5313c931da
|
[] |
no_license
|
davekessener/LISP
|
6b6881952edf41fed550e09455635082978100b0
|
89c72343bd1e9f54c1edc55ced40baa38f3e3d9d
|
refs/heads/master
| 2021-01-13T01:45:29.769987
| 2020-08-12T18:23:23
| 2020-08-12T18:23:23
| 14,492,999
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 705
|
java
|
package dave.lisp.detail;
import dave.lisp.common.Environment;
import dave.lisp.common.Result;
public abstract class LispBuiltin extends LispObject implements LispCallable
{
private final String mID;
private final boolean mEvaluateArgs;
protected LispBuiltin(String id, boolean e)
{
mID = id;
mEvaluateArgs = e;
}
public String id() { return mID; }
@Override
public Result call(String name, LispObject a, Environment e)
{
if(mEvaluateArgs)
{
a = LispRuntime.eval_all(a, e);
}
return apply(a, e);
}
@Override
public String serialize(boolean pretty)
{
return pretty ? mID : ("BUILTIN[" + mID + "]");
}
protected abstract Result apply(LispObject a, Environment e);
}
|
[
"davekessener@gmail.com"
] |
davekessener@gmail.com
|
d4be612be2b7b22a51490e201495fc7abd31f510
|
e295261737d3ba0bf84cb69c0f20d1e1dceac910
|
/src/main/java/com/test/model/User.java
|
74861b16e31e873f741524bc27822442915c8a21
|
[] |
no_license
|
tangchaolibai/springbootjasypt
|
8a1c1442aea7a968a6260df20f501e6953a36c1b
|
e5d560905eb2dd7c647cdad120d1471ea75c6e34
|
refs/heads/main
| 2023-07-11T09:28:30.704408
| 2021-08-15T15:38:50
| 2021-08-15T15:38:50
| 396,377,411
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 561
|
java
|
package com.test.model;
public class User {
private Long id;
private String name;
private Integer age;
private String email;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Integer getAge() {
return age;
}
public void setAge(Integer age) {
this.age = age;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
}
|
[
"heweiqing@formssi.com"
] |
heweiqing@formssi.com
|
af192d25e39b76040061d6fc89734ba45bffe2a1
|
2b69d7124ce03cb40c3ee284aa0d3ce0d1814575
|
/pms/pms-facade/src/main/java/com/zb/fincore/pms/facade/product/ProductPlanJobServiceFacade.java
|
46ec81365a267846f41a1de5f23f5286e4375bbc
|
[] |
no_license
|
hhhcommon/fincore_p2p
|
6bb7a4c44ebd8ff12a4c1f7ca2cf5cc182b55b44
|
550e937c1f7d1c6642bda948cd2f3cc9feb7d3eb
|
refs/heads/master
| 2021-10-24T12:12:22.322007
| 2019-03-26T02:17:01
| 2019-03-26T02:17:01
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 755
|
java
|
package com.zb.fincore.pms.facade.product;
import com.zb.fincore.pms.common.dto.BaseResponse;
/**
* 功能: 产品计划数据库服务接口
* 创建: liuchongguang - liuchongguang@zillionfortune.com
* 日期: 2017/4/6 0006 16:55
* 版本: V1.0
*/
public interface ProductPlanJobServiceFacade {
/**
* 创建产品计划 job调用. <br/>
*
* @return
* @throws Exception
*/
BaseResponse createProductPlan();
/**
* 计算产品计划库存 job调用. <br/>
*
* @return
* @throws Exception
*/
BaseResponse countProductPlanStock();
/**
* 开放产品计划 job调用 . <br/>
*
* @return
* @throws Exception
*/
BaseResponse openProductPaln();
}
|
[
"kaiyun@zillionfortune.com"
] |
kaiyun@zillionfortune.com
|
db6511566b9b9477df7e50b3378e3ca62a6aa3a7
|
b914bb98d3d35e0cc108a8905a60b8aeab878934
|
/intellij/org.eclipse.xtext.core.idea.tests/src-gen/org/eclipse/xtext/parsetree/impl/idea/server/CommentAssociationTestLanguageBuildProcessParametersProvider.java
|
14c071fa02122b31f40c3b7be73526cd74d801c5
|
[
"LicenseRef-scancode-generic-cla"
] |
no_license
|
l0rd/xtext
|
50e9284d97bd927fa1290b9badf1cf3374e798cf
|
6fc2fba698705832b5ad014cbbd6896092eaabdc
|
refs/heads/master
| 2021-01-17T16:43:36.435925
| 2015-03-26T08:55:11
| 2015-03-26T08:55:11
| 32,921,650
| 0
| 0
| null | 2015-03-26T10:44:08
| 2015-03-26T10:44:08
| null |
UTF-8
|
Java
| false
| false
| 639
|
java
|
package org.eclipse.xtext.parsetree.impl.idea.server;
import java.util.Arrays;
import java.util.List;
import com.intellij.compiler.server.BuildProcessParametersProvider;
import com.intellij.ide.plugins.PluginManager;
import com.intellij.openapi.extensions.PluginId;
public class CommentAssociationTestLanguageBuildProcessParametersProvider extends BuildProcessParametersProvider {
public List<String> getClassPath() {
String path = PluginManager.getPlugin(PluginId.getId("org.eclipse.xtext.parsetree.impl.idea")).getPath().getPath();
return Arrays.asList(
path + "/bin",
path + "/../org.eclipse.xtext.tests/bin"
);
}
}
|
[
"anton.kosyakov@itemis.de"
] |
anton.kosyakov@itemis.de
|
b945405f56a3be8ef724385700a2bccf9298f0c4
|
8dab0aa919849ad281a45343b8fc0a75af0c40e3
|
/app/src/main/java/ikon/ikon/Model/AccessoriesResponse.java
|
94e8c780348adf815574bae6f5c605de6ac37441
|
[] |
no_license
|
AhmedMansour9/Jake
|
38e5aec5eb277aa20b64e4f514c6be1450aef44a
|
3e29b8c1955498a8e783aaaeec08c2343e3adf37
|
refs/heads/master
| 2020-04-14T06:04:54.051963
| 2019-03-04T13:25:28
| 2019-03-04T13:25:28
| 163,676,963
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 825
|
java
|
package ikon.ikon.Model;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
/**
* Created by ic on 9/8/2018.
*/
public class AccessoriesResponse {
@SerializedName("data")
@Expose
private Accessories data;
@SerializedName("status")
@Expose
private Boolean status;
@SerializedName("error")
@Expose
private String error;
public Accessories getData() {
return data;
}
public void setData(Accessories data) {
this.data = data;
}
public Boolean getStatus() {
return status;
}
public void setStatus(Boolean status) {
this.status = status;
}
public String getError() {
return error;
}
public void setError(String error) {
this.error = error;
}
}
|
[
"37387373+AhmedMansour9@users.noreply.github.com"
] |
37387373+AhmedMansour9@users.noreply.github.com
|
b5c02050d438b3bfd3d120c1bad44458b72d9bf5
|
404a189c16767191ffb172572d36eca7db5571fb
|
/main-war/build/jsp/org/apache/jsp/grnds_002ddocs/document/documentException_jsp.java
|
439ce69829ad437cfc69b6fdda7dfc3493f7881a
|
[] |
no_license
|
tayduivn/training
|
648a8e9e91194156fb4ffb631749e6d4bf2d0590
|
95078fb2c7e21bf2bba31e2bbd5e404ac428da2f
|
refs/heads/master
| 2021-06-13T16:20:41.293097
| 2017-05-08T21:37:59
| 2017-05-08T21:37:59
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,424
|
java
|
package org.apache.jsp.grnds_002ddocs.document;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import gov.georgia.dhr.dfcs.sacwis.web.core.web.BasePrsConversation;
import gov.georgia.dhr.dfcs.sacwis.core.constants.ArchitectureConstants;
import gov.georgia.dhr.dfcs.sacwis.web.core.web.BasePrsConversation;
public final class documentException_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent {
private static java.util.Vector _jspx_dependants;
public java.util.List getDependants() {
return _jspx_dependants;
}
public void _jspService(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, ServletException {
JspFactory _jspxFactory = null;
PageContext pageContext = null;
HttpSession session = null;
ServletContext application = null;
ServletConfig config = null;
JspWriter out = null;
Object page = this;
JspWriter _jspx_out = null;
PageContext _jspx_page_context = null;
try {
_jspxFactory = JspFactory.getDefaultFactory();
response.setContentType("text/html");
pageContext = _jspxFactory.getPageContext(this, request, response,
null, true, 8192, true);
_jspx_page_context = pageContext;
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out = out;
out.write("\r\n\r\n\r\n\r\n\r\n\r\n");
// Set character encoding before printing anything out; this MUST
// be done in order to properly display extended characters.
response.setContentType( "text/html; charset=" + ArchitectureConstants.CHARACTER_ENCODING );
out.write("\r\n<html>\r\n<head>\r\n <meta http-equiv=\"Content-Type\" content=\"text/html; charset=");
out.print(ArchitectureConstants.CHARACTER_ENCODING);
out.write("\">\r\n <title>Document Architecture Exception</title>\r\n <link href=\"/grnds-docs/css/impact.css\" rel=\"stylesheet\">\r\n</head>\r\n<body>\r\n <table width=\"500\" cellpadding=\"1\">\r\n <tr>\r\n <td class=\"formErrorText\">\r\n <hr noshade size=\"1\">\r\n");
if (request.getAttribute( BasePrsConversation.ERROR_MESSAGES )!= null)
{
Map nonValidationErrorMessages = (Map)request.getAttribute( BasePrsConversation.ERROR_MESSAGES );
Set keys = nonValidationErrorMessages.keySet();
Iterator keyIter = keys.iterator();
while (keyIter.hasNext())
{
String nextErrorName = (String) keyIter.next();
String nextErrorMessage = (String) nonValidationErrorMessages.get(nextErrorName);
out.println(nextErrorMessage + "<br>");
}
}
out.write("\r\n <hr noshade size=\"1\">\r\n </td>\r\n </tr>\r\n</table>\r\n</body>\r\n</html>");
} catch (Throwable t) {
if (!(t instanceof SkipPageException)){
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
out.clearBuffer();
if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
}
} finally {
if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context);
}
}
}
|
[
"lgeddam@gmail.com"
] |
lgeddam@gmail.com
|
5a67d5b31ffb17c8158ef62dbf422b0e1ea4673c
|
dd80a584130ef1a0333429ba76c1cee0eb40df73
|
/packages/apps/VideoEditor/src/com/android/videoeditor/ExportOptionsDialog.java
|
a845dea1a1069e3e99242e1c558ad9efb5db5062
|
[
"MIT"
] |
permissive
|
karunmatharu/Android-4.4-Pay-by-Data
|
466f4e169ede13c5835424c78e8c30ce58f885c1
|
fcb778e92d4aad525ef7a995660580f948d40bc9
|
refs/heads/master
| 2021-03-24T13:33:01.721868
| 2017-02-18T17:48:49
| 2017-02-18T17:48:49
| 81,847,777
| 0
| 2
|
MIT
| 2020-03-09T00:02:12
| 2017-02-13T16:47:00
| null |
UTF-8
|
Java
| false
| false
| 6,960
|
java
|
/*
* Copyright (C) 2010 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.videoeditor;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.media.videoeditor.MediaProperties;
import android.util.Pair;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.Spinner;
/**
* The export options dialog
*/
public class ExportOptionsDialog {
// Listener
public interface ExportOptionsListener {
/**
* User initiated the export operation
*
* @param movieHeight The movie height (from MediaProperties)
* @param movieBitrate The movie bitrate (from MediaProperties)
*/
public void onExportOptions(int movieHeight, int movieBitrate);
}
/**
* Create the export options dialog
*
* @param context The context
* @param positiveListener The positive listener
* @param negativeListener The negative listener
* @param cancelListener The cancel listener
* @param aspectRatio The aspect ratio
*
* @return The dialog
*/
public static Dialog create(Context context, final ExportOptionsListener positiveListener,
DialogInterface.OnClickListener negativeListener,
DialogInterface.OnCancelListener cancelListener, final int aspectRatio) {
AlertDialog.Builder builder = new AlertDialog.Builder(context);
// Set the title
builder.setIcon(android.R.drawable.ic_dialog_info);
builder.setTitle(context.getString(R.string.editor_export_movie));
// Set the layout
final LayoutInflater vi = (LayoutInflater)context
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
final View myView = vi.inflate(R.layout.export_options_dialog_view, null);
builder.setView(myView);
// Prepare the dialog content
prepareContent(myView, aspectRatio);
// Setup the positive listener
builder.setPositiveButton(context.getString(R.string.export_dialog_export),
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
final Spinner sizeSpinner = (Spinner)myView.findViewById(
R.id.export_option_size);
final int movieHeight = indexToMovieHeight(
sizeSpinner.getSelectedItemPosition(), aspectRatio);
final Spinner qualitySpinner = (Spinner)myView.findViewById(
R.id.export_option_quality);
final int movieBitrate = indexToMovieBitrate(
qualitySpinner.getSelectedItemPosition());
positiveListener.onExportOptions(movieHeight, movieBitrate);
}
});
// Setup the negative listener
builder.setNegativeButton(context.getString(android.R.string.cancel), negativeListener);
builder.setCancelable(true);
builder.setOnCancelListener(cancelListener);
final AlertDialog dialog = builder.create();
return dialog;
}
/**
* Prepare the dialog content
*
* @param view The dialog content view
* @param aspectRatio The project aspect ratio
*/
private static void prepareContent(View view, int aspectRatio) {
final Context context = view.getContext();
// Setup the movie size spinner
final ArrayAdapter<CharSequence> sizeAdapter = new ArrayAdapter<CharSequence>(
context, android.R.layout.simple_spinner_item);
sizeAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
final Pair<Integer, Integer>[] supportedSizes =
MediaProperties.getSupportedResolutions(aspectRatio);
for (int i = 0; i < supportedSizes.length; i++) {
sizeAdapter.add(supportedSizes[i].first + "x" + supportedSizes[i].second);
}
final Spinner sizeSpinner = (Spinner)view.findViewById(R.id.export_option_size);
sizeSpinner.setAdapter(sizeAdapter);
sizeSpinner.setPromptId(R.string.export_dialog_movie_size);
// Setup the movie quality spinner
final ArrayAdapter<CharSequence> qualityAdapter = new ArrayAdapter<CharSequence>(context,
android.R.layout.simple_spinner_item);
qualityAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
qualityAdapter.add(context.getString(R.string.export_dialog_movie_quality_low));
qualityAdapter.add(context.getString(R.string.export_dialog_movie_quality_medium));
qualityAdapter.add(context.getString(R.string.export_dialog_movie_quality_high));
final Spinner qualitySpinner = (Spinner)view.findViewById(R.id.export_option_quality);
qualitySpinner.setAdapter(qualityAdapter);
// Set the default quality to "Medium"
qualitySpinner.setSelection(1);
qualitySpinner.setPromptId(R.string.export_dialog_movie_quality);
}
/**
* Convert the spinner selection to a movie height
*
* @param sizeIndex The index of the selected spinner item
* @param aspectRatio The aspect ratio
*
* @return The movie height
*/
private static int indexToMovieHeight(int sizeIndex, int aspectRatio) {
final Pair<Integer, Integer>[] supportedSizes =
MediaProperties.getSupportedResolutions(aspectRatio);
return supportedSizes[sizeIndex].second;
}
/**
* Convert the spinner selection to a movie quality
*
* @param qualityIndex The index of the selected spinner item
*
* @return The movie bitrate
*/
private static int indexToMovieBitrate(int qualityIndex) {
switch (qualityIndex) {
case 0: { // Low
return MediaProperties.BITRATE_512K;
}
case 1: { // Medium
return MediaProperties.BITRATE_2M;
}
case 2: { // High
return MediaProperties.BITRATE_8M;
}
default: {
return MediaProperties.BITRATE_2M;
}
}
}
}
|
[
"karun.matharu@gmail.com"
] |
karun.matharu@gmail.com
|
1bca3cfe201db541d24e0fb6c73fbf433ab3e8e2
|
7c24fa6ab4d1cdc0f4490d82de61ddb31684999f
|
/logginghub-utils/src/main/java/com/logginghub/utils/Is.java
|
6b77d779074f742bedfd1a347ed607621ccaa211
|
[
"Apache-2.0"
] |
permissive
|
logginghub/core
|
e4e0d46780d99561127f531f600f2bb5b01cb46d
|
c04545c3261258f8d54aeb30eb43f58a7ba58493
|
refs/heads/master
| 2022-12-13T03:46:39.295908
| 2022-12-08T08:55:57
| 2022-12-08T08:55:57
| 28,720,138
| 0
| 2
|
Apache-2.0
| 2022-07-07T21:04:39
| 2015-01-02T17:16:52
|
Java
|
UTF-8
|
Java
| false
| false
| 4,198
|
java
|
package com.logginghub.utils;
import java.util.Arrays;
import java.util.Collection;
import java.util.Set;
import javax.swing.SwingUtilities;
public class Is {
public static boolean exitOnViolation = false;
public static void instanceOf(Object instance, Class<?> instanceOfClass, String message, Object... objects) {
if(instance.getClass().isAssignableFrom(instanceOfClass)) {
throwI(message, objects);
}
}
public static void equals(byte[] a, byte[] b, String message, Object... objects) {
if (!Arrays.equals(a, b)) {
throwI(message, objects);
}
}
public static void equals(String actual, String expected, String message, Object... objects) {
if (!actual.equals(expected)) {
throwI(message, objects);
}
}
public static void equals(Object actual, Object expected, String message, Object... objects) {
if (!actual.equals(expected)) {
throwI(message, objects);
}
}
public static void falseStatement(boolean value, String message, Object... objects) {
if (value) {
throwI(message, objects);
}
}
public static void greaterThan(double a, double b, String message, Object... objects) {
if(a <= b) {
throwI(message, objects);
}
}
public static void lessThan(double a, double b, String message, Object... objects) {
if(b < a) {
throwI(message, objects);
}
}
public static void greaterThanOrZero(int value, String message, Object... objects) {
if (value < 0) {
throwI(message, objects);
}
}
public static void greaterThanZero(double value, String message, Object... objects) {
if (value <= 0) {
throwI(message, objects);
}
}
public static void not(Object actual, Object expected, String message, Object... objects) {
if (actual.equals(expected)) {
throwI(message, objects);
}
}
public static void notEmpty(Collection<?> collection, String message) {
if (collection.size() == 0) {
throwI(message, collection);
}
}
public static void notIn(Object object, Set<String> set, String message) {
if (set.contains(object)) {
throwI(message, object, set);
}
}
public static void notNull(Object object, String message) {
if (object == null) {
throwI(message, object);
}
}
public static void notNull(Object object, String message, Object... objects) {
if (object == null) {
throwI(message, objects);
}
}
public static void notNullOrEmpty(String string, String message) {
if (string == null || string.length() == 0) {
throwI(message, string);
}
}
public static void notNullOrEmpty(String string, String message, Object... objects) {
if (string == null || string.length() == 0) {
throwI(message, objects);
}
}
public static void nullOrEmpty(String string, String message) {
if (string != null && string.length() != 0) {
throwI(message, string);
}
}
public static void swingEventThread() {
if (!SwingUtilities.isEventDispatchThread()) {
throw new IllegalArgumentException("Call wasn't made from the swing event dispatch thread");
}
}
public static void trueStatement(boolean value, String message, Object... objects) {
if (!value) {
throwI(message, objects);
}
}
private static void throwI(String message, Object... objects) {
String formattedMessage = StringUtils.format(message, objects);
if (exitOnViolation) {
System.err.println(formattedMessage);
System.exit(-1);
}
else {
throw new IllegalArgumentException(formattedMessage);
}
}
}
|
[
"james@vertexlabs.co.uk"
] |
james@vertexlabs.co.uk
|
2f21318152b1eb8c9dc693b7f9634700c3cd01a6
|
863acb02a064a0fc66811688a67ce3511f1b81af
|
/sources/com/airbnb/lottie/p094e/C5787B.java
|
7064d9a37c78c09b736efe3b4231115f7e84b1fe
|
[
"MIT"
] |
permissive
|
Game-Designing/Custom-Football-Game
|
98d33eb0c04ca2c48620aa4a763b91bc9c1b7915
|
47283462b2066ad5c53b3c901182e7ae62a34fc8
|
refs/heads/master
| 2020-08-04T00:02:04.876780
| 2019-10-06T06:55:08
| 2019-10-06T06:55:08
| 211,914,568
| 1
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,923
|
java
|
package com.airbnb.lottie.p094e;
import android.graphics.PointF;
import android.util.JsonReader;
import com.airbnb.lottie.C5830g;
import com.airbnb.lottie.model.animatable.AnimatableValue;
import com.airbnb.lottie.p089c.p090a.C5721b;
import com.airbnb.lottie.p089c.p090a.C5725f;
import com.airbnb.lottie.p089c.p091b.C5747j;
import java.io.IOException;
/* renamed from: com.airbnb.lottie.e.B */
/* compiled from: RectangleShapeParser */
class C5787B {
/* renamed from: a */
static C5747j m10417a(JsonReader reader, C5830g composition) throws IOException {
String name = null;
AnimatableValue<PointF, PointF> position = null;
C5725f size = null;
C5721b roundedness = null;
while (reader.hasNext()) {
String nextName = reader.nextName();
char c = 65535;
int hashCode = nextName.hashCode();
if (hashCode != 112) {
if (hashCode != 3519) {
if (hashCode != 114) {
if (hashCode == 115 && nextName.equals("s")) {
c = 2;
}
} else if (nextName.equals("r")) {
c = 3;
}
} else if (nextName.equals("nm")) {
c = 0;
}
} else if (nextName.equals("p")) {
c = 1;
}
if (c == 0) {
name = reader.nextString();
} else if (c == 1) {
position = C5797a.m10430b(reader, composition);
} else if (c == 2) {
size = C5800d.m10442e(reader, composition);
} else if (c != 3) {
reader.skipValue();
} else {
roundedness = C5800d.m10440c(reader, composition);
}
}
return new C5747j(name, position, size, roundedness);
}
}
|
[
"tusharchoudhary0003@gmail.com"
] |
tusharchoudhary0003@gmail.com
|
72d175ba7f3d6d277545b15a0874270fa613707b
|
504f0ba5c18ccc7393e6715f1ce9b236c4f6d99f
|
/drds-20190123/src/main/java/com/aliyun/drds20190123/models/DescribeBackupSetsRequest.java
|
32e325f04c3db99be541ea94705ee7a5b253b64a
|
[
"Apache-2.0"
] |
permissive
|
jhz-duanmeng/alibabacloud-java-sdk
|
77f69351dee8050f9c40d7e19b05cf613d2448d6
|
ac8bfeb15005d3eac06091bbdf50e7ed3e891c38
|
refs/heads/master
| 2023-01-16T04:30:12.898713
| 2020-11-25T11:45:31
| 2020-11-25T11:45:31
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,319
|
java
|
// This file is auto-generated, don't edit it. Thanks.
package com.aliyun.drds20190123.models;
import com.aliyun.tea.*;
public class DescribeBackupSetsRequest extends TeaModel {
@NameInMap("DrdsInstanceId")
@Validation(required = true)
public String drdsInstanceId;
@NameInMap("StartTime")
@Validation(required = true)
public String startTime;
@NameInMap("EndTime")
@Validation(required = true)
public String endTime;
public static DescribeBackupSetsRequest build(java.util.Map<String, ?> map) throws Exception {
DescribeBackupSetsRequest self = new DescribeBackupSetsRequest();
return TeaModel.build(map, self);
}
public DescribeBackupSetsRequest setDrdsInstanceId(String drdsInstanceId) {
this.drdsInstanceId = drdsInstanceId;
return this;
}
public String getDrdsInstanceId() {
return this.drdsInstanceId;
}
public DescribeBackupSetsRequest setStartTime(String startTime) {
this.startTime = startTime;
return this;
}
public String getStartTime() {
return this.startTime;
}
public DescribeBackupSetsRequest setEndTime(String endTime) {
this.endTime = endTime;
return this;
}
public String getEndTime() {
return this.endTime;
}
}
|
[
"sdk-team@alibabacloud.com"
] |
sdk-team@alibabacloud.com
|
e14722486b554db40f41836cccf06d0e577ed9ef
|
23969aab34c2c98d590a7be3c9b9cb6028054ca0
|
/Food-diy-Web/src/main/java/kr/co/bit/dao/Select_Ing_DAOImp.java
|
b570eecbd46eb8330b28041b7f2b42acfa80d65c
|
[] |
no_license
|
hysrush/Fooddiy
|
7730c3a5604c1422b0e240e3998534159025668c
|
6113d8d5d77610360d4e6f05e999803e85b3eb27
|
refs/heads/master
| 2021-09-02T10:53:33.465785
| 2018-01-02T02:37:18
| 2018-01-02T02:37:18
| 109,796,454
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 616
|
java
|
package kr.co.bit.dao;
import java.util.List;
import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import kr.co.bit.vo.IngredientsVO;
@Repository
public class Select_Ing_DAOImp implements Select_Ing_DAO{
@Autowired
private SqlSessionTemplate sqlSession;
private String url = "kr.co.bit.menu.dao.Select_Ing_DAO.";
@Override
public List<IngredientsVO> selectAllIng() {
List<IngredientsVO> ingAll = sqlSession.selectList(url + "selectAllIng");
return ingAll;
}
}
|
[
"bit-user@DESKTOP-C1QR4BV"
] |
bit-user@DESKTOP-C1QR4BV
|
231e678dbe730b8e6e797ecd1718c28a491686fa
|
c7406de612eff59725824a8120d960c585da4b2c
|
/logistics/src/main/java/com/tomtop/entry/po/SkuMapTemplate.java
|
ad9063e56b2829089958d275dce5d98a2a407643
|
[] |
no_license
|
liudih/tt-58
|
92b9a53a6514e13d30e4c2afbafc8de68f096dfb
|
0a921f35cc10052f20ff3f8434407dc3eabd7aa1
|
refs/heads/master
| 2021-01-20T18:02:12.917030
| 2016-06-28T04:08:30
| 2016-06-28T04:08:30
| 62,108,984
| 1
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 632
|
java
|
package com.tomtop.entry.po;
import java.io.Serializable;
public class SkuMapTemplate implements Serializable {
/**
*
*/
private static final long serialVersionUID = -5541697697025691012L;
private String sku;
private String templateId;
private String mapKey;
public String getSku() {
return sku;
}
public void setSku(String sku) {
this.sku = sku;
}
public String getTemplateId() {
return templateId;
}
public void setTemplateId(String templateId) {
this.templateId = templateId;
}
public String getMapKey() {
return mapKey;
}
public void setMapKey(String mapKey) {
this.mapKey = mapKey;
}
}
|
[
"liudih@qq.com"
] |
liudih@qq.com
|
65a790a093158a8b6d3727d8a9f6412c80098f4e
|
bd6ecb98c629d7780363970cb20ba3b92d3199c1
|
/src/main/java/com/github/prbrios/documentofiscal/cte/CTeInfCteInfCteAnu.java
|
0e917500c5e5e1e2a8c2fe3a7f1f50a637ffa31a
|
[] |
no_license
|
prbrios/leiaute-documento-fiscal
|
5d4468c57f8abdfe0c47115fc3316b14a0961960
|
f1d67ef090c89ada318741ecd023d3a0680dcd27
|
refs/heads/master
| 2023-08-26T11:12:12.983779
| 2023-07-14T13:16:39
| 2023-07-14T13:16:39
| 212,176,018
| 0
| 0
| null | 2022-11-16T00:56:35
| 2019-10-01T18:57:21
|
Java
|
UTF-8
|
Java
| false
| false
| 542
|
java
|
package com.github.prbrios.documentofiscal.cte;
import org.simpleframework.xml.Element;
import org.simpleframework.xml.Root;
@Root(name = "infCTeAnu")
public class CTeInfCteInfCteAnu {
@Element(name = "chCte", required = false)
private String chCte;
@Element(name = "dEmi", required = false)
private String dEmi;
public String getChCte() {
return chCte;
}
public void setChCte(String chCte) {
this.chCte = chCte;
}
public String getdEmi() {
return dEmi;
}
public void setdEmi(String dEmi) {
this.dEmi = dEmi;
}
}
|
[
"prbrios@gmail.com"
] |
prbrios@gmail.com
|
6057def5514dc626e3c1572f5263453bc7b32269
|
fa91450deb625cda070e82d5c31770be5ca1dec6
|
/Diff-Raw-Data/15/15_60a2280ebfe5239311395acefe4b233f6d8c1fdc/CoreFeature/15_60a2280ebfe5239311395acefe4b233f6d8c1fdc_CoreFeature_s.java
|
9370524486c5f6c59aac9762364172512de45873
|
[] |
no_license
|
zhongxingyu/Seer
|
48e7e5197624d7afa94d23f849f8ea2075bcaec0
|
c11a3109fdfca9be337e509ecb2c085b60076213
|
refs/heads/master
| 2023-07-06T12:48:55.516692
| 2023-06-22T07:55:56
| 2023-06-22T07:55:56
| 259,613,157
| 6
| 2
| null | 2023-06-22T07:55:57
| 2020-04-28T11:07:49
| null |
UTF-8
|
Java
| false
| false
| 6,389
|
java
|
/*
* Copyright (c) 2006-2011 Nuxeo SA (http://nuxeo.com/) and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* bstefanescu
*/
package org.nuxeo.ecm.core.test;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.nuxeo.ecm.core.api.ClientException;
import org.nuxeo.ecm.core.api.CoreInstance;
import org.nuxeo.ecm.core.api.CoreSession;
import org.nuxeo.ecm.core.api.PathRef;
import org.nuxeo.ecm.core.event.EventService;
import org.nuxeo.ecm.core.test.annotations.BackendType;
import org.nuxeo.ecm.core.test.annotations.Granularity;
import org.nuxeo.ecm.core.test.annotations.RepositoryInit;
import org.nuxeo.runtime.api.Framework;
import org.nuxeo.runtime.test.runner.Deploy;
import org.nuxeo.runtime.test.runner.Features;
import org.nuxeo.runtime.test.runner.FeaturesRunner;
import org.nuxeo.runtime.test.runner.RuntimeFeature;
import org.nuxeo.runtime.test.runner.SimpleFeature;
import com.google.inject.Binder;
/**
* The core feature provides deployments needed to have a nuxeo core running.
* Several annotations can be used:
* <ul>
* <li>FIXME
* <li>FIXME
* </ul>
*
* @author <a href="mailto:bs@nuxeo.com">Bogdan Stefanescu</a>
*/
@Deploy({ "org.nuxeo.ecm.core.schema", "org.nuxeo.ecm.core.query",
"org.nuxeo.ecm.core.api", "org.nuxeo.ecm.core.event",
"org.nuxeo.ecm.core", "org.nuxeo.ecm.core.convert",
"org.nuxeo.ecm.core.convert.plugins", "org.nuxeo.ecm.core.storage.sql",
"org.nuxeo.ecm.core.storage.sql.test" })
@Features(RuntimeFeature.class)
public class CoreFeature extends SimpleFeature {
private static final Log log = LogFactory.getLog(CoreFeature.class);
protected int initialOpenSessions;
protected RepositorySettings repository;
public RepositorySettings getRepository() {
return repository;
}
public BackendType getBackendType() {
return repository.getBackendType();
}
@Override
public void initialize(FeaturesRunner runner) throws Exception {
repository = new RepositorySettings(runner);
runner.getFeature(RuntimeFeature.class).addServiceProvider(
repository);
}
@Override
public void start(FeaturesRunner runner) throws Exception {
repository.initialize();
}
@Override
public void configure(FeaturesRunner runner, Binder binder) {
binder.bind(RepositorySettings.class).toInstance(repository);
}
@Override
public void beforeRun(FeaturesRunner runner) throws Exception {
initialOpenSessions = CoreInstance.getInstance().getNumberOfSessions();
if (repository.getGranularity() != Granularity.METHOD) {
initializeSession(runner);
}
}
@Override
public void afterRun(FeaturesRunner runner) throws Exception {
if (repository.getGranularity() != Granularity.METHOD) {
cleanupSession(runner);
}
waitForAsyncCompletion();
repository.shutdown();
final CoreInstance core = CoreInstance.getInstance();
int finalOpenSessions = core.getNumberOfSessions();
int leakedOpenSessions = finalOpenSessions - initialOpenSessions;
if (leakedOpenSessions != 0) {
log.error(String.format(
"There are %s open session(s) at tear down; it seems "
+ "the test leaked %s session(s).",
Integer.valueOf(finalOpenSessions),
Integer.valueOf(leakedOpenSessions)));
for (CoreInstance.RegistrationInfo info:core.getRegistrationInfos()) {
log.warn("Leaking session", info);
}
}
}
@Override
public void beforeSetup(FeaturesRunner runner) throws Exception {
if (repository.getGranularity() == Granularity.METHOD) {
initializeSession(runner);
}
}
@Override
public void afterTeardown(FeaturesRunner runner) throws Exception {
if (repository.getGranularity() == Granularity.METHOD) {
cleanupSession(runner);
}
}
protected void waitForAsyncCompletion() {
Framework.getLocalService(EventService.class).waitForAsyncCompletion();
}
protected void cleanupSession(FeaturesRunner runner) {
CoreSession session = repository.getSession();
// wait for any async thread to finish (e.g. fulltext indexing) as
// apparently concurrent fulltext indexing of document that has just
// been deleted can trigger the core (SessionImpl) to try to re-create
// the row either in the hierarchy or in the fulltext tables and violate
// integrity constraints of the database
waitForAsyncCompletion();
if (session == null) {
// session was never properly created, error during setup
return;
}
try {
session.removeChildren(new PathRef("/"));
session.save();
// wait for async events potentially triggered by the repo clean up
// it-self before moving on to executing the next test if any
waitForAsyncCompletion();
} catch (ClientException e) {
log.error("Unable to reset repository", e);
} finally {
CoreScope.INSTANCE.exit();
}
repository.releaseSession();
}
protected void initializeSession(FeaturesRunner runner) {
CoreScope.INSTANCE.enter();
CoreSession session = repository.createSession();
RepositoryInit factory = repository.getInitializer();
if (factory != null) {
try {
factory.populate(session);
session.save();
waitForAsyncCompletion();
} catch (ClientException e) {
log.error(e.toString(), e);
}
}
}
public void setRepositorySettings(RepositorySettings settings) {
repository.importSettings(settings);
}
}
|
[
"yuzhongxing88@gmail.com"
] |
yuzhongxing88@gmail.com
|
db61425ebdd1cc88937ee3ff1d54391f9ad8d258
|
17e8438486cb3e3073966ca2c14956d3ba9209ea
|
/dso/tags/4.1.4_fix2/toolkit-impl/src/main/java/com/terracotta/toolkit/events/ToolkitNotifierImplApplicator.java
|
301954071a20a39e1e8740f72507e968007e53ee
|
[] |
no_license
|
sirinath/Terracotta
|
fedfc2c4f0f06c990f94b8b6c3b9c93293334345
|
00a7662b9cf530dfdb43f2dd821fa559e998c892
|
refs/heads/master
| 2021-01-23T05:41:52.414211
| 2015-07-02T15:21:54
| 2015-07-02T15:21:54
| 38,613,711
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,686
|
java
|
/*
* All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved.
*/
package com.terracotta.toolkit.events;
import com.tc.logging.TCLogger;
import com.tc.object.ClientObjectManager;
import com.tc.object.SerializationUtil;
import com.tc.object.TCObject;
import com.tc.object.TraversedReferences;
import com.tc.object.applicator.BaseApplicator;
import com.tc.object.dna.api.DNA;
import com.tc.object.dna.api.DNACursor;
import com.tc.object.dna.api.DNAEncoding;
import com.tc.object.dna.api.DNAWriter;
import com.tc.object.dna.api.LogicalAction;
import com.tc.object.dna.api.PhysicalAction;
import java.io.IOException;
import java.util.Arrays;
public class ToolkitNotifierImplApplicator extends BaseApplicator {
public ToolkitNotifierImplApplicator(DNAEncoding encoding, TCLogger logger) {
super(encoding, logger);
}
@Override
public void hydrate(ClientObjectManager objectManager, TCObject tcObject, DNA dna, Object pojo) throws IOException,
ClassNotFoundException {
ToolkitNotifierImpl clusteredNotifierImpl = (ToolkitNotifierImpl) pojo;
DNACursor cursor = dna.getCursor();
while (cursor.next(encoding)) {
Object action = cursor.getAction();
if (action instanceof LogicalAction) {
LogicalAction la = (LogicalAction) action;
if (la.getMethod() == SerializationUtil.CLUSTERED_NOTIFIER) {
Object[] parameters = la.getParameters();
if (parameters.length != 2) { throw new AssertionError(
"ClusteredNotifier should have 2 parameters, but found: "
+ parameters.length + " : "
+ Arrays.asList(parameters)); }
clusteredNotifierImpl.onNotification((String) parameters[0], (String) parameters[1]);
} else if (la.getMethod() == SerializationUtil.DESTROY) {
clusteredNotifierImpl.applyDestroy();
}
} else if (action instanceof PhysicalAction) { throw new AssertionError(
"ClusteredNotifier should not broadcast any physical actions"); }
}
}
@Override
public void dehydrate(ClientObjectManager objectManager, TCObject tcObject, DNAWriter writer, Object pojo) {
// do nothing
}
@Override
public TraversedReferences getPortableObjects(Object pojo, TraversedReferences addTo) {
return addTo;
}
@Override
public Object getNewInstance(ClientObjectManager objectManager, DNA dna) {
throw new UnsupportedOperationException();
}
}
|
[
"speddir@7fc7bbf3-cf45-46d4-be06-341739edd864"
] |
speddir@7fc7bbf3-cf45-46d4-be06-341739edd864
|
cd95e3af2576e669c31f195cd5eb8470d2a2ea5a
|
aa45c0b3db42693a832abdac36b02dc60d1e7f90
|
/app/src/main/java/com/example/dell/myapplication/Main3Activityxc.java
|
38cb8b1639a48a0a6d29e02083e30f6ab6b2cf33
|
[] |
no_license
|
yufeilong92/StudyInface
|
0f054a5b9706348d1d2f8d3fc20e2ee053660591
|
19c3ca736dd4c41255a4bb58ace5dda491b83ba9
|
refs/heads/master
| 2020-03-20T05:53:35.607510
| 2018-06-13T14:53:19
| 2018-06-13T14:53:19
| 137,230,153
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 721
|
java
|
package com.example.dell.myapplication;
import android.os.Bundle;
import android.support.v4.app.ActivityCompat;
/**
* @version V 1.0 xxxxxxxx
* @Title: Main3Activityxc.java
* @Package com.example.dell.myapplication
* @Description: todo
* @author: YFL
* @date: 2018/6/12 22:06
* @verdescript 版本号 修改时间 修改人 修改的概要说明
* @Copyright: 2018/6/12 星期二
* 注意:本内容仅限于学川教育有限公司内部传阅,禁止外泄以及用于其他的商业目
*/
interface Main3Activityxc extends ActivityCompat.OnRequestPermissionsResultCallback, ActivityCompat.RequestPermissionsRequestCodeValidator, add {
void onCreate(Bundle savedInstanceState);
void addup();
}
|
[
"931697478@qq.com"
] |
931697478@qq.com
|
089aab0aae2d3eb6af11252fcad09d29be2d93eb
|
8a5ca7a814651085ac7d0d973737e5db581093d4
|
/Teamwork/src/pt/tumba/ngram/TCatNGException.java
|
575fdf737623636186d8c4cd35b936f0b999facf
|
[] |
no_license
|
Richard1112/Twproject-2017
|
07be5eed5191ef758c326034430885061f0bc892
|
7b3e0bdd27b6c64ce5ad03443b1692e03e6a2bb1
|
refs/heads/master
| 2021-01-23T19:18:16.741469
| 2017-09-12T00:17:07
| 2017-09-12T00:17:07
| 102,817,944
| 0
| 1
| null | 2017-09-12T00:17:08
| 2017-09-08T04:34:20
|
Java
|
UTF-8
|
Java
| false
| false
| 869
|
java
|
package pt.tumba.ngram;
/**
* Wrapper for Exceptions used in the TCatNG package.
*
*@author Bruno Martins
*/
public class TCatNGException extends Exception {
/** The Exception message */
String msg;
/**
* Constructor for NGramException
*
*@param msg A String with the Exception message.
*/
public TCatNGException(String msg) {
this.msg = msg;
}
/**
* Constructor for NGramException
*
*@param e The Exception we wish to wrap.
*/
public TCatNGException(Exception e) {
this.msg = e.toString();
}
/**
* Returns the String message associated with this Exception.
*
*@return A String with the message associated with this Exception.
*/
public String toString() {
return "TCatNGException{'" + msg + "'}";
}
}
|
[
"79544198@qq.com"
] |
79544198@qq.com
|
58aa641097044e67ec84b1869bb8bbaaff0c1691
|
7730793c2e5981f98fcc3c2f12526e153fba2e72
|
/src/main/java/com/apptium/order/repository/OrdContractCharacteristicsRepository.java
|
6cd544355f31f9624e5bced32eeaf415a243c6a5
|
[] |
no_license
|
ravi7mech/order-management
|
3de18db5e26099d5fa5968ea991b62089e9b3699
|
a968c8cc71fc0a23c739999de4cce1d97f9b2cb3
|
refs/heads/main
| 2023-06-16T16:51:09.393167
| 2021-07-14T07:39:11
| 2021-07-14T07:39:11
| 385,852,996
| 0
| 0
| null | 2021-07-14T07:39:12
| 2021-07-14T07:31:15
|
Java
|
UTF-8
|
Java
| false
| false
| 492
|
java
|
package com.apptium.order.repository;
import com.apptium.order.domain.OrdContractCharacteristics;
import org.springframework.data.jpa.repository.*;
import org.springframework.stereotype.Repository;
/**
* Spring Data SQL repository for the OrdContractCharacteristics entity.
*/
@SuppressWarnings("unused")
@Repository
public interface OrdContractCharacteristicsRepository
extends JpaRepository<OrdContractCharacteristics, Long>, JpaSpecificationExecutor<OrdContractCharacteristics> {}
|
[
"jhipster-bot@jhipster.tech"
] |
jhipster-bot@jhipster.tech
|
276a2ad281074e8e7eb1f5cc2a874dc76d01498a
|
f525deacb5c97e139ae2d73a4c1304affb7ea197
|
/gitv-DeObfuscate/src/main/java/com/gala/afinal/http/AjaxParams.java
|
08c77f5eb5ceac357690894cda7002e6191c1264
|
[] |
no_license
|
AgnitumuS/gitv
|
93b2359e1bf9f2b6c945298c61c5c6dbfeea49b3
|
242c9a10a0aeb41b9589de9f254e6ce9f57bd77a
|
refs/heads/master
| 2021-08-08T00:50:10.630301
| 2017-11-09T08:10:33
| 2017-11-09T08:10:33
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,608
|
java
|
package com.gala.afinal.http;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
import org.apache.http.HttpEntity;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.utils.URLEncodedUtils;
import org.apache.http.message.BasicNameValuePair;
import org.cybergarage.upnp.std.av.server.object.SearchCriteria;
public class AjaxParams {
private static String ENCODING = "UTF-8";
protected ConcurrentHashMap<String, FileWrapper> fileParams;
protected ConcurrentHashMap<String, String> urlParams;
static class FileWrapper {
public String contentType;
public String fileName;
public InputStream inputStream;
public FileWrapper(InputStream inputStream, String fileName, String contentType) {
this.inputStream = inputStream;
this.fileName = fileName;
this.contentType = contentType;
}
public String getFileName() {
if (this.fileName != null) {
return this.fileName;
}
return "nofilename";
}
}
public AjaxParams() {
init();
}
public AjaxParams(Map<String, String> source) {
init();
for (Entry entry : source.entrySet()) {
put((String) entry.getKey(), (String) entry.getValue());
}
}
public AjaxParams(String key, String value) {
init();
put(key, value);
}
public AjaxParams(Object... keysAndValues) {
init();
int length = keysAndValues.length;
if (length % 2 != 0) {
throw new IllegalArgumentException("Supplied arguments must be even");
}
for (int i = 0; i < length; i += 2) {
put(String.valueOf(keysAndValues[i]), String.valueOf(keysAndValues[i + 1]));
}
}
public void put(String key, String value) {
if (key != null && value != null) {
this.urlParams.put(key, value);
}
}
public void put(String key, File file) throws FileNotFoundException {
put(key, new FileInputStream(file), file.getName());
}
public void put(String key, InputStream stream) {
put(key, stream, null);
}
public void put(String key, InputStream stream, String fileName) {
put(key, stream, fileName, null);
}
public void put(String key, InputStream stream, String fileName, String contentType) {
if (key != null && stream != null) {
this.fileParams.put(key, new FileWrapper(stream, fileName, contentType));
}
}
public void remove(String key) {
this.urlParams.remove(key);
this.fileParams.remove(key);
}
public String toString() {
StringBuilder stringBuilder = new StringBuilder();
for (Entry entry : this.urlParams.entrySet()) {
if (stringBuilder.length() > 0) {
stringBuilder.append("&");
}
stringBuilder.append((String) entry.getKey());
stringBuilder.append(SearchCriteria.EQ);
stringBuilder.append((String) entry.getValue());
}
for (Entry entry2 : this.fileParams.entrySet()) {
if (stringBuilder.length() > 0) {
stringBuilder.append("&");
}
stringBuilder.append((String) entry2.getKey());
stringBuilder.append(SearchCriteria.EQ);
stringBuilder.append("FILE");
}
return stringBuilder.toString();
}
public HttpEntity getEntity() {
if (this.fileParams.isEmpty()) {
try {
return new UrlEncodedFormEntity(getParamsList(), ENCODING);
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
return null;
}
}
HttpEntity multipartEntity = new MultipartEntity();
for (Entry entry : this.urlParams.entrySet()) {
multipartEntity.addPart((String) entry.getKey(), (String) entry.getValue());
}
int size = this.fileParams.entrySet().size() - 1;
int i = 0;
for (Entry entry2 : this.fileParams.entrySet()) {
FileWrapper fileWrapper = (FileWrapper) entry2.getValue();
if (fileWrapper.inputStream != null) {
boolean z = i == size;
if (fileWrapper.contentType != null) {
multipartEntity.addPart((String) entry2.getKey(), fileWrapper.getFileName(), fileWrapper.inputStream, fileWrapper.contentType, z);
} else {
multipartEntity.addPart((String) entry2.getKey(), fileWrapper.getFileName(), fileWrapper.inputStream, z);
}
}
i++;
}
return multipartEntity;
}
private void init() {
this.urlParams = new ConcurrentHashMap();
this.fileParams = new ConcurrentHashMap();
}
protected List<BasicNameValuePair> getParamsList() {
List<BasicNameValuePair> linkedList = new LinkedList();
for (Entry entry : this.urlParams.entrySet()) {
linkedList.add(new BasicNameValuePair((String) entry.getKey(), (String) entry.getValue()));
}
return linkedList;
}
public String getParamString() {
return URLEncodedUtils.format(getParamsList(), ENCODING);
}
}
|
[
"liuwencai@le.com"
] |
liuwencai@le.com
|
ee05e4a21f82b36f0a63b1d218662dda4ef436af
|
0b0cc171457f32b5259ac2e0891d617abdfc0e47
|
/src/editor/map/primitive/SpiralRampGenerator.java
|
53e8d82516cb0813b92e12d6bf15c087b3f74191
|
[] |
no_license
|
bobolicener/star-rod
|
24b403447b4bd82af1bca734c63ac38785748824
|
59235901ab024c5af267daebf92344b20538251a
|
refs/heads/master
| 2020-07-01T20:12:10.960817
| 2019-08-08T14:54:46
| 2019-08-08T14:54:46
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 6,203
|
java
|
package editor.map.primitive;
import editor.map.mesh.Triangle;
import editor.map.mesh.Vertex;
import editor.map.shape.TriangleBatch;
import editor.map.shape.UV;
import editor.ui.dialogs.PrimitiveOptionsPanel;
import editor.ui.elements.LabeledIntegerSpinner;
import java.awt.Font;
import java.util.List;
import javax.swing.JCheckBox;
public class SpiralRampGenerator extends ShapeGenerator
{
private final LabeledIntegerSpinner innerRadiusSpinner;
private final LabeledIntegerSpinner outerRadiusSpinner;
private final LabeledIntegerSpinner divisionsSpinner;
private final LabeledIntegerSpinner angleSpinner;
private final LabeledIntegerSpinner riseSpinner;
private final LabeledIntegerSpinner sideHeightSpinner;
private final JCheckBox makeBottomCheckbox;
public SpiralRampGenerator()
{
super(ShapeGenerator.Primitive.SPIRAL_RAMP);
riseSpinner = new LabeledIntegerSpinner("Step Rise", 1, 500, 10);
innerRadiusSpinner = new LabeledIntegerSpinner("Inner Radius", 0, 5000, 100);
outerRadiusSpinner = new LabeledIntegerSpinner("Outer Radius", 10, 5000, 200);
divisionsSpinner = new LabeledIntegerSpinner("Divisions", 2, 256, 24);
angleSpinner = new LabeledIntegerSpinner("Arc Angle", 15, 1440, 360);
sideHeightSpinner = new LabeledIntegerSpinner("Side Height", 0, 500, 0);
makeBottomCheckbox = new JCheckBox(" Create Bottom Faces");
makeBottomCheckbox.setSelected(false);
makeBottomCheckbox.setFont(makeBottomCheckbox.getFont().deriveFont(12.0F));
}
public void addFields(PrimitiveOptionsPanel panel)
{
panel.addSpinner(riseSpinner);
panel.addSpinner(innerRadiusSpinner);
panel.addSpinner(outerRadiusSpinner);
panel.addSpinner(divisionsSpinner);
panel.addSpinner(angleSpinner);
panel.addSpinner(sideHeightSpinner);
panel.addCheckBox(makeBottomCheckbox);
}
public void setVisible(boolean b)
{
riseSpinner.setVisible(b);
innerRadiusSpinner.setVisible(b);
outerRadiusSpinner.setVisible(b);
divisionsSpinner.setVisible(b);
angleSpinner.setVisible(b);
sideHeightSpinner.setVisible(b);
makeBottomCheckbox.setVisible(b);
}
public TriangleBatch generate(int centerX, int centerY, int centerZ)
{
int steps = divisionsSpinner.getValue();
int stepRise = riseSpinner.getValue();
int innerRadius = innerRadiusSpinner.getValue();
int outerRadius = outerRadiusSpinner.getValue();
int angle = angleSpinner.getValue();
int sideHeight = sideHeightSpinner.getValue();
boolean makeBottom = makeBottomCheckbox.isSelected();
if (innerRadius == outerRadius) {
outerRadius = innerRadius + 50;
}
return generate(steps, stepRise, innerRadius, outerRadius, angle, sideHeight, makeBottom, centerX, centerY, centerZ);
}
private static TriangleBatch generate(int steps, int stepRise, int innerR, int outerR, int angle, int sideHeight, boolean makeBottom, int centerX, int centerY, int centerZ)
{
int N = steps + 1;
double angleRad = Math.toRadians(angle);
int uOffset = 0;
int vOffset = 1536;
int overflow = 1024 * steps - 32767;
if (overflow > 0)
{
uOffset = 64512 * (1 + overflow / 1024);
uOffset = uOffset < 32768 ? 32768 : uOffset;
}
Vertex[] ringI = new Vertex[N];
Vertex[] ringO = new Vertex[N];
for (int i = 0; i < N; i++)
{
int H = i * stepRise;
double theta = angleRad * i / steps;
double X = Math.sin(theta);
double Z = Math.cos(theta);
ringI[i] = new Vertex(centerX + (int)(innerR * X), centerY + H, centerZ - (int)(innerR * Z));
ringO[i] = new Vertex(centerX + (int)(outerR * X), centerY + H, centerZ - (int)(outerR * Z));
uv = new UV(i * 1024 + uOffset, 0);
uv = new UV(i * 1024 + uOffset, 1024);
}
TriangleBatch batch = new TriangleBatch();
for (int i = 0; i < N - 1; i++)
{
triangles.add(new Triangle(ringO[i], ringI[i], ringI[(i + 1)]));
triangles.add(new Triangle(ringO[i], ringI[(i + 1)], ringO[(i + 1)]));
}
if (sideHeight > 0)
{
Vertex[] upperI = new Vertex[N];
Vertex[] upperO = new Vertex[N];
for (int i = 0; i < N; i++)
{
upperI[i] = ringI[i].deepCopy();
upperO[i] = ringO[i].deepCopy();
uv = new UV(i * 1024 + uOffset, vOffset);
uv = new UV(i * 1024 + uOffset, vOffset);
}
float uvScale = 1024 / (outerR - innerR);
Vertex[] lowerI = new Vertex[N];
Vertex[] lowerO = new Vertex[N];
for (int i = 0; i < steps + 1; i++)
{
lowerI[i] = new Vertex(upperI[i].getCurrentX(), upperI[i].getCurrentY() - sideHeight, upperI[i].getCurrentZ());
lowerO[i] = new Vertex(upperO[i]
.getCurrentX(), upperO[i]
.getCurrentY() - sideHeight, upperO[i]
.getCurrentZ());
uv = new UV(uv.getU() + uOffset, vOffset + uvScale * sideHeight);
uv = new UV(uv.getU() + uOffset, vOffset + uvScale * sideHeight);
}
for (int i = 0; i < steps; i++)
{
triangles.add(new Triangle(lowerI[(i + 1)], upperI[i], lowerI[i]));
triangles.add(new Triangle(upperI[(i + 1)], upperI[i], lowerI[(i + 1)]));
triangles.add(new Triangle(upperO[i], lowerO[(i + 1)], lowerO[i]));
triangles.add(new Triangle(upperO[i], upperO[(i + 1)], lowerO[(i + 1)]));
}
if (makeBottom)
{
Vertex[] bottomI = new Vertex[steps + 1];
Vertex[] bottomO = new Vertex[steps + 1];
for (int i = 0; i < steps + 1; i++)
{
bottomI[i] = lowerI[i].deepCopy();
bottomO[i] = lowerO[i].deepCopy();
uv = new UV(i * 1024 + uOffset, -vOffset);
uv = new UV(i * 1024 + uOffset, 1024 - vOffset);
}
for (int i = 0; i < steps; i++)
{
triangles.add(new Triangle(bottomI[i], bottomO[i], bottomI[(i + 1)]));
triangles.add(new Triangle(bottomI[(i + 1)], bottomO[i], bottomO[(i + 1)]));
}
}
}
return batch;
}
}
|
[
"gregory.degruy@gmail.com"
] |
gregory.degruy@gmail.com
|
c60cd4be00a9cfa22b5ab5e4868cc404f00b6baf
|
d71e879b3517cf4fccde29f7bf82cff69856cfcd
|
/ExtractedJars/RT_News_com.rt.mobile.english/javafiles/com/google/android/gms/internal/ads/zzai.java
|
091eebf57ce141f55c42a71babcfe9e4701760a5
|
[
"MIT"
] |
permissive
|
Andreas237/AndroidPolicyAutomation
|
b8e949e072d08cf6c6166c3f15c9c63379b8f6ce
|
c1ed10a2c6d4cf3dfda8b8e6291dee2c2a15ee8a
|
refs/heads/master
| 2020-04-10T02:14:08.789751
| 2019-05-16T19:29:11
| 2019-05-16T19:29:11
| 160,739,088
| 5
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,470
|
java
|
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) annotate safe
package com.google.android.gms.internal.ads;
import java.io.IOException;
import java.util.*;
import org.apache.http.*;
import org.apache.http.entity.BasicHttpEntity;
import org.apache.http.message.*;
// Referenced classes of package com.google.android.gms.internal.ads:
// zzar, zza, zzaq, zzl,
// zzr
public abstract class zzai
implements zzar
{
public zzai()
{
// 0 0:aload_0
// 1 1:invokespecial #10 <Method void Object()>
// 2 4:return
}
public abstract zzaq zza(zzr zzr, Map map)
throws IOException, zza;
public final HttpResponse zzb(zzr zzr, Map map)
throws IOException, zza
{
zzr = ((zzr) (zza(zzr, map)));
// 0 0:aload_0
// 1 1:aload_1
// 2 2:aload_2
// 3 3:invokevirtual #22 <Method zzaq zza(zzr, Map)>
// 4 6:astore_1
map = ((Map) (new BasicHttpResponse(((org.apache.http.StatusLine) (new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), ((zzaq) (zzr)).getStatusCode(), ""))))));
// 5 7:new #24 <Class BasicHttpResponse>
// 6 10:dup
// 7 11:new #26 <Class BasicStatusLine>
// 8 14:dup
// 9 15:new #28 <Class ProtocolVersion>
// 10 18:dup
// 11 19:ldc1 #30 <String "HTTP">
// 12 21:iconst_1
// 13 22:iconst_1
// 14 23:invokespecial #33 <Method void ProtocolVersion(String, int, int)>
// 15 26:aload_1
// 16 27:invokevirtual #39 <Method int zzaq.getStatusCode()>
// 17 30:ldc1 #41 <String "">
// 18 32:invokespecial #44 <Method void BasicStatusLine(ProtocolVersion, int, String)>
// 19 35:invokespecial #47 <Method void BasicHttpResponse(org.apache.http.StatusLine)>
// 20 38:astore_2
Object obj = ((Object) (new ArrayList()));
// 21 39:new #49 <Class ArrayList>
// 22 42:dup
// 23 43:invokespecial #50 <Method void ArrayList()>
// 24 46:astore_3
zzl zzl1;
for(Iterator iterator = ((zzaq) (zzr)).zzq().iterator(); iterator.hasNext(); ((List) (obj)).add(((Object) (new BasicHeader(zzl1.getName(), zzl1.getValue())))))
//* 25 47:aload_1
//* 26 48:invokevirtual #54 <Method List zzaq.zzq()>
//* 27 51:invokeinterface #60 <Method Iterator List.iterator()>
//* 28 56:astore 4
//* 29 58:aload 4
//* 30 60:invokeinterface #66 <Method boolean Iterator.hasNext()>
//* 31 65:ifeq 107
zzl1 = (zzl)iterator.next();
// 32 68:aload 4
// 33 70:invokeinterface #70 <Method Object Iterator.next()>
// 34 75:checkcast #72 <Class zzl>
// 35 78:astore 5
// 36 80:aload_3
// 37 81:new #74 <Class BasicHeader>
// 38 84:dup
// 39 85:aload 5
// 40 87:invokevirtual #78 <Method String zzl.getName()>
// 41 90:aload 5
// 42 92:invokevirtual #81 <Method String zzl.getValue()>
// 43 95:invokespecial #84 <Method void BasicHeader(String, String)>
// 44 98:invokeinterface #88 <Method boolean List.add(Object)>
// 45 103:pop
//* 46 104:goto 58
((BasicHttpResponse) (map)).setHeaders((Header[])((List) (obj)).toArray(((Object []) (new Header[((List) (obj)).size()]))));
// 47 107:aload_2
// 48 108:aload_3
// 49 109:aload_3
// 50 110:invokeinterface #91 <Method int List.size()>
// 51 115:anewarray Header[]
// 52 118:invokeinterface #97 <Method Object[] List.toArray(Object[])>
// 53 123:checkcast #99 <Class Header[]>
// 54 126:invokevirtual #103 <Method void BasicHttpResponse.setHeaders(Header[])>
obj = ((Object) (((zzaq) (zzr)).getContent()));
// 55 129:aload_1
// 56 130:invokevirtual #107 <Method java.io.InputStream zzaq.getContent()>
// 57 133:astore_3
if(obj != null)
//* 58 134:aload_3
//* 59 135:ifnull 169
{
BasicHttpEntity basichttpentity = new BasicHttpEntity();
// 60 138:new #109 <Class BasicHttpEntity>
// 61 141:dup
// 62 142:invokespecial #110 <Method void BasicHttpEntity()>
// 63 145:astore 4
basichttpentity.setContent(((java.io.InputStream) (obj)));
// 64 147:aload 4
// 65 149:aload_3
// 66 150:invokevirtual #114 <Method void BasicHttpEntity.setContent(java.io.InputStream)>
basichttpentity.setContentLength(((zzaq) (zzr)).getContentLength());
// 67 153:aload 4
// 68 155:aload_1
// 69 156:invokevirtual #117 <Method int zzaq.getContentLength()>
// 70 159:i2l
// 71 160:invokevirtual #121 <Method void BasicHttpEntity.setContentLength(long)>
((BasicHttpResponse) (map)).setEntity(((org.apache.http.HttpEntity) (basichttpentity)));
// 72 163:aload_2
// 73 164:aload 4
// 74 166:invokevirtual #125 <Method void BasicHttpResponse.setEntity(org.apache.http.HttpEntity)>
}
return ((HttpResponse) (map));
// 75 169:aload_2
// 76 170:areturn
}
}
|
[
"silenta237@gmail.com"
] |
silenta237@gmail.com
|
d46e36eec5e1bfa69fdfc92534b8346d8eaea7e7
|
fa91450deb625cda070e82d5c31770be5ca1dec6
|
/Diff-Raw-Data/2/2_728ecc69d15a958b99cf085ad81adcdabc5bb88d/ClientThread/2_728ecc69d15a958b99cf085ad81adcdabc5bb88d_ClientThread_t.java
|
cd4b3eb022aefd14ebc6756a4ec09ad31a20172b
|
[] |
no_license
|
zhongxingyu/Seer
|
48e7e5197624d7afa94d23f849f8ea2075bcaec0
|
c11a3109fdfca9be337e509ecb2c085b60076213
|
refs/heads/master
| 2023-07-06T12:48:55.516692
| 2023-06-22T07:55:56
| 2023-06-22T07:55:56
| 259,613,157
| 6
| 2
| null | 2023-06-22T07:55:57
| 2020-04-28T11:07:49
| null |
UTF-8
|
Java
| false
| false
| 4,205
|
java
|
package blue.mesh;
import java.io.IOException;
import java.lang.reflect.Method;
import java.util.Set;
import java.util.UUID;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothSocket;
import android.util.Log;
public class ClientThread extends BluetoothConnectionThread {
private static final String TAG = "ClientThread";
private BluetoothAdapter adapter;
private BlueMeshService bms;
private RouterObject router;
private UUID uuid;
private BluetoothSocket clientSocket = null;
volatile private Boolean killed = false;
protected ClientThread(BluetoothAdapter mAdapter, BlueMeshService mBms, RouterObject mRouter,
UUID a_uuid) {
uuid = a_uuid;
adapter = mAdapter;
router = mRouter;
bms = mBms;
}
private boolean removeBond(BluetoothDevice btDevice)
throws Exception
{
Class<?> btClass = Class.forName("android.bluetooth.BluetoothDevice");
Method removeBondMethod = btClass.getMethod("removeBond");
Boolean returnValue = (Boolean) removeBondMethod.invoke(btDevice);
return returnValue.booleanValue();
}
private boolean createBond(BluetoothDevice btDevice)
throws Exception
{
Class<?> class1 = Class.forName("android.bluetooth.BluetoothDevice");
Method createBondMethod = class1.getMethod("createBond");
Boolean returnValue = (Boolean) createBondMethod.invoke(btDevice);
return returnValue.booleanValue();
}
// function run gets list of paired devices, and attempts to
// open and connect a socket for that device, which is then
// passed to the router object
public void run(){
while ( !this.killed ) {
// get list of all paired devices
Set<BluetoothDevice> pairedDevices = adapter.getBondedDevices();
// Loop through paired devices and attempt to connect
for (BluetoothDevice d : pairedDevices) {
Log.d(TAG, "Trying to connect to " + d.getName());
clientSocket = null;
try {
if (router.getDeviceState( Constants.TYPE_BLUETOOTH + '@' + d.toString()) == Constants.STATE_CONNECTED)
continue;
if( removeBond( d ) ){
while( !createBond( d ) ){ Log.d(TAG, "Trying to rebond");}
}
else{
Log.d(TAG, "Could not remove bond");
}
clientSocket = d.createRfcommSocketToServiceRecord(uuid);
}
catch (IOException e) {
Log.e(TAG, "Socket create() failed", e);
bms.disconnect();
} catch (Exception e) {
Log.e(TAG, "createBond() or removeBond() failed", e);
bms.disconnect();
}
// once a socket is opened, try to connect and then pass to
// router
try {
clientSocket.connect();
Connection bluetoothConnection = new AndroidBluetoothConnection( clientSocket );
Log.d(TAG,
"Connection Created, calling router.beginConnection()");
router.beginConnection(bluetoothConnection);
}
catch (IOException e) {
Log.e(TAG, "Connection constructor failed", e);
Log.d(TAG, "isInterrupted() == " + this.killed );
if( this.killed ){
Log.d(TAG, "Thread interrupted");
return;
}
}
}
}
Log.d(TAG, "Thread interrupted");
return;
}
protected int kill() {
Log.d(TAG, "trying to kill");
this.killed = true;
Log.d(TAG, "kill success");
return Constants.SUCCESS;
}
};
|
[
"yuzhongxing88@gmail.com"
] |
yuzhongxing88@gmail.com
|
0a9cbfa0208bd629874c3afff7936d9eefb0bfc2
|
3d3184dbbe61cee90f4380578d44ab533f482761
|
/Android-1/Lesson-8/BehaviorCoordinator/app/src/main/java/ru/geekbrains/behaviorcoordinator/Bb8Behavior.java
|
0dd37472c6f03ca5a9a1f5900445b0d3c79d672e
|
[] |
no_license
|
MrPaul98/Android
|
c170a37a44ca9f06418c921230568097254f5680
|
6acecb69a190943de9827c34800a4ee7b860632d
|
refs/heads/master
| 2022-12-21T12:47:33.879706
| 2020-10-01T11:31:28
| 2020-10-01T11:31:28
| 300,254,265
| 1
| 0
| null | 2020-10-01T11:27:02
| 2020-10-01T11:27:01
| null |
UTF-8
|
Java
| false
| false
| 1,927
|
java
|
package ru.geekbrains.behaviorcoordinator;
import android.content.Context;
import android.support.design.widget.AppBarLayout;
import android.support.design.widget.CoordinatorLayout;
import android.util.AttributeSet;
import android.view.View;
import android.widget.ImageView;
// Поведение изображения
public class Bb8Behavior extends CoordinatorLayout.Behavior<ImageView> {
private float initialX = 0; // начальное значение X изображения, от нее и будем отталкиваться
private boolean firstMove = true; // Нам надо получить начальное значение X только один раз
// конструктор должен быть именно такой
public Bb8Behavior(Context context, AttributeSet attrs) {
super(context, attrs);
}
// этот метод вызывается при изменении каждого элемента материального дизайна,
// а мы будем отрабатывать только если меняется AppBarLayout.
@Override
public boolean layoutDependsOn(CoordinatorLayout parent, ImageView child, View dependency) {
return dependency instanceof AppBarLayout;
}
// Как только AppBarLayout изменился, сразу же меняется и наш элемент
@Override
public boolean onDependentViewChanged(CoordinatorLayout parent, ImageView child, View dependency) {
// инициализация начального значения X
if (firstMove){
firstMove = false;
initialX = child.getX();
}
// изображение будет ездить по низу экрана
child.setX(initialX - dependency.getY()*1.5f );
return false;
}
}
|
[
"mrvlmor@gmail.com"
] |
mrvlmor@gmail.com
|
6b877fbdad06219afdf94fb6e10ae7aec3c12337
|
7773ea6f465ffecfd4f9821aad56ee1eab90d97a
|
/platform/execution-impl/src/com/intellij/execution/impl/DefaultNewRunConfigurationTreePopupFactory.java
|
6153c1c7a78d56ed49ede0f6f810c9b82eecf88a
|
[
"Apache-2.0"
] |
permissive
|
aghasyedbilal/intellij-community
|
5fa14a8bb62a037c0d2764fb172e8109a3db471f
|
fa602b2874ea4eb59442f9937b952dcb55910b6e
|
refs/heads/master
| 2023-04-10T20:55:27.988445
| 2020-05-03T22:00:26
| 2020-05-03T22:26:23
| 261,074,802
| 2
| 0
|
Apache-2.0
| 2020-05-04T03:48:36
| 2020-05-04T03:48:35
| null |
UTF-8
|
Java
| false
| false
| 5,229
|
java
|
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.execution.impl;
import com.intellij.execution.ExecutionBundle;
import com.intellij.execution.configurations.ConfigurationFactory;
import com.intellij.execution.configurations.ConfigurationType;
import com.intellij.ide.util.treeView.NodeDescriptor;
import com.intellij.openapi.project.Project;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import javax.swing.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
public class DefaultNewRunConfigurationTreePopupFactory extends NewRunConfigurationTreePopupFactory {
private NodeDescriptor<?> root;
private List<GroupDescriptor> myGroups;
private NodeDescriptor<?> other;
private List<ConfigurationType> myTypesToShow;
private List<ConfigurationType> myOtherTypes;
@Override
public void initStructure(@NotNull Project project) {
root = createDescriptor(project, "<invisible-templates-root>", null);
other = createDescriptor(project, ExecutionBundle.message("add.new.run.configuration.other.types.node.text"), root,
NodeDescriptor.DEFAULT_WEIGHT + 1);
myTypesToShow = new ArrayList<>(
RunConfigurable.Companion.configurationTypeSorted(project, true,
ConfigurationType.CONFIGURATION_TYPE_EP.getExtensionList()));
myOtherTypes = new ArrayList<>(ConfigurationType.CONFIGURATION_TYPE_EP.getExtensionList());
myOtherTypes.sort((o1, o2) -> RunConfigurationListManagerHelperKt.compareTypesForUi(o1, o2));
myOtherTypes.removeAll(myTypesToShow);
myGroups = createGroups(project, myTypesToShow);
}
@NotNull
@Override
public NodeDescriptor<?> getRootElement() {
return root;
}
protected List<GroupDescriptor> createGroups(@NotNull Project project, @NotNull List<ConfigurationType> fullList) {
return Arrays.asList(
//it's just an example, 'how-to'
//new GroupDescriptor(project, getRootElement(), AllIcons.FileTypes.Java, "Java", getTypes(fullList, "Application", "JarApplication")),
//new GroupDescriptor(project, getRootElement(), AllIcons.RunConfigurations.TestPassed, "Tests", getTypes(fullList, "JUnit", "TestNG"))
);
}
@SuppressWarnings("unused")
protected static List<ConfigurationType> getTypes(List<ConfigurationType> fullList, String... ids) {
List<String> idsList = Arrays.asList(ids);
List<ConfigurationType> result = new ArrayList<>();
for (Iterator<ConfigurationType> iterator = fullList.iterator(); iterator.hasNext(); ) {
ConfigurationType type = iterator.next();
if (idsList.contains(type.getId())) {
result.add(type);
//Note, here we remove an element from full 'plain' list as we put the element into some group
iterator.remove();
}
}
return result;
}
@Override
public NodeDescriptor<?>[] createChildElements(@NotNull Project project, @NotNull NodeDescriptor nodeDescriptor) {
Object nodeDescriptorElement = nodeDescriptor.getElement();
if (root.equals(nodeDescriptor)) {
ArrayList<NodeDescriptor> list = new ArrayList<>();
for (GroupDescriptor group : myGroups) {
if (!group.myTypes.isEmpty()) {
list.add(group);
}
}
list.addAll(Arrays.asList(convertToDescriptors(project, nodeDescriptor, myTypesToShow.toArray())));
if (!myOtherTypes.isEmpty()) {
list.add(other);
}
return list.toArray(NodeDescriptor.EMPTY_ARRAY);
}
else if (nodeDescriptor instanceof GroupDescriptor) {
ArrayList<NodeDescriptor> list = new ArrayList<>();
for (ConfigurationType type : ((GroupDescriptor)nodeDescriptor).myTypes) {
list.add(createDescriptor(project, type, nodeDescriptor));
}
return list.toArray(NodeDescriptor.EMPTY_ARRAY);
}
else if (other.equals(nodeDescriptor)) {
return convertToDescriptors(project, nodeDescriptor, myOtherTypes.toArray());
}
else if (nodeDescriptorElement instanceof ConfigurationType) {
ConfigurationFactory[] factories = ((ConfigurationType)nodeDescriptorElement).getConfigurationFactories();
if (factories.length > 1) {
return convertToDescriptors(project, nodeDescriptor, factories);
}
}
return NodeDescriptor.EMPTY_ARRAY;
}
protected static class GroupDescriptor extends NodeDescriptor<String> {
private final List<ConfigurationType> myTypes;
protected GroupDescriptor(@NotNull Project project,
@NotNull NodeDescriptor parent,
@Nullable Icon icon,
@NotNull String name,
List<ConfigurationType> types) {
super(project, parent);
myTypes = types;
myClosedIcon = icon;
myName = name;
}
@Override
public boolean update() {
return false;
}
@Override
public String getElement() {
return myName;
}
@Override
public int getWeight() {
return DEFAULT_WEIGHT - 1;
}
}
}
|
[
"intellij-monorepo-bot-no-reply@jetbrains.com"
] |
intellij-monorepo-bot-no-reply@jetbrains.com
|
ff15fc3ccb10261fdc890786a5a84cb981785983
|
ee99c44457879e56bdfdb9004072bd088aa85b15
|
/live-service/src/main/java/cn/idongjia/live/restructure/manager/NotifyManager.java
|
d08d86896cdbb772d1e47ef95f01867bdd52e083
|
[] |
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
| 2,483
|
java
|
package cn.idongjia.live.restructure.manager;
import cn.idongjia.clan.lib.pojo.User;
import cn.idongjia.live.exception.LiveException;
import cn.idongjia.live.restructure.enums.LiveEnum;
import cn.idongjia.live.support.LiveConst;
import cn.idongjia.log.Log;
import cn.idongjia.log.LogFactory;
import cn.idongjia.push.api.NotifyService;
import cn.idongjia.push.pojo.NotifyBase;
import cn.idongjia.push.pojo.NotifyExtra;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.List;
import java.util.Objects;
@Component
public class NotifyManager {
@Resource
private NotifyService notifyService;
@Resource
private ConfigManager configManager;
@Resource
private UserManager userManager;
private static final Log LOGGER = LogFactory.getLog(NotifyManager.class);
/**
* 发送推送消息
* @param uids 被发送人ID
* @param Huid 主播ID
* @param liveTitle 直播标题
* @param liveId 直播ID
* @param livePic 直播图片
*/
public void sendNotify(List<Long> uids, Long Huid, String liveTitle, Long liveId, String livePic,Integer liveType){
if (uids.size() == 0){
return;
}
//构建推送基本信息
NotifyBase notifyBase = new NotifyBase();
notifyBase.setUids(uids);
User user = userManager.getUser(Huid);
String pushContent = String.format(configManager.getPushContent(), liveTitle);
notifyBase.setContent(pushContent);
String infoContent = String.format(configManager.getInfoContent(), user.getUsername(), liveTitle);
notifyBase.setInfoContent(infoContent);
notifyBase.setIcon(livePic);
//构建推送额外信息
NotifyExtra notifyExtra = new NotifyExtra();
notifyExtra.set_tp(NotifyExtra.MsgTp.NOTIFICATION.getStrValue());
notifyExtra.setDjaddr(liveId.toString());
if(Objects.equals(LiveEnum.LiveType.LIVE_AUCTION.getCode(),liveType.intValue())){
notifyExtra.setDjtype(String.valueOf(LiveConst.TYPE_JUMP_LIVE_AUCTION));
}else {
notifyExtra.setDjtype(String.valueOf(LiveConst.TYPE_JUMP_LIVE));
}
try {
notifyService.notifyWithExtra(notifyBase, notifyExtra, true, false);
}catch (Exception e){
LOGGER.warn("推送服务失败" + e.getMessage());
throw new LiveException(-12138, "调用推送服务失败");
}
}
}
|
[
"zhangyingjie@idongjia.cn"
] |
zhangyingjie@idongjia.cn
|
e4ebd05e777e0d13fa27efe15df2ad313977ff15
|
7f52c1414ee44a3efa9fae60308e4ae0128d9906
|
/core/src/test/java/com/alibaba/druid/bvt/sql/mysql/select/MySqlSelectTest_254.java
|
df24f0979932b055b6a609675872a88164d0894a
|
[
"Apache-2.0"
] |
permissive
|
luoyongsir/druid
|
1f6ba7c7c5cabab2879a76ef699205f484f2cac7
|
37552f849a52cf0f2784fb7849007e4656851402
|
refs/heads/master
| 2022-11-19T21:01:41.141853
| 2022-11-19T13:21:51
| 2022-11-19T13:21:51
| 474,518,936
| 0
| 1
|
Apache-2.0
| 2022-03-27T02:51:11
| 2022-03-27T02:51:10
| null |
UTF-8
|
Java
| false
| false
| 1,284
|
java
|
/*
* Copyright 1999-2017 Alibaba Group Holding Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.alibaba.druid.bvt.sql.mysql.select;
import com.alibaba.druid.DbType;
import com.alibaba.druid.sql.MysqlTest;
import com.alibaba.druid.sql.SQLUtils;
import com.alibaba.druid.sql.ast.statement.SQLSelectStatement;
public class MySqlSelectTest_254 extends MysqlTest {
public void test_0() throws Exception {
String sql = "SELECT 'a', (VALUES 1) GROUP BY 1";
SQLSelectStatement stmt = (SQLSelectStatement) SQLUtils.parseSingleStatement(sql, DbType.mysql);
assertEquals("SELECT 'a'\n" +
"\t, (\n" +
"\t\tVALUES (1)\n" +
"\t)\n" +
"GROUP BY 1", stmt.toString());
}
}
|
[
"shaojin.wensj@alibaba-inc.com"
] |
shaojin.wensj@alibaba-inc.com
|
dc7dd6e85121bb7905d7917630ada4310a61d45f
|
6675a1a9e2aefd5668c1238c330f3237b253299a
|
/2.15/dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/event/TrackedEntityAttributeGroupController.java
|
95b7d51b8af06454eef026270088faf7b3e2a5bb
|
[
"BSD-3-Clause"
] |
permissive
|
hispindia/dhis-2.15
|
9e5bd360bf50eb1f770ac75cf01dc848500882c2
|
f61f791bf9df8d681ec442e289d67638b16f99bf
|
refs/heads/master
| 2021-01-12T06:32:38.660800
| 2016-12-27T07:44:32
| 2016-12-27T07:44:32
| 77,379,159
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 7,595
|
java
|
package org.hisp.dhis.api.controller.event;
/*
* Copyright (c) 2004-2014, University of Oslo
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* Neither the name of the HISP project 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.
*/
import org.hisp.dhis.api.controller.AbstractCrudController;
import org.hisp.dhis.api.utils.ContextUtils;
import org.hisp.dhis.dxf2.utils.JacksonUtils;
import org.hisp.dhis.trackedentity.TrackedEntityAttributeGroup;
import org.hisp.dhis.trackedentity.TrackedEntityAttributeGroupService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Controller;
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.ResponseStatus;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
/**
* @author Morten Olav Hansen <mortenoh@gmail.com>
*/
@Controller
@RequestMapping( value = TrackedEntityAttributeGroupController.RESOURCE_PATH )
public class TrackedEntityAttributeGroupController extends AbstractCrudController<TrackedEntityAttributeGroup>
{
public static final String RESOURCE_PATH = "/trackedEntityAttributeGroups";
@Autowired
private TrackedEntityAttributeGroupService trackedEntityAttributeGroupService;
//--------------------------------------------------------------------------
// POST
//--------------------------------------------------------------------------
@RequestMapping( method = RequestMethod.POST, consumes = { "application/xml", "text/xml" } )
@ResponseStatus( HttpStatus.CREATED )
public void postXmlObject( HttpServletResponse response, HttpServletRequest request, InputStream input ) throws Exception
{
TrackedEntityAttributeGroup trackedEntityAttributeGroup = JacksonUtils.fromXml( input, TrackedEntityAttributeGroup.class );
trackedEntityAttributeGroupService.addTrackedEntityAttributeGroup( trackedEntityAttributeGroup );
response.setHeader( "Location", ContextUtils.getRootPath( request ) + RESOURCE_PATH + "/" + trackedEntityAttributeGroup.getUid() );
}
@RequestMapping( method = RequestMethod.POST, consumes = "application/json" )
@ResponseStatus( HttpStatus.CREATED )
public void postJsonObject( HttpServletResponse response, HttpServletRequest request, InputStream input ) throws Exception
{
TrackedEntityAttributeGroup trackedEntityAttributeGroup = JacksonUtils.fromJson( input, TrackedEntityAttributeGroup.class );
trackedEntityAttributeGroupService.addTrackedEntityAttributeGroup( trackedEntityAttributeGroup );
response.setHeader( "Location", ContextUtils.getRootPath( request ) + RESOURCE_PATH + "/" + trackedEntityAttributeGroup.getUid() );
}
//--------------------------------------------------------------------------
// PUT
//--------------------------------------------------------------------------
@RequestMapping( value = "/{uid}", method = RequestMethod.PUT, consumes = { "application/xml", "text/xml" } )
@ResponseStatus( value = HttpStatus.NO_CONTENT )
public void putXmlObject( HttpServletResponse response, HttpServletRequest request, @PathVariable( "uid" ) String uid, InputStream input ) throws Exception
{
TrackedEntityAttributeGroup trackedEntityAttributeGroup = trackedEntityAttributeGroupService.getTrackedEntityAttributeGroup( uid );
if ( trackedEntityAttributeGroup == null )
{
ContextUtils.conflictResponse( response, "TrackedEntityAttributeGroup does not exist: " + uid );
return;
}
TrackedEntityAttributeGroup newTrackedEntityAttributeGroup = JacksonUtils.fromXml( input, TrackedEntityAttributeGroup.class );
newTrackedEntityAttributeGroup.setUid( trackedEntityAttributeGroup.getUid() );
trackedEntityAttributeGroup.mergeWith( newTrackedEntityAttributeGroup );
trackedEntityAttributeGroupService.updateTrackedEntityAttributeGroup( trackedEntityAttributeGroup );
}
@RequestMapping( value = "/{uid}", method = RequestMethod.PUT, consumes = "application/json" )
@ResponseStatus( value = HttpStatus.NO_CONTENT )
public void putJsonObject( HttpServletResponse response, HttpServletRequest request, @PathVariable( "uid" ) String uid, InputStream input ) throws Exception
{
TrackedEntityAttributeGroup trackedEntityAttributeGroup = trackedEntityAttributeGroupService.getTrackedEntityAttributeGroup( uid );
if ( trackedEntityAttributeGroup == null )
{
ContextUtils.conflictResponse( response, "TrackedEntityAttributeGroup does not exist: " + uid );
return;
}
TrackedEntityAttributeGroup newTrackedEntityAttributeGroup = JacksonUtils.fromJson( input, TrackedEntityAttributeGroup.class );
newTrackedEntityAttributeGroup.setUid( trackedEntityAttributeGroup.getUid() );
trackedEntityAttributeGroup.mergeWith( newTrackedEntityAttributeGroup );
trackedEntityAttributeGroupService.updateTrackedEntityAttributeGroup( trackedEntityAttributeGroup );
}
//--------------------------------------------------------------------------
// DELETE
//--------------------------------------------------------------------------
@RequestMapping( value = "/{uid}", method = RequestMethod.DELETE )
@ResponseStatus( value = HttpStatus.NO_CONTENT )
public void deleteObject( HttpServletResponse response, HttpServletRequest request, @PathVariable( "uid" ) String uid ) throws Exception
{
TrackedEntityAttributeGroup trackedEntityAttributeGroup = trackedEntityAttributeGroupService.getTrackedEntityAttributeGroup( uid );
if ( trackedEntityAttributeGroup == null )
{
ContextUtils.conflictResponse( response, "TrackedEntityAttributeGroup does not exist: " + uid );
return;
}
trackedEntityAttributeGroupService.deleteTrackedEntityAttributeGroup( trackedEntityAttributeGroup );
}
}
|
[
"[sagarb.4488@gmail.com]"
] |
[sagarb.4488@gmail.com]
|
4fb241812404004dd43f351b58e7b7b5c540f702
|
8fa221482da055f4c8105b590617a27595826cc3
|
/sources/com/google/android/gms/common/zzi.java
|
0693d1cac9ad6ac16bf53063bcad32574ee4f2a7
|
[] |
no_license
|
TehVenomm/sauceCodeProject
|
4ed2f12393e67508986aded101fa2db772bd5c6b
|
0b4e49a98d14b99e7d144a20e4c9ead408694d78
|
refs/heads/master
| 2023-03-15T16:36:41.544529
| 2018-10-08T03:44:58
| 2018-10-08T03:44:58
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 629
|
java
|
package com.google.android.gms.common;
import java.lang.ref.WeakReference;
abstract class zzi extends zzg {
private static final WeakReference<byte[]> zzffl = new WeakReference(null);
private WeakReference<byte[]> zzffk = zzffl;
zzi(byte[] bArr) {
super(bArr);
}
final byte[] getBytes() {
byte[] bArr;
synchronized (this) {
bArr = (byte[]) this.zzffk.get();
if (bArr == null) {
bArr = zzafa();
this.zzffk = new WeakReference(bArr);
}
}
return bArr;
}
protected abstract byte[] zzafa();
}
|
[
"gabrielbrazs@gmail.com"
] |
gabrielbrazs@gmail.com
|
e57dd944eab1cda95cc65cb9a34f29725a8c6891
|
6baf1fe00541560788e78de5244ae17a7a2b375a
|
/hollywood/com.oculus.alpenglow-EnterpriseServer/sources/X/C02730ag.java
|
79e7f68480537b552a11f2394b50ab2450a1e8c4
|
[] |
no_license
|
phwd/quest-tracker
|
286e605644fc05f00f4904e51f73d77444a78003
|
3d46fbb467ba11bee5827f7cae7dfeabeb1fd2ba
|
refs/heads/main
| 2023-03-29T20:33:10.959529
| 2021-04-10T22:14:11
| 2021-04-10T22:14:11
| 357,185,040
| 4
| 2
| null | 2021-04-12T12:28:09
| 2021-04-12T12:28:08
| null |
UTF-8
|
Java
| false
| false
| 152
|
java
|
package X;
/* renamed from: X.0ag reason: invalid class name and case insensitive filesystem */
public class C02730ag implements AbstractC05480ja {
}
|
[
"cyuubiapps@gmail.com"
] |
cyuubiapps@gmail.com
|
ce558758df87d4db7b5cdac88fc3755e36965a6f
|
bb8b8dbf8b7e5e2082170255d1ba653f54238fe8
|
/net.solarnetwork.central.dras/src/net/solarnetwork/central/dras/support/ProgramCriteria.java
|
a2e7755cb2a2ab9374de9b80894a2d9cdf9959da
|
[] |
no_license
|
SolarNetwork/solarnetwork-dras
|
d9bff80d864a3fef0a22485a1339567e61b95c0c
|
cf7058c18b6c09ad63d64cd5d044405b10b1299d
|
refs/heads/master
| 2023-02-18T23:09:20.729002
| 2023-02-15T01:33:03
| 2023-02-15T01:34:08
| 6,083,766
| 0
| 2
| null | 2017-06-13T21:52:07
| 2012-10-04T23:54:44
|
Java
|
UTF-8
|
Java
| false
| false
| 1,420
|
java
|
/* ==================================================================
* ProgramCriteria.java - Jun 11, 2011 7:17:37 PM
*
* Copyright 2007-2011 SolarNetwork.net Dev Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 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., 59 Temple Place, Suite 330, Boston, MA
* 02111-1307 USA
* ==================================================================
* $Id$
* ==================================================================
*/
package net.solarnetwork.central.dras.support;
import net.solarnetwork.central.dras.dao.ProgramFilter;
/**
* Criteria for Program objects.
*
* @author matt
* @version $Revision$
*/
public class ProgramCriteria extends CriteriaSupport<ProgramFilter> {
/**
* Default constructor.
*/
public ProgramCriteria() {
super(new SimpleProgramFilter());
}
}
|
[
"git+matt@msqr.us"
] |
git+matt@msqr.us
|
5e2af4f876e77c7eb693e57857b9920dd83ca0b9
|
0429ec7192a11756b3f6b74cb49dc1ba7c548f60
|
/src/main/java/com/ai/itms/sms/socket/SMGPSocket.java
|
ce8e752acf054024a5b50ef99c27c05639833208
|
[] |
no_license
|
lichao20000/WEB
|
5c7730779280822619782825aae58506e8ba5237
|
5d2964387d66b9a00a54b90c09332e2792af6dae
|
refs/heads/master
| 2023-06-26T16:43:02.294375
| 2021-07-29T08:04:46
| 2021-07-29T08:04:46
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,540
|
java
|
package com.ai.itms.sms.socket;
import java.io.DataInputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.net.Socket;
import java.net.UnknownHostException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.ai.itms.sms.involve.SMGPException;
import com.ai.itms.sms.packet.SMGPRequestPacket;
import com.ai.itms.sms.util.Common;
/**
* 建立和网关的socket连接
*
* @author YC
* @version 1.0 (2005-3-31 22:52:58)
*/
public class SMGPSocket {
/**
* Logger for this class
*/
private static Logger log = LoggerFactory.getLogger(SMGPSocket.class);
/**
* 网关主机地址
*/
private String host;
/**
* 监听端口
*/
private int port;
/**
* 建立起的socket端
*/
private Socket socket;
/**
* 输出流
*/
private OutputStream os;
/**
* 输入流
*/
private DataInputStream is;
/**
* 构造函数
*
* @param host
* 网关主机地址
* @param port
* 监听端口
*/
public SMGPSocket(String host, int port) {
this.host = host;
this.port = port;
}
/**
* 得到输入流
*
* @return DataInputStream
*/
public DataInputStream getInputStream() {
return this.is;
}
/**
* 初始化socket连接,设定超时时间为5秒 <br>
* 使用cmpp协议各命令之前,必须调用此方法
*
* @throws SMGPException
* 封装连接时抛出的UnknownHostException以及IOException
*/
public int initialSock() throws IOException {
int ret=-1;
try {
if (socket == null) {
log.warn("连接主机:"+host+"端口:"+port);
socket = new Socket(host, port);
}
socket.setSoTimeout(30 * 1000);
os = socket.getOutputStream();
is = new DataInputStream(socket.getInputStream());
log.warn("成功建立起和网关的socket连接");
ret=0;
}
catch (UnknownHostException e) {
log.error("地址\"" + host + "\"未知" + e.toString());
ret=-2;
throw e;
}
catch (IOException e) {
log.error("建立socket IO异常:" + e.toString());
ret=-3;
throw e;
}
return ret;
}
/**
* 关闭socket连接
*
* @throws CMPPException
* 封装关闭连接时抛出的IOException
*/
public void closeSock() throws IOException {
try {
if (socket != null) {
socket.close();
if (os != null)
os.close();
if (is != null)
is.close();
}
socket = null;
os = null;
is = null;
log.debug("socket连接关闭成功");
}
catch (IOException e) {
log.error("socket关闭异常:" + e.toString());
throw e;
}
}
// /**
// * 判断连接是否关闭
// *
// * @return boolean
// */
// public boolean isClosed() {
// return socket.isClosed();
//
// }
//
// /**
// * 判断连接是否正确建立成功
// *
// * @return boolean
// */
// public boolean isConnected() {
// return socket.isConnected();
// }
/**
* socket连接上发送请求包
*
* @param packet
* @throws IOException
*/
public void write(SMGPRequestPacket cmpppacket) throws IOException {
byte[] packets = cmpppacket.getRequestPacket();
os.write(packets);
os.flush();
log.debug(cmpppacket.getRequestBody().getClass().getName() + " 发送包体成功");
}
/**
* socket连接上读取输入流
*
* @return 输入流的字节形式
* @throws IOException
*/
public byte[] read() throws SMGPException, IOException {
//包头
byte[] head = new byte[12];
byte[] packet = null;
int reads = -1;
// 应该这样读,先读12个字节,然后解析后得到包长,再读包长的长度
// try {
reads = is.read(head, 0, 12);
// 没有读到的话
if (reads == -1) {
throw new SMGPException("读包头时输入流已空,没有读到数据!");
}
// 得到输入流的总长度,应该和is.available的一样
byte[] length = new byte[4];
System.arraycopy(head, 0, length, 0, 4);
int packetlen = Common.bytes4ToInt(length);
//整个输入流的字节形式
packet = new byte[packetlen];
//将包头独到整个输入流的字节形式中
System.arraycopy(head, 0, packet, 0, 12);
//如果输入流还有包体
if (packetlen - 12 != 0) {
reads = is.read(packet, 12, packetlen - 12);
if (reads == -1) {
throw new SMGPException("读包体时输入流已空,没有读到数据!");
}
}
log.warn("本次输入流读取完毕,totalLength=" + packetlen);
return packet;
// }
// catch (IOException o) {
// log.error(o.getMessage());
// throw new CMPPException(o.getMessage());
// }
}
}
|
[
"di4zhibiao.126.com"
] |
di4zhibiao.126.com
|
d56e7876a35298b9196d4f5d04d78195fd859483
|
5931d41760028bec8bddcac0b583e5a2558be14b
|
/src/main/java/com/zyf/lf/service/impl/OsKindServiceImpl.java
|
41cbcfe5ef09aed211661b612a67eec04f86ceab
|
[] |
no_license
|
zengyufei/dc-single
|
ca757900d40638fea2cb4e44650d3539807bb3c7
|
5d8f8e630cf15eb7fe72e2263675c762716cb4f1
|
refs/heads/master
| 2021-05-09T20:39:21.531261
| 2018-01-24T02:46:32
| 2018-01-24T02:46:32
| 118,700,102
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 479
|
java
|
package com.zyf.lf.service.impl;
import com.zyf.lf.models.entity.OsKind;
import com.zyf.lf.mapper.OsKindMapper;
import com.zyf.lf.service.IOsKindService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
* 产品类型表 服务实现类
* </p>
*
* @author zengyufei
* @since 2018-01-24
*/
@Service
public class OsKindServiceImpl extends ServiceImpl<OsKindMapper, OsKind> implements IOsKindService {
}
|
[
"zengyufei@evergrande.com"
] |
zengyufei@evergrande.com
|
3101f293fd8fd1ab1006d215207a8e46b860422b
|
781e2692049e87a4256320c76e82a19be257a05d
|
/all_data/cs61bl/lab03/cs61bl-nl/Debug.java
|
244ab6df4f32ae02c19ff8321b5e2434ff0aea16
|
[] |
no_license
|
itsolutionscorp/AutoStyle-Clustering
|
54bde86fe6dbad35b568b38cfcb14c5ffaab51b0
|
be0e2f635a7558f56c61bc0b36c6146b01d1e6e6
|
refs/heads/master
| 2020-12-11T07:27:19.291038
| 2016-03-16T03:18:00
| 2016-03-16T03:18:42
| 59,454,921
| 4
| 0
| null | 2016-05-23T05:40:56
| 2016-05-23T05:40:56
| null |
UTF-8
|
Java
| false
| false
| 2,036
|
java
|
public class Debug {
String myString;
public Debug(String s) {
myString = s;
}
/**
* Return true when myString is the result of inserting exactly one
* character into s, and return false otherwise.
*/
public boolean contains1MoreThan(String s) {
if (myString.length() == 0) {
return false;
} else if (s.length() == 0) {
return myString.length() == 1;
} else if (myString.charAt(0) == s.charAt(0)) {
Debug remainder = new Debug(myString.substring(1)); //
return remainder.contains1MoreThan(s.substring(1)); //
} else {
return myString.substring(1) == s; //
}
}
public static void main(String[] args) {
check("abc", "def"); // should be false
check("abc2", "abc"); // should be true
check("abc", "abc2"); // correctly returns true
check("abd2", "abc"); // correctly returns false
// incorrectly returns true(no pairs of strings)
check("ab2c", "abc"); // incorrectly returns false
// check(23,2); // crash case
// String d = "abc";
// System.out.println(d.substring(1));
}
public static void check(String s1, String s2) {
Debug d = new Debug(s1);
if (d.contains1MoreThan(s2)) {
System.out.println(s1
+ " is the result of adding a single character to " + s2);
} else {
System.out.println(s1
+ " is not the result of adding a single character to "
+ s2);
}
}
}
/* bug.info
* 1. check("abc", "abc2"); // correctly returns true
2. check("abd2", "abc"); // correctly returns false
3. no pairs of strings // incorrectly returns true(no pairs of strings)
4. check("ab2c", "abc"); // incorrectly returns false
5. check(23,2); // crash case
Bug explain:
else if (myString.charAt(0) == s.charAt(0)) {
Debug remainder = new Debug(myString.substring(1)); return remainder.contains1MoreThan(s.substring(1));
}
This "else if" condition only checks letters in order. It only returns true when letter is inserted at the end of the string. For example, "abc2" and "abc" returns true, but "ab2c" and "abc" returns false. */
|
[
"moghadam.joseph@gmail.com"
] |
moghadam.joseph@gmail.com
|
7ee56d9f522c0cd46a6f097bf358bcb61e6be64e
|
4edc8b9a76b182ad4bc39e1e894af6a87c2bbd82
|
/springboot-socketio/src/main/java/com/springboot/demo/socketio/SocketIOApplication.java
|
84b84bd67d0d86e744aa4db5f7b773a79194756f
|
[] |
no_license
|
mortalliao/springboot-demo
|
33e33db0d1115555580d13a45fefe4446be00b1c
|
cd4dd81c0b5bbc6b72bec2bc019864fb4d1f8b43
|
refs/heads/master
| 2022-06-24T09:16:21.414976
| 2019-12-01T11:54:35
| 2019-12-01T11:54:35
| 129,705,288
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 359
|
java
|
package com.springboot.demo.socketio;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
/**
* @author Jim
*/
@SpringBootApplication
public class SocketIOApplication {
public static void main(String[] args) {
SpringApplication.run(SocketIOApplication.class, args);
}
}
|
[
"mortalliaoyujian@163.com"
] |
mortalliaoyujian@163.com
|
3a59b0643c38cc38abd82b21bacb7ca83c062134
|
f51d514f6149166346bd6efd8887c839ef09a632
|
/gameengine/src/test/java/de/mirkosertic/gameengine/type/ResourceNameTest.java
|
07e41495e302189f9c25cd0d8dd426bec713aef8
|
[] |
no_license
|
mirkosertic/GameComposer
|
fae3c72a381a640344e885ac9b3235fd86c8c954
|
bbe0c583c9bba894f3fa3e2f80eb0a73025e3f58
|
refs/heads/master
| 2023-08-16T22:59:10.068628
| 2023-04-28T07:41:10
| 2023-04-28T07:41:10
| 13,907,695
| 67
| 21
| null | 2023-09-12T04:52:16
| 2013-10-27T18:24:00
|
Java
|
UTF-8
|
Java
| false
| false
| 2,391
|
java
|
package de.mirkosertic.gameengine.type;
import java.util.HashMap;
import java.util.Map;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
public class ResourceNameTest {
@Test
public void testInitNull() {
ResourceName theResourceName = new ResourceName(null);
assertNull(theResourceName.get());
}
@Test
public void testInitWithName() {
ResourceName theResourceName = new ResourceName("test");
assertEquals("test", theResourceName.get());
}
@Test
public void testEquals() throws Exception {
ResourceName theResourceName = new ResourceName("test");
ResourceName theResourceName2 = new ResourceName("test");
ResourceName theResourceName3 = new ResourceName("other");
ResourceName theResourceName4 = new ResourceName(null);
assertTrue(theResourceName.equals(theResourceName));
assertTrue(theResourceName.equals(theResourceName2));
assertFalse(theResourceName.equals(theResourceName3));
assertFalse(theResourceName.equals(null));
assertFalse(theResourceName.equals("test"));
assertFalse(theResourceName.equals(theResourceName4));
assertFalse(theResourceName4.equals(theResourceName));
}
@Test
public void testHashCode() throws Exception {
assertEquals(0, new ResourceName(null).hashCode());
assertEquals("test".hashCode(), new ResourceName("test").hashCode());
}
@Test
public void testSerialize() throws Exception {
ResourceName theResourceName1 = new ResourceName(null);
Map<String, Object> theData = theResourceName1.serialize();
assertEquals(1, theData.size());
assertEquals(null, theData.get("name"));
ResourceName theResourceName2 = new ResourceName("test");
Map<String, Object> theData2 = theResourceName2.serialize();
assertEquals(1, theData2.size());
assertEquals("test", theData2.get("name"));
}
@Test
public void testDeserialize() throws Exception {
Map<String, Object> theData = new HashMap<>();
theData.put("name", "test");
ResourceName theName = ResourceName.deserialize(theData);
assertEquals("test", theName.get());
}
}
|
[
"mirko.sertic@web.de"
] |
mirko.sertic@web.de
|
f90eebc1b35c2552df61eaea31ac190fa3fb98b6
|
b406aacdf46066a3016c88d755964c0d566539ea
|
/src/main/java/searching/GraphSearch.java
|
22cf229dfda5ceea6b1a15fb7870251a6a874439
|
[] |
no_license
|
andreaiacono/DataStructuresAndAlgorithms
|
f0a508ec37e95928bb01ff9e8a65c0e5abee8b47
|
752c4534126d7d61dccddc008d110b7b9902d0ee
|
refs/heads/master
| 2021-07-25T06:28:48.836438
| 2021-01-20T09:24:07
| 2021-01-20T09:24:07
| 21,306,821
| 7
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,825
|
java
|
package searching;
import datastructures.Edge;
import datastructures.Graph;
import datastructures.NodeStatus;
import datastructures.node.GraphNode;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Deque;
import java.util.List;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
/**
* Created with IntelliJ IDEA.
* User: andrea
* Date: 14/07/14
* Time: 16.08
*/
public class GraphSearch {
private int vertexCount;
private LocalGraphNode root;
class LocalGraphNode {
VertexState status;
}
enum VertexState {
VISITED, IN_PROGRESS, NOT_VISITED
}
public void depthFirstSearch() {
VertexState state[] = new VertexState[vertexCount];
for (int i = 0; i < vertexCount; i++)
state[i] = VertexState.NOT_VISITED;
recursiveDepthFirstSearch(0, state);
}
public void recursiveDepthFirstSearch(int u, VertexState[] state) {
state[u] = VertexState.IN_PROGRESS;
for (int v = 0; v < vertexCount; v++)
if (isEdge(u, v) && state[v] == VertexState.NOT_VISITED)
recursiveDepthFirstSearch(v, state);
state[u] = VertexState.VISITED;
}
public void iterativeDepthFirstSearch() {
List<LocalGraphNode> nodes = new ArrayList<>();
Deque<LocalGraphNode> stack = new ArrayDeque<>();
stack.push(root);
root.status = VertexState.VISITED;
nodes.add(root);
while (!stack.isEmpty()) {
LocalGraphNode node = stack.peek();
LocalGraphNode child = null; //getUnvisitedChildNode(node);
if (child != null) {
child.status = VertexState.VISITED;
nodes.add(node);
stack.push(child);
}
else {
stack.pop();
}
}
}
public static void bfs(Graph graph, Consumer<GraphNode> onVisitedNode, Consumer<Edge> onVisitedEdge, Consumer<GraphNode> onProcessedNode) {
genericFirstSearch(graph,
(queue, node) -> queue.add(node),
(queue) -> (GraphNode) queue.poll(),
onVisitedNode,
onVisitedEdge,
onProcessedNode);
}
public static void dfs(Graph graph, Consumer<GraphNode> onVisitedNode, Consumer<Edge> onVisitedEdge, Consumer<GraphNode> onProcessedNode) {
genericFirstSearch(graph,
(stack, node) -> stack.push(node),
(stack) -> (GraphNode) stack.pop(),
onVisitedNode,
onVisitedEdge,
onProcessedNode);
}
public static void genericFirstSearch(Graph graph, BiConsumer<Deque, GraphNode> nodePutter, Function<Deque, GraphNode> nodeGetter, Consumer<GraphNode> onVisitedNode, Consumer<Edge> onVisitedEdge, Consumer<GraphNode> onProcessedNode) {
graph.getNodes().forEach(node -> node.setStatus(NodeStatus.UNKNOWN));
Deque<GraphNode> queue = new ArrayDeque<>();
nodePutter.accept(queue, graph.getNodes().get(0));
while (!queue.isEmpty()) {
GraphNode node = nodeGetter.apply(queue);
node.setStatus(NodeStatus.DISCOVERED);
onVisitedNode.accept(node);
for (Edge edge: node.getEdges()) {
if ((edge.getDestination()).getStatus() == NodeStatus.UNKNOWN) {
nodePutter.accept(queue, edge.getDestination());
(edge.getDestination()).setStatus(NodeStatus.DISCOVERED);
onVisitedEdge.accept(edge);
}
}
node.setStatus(NodeStatus.PROCESSED);
onProcessedNode.accept(node);
}
}
public boolean isEdge(int u, int v) {
return true;
}
}
|
[
"andrea.iacono.nl@gmail.com"
] |
andrea.iacono.nl@gmail.com
|
5ed0239877bdec5739473f43feec1dd8f5901e4a
|
6dc34d2ab1312154685e47f474bcaf9d85fe315b
|
/fundamentals-12/fundamentals12/src/main/java/com/manchesterdigital/FlightInformation.java
|
26e97d3617d2bdc50f7690d6af77f9834419b44f
|
[] |
no_license
|
johannalongmuir/bootcamp-2019
|
64e40f14c238031a307ca096adde8a2b471c97e0
|
b9ed19b39003cb850077f47edddce8d18459cfea
|
refs/heads/master
| 2021-07-11T19:44:08.486157
| 2019-10-12T20:55:34
| 2019-10-12T20:55:34
| 210,178,931
| 1
| 0
| null | 2020-10-13T16:40:21
| 2019-09-22T16:29:39
|
Java
|
UTF-8
|
Java
| false
| false
| 1,010
|
java
|
package com.manchesterdigital;
import java.util.Optional;
/**
* POJO for flight info
* Uses another Object (Airline)
* At the moment hope that Airline + destination is set already!
*
*/
public class FlightInformation {
private final String flightNumber;
private String destination;
private Optional<Airline> airline;
// has an airline relationship not is a
// constructor
public FlightInformation(String flightNumber) {
this.flightNumber = flightNumber;
}
// if do all auto getter/setter not make a set FlightNumber as have the constructor
public String getFlightNumber() {
return flightNumber;
}
public String getDestination() {
return destination;
}
public void setDestination(String destination) {
this.destination = destination;
}
public Optional<Airline> getAirline() {
return airline;
}
public void setAirline(Optional<Airline> airline) {
this.airline = airline;
}
}
|
[
"johannalongmuir@gmail.com"
] |
johannalongmuir@gmail.com
|
53a673248e187b3b2f7e91e5bf242db147432fd0
|
eb3ad750a23be626d4190eeb48d1047cb8e32c3e
|
/BWCommon/src/main/java/org/w3c/dom/stylesheets/StyleSheetList.java
|
aa078251b3b3a6997b41995fe3b6fc5d104ffb80
|
[] |
no_license
|
00mjk/beowulf-1
|
1ad29e79e2caee0c76a8b0bd5e15c24c22017d56
|
d28d7dfd6b9080130540fc7427bfe7ad01209ade
|
refs/heads/master
| 2021-05-26T23:07:39.561391
| 2013-01-23T03:09:44
| 2013-01-23T03:09:44
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,743
|
java
|
/*
* Copyright (c) 2000 World Wide Web Consortium, (Massachusetts Institute of
* Technology, Institut National de Recherche en Informatique et en Automatique,
* Keio University). All Rights Reserved. This program is distributed under the
* W3C's Software Intellectual Property License. This program is distributed in
* the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
* W3C License http://www.w3.org/Consortium/Legal/ for more details.
*/
package org.w3c.dom.stylesheets;
/**
* The <code>StyleSheetList</code> interface provides the abstraction of an
* ordered collection of style sheets.
* <p>
* The items in the <code>StyleSheetList</code> are accessible via an integral
* index, starting from 0.
* <p>
* See also the <a
* href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113'>Document
* Object Model (DOM) Level 2 Style Specification</a>.
*
* @since DOM Level 2
*/
public interface StyleSheetList {
/**
* The number of <code>StyleSheets</code> in the list. The range of valid
* child stylesheet indices is <code>0</code> to <code>length-1</code>
* inclusive.
*/
public int getLength();
/**
* Used to retrieve a style sheet by ordinal index. If index is greater than
* or equal to the number of style sheets in the list, this returns
* <code>null</code>.
*
* @param indexIndex
* into the collection
* @return The style sheet at the <code>index</code> position in the
* <code>StyleSheetList</code>, or <code>null</code> if that is not
* a valid index.
*/
public StyleSheet item(int index);
}
|
[
"nibin012@gmail.com"
] |
nibin012@gmail.com
|
1decd15fe14116b72b4f87e92d26573995d5d11d
|
52fbe7a7ed03593c05356c469bdb858c68d391d0
|
/src/main/java/org/demo/business/service/mapping/OrderTransServiceMapper.java
|
15968cc553824379b8f200dd13e449afc1fafcac
|
[] |
no_license
|
altansenel/maven-project
|
4d165cb10da24159f58d083f4d5e4442ab3265b2
|
0f2e392553e5fb031235c9df776a4a01b077c349
|
refs/heads/master
| 2016-08-12T05:51:51.359531
| 2016-02-25T07:26:28
| 2016-02-25T07:26:28
| 52,504,851
| 0
| 0
| null | null | null | null |
ISO-8859-13
|
Java
| false
| false
| 7,363
|
java
|
/*
* Created on 24 Žub 2016 ( Time 16:27:51 )
* Generated by Telosys Tools Generator ( version 2.1.1 )
*/
package org.demo.business.service.mapping;
import org.modelmapper.ModelMapper;
import org.modelmapper.convention.MatchingStrategies;
import org.springframework.stereotype.Component;
import org.demo.bean.OrderTrans;
import org.demo.bean.jpa.OrderTransEntity;
import org.demo.bean.jpa.OrderTransStatusEntity;
import org.demo.bean.jpa.OrderTransSourceEntity;
import org.demo.bean.jpa.GlobalTransPointEntity;
import org.demo.bean.jpa.SaleSellerEntity;
import org.demo.bean.jpa.ContactEntity;
import org.demo.bean.jpa.GlobalPrivateCodeEntity;
import org.demo.bean.jpa.StockDepotEntity;
/**
* Mapping between entity beans and display beans.
*/
@Component
public class OrderTransServiceMapper extends AbstractServiceMapper {
/**
* ModelMapper : bean to bean mapping library.
*/
private ModelMapper modelMapper;
/**
* Constructor.
*/
public OrderTransServiceMapper() {
modelMapper = new ModelMapper();
modelMapper.getConfiguration().setMatchingStrategy(MatchingStrategies.STRICT);
}
/**
* Mapping from 'OrderTransEntity' to 'OrderTrans'
* @param orderTransEntity
*/
public OrderTrans mapOrderTransEntityToOrderTrans(OrderTransEntity orderTransEntity) {
if(orderTransEntity == null) {
return null;
}
//--- Generic mapping
OrderTrans orderTrans = map(orderTransEntity, OrderTrans.class);
//--- Link mapping ( link to OrderTransStatus )
if(orderTransEntity.getOrderTransStatus() != null) {
orderTrans.setStatusId(orderTransEntity.getOrderTransStatus().getId());
}
//--- Link mapping ( link to OrderTransSource )
if(orderTransEntity.getOrderTransSource() != null) {
orderTrans.setTransSourceId(orderTransEntity.getOrderTransSource().getId());
}
//--- Link mapping ( link to GlobalTransPoint )
if(orderTransEntity.getGlobalTransPoint() != null) {
orderTrans.setTransPointId(orderTransEntity.getGlobalTransPoint().getId());
}
//--- Link mapping ( link to SaleSeller )
if(orderTransEntity.getSaleSeller() != null) {
orderTrans.setSellerId(orderTransEntity.getSaleSeller().getId());
}
//--- Link mapping ( link to Contact )
if(orderTransEntity.getContact() != null) {
orderTrans.setContactId(orderTransEntity.getContact().getId());
}
//--- Link mapping ( link to GlobalPrivateCode )
if(orderTransEntity.getGlobalPrivateCode() != null) {
orderTrans.setPrivateCodeId(orderTransEntity.getGlobalPrivateCode().getId());
}
//--- Link mapping ( link to StockDepot )
if(orderTransEntity.getStockDepot() != null) {
orderTrans.setDepotId(orderTransEntity.getStockDepot().getId());
}
return orderTrans;
}
/**
* Mapping from 'OrderTrans' to 'OrderTransEntity'
* @param orderTrans
* @param orderTransEntity
*/
public void mapOrderTransToOrderTransEntity(OrderTrans orderTrans, OrderTransEntity orderTransEntity) {
if(orderTrans == null) {
return;
}
//--- Generic mapping
map(orderTrans, orderTransEntity);
//--- Link mapping ( link : orderTrans )
if( hasLinkToOrderTransStatus(orderTrans) ) {
OrderTransStatusEntity orderTransStatus1 = new OrderTransStatusEntity();
orderTransStatus1.setId( orderTrans.getStatusId() );
orderTransEntity.setOrderTransStatus( orderTransStatus1 );
} else {
orderTransEntity.setOrderTransStatus( null );
}
//--- Link mapping ( link : orderTrans )
if( hasLinkToOrderTransSource(orderTrans) ) {
OrderTransSourceEntity orderTransSource2 = new OrderTransSourceEntity();
orderTransSource2.setId( orderTrans.getTransSourceId() );
orderTransEntity.setOrderTransSource( orderTransSource2 );
} else {
orderTransEntity.setOrderTransSource( null );
}
//--- Link mapping ( link : orderTrans )
if( hasLinkToGlobalTransPoint(orderTrans) ) {
GlobalTransPointEntity globalTransPoint3 = new GlobalTransPointEntity();
globalTransPoint3.setId( orderTrans.getTransPointId() );
orderTransEntity.setGlobalTransPoint( globalTransPoint3 );
} else {
orderTransEntity.setGlobalTransPoint( null );
}
//--- Link mapping ( link : orderTrans )
if( hasLinkToSaleSeller(orderTrans) ) {
SaleSellerEntity saleSeller4 = new SaleSellerEntity();
saleSeller4.setId( orderTrans.getSellerId() );
orderTransEntity.setSaleSeller( saleSeller4 );
} else {
orderTransEntity.setSaleSeller( null );
}
//--- Link mapping ( link : orderTrans )
if( hasLinkToContact(orderTrans) ) {
ContactEntity contact5 = new ContactEntity();
contact5.setId( orderTrans.getContactId() );
orderTransEntity.setContact( contact5 );
} else {
orderTransEntity.setContact( null );
}
//--- Link mapping ( link : orderTrans )
if( hasLinkToGlobalPrivateCode(orderTrans) ) {
GlobalPrivateCodeEntity globalPrivateCode6 = new GlobalPrivateCodeEntity();
globalPrivateCode6.setId( orderTrans.getPrivateCodeId() );
orderTransEntity.setGlobalPrivateCode( globalPrivateCode6 );
} else {
orderTransEntity.setGlobalPrivateCode( null );
}
//--- Link mapping ( link : orderTrans )
if( hasLinkToStockDepot(orderTrans) ) {
StockDepotEntity stockDepot7 = new StockDepotEntity();
stockDepot7.setId( orderTrans.getDepotId() );
orderTransEntity.setStockDepot( stockDepot7 );
} else {
orderTransEntity.setStockDepot( null );
}
}
/**
* Verify that OrderTransStatus id is valid.
* @param OrderTransStatus OrderTransStatus
* @return boolean
*/
private boolean hasLinkToOrderTransStatus(OrderTrans orderTrans) {
if(orderTrans.getStatusId() != null) {
return true;
}
return false;
}
/**
* Verify that OrderTransSource id is valid.
* @param OrderTransSource OrderTransSource
* @return boolean
*/
private boolean hasLinkToOrderTransSource(OrderTrans orderTrans) {
if(orderTrans.getTransSourceId() != null) {
return true;
}
return false;
}
/**
* Verify that GlobalTransPoint id is valid.
* @param GlobalTransPoint GlobalTransPoint
* @return boolean
*/
private boolean hasLinkToGlobalTransPoint(OrderTrans orderTrans) {
if(orderTrans.getTransPointId() != null) {
return true;
}
return false;
}
/**
* Verify that SaleSeller id is valid.
* @param SaleSeller SaleSeller
* @return boolean
*/
private boolean hasLinkToSaleSeller(OrderTrans orderTrans) {
if(orderTrans.getSellerId() != null) {
return true;
}
return false;
}
/**
* Verify that Contact id is valid.
* @param Contact Contact
* @return boolean
*/
private boolean hasLinkToContact(OrderTrans orderTrans) {
if(orderTrans.getContactId() != null) {
return true;
}
return false;
}
/**
* Verify that GlobalPrivateCode id is valid.
* @param GlobalPrivateCode GlobalPrivateCode
* @return boolean
*/
private boolean hasLinkToGlobalPrivateCode(OrderTrans orderTrans) {
if(orderTrans.getPrivateCodeId() != null) {
return true;
}
return false;
}
/**
* Verify that StockDepot id is valid.
* @param StockDepot StockDepot
* @return boolean
*/
private boolean hasLinkToStockDepot(OrderTrans orderTrans) {
if(orderTrans.getDepotId() != null) {
return true;
}
return false;
}
/**
* {@inheritDoc}
*/
@Override
protected ModelMapper getModelMapper() {
return modelMapper;
}
protected void setModelMapper(ModelMapper modelMapper) {
this.modelMapper = modelMapper;
}
}
|
[
"altan.senel@gunessigorta.com.tr"
] |
altan.senel@gunessigorta.com.tr
|
6d04f71d6c6e8da389d5d7c6ff58bd91cb911c77
|
fa91450deb625cda070e82d5c31770be5ca1dec6
|
/Diff-Raw-Data/30/30_7076cc679be116a782df2d720fd73b43bb4b81c3/NiftyJava2dWindow/30_7076cc679be116a782df2d720fd73b43bb4b81c3_NiftyJava2dWindow_t.java
|
d6091ecf02372aa22addb175d5b48bbe56301c88
|
[] |
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,631
|
java
|
package de.lessvoid.nifty.java2d.tests;
import java.awt.Canvas;
import java.awt.Dimension;
import java.awt.Frame;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import de.lessvoid.nifty.Nifty;
import de.lessvoid.nifty.java2d.input.InputSystemAwtImpl;
import de.lessvoid.nifty.java2d.renderer.FontProviderJava2dImpl;
import de.lessvoid.nifty.java2d.renderer.RenderDeviceJava2dImpl;
import de.lessvoid.nifty.spi.sound.SoundDevice;
import de.lessvoid.nifty.spi.sound.SoundDeviceNullImpl;
import de.lessvoid.nifty.tools.TimeProvider;
public class NiftyJava2dWindow {
protected Nifty nifty;
public NiftyJava2dWindow(String title, int width, int height,
String filename, String screenName) {
this(title, width, height, filename, screenName,
new SoundDeviceNullImpl());
}
public NiftyJava2dWindow(String title, int width, int height,
String filename, String screenName, SoundDevice soundDevice) {
InputSystemAwtImpl inputSystem = new InputSystemAwtImpl();
final Canvas canvas = new Canvas();
canvas.addMouseMotionListener(inputSystem);
canvas.addMouseListener(inputSystem);
canvas.addKeyListener(inputSystem);
Frame f = new Frame(title);
f.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
}
public void windowDeiconified(WindowEvent e) {
}
public void windowIconified(WindowEvent e) {
}
});
f.add(canvas);
f.pack();
f.setSize(new Dimension(width, height));
f.setVisible(true);
// f.setIgnoreRepaint(true);
// canvas.setIgnoreRepaint(true);
FontProviderJava2dImpl fontProvider = new FontProviderJava2dImpl();
registerFonts(fontProvider);
RenderDeviceJava2dImpl renderDevice = new RenderDeviceJava2dImpl(canvas);
renderDevice.setFontProvider(fontProvider);
nifty = new Nifty(renderDevice, soundDevice, inputSystem,
new TimeProvider());
nifty.fromXml(filename, screenName);
}
protected void registerFonts(FontProviderJava2dImpl fontProviderJava2dImpl) {
}
long fps = 0;
public long getFrameTime() {
return 1000 / getFramesPerSecond();
}
public long getFramesPerSecond() {
return fps;
}
public void start() {
boolean done = false;
long time = System.currentTimeMillis();
long frames = 0;
while (!done) {
done = nifty.render(true);
frames++;
long diff = System.currentTimeMillis() - time;
if (diff >= 1000) {
fps = frames;
time += diff;
System.out.println("fps: " + frames);
frames = 0;
}
}
}
}
|
[
"yuzhongxing88@gmail.com"
] |
yuzhongxing88@gmail.com
|
8358d2589c7af609625bf4210c2bbc57c4feed18
|
90833a7f5552cd0b2de6e92d1915b13a57290ff3
|
/src/main/java/com/univocity/cardano/wallet/api/generated/byronmigrations/MigrateByronWalletResponseItem.java
|
d6411261b8094ea39f1a939c0ffe4650f93e2e17
|
[
"Apache-2.0"
] |
permissive
|
Daniel-SchaeferJ/envlp-cardano-wallet
|
c7a7d723375382ca1ecb8d86ad02446b7d267736
|
fba23620f69f4dcea010005afc78a175d466dfe3
|
refs/heads/main
| 2023-02-12T01:33:20.158351
| 2021-01-14T19:19:52
| 2021-01-14T19:19:52
| 319,252,048
| 0
| 0
|
Apache-2.0
| 2021-01-14T19:19:53
| 2020-12-07T08:27:08
|
Java
|
UTF-8
|
Java
| false
| false
| 470
|
java
|
package com.univocity.cardano.wallet.api.generated.byronmigrations;
import com.univocity.cardano.wallet.api.generated.common.*;
import java.util.regex.*;
import java.util.*;
import static com.univocity.cardano.wallet.common.Utils.*;
import com.fasterxml.jackson.annotation.*;
import com.univocity.cardano.wallet.api.generated.*;
/**
*
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public final class MigrateByronWalletResponseItem extends AbstractTransaction {
}
|
[
"jbax@univocity.com"
] |
jbax@univocity.com
|
c9b3976ad5289981be6b372a012b11540a8c2faa
|
a00326c0e2fc8944112589cd2ad638b278f058b9
|
/src/main/java/000/142/361/CWE643_Xpath_Injection__listen_tcp_66a.java
|
b5358a8467b4ef8346c371773cb6f13dc4635176
|
[] |
no_license
|
Lanhbao/Static-Testing-for-Juliet-Test-Suite
|
6fd3f62713be7a084260eafa9ab221b1b9833be6
|
b095b11c7cb6d4a5bb2b76181e35d6ee00e96e68
|
refs/heads/master
| 2020-08-24T13:34:04.004149
| 2019-10-25T09:26:00
| 2019-10-25T09:26:00
| 216,822,684
| 0
| 1
| null | 2019-11-08T09:51:54
| 2019-10-22T13:37:13
|
Java
|
UTF-8
|
Java
| false
| false
| 7,483
|
java
|
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE643_Xpath_Injection__listen_tcp_66a.java
Label Definition File: CWE643_Xpath_Injection.label.xml
Template File: sources-sinks-66a.tmpl.java
*/
/*
* @description
* CWE: 643 Xpath Injection
* BadSource: listen_tcp Read data using a listening tcp connection
* GoodSource: A hardcoded string
* Sinks:
* GoodSink: validate input through StringEscapeUtils
* BadSink : user input is used without validate
* Flow Variant: 66 Data flow: data passed in an array from one method to another in different source files in the same package
*
* */
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.net.Socket;
import java.net.ServerSocket;
import java.util.logging.Level;
public class CWE643_Xpath_Injection__listen_tcp_66a extends AbstractTestCase
{
public void bad() throws Throwable
{
String data;
data = ""; /* Initialize data */
/* Read data using a listening tcp connection */
{
ServerSocket listener = null;
Socket socket = null;
BufferedReader readerBuffered = null;
InputStreamReader readerInputStream = null;
/* Read data using a listening tcp connection */
try
{
listener = new ServerSocket(39543);
socket = listener.accept();
/* read input from socket */
readerInputStream = new InputStreamReader(socket.getInputStream(), "UTF-8");
readerBuffered = new BufferedReader(readerInputStream);
/* POTENTIAL FLAW: Read data using a listening tcp connection */
data = readerBuffered.readLine();
}
catch (IOException exceptIO)
{
IO.logger.log(Level.WARNING, "Error with stream reading", exceptIO);
}
finally
{
/* Close 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);
}
/* Close socket objects */
try
{
if (socket != null)
{
socket.close();
}
}
catch (IOException exceptIO)
{
IO.logger.log(Level.WARNING, "Error closing Socket", exceptIO);
}
try
{
if (listener != null)
{
listener.close();
}
}
catch (IOException exceptIO)
{
IO.logger.log(Level.WARNING, "Error closing ServerSocket", exceptIO);
}
}
}
String[] dataArray = new String[5];
dataArray[2] = data;
(new CWE643_Xpath_Injection__listen_tcp_66b()).badSink(dataArray );
}
public void good() throws Throwable
{
goodG2B();
goodB2G();
}
/* goodG2B() - use goodsource and badsink */
private void goodG2B() throws Throwable
{
String data;
/* FIX: Use a hardcoded string */
data = "foo";
String[] dataArray = new String[5];
dataArray[2] = data;
(new CWE643_Xpath_Injection__listen_tcp_66b()).goodG2BSink(dataArray );
}
/* goodB2G() - use badsource and goodsink */
private void goodB2G() throws Throwable
{
String data;
data = ""; /* Initialize data */
/* Read data using a listening tcp connection */
{
ServerSocket listener = null;
Socket socket = null;
BufferedReader readerBuffered = null;
InputStreamReader readerInputStream = null;
/* Read data using a listening tcp connection */
try
{
listener = new ServerSocket(39543);
socket = listener.accept();
/* read input from socket */
readerInputStream = new InputStreamReader(socket.getInputStream(), "UTF-8");
readerBuffered = new BufferedReader(readerInputStream);
/* POTENTIAL FLAW: Read data using a listening tcp connection */
data = readerBuffered.readLine();
}
catch (IOException exceptIO)
{
IO.logger.log(Level.WARNING, "Error with stream reading", exceptIO);
}
finally
{
/* Close 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);
}
/* Close socket objects */
try
{
if (socket != null)
{
socket.close();
}
}
catch (IOException exceptIO)
{
IO.logger.log(Level.WARNING, "Error closing Socket", exceptIO);
}
try
{
if (listener != null)
{
listener.close();
}
}
catch (IOException exceptIO)
{
IO.logger.log(Level.WARNING, "Error closing ServerSocket", exceptIO);
}
}
}
String[] dataArray = new String[5];
dataArray[2] = data;
(new CWE643_Xpath_Injection__listen_tcp_66b()).goodB2GSink(dataArray );
}
/* 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);
}
}
|
[
"anhtluet12@gmail.com"
] |
anhtluet12@gmail.com
|
6288e5cac00ae6c009da279f9b564cc6151beeea
|
378a9d476ecb36f32f95f5a78a20c11ce1a419fb
|
/selfContained/data/code/mutable/recurrentjava/autodiff/Graph.java
|
13ca544886f36aa0e386bf88fe8a2cdf2391a1d2
|
[
"MIT"
] |
permissive
|
benrayfield/occamsworkspace
|
49361d29b523b0ff3d20965c6a8bcd9fa7d781c2
|
6968855d2b3a7ad40a537929b4c5c410e57117dd
|
refs/heads/main
| 2023-04-04T13:23:57.881418
| 2021-04-08T16:43:07
| 2021-04-08T16:43:07
| 355,909,685
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 6,812
|
java
|
package mutable.recurrentjava.autodiff;
import java.io.Flushable;
import java.nio.FloatBuffer;
import java.util.ArrayList;
import java.util.List;
import java.util.function.Consumer;
import immutable.acyclicflow.AcyclicFlowF;
import immutable.rbm.learnloop.OpenclProgs;
import immutable.recurrentjava.flop.unary.Unaflop;
import immutable.rnn.RnnParams;
import immutable.util.MathUtil;
import mutable.recurrentjava.RjOptions;
import mutable.recurrentjava.datastructs.DataSequence;
import mutable.recurrentjava.loss.Loss;
import mutable.recurrentjava.matrix.Matrix;
import mutable.recurrentjava.model.Model;
import mutable.recurrentjava.model.NeuralNetwork;
import mutable.util.ManualLazy;
import mutable.util.task.RunnableTask;
import mutable.util.task.Task;
/** A Graph is a mutable builder of numberCrunching ops with backprop (and in some cases also training) built in.
BenRayfield found opensourceMITLicensed RecurrentJava code which seemed to do the right calculations but only on CPU,
so he is (as of 2020-5-2) still OpenCL optimizing that whole autodiff system
and plans to add a few more funcs to Graph so forward and backprop thru a gru node and lstm node can be done in
a single opencl ndrange kernel instead of a kernel for every add, multiply, etc,
cuz the number of sequential kernels is a bottleneck.
*/
public interface Graph /*extends ManualLazy*/{
/** Call this after creating all the forward Matrixs such as by mul(Matrix,Matrix) and oneMinus(Matrix),
to set the dw and stepCache and adjust w (weights) by those, aka to learn.
As of 2021-4-6 theres no tasks in forwardprop list, but tasks are added for backprop and training
which wait until this is called, since doing backprop before all the forward steps loses the later forward steps.
*/
public void learn();
public boolean isApplyBackprop();
//TODO rename this recurrentjava to benrayfieldsrecurrentjavafork or something shorter
/** (benrayfield made this func) Was it wrong to copy the stepcache?
I dont see other funcs accessing stepcache places other than in Trainer.
Maybe thats cuz this op isnt used except inside neural nodes
and only the Model.getParameters() (such as weights) use stepCache.
*/
public Matrix concatVectors(final Matrix m1, final Matrix m2);
//FIXME implement most of the funcs in Graph using acyclicFlow(AcyclicFlow,Matrix...),
//such as sub(Matrix,Matrix) and oneMinus(Matrix), but I'm unsure if I want every input and output var in
//AcyclicFlow to be its own Matrix. Maybe specify that in AcyclicFlow class.
public Matrix nonlin(final Unaflop neuron, final Matrix m);
public Matrix mul(final Matrix m1, final Matrix m2);
public Matrix add(final Matrix m1, final Matrix m2);
/** Example add.rows=200 add.cols=5 rowsOneCol.rows=200 rowsOneCol.cols=1 colMult=5 returns rows=200 cols=5.
Benrayfields upgrading of recurrentjava to opencl is putting multiple cols as parallelSize
(unsure if it should be rows or cols yet 2019-5-9, probably cols),
and the bias needs to be added to all parallelIndex vecs, unlike matmul which (it appears) already does.
Copying and modifying the code from add(...).
Planning to opencl upgrade after the upgrade to parallelSize and parallelIndex vars.
<br><br>
FIXME is this the same as add(Matrix add, Matrix concatVectors colMult of them)? And should it be?
*/
public Matrix add_rowsCols_to_rowsColsWithColmult(Matrix add, Matrix rowsOneCol, int colMult);
public Matrix elmult_rowsCols_to_rowsColsWithColmult(Matrix rowsCols, Matrix rowsOneCol, int colMult);
public Matrix oneMinus(final Matrix m);
public Matrix sub(final Matrix m1, final Matrix m2);
public Matrix smul(final Matrix m, final float s);
public default Matrix smul(final float s, final Matrix m) {
return smul(m,s);
}
public Matrix neg(final Matrix m);
public Matrix elmul(final Matrix m1, final Matrix m2);
/*public default Matrix[] forwardpropGruNodes(Object todoWhatParams){
throw new Error("FIXME add a few more funcs to Graph so forward and backprop thru a gru node and lstm node can be done in a single opencl ndrange kernel instead of a kernel for every add, multiply, etc, cuz the number of sequential kernels is a bottleneck.");
}
public default Matrix[] backpropGruNodes(Object todoWhatParams){
throw new Error("FIXME add a few more funcs to Graph so forward and backprop thru a gru node and lstm node can be done in a single opencl ndrange kernel instead of a kernel for every add, multiply, etc, cuz the number of sequential kernels is a bottleneck.");
}
public default Matrix[] forwardpropLstmNodes(Object todoWhatParams){
throw new Error("FIXME add a few more funcs to Graph so forward and backprop thru a gru node and lstm node can be done in a single opencl ndrange kernel instead of a kernel for every add, multiply, etc, cuz the number of sequential kernels is a bottleneck.");
}
public default Matrix[] backpropLstmNodes(Object todoWhatParams){
throw new Error("FIXME add a few more funcs to Graph so forward and backprop thru a gru node and lstm node can be done in a single opencl ndrange kernel instead of a kernel for every add, multiply, etc, cuz the number of sequential kernels is a bottleneck.");
}
TODO a Matrix that does an AcyclicFlow, which forwardpropGruNodes and backpropLstmNodes etc could be implemented as instead of complicating Graph interface with those funcs.
That would be useful for also being able to optimize new kinds of neuralnets AI thinks of at runtime to try.
Maybe use Biflop and Unaflop interfaces for this? Or use some of the physicsmata mathevo code? Or some of the acyclicflow int[] code (2 int12 ptrs and an int8 op)?
That could be the cpu form of it, but still need to generate opencl code. This will be compatible withopencl wallet and spend ops.
*/
/** For each input in AcyclicFlow, theres a Matrix param. For each output, theres a returned Matrix. */
public Matrix[] acyclicFlow(AcyclicFlowF af, Matrix... ins);
/** This is a redesign of RecurrentJava Trainer.pass(...).
Some of the params are used during CpuGraph but only at the start andOr end of GpuGraph.
<br><br>
Schedule thinking andOr training of the NeuralNetwork which the earlier calls, such as mul(Matrix,Matrix)
are part of its forward and backprop steps.
Gets Matrixs from it. You still have to call run() (as this implements Runnable) to do all those things if this is an OpenclGraph,
else if its CpuGraph does it here.
*
public void train(NeuralNetwork net);
*/
public void pass(RnnParams params, Consumer<Matrix> outputListener, Consumer<Model> stateResetter,
Model model, List<DataSequence> sequences, boolean applyTraining, Loss lossTraining, Loss lossReporting);
/** normally called by pass(...) */
public void updateModelParams(RnnParams p, Model model);
}
|
[
"ben@humanai.net"
] |
ben@humanai.net
|
39082dfb23f7bffd7f26d0db74e02074d12f757a
|
bfcce2270be74b70f75c2ad25ebeed67a445220d
|
/bin/custom/training/trainingcockpits/src/com/hybris/training/cockpits/cmscockpit/browser/filters/MobileUiExperienceBrowserFilter.java
|
05487a8dc53c8e29957d5a3a56141c8dc97adcc5
|
[
"Unlicense"
] |
permissive
|
hasanakgoz/Hybris
|
018c1673e8328bd5763d29c5ef72fd35536cd11a
|
2a9d0ea1e24d6dee5bfc20a8541ede903eedc064
|
refs/heads/master
| 2020-03-27T12:46:57.199555
| 2018-03-26T10:47:21
| 2018-03-26T10:47:21
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,366
|
java
|
/*
* [y] hybris Platform
*
* Copyright (c) 2017 SAP SE or an SAP affiliate company. All rights reserved.
*
* This software is the confidential and proprietary information of SAP
* ("Confidential Information"). You shall not disclose such Confidential
* Information and shall use it only in accordance with the terms of the
* license agreement you entered into with SAP.
*/
package com.hybris.training.cockpits.cmscockpit.browser.filters;
import de.hybris.platform.commerceservices.enums.UiExperienceLevel;
import de.hybris.platform.cockpit.model.search.Query;
import de.hybris.platform.util.localization.Localization;
public class MobileUiExperienceBrowserFilter extends AbstractUiExperienceFilter
{
private static final String MOBILE_UI_EXPERIENCE_LABEL_KEY = "mobile.ui.experience.label.key";
@Override
public boolean exclude(final Object item)
{
return false;
}
@Override
public void filterQuery(final Query query)
{
//we have to remove a defaultPage = true filter if we are interested in immediate results..
removeDefaultPageFilter(query);
//we have to passed filter specific value
query.setContextParameter(UI_EXPERIENCE_PARAM, UiExperienceLevel.MOBILE);
}
@Override
public String getLabel()
{
return Localization.getLocalizedString(MOBILE_UI_EXPERIENCE_LABEL_KEY);
}
}
|
[
"sandeepvalapi@gmail.com"
] |
sandeepvalapi@gmail.com
|
2934c07963f23592e072740776876dda09fd794d
|
459a7b0bdcc236441173bb17fc519ee04c1189ca
|
/engine/src/main/java/org/hibernate/validator/path/ContainerElementNode.java
|
7a8e585ccbb915088491f800c6e3458c9f8635b1
|
[
"LicenseRef-scancode-dco-1.1",
"Apache-2.0"
] |
permissive
|
YHTCUG/hibernate-validator
|
811019d6433fdcca62e7ca08f0aa6b1fadd5e1f3
|
15a36e56bb1c80f830adfaf2f7a8938588860e62
|
refs/heads/master
| 2023-04-12T21:07:20.834503
| 2019-08-02T14:24:27
| 2019-08-02T15:06:43
| 202,673,473
| 0
| 0
|
Apache-2.0
| 2023-04-04T15:54:57
| 2019-08-16T06:43:44
|
Java
|
UTF-8
|
Java
| false
| false
| 595
|
java
|
/*
* Hibernate Validator, declare and validate application constraints
*
* License: Apache License, Version 2.0
* See the license.txt file in the root directory or <http://www.apache.org/licenses/LICENSE-2.0>.
*/
package org.hibernate.validator.path;
/**
* Node representing a container element, providing Hibernate Validator specific functionality.
*
* @author Guillaume Smet
*/
public interface ContainerElementNode extends javax.validation.Path.ContainerElementNode {
/**
* @return Returns the value of the container element represented by this node.
*/
Object getValue();
}
|
[
"gunnar.morling@googlemail.com"
] |
gunnar.morling@googlemail.com
|
def55e6aeb8444f3307d569d1172414a63d4a5b2
|
cca87c4ade972a682c9bf0663ffdf21232c9b857
|
/com/tencent/mm/protocal/c/bpi.java
|
45d6cbbac4ba425c67a4fa5e25cda5553ad4c770
|
[] |
no_license
|
ZoranLi/wechat_reversing
|
b246d43f7c2d7beb00a339e2f825fcb127e0d1a1
|
36b10ef49d2c75d69e3c8fdd5b1ea3baa2bba49a
|
refs/heads/master
| 2021-07-05T01:17:20.533427
| 2017-09-25T09:07:33
| 2017-09-25T09:07:33
| 104,726,592
| 12
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,071
|
java
|
package com.tencent.mm.protocal.c;
import com.tencent.mm.bd.a;
public final class bpi extends a {
public String fFW;
public int tlI;
public int unN;
public String url;
protected final int a(int i, Object... objArr) {
if (i == 0) {
a.a.a.c.a aVar = (a.a.a.c.a) objArr[0];
aVar.eO(1, this.unN);
aVar.eO(2, this.tlI);
if (this.url != null) {
aVar.e(3, this.url);
}
if (this.fFW != null) {
aVar.e(4, this.fFW);
}
return 0;
} else if (i == 1) {
r0 = (a.a.a.a.eL(1, this.unN) + 0) + a.a.a.a.eL(2, this.tlI);
if (this.url != null) {
r0 += a.a.a.b.b.a.f(3, this.url);
}
if (this.fFW != null) {
return r0 + a.a.a.b.b.a.f(4, this.fFW);
}
return r0;
} else if (i == 2) {
a.a.a.a.a aVar2 = new a.a.a.a.a((byte[]) objArr[0], unknownTagHandler);
for (r0 = a.a(aVar2); r0 > 0; r0 = a.a(aVar2)) {
if (!super.a(aVar2, this, r0)) {
aVar2.cid();
}
}
return 0;
} else if (i != 3) {
return -1;
} else {
a.a.a.a.a aVar3 = (a.a.a.a.a) objArr[0];
bpi com_tencent_mm_protocal_c_bpi = (bpi) objArr[1];
switch (((Integer) objArr[2]).intValue()) {
case 1:
com_tencent_mm_protocal_c_bpi.unN = aVar3.xmD.mL();
return 0;
case 2:
com_tencent_mm_protocal_c_bpi.tlI = aVar3.xmD.mL();
return 0;
case 3:
com_tencent_mm_protocal_c_bpi.url = aVar3.xmD.readString();
return 0;
case 4:
com_tencent_mm_protocal_c_bpi.fFW = aVar3.xmD.readString();
return 0;
default:
return -1;
}
}
}
}
|
[
"lizhangliao@xiaohongchun.com"
] |
lizhangliao@xiaohongchun.com
|
a64160bb4303ee8b912c51743a76c2713def2077
|
ef7c846fd866bbc748a2e8719358c55b73f6fc96
|
/library/weiui/src/main/java/vip/kuaifan/weiui/extend/view/tablayout/widget/MsgView.java
|
6577477a8afcb82b3ee0f39e5d2d198a17346d2a
|
[
"MIT"
] |
permissive
|
shaibaoj/weiui
|
9e876fa3797537faecccca74a0c9206dba67e444
|
131a8e3a6ecad245f421f039d2bedc8a0362879d
|
refs/heads/master
| 2020-03-17T22:45:52.855193
| 2018-07-02T01:56:51
| 2018-07-02T01:56:51
| 134,017,696
| 0
| 0
| null | 2018-07-02T01:56:52
| 2018-05-19T01:01:44
|
Java
|
UTF-8
|
Java
| false
| false
| 5,084
|
java
|
package vip.kuaifan.weiui.extend.view.tablayout.widget;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Color;
import android.graphics.drawable.GradientDrawable;
import android.graphics.drawable.StateListDrawable;
import android.os.Build;
import android.util.AttributeSet;
import android.widget.TextView;
import vip.kuaifan.weiui.R;
/** 用于需要圆角矩形框背景的TextView的情况,减少直接使用TextView时引入的shape资源文件 */
@SuppressLint("AppCompatCustomView")
public class MsgView extends TextView {
private Context context;
private GradientDrawable gd_background = new GradientDrawable();
private int backgroundColor;
private int cornerRadius;
private int strokeWidth;
private int strokeColor;
private boolean isRadiusHalfHeight;
private boolean isWidthHeightEqual;
public MsgView(Context context) {
this(context, null);
}
public MsgView(Context context, AttributeSet attrs) {
this(context, attrs, 0);
}
public MsgView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
this.context = context;
obtainAttributes(context, attrs);
}
private void obtainAttributes(Context context, AttributeSet attrs) {
TypedArray ta = context.obtainStyledAttributes(attrs, R.styleable.MsgView);
backgroundColor = ta.getColor(R.styleable.MsgView_mv_backgroundColor, Color.TRANSPARENT);
cornerRadius = ta.getDimensionPixelSize(R.styleable.MsgView_mv_cornerRadius, 0);
strokeWidth = ta.getDimensionPixelSize(R.styleable.MsgView_mv_strokeWidth, 0);
strokeColor = ta.getColor(R.styleable.MsgView_mv_strokeColor, Color.TRANSPARENT);
isRadiusHalfHeight = ta.getBoolean(R.styleable.MsgView_mv_isRadiusHalfHeight, false);
isWidthHeightEqual = ta.getBoolean(R.styleable.MsgView_mv_isWidthHeightEqual, false);
ta.recycle();
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
if (isWidthHeightEqual() && getWidth() > 0 && getHeight() > 0) {
int max = Math.max(getWidth(), getHeight());
int measureSpec = MeasureSpec.makeMeasureSpec(max, MeasureSpec.EXACTLY);
super.onMeasure(measureSpec, measureSpec);
return;
}
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
}
@Override
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
super.onLayout(changed, left, top, right, bottom);
if (isRadiusHalfHeight()) {
setCornerRadius(getHeight() / 2);
} else {
setBgSelector();
}
}
public void setBackgroundColor(int backgroundColor) {
this.backgroundColor = backgroundColor;
setBgSelector();
}
public void setCornerRadius(int cornerRadius) {
this.cornerRadius = dp2px(cornerRadius);
setBgSelector();
}
public void setStrokeWidth(int strokeWidth) {
this.strokeWidth = dp2px(strokeWidth);
setBgSelector();
}
public void setStrokeColor(int strokeColor) {
this.strokeColor = strokeColor;
setBgSelector();
}
public void setIsRadiusHalfHeight(boolean isRadiusHalfHeight) {
this.isRadiusHalfHeight = isRadiusHalfHeight;
setBgSelector();
}
public void setIsWidthHeightEqual(boolean isWidthHeightEqual) {
this.isWidthHeightEqual = isWidthHeightEqual;
setBgSelector();
}
public int getBackgroundColor() {
return backgroundColor;
}
public int getCornerRadius() {
return cornerRadius;
}
public int getStrokeWidth() {
return strokeWidth;
}
public int getStrokeColor() {
return strokeColor;
}
public boolean isRadiusHalfHeight() {
return isRadiusHalfHeight;
}
public boolean isWidthHeightEqual() {
return isWidthHeightEqual;
}
protected int dp2px(float dp) {
final float scale = context.getResources().getDisplayMetrics().density;
return (int) (dp * scale + 0.5f);
}
protected int sp2px(float sp) {
final float scale = this.context.getResources().getDisplayMetrics().scaledDensity;
return (int) (sp * scale + 0.5f);
}
private void setDrawable(GradientDrawable gd, int color, int strokeColor) {
gd.setColor(color);
gd.setCornerRadius(cornerRadius);
gd.setStroke(strokeWidth, strokeColor);
}
public void setBgSelector() {
StateListDrawable bg = new StateListDrawable();
setDrawable(gd_background, backgroundColor, strokeColor);
bg.addState(new int[]{-android.R.attr.state_pressed}, gd_background);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {//16
setBackground(bg);
} else {
//noinspection deprecation
setBackgroundDrawable(bg);
}
}
}
|
[
"342210020@qq.com"
] |
342210020@qq.com
|
b6b8304b9aab1caa6a54e381c21d7e3b04020729
|
e2d1ad7bfd684f4d49469130e166efd6f47b59af
|
/design_pattern/src/main/java/com/study/book/bridge/example3/UrgencyMessage.java
|
51b15520d36cf5d260ed35e3cd312a5c406fad26
|
[] |
no_license
|
snowbuffer/jdk-java-basic
|
8545aef243c2d0a2749ea888dbe92bec9b49751c
|
2414167f93569d878b2d802b9c70af906b605c7a
|
refs/heads/master
| 2022-12-22T22:10:11.575240
| 2021-07-06T06:13:38
| 2021-07-06T06:13:38
| 172,832,856
| 0
| 1
| null | 2022-12-16T04:40:12
| 2019-02-27T03:04:57
|
Java
|
GB18030
|
Java
| false
| false
| 376
|
java
|
package com.study.book.bridge.example3;
/**
* 加急消息的抽象接口
*/
public interface UrgencyMessage extends Message {
/**
* 监控某消息的处理过程
*
* @param messageId 被监控的消息的编号
* @return 包含监控到的数据对象,这里示意一下,所以用了Object
*/
public Object watch(String messageId);
}
|
[
"timmydargon@sina.com"
] |
timmydargon@sina.com
|
ef057497566f57501c01c11fcf92a064fe8b5063
|
4b5d1251a6bc02b52d0f6251e3d309a64ef852bd
|
/com.io7m.jcanephora.fake/src/main/java/com/io7m/jcanephora/fake/FakeArrayVertexAttributeFloating.java
|
0e89dab831c44d2d73001ddd3f1920cfeb07fc97
|
[
"ISC"
] |
permissive
|
io7m/jcanephora
|
92fb29950f928cefcefda849641b6f3fb3ebbebd
|
a10b2ca6675ab0a2c4710028fcd8cf33db552e01
|
refs/heads/master
| 2023-03-16T13:29:17.285869
| 2017-06-21T14:06:32
| 2017-06-21T14:06:32
| 43,243,403
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,000
|
java
|
/*
* Copyright © 2015 <code@io7m.com> http://io7m.com
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
* IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
package com.io7m.jcanephora.fake;
import com.io7m.jcanephora.core.JCGLArrayBufferUsableType;
import com.io7m.jcanephora.core.JCGLArrayVertexAttributeFloatingPointType;
import com.io7m.jcanephora.core.JCGLArrayVertexAttributeMatcherType;
import com.io7m.jcanephora.core.JCGLScalarType;
import com.io7m.jnull.NullCheck;
import java.util.Objects;
final class FakeArrayVertexAttributeFloating extends FakeObjectPseudoUnshared
implements JCGLArrayVertexAttributeFloatingPointType
{
private final int index;
private final JCGLArrayBufferUsableType array;
private final JCGLScalarType type;
private final int stride;
private final long offset;
private final int elements;
private final boolean normalized;
private final int divisor;
FakeArrayVertexAttributeFloating(
final FakeContext in_context,
final int in_index,
final JCGLArrayBufferUsableType in_a,
final JCGLScalarType in_type,
final int in_elements,
final int in_stride,
final long in_offset,
final boolean in_normalized,
final int in_divisor)
{
super(in_context);
this.index = in_index;
this.array = NullCheck.notNull(in_a, "Array");
this.type = NullCheck.notNull(in_type, "Type");
this.elements = in_elements;
this.stride = in_stride;
this.offset = in_offset;
this.normalized = in_normalized;
this.divisor = in_divisor;
}
@Override
public int elementCount()
{
return this.elements;
}
@Override
public boolean isNormalized()
{
return this.normalized;
}
@Override
public long offsetOctets()
{
return this.offset;
}
@Override
public int strideOctets()
{
return this.stride;
}
@Override
public JCGLScalarType type()
{
return this.type;
}
@Override
public int index()
{
return this.index;
}
@Override
public JCGLArrayBufferUsableType getArrayBuffer()
{
return this.array;
}
@Override
public boolean equals(final Object o)
{
if (this == o) {
return true;
}
if (o == null || this.getClass() != o.getClass()) {
return false;
}
final FakeArrayVertexAttributeFloating that =
(FakeArrayVertexAttributeFloating) o;
return this.index == that.index
&& this.stride == that.stride
&& this.offset == that.offset
&& this.elements == that.elements
&& this.normalized == that.normalized
&& this.divisor == that.divisor
&& Objects.equals(this.array, that.array)
&& this.type == that.type;
}
@Override
public int hashCode()
{
int result = this.index;
result = 31 * result + this.array.hashCode();
result = 31 * result + this.type.hashCode();
result = 31 * result + this.stride;
result = 31 * result + (int) (this.offset ^ (this.offset >>> 32));
result = 31 * result + this.elements;
result = 31 * result + (this.normalized ? 1 : 0);
result = 31 * result + this.divisor;
return result;
}
@Override
public <A, E extends Exception> A matchVertexAttribute(
final JCGLArrayVertexAttributeMatcherType<A, E> m)
throws E
{
return m.matchFloatingPoint(this);
}
@Override
public int divisor()
{
return this.divisor;
}
}
|
[
"code@io7m.com"
] |
code@io7m.com
|
1eb2107741f0585e224f9ba803343a42c815672c
|
9e92540d8d29e642e42cee330aeb9c81c3ab11db
|
/D2FSClient/src/main/java/com/emc/d2fs/services/checkout_service/package-info.java
|
fc2ad6bc7cc9215c7ac8c9b95824faa7b3c70c95
|
[] |
no_license
|
ambadan1/demotrial
|
c8a64f6f26b5f0e5a9c8a2047dfb11d354ddec42
|
9b4dd17ad423067eca376a4bad204986ed039fee
|
refs/heads/master
| 2020-04-29T10:52:03.614348
| 2019-03-17T09:26:26
| 2019-03-17T09:26:26
| 176,076,767
| 0
| 0
| null | 2019-03-17T09:26:27
| 2019-03-17T08:48:00
|
Java
|
UTF-8
|
Java
| false
| false
| 218
|
java
|
@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.emc.com/d2fs/services/checkout_service", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
package com.emc.d2fs.services.checkout_service;
|
[
"aniket.ambadkar@novartis.com"
] |
aniket.ambadkar@novartis.com
|
05056f8553b8c2b5c2b92960a0e39c45a5c25e19
|
6544cd797a4e98de0690566fe663e20c4cc05f81
|
/Chap2OperatorsAndStatements/src/main/java/com/lethanh98/java/learn/oca8/chap2/StatementsJava/Switch.java
|
9cba3218b6162ef24a2d8ab5be1d7bc702856c3c
|
[] |
no_license
|
solitarysp/JavaOCA8
|
083de0164b53598c7a3dbf13b555091174e68239
|
e4e025c203455f7805cb138fe9a1f58e88594ec3
|
refs/heads/master
| 2023-03-02T21:40:19.405274
| 2021-02-02T03:19:58
| 2021-02-02T03:19:58
| 311,372,625
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,310
|
java
|
package com.lethanh98.java.learn.oca8.chap2.StatementsJava;
import com.lethanh98.java.learn.oca8.chap2.Operators;
import lombok.extern.slf4j.Slf4j;
@Slf4j
public class Switch implements Operators {
public static void main(String[] args) {
Operators operators = new Switch();
operators.run();
}
@Override
public void run() {
example1();
example3();
example5();
example6UsingFallThrough();
exampleStringSwitchDemo();
}
// Sẽ hiển thị Default và 2. Bởi vì đến case default hệ thống sẽ thực hiện các code ở các case tiếp theo cho đến khi gặp break
private void example1() {
log.info("==================example1============");
switch (5) {
case 1: {
log.info("1");
break;
}
default: {
log.info("Default");
}
case 2: {
log.info("2");
}
}
}
//example2 sẽ lỗi compiler vì có 2 biến result được tạo. Khi case không có {} thì scope của nó sẽ ở scope của switch.
// private void example2() {
// log.info("==================example2============");
// switch (5) {
// case 1:
// String result = "1";
// log.info("1");
// break;
// case 2:
// String result = "1";
// log.info("2");
// break;
// }
// }
// Example 3 chạy bình thường vì result ở các scope khác nhau
private void example3() {
log.info("==================example3============");
switch (1) {
case 1: {
String result = "1";
log.info("1");
break;
}
case 2: {
String result = "1";
log.info("2");
break;
}
}
}
// Không chạy được vì dataForCase không phải là một constant
// private void example4(int number) {
// log.info("==================example4============");
// int dataForCase= 1;
// switch (getData(number)) {
// case 1: {
// String result="1";
// log.info("1");
// break;
// }
// case dataForCase: {
// String result="1";
// log.info("2");
// break;
// }
//
// }
// }
private void example5() {
log.info("==================example5============");
switch (1) {
case '1': {
log.info("1");
break;
}
case 2: {
log.info("2");
break;
}
}
}
private void example6UsingFallThrough() {
log.info("====================================example6UsingFallThrough==================================");
int month = 9;
switch (month) {
case 1:
log.info("January");
case 2:
log.info("February");
case 3:
log.info("March");
case 4:
log.info("April");
case 5:
log.info("May");
case 6:
log.info("June");
case 7:
log.info("July");
case 8:
log.info("August");
case 9:
log.info("September");
case 10:
log.info("October");
case 11:
log.info("November");
case 12:
log.info("December");
break;
default:
break;
}
}
// Bắt đầu từ java 7, chúng ta có thể String trong switch
private void exampleStringSwitchDemo() {
log.info("====================================exampleStringSwitchDemo==================================");
String name = "thanh";
switch (name) {
case "thanh":
log.info("thanh");
break;
case "tuan":
log.info("tuan");
break;
}
}
}
|
[
"lethanh9398@gmail.com"
] |
lethanh9398@gmail.com
|
5a6dcd89a2c284a13379c55d028828a038eb7653
|
95c49f466673952b465e19a5ee3ae6eff76bee00
|
/src/main/java/com/zhihu/android/question/page/newvideo/p1894b/$$Lambda$a$qBlBg6e3R_rYEYgiWKhLGBdoE0.java
|
0051fed30abcb8ffb19962671460957bfcf95bb7
|
[] |
no_license
|
Phantoms007/zhihuAPK
|
58889c399ae56b16a9160a5f48b807e02c87797e
|
dcdbd103436a187f9c8b4be8f71bdf7813b6d201
|
refs/heads/main
| 2023-01-24T01:34:18.716323
| 2020-11-25T17:14:55
| 2020-11-25T17:14:55
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 802
|
java
|
package com.zhihu.android.question.page.newvideo.p1894b;
import com.zhihu.android.api.model.AnswerVideoInfo;
import java8.util.p2234b.AbstractC32237i;
/* renamed from: com.zhihu.android.question.page.newvideo.b.-$$Lambda$a$qBlBg6e3R_rYEYgiWKhLGBd-oE0 reason: invalid class name */
/* compiled from: lambda */
public final /* synthetic */ class $$Lambda$a$qBlBg6e3R_rYEYgiWKhLGBdoE0 implements AbstractC32237i {
public static final /* synthetic */ $$Lambda$a$qBlBg6e3R_rYEYgiWKhLGBdoE0 INSTANCE = new $$Lambda$a$qBlBg6e3R_rYEYgiWKhLGBdoE0();
private /* synthetic */ $$Lambda$a$qBlBg6e3R_rYEYgiWKhLGBdoE0() {
}
@Override // java8.util.p2234b.AbstractC32237i
public final Object apply(Object obj) {
return QuestionVideoUtil.m121102a((AnswerVideoInfo.Videos) obj);
}
}
|
[
"seasonpplp@qq.com"
] |
seasonpplp@qq.com
|
8f3ac48e12545168922e485993285585a8a43128
|
b07221f062214a1eccc7fa95e2d110534b03819e
|
/buildinggame/src/com/gmail/stefvanschiedev/buildinggame/events/scoreboards/MainScoreboardJoinShow.java
|
3e82a66ba6e72dc9a52391cebed0501e4ecf640b
|
[] |
no_license
|
VerschuerenTom/buildinggame
|
15f1f71a6e98b70c1e653da7baad24b77dae914e
|
569026f98dc1ab8e4069e493294d8ad7dab52fd2
|
refs/heads/master
| 2021-06-22T10:36:28.872286
| 2017-07-27T15:37:36
| 2017-07-27T15:39:06
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,609
|
java
|
package com.gmail.stefvanschiedev.buildinggame.events.scoreboards;
import com.gmail.stefvanschiedev.buildinggame.Main;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import com.gmail.stefvanschiedev.buildinggame.managers.files.SettingsManager;
import com.gmail.stefvanschiedev.buildinggame.managers.scoreboards.MainScoreboardManager;
import org.bukkit.scheduler.BukkitRunnable;
/**
* Handles the main scoreboard for new players
*
* @since 3.1.1
*/
public class MainScoreboardJoinShow implements Listener {
/**
* Handles the main scoreboard for new players
*
* @param e an event representing a player joining
* @see PlayerJoinEvent
* @since 3.1.1
*/
@EventHandler
public void onPlayerJoin(PlayerJoinEvent e) {
YamlConfiguration config = SettingsManager.getInstance().getConfig();
Player player = e.getPlayer();
MainScoreboardManager manager = MainScoreboardManager.getInstance();
if (!config.getBoolean("scoreboards.main.enable"))
return;
if (config.getStringList("scoreboards.main.worlds.enable").contains(player.getWorld().getName())) {
//schedule 1 tick later, so the player is fully connected
new BukkitRunnable() {
@Override
public void run() {
manager.getScoreboard().show(player);
manager.register(player);
}
}.runTaskLater(Main.getInstance(), 1L);
}
}
}
|
[
"stefvanschiedev@gmail.com"
] |
stefvanschiedev@gmail.com
|
9587e157b7b77799c4a3cb913e218526f040eab6
|
45e7e1ad471e9da41911dfe4e03fe48ee74eb361
|
/Pokecube Core/src/main/java/pokecube/core/interfaces/Nature.java
|
32e67043f6dc1301d924416d3e092410707ff406
|
[] |
no_license
|
sunwize/Pokecube
|
93ab41fc7206b02106eea7d094ce2bff95c4b6fc
|
fc42d1027c861622641bea8c82461dc3b1caef30
|
refs/heads/master
| 2021-01-18T07:19:41.175284
| 2015-12-31T18:14:30
| 2015-12-31T18:14:30
| 48,182,723
| 2
| 0
| null | 2015-12-17T15:36:04
| 2015-12-17T15:36:03
| null |
UTF-8
|
Java
| false
| false
| 3,171
|
java
|
package pokecube.core.interfaces;
import net.minecraft.util.StatCollector;
import pokecube.core.items.berries.BerryManager;
public enum Nature
{
// @formatter:off
HARDY (new byte[]{0,0,0,0,0,0}),
LONELY (new byte[]{0,1,-1,0,0,0}),
BRAVE (new byte[]{0,1,0,0,0,-1}),
ADAMANT (new byte[]{0,1,0,-1,0,0}),
NAUGHTY (new byte[]{0,1,0,0,-1,0}),
BOLD (new byte[]{0,-1,1,0,0,0}),
DOCILE (new byte[]{0,0,0,0,0,0}),
RELAXED (new byte[]{0,0,1,0,0,-1}),
IMPISH (new byte[]{0,0,1,-1,0,0}),
LAX (new byte[]{0,0,1,0,-1,0}),
TIMID (new byte[]{0,-1,0,0,0,1}),
HASTY (new byte[]{0,0,-1,0,0,1}),
SERIOUS (new byte[]{0,0,0,0,0,0}),
JOLLY (new byte[]{0,0,0,-1,0,1}),
NAIVE (new byte[]{0,0,0,0,-1,1}),
MODEST (new byte[]{0,-1,0,1,0,0}),
MILD (new byte[]{0,0,-1,1,0,0}),
QUIET (new byte[]{0,0,0,1,0,-1}),
BASHFUL (new byte[]{0,0,0,0,0,0}),
RASH (new byte[]{0,0,0,1,-1,0}),
CALM (new byte[]{0,-1,0,0,1,0}),
GENTLE (new byte[]{0,0,-1,0,1,0}),
SASSY (new byte[]{0,0,0,0,1,-1}),
CAREFUL (new byte[]{0,0,0,-1,1,0}),
QUIRKY (new byte[]{0,0,0,0,0,0});
// @formatter:on
final byte[] stats;
final byte badFlavour;
final byte goodFlavour;
int favourteBerry = -1;
private Nature(byte[] stats)
{
this.stats = stats;
byte good = -1;
byte bad = -1;
for (int i = 1; i < 6; i++)
{
if (stats[i] == 1)
{
good = (byte) (i - 1);
}
if (stats[i] == -1)
{
bad = (byte) (i - 1);
}
}
goodFlavour = good;
badFlavour = bad;
}
public byte[] getStatsMod()
{
return stats;
}
/** Returns the prefered berry for this nature, if it returns -1, it likes
* all berries equally.
*
* @param type
* @return */
public static int getFavouriteBerryIndex(Nature type)
{
int ret = -1;
byte good = type.goodFlavour;
byte bad = type.badFlavour;
if (good == bad) { return ret; }
if (type.favourteBerry != -1) return type.favourteBerry;
int max = 0;
int current;
for(Integer i:BerryManager.berryFlavours.keySet())
{
current = getBerryWeight(i, type);
if(current>max)
{
ret = i;
max = current;
}
}
type.favourteBerry = ret;
return ret;
}
public static String getTranslatedName(Nature type)
{
String translated = StatCollector.translateToLocal("nature." + type);
if (translated == null || translated.startsWith("nature.")) { return type.toString(); }
return translated;
}
public static int getBerryWeight(int berryIndex, Nature type)
{
int ret = 0;
int[] flavours = BerryManager.berryFlavours.get(berryIndex);
if(type.goodFlavour == type.badFlavour || flavours == null) return ret;
ret = flavours[type.goodFlavour] - flavours[type.badFlavour];
return ret;
}
}
|
[
"elpatricimo@gmail.com"
] |
elpatricimo@gmail.com
|
9d0754dff53f069529e8111c2e666e21df1e0691
|
39ff7a38be081a79742f6a82a19e7db68a119ca0
|
/src/test/java/vietj/test/CoroutineTest.java
|
2d0b26b7f75f9ce4391b12757213bc63257a6f87
|
[] |
no_license
|
PlumpMath/kotlin-coroutines
|
cc4801f3f7f826803d0402f07a2479f63886404f
|
1a69faedbfa1402a19cf36052a8f28fc9708d9ae
|
refs/heads/master
| 2021-01-20T09:55:04.959201
| 2016-07-05T06:52:04
| 2016-07-05T06:52:04
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,774
|
java
|
package vietj.test;
import io.vertx.core.Future;
import io.vertx.core.Handler;
import io.vertx.core.streams.ReadStream;
import org.junit.Test;
import vietj.coroutines.TheTest;
import java.util.Arrays;
import java.util.Collections;
import java.util.LinkedList;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import static junit.framework.TestCase.assertTrue;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
/**
* @author <a href="mailto:julien@julienviet.com">Julien Viet</a>
*/
public class CoroutineTest {
@Test
public void testAsyncFuture() throws Exception {
TheTest test = new TheTest();
CompletableFuture<String> result = new CompletableFuture<>();
test.testAsyncFuture(result::complete);
assertEquals("the_value", result.get(10, TimeUnit.SECONDS));
}
@Test
public void testAsyncHandler() throws Exception {
TheTest test = new TheTest();
CompletableFuture<String> result = new CompletableFuture<>();
test.testAsyncResultHandler(result::complete);
assertEquals("pong", result.get(10, TimeUnit.SECONDS));
}
@Test
public void testReadStream() throws Exception {
TheTest test = new TheTest();
ReadStreamImpl<String> stream = new ReadStreamImpl<>();
LinkedList<String> items = new LinkedList<>();
AtomicInteger done = new AtomicInteger();
test.readStream(stream, items::add, v -> done.incrementAndGet());
assertNotNull(stream.dataHandler);
assertNotNull(stream.endHandler);
assertEquals(Collections.emptyList(), items);
assertEquals(0, done.get());
stream.dataHandler.handle("zero");
assertEquals(Collections.singletonList("zero"), items);
assertEquals(0, done.get());
stream.dataHandler.handle("one");
assertEquals(Arrays.asList("zero", "one"), items);
assertEquals(0, done.get());
stream.endHandler.handle(null);
assertEquals(Arrays.asList("zero", "one"), items);
assertEquals(1, done.get());
}
@Test
public void testReadStreamWithBackPressure() throws Exception {
TheTest test = new TheTest();
ReadStreamImpl<String> stream = new ReadStreamImpl<>();
LinkedList<String> items = new LinkedList<>();
AtomicInteger done = new AtomicInteger();
Future<Void> resume = Future.future();
test.readStreamWithBackPressure(stream, resume, items::add, v -> done.incrementAndGet());
assertNotNull(stream.dataHandler);
assertNotNull(stream.endHandler);
assertEquals(Collections.emptyList(), items);
assertEquals(0, done.get());
stream.dataHandler.handle("0");
assertEquals(Collections.singletonList("0"), items);
assertEquals(0, done.get());
stream.dataHandler.handle("1");
assertEquals(Arrays.asList("0", "1"), items);
assertEquals(0, done.get());
stream.dataHandler.handle("2");
assertEquals(Arrays.asList("0", "1", "2"), items);
assertEquals(0, done.get());
for (int i = 0;i < 10;i++) {
stream.dataHandler.handle("" + (3 + i));
assertEquals(Arrays.asList("0", "1", "2"), items);
assertEquals(0, done.get());
assertFalse(stream.paused);
}
stream.dataHandler.handle("13");
assertEquals(Arrays.asList("0", "1", "2"), items);
assertEquals(0, done.get());
assertTrue(stream.paused);
resume.complete();
assertEquals(Arrays.asList("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13"), items);
assertEquals(0, done.get());
assertFalse(stream.paused);
stream.dataHandler.handle("14");
assertEquals(Arrays.asList("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14"), items);
assertEquals(0, done.get());
assertFalse(stream.paused);
stream.endHandler.handle(null);
assertEquals(Arrays.asList("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14"), items);
assertEquals(1, done.get());
assertFalse(stream.paused);
}
class ReadStreamImpl<T> implements ReadStream<T> {
private Handler<T> dataHandler;
private Handler<Void> endHandler;
private boolean paused;
@Override
public ReadStream<T> exceptionHandler(Handler<Throwable> handler) {
return this;
}
@Override
public ReadStream<T> handler(Handler<T> handler) {
dataHandler = handler;
return this;
}
@Override
public ReadStream<T> pause() {
paused = true;
return this;
}
@Override
public ReadStream<T> resume() {
paused = false;
return this;
}
@Override
public ReadStream<T> endHandler(Handler<Void> handler) {
endHandler = handler;
return this;
}
}
}
|
[
"julien@julienviet.com"
] |
julien@julienviet.com
|
05053cb0946f8d5acd29aa9a89fc7fd44ec9aa1c
|
4dd22e45d6216df9cd3b64317f6af953f53677b7
|
/LMS/src/main/java/com/ulearning/ulms/scorm/adl/parsers/util/MessageHandler.java
|
2c0c548d87e99ec4475b81c2192fac727d42d378
|
[] |
no_license
|
tianpeijun198371/flowerpp
|
1325344032912301aaacd74327f24e45c32efa1e
|
169d3117ee844594cb84b2114e3fd165475f4231
|
refs/heads/master
| 2020-04-05T23:41:48.254793
| 2008-02-16T18:03:08
| 2008-02-16T18:03:08
| 40,278,397
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,971
|
java
|
// Source File Name: MessageHandler.java
package com.ulearning.ulms.scorm.adl.parsers.util;
import com.ulearning.ulms.scorm.adl.util.Message;
import com.ulearning.ulms.scorm.adl.util.Message;
import com.ulearning.ulms.scorm.adl.util.debug.DebugIndicator;
import java.io.FileWriter;
import java.io.PrintStream;
import java.util.Collection;
import java.util.Vector;
// Referenced classes of package com.ulearning.ulms.scorm.adl.parsers.util:
// MessageClassification
public class MessageHandler
{
private int numClassifications;
private Vector[] messageClassification;
public MessageHandler()
{
numClassifications = MessageClassification.NUM;
messageClassification = new Vector[numClassifications];
for (int i = 0; i < numClassifications; i++)
{
messageClassification[i] = new Vector(0, 5);
}
}
public void addMessage(int i, int j, String s, String s1, String s2)
{
Message message = new Message(j, s, s1, s2);
messageClassification[i].add(message);
if (DebugIndicator.ON)
{
System.out.println(message.toString());
}
}
public void addMessage(int i, int j, String s, String s1, String s2,
FileWriter filewriter)
{
logMessage(j, s, filewriter);
}
public void logMessage(int i, String s, FileWriter filewriter)
{
try
{
String s1 = "";
if (i == 0)
{
s1 = s1 +
" <img src=\"../../../images/smallinfo.gif\"> <font style=\"font-size:15px;\" color=\"blue\">";
}
else if (i == 1)
{
s1 = s1 +
" <img src=\"../../../images/smallwarning.gif\"> <font style=\"font-size:15px;\" color=\"darkorange\"> WARNING:";
}
else if (i == 2)
{
s1 = s1 +
" <img src=\"../../../images/smallcheck.gif\"> <font style=\"font-size:15px;\" color=\"green\">";
}
else if (i == 3)
{
s1 = s1 +
" <img src=\"../../../images/smallxuser.gif\"> <font style=\"font-size:15px;\" color=\"red\"> ERROR:";
}
else if (i == 4)
{
s1 = s1 +
" <img src=\"../../../images/smallstop.gif\"> <font style=\"font-size:15px;\" color=\"red\"> ERROR:";
}
else if (i == 5)
{
s1 = s1 +
" <img src=\"../../../../images/adl_tm_24x16.jpg\"> <font style=\"font-size:15px;\" color=\"purple\">";
}
else
{
s1 = s1 +
" <font style=\"font-size:15px;\" color=\"black\">";
}
s1 = s1 + " " + s + "</font>";
s1 = s1 + "<br>\n";
filewriter.write(s1);
}
catch (Exception exception)
{
}
}
public void appendMessage(int i, Collection collection)
{
messageClassification[i].addAll(collection);
}
public Vector getMessage(int i)
{
return messageClassification[i];
}
public void clearMessage(int i)
{
messageClassification[i].clear();
}
public void clearAll()
{
messageClassification[MessageClassification.SYSTEM].clear();
messageClassification[MessageClassification.WELLFORMED].clear();
messageClassification[MessageClassification.VALID].clear();
messageClassification[MessageClassification.MINIMUM].clear();
messageClassification[MessageClassification.EXTENTION].clear();
messageClassification[MessageClassification.METADATA].clear();
messageClassification[MessageClassification.CONFORMANCE].clear();
}
}
|
[
"flowerpp@aeb45441-6f43-0410-8555-aba96bfc7626"
] |
flowerpp@aeb45441-6f43-0410-8555-aba96bfc7626
|
e08b62a5a189a55e84ddc8f374253e8038dbc5be
|
90eb7a131e5b3dc79e2d1e1baeed171684ef6a22
|
/sources/p005b/p096l/p097a/p113c/p131e/p136e/C2504th.java
|
7adb37979626d95bdc1620ecdffdaf0572aa0cf8
|
[] |
no_license
|
shalviraj/greenlens
|
1c6608dca75ec204e85fba3171995628d2ee8961
|
fe9f9b5a3ef4a18f91e12d3925e09745c51bf081
|
refs/heads/main
| 2023-04-20T13:50:14.619773
| 2021-04-26T15:45:11
| 2021-04-26T15:45:11
| 361,799,768
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,300
|
java
|
package p005b.p096l.p097a.p113c.p131e.p136e;
import com.google.android.gms.common.api.Status;
import p005b.p006a.p007a.p024o.C0823f;
import p005b.p096l.p097a.p113c.p119b.p120l.p121k.C1851p;
import p005b.p096l.p180d.p185o.C3861d;
import p005b.p096l.p180d.p185o.p189e0.C3873e0;
import p005b.p096l.p180d.p185o.p189e0.C3883j0;
import p005b.p096l.p180d.p185o.p189e0.C3900y;
/* renamed from: b.l.a.c.e.e.th */
public final class C2504th extends C2091cj<Object, C3900y> {
/* renamed from: p */
public final C2572wd f4311p;
public C2504th(C3861d dVar) {
super(2);
C0823f.m380l(dVar, "credential cannot be null");
this.f4311p = new C2572wd(dVar);
}
/* renamed from: a */
public final String mo12391a() {
return "sendSignInLinkToEmail";
}
/* renamed from: b */
public final C1851p<C2040ai, Object> mo12392b() {
C1851p.C1852a a = C1851p.m2499a();
a.f3274a = new C2480sh(this);
return a.mo12158a();
}
/* renamed from: c */
public final void mo12393c() {
C3883j0 d = C2600xh.m4401d(this.f3677c, this.f3683i);
((C3900y) this.f3679e).mo15422b(this.f3682h, d);
C3873e0 e0Var = new C3873e0(d);
this.f3688n = true;
this.f3689o.mo12434a(e0Var, (Status) null);
}
}
|
[
"73280944+shalviraj@users.noreply.github.com"
] |
73280944+shalviraj@users.noreply.github.com
|
3d53e15682f3fd10464270171befd6268960f038
|
ca7da6499e839c5d12eb475abe019370d5dd557d
|
/spring-aop/src/main/java/org/springframework/aop/RawTargetAccess.java
|
8eb6521b0c90f1a1643babfe3ec83a3648ea3ef2
|
[
"Apache-2.0"
] |
permissive
|
yangfancoming/spring-5.1.x
|
19d423f96627636a01222ba747f951a0de83c7cd
|
db4c2cbcaf8ba58f43463eff865d46bdbd742064
|
refs/heads/master
| 2021-12-28T16:21:26.101946
| 2021-12-22T08:55:13
| 2021-12-22T08:55:13
| 194,103,586
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 837
|
java
|
package org.springframework.aop;
/**
* Marker for AOP proxy interfaces (in particular: introduction interfaces)
* that explicitly intend to return the raw target object (which would normally
* get replaced with the proxy object when returned from a method invocation).
*
* Note that this is a marker interface in the style of {@link java.io.Serializable},
* semantically applying to a declared interface rather than to the full class
* of a concrete object. In other words, this marker applies to a particular
* interface only (typically an introduction interface that does not serve
* as the primary interface of an AOP proxy), and hence does not affect
* other interfaces that a concrete AOP proxy may implement.
* @since 2.0.5
* @see org.springframework.aop.scope.ScopedObject
*/
public interface RawTargetAccess {
}
|
[
"34465021+jwfl724168@users.noreply.github.com"
] |
34465021+jwfl724168@users.noreply.github.com
|
827691a65127aba4fca89e9b41f46b53f9961e2d
|
20966a3c519243c9a609fb652227b53f514a530d
|
/JPA Specification/src/org/netbeans/jpa/modeler/spec/extend/JavaClass.java
|
04bb912f2aff8c52a2be0ee91237a69985d7164f
|
[
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
schnocky/JPAModeler
|
08c7d78dd4df231af573cdc2e89056c7df791b2c
|
7dd3115e84c4057e79180a7d447e5c2c95d88a49
|
refs/heads/master
| 2021-01-16T17:08:29.946011
| 2016-05-19T08:27:15
| 2016-05-19T08:27:15
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 7,934
|
java
|
/**
* Copyright [2014] Gaurav Gupta
*
* 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.netbeans.jpa.modeler.spec.extend;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import javax.lang.model.element.Modifier;
import javax.lang.model.element.TypeElement;
import javax.lang.model.type.TypeMirror;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlTransient;
import org.netbeans.jpa.modeler.spec.EntityMappings;
import org.netbeans.jpa.modeler.spec.extend.annotation.Annotation;
import org.netbeans.jpa.source.JavaSourceParserUtil;
import org.netbeans.modeler.core.NBModelerUtil;
import org.netbeans.jpa.source.JCRELoader;
import org.openide.filesystems.FileObject;
/**
*
* @author Gaurav Gupta
*/
@XmlAccessorType(XmlAccessType.FIELD)
public abstract class JavaClass extends FlowNode implements JCRELoader {
@XmlAttribute(name = "abs")
protected Boolean _abstract = false;
@XmlAttribute(name = "class", required = true)
protected String clazz;
@XmlAttribute
private String superclassId;
// @XmlElementWrapper(name = "interface-list")
@XmlElement(name = "inf")
private List<String> interfaces;
@XmlTransient
private JavaClass superclass;
@XmlTransient
private Set<JavaClass> subclassList;
@XmlAttribute
private boolean visibile = true;
private List<Annotation> annotation;
@XmlTransient
private FileObject fileObject;
@Override
public void load(EntityMappings entityMappings, TypeElement element, boolean fieldAccess) {
this.setId(NBModelerUtil.getAutoGeneratedStringId());
this.clazz = element.getSimpleName().toString();
if (element.getModifiers().contains(Modifier.ABSTRACT)) {
this.setAbstract(true);
}
for (TypeMirror mirror : element.getInterfaces()) {
if (Serializable.class.getName().equals(mirror.toString())) {
continue;
}
this.addInterface(mirror.toString());
}
this.setAnnotation(JavaSourceParserUtil.getNonEEAnnotation(element));
}
/**
* @return the annotation
*/
public List<Annotation> getAnnotation() {
if (annotation == null) {
annotation = new ArrayList<>();
}
return annotation;
}
/**
* @param annotation the annotation to set
*/
public void setAnnotation(List<Annotation> annotation) {
this.annotation = annotation;
}
public void addAnnotation(Annotation annotation_In) {
if (annotation == null) {
annotation = new ArrayList<>();
}
this.annotation.add(annotation_In);
}
public void removeAnnotation(Annotation annotation_In) {
if (annotation == null) {
annotation = new ArrayList<>();
}
this.annotation.remove(annotation_In);
}
/**
* @return the visibile
*/
public boolean isVisibile() {
return visibile;
}
/**
* @param visibile the visibile to set
*/
public void setVisibile(boolean visibile) {
this.visibile = visibile;
}
/**
* @return the superclassRef
*/
public JavaClass getSuperclass() {
return superclass;
}
/**
* @param superclassRef the superclassRef to set
*/
public void addSuperclass(JavaClass superclassRef) {
if (this.superclass == superclassRef) {
return;
}
if (this.superclass != null) {
throw new RuntimeException("JavaClass.addSuperclass > superclass is already exist [remove it first to add the new one]");
}
this.superclass = superclassRef;
if (this.superclass != null) {
this.superclassId = this.superclass.getId();
this.superclass.addSubclass(this);
} else {
throw new RuntimeException("JavaClass.addSuperclass > superclassRef is null");
}
}
public void removeSuperclass(JavaClass superclassRef) {
if (superclassRef != null) {
superclassRef.removeSubclass(this);
} else {
throw new RuntimeException("JavaClass.removeSuperclass > superclassRef is null");
}
this.superclassId = null;
this.superclass = null;
}
/**
* @return the subclassList
*/
public Set<JavaClass> getSubclassList() {
return subclassList;
}
/**
* @param subclassList the subclassList to set
*/
public void setSubclassList(Set<JavaClass> subclassList) {
if (this.subclassList == null) {
this.subclassList = new HashSet<JavaClass>();
}
this.subclassList = subclassList;
}
public void addSubclass(JavaClass subclass) {
if (this.subclassList == null) {
this.subclassList = new HashSet<JavaClass>();
}
this.subclassList.add(subclass);
}
public void removeSubclass(JavaClass subclass) {
if (this.subclassList == null) {
this.subclassList = new HashSet<JavaClass>();
}
this.subclassList.remove(subclass);
}
/**
* @return the superclassId
*/
public String getSuperclassId() {
return superclassId;
}
/**
* @return the _abstract
*/
public Boolean getAbstract() {
return _abstract;
}
/**
* @param _abstract the _abstract to set
*/
public void setAbstract(Boolean _abstract) {
this._abstract = _abstract;
}
/**
* @return the interfaces
*/
public List<String> getInterfaces() {
return interfaces;
}
/**
* @param interfaces the interfaces to set
*/
public void setInterfaces(List<String> interfaces) {
this.interfaces = interfaces;
}
public void addInterface(String _interface) {
if (this.interfaces == null) {
this.interfaces = new ArrayList<String>();
}
this.interfaces.add(_interface);
}
public void removeInterface(String _interface) {
if (this.interfaces == null) {
this.interfaces = new ArrayList<String>();
}
this.interfaces.remove(_interface);
}
/**
* Gets the value of the clazz property.
*
* @return possible object is {@link String }
*
*/
public String getClazz() {
return clazz;
}
/**
* Sets the value of the clazz property.
*
* @param value allowed object is {@link String }
*
*/
public void setClazz(String value) {
this.clazz = value;
}
/**
* @return the fileObject
*/
public FileObject getFileObject() {
return fileObject;
}
/**
* @param fileObject the fileObject to set
*/
public void setFileObject(FileObject fileObject) {
this.fileObject = fileObject;
}
}
|
[
"gaurav.gupta.jc@gmail.com"
] |
gaurav.gupta.jc@gmail.com
|
f38b379d07d5ae8f5dfb5269cc0f011b59ae266e
|
03539dfb4d2448426c9ddd8fe8813586b960cd3b
|
/groza-dao/src/main/java/com/sanshengshui/server/dao/sql/user/JpaUserCredentialsDao.java
|
c2de145759d5801af7a25be3096f84448d23de16
|
[
"Apache-2.0"
] |
permissive
|
tonyshen277/Groza
|
a7ce34ad6b361bf02ce26d85552f8b68d9d8ba2e
|
0ed5fdd7de27b6d0e546342a3615182fc23cbb8e
|
refs/heads/master
| 2020-05-02T03:21:33.061286
| 2019-05-24T03:59:16
| 2019-05-24T03:59:16
| 177,726,695
| 0
| 0
|
Apache-2.0
| 2019-05-24T03:59:17
| 2019-03-26T06:19:52
|
Java
|
UTF-8
|
Java
| false
| false
| 1,765
|
java
|
package com.sanshengshui.server.dao.sql.user;
import com.sanshengshui.server.common.data.UUIDConverter;
import com.sanshengshui.server.common.data.security.UserCredentials;
import com.sanshengshui.server.dao.DaoUtil;
import com.sanshengshui.server.dao.model.sql.UserCredentialsEntity;
import com.sanshengshui.server.dao.sql.JpaAbstractDao;
import com.sanshengshui.server.dao.user.UserCredentialsDao;
import com.sanshengshui.server.dao.util.SqlDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Component;
import java.util.UUID;
/**
* @author james mu
* @date 19-2-20 下午3:57
* @description
*/
@Component
@SqlDao
public class JpaUserCredentialsDao extends JpaAbstractDao<UserCredentialsEntity, UserCredentials> implements UserCredentialsDao {
@Autowired
private UserCredentialsRepository userCredentialsRepository;
@Override
protected Class<UserCredentialsEntity> getEntityClass() {
return UserCredentialsEntity.class;
}
@Override
protected CrudRepository<UserCredentialsEntity, String> getCrudRepository() {
return userCredentialsRepository;
}
@Override
public UserCredentials findByUserId(UUID userId) {
return DaoUtil.getData(userCredentialsRepository.findByUserId(UUIDConverter.fromTimeUUID(userId)));
}
@Override
public UserCredentials findByActivateToken(String activateToken) {
return DaoUtil.getData(userCredentialsRepository.findByActivateToken(activateToken));
}
@Override
public UserCredentials findByResetToken(String resetToken) {
return DaoUtil.getData(userCredentialsRepository.findByResetToken(resetToken));
}
}
|
[
"lovewsic@gmail.com"
] |
lovewsic@gmail.com
|
2500ad59ed5ebd63778f0f85c3dd320d8b1b693b
|
748d4c28bbd7fa682cceda01e0c401b8b5fbe58d
|
/src/synthesijer/model/State.java
|
e40e47e734a8868dbf130501f5b575084e2bb7b2
|
[] |
no_license
|
miya4649/synthesijer
|
72d83f39b713018739e8b163c9de8d5d0164b717
|
9546c060dc67869d701fd71aea63408f1a71002e
|
refs/heads/master
| 2021-01-20T16:54:52.318738
| 2015-10-01T05:25:58
| 2015-10-01T05:25:58
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,175
|
java
|
package synthesijer.model;
import java.util.ArrayList;
import synthesijer.ast.Expr;
import synthesijer.ast.statement.ExprContainStatement;
public class State {
private final int id;
private final String desc;
private final Statemachine machine;
private final boolean terminate;
private ArrayList<ExprContainStatement> body = new ArrayList<>();
private ArrayList<Transition> transitions = new ArrayList<>();
private ArrayList<State> predecesors = new ArrayList<>();
State(Statemachine m, int id, String desc, boolean terminate){
this.machine = m;
this.id = id;
this.desc = desc;
this.terminate = terminate;
}
public void addBody(ExprContainStatement s){
if(body.contains(s) == false){
body.add(s);
}
}
public ExprContainStatement[] getBodies(){
return body.toArray(new ExprContainStatement[0]);
}
public void clearTransition(){
transitions.clear();
}
public void setTransition(Transition[] t){
for(Transition t0: t){
transitions.add(t0);
}
}
private void addTransition(State s, Transition t){
transitions.add(t);
s.addPredecesors(this);
}
public void addTransition(State s){
addTransition(s, new Transition(s, null, true));
}
public void addTransition(State s, Expr cond, boolean flag){
addTransition(s, new Transition(s, cond, flag));
}
public void addTransition(State s, Expr cond, Expr pat){
addTransition(s, new Transition(s, cond, pat));
}
public void addPredecesors(State s){
predecesors.add(s);
}
public Transition[] getTransitions(){
return transitions.toArray(new Transition[0]);
}
public State[] getPredecesors(){
return predecesors.toArray(new State[0]);
}
public String getId(){
return String.format("%s_%04d", getBase(), id);
}
public String getDescription(){
return desc;
}
public String getBase(){
return machine.getKey();
}
public Statemachine getStateMachine(){
return machine;
}
public boolean isTerminate(){
return terminate;
}
public void accept(StatemachineVisitor v){
v.visitState(this);
}
public String toString(){
return String.format("State: id=%d, desc=%s, machine=%s", id, desc, machine.getKey());
}
}
|
[
"miyo@wasamon.net"
] |
miyo@wasamon.net
|
3f3f719b44baebc6caa9a811bef0827d0e3318dd
|
80bb2019f1f8cf0db2191b34ec486faff6433b0c
|
/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/NativeConfigServerIntegrationTests.java
|
b1682b3b8a75041c17931b45bfb999ced62e0da0
|
[
"LicenseRef-scancode-generic-cla",
"Apache-2.0"
] |
permissive
|
roykachouh/spring-cloud-config
|
f289a0c1a967bd3148dc978a6ef122f5257d54c4
|
2865804c5bac23b8ba0ebb973a882368b92b3f57
|
refs/heads/master
| 2021-01-18T02:22:57.834360
| 2015-02-24T22:14:56
| 2015-02-24T23:14:06
| 29,275,294
| 0
| 0
| null | 2015-01-15T01:46:07
| 2015-01-15T01:46:07
| null |
UTF-8
|
Java
| false
| false
| 2,228
|
java
|
package org.springframework.cloud.config.server;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import java.io.IOException;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.test.IntegrationTest;
import org.springframework.boot.test.SpringApplicationConfiguration;
import org.springframework.boot.test.TestRestTemplate;
import org.springframework.cloud.config.Environment;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;
@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = ConfigServerApplication.class)
@IntegrationTest({ "server.port:0", "spring.config.name:configserver" })
@WebAppConfiguration
@ActiveProfiles({ "test", "native" })
public class NativeConfigServerIntegrationTests {
@Value("${local.server.port}")
private int port;
@BeforeClass
public static void init() throws IOException{
ConfigServerTestUtils.prepareLocalRepo();
}
@Test
public void contextLoads() {
Environment environment = new TestRestTemplate().getForObject("http://localhost:" + port + "/foo/development/", Environment.class);
assertFalse(environment.getPropertySources().isEmpty());
assertEquals("overrides", environment.getPropertySources().get(0).getName());
assertEquals("{spring.cloud.config.enabled=true}", environment.getPropertySources().get(0).getSource().toString());
}
@Test
public void badYaml() {
ResponseEntity<String> response = new TestRestTemplate().getForEntity("http://localhost:"
+ port + "/bad/default/", String.class);
assertEquals(HttpStatus.INTERNAL_SERVER_ERROR, response.getStatusCode());
}
public static void main(String[] args) {
new SpringApplicationBuilder(ConfigServerApplication.class).profiles("native").properties(
"spring.config.name=configserver").run(args);
}
}
|
[
"dsyer@pivotal.io"
] |
dsyer@pivotal.io
|
8f9fa00d91a8b9656ce837c4216e7596a055b480
|
dd952805064684d85a34600beca9577a40a74423
|
/HuiHu_Android/module_home/src/main/java/com/huihu/module_home/categorydetail/entity/UserInfoBean.java
|
e189445b99f96ee1605e606a3cd4d2db31040422
|
[] |
no_license
|
zhangkangmu/huihu
|
4898375874e4c4d50414b96277568fadcac0aac8
|
ae53fae658546882d4f14febfe143bdf8456a324
|
refs/heads/master
| 2020-05-31T07:06:51.460718
| 2019-06-04T07:56:36
| 2019-06-04T07:56:36
| 190,154,356
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,363
|
java
|
package com.huihu.module_home.categorydetail.entity;
/**
* create by wangjing on 2019/4/1 0001
* description:
*/
public class UserInfoBean {
/**
* authBewrite : string
* authName : string
* follow : 0
* fxCode : string
* nickName : string
* uid : 0
* userHeadImage : string
* userHeadImg_120 : string
* userHeadImg_48 : string
* userHeadImg_80 : string
*/
private String authBewrite;
private String authName;
private int follow;
private String fxCode;
private String nickName;
private long uid;
private String userHeadImage;
private String userHeadImg_120;
private String userHeadImg_48;
private String userHeadImg_80;
public String getAuthBewrite() {
return authBewrite;
}
public void setAuthBewrite(String authBewrite) {
this.authBewrite = authBewrite;
}
public String getAuthName() {
return authName;
}
public void setAuthName(String authName) {
this.authName = authName;
}
public int getFollow() {
return follow;
}
public void setFollow(int follow) {
this.follow = follow;
}
public String getFxCode() {
return fxCode;
}
public void setFxCode(String fxCode) {
this.fxCode = fxCode;
}
public String getNickName() {
return nickName;
}
public void setNickName(String nickName) {
this.nickName = nickName;
}
public long getUid() {
return uid;
}
public void setUid(long uid) {
this.uid = uid;
}
public String getUserHeadImage() {
return userHeadImage;
}
public void setUserHeadImage(String userHeadImage) {
this.userHeadImage = userHeadImage;
}
public String getUserHeadImg_120() {
return userHeadImg_120;
}
public void setUserHeadImg_120(String userHeadImg_120) {
this.userHeadImg_120 = userHeadImg_120;
}
public String getUserHeadImg_48() {
return userHeadImg_48;
}
public void setUserHeadImg_48(String userHeadImg_48) {
this.userHeadImg_48 = userHeadImg_48;
}
public String getUserHeadImg_80() {
return userHeadImg_80;
}
public void setUserHeadImg_80(String userHeadImg_80) {
this.userHeadImg_80 = userHeadImg_80;
}
}
|
[
"289590351@qq.com"
] |
289590351@qq.com
|
e798a75a496832c0899d635fd77a428be6c18b2f
|
cf7c928d6066da1ce15d2793dcf04315dda9b9ed
|
/SW_Expert_Academy/D3/Solution_D3_1206_View.java
|
790312c79d2648a643497b48e2ef59672b7300ae
|
[] |
no_license
|
refresh6724/APS
|
a261b3da8f53de7ff5ed687f21bb1392046c98e5
|
945e0af114033d05d571011e9dbf18f2e9375166
|
refs/heads/master
| 2022-02-01T23:31:42.679631
| 2021-12-31T14:16:04
| 2021-12-31T14:16:04
| 251,617,280
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,705
|
java
|
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.Arrays;
import java.util.Collections;
import java.util.LinkedList;
import java.util.StringTokenizer;
public class Solution_D3_1206_View { // 제출일 2020-03-26 23:44
static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
static BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
static StringTokenizer st = null;
static StringBuilder sb = new StringBuilder();
static int ans, n, mid;
static LinkedList<Integer> five;
static Integer[] a;
public static void main(String[] args) throws NumberFormatException, IOException {
// int T = Integer.parseInt(br.readLine());
// int T = 10;
for (int tc = 1; tc <= 10; tc++) {
st = new StringTokenizer(br.readLine());
n = Integer.parseInt(st.nextToken());
st = new StringTokenizer(br.readLine());
ans = 0;
five = new LinkedList<Integer>();
for (int i = 0; i < 4; i++) {
five.add(Integer.parseInt(st.nextToken()));
}
// 5개의 숫자를 보고 가운데 숫자가 최고층이라면 정답에 최고층 - 두번째를 더한다
mid = 0;
a = new Integer[5];
// int[] a = new int[5];
for (int i = 4; i < n; i++) {
five.add(Integer.parseInt(st.nextToken()));
mid = five.get(2);
a = five.toArray(new Integer[5]);
// a = five.stream().mapToInt(t -> t).toArray();
Arrays.sort(a);
if(mid == a[4]) {
ans += a[4]-a[3];
}
five.poll();
}
sb.append("#" + tc + " " + ans + "\n");
}
bw.write(sb.toString());
bw.flush();
}
}
|
[
"refresh6724@gmail.com"
] |
refresh6724@gmail.com
|
68164b84a376c3b947458092443062f62fe68f6f
|
fa34634b84455bf809dbfeeee19f8fb7e26b6f76
|
/2.JavaCore/src/com/javarush/task/task14/task1413/Monitor.java
|
e06c82ddd9cf09515469f56696d7d58d897d6d95
|
[
"Apache-2.0"
] |
permissive
|
Ponser2000/JavaRushTasks
|
3b4bdd2fa82ead3c72638f0f2826db9f871038cc
|
e6eb2e8ee2eb7df77273f2f0f860f524400f72a2
|
refs/heads/main
| 2023-04-04T13:23:52.626862
| 2021-03-25T10:43:04
| 2021-03-25T10:43:04
| 322,064,721
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 174
|
java
|
package com.javarush.task.task14.task1413;
public class Monitor implements CompItem{
@java.lang.Override
public String getName() {
return "Monitor";
}
}
|
[
"ponser2000@gmail.com"
] |
ponser2000@gmail.com
|
cc8123910e6f9ca491e5f3ac478b91f9cb013a7b
|
bc0219f753da65e0eec3b5496a3569b2d2978585
|
/vault-core/src/main/java/org/apache/jackrabbit/vault/util/RejectingEntityDefaultHandler.java
|
fea9d713a34bae1419ad343901f96fb00878957f
|
[
"Apache-2.0",
"W3C"
] |
permissive
|
apache/jackrabbit-filevault
|
92d2fd9cca23714f0ecafcd702f7b0fb9de31899
|
45bb0ff67a55a7a86313fe2a1d234e1005e98801
|
refs/heads/master
| 2023-09-03T11:18:51.577677
| 2023-08-16T17:03:38
| 2023-08-29T16:24:33
| 16,021,499
| 40
| 92
|
Apache-2.0
| 2023-09-13T15:15:20
| 2014-01-18T08:00:07
|
Java
|
UTF-8
|
Java
| false
| false
| 1,764
|
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.jackrabbit.vault.util;
import java.io.IOException;
import java.io.StringReader;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;
/**
* Default handler with special entity resolver that handles all entity resolution requests by returning an empty input
* source. This is to prevent "Arbitrary DTD inclusion in XML parsing".
*/
public class RejectingEntityDefaultHandler extends DefaultHandler {
/**
* default logger
*/
private static final Logger log = LoggerFactory.getLogger(RejectingEntityDefaultHandler.class);
@Override
public InputSource resolveEntity(String publicId, String systemId) throws IOException, SAXException {
log.warn("Rejecting external entity loading with publicId={} systemId={}", publicId, systemId);
return new InputSource(new StringReader(""));
}
}
|
[
"tripod@apache.org"
] |
tripod@apache.org
|
c71288b0c4e31a7abfa3e2232e54f41da252c42b
|
38e223e8eabbe08e255f9c376366774094d5ba44
|
/app/src/main/java/com/haikuowuya/elm/http/ParamsInterceptor.java
|
87eb7f4eb2e47eead49ae66be5459748eb636cb5
|
[] |
no_license
|
cuihualibo/elm_api_test
|
2576cfde39bd989be6aa4ee87b739143e9318b38
|
347e82bf66217f2ae022f19a9ac68ebdd52b9f64
|
refs/heads/master
| 2020-03-21T10:58:41.606571
| 2019-10-30T06:25:22
| 2019-10-30T06:25:22
| 138,481,887
| 0
| 0
| null | 2019-10-30T06:25:23
| 2018-06-24T12:56:59
|
Java
|
UTF-8
|
Java
| false
| false
| 2,032
|
java
|
package com.haikuowuya.elm.http;
import com.haikuowuya.elm.utils.SoutUtils;
import java.io.IOException;
import java.util.Set;
import okhttp3.FormBody;
import okhttp3.HttpUrl;
import okhttp3.Interceptor;
import okhttp3.Request;
import okhttp3.Response;
/**
* 网络请求公共参数插入器
* <p>
*
*/
public class ParamsInterceptor implements Interceptor {
@Override
public Response intercept(Chain chain) throws IOException {
Request request = chain.request();
if (request.method().equals("GET")) {
HttpUrl httpUrl = request.url();
Set<String> names = httpUrl.queryParameterNames();
for(String name :names)
{
SoutUtils.out("name = " + name);
SoutUtils.out("value = "+ httpUrl.queryParameterValues(name).get(0));
}
httpUrl.newBuilder()
// .addQueryParameter("version", "xxx")
// .addQueryParameter("device", "Android")
// .addQueryParameter("timestamp", String.valueOf(System.currentTimeMillis()))
.build();
request = request.newBuilder().url(httpUrl).build();
} else if (request.method().equals("POST")) {
if (request.body() instanceof FormBody) {
FormBody.Builder bodyBuilder = new FormBody.Builder();
FormBody formBody = (FormBody) request.body();
for (int i = 0; i < formBody.size(); i++) {
bodyBuilder.addEncoded(formBody.encodedName(i), formBody.encodedValue(i));
}
formBody = bodyBuilder
// .addEncoded("version", "xxx")
// .addEncoded("device", "Android")
// .addEncoded("timestamp", String.valueOf(System.currentTimeMillis()))
.build();
request = request.newBuilder().post(formBody).build();
}
}
return chain.proceed(request);
}
}
|
[
"haikuowuya@gmail.com"
] |
haikuowuya@gmail.com
|
2379db2641d46e2b017c50f233b3e8851c0263d4
|
882a1a28c4ec993c1752c5d3c36642fdda3d8fad
|
/src/test/java/com/microsoft/bingads/v12/api/test/entities/adgroup/write/BulkAdGroupWriteToRowValuesUrlCustomParameters.java
|
599b9727a346737d8619b0cdc7d0261b0f53baa0
|
[
"MIT"
] |
permissive
|
BazaRoi/BingAds-Java-SDK
|
640545e3595ed4e80f5a1cd69bf23520754c4697
|
e30e5b73c01113d1c523304860180f24b37405c7
|
refs/heads/master
| 2020-07-26T08:11:14.446350
| 2019-09-10T03:25:30
| 2019-09-10T03:25:30
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,174
|
java
|
package com.microsoft.bingads.v12.api.test.entities.adgroup.write;
import java.util.Arrays;
import java.util.Collection;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameter;
import org.junit.runners.Parameterized.Parameters;
import com.microsoft.bingads.internal.functionalinterfaces.BiConsumer;
import com.microsoft.bingads.v12.api.test.entities.adgroup.BulkAdGroupTest;
import com.microsoft.bingads.v12.bulk.entities.BulkAdGroup;
import com.microsoft.bingads.v12.campaignmanagement.ArrayOfCustomParameter;
import com.microsoft.bingads.v12.campaignmanagement.CustomParameter;
import com.microsoft.bingads.v12.campaignmanagement.CustomParameters;
@RunWith(Parameterized.class)
public class BulkAdGroupWriteToRowValuesUrlCustomParameters extends BulkAdGroupTest {
@Parameter(value = 1)
public CustomParameters propertyValue;
@Parameters
public static Collection<Object[]> data() {
return Arrays.asList(new Object[][]{
{null, null},
});
}
@Test
public void testWrite() {
this.<CustomParameters>testWriteProperty("Custom Parameter", this.datum, this.propertyValue, new BiConsumer<BulkAdGroup, CustomParameters>() {
@Override
public void accept(BulkAdGroup c, CustomParameters v) {
c.getAdGroup().setUrlCustomParameters(v);;
}
});
this.datum = "delete_value";
propertyValue = new CustomParameters();
this.<CustomParameters>testWriteProperty("Custom Parameter", this.datum, this.propertyValue, new BiConsumer<BulkAdGroup, CustomParameters>() {
@Override
public void accept(BulkAdGroup c, CustomParameters v) {
c.getAdGroup().setUrlCustomParameters(v);;
}
});
this.datum = "delete_value";
propertyValue.setParameters(new ArrayOfCustomParameter());
this.<CustomParameters>testWriteProperty("Custom Parameter", this.datum, this.propertyValue, new BiConsumer<BulkAdGroup, CustomParameters>() {
@Override
public void accept(BulkAdGroup c, CustomParameters v) {
c.getAdGroup().setUrlCustomParameters(v);;
}
});
this.datum = "{_key1}=value\\;1; {_key2}=value\\\\2";
CustomParameter paraTest1 = new CustomParameter();
paraTest1.setKey("key1");
paraTest1.setValue("value;1");
CustomParameter paraTest2 = new CustomParameter();
paraTest2.setKey("key2");
paraTest2.setValue("value\\2");
ArrayOfCustomParameter array = new ArrayOfCustomParameter();
array.getCustomParameters().add(paraTest1);
array.getCustomParameters().add(paraTest2);
propertyValue = new CustomParameters();
propertyValue.setParameters(array);
this.<CustomParameters>testWriteProperty("Custom Parameter", this.datum, this.propertyValue, new BiConsumer<BulkAdGroup, CustomParameters>() {
@Override
public void accept(BulkAdGroup c, CustomParameters v) {
c.getAdGroup().setUrlCustomParameters(v);;
}
});
}
}
|
[
"qitia@microsoft.com"
] |
qitia@microsoft.com
|
92c50b5ed0292a4d8827102cf4fa73957a1fc904
|
06c69e2e123638ec147591dcdb3c46a64303e7bb
|
/ldm-ioc/src/main/java/com/oe/ioc/MainTest.java
|
c964168ef3d1b4fd5a130f6e83c8a6dd17fe396c
|
[] |
no_license
|
youngxong/ldm-ioc-parent
|
2ab7705aea06738394afff7da4bc4be08dbb7e75
|
2ab3e92abd68e17d5d7ed9eed20b6e221568540b
|
refs/heads/master
| 2022-08-01T10:32:27.125614
| 2020-03-09T14:36:33
| 2020-03-09T14:36:33
| 245,840,526
| 0
| 0
| null | 2022-06-21T02:56:46
| 2020-03-08T15:37:10
|
Java
|
UTF-8
|
Java
| false
| false
| 386
|
java
|
package com.oe.ioc;
import com.oe.ioc.aop.AopInvocation;
import com.oe.ioc.aop.AopProcessor;
import com.oe.ioc.aop.Invocation;
import com.oe.ioc.test.AopTest;
import com.oe.ioc.test.AopTestImpl;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class MainTest {
public static void main(String[] args) {
}
}
|
[
"admin@example.com"
] |
admin@example.com
|
9d6dcb84349bf3a91bd3fa2a9e020cbca4d6005e
|
34d9d1dbd41b2781f5d1839367942728ee199c2c
|
/VectorGraphics/src/org/freehep/graphicsio/PageConstants.java
|
06084eb9180c0b8b6c705f252ba68f42c48c126c
|
[] |
no_license
|
Intrinsarc/intrinsarc-evolve
|
4808c0698776252ac07bfb5ed2afddbc087d5e21
|
4492433668893500ebc78045b6be24f8b3725feb
|
refs/heads/master
| 2020-05-23T08:14:14.532184
| 2015-09-08T23:07:35
| 2015-09-08T23:07:35
| 70,294,516
| 1
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,558
|
java
|
// Copyright 2000, CERN, Geneva, Switzerland and University of Santa Cruz, California, U.S.A.
package org.freehep.graphicsio;
import java.awt.*;
import java.util.*;
/**
* This class defines a set of constants which describe a page. Convenience
* objects are provided for various margins, orientations, rescaling, and
* standard page sizes.
*
* @author Charles Loomis
* @author Mark Donszelmann
* @version $Id: PageConstants.java,v 1.1 2009-03-04 22:46:56 andrew Exp $
*/
public class PageConstants
{
private PageConstants()
{
}
// Orientation
public static final String ORIENTATION = "Orientation";
public static final String PORTRAIT = "Portrait";
public static final String LANDSCAPE = "Landscape";
public static final String BEST_FIT = "Best Fit";
public final static String[] getOrientationList()
{
return new String[]{PORTRAIT, LANDSCAPE, /* BEST_FIT */};
}
// Page Sizes
public static final String PAGE_SIZE = "PageSize";
public static final String INTERNATIONAL = "International";
public static final String A3 = "A3";
public static final String A4 = "A4";
public static final String A5 = "A5";
public static final String A6 = "A6";
public static final String LETTER = "Letter";
public static final String LEGAL = "Legal";
public static final String EXECUTIVE = "Executive";
public static final String LEDGER = "Ledger";
public static final String[] getSizeList()
{
return new String[]{INTERNATIONAL, A4, LETTER, A3, LEGAL, A5, A6, EXECUTIVE, LEDGER};
}
public static final Dimension getSize(String size)
{
return getSize(size, PORTRAIT);
}
public static final Dimension getSize(String size, String orientation)
{
Dimension d = (Dimension) sizeTable.get(size);
if (orientation.equals(PORTRAIT))
{
return d;
}
else
{
return new Dimension(d.height, d.width);
}
}
private static final Map sizeTable = new HashMap();
static
{
sizeTable.put(INTERNATIONAL, new Dimension(595, 791));
sizeTable.put(A3, new Dimension(842, 1191));
sizeTable.put(A4, new Dimension(595, 842));
sizeTable.put(A5, new Dimension(420, 595));
sizeTable.put(A6, new Dimension(298, 420));
sizeTable.put(LETTER, new Dimension(612, 791));
sizeTable.put(LEGAL, new Dimension(612, 1009));
sizeTable.put(EXECUTIVE, new Dimension(539, 720));
sizeTable.put(LEDGER, new Dimension(791, 1225));
}
// Margins
public static final String PAGE_MARGINS = "PageMargins";
public static final String SMALL = "Small";
public static final String MEDIUM = "Medium";
public static final String LARGE = "Large";
private static final Map marginTable = new HashMap();
static
{
marginTable.put(SMALL, new Insets(20, 20, 20, 20));
marginTable.put(MEDIUM, new Insets(30, 30, 30, 30));
marginTable.put(LARGE, new Insets(40, 40, 40, 40));
}
public static final Insets getMargins(String size)
{
return (Insets) marginTable.get(size);
}
public static final Insets getMargins(Insets insets, String orientation)
{
if (orientation.equals(PORTRAIT))
{
return insets;
}
else
{
// turn page to right
return new Insets(insets.left, insets.bottom, insets.right, insets.top);
}
}
// Fit
public static final String FIT_TO_PAGE = "FitToPage";
// FIXME: should move?
public static final String TRANSPARENT = "Transparent";
public static final String BACKGROUND = "Background";
public static final String BACKGROUND_COLOR = "BackgroundColor";
}
|
[
"devnull@localhost"
] |
devnull@localhost
|
2e0716e81b8fbaba62346b974983c9e4c41b6b33
|
774d36285e48bd429017b6901a59b8e3a51d6add
|
/sources/p093e/p101c/p102a/p103a/p104i/p107v/C3421b.java
|
d5de488daff1031e7e7f808c78a3b3b5ae3ddde8
|
[] |
no_license
|
jorge-luque/hb
|
83c086851a409e7e476298ffdf6ba0c8d06911db
|
b467a9af24164f7561057e5bcd19cdbc8647d2e5
|
refs/heads/master
| 2023-08-25T09:32:18.793176
| 2020-10-02T11:02:01
| 2020-10-02T11:02:01
| 300,586,541
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 983
|
java
|
package p093e.p101c.p102a.p103a.p104i.p107v;
import com.google.android.datatransport.runtime.synchronization.C3031a;
import p093e.p101c.p102a.p103a.p104i.C3400h;
import p093e.p101c.p102a.p103a.p104i.C3406l;
/* renamed from: e.c.a.a.i.v.b */
/* compiled from: com.google.android.datatransport:transport-runtime@@2.2.0 */
final /* synthetic */ class C3421b implements C3031a.C3032a {
/* renamed from: a */
private final C3422c f9513a;
/* renamed from: b */
private final C3406l f9514b;
/* renamed from: c */
private final C3400h f9515c;
private C3421b(C3422c cVar, C3406l lVar, C3400h hVar) {
this.f9513a = cVar;
this.f9514b = lVar;
this.f9515c = hVar;
}
/* renamed from: a */
public static C3031a.C3032a m11386a(C3422c cVar, C3406l lVar, C3400h hVar) {
return new C3421b(cVar, lVar, hVar);
}
public Object execute() {
return C3422c.m11387a(this.f9513a, this.f9514b, this.f9515c);
}
}
|
[
"jorge.luque@taiger.com"
] |
jorge.luque@taiger.com
|
352665ec1f88876be940c85998bcce6d11803099
|
9b4ca2847ef62227ffdb4e55fa77b2a62843ea76
|
/app/src/main/java/com/iblogstreet/mpchartdemo/entity/ICandle.java
|
f932bb6797895c106caf61ced0c1ed07bea8ac6c
|
[] |
no_license
|
sayhellotogithub/MpChartDemo
|
9b0a310aaeaed4d32016afe4c995e15bd0071a66
|
7e1b0de6833a7608920fc9f1f1d3f3d934ac7b7d
|
refs/heads/main
| 2023-02-15T06:00:44.838907
| 2021-01-05T07:21:41
| 2021-01-05T07:21:41
| 326,879,312
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,033
|
java
|
package com.iblogstreet.mpchartdemo.entity;
/**
* 蜡烛图实体接口
*/
public interface ICandle {
/**
* 开盘价
*/
float getOpenPrice();
/**
* 最高价
*/
float getHighPrice();
/**
* 最低价
*/
float getLowPrice();
/**
* 收盘价
*/
float getClosePrice();
// 以下为MA数据
/**
* 五(月,日,时,分,5分等)均价
*/
float getMA5Price();
/**
* 十(月,日,时,分,5分等)均价
*/
float getMA10Price();
/**
* 二十(月,日,时,分,5分等)均价
*/
float getMA20Price();
/**
* 三十(月,日,时,分,5分等)均价
*/
float getMA30Price();
/**
* 六十(月,日,时,分,5分等)均价
*/
float getMA60Price();
// 以下为BOLL数据
/**
* 上轨线
*/
float getUp();
/**
* 中轨线
*/
float getMb();
/**
* 下轨线
*/
float getDn();
}
|
[
"wang.jun16@163.com"
] |
wang.jun16@163.com
|
e728acd5dd19aabfba6ba3e318b5195f9d5cf9f4
|
045d58477ba23f9c909e6c68bdf62c7bdbf5e346
|
/sdk/src/main/java/org/ovirt/engine/sdk/decorators/HostKatelloErrata.java
|
ed3fef295b7cefdc25a0ef81d9cafb405e4f8ed4
|
[
"Apache-2.0"
] |
permissive
|
dennischen/ovirt-engine-sdk-java
|
091304a4a4b3008b68822e22c0a0fdafeaebdd6f
|
e9a42126e5001ec934d851ff0c8efea4bf6a436f
|
refs/heads/master
| 2021-01-14T12:58:20.224170
| 2015-06-23T11:22:10
| 2015-06-23T14:51:02
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,664
|
java
|
//
// Copyright (c) 2012 Red Hat, 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.
//
// *********************************************************************
// ********************* GENERATED CODE - DO NOT MODIFY ****************
// *********************************************************************
package org.ovirt.engine.sdk.decorators;
import java.io.IOException;
import java.util.List;
import java.util.UUID;
import org.apache.http.Header;
import org.apache.http.client.ClientProtocolException;
import org.ovirt.engine.sdk.common.CollectionDecorator;
import org.ovirt.engine.sdk.exceptions.ServerException;
import org.ovirt.engine.sdk.utils.CollectionUtils;
import org.ovirt.engine.sdk.utils.HttpHeaderBuilder;
import org.ovirt.engine.sdk.utils.HttpHeaderUtils;
import org.ovirt.engine.sdk.utils.UrlBuilder;
import org.ovirt.engine.sdk.utils.UrlBuilder;
import org.ovirt.engine.sdk.utils.UrlHelper;
import org.ovirt.engine.sdk.web.HttpProxyBroker;
import org.ovirt.engine.sdk.web.UrlParameterType;
import org.ovirt.engine.sdk.entities.Action;
/**
* <p>HostKatelloErrata providing relation and functional services
* <p>to {@link org.ovirt.engine.sdk.entities.KatelloErrata }.
*/
@SuppressWarnings("unused")
public class HostKatelloErrata extends
CollectionDecorator<org.ovirt.engine.sdk.entities.KatelloErratum,
org.ovirt.engine.sdk.entities.KatelloErrata,
HostKatelloErratum> {
private Host parent;
/**
* @param proxy HttpProxyBroker
* @param parent Host
*/
public HostKatelloErrata(HttpProxyBroker proxy, Host parent) {
super(proxy, "katelloerrata");
this.parent = parent;
}
/**
* Lists HostKatelloErratum objects.
*
* @return
* List of {@link HostKatelloErratum }
*
* @throws ClientProtocolException
* Signals that HTTP/S protocol error has occurred.
* @throws ServerException
* Signals that an oVirt api error has occurred.
* @throws IOException
* Signals that an I/O exception of some sort has occurred.
*/
@Override
public List<HostKatelloErratum> list() throws ClientProtocolException,
ServerException, IOException {
String url = this.parent.getHref() + SLASH + getName();
return list(url, org.ovirt.engine.sdk.entities.KatelloErrata.class, HostKatelloErratum.class);
}
/**
* Fetches HostKatelloErratum object by id.
*
* @return
* {@link HostKatelloErratum }
*
* @throws ClientProtocolException
* Signals that HTTP/S protocol error has occurred.
* @throws ServerException
* Signals that an oVirt api error has occurred.
* @throws IOException
* Signals that an I/O exception of some sort has occurred.
*/
@Override
public HostKatelloErratum get(UUID id) throws ClientProtocolException,
ServerException, IOException {
String url = this.parent.getHref() + SLASH + getName() + SLASH + id.toString();
return getProxy().get(url, org.ovirt.engine.sdk.entities.KatelloErratum.class, HostKatelloErratum.class);
}
/**
* Fetches HostKatelloErratum object by id.
*
* @return
* {@link HostKatelloErratum }
*
* @throws ClientProtocolException
* Signals that HTTP/S protocol error has occurred.
* @throws ServerException
* Signals that an oVirt api error has occurred.
* @throws IOException
* Signals that an I/O exception of some sort has occurred.
*/
@Override
public HostKatelloErratum getById(String id) throws ClientProtocolException,
ServerException, IOException {
String url = this.parent.getHref() + SLASH + getName() + SLASH + id;
return getProxy().get(url, org.ovirt.engine.sdk.entities.KatelloErratum.class, HostKatelloErratum.class);
}
/**
* Lists HostKatelloErratum objects.
*
* @param max
* <pre>
* [max results]
* </pre>
*
* @return List of {@link HostKatelloErratum }
*
* @throws ClientProtocolException
* Signals that HTTP/S protocol error has occurred.
* @throws ServerException
* Signals that an oVirt api error has occurred.
* @throws IOException
* Signals that an I/O exception of some sort has occurred.
*/
public List<HostKatelloErratum> list(Integer max) throws ClientProtocolException,
ServerException, IOException {
HttpHeaderBuilder headersBuilder = new HttpHeaderBuilder();
List<Header> headers = headersBuilder.build();
UrlBuilder urlBuilder = new UrlBuilder(this.parent.getHref() + SLASH + getName());
if (max != null) {
urlBuilder.add("max", max, UrlParameterType.MATRIX);
}
String url = urlBuilder.build();
return list(url, org.ovirt.engine.sdk.entities.KatelloErrata.class,
HostKatelloErratum.class, headers);
}
}
|
[
"juan.hernandez@redhat.com"
] |
juan.hernandez@redhat.com
|
7943278919e2e35d93fe63ab674d599694e62fc9
|
a7bb6b268df073b89570d096efeb0aab3e4e683d
|
/engine/src/main/java/de/matthiasmann/twl/renderer/lwjgl/LWJGLFontCache.java
|
b9a472531244e1e3f3803f7dd4ff8ca98e3e822c
|
[
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] |
permissive
|
dmitrykolesnikovich/twl
|
abf96f9d0a84b15e9d42b54804adb37ae3685162
|
39e88bc6b5338444d64424d1609f24c2be18a890
|
refs/heads/master
| 2021-07-01T03:57:07.280286
| 2017-09-22T13:12:15
| 2017-09-22T13:12:15
| 104,472,844
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,769
|
java
|
/*
* Copyright (c) 2008-2010, Matthias Mann
*
* 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 Matthias Mann 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 de.matthiasmann.twl.renderer.lwjgl;
import de.matthiasmann.twl.renderer.AnimationState;
import de.matthiasmann.twl.renderer.FontCache;
import org.lwjgl.opengl.GL11;
/**
* A font render cache - uses display lists
*
* @author Matthias Mann
*/
public class LWJGLFontCache implements FontCache {
private final LWJGLRenderer renderer;
private final LWJGLFont font;
private int id;
private int width;
private int height;
private int[] multiLineInfo;
private int numLines;
LWJGLFontCache(LWJGLRenderer renderer, LWJGLFont font) {
this.renderer = renderer;
this.font = font;
this.id = GL11.glGenLists(1);
}
public void draw(AnimationState as, int x, int y) {
if (id != 0) {
LWJGLFont.FontState fontState = font.evalFontState(as);
renderer.tintStack.setColor(fontState.color);
GL11.glPushMatrix();
GL11.glTranslatef(x + fontState.offsetX, y + fontState.offsetY, 0f);
GL11.glCallList(id);
if (fontState.style != 0) {
if (numLines > 0) {
font.drawLines(fontState, 0, 0, multiLineInfo, numLines);
} else {
font.drawLine(fontState, 0, 0, width);
}
}
GL11.glPopMatrix();
}
}
public void destroy() {
if (id != 0) {
GL11.glDeleteLists(id, 1);
id = 0;
}
}
boolean startCompile() {
if (id != 0) {
GL11.glNewList(id, GL11.GL_COMPILE);
this.numLines = 0;
return true;
}
return false;
}
void endCompile(int width, int height) {
GL11.glEndList();
this.width = width;
this.height = height;
}
int[] getMultiLineInfo(int numLines) {
if (multiLineInfo == null || multiLineInfo.length < numLines) {
multiLineInfo = new int[numLines];
}
this.numLines = numLines;
return multiLineInfo;
}
public int getHeight() {
return height;
}
public int getWidth() {
return width;
}
}
|
[
"kolesnikovichdn@gmail.com"
] |
kolesnikovichdn@gmail.com
|
c977dcff951acb343719504dcede90b24393155c
|
57147bf68f08988916dacd996fcb30a3c396b0fc
|
/src/java/security/InvalidParameterException.java
|
9b262dab99d69b57afc1f357ebcb486f20b36390
|
[] |
no_license
|
YGBM/Java_JDK_1.0_FZS
|
a268b0f015a7739993e18bab4df168b1d0a81a84
|
b2e557177fa52ef4666ad3d6a38392ce9679558d
|
refs/heads/master
| 2020-05-15T09:30:14.128294
| 2019-04-19T01:26:40
| 2019-04-19T01:26:40
| 182,178,527
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,272
|
java
|
/*
* @(#)InvalidParameterException.java 1.12 99/02/09
*
* Copyright 1995-1999 by Sun Microsystems, Inc.,
* 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
* All rights reserved.
*
* This software is the confidential and proprietary information
* of Sun Microsystems, Inc. ("Confidential Information"). You
* shall not disclose such Confidential Information and shall use
* it only in accordance with the terms of the license agreement
* you entered into with Sun.
*/
package java.security;
/**
* This exception is thrown when an invalid parameter is passed
* to a method.
*
* @author Benjamin Renaud
* @version 1.12, 99/02/09
*/
public class InvalidParameterException extends IllegalArgumentException {
/**
* Constructs an InvalidParameterException with no detail message.
* A detail message is a String that describes this particular
* exception.
*/
public InvalidParameterException() {
super();
}
/**
* Constructs an InvalidParameterException with the specified
* detail message. A detail message is a String that describes
* this particular exception.
*
* @param msg the detail message.
*/
public InvalidParameterException(String msg) {
super(msg);
}
}
|
[
"fuzusheng@gmail.com"
] |
fuzusheng@gmail.com
|
337e9faa1aa2db85372d2256c0eb879087ff8ad8
|
d4028778cc8c83d77b5b90489a90f7e0a7710815
|
/plugins/org.bflow.toolbox.oepc.diagram/src/oepc/diagram/edit/policies/ControlFlowEdgeItemSemanticEditPolicy.java
|
b24586afcf05d70a3021b81f5a0cabb8ac1bdbe1
|
[] |
no_license
|
bflowtoolbox/app
|
881a856ea055bb8466a1453e2ed3e1b23347e425
|
997baa8c73528d20603fa515e3d701334acb1be4
|
refs/heads/master
| 2021-06-01T15:19:14.222596
| 2020-06-15T18:36:49
| 2020-06-15T18:36:49
| 39,310,563
| 5
| 7
| null | 2019-02-05T16:02:49
| 2015-07-18T19:44:51
|
Java
|
UTF-8
|
Java
| false
| false
| 530
|
java
|
package oepc.diagram.edit.policies;
import org.eclipse.gef.commands.Command;
import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand;
import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
/**
* @generated
*/
public class ControlFlowEdgeItemSemanticEditPolicy extends
OepcBaseItemSemanticEditPolicy {
/**
* @generated
*/
protected Command getDestroyElementCommand(DestroyElementRequest req) {
return getGEFWrapper(new DestroyElementCommand(req));
}
}
|
[
"astorch@ee779243-7f51-0410-ad50-ee0809328dc4"
] |
astorch@ee779243-7f51-0410-ad50-ee0809328dc4
|
bc99d731af672f2cc1e1618564210bc95d36d23b
|
03225f02d331facaea10984d3b27cc2b3b953e4a
|
/app/src/main/java/com/svafvel/software/production/mynavigationdrawe/ui/slideshow/SlideshowViewModel.java
|
f7ef9f3d61e01d20862430f5b00cf9a0d189506c
|
[] |
no_license
|
roindeyal/LatihanDrawer
|
483569c724c2e810b97578ff3b7e3ed26f9028bf
|
e40dc660881ff8ae7d7952b1a35a15118a160912
|
refs/heads/master
| 2020-09-22T08:52:22.644398
| 2019-12-01T11:22:29
| 2019-12-01T11:22:29
| 225,128,874
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 492
|
java
|
package com.svafvel.software.production.mynavigationdrawe.ui.slideshow;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;
public class SlideshowViewModel extends ViewModel {
private MutableLiveData<String> mText;
public SlideshowViewModel() {
mText = new MutableLiveData<>();
mText.setValue("This is slideshow fragment");
}
public LiveData<String> getText() {
return mText;
}
}
|
[
"root@localhost.localdomain"
] |
root@localhost.localdomain
|
206950a0ae635522991f71e9dc7563a9c77adb78
|
f83cda1c30ad3ed95d171068970edbe9ae2e7cce
|
/jforgame-server/src/main/java/jforgame/server/thread/CommonMailGroup.java
|
ed2061503aaf2415a1b27532e53d456b961ba0f8
|
[
"Apache-2.0"
] |
permissive
|
flyarong/jforgame
|
d6e0f2e007cfc9b19c4184f880fe5282f14cc283
|
cd150fbd2b97cf3a43bd1e87200184fbd85ccab1
|
refs/heads/master
| 2022-11-03T21:53:46.844517
| 2022-10-20T01:21:35
| 2022-10-20T01:21:35
| 220,163,125
| 0
| 1
|
Apache-2.0
| 2022-10-20T01:21:37
| 2019-11-07T06:03:48
|
Java
|
UTF-8
|
Java
| false
| false
| 767
|
java
|
package jforgame.server.thread;
import jforgame.socket.actor.MailBox;
public class CommonMailGroup {
private String name;
private int workerSize;
private MailBox[] mailGroup;
public CommonMailGroup(String name, int workerSize) {
this.name = name;
this.workerSize = workerSize;
this.initWorkers();
}
private void initWorkers() {
mailGroup = new MailBox[workerSize];
for (int i = 0; i < workerSize; i++) {
mailGroup[i] = ThreadCenter.createBusinessMailBox(name);
}
}
/**
* 共享邮箱
* @param key
* @return
*/
public MailBox getSharedMailQueue(long key){
int index = (int) (key % workerSize);
return mailGroup[index];
}
}
|
[
"475139136@qq.com"
] |
475139136@qq.com
|
93e469f0d9fdf656fd829a19c36bc78322f67ce4
|
e3c3ede1ba0ed1262fed1e68cf10ad0fb3419c9f
|
/src/de/jungblut/classification/regression/LogisticRegressionCostFunction.java
|
e2d8aabc4438d47f9cc8978d65f2abd0416a45d3
|
[
"Apache-2.0"
] |
permissive
|
kennethxian/thomasjungblut-common
|
90e8c9cb8a45ef7d3c7d23cb41159c0ae3f6010d
|
1c6f30320890b212ded89ef894ed9445ecb1f791
|
refs/heads/master
| 2021-01-18T09:05:05.423026
| 2013-05-21T16:31:55
| 2013-05-21T16:31:55
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,258
|
java
|
package de.jungblut.classification.regression;
import static de.jungblut.math.activation.ActivationFunctionSelector.SIGMOID;
import java.util.Collections;
import de.jungblut.classification.nn.ErrorFunction;
import de.jungblut.math.DoubleMatrix;
import de.jungblut.math.DoubleVector;
import de.jungblut.math.dense.DenseDoubleMatrix;
import de.jungblut.math.dense.DenseDoubleVector;
import de.jungblut.math.minimize.CostFunction;
import de.jungblut.math.minimize.Minimizer;
import de.jungblut.math.sparse.SparseDoubleRowMatrix;
import de.jungblut.math.tuple.Tuple;
/**
* Logistic regression cost function to optimize with an arbitrary
* {@link Minimizer}.
*
* @author thomas.jungblut
*
*/
public final class LogisticRegressionCostFunction implements CostFunction {
private static final ErrorFunction ERROR_FUNCTION = ErrorFunction.SIGMOID_ERROR;
private final DoubleMatrix x;
private final DenseDoubleMatrix y;
private final double lambda;
private final int m;
private DenseDoubleMatrix eye;
public LogisticRegressionCostFunction(DoubleMatrix x, DoubleVector y,
double lambda) {
if (!x.isSparse()) {
// add a column of ones to handle the intercept term
this.x = new DenseDoubleMatrix(DenseDoubleVector.ones(y.getLength()), x);
} else {
this.x = new SparseDoubleRowMatrix(DenseDoubleVector.ones(y.getLength()),
x);
}
this.y = new DenseDoubleMatrix(Collections.singletonList(y));
this.lambda = lambda;
this.m = y.getLength();
eye = DenseDoubleMatrix.eye(x.getColumnCount() + 1);
eye.set(0, 0, 0.0d);
}
@Override
public Tuple<Double, DoubleVector> evaluateCost(DoubleVector input) {
double reg = input.slice(1, input.getLength()).pow(2).sum() * lambda
/ (2.0d * m);
DenseDoubleMatrix hypo = new DenseDoubleMatrix(
Collections.singletonList(SIGMOID.get().apply(x.multiplyVector(input))));
double sum = ERROR_FUNCTION.getError(y, hypo);
double j = (1.0d / m) * sum + reg;
DoubleVector regGradient = eye.multiply(lambda).multiplyVector(input);
DoubleVector gradient = x.transpose()
.multiplyVector(hypo.subtract(y).getRowVector(0)).add(regGradient)
.divide(m);
return new Tuple<>(j, gradient);
}
}
|
[
"thomas.jungblut@gmail.com"
] |
thomas.jungblut@gmail.com
|
48fc4033240c1ebcfc29b6bd80cd090bf6e76120
|
e8f4d3d48a1925b515d509902232108a3439d5a0
|
/snz/snz-eai-api/src/main/java/com/haier/QuerySupplierBalanceFromGVS/QuerySupplierBalanceFromGVS.java
|
e80d00ecbda7f0a19df8475fa69e6f3725377193
|
[] |
no_license
|
palmelf/test-snz
|
bfd7b6ea3bc9e5cfda8e4434e9bcb69674719748
|
6d6914863b539753f466025aefc2b579c7263f63
|
refs/heads/master
| 2021-01-22T10:36:43.453850
| 2016-04-09T08:23:36
| 2016-04-09T08:23:36
| 33,541,041
| 0
| 0
| null | 2015-04-07T12:13:30
| 2015-04-07T12:13:29
| null |
UTF-8
|
Java
| false
| false
| 1,608
|
java
|
package com.haier.QuerySupplierBalanceFromGVS;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebResult;
import javax.jws.WebService;
import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.ws.RequestWrapper;
import javax.xml.ws.ResponseWrapper;
import java.util.List;
/**
* This class was generated by the JAX-WS RI.
* JAX-WS RI 2.1.6 in JDK 6
* Generated source version: 2.1
*
*/
@WebService(name = "QuerySupplierBalanceFromGVS", targetNamespace = "http://www.example.org/QuerySupplierBalanceFromGVS/")
@XmlSeeAlso({
ObjectFactory.class
})
public interface QuerySupplierBalanceFromGVS {
/**
*
* @param input
* @return
* returns java.util.List<com.haier.QuerySupplierBalanceFromGVS.ZFIINTLIFNRYEOUT>
*/
@WebMethod(operationName = "QuerySupplierBalanceFromGVS", action = "http://www.example.org/QuerySupplierBalanceFromGVS/QuerySupplierBalanceFromGVS")
@WebResult(name = "OUTPUT", targetNamespace = "")
@RequestWrapper(localName = "QuerySupplierBalanceFromGVS", targetNamespace = "http://www.example.org/QuerySupplierBalanceFromGVS/", className = "com.haier.QuerySupplierBalanceFromGVS.QuerySupplierBalanceFromGVS_Type")
@ResponseWrapper(localName = "QuerySupplierBalanceFromGVSResponse", targetNamespace = "http://www.example.org/QuerySupplierBalanceFromGVS/", className = "com.haier.QuerySupplierBalanceFromGVS.QuerySupplierBalanceFromGVSResponse")
public List<ZFIINTLIFNRYEOUT> querySupplierBalanceFromGVS(
@WebParam(name = "INPUT", targetNamespace = "")
List<ZFIINTLIFNRYEIN> input);
}
|
[
"yangzhiliang1018@gmail.com"
] |
yangzhiliang1018@gmail.com
|
13d0672dce92800fa5c5d7e765cb48564a432f56
|
8af1164bac943cef64e41bae312223c3c0e38114
|
/results-java/mikepenz--MaterialDrawer/7b3b9d3f51f79bcab26cd23e42fa065f72a85a75/before/StringHolder.java
|
d585c0903f387c5bfcac82f582ab256886f26bcf
|
[] |
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,781
|
java
|
package com.mikepenz.materialdrawer.holder;
import android.content.Context;
import android.view.View;
import android.widget.TextView;
/**
* Created by mikepenz on 13.07.15.
*/
public class StringHolder {
private String mText;
private int mTextRes = -1;
public StringHolder(String text) {
this.mText = text;
}
public StringHolder(int textRes) {
this.mTextRes = textRes;
}
public void applyTo(TextView textView) {
if (mText != null) {
textView.setText(mText);
} else if (mTextRes != -1) {
textView.setText(mTextRes);
} else {
textView.setText("");
}
}
public void applyToOrHide(TextView textView) {
if (mText != null) {
textView.setText(mText);
textView.setVisibility(View.VISIBLE);
} else if (mTextRes != -1) {
textView.setText(mTextRes);
textView.setVisibility(View.VISIBLE);
} else {
textView.setVisibility(View.GONE);
}
}
public String getText(Context ctx) {
if (mText != null) {
return mText;
} else if (mTextRes != -1) {
return ctx.getString(mTextRes);
}
return null;
}
public static void applyTo(StringHolder text, TextView textView) {
if (text != null && textView != null) {
text.applyTo(textView);
}
}
public static void applyToOrHide(StringHolder text, TextView textView) {
if (text != null && textView != null) {
text.applyToOrHide(textView);
} else if (textView != null) {
textView.setVisibility(View.GONE);
}
}
@Override
public String toString() {
return mText;
}
}
|
[
"fraczwojciech@gmail.com"
] |
fraczwojciech@gmail.com
|
a58f5bbbd53345e9cd73b6e54bdc48a219ff2d27
|
13ea5da0b7b8d4ba87d622a5f733dcf6b4c5f1e3
|
/crash-reproduction-new-fitness/results/MATH-81b-4-30-Single_Objective_GGA-WeightedSum-BasicBlockCoverage-opt/org/apache/commons/math/linear/EigenDecompositionImpl_ESTest.java
|
5f4fe33645ee5b7112333c2ef246289660df50e5
|
[
"MIT",
"CC-BY-4.0"
] |
permissive
|
STAMP-project/Botsing-basic-block-coverage-application
|
6c1095c6be945adc0be2b63bbec44f0014972793
|
80ea9e7a740bf4b1f9d2d06fe3dcc72323b848da
|
refs/heads/master
| 2022-07-28T23:05:55.253779
| 2022-04-20T13:54:11
| 2022-04-20T13:54:11
| 285,771,370
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,277
|
java
|
/*
* This file was automatically generated by EvoSuite
* Tue Oct 26 09:12:38 UTC 2021
*/
package org.apache.commons.math.linear;
import org.junit.Test;
import static org.junit.Assert.*;
import static org.evosuite.runtime.EvoAssertions.*;
import org.apache.commons.math.linear.EigenDecompositionImpl;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.junit.runner.RunWith;
@RunWith(EvoRunner.class) @EvoRunnerParameters(useVFS = true, useJEE = true)
public class EigenDecompositionImpl_ESTest extends EigenDecompositionImpl_ESTest_scaffolding {
@Test(timeout = 4000)
public void test0() throws Throwable {
double[] doubleArray0 = new double[9];
doubleArray0[0] = (-12.558547230009951);
double double0 = 1293.2698;
double[] doubleArray1 = new double[8];
doubleArray1[0] = (-12.558547230009951);
doubleArray1[1] = 1300.3724385613882;
doubleArray1[2] = (-2212.4714725929);
doubleArray1[4] = 1300.3724385613882;
doubleArray1[5] = 1300.3724385613882;
doubleArray1[6] = (-531.0895530460017);
doubleArray1[7] = (-12.558547230009951);
EigenDecompositionImpl eigenDecompositionImpl0 = new EigenDecompositionImpl(doubleArray0, doubleArray1, 0.0);
}
}
|
[
"pderakhshanfar@serg2.ewi.tudelft.nl"
] |
pderakhshanfar@serg2.ewi.tudelft.nl
|
35eb1fd41d6b6def0c231d034c6b74de9a86cc7c
|
569007d9fc5eef66f5a8c6a4b1b90576ab96dd8c
|
/2016-september/17.file-problems/src/com/alg/top20/file/UrlFiltering.java
|
7cd255723545228cae67b96c52c87044e5a17490
|
[] |
no_license
|
SUDHARSHAN99/top20
|
917683dcf49d2e5394eaf07fbd67afac6a7cd780
|
4ff0f28d650a7c212bd9a606a673c6af618a532b
|
refs/heads/master
| 2020-05-04T04:44:27.590605
| 2019-03-30T02:16:40
| 2019-03-30T02:16:40
| 178,972,411
| 1
| 0
| null | 2019-04-02T01:07:05
| 2019-04-02T01:07:05
| null |
UTF-8
|
Java
| false
| false
| 1,582
|
java
|
package com.alg.top20.file;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.HashSet;
import java.util.Random;
import java.util.Scanner;
import java.util.UUID;
public class UrlFiltering {
private static HashSet<String> unsafe_url_set = new HashSet<String>();
public static boolean isUrlUnSafe1(String url, String file)
throws Exception {
BufferedReader br = new BufferedReader(new FileReader(file));
String unsafeurl;
while ((unsafeurl = br.readLine()) != null) {
if (url.equals(unsafeurl.trim().toLowerCase()))
return true;
}
return false;
}
public static void init(String file) throws Exception {
BufferedReader br = new BufferedReader(new FileReader(file));
String unsafeurl;
while ((unsafeurl = br.readLine()) != null) {
unsafe_url_set.add(unsafeurl.trim().toLowerCase());
}
}
public static boolean isUrlUnSafe2(String url) {
return unsafe_url_set.contains(url);
}
public static void createRandomFile(String infile, long n) throws Exception {
BufferedWriter bw = new BufferedWriter(new FileWriter(infile));
for (long i = 0; i < n; ++i) {
bw.write("www." + UUID.randomUUID() + ".com");
bw.newLine();
}
bw.close();
}
public static void main(String[] args) throws Exception {
// createRandomFile("D:/chrome/unsafe.txt", Integer.parseInt(args[0]));
init("D:/chrome/unsafe.txt");
while (true) {
Scanner scanner = new Scanner(System.in);
String url = scanner.nextLine();
System.out.println(isUrlUnSafe2(url));
}
}
}
|
[
"info@algorithmica.co.in"
] |
info@algorithmica.co.in
|
d8c8ac72730cc439faeaa663cc761ae4709985d4
|
4b9966401f9ed4af1179658c8bed4da4e97875cc
|
/app/src/main/java/com/example/administrator/koudaiwanzi/classification/type/screen/ClassAdapter.java
|
e712d28a3469a2ecfe82960dc72ac50079fc132b
|
[] |
no_license
|
liu66104/koudaiwanzime
|
37cb2593036513277ac7de9ea207d0264cee17e3
|
363a2aa1ae38a6c14bab1487014570c2a695185f
|
refs/heads/master
| 2020-12-03T09:29:41.892422
| 2017-06-27T09:00:26
| 2017-06-27T09:00:26
| 95,625,253
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,524
|
java
|
package com.example.administrator.koudaiwanzi.classification.type.screen;
import android.content.Context;
import android.graphics.Paint;
import android.net.Uri;
import android.os.Handler;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import com.example.administrator.koudaiwanzi.R;
import com.example.administrator.koudaiwanzi.base.MyUrl;
import com.facebook.drawee.backends.pipeline.Fresco;
import com.facebook.drawee.interfaces.DraweeController;
import com.facebook.drawee.view.SimpleDraweeView;
import com.facebook.imagepipeline.common.ResizeOptions;
import com.facebook.imagepipeline.request.ImageRequest;
import com.facebook.imagepipeline.request.ImageRequestBuilder;
import org.xutils.common.util.DensityUtil;
import org.xutils.image.ImageOptions;
import org.xutils.x;
import java.util.List;
/**
* Created by Administrator on 2016/6/25.
*/
public class ClassAdapter extends BaseAdapter{
private String imgUrl = MyUrl.url;
// private List<String> inits;
private List<ProductBean.DITEMSBean> data;
private Context context;
private Handler handler;
public ClassAdapter(Context context, Handler handler) {
this.context = context;
this.handler = handler;
}
public void addData(List<ProductBean.DITEMSBean> data) {
this.data = data;
notifyDataSetChanged();
}
@Override
public int getCount() {
return data.size();
}
@Override
public Object getItem(int position) {
return data.get(position);
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(final int position, View convertView, ViewGroup parent) {
MyViewHolder myViewHolder = null;
if (convertView == null) {
myViewHolder = new MyViewHolder();
convertView = LayoutInflater.from(context).inflate(R.layout.show_item_two, null);
myViewHolder.tv_name = (TextView) convertView.findViewById(R.id.show2_item_tv1);
myViewHolder.iv_topPicture = (SimpleDraweeView) convertView.findViewById(R.id.show2_item_iv1);
myViewHolder.tv_nowPrice = (TextView) convertView.findViewById(R.id.show2_item_newprice1);
myViewHolder.tv_oldPrice = (TextView) convertView.findViewById(R.id.tv_price_old);
myViewHolder.iv_shop = (ImageView) convertView.findViewById(R.id.iv_shop_class);
myViewHolder.tv_ISOUTSTOCK = (TextView) convertView.findViewById(R.id.tv_show_two_ISOUTSTOCK);
convertView.setTag(myViewHolder);
} else {
myViewHolder = (MyViewHolder) convertView.getTag();
}
if (data.get(position).getDISCOUNT() == 0){
myViewHolder.tv_oldPrice.setVisibility(View.INVISIBLE);
myViewHolder.tv_nowPrice.setText("¥" + data.get(position).getPRICE()+"");
}else {
myViewHolder.tv_oldPrice.setVisibility(View.VISIBLE);
myViewHolder.tv_nowPrice.setText("¥" + data.get(position).getBARGAIN()+"");
myViewHolder.tv_oldPrice.setText("¥" + data.get(position).getPRICE()+"");
//给textView中间加横线
myViewHolder.tv_oldPrice.getPaint().setFlags(Paint.STRIKE_THRU_TEXT_FLAG);
}
if (data.get(position).getISOUTSTOCK() == 0){
myViewHolder.tv_ISOUTSTOCK.setVisibility(View.GONE);
}else {
myViewHolder.tv_ISOUTSTOCK.setVisibility(View.VISIBLE);
}
myViewHolder.tv_name.setText(data.get(position).getTRADENAME());
// ImageOptions options = new ImageOptions.Builder()
// //图片大小
// .setSize(DensityUtil.dip2px(200), DensityUtil.dip2px(150))
// // 是否忽略GIF格式的图片
// .setIgnoreGif(false)
// // 图片缩放模式
// .setImageScaleType(ImageView.ScaleType.CENTER_CROP)
// // 得到ImageOptions对象
// .build();
//
// x.image().bind(myViewHolder.iv_topPicture, MyUrl.url+data.get(position).getICOURL(), options);
//FRESCO缓存图片
Uri imageUri = Uri.parse(imgUrl + data.get(position).getICOURL());
ImageRequest request = ImageRequestBuilder.newBuilderWithSource(imageUri)
.setResizeOptions(new ResizeOptions(200, 200))
.build();
DraweeController controller = Fresco.newDraweeControllerBuilder()
.setOldController(myViewHolder.iv_topPicture.getController())
.setImageRequest(request)
.build();
myViewHolder.iv_topPicture.setController(controller);
myViewHolder.iv_shop.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (data.get(position).getISOUTSTOCK() == 0){
handler.sendMessage(handler.obtainMessage(28, data.get(position).getDetailUrl()));
}else {
Toast.makeText(context, "商品缺货", Toast.LENGTH_SHORT).show();
}
}
});
return convertView;
}
class MyViewHolder {
private TextView tv_name,tv_nowPrice,tv_oldPrice,tv_ISOUTSTOCK;
private ImageView iv_shop;
private SimpleDraweeView iv_topPicture;
}
}
|
[
"695335338@qq.com"
] |
695335338@qq.com
|
2c1ba82bd406637875848d0963c659057289acf4
|
cb30f68e27b226b9d6dccd36d373fe45db18b0d9
|
/ais2/src/com/xbwl/test/common/SpringContextHolderTest.java
|
5654f2a0546ac049209c7ebb3cd53830e20b8ce6
|
[] |
no_license
|
czltx224/ais2
|
81ab0b92073ae7fa22923c7be104446b4c39cc23
|
348e5f8d8aee735b2fe9a3d81d1d73ab02672675
|
refs/heads/master
| 2021-01-10T12:42:10.015359
| 2016-01-07T01:32:57
| 2016-01-07T01:32:57
| 49,176,839
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,395
|
java
|
package com.xbwl.test.common;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.fail;
import org.junit.Test;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.util.ReflectionUtils;
import com.xbwl.common.utils.SpringContextHolder;
public class SpringContextHolderTest {
@Test
public void testGetBean() {
SpringContextHolder.clear();
try {
SpringContextHolder.getBean("foo");
fail("No exception throw for applicationContxt hadn't been init.");
} catch (IllegalStateException e) {
}
ConfigurableApplicationContext context = new ClassPathXmlApplicationContext(
"classpath:/applicationContext.xml");
assertNotNull(SpringContextHolder.getApplicationContext());
SpringContextHolder holderByName = SpringContextHolder.getBean("springContextHolder");
assertEquals(SpringContextHolder.class, holderByName.getClass());
SpringContextHolder holderByClass = SpringContextHolder.getBean(SpringContextHolder.class);
assertEquals(SpringContextHolder.class, holderByClass.getClass());
context.close();
// assertNull(ReflectionUtils.getFieldValue(holderByName, "applicationContext"));
}
}
|
[
"czltx224@163.com"
] |
czltx224@163.com
|
30c97fb372b8890065f4f88763cd526381dc3555
|
a78e998b0cb3c096a6d904982bb449da4003ff8b
|
/app/src/main/java/com/alipay/api/domain/ButtonObject.java
|
c1bb38dbd9113110972e85fe78ff8e303be963a4
|
[
"Apache-2.0"
] |
permissive
|
Zhengfating/F2FDemo
|
4b85b598989376b3794eefb228dfda48502ca1b2
|
8654411f4269472e727e2230e768051162a6b672
|
refs/heads/master
| 2020-05-03T08:30:29.641080
| 2019-03-30T07:50:30
| 2019-03-30T07:50:30
| 178,528,073
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,479
|
java
|
package com.alipay.api.domain;
import java.util.List;
import com.alipay.api.AlipayObject;
import com.alipay.api.internal.mapping.ApiField;
import com.alipay.api.internal.mapping.ApiListField;
/**
* 菜单对象模型
*
* @author auto create
* @since 1.0, 2017-10-31 19:50:53
*/
public class ButtonObject extends AlipayObject {
private static final long serialVersionUID = 3811752149199291823L;
/**
* 当actionType为link时,该参数为url链接;
当actionType为out时,该参数为用户自定义参数;
当actionType为tel时,该参数为电话号码。
当action_type为map时,该参数为查看地图的关键字。
当action_type为consumption时,该参数可不传。
该参数最长255个字符,不允许冒号等特殊字符。
*/
@ApiField("action_param")
private String actionParam;
/**
* 菜单类型:
out——事件型菜单;
link——链接型菜单;
tel——点击拨打电话;
map——点击查看地图;
consumption——点击查看用户与生活号管理员账号之间的消费记录
*/
@ApiField("action_type")
private String actionType;
/**
* icon图片url,必须是http协议的url,尺寸为60X60,最大不超过5M,请先调用<a href="https://docs.open.alipay.com/api_3/alipay.offline.material.image.upload"> 图片上传接口</a>获得图片url
*/
@ApiField("icon")
private String icon;
/**
* 菜单名称,icon菜单名称不超过5个汉字,文本菜单名称不超过9个汉字,编码格式为GBK
*/
@ApiField("name")
private String name;
/**
* 二级菜单数组,若sub_button为空,则一级菜单必须指定action_type和action_param的值,二级菜单个数可以为1~5个。
*/
@ApiListField("sub_button")
@ApiField("sub_button")
private List<SubButton> subButton;
public String getActionParam() {
return this.actionParam;
}
public void setActionParam(String actionParam) {
this.actionParam = actionParam;
}
public String getActionType() {
return this.actionType;
}
public void setActionType(String actionType) {
this.actionType = actionType;
}
public String getIcon() {
return this.icon;
}
public void setIcon(String icon) {
this.icon = icon;
}
public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
}
public List<SubButton> getSubButton() {
return this.subButton;
}
public void setSubButton(List<SubButton> subButton) {
this.subButton = subButton;
}
}
|
[
"452139060@qq.com"
] |
452139060@qq.com
|
b18e961e807362e8ce08b90dd9bf2570b47fb76e
|
091c6d40da2150206c70f665b3c9552e2a23bcc5
|
/modules/dom/document/impl/src/test/java/org/incode/example/document/dom/impl/docs/Document_Test.java
|
7a091facbcb2f998ee7dcd3e25d5df4cba3b113e
|
[
"Apache-2.0"
] |
permissive
|
marcusvb/incode-platform
|
6071c03f7bccfaa40d634d7d92f353f85744f13f
|
3dcaa10bf91257de2c6b762b77283f962ed8cd0c
|
refs/heads/master
| 2021-05-04T13:48:21.423279
| 2018-02-08T17:36:22
| 2018-02-08T17:36:22
| 120,320,959
| 2
| 0
| null | 2018-02-05T15:11:16
| 2018-02-05T15:11:16
| null |
UTF-8
|
Java
| false
| false
| 2,203
|
java
|
package org.incode.example.document.dom.impl.docs;
import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.apache.isis.core.unittestsupport.jmocking.JUnitRuleMockery2;
import org.incode.example.document.dom.impl.types.DocumentType;
import org.incode.example.document.dom.impl.types.DocumentTypeForTesting;
import org.incode.module.unittestsupport.dom.bean.AbstractBeanPropertiesTest;
import org.incode.module.unittestsupport.dom.bean.FixtureDatumFactoriesForJoda;
public class Document_Test {
@Rule
public JUnitRuleMockery2 context = JUnitRuleMockery2.createFor(JUnitRuleMockery2.Mode.INTERFACES_AND_CLASSES);
public static class BeanProperties extends AbstractBeanPropertiesTest {
@Test
public void test() {
newPojoTester()
.withFixture(FixtureDatumFactoriesForJoda.dateTimes())
.withFixture(pojos(DocumentType.class, DocumentTypeForTesting.class))
.exercise(new Document());
}
}
public static class Constructor_Test extends Document_Test {
@Ignore
@Test
public void happy_case() throws Exception {
}
}
public static class Render_Test extends Document_Test {
@Ignore
@Test
public void happy_case() throws Exception {
}
}
public static class Blob_Test extends Document_Test {
@Ignore
@Test
public void set_happy_case() throws Exception {
}
}
public static class Clob_Test extends Document_Test {
@Ignore
@Test
public void set_happy_case() throws Exception {
}
}
public static class ExternalUrl_Test extends Document_Test {
@Ignore
@Test
public void hidden_if_sort_is_not_external() throws Exception {
}
}
public static class AsChars_Test extends Document_Test {
@Ignore
@Test
public void happy_case() throws Exception {
}
}
public static class AsBytes_Test extends Document_Test {
@Ignore
@Test
public void happy_case() throws Exception {
}
}
}
|
[
"dan@haywood-associates.co.uk"
] |
dan@haywood-associates.co.uk
|
2e45627c750aa856aeebc70e0bd39df864ce464a
|
9d9b26fee5298a6119ddb5d02614ba6cbf3e4548
|
/src/Jul/Random1.java
|
bc62c1d9865dfb14a1c8eef6808e4d1fb5d2aa91
|
[] |
no_license
|
Orlando-Houston/JavaBoothCamp2020
|
7ec2bae32bb28ce7b922093a8eb5014d55b2285c
|
493fb81ca749de1cfc841868ce598a29ba1cf01b
|
refs/heads/master
| 2023-04-09T08:04:28.104305
| 2021-04-24T18:05:28
| 2021-04-24T18:05:28
| 343,461,121
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,360
|
java
|
package Jul;
public class Random1 {
public static void main(String[] args) {
for (int i=0;i<20;i++){
System.out.print( 25 +(int)(Math.random()*72)+"\t");
/*
// o-100 arasi 10 adet rastgele sayi uretmek
for (int i=0;i<10;i++){
System.out.print((int) (Math.random()*30)+"\t");
*/
/*
for (int i=0;i<10;i++){
SubjectHeadings.Random rnd=new SubjectHeadings.Random();
System.out.println(rnd.nextInt(100)+"\t");
*/
/*
//12 den basla 65 e kadar.dongu 20 defa
for (int i=0;i<20;i++){
SubjectHeadings.Random rnd= new SubjectHeadings.Random();
System.out.print(12+(int)(Math.random()*53)+"\t");
*/
/*
// 0 ile 100 arasinda random 20 sayidan uretilen sayidan cift alanlarini ekrana yazdiran program
for (int i=0;i<20;i++){
int a=(int)(Math.random()*100);
if (a%2==0){
System.out.print(a+"\t");
*/
//15 70 arasi ...13 sayidan 10 ile 60 arasindaki tek sayilari yazdiran program yaziniz
/*
for (int i=0;i<13;i++){
int a=(15+(int)(Math.random()*60));
if (a>15&& a<60 &&a%2==1){
System.out.print(a+"\t");
*/
}
}
}
|
[
"a.ozder@outlook.com"
] |
a.ozder@outlook.com
|
1908604a76f7c0e55afa8dc9767835fbdc9b6647
|
3d4013838223941bd2e134385931ebeb2afcfb73
|
/src/main/java/org/matrixchain/crypto/jce/ECKeyAgreement.java
|
324a66ed227805db1f1f679932228bda0a42059e
|
[] |
no_license
|
matrixchainos/matrixchain
|
a16498111de2d9bbe6959471f5fadcc21eac16eb
|
47605dbac0b673f2f688747a6cf513b7de812aca
|
refs/heads/master
| 2020-04-09T05:13:49.136132
| 2020-01-19T12:33:02
| 2020-01-19T12:33:02
| 160,056,535
| 2
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,137
|
java
|
/*
* Copyright (c) [2016] [ <ether.camp> ]
* This file is part of the ethereumJ library.
*
* The ethereumJ library is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* The ethereumJ library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with the ethereumJ library. If not, see <http://www.gnu.org/licenses/>.
*/
package org.matrixchain.crypto.jce;
import javax.crypto.KeyAgreement;
import java.security.NoSuchAlgorithmException;
import java.security.NoSuchProviderException;
import java.security.Provider;
public final class ECKeyAgreement {
public static final String ALGORITHM = "ECDH";
private static final String algorithmAssertionMsg =
"Assumed the JRE supports EC key agreement";
private ECKeyAgreement() {
}
public static KeyAgreement getInstance() {
try {
return KeyAgreement.getInstance(ALGORITHM);
} catch (NoSuchAlgorithmException ex) {
throw new AssertionError(algorithmAssertionMsg, ex);
}
}
public static KeyAgreement getInstance(final String provider) throws
NoSuchProviderException {
try {
return KeyAgreement.getInstance(ALGORITHM, provider);
} catch (NoSuchAlgorithmException ex) {
throw new AssertionError(algorithmAssertionMsg, ex);
}
}
public static KeyAgreement getInstance(final Provider provider) {
try {
return KeyAgreement.getInstance(ALGORITHM, provider);
} catch (NoSuchAlgorithmException ex) {
throw new AssertionError(algorithmAssertionMsg, ex);
}
}
}
|
[
"kayfhan@sina.com"
] |
kayfhan@sina.com
|
e90ccb65221c5c46c646ef2bc0a4bbd088c6719e
|
0af8b92686a58eb0b64e319b22411432aca7a8f3
|
/large-multiproject/project15/src/test/java/org/gradle/test/performance15_1/Test15_20.java
|
2cdec79e9fcf29e579a3198dd0ff8859b1092f0f
|
[] |
no_license
|
gradle/performance-comparisons
|
b0d38db37c326e0ce271abebdb3c91769b860799
|
e53dc7182fafcf9fedf07920cbbea8b40ee4eef4
|
refs/heads/master
| 2023-08-14T19:24:39.164276
| 2022-11-24T05:18:33
| 2022-11-24T05:18:33
| 80,121,268
| 17
| 15
| null | 2022-09-30T08:04:35
| 2017-01-26T14:25:33
| null |
UTF-8
|
Java
| false
| false
| 289
|
java
|
package org.gradle.test.performance15_1;
import static org.junit.Assert.*;
public class Test15_20 {
private final Production15_20 production = new Production15_20("value");
@org.junit.Test
public void test() {
assertEquals(production.getProperty(), "value");
}
}
|
[
"cedric.champeau@gmail.com"
] |
cedric.champeau@gmail.com
|
64bac25b6f35c7a9a510cddfbdeb449a93a8e150
|
ff060793eb77701587bf1b7ba9f25ed49a2ba359
|
/aws-java-sdk-config/src/main/java/com/amazonaws/services/config/model/transform/DescribeRetentionConfigurationsResultJsonUnmarshaller.java
|
857f09fc79b0efda3c1965f154c0a1c668746330
|
[
"Apache-2.0"
] |
permissive
|
qp3research/aws-sdk-java
|
39e8123d37a39b3931f4737830141bfba76dc220
|
a188c3865685cacbd5c73bae66ad7be0b185af48
|
refs/heads/master
| 2021-10-15T07:00:40.638759
| 2019-02-05T09:03:59
| 2019-02-05T09:03:59
| 169,162,468
| 0
| 0
|
Apache-2.0
| 2019-02-04T22:53:19
| 2019-02-04T22:53:19
| null |
UTF-8
|
Java
| false
| false
| 3,413
|
java
|
/*
* Copyright 2013-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.config.model.transform;
import java.math.*;
import javax.annotation.Generated;
import com.amazonaws.services.config.model.*;
import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*;
import com.amazonaws.transform.*;
import com.fasterxml.jackson.core.JsonToken;
import static com.fasterxml.jackson.core.JsonToken.*;
/**
* DescribeRetentionConfigurationsResult JSON Unmarshaller
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class DescribeRetentionConfigurationsResultJsonUnmarshaller implements Unmarshaller<DescribeRetentionConfigurationsResult, JsonUnmarshallerContext> {
public DescribeRetentionConfigurationsResult unmarshall(JsonUnmarshallerContext context) throws Exception {
DescribeRetentionConfigurationsResult describeRetentionConfigurationsResult = new DescribeRetentionConfigurationsResult();
int originalDepth = context.getCurrentDepth();
String currentParentElement = context.getCurrentParentElement();
int targetDepth = originalDepth + 1;
JsonToken token = context.getCurrentToken();
if (token == null)
token = context.nextToken();
if (token == VALUE_NULL) {
return describeRetentionConfigurationsResult;
}
while (true) {
if (token == null)
break;
if (token == FIELD_NAME || token == START_OBJECT) {
if (context.testExpression("RetentionConfigurations", targetDepth)) {
context.nextToken();
describeRetentionConfigurationsResult.setRetentionConfigurations(new ListUnmarshaller<RetentionConfiguration>(
RetentionConfigurationJsonUnmarshaller.getInstance()).unmarshall(context));
}
if (context.testExpression("NextToken", targetDepth)) {
context.nextToken();
describeRetentionConfigurationsResult.setNextToken(context.getUnmarshaller(String.class).unmarshall(context));
}
} else if (token == END_ARRAY || token == END_OBJECT) {
if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {
if (context.getCurrentDepth() <= originalDepth)
break;
}
}
token = context.nextToken();
}
return describeRetentionConfigurationsResult;
}
private static DescribeRetentionConfigurationsResultJsonUnmarshaller instance;
public static DescribeRetentionConfigurationsResultJsonUnmarshaller getInstance() {
if (instance == null)
instance = new DescribeRetentionConfigurationsResultJsonUnmarshaller();
return instance;
}
}
|
[
"qp3@illinois.edu"
] |
qp3@illinois.edu
|
d714e417703c1c3fc9e07fa4af895220a6d28251
|
159f75d12bb51bff89497499c2dbc2971ad8dc3e
|
/edelta.parent/edelta/src/edelta/interpreter/EdeltaInterpreterIssuePresenter.java
|
00152d6d0da00f8d4ad31798d1562390ad5d7b12
|
[] |
no_license
|
LorenzoBettini/edelta
|
f406a305b99bdf30e373cb26d097df8ae256da6c
|
b011c66859f7751bd8434e91d87ace681978f1c1
|
refs/heads/master
| 2023-07-02T10:07:46.624753
| 2023-06-08T11:36:36
| 2023-06-08T11:36:36
| 97,230,480
| 8
| 7
| null | 2023-06-08T10:02:02
| 2017-07-14T12:13:27
|
Java
|
UTF-8
|
Java
| false
| false
| 1,148
|
java
|
package edelta.interpreter;
import org.eclipse.emf.ecore.ENamedElement;
import edelta.lib.EdeltaRuntime;
import edelta.lib.EdeltaIssuePresenter;
import edelta.validation.EdeltaValidator;
/**
* Used by the {@link EdeltaInterpreter} to catch issues reported by
* {@link EdeltaRuntime#showError(ENamedElement, String)},
* {@link EdeltaRuntime#showWarning(ENamedElement, String)}, etc, using
* {@link EdeltaInterpreterDiagnosticHelper}.
*
* @author Lorenzo Bettini
*
*/
public class EdeltaInterpreterIssuePresenter implements EdeltaIssuePresenter {
private EdeltaInterpreterDiagnosticHelper diagnosticHelper;
public EdeltaInterpreterIssuePresenter(EdeltaInterpreterDiagnosticHelper diagnosticHelper) {
this.diagnosticHelper = diagnosticHelper;
}
@Override
public void showError(ENamedElement problematicObject, String message) {
diagnosticHelper
.addError(problematicObject, EdeltaValidator.LIVE_VALIDATION_ERROR, message);
}
@Override
public void showWarning(ENamedElement problematicObject, String message) {
diagnosticHelper
.addWarning(problematicObject, EdeltaValidator.LIVE_VALIDATION_WARNING, message);
}
}
|
[
"lorenzo.bettini@gmail.com"
] |
lorenzo.bettini@gmail.com
|
bfe158ed0fa4b6327e4a510d80db4c717b0ba277
|
c54d9142d97744fd8de3083be0cb50daab9a58fc
|
/src/engine/tm/water/WaterFrameBuffers.java
|
74af61263d4c3621e9f10f732c8affa259767a3d
|
[] |
no_license
|
dtrajko/fancyEngine
|
07034c4e7cb050b04d80726bd0090adaed667ec1
|
26c79665d719575a8ac982971a0162fc48443108
|
refs/heads/master
| 2021-06-24T15:15:54.752505
| 2019-04-16T06:49:11
| 2019-04-16T06:49:11
| 134,029,791
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,877
|
java
|
package engine.tm.water;
import java.nio.ByteBuffer;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL14;
import org.lwjgl.opengl.GL30;
import org.lwjgl.opengl.GL32;
import engine.Window;
public class WaterFrameBuffers {
protected static final int REFLECTION_WIDTH = Window.width / 2;
private static final int REFLECTION_HEIGHT = Window.height / 2;
protected static final int REFRACTION_WIDTH = Window.width / 2;
private static final int REFRACTION_HEIGHT = Window.height / 2;
private int reflectionFrameBuffer;
private int reflectionTexture;
private int reflectionDepthBuffer;
private int refractionFrameBuffer;
private int refractionTexture;
private int refractionDepthTexture;
private int minimapFrameBuffer;
private int minimapTexture;
public WaterFrameBuffers() { //call when loading the game
initializeReflectionFrameBuffer();
initializeRefractionFrameBuffer();
initializeMinimapFrameBuffer();
}
private void initializeReflectionFrameBuffer() {
reflectionFrameBuffer = createFrameBuffer();
reflectionTexture = createTextureAttachment(REFLECTION_WIDTH, REFLECTION_HEIGHT);
reflectionDepthBuffer = createDepthBufferAttachment(REFLECTION_WIDTH, REFLECTION_HEIGHT);
unbindCurrentFrameBuffer();
}
private void initializeRefractionFrameBuffer() {
refractionFrameBuffer = createFrameBuffer();
refractionTexture = createTextureAttachment(REFRACTION_WIDTH, REFRACTION_HEIGHT);
refractionDepthTexture = createDepthTextureAttachment(REFRACTION_WIDTH, REFRACTION_HEIGHT);
unbindCurrentFrameBuffer();
}
private void initializeMinimapFrameBuffer() {
minimapFrameBuffer = createFrameBuffer();
minimapTexture = createTextureAttachment(REFLECTION_WIDTH, REFLECTION_HEIGHT);
unbindCurrentFrameBuffer();
}
private int createFrameBuffer() {
int frameBuffer = GL30.glGenFramebuffers();
// generate name for frame buffer
GL30.glBindFramebuffer(GL30.GL_FRAMEBUFFER, frameBuffer);
// create the frame buffer
GL11.glDrawBuffer(GL30.GL_COLOR_ATTACHMENT0);
// indicate that we will always render to color attachment 0
return frameBuffer;
}
private int createTextureAttachment( int width, int height) {
int texture = GL11.glGenTextures();
GL11.glBindTexture(GL11.GL_TEXTURE_2D, texture);
GL11.glTexImage2D(GL11.GL_TEXTURE_2D, 0, GL11.GL_RGB, width, height, 0, GL11.GL_RGB, GL11.GL_UNSIGNED_BYTE, (ByteBuffer) null);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR);
GL32.glFramebufferTexture(GL30.GL_FRAMEBUFFER, GL30.GL_COLOR_ATTACHMENT0, texture, 0);
return texture;
}
private int createDepthTextureAttachment(int width, int height){
int texture = GL11.glGenTextures();
GL11.glBindTexture(GL11.GL_TEXTURE_2D, texture);
GL11.glTexImage2D(GL11.GL_TEXTURE_2D, 0, GL14.GL_DEPTH_COMPONENT32, width, height, 0, GL11.GL_DEPTH_COMPONENT, GL11.GL_FLOAT, (ByteBuffer) null);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR);
GL32.glFramebufferTexture(GL30.GL_FRAMEBUFFER, GL30.GL_DEPTH_ATTACHMENT, texture, 0);
return texture;
}
private int createDepthBufferAttachment(int width, int height) {
int depthBuffer = GL30.glGenRenderbuffers();
GL30.glBindRenderbuffer(GL30.GL_RENDERBUFFER, depthBuffer);
GL30.glRenderbufferStorage(GL30.GL_RENDERBUFFER, GL11.GL_DEPTH_COMPONENT, width, height);
GL30.glFramebufferRenderbuffer(GL30.GL_FRAMEBUFFER, GL30.GL_DEPTH_ATTACHMENT, GL30.GL_RENDERBUFFER, depthBuffer);
return depthBuffer;
}
public void bindReflectionFrameBuffer() { // call before rendering to this FBO
bindFrameBuffer(reflectionFrameBuffer, REFLECTION_WIDTH, REFLECTION_HEIGHT);
}
public void bindRefractionFrameBuffer() { // call before rendering to this FBO
bindFrameBuffer(refractionFrameBuffer, REFRACTION_WIDTH, REFRACTION_HEIGHT);
}
public void bindMinimapFrameBuffer() {
bindFrameBuffer(minimapFrameBuffer, REFLECTION_WIDTH, REFLECTION_HEIGHT);
}
public void unbindCurrentFrameBuffer() { // call to switch to default frame buffer
GL30.glBindFramebuffer(GL30.GL_FRAMEBUFFER, 0);
GL11.glViewport(0, 0, Window.width, Window.height);
}
public int getReflectionTexture() { //get the resulting texture
return reflectionTexture;
}
public int getRefractionTexture() { //get the resulting texture
return refractionTexture;
}
public int getRefractionDepthTexture(){ //get the resulting depth texture
return refractionDepthTexture;
}
public int getMinimapTexture() { // get the resulting minimap texture
return minimapTexture;
}
private void bindFrameBuffer(int frameBuffer, int width, int height){
GL11.glBindTexture(GL11.GL_TEXTURE_2D, 0); // To make sure the texture isn't bound
GL30.glBindFramebuffer(GL30.GL_FRAMEBUFFER, frameBuffer);
GL11.glViewport(0, 0, width, height);
}
public void cleanUp() { //call when closing the game
GL30.glDeleteFramebuffers(reflectionFrameBuffer);
GL11.glDeleteTextures(reflectionTexture);
GL30.glDeleteRenderbuffers(reflectionDepthBuffer);
GL30.glDeleteFramebuffers(refractionFrameBuffer);
GL11.glDeleteTextures(refractionTexture);
GL11.glDeleteTextures(refractionDepthTexture);
GL30.glDeleteFramebuffers(minimapFrameBuffer);
GL11.glDeleteTextures(minimapTexture);
}
}
|
[
"dtrajko@gmail.com"
] |
dtrajko@gmail.com
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.