blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 410 | content_id stringlengths 40 40 | detected_licenses listlengths 0 51 | license_type stringclasses 2
values | repo_name stringlengths 5 132 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringlengths 4 80 | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 684M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 22
values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 132
values | src_encoding stringclasses 34
values | language stringclasses 1
value | is_vendor bool 1
class | is_generated bool 2
classes | length_bytes int64 3 9.45M | extension stringclasses 28
values | content stringlengths 3 9.45M | authors listlengths 1 1 | author_id stringlengths 0 352 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
27abbd8d625852fc4aefa4f413d2a1c6cd24f779 | cb9fcc21d82775c9a9780e1add7ba23a72755ad6 | /src/main/java/com/yhc/example/config/WebMvcConfig.java | 37579e0f78bde20fa8c7d8fbd9e8e8221dc3ea3b | [] | no_license | yanghaichuan/springboot-admin | 80661f36c2d64b918eb2b166845c5936cadc5211 | 3d41a03b59c104a82f3ff1d396218692cf7c8378 | refs/heads/master | 2023-02-02T01:53:09.591945 | 2020-09-18T08:09:29 | 2020-09-18T08:09:29 | 285,513,616 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,360 | java | package com.yhc.example.config;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
/**
* Created with IDEA2018.3
* author:杨海传
* Date:2020-08-22 16:56
*/
@Configuration
public class WebMvcConfig implements WebMvcConfigurer {
@Override
public void addViewControllers(ViewControllerRegistry registry) {
//视图映射:浏览器发送"/"请求,会来到index页面(thymeleaf解析的页面),
// registry.addViewController("/").setViewName("/index");
registry.addViewController("/index.html").setViewName("/index");
registry.addViewController("/main.html").setViewName("/main");
//配置springboot直接访问静态html页面,不经过controller
//配置之后,发送/loginAndRegister.html,就相当于在controller中return "loginAndRegister"
registry.addViewController("/loginAndRegister.html").setViewName("/loginAndRegister");
}
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/static/**").addResourceLocations("classpath:/static/");
}
}
| [
"51939690+yanghaichuan@users.noreply.github.com"
] | 51939690+yanghaichuan@users.noreply.github.com |
7fe26146def4f519b51ae028ca2a113a4b8b288a | f1c577cf45a7953ac7e753d6073949c04bce9787 | /app/src/main/java/com/ssadeo/ui/activity/login/LoginIPresenter.java | 360bcdab62ab84f8c0b2111ca0e63bc1df4c661c | [] | no_license | rajeshkanna83/appoets-ssadeo_android_user-f8765ecb9d87 | 0ebd3ad4d485c905fe9ed72b62f12a2cf0e68572 | fc2306f64809355204fd5ff6bc2e0a1a6f230edb | refs/heads/master | 2022-12-08T07:37:21.443266 | 2020-08-22T05:18:10 | 2020-08-22T05:18:10 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 377 | java | package com.ssadeo.ui.activity.login;
import com.ssadeo.base.MvpPresenter;
import java.util.HashMap;
/**
* Created by santhosh@appoets.com on 19-05-2018.
*/
public interface LoginIPresenter<V extends LoginIView> extends MvpPresenter<V>{
void login(HashMap<String, Object> obj);
void verifyOTP(HashMap<String, Object> obj);
void forgotPassword(String email);
}
| [
"rkanna@farshore.com"
] | rkanna@farshore.com |
98f99cb92b0eb1c26d0ad7bfb70f9b05d13da7b1 | 8b07dffa0c30339dd6bc85ae9d65e7c10c4d311c | /Server/Brainsense_new/src/com/matrix/brainsense/struts/PackagePathAction.java | ac63619620da9b60816e7d7c2c06eadaf74fbbbf | [] | no_license | joselyncui/Bransense | 7c7afe43c288b039b4ee70796fb0e05c803b1da8 | f423bd8c91a520b3fa5c2bcdf1ece78ba1489576 | refs/heads/master | 2021-01-10T09:20:44.114298 | 2015-10-22T01:06:11 | 2015-10-22T01:06:11 | 44,713,427 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,528 | java | package com.matrix.brainsense.struts;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.InterceptorRef;
import org.apache.struts2.convention.annotation.InterceptorRefs;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.ParentPackage;
import org.apache.struts2.convention.annotation.Result;
import org.apache.struts2.convention.annotation.Results;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import com.matrix.brainsense.action.AdminAction;
import com.matrix.brainsense.entity.PackagePath;
import com.opensymphony.xwork2.ActionSupport;
@ParentPackage("custom-default")
@Namespace("/struts")
@Controller
@Results( { @Result(name = "success", type = "redirect" ,location = "getPath?message=${message}"),
@Result(name = "invalid.token", location = "getPath?message=${message}") } )
@InterceptorRefs({ @InterceptorRef("annotatedStack") })
public class PackagePathAction extends ActionSupport {
private static final long serialVersionUID = 1L;
@Autowired
private AdminAction adminAction;
private String basePath;
private String contentPath;
private String message;
public String getBasePath() {
return basePath;
}
public void setBasePath(String basePath) {
this.basePath = basePath;
}
public String getContentPath() {
return contentPath;
}
public void setContentPath(String contentPath) {
this.contentPath = contentPath;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
@Action(value = "getPath", results = { @Result(name = "success", location = "/WEB-INF/PackagePath.jsp") })
public String getPath(){
PackagePath packagePath = adminAction.getPath();
if(packagePath == null){
this.basePath = "";
this.contentPath = "";
}
this.basePath = packagePath.getBasePath();
this.contentPath = packagePath.getContentPath();
return SUCCESS;
}
@Action(value = "updatePackagePath")
public String updatePath(){
PackagePath packagePath = adminAction.getPath();
if(packagePath == null){
if(adminAction.addPath(this.basePath, this.contentPath)){
this.message = "Add success!";
} else {
this.message = "Add failed!";
}
} else {
if(adminAction.updatePath(this.basePath, this.contentPath)){
this.message = "Update Success!";
} else {
this.message = "Update failed!";
}
}
return SUCCESS;
}
}
| [
"15895026586@163.com"
] | 15895026586@163.com |
f6ac416244437b5c7ef6a617e3a10b0fa49cbd98 | 82654bea15ff9d65a916caaac0f57065a60ab769 | /SleepSendIntent/src/jp/lnc/android/send_activity/SleepSendActivity.java | fb13031390b087bbac209789ec54038221946370 | [] | no_license | bols-blue/SleepSendIntentExample | 7850265a389870b41e6b2094f258db1ccea51dfa | 267eb4a3463dd5c70708e210b961d0808f455213 | refs/heads/master | 2020-05-30T05:41:46.951929 | 2011-03-20T07:34:27 | 2011-03-20T07:34:27 | 1,502,007 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,331 | java | package jp.lnc.android.send_activity;
import java.util.Timer;
import java.util.TimerTask;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;
public class SleepSendActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Timerを設定する
timer = new Timer(true);
TimerTask timerTask = new exsampleTimerTask();
timer.schedule(timerTask, 200000, 10000); // 初回起動の遅延と周期指定。単位はms
setContentView(R.layout.main);
}
private void sendIntent() {
Log.d("test", "Send Intent");
String strUrl = "http://hatena.ne.jp/";
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(strUrl));
startActivity(intent);
}
/** Called when the activity is first created. */
int tickcount;
Timer timer = null; // タイマを定義
TextView mDisplayText; // 表示領域の定義
class exsampleTimerTask extends TimerTask {
final android.os.Handler handler = new android.os.Handler();
public void run() {
// TODO Auto-generated method stub
handler.post(new Runnable() {
public void run() {
sendIntent();
}
});
}
}
} | [
"bols-blue@lnc.jp"
] | bols-blue@lnc.jp |
4f6fa108294d293b45cb28b64d818703ee619dfa | c76f296832b94375ecd4a6f093b73907413dc7fd | /simpletomcatchap10/src/tmp/org/apache/catalina/connector/http/HttpConnector.java | af9372ef26c202328336ff757892de885678ad82 | [] | no_license | zhoushuo19850509/SimpleTomcat | 2881d250f0ac48a4c7212f7c993a1ad1c12bd759 | 996c40050769114f969f719638f1507d63801c0a | refs/heads/master | 2023-07-03T23:15:49.984718 | 2021-08-07T02:33:55 | 2021-08-07T02:33:55 | 338,585,187 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 29,933 | java | package org.apache.catalina.connector.http;
import org.apache.catalina.*;
import org.apache.catalina.net.DefaultServerSocketFactory;
import org.apache.catalina.net.ServerSocketFactory;
import org.apache.catalina.util.LifecycleSupport;
import org.apache.catalina.util.StringManager;
import java.io.IOException;
import java.net.BindException;
import java.net.InetAddress;
import java.net.ServerSocket;
import java.net.Socket;
import java.security.*;
import java.security.cert.CertificateException;
import java.util.Stack;
import java.util.Vector;
/**
* Implementation of an HTTP/1.1 connector.
*
* @author Craig R. McClanahan
* @author Remy Maucherat
* @version $Revision: 1.34 $ $Date: 2002/03/18 07:15:39 $
* @deprecated
*/
public final class HttpConnector
implements Connector, Lifecycle, Runnable {
// ----------------------------------------------------- Instance Variables
/**
* The <code>Service</code> we are associated with (if any).
*/
private Service service = null;
/**
* The accept count for this Connector.
*/
private int acceptCount = 10;
/**
* The IP address on which to bind, if any. If <code>null</code>, all
* addresses on the server will be bound.
*/
private String address = null;
/**
* The input buffer size we should create on input streams.
*/
private int bufferSize = 2048;
/**
* The Container used for processing requests received by this Connector.
*/
protected Container container = null;
/**
* The set of processors that have ever been created.
*/
private Vector created = new Vector();
/**
* The current number of processors that have been created.
*/
private int curProcessors = 0;
/**
* The debugging detail level for this component.
*/
private int debug = 0;
/**
* The "enable DNS lookups" flag for this Connector.
*/
private boolean enableLookups = false;
/**
* The server socket factory for this component.
*/
private ServerSocketFactory factory = null;
/**
* Descriptive information about this Connector implementation.
*/
private static final String info =
"org.apache.catalina.connector.http.HttpConnector/1.0";
/**
* The lifecycle event support for this component.
*/
protected LifecycleSupport lifecycle = new LifecycleSupport(this);
/**
* The minimum number of processors to start at initialization time.
*/
protected int minProcessors = 5;
/**
* The maximum number of processors allowed, or <0 for unlimited.
*/
private int maxProcessors = 20;
/**
* Timeout value on the incoming connection.
* Note : a value of 0 means no timeout.
*/
private int connectionTimeout = Constants.DEFAULT_CONNECTION_TIMEOUT;
/**
* The port number on which we listen for HTTP requests.
*/
private int port = 8080;
/**
* The set of processors that have been created but are not currently
* being used to process a request.
*/
private Stack processors = new Stack();
/**
* The server name to which we should pretend requests to this Connector
* were directed. This is useful when operating Tomcat behind a proxy
* server, so that redirects get constructed accurately. If not specified,
* the server name included in the <code>Host</code> header is used.
*/
private String proxyName = null;
/**
* The server port to which we should pretent requests to this Connector
* were directed. This is useful when operating Tomcat behind a proxy
* server, so that redirects get constructed accurately. If not specified,
* the port number specified by the <code>port</code> property is used.
*/
private int proxyPort = 0;
/**
* The redirect port for non-SSL to SSL redirects.
*/
private int redirectPort = 443;
/**
* The request scheme that will be set on all requests received
* through this connector.
*/
private String scheme = "http";
/**
* The secure connection flag that will be set on all requests received
* through this connector.
*/
private boolean secure = false;
/**
* The server socket through which we listen for incoming TCP connections.
*/
private ServerSocket serverSocket = null;
/**
* The string manager for this package.
*/
private StringManager sm =
StringManager.getManager(Constants.Package);
/**
* Has this component been initialized yet?
*/
private boolean initialized = false;
/**
* Has this component been started yet?
*/
private boolean started = false;
/**
* The shutdown signal to our background thread
*/
private boolean stopped = false;
/**
* The background thread.
*/
private Thread thread = null;
/**
* The name to register for the background thread.
*/
private String threadName = null;
/**
* The thread synchronization object.
*/
private Object threadSync = new Object();
/**
* Is chunking allowed ?
*/
private boolean allowChunking = true;
/**
* Use TCP no delay ?
*/
private boolean tcpNoDelay = true;
// ------------------------------------------------------------- Properties
/**
* Return the <code>Service</code> with which we are associated (if any).
*/
public Service getService() {
return (this.service);
}
/**
* Set the <code>Service</code> with which we are associated (if any).
*
* @param service The service that owns this Engine
*/
public void setService(Service service) {
this.service = service;
}
/**
* Return the connection timeout for this Connector.
*/
public int getConnectionTimeout() {
return (connectionTimeout);
}
/**
* Set the connection timeout for this Connector.
*
* @param count The new connection timeout
*/
public void setConnectionTimeout(int connectionTimeout) {
this.connectionTimeout = connectionTimeout;
}
/**
* Return the accept count for this Connector.
*/
public int getAcceptCount() {
return (acceptCount);
}
/**
* Set the accept count for this Connector.
*
* @param count The new accept count
*/
public void setAcceptCount(int count) {
this.acceptCount = count;
}
/**
* Get the allow chunking flag.
*/
public boolean isChunkingAllowed() {
return (allowChunking);
}
/**
* Get the allow chunking flag.
*/
public boolean getAllowChunking() {
return isChunkingAllowed();
}
/**
* Set the allow chunking flag.
*
* @param allowChunking Allow chunking flag
*/
public void setAllowChunking(boolean allowChunking) {
this.allowChunking = allowChunking;
}
/**
* Return the bind IP address for this Connector.
*/
public String getAddress() {
return (this.address);
}
/**
* Set the bind IP address for this Connector.
*
* @param address The bind IP address
*/
public void setAddress(String address) {
this.address = address;
}
/**
* Is this connector available for processing requests?
*/
public boolean isAvailable() {
return (started);
}
/**
* Return the input buffer size for this Connector.
*/
public int getBufferSize() {
return (this.bufferSize);
}
/**
* Set the input buffer size for this Connector.
*
* @param bufferSize The new input buffer size.
*/
public void setBufferSize(int bufferSize) {
this.bufferSize = bufferSize;
}
/**
* Return the Container used for processing requests received by this
* Connector.
*/
public Container getContainer() {
return (container);
}
/**
* Set the Container used for processing requests received by this
* Connector.
*
* @param container The new Container to use
*/
public void setContainer(Container container) {
this.container = container;
}
/**
* Return the current number of processors that have been created.
*/
public int getCurProcessors() {
return (curProcessors);
}
/**
* Return the debugging detail level for this component.
*/
public int getDebug() {
return (debug);
}
/**
* Set the debugging detail level for this component.
*
* @param debug The new debugging detail level
*/
public void setDebug(int debug) {
this.debug = debug;
}
/**
* Return the "enable DNS lookups" flag.
*/
public boolean getEnableLookups() {
return (this.enableLookups);
}
/**
* Set the "enable DNS lookups" flag.
*
* @param enableLookups The new "enable DNS lookups" flag value
*/
public void setEnableLookups(boolean enableLookups) {
this.enableLookups = enableLookups;
}
/**
* Return the server socket factory used by this Container.
*/
public ServerSocketFactory getFactory() {
if (this.factory == null) {
synchronized (this) {
this.factory = new DefaultServerSocketFactory();
}
}
return (this.factory);
}
/**
* Set the server socket factory used by this Container.
*
* @param factory The new server socket factory
*/
public void setFactory(ServerSocketFactory factory) {
this.factory = factory;
}
/**
* Return descriptive information about this Connector implementation.
*/
public String getInfo() {
return (info);
}
/**
* Return the minimum number of processors to start at initialization.
*/
public int getMinProcessors() {
return (minProcessors);
}
/**
* Set the minimum number of processors to start at initialization.
*
* @param minProcessors The new minimum processors
*/
public void setMinProcessors(int minProcessors) {
this.minProcessors = minProcessors;
}
/**
* Return the maximum number of processors allowed, or <0 for unlimited.
*/
public int getMaxProcessors() {
return (maxProcessors);
}
/**
* Set the maximum number of processors allowed, or <0 for unlimited.
*
* @param maxProcessors The new maximum processors
*/
public void setMaxProcessors(int maxProcessors) {
this.maxProcessors = maxProcessors;
}
/**
* Return the port number on which we listen for HTTP requests.
*/
public int getPort() {
return (this.port);
}
/**
* Set the port number on which we listen for HTTP requests.
*
* @param port The new port number
*/
public void setPort(int port) {
this.port = port;
}
/**
* Return the proxy server name for this Connector.
*/
public String getProxyName() {
return (this.proxyName);
}
/**
* Set the proxy server name for this Connector.
*
* @param proxyName The new proxy server name
*/
public void setProxyName(String proxyName) {
this.proxyName = proxyName;
}
/**
* Return the proxy server port for this Connector.
*/
public int getProxyPort() {
return (this.proxyPort);
}
/**
* Set the proxy server port for this Connector.
*
* @param proxyPort The new proxy server port
*/
public void setProxyPort(int proxyPort) {
this.proxyPort = proxyPort;
}
/**
* Return the port number to which a request should be redirected if
* it comes in on a non-SSL port and is subject to a security constraint
* with a transport guarantee that requires SSL.
*/
public int getRedirectPort() {
return (this.redirectPort);
}
/**
* Set the redirect port number.
*
* @param redirectPort The redirect port number (non-SSL to SSL)
*/
public void setRedirectPort(int redirectPort) {
this.redirectPort = redirectPort;
}
/**
* Return the scheme that will be assigned to requests received
* through this connector. Default value is "http".
*/
public String getScheme() {
return (this.scheme);
}
/**
* Set the scheme that will be assigned to requests received through
* this connector.
*
* @param scheme The new scheme
*/
public void setScheme(String scheme) {
this.scheme = scheme;
}
/**
* Return the secure connection flag that will be assigned to requests
* received through this connector. Default value is "false".
*/
public boolean getSecure() {
return (this.secure);
}
/**
* Set the secure connection flag that will be assigned to requests
* received through this connector.
*
* @param secure The new secure connection flag
*/
public void setSecure(boolean secure) {
this.secure = secure;
}
/**
* Return the TCP no delay flag value.
*/
public boolean getTcpNoDelay() {
return (this.tcpNoDelay);
}
/**
* Set the TCP no delay flag which will be set on the socket after
* accepting a connection.
*
* @param tcpNoDelay The new TCP no delay flag
*/
public void setTcpNoDelay(boolean tcpNoDelay) {
this.tcpNoDelay = tcpNoDelay;
}
// --------------------------------------------------------- Public Methods
/**
* Create (or allocate) and return a Request object suitable for
* specifying the contents of a Request to the responsible Container.
*/
public Request createRequest() {
// if (debug >= 2)
// log("createRequest: Creating new request");
HttpRequestImpl request = new HttpRequestImpl();
request.setConnector(this);
return (request);
}
/**
* Create (or allocate) and return a Response object suitable for
* receiving the contents of a Response from the responsible Container.
*/
public Response createResponse() {
// if (debug >= 2)
// log("createResponse: Creating new response");
HttpResponseImpl response = new HttpResponseImpl();
response.setConnector(this);
return (response);
}
// -------------------------------------------------------- Package Methods
/**
* Recycle the specified Processor so that it can be used again.
*
* @param processor The processor to be recycled
*/
void recycle(HttpProcessor processor) {
// if (debug >= 2)
// log("recycle: Recycling processor " + processor);
processors.push(processor);
}
// -------------------------------------------------------- Private Methods
/**
* Create (or allocate) and return an available processor for use in
* processing a specific HTTP request, if possible. If the maximum
* allowed processors have already been created and are in use, return
* <code>null</code> instead.
*/
private HttpProcessor createProcessor() {
synchronized (processors) {
if (processors.size() > 0) {
// if (debug >= 2)
// log("createProcessor: Reusing existing processor");
return ((HttpProcessor) processors.pop());
}
if ((maxProcessors > 0) && (curProcessors < maxProcessors)) {
// if (debug >= 2)
// log("createProcessor: Creating new processor");
return (newProcessor());
} else {
if (maxProcessors < 0) {
// if (debug >= 2)
// log("createProcessor: Creating new processor");
return (newProcessor());
} else {
// if (debug >= 2)
// log("createProcessor: Cannot create new processor");
return (null);
}
}
}
}
/**
* Log a message on the Logger associated with our Container (if any).
*
* @param message Message to be logged
*/
private void log(String message) {
Logger logger = container.getLogger();
String localName = threadName;
if (localName == null)
localName = "HttpConnector";
if (logger != null)
logger.log(localName + " " + message);
else
System.out.println(localName + " " + message);
}
/**
* Log a message on the Logger associated with our Container (if any).
*
* @param message Message to be logged
* @param throwable Associated exception
*/
private void log(String message, Throwable throwable) {
Logger logger = container.getLogger();
String localName = threadName;
if (localName == null)
localName = "HttpConnector";
if (logger != null)
logger.log(localName + " " + message, throwable);
else {
System.out.println(localName + " " + message);
throwable.printStackTrace(System.out);
}
}
/**
* Create and return a new processor suitable for processing HTTP
* requests and returning the corresponding responses.
*/
private HttpProcessor newProcessor() {
// if (debug >= 2)
// log("newProcessor: Creating new processor");
HttpProcessor processor = new HttpProcessor(this, curProcessors++);
if (processor instanceof Lifecycle) {
try {
((Lifecycle) processor).start();
} catch (LifecycleException e) {
log("newProcessor", e);
return (null);
}
}
created.addElement(processor);
return (processor);
}
/**
* Open and return the server socket for this Connector. If an IP
* address has been specified, the socket will be opened only on that
* address; otherwise it will be opened on all addresses.
*
* @exception IOException input/output or network error
* @exception KeyStoreException error instantiating the
* KeyStore from file (SSL only)
* @exception NoSuchAlgorithmException KeyStore algorithm unsupported
* by current provider (SSL only)
* @exception CertificateException general certificate error (SSL only)
* @exception UnrecoverableKeyException internal KeyStore problem with
* the certificate (SSL only)
* @exception KeyManagementException problem in the key management
* layer (SSL only)
*/
private ServerSocket open()
throws IOException, KeyStoreException, NoSuchAlgorithmException,
CertificateException, UnrecoverableKeyException,
KeyManagementException
{
// Acquire the server socket factory for this Connector
ServerSocketFactory factory = getFactory();
// If no address is specified, open a connection on all addresses
if (address == null) {
log(sm.getString("httpConnector.allAddresses"));
try {
return (factory.createSocket(port, acceptCount));
} catch (BindException be) {
throw new BindException(be.getMessage() + ":" + port);
}
}
// Open a server socket on the specified address
try {
InetAddress is = InetAddress.getByName(address);
log(sm.getString("httpConnector.anAddress", address));
try {
return (factory.createSocket(port, acceptCount, is));
} catch (BindException be) {
throw new BindException(be.getMessage() + ":" + address +
":" + port);
}
} catch (Exception e) {
log(sm.getString("httpConnector.noAddress", address));
try {
return (factory.createSocket(port, acceptCount));
} catch (BindException be) {
throw new BindException(be.getMessage() + ":" + port);
}
}
}
// ---------------------------------------------- Background Thread Methods
/**
* The background thread that listens for incoming TCP/IP connections and
* hands them off to an appropriate processor.
*/
public void run() {
// Loop until we receive a shutdown command
while (!stopped) {
// Accept the next incoming connection from the server socket
Socket socket = null;
try {
// if (debug >= 3)
// log("run: Waiting on serverSocket.accept()");
socket = serverSocket.accept();
// if (debug >= 3)
// log("run: Returned from serverSocket.accept()");
if (connectionTimeout > 0)
socket.setSoTimeout(connectionTimeout);
socket.setTcpNoDelay(tcpNoDelay);
} catch (AccessControlException ace) {
log("socket accept security exception", ace);
continue;
} catch (IOException e) {
// if (debug >= 3)
// log("run: Accept returned IOException", e);
try {
// If reopening fails, exit
synchronized (threadSync) {
if (started && !stopped)
log("accept error: ", e);
if (!stopped) {
// if (debug >= 3)
// log("run: Closing server socket");
serverSocket.close();
// if (debug >= 3)
// log("run: Reopening server socket");
serverSocket = open();
}
}
// if (debug >= 3)
// log("run: IOException processing completed");
} catch (IOException ioe) {
log("socket reopen, io problem: ", ioe);
break;
} catch (KeyStoreException kse) {
log("socket reopen, keystore problem: ", kse);
break;
} catch (NoSuchAlgorithmException nsae) {
log("socket reopen, keystore algorithm problem: ", nsae);
break;
} catch (CertificateException ce) {
log("socket reopen, certificate problem: ", ce);
break;
} catch (UnrecoverableKeyException uke) {
log("socket reopen, unrecoverable key: ", uke);
break;
} catch (KeyManagementException kme) {
log("socket reopen, key management problem: ", kme);
break;
}
continue;
}
// Hand this socket off to an appropriate processor
HttpProcessor processor = createProcessor();
if (processor == null) {
try {
log(sm.getString("httpConnector.noProcessor"));
socket.close();
} catch (IOException e) {
;
}
continue;
}
// if (debug >= 3)
// log("run: Assigning socket to processor " + processor);
processor.assign(socket);
// The processor will recycle itself when it finishes
}
// Notify the threadStop() method that we have shut ourselves down
// if (debug >= 3)
// log("run: Notifying threadStop() that we have shut down");
synchronized (threadSync) {
threadSync.notifyAll();
}
}
/**
* Start the background processing thread.
*/
private void threadStart() {
log(sm.getString("httpConnector.starting"));
thread = new Thread(this, threadName);
thread.setDaemon(true);
thread.start();
}
/**
* Stop the background processing thread.
*/
private void threadStop() {
log(sm.getString("httpConnector.stopping"));
stopped = true;
try {
threadSync.wait(5000);
} catch (InterruptedException e) {
;
}
thread = null;
}
// ------------------------------------------------------ Lifecycle Methods
/**
* Add a lifecycle event listener to this component.
*
* @param listener The listener to add
*/
public void addLifecycleListener(LifecycleListener listener) {
lifecycle.addLifecycleListener(listener);
}
/**
* Get the lifecycle listeners associated with this lifecycle. If this
* Lifecycle has no listeners registered, a zero-length array is returned.
*/
public LifecycleListener[] findLifecycleListeners() {
return lifecycle.findLifecycleListeners();
}
/**
* Remove a lifecycle event listener from this component.
*
* @param listener The listener to add
*/
public void removeLifecycleListener(LifecycleListener listener) {
lifecycle.removeLifecycleListener(listener);
}
/**
* Initialize this connector (create ServerSocket here!)
*/
public void initialize()
throws LifecycleException {
if (initialized)
throw new LifecycleException(
sm.getString("httpConnector.alreadyInitialized"));
this.initialized=true;
Exception eRethrow = null;
// Establish a server socket on the specified port
try {
serverSocket = open();
} catch (IOException ioe) {
log("httpConnector, io problem: ", ioe);
eRethrow = ioe;
} catch (KeyStoreException kse) {
log("httpConnector, keystore problem: ", kse);
eRethrow = kse;
} catch (NoSuchAlgorithmException nsae) {
log("httpConnector, keystore algorithm problem: ", nsae);
eRethrow = nsae;
} catch (CertificateException ce) {
log("httpConnector, certificate problem: ", ce);
eRethrow = ce;
} catch (UnrecoverableKeyException uke) {
log("httpConnector, unrecoverable key: ", uke);
eRethrow = uke;
} catch (KeyManagementException kme) {
log("httpConnector, key management problem: ", kme);
eRethrow = kme;
}
if ( eRethrow != null )
throw new LifecycleException(threadName + ".open", eRethrow);
}
/**
* Begin processing requests via this Connector.
*
* @exception LifecycleException if a fatal startup error occurs
*/
public void start() throws LifecycleException {
// Validate and update our current state
if (started)
throw new LifecycleException
(sm.getString("httpConnector.alreadyStarted"));
threadName = "HttpConnector[" + port + "]";
lifecycle.fireLifecycleEvent(START_EVENT, null);
started = true;
// Start our background thread
threadStart();
// Create the specified minimum number of processors
while (curProcessors < minProcessors) {
if ((maxProcessors > 0) && (curProcessors >= maxProcessors))
break;
HttpProcessor processor = newProcessor();
recycle(processor);
}
}
/**
* Terminate processing requests via this Connector.
*
* @exception LifecycleException if a fatal shutdown error occurs
*/
public void stop() throws LifecycleException {
// Validate and update our current state
if (!started)
throw new LifecycleException
(sm.getString("httpConnector.notStarted"));
lifecycle.fireLifecycleEvent(STOP_EVENT, null);
started = false;
// Gracefully shut down all processors we have created
for (int i = created.size() - 1; i >= 0; i--) {
HttpProcessor processor = (HttpProcessor) created.elementAt(i);
if (processor instanceof Lifecycle) {
try {
((Lifecycle) processor).stop();
} catch (LifecycleException e) {
log("HttpConnector.stop", e);
}
}
}
synchronized (threadSync) {
// Close the server socket we were using
if (serverSocket != null) {
try {
serverSocket.close();
} catch (IOException e) {
;
}
}
// Stop our background thread
threadStop();
}
serverSocket = null;
}
}
| [
"zhoushuo19850509@163.com"
] | zhoushuo19850509@163.com |
97489850d50357c745a0d17fa308bade397c6597 | 95201c0d3efe7a6357c31a0680b4b0b64f66ea9f | /airline-gwt/src/main/java/edu/pdx/cs410J/singh2/client/AirlineService.java | 3503f9cf65864a4e941394582420e1ca8568e950 | [] | no_license | harmanpreet52/AdvJavaSummer2014 | c6159c3814ed3b5eef8b2c395a63bb88bcd5b621 | 08f5dd31b35f3fa8c0627f34244f3f093bb0a727 | refs/heads/master | 2021-05-28T16:01:23.069840 | 2014-11-19T23:51:59 | 2014-11-19T23:51:59 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,209 | java | package edu.pdx.cs410J.singh2.client;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
import edu.pdx.cs410J.AbstractAirline;
import edu.pdx.cs410J.AbstractFlight;
import java.util.ArrayList;
/**
* A GWT remote service that returns a dummy airline
*/
@RemoteServiceRelativePath("airlineServlet")
public interface AirlineService extends RemoteService {
/**
* return a list of airlines to display to user
* @return list of airlines
*/
public ArrayList<Airline> displayAll();
/**
* search for flight given the airlineName, src and dest
* @param airlineName name of the airline
* @param src source airport
* @param dest destination airport
* @return returns the matched airline with flights
*/
public String search(String airlineName, String src, String dest);
/**
* add a flight with airline name
* @param airlineName name of the airline
* @param flight flight to add
* @return list of airline with flights
*/
public ArrayList<Airline> addFlight(String airlineName, Flight flight);
}
| [
"singh2@pdx.edu"
] | singh2@pdx.edu |
cf0f2a5905150df2bd9f1a1e2eb9ca7b387eb3ed | 7ad85e475d5b5be5117cc1285e7496d88b443d69 | /JavaDesignPattern/src/com/dong/design/builder/KfcSet.java | f62a74bc7ceea3831e213cfcf40391d0af742b06 | [
"Apache-2.0"
] | permissive | appledong/JavaDesignPattern | 94a06c69506f2c9ce1cec36b0abd3ff9ecaf9b58 | 159669477da6449be20cdda909c594af772b5d9a | refs/heads/master | 2020-04-17T02:27:52.328684 | 2016-08-31T09:20:18 | 2016-08-31T09:20:18 | 52,856,675 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 438 | java | package com.dong.design.builder;
public class KfcSet {
private KfcHanbao kfcHanbao;
private KfcShutiao kfcShutiao;
public void setKfcHanbao(KfcHanbao kfcHanbao) {
this.kfcHanbao = kfcHanbao;
}
public void setKfcShutiao(KfcShutiao kfcShutiao) {
this.kfcShutiao = kfcShutiao;
}
public KfcHanbao getKfcHanbao() {
return kfcHanbao;
}
public KfcShutiao getKfcShutiao() {
return kfcShutiao;
}
}
| [
"yijianpiaoxue2011@163.com"
] | yijianpiaoxue2011@163.com |
f86dca005658c0f0cb4c2c18192546bb26dba7e7 | 39f343e2978f59b96835525e1f97630cc49d3eff | /Agrawal_Gourav_FinalProject/src/Business/WorkQueue/WorkQueue.java | 73401974a3b73611c9a44d09e4e602a99fc3bb8d | [] | no_license | Gouravagrawal/Java | bef702942a08adc7f8e132a2495e043ff6e6c3df | 7911fceab696af8b8a988f9df91f852fd72d2775 | refs/heads/master | 2021-01-10T16:42:19.591125 | 2015-10-06T01:45:39 | 2015-10-06T01:45:39 | 43,724,103 | 0 | 0 | null | 2015-10-06T01:45:40 | 2015-10-06T01:34:38 | null | UTF-8 | Java | false | false | 932 | java | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package Business.WorkQueue;
import Business.Enterprise.Enterprise;
import java.util.ArrayList;
/**
*
* @author gourav
*/
public class WorkQueue {
private ArrayList<WorkRequest> workRequestList;
private Enterprise enterprise;
public WorkQueue() {
workRequestList = new ArrayList<>();
}
public ArrayList<WorkRequest> getWorkRequestList() {
return workRequestList;
}
public void addWorkRequest(WorkRequest workrequest){
this.workRequestList.add(workrequest);
}
public WorkRequest searchByID(int ID)
{
for(WorkRequest workRequest: workRequestList)
{
if(workRequest.getId()==(ID))
{
return workRequest;
}
}
return null;
}
} | [
"agrawal.g@husky.neu.edu"
] | agrawal.g@husky.neu.edu |
891ec3ec32afcb6a64ff539d7f3c951645d59d3f | d5fc2c19963766e430859644d55a14d256ea80df | /src/test/java/com/hancomee/AnyTest.java | 5e91f5c20eb3a4a9ab41bdd7af256bba39db97e2 | [] | no_license | boosteel/hancomee | 61076716949d7739175bb09f775942897ed633df | 85b95a608198c00d0377392f7ae53cc2c2a5f403 | refs/heads/master | 2020-04-17T08:25:39.869167 | 2019-01-18T14:06:38 | 2019-01-18T14:06:38 | 166,411,675 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,185 | java | package com.hancomee;
import com.boosteel.http.HTTP;
import com.boosteel.nativedb.core.SQL;
import com.boosteel.util.support.MapAccess;
import com.boosteel.util.support.Patterns;
import com.hancomee.web.controller.work.ListController;
import org.junit.Test;
import java.lang.reflect.Method;
import java.net.URLEncoder;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.*;
import java.util.function.Function;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import static com.boosteel.util.support.MapAccess.createDataMap;
public class AnyTest {
@Test
public void test() throws Exception {
}
public void naver(String query, int page) throws Exception {
Map<String, String> header = new HashMap<>();
header.put("user-agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36");
header.put("cookie", "npic=JOnB4nrZM/tE/wex2mHKCeO8dRlUn8+DT+XM+snlvK2ZowGZh3T5Pf37N6kP6z6lCA==; NNB=2YOXOKUS3QRFU; ASID=d2674676000001603f23f47900000051; _ga=GA1.2.273050149.1518249030; nx_open_so=1; nx_ssl=2; NID_AUT=urpiSqQIwB9TtR02YAYOTIb8ugiC1Gao5NG5yrQCqvnWy3AB2mHtj/3k/qEtYecY; NID_SES=AAABfzkWBbdMiF5TrPc9Gha+3iTrH9qzsmVeqwsWdGHD8MqZBksl9+t1UtUFfK3dTmSST80B+krqBoqGk+JXcdQ+4AityV640JmQ/n5Cj9cPKZIsGvOykTFRUm09hbnxtZvo2Y+KodtheeXKlJGqPt6buYB0GeqU/J3ZGqCo0vNjcj0UhJhoAJHaESJoLeeZ/NZnjp8HDgztcHR6mSJGEe/vA8pFcZ6nZnTuFXBCiZ7KSQPsNSB603pmwUv9yyveQLHujdPACJsJ4NgrtStva1UxRwHeVAB+au8PzRShdsF3bRkbtntxM4386Yz4rUFkwtsrwD61i+l6p/B3dnBmYy7dQxaKZoYBT6wtMDpoEQhSYkEMAj98Di7PChbYYwY95hgeuZNIKdCGFiT7QFzCsDo2OuZX5kj+oijFkp6bRlXhnC4WTX3TN0VOqJuA5url0nlovxmy80VepFuOe54Ru7cujb9fyec4lON08xzXyr5GNWb3wuJQLXeGk/WFpeJVEAnvrw==; _naver_usersession_=muDbLkU6OByej+ylwRbJFg==; page_uid=T/YRglpVuEwssvlSr4KssssstfG-081893");
String url = "https://search.naver.com/search.naver?date_from=&date_option=0&" +
"date_to=&dup_remove=1&nso=&post_blogurl=&post_blogurl_without=&" +
"query=" + URLEncoder.encode(query, "euc-kr") +
"&sm=tab_pge&srchby=all&st=sim&where=post&" +
"start=" + (page < 2 ? "" : page - 1) + "1",
html = HTTP.get(url, header);
Patterns.forEach("class=\"sh_blog_top\".*?sh_blog_title[^<>]+title=\"([^\"]+).*?txt_inline\">([^<>]+).*?class=\"txt84\".*?>([^<>]+).*?<a .*?([^<>]+)<\\/a",
html, (i, g, title, date, name, postId) -> {
out("[" + date.trim() + "] " + title + " / " + name + "\n" + postId + "\n");
});
}
public void n(int i) {
out(i);
}
public List<Map<String, Object>> list() {
return null;
}
public static class Magic {
Korean korean = new Korean();
String getName() {
return "네임";
}
}
public static class Korean {
String name = "asdf";
}
public static class Test1 {
int a;
public String name = "운따";
}
private <T> T out(T obj) {
System.out.println(obj);
return obj;
}
}
| [
"hellofunc@naver.com"
] | hellofunc@naver.com |
0bf2f04416413bb828245e63545a10b3b6d66bb2 | 71a7c06bbac9fda7512a72a4a8a7f3af79961c03 | /BaseValueManagement/BYEProcess/SoapProxyStubsRulesService/src/gov/lacounty/assessor/amp/data/bvm/deriveescalationpath/v1/ObjectFactory.java | 30e54ad2e145fc57a138076f84972c70113e63f3 | [] | no_license | kishanpeddaboina/oracle | 33b65117f1d6ca2a368ff46ab7e8f921dfac4d5c | a094622693ea1906a5c3372a56ea58a96198b13a | refs/heads/master | 2020-03-30T19:28:52.989304 | 2018-10-04T09:14:19 | 2018-10-04T09:14:19 | 151,544,922 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,690 | java |
package gov.lacounty.assessor.amp.data.bvm.deriveescalationpath.v1;
import javax.xml.bind.annotation.XmlRegistry;
/**
* This object contains factory methods for each
* Java content interface and Java element interface
* generated in the gov.lacounty.assessor.amp.data.bvm.deriveescalationpath.v1 package.
* <p>An ObjectFactory allows you to programatically
* construct new instances of the Java representation
* for XML content. The Java representation of XML
* content can consist of schema derived interfaces
* and classes representing the binding of schema
* type definitions, element declarations and model
* groups. Factory methods for each of these are
* provided in this class.
*
*/
@XmlRegistry
public class ObjectFactory {
/**
* Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: gov.lacounty.assessor.amp.data.bvm.deriveescalationpath.v1
*
*/
public ObjectFactory() {
}
/**
* Create an instance of {@link DeriveEscalationPathRequest }
*
*/
public DeriveEscalationPathRequest createDeriveEscalationPathRequest() {
return new DeriveEscalationPathRequest();
}
/**
* Create an instance of {@link BaseYearEventList }
*
*/
public BaseYearEventList createBaseYearEventList() {
return new BaseYearEventList();
}
/**
* Create an instance of {@link DeriveEscalationPathResponse }
*
*/
public DeriveEscalationPathResponse createDeriveEscalationPathResponse() {
return new DeriveEscalationPathResponse();
}
}
| [
"peddaboinakishan@gmail.com"
] | peddaboinakishan@gmail.com |
dae1619c995297783172a8db4300c8270b826816 | ac637beab94bc5372992b05e3c58181c40a7cb79 | /src/main/java/gxt/share/FileServiceAsync.java | 838d6a676809d2a02d447d3f20fccc563064d99d | [] | no_license | alexsep19/gx.case | 6d94d35b01eff665532bf72b2b88d4ab59ed1fc4 | a69112fc85482c8232e26d884995ad80305857ab | refs/heads/master | 2021-08-28T06:50:41.299165 | 2017-12-11T13:34:03 | 2017-12-11T13:34:03 | 113,862,789 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 284 | java | package gxt.share;
import java.util.List;
import com.google.gwt.user.client.rpc.AsyncCallback;
public interface FileServiceAsync {
void doTestCopy(String s, AsyncCallback<CopyModel> callback);
void doTrueCopy(List<String> atms, AsyncCallback<CopyModel> callback);
}
| [
"alexsep@isonews2.com"
] | alexsep@isonews2.com |
1989545572417a0d19945e23e71ec6cedfb955e3 | 0533d2d6fffafeaa4719784ecb125c8ac6799862 | /src/main/java/com/example/controller/StudentController.java | 9cfcb7b588d8c4e1e11588dc456268b5775a7760 | [] | no_license | apap-ekstensi-2018/tutorial8_1606954994 | a436799d8ffb692ce24c36f0b90dc2c37cdb5c32 | c338039a89b199cc2e32a12185dff65e4aeaf92a | refs/heads/master | 2020-03-14T01:58:15.898610 | 2018-04-28T08:24:36 | 2018-04-28T08:24:36 | 131,389,259 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,362 | java | package com.example.controller;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
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.RequestParam;
import com.example.model.StudentModel;
import com.example.service.StudentService;
@Controller
public class StudentController
{
@Autowired
StudentService studentDAO;
@RequestMapping("/student/add")
public String add ()
{
return "form-add";
}
@RequestMapping("/student/add/submit")
public String addSubmit (
@RequestParam(value = "npm", required = false) String npm,
@RequestParam(value = "name", required = false) String name,
@RequestParam(value = "gpa", required = false) double gpa)
{
StudentModel student = new StudentModel (npm, name, gpa);
studentDAO.addStudent (student);
return "success-add";
}
@RequestMapping("/student/view")
public String view (Model model,
@RequestParam(value = "npm", required = false) String npm)
{
StudentModel student = studentDAO.selectStudent (npm);
if (student != null) {
model.addAttribute ("student", student);
return "view";
} else {
model.addAttribute ("npm", npm);
return "not-found";
}
}
@RequestMapping("/student/view/{npm}")
public String viewPath (Model model,
@PathVariable(value = "npm") String npm)
{
StudentModel student = studentDAO.selectStudent (npm);
if (student != null) {
model.addAttribute ("student", student);
return "view";
} else {
model.addAttribute ("npm", npm);
return "not-found";
}
}
@RequestMapping("/student/viewall")
public String view (Model model)
{
List<StudentModel> students = studentDAO.selectAllStudents ();
model.addAttribute ("students", students);
return "viewall";
}
@RequestMapping("/student/delete/{npm}")
public String delete (Model model, @PathVariable(value = "npm") String npm)
{
StudentModel student = studentDAO.selectStudent (npm);
if (student != null) {
studentDAO.deleteStudent (npm);
return "delete";
} else {
return "not-found";
}
}
@RequestMapping("/student/update/{npm}")
public String update (Model model, @PathVariable(value = "npm") String npm)
{
StudentModel student = studentDAO.selectStudent (npm);
if (student != null) {
model.addAttribute("student", student);
return "form-update";
} else {
return "not-found";
}
}
@RequestMapping(value="/student/update/submit", method = RequestMethod.POST)
public String updateSubmit (@ModelAttribute StudentModel student) {
studentDAO.updateStudent (student);
return "success-update";
}
}
| [
"rinjani.samosir@gmail.com"
] | rinjani.samosir@gmail.com |
a57232dd988da1a8b081b4f8e4c1dd7e364d959a | 36c6d23e58eb87a2ac31c58b115a844d585dccfa | /src/com/yafatek/Main.java | 159899186eb9c1192989159fcff6265477375593 | [] | no_license | ferasawadi/BuilderDesignPattern | f21a5523d2904c390185ae113c5f11341b646235 | f65528cbeda41e561f0d15c10981c346fac56eee | refs/heads/master | 2020-08-13T15:12:13.562247 | 2019-10-14T08:37:54 | 2019-10-14T08:37:54 | 214,990,101 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 332 | java | package com.yafatek;
import java.io.IOException;
public class Main {
public static void main(String[] args) throws IOException {
// write your code here
OrderBuilder builder = new OrderBuilder();
OrderItems items = builder.preparePizza();
items.showItems();
System.out.println("Total Cost: " + items.getCost());
}
}
| [
"feras.alawadi@zarcony.com"
] | feras.alawadi@zarcony.com |
3b930510ed56b701e7039d50aa145075231f372b | e49bffe6fb1b90ae06cfd4b4395bfef6ae97ef93 | /springboots/Microservices/mssc-beer-service/src/main/java/elearning/sfg/beer/brewery/dtos/CustomerDto.java | 53fb0bf35dd7f024a730e60ab86e35ddd8850564 | [] | no_license | mkejeiri/Toolbox | ca86901149179eb54d2a66df18c36dfb737bc018 | a64fcf71243fedf8ad73521a827f114d912b3040 | refs/heads/master | 2023-04-09T22:41:25.131280 | 2021-04-06T12:49:01 | 2021-04-06T12:49:01 | 297,075,481 | 0 | 1 | null | 2021-01-01T18:18:35 | 2020-09-20T12:51:41 | Java | UTF-8 | Java | false | false | 884 | java | package elearning.sfg.beer.brewery.dtos;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.time.OffsetDateTime;
import java.util.UUID;
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class CustomerDto {
@JsonProperty("id")
private UUID id = null;
@JsonProperty("version")
private Integer version = null;
@JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ssZ", shape = JsonFormat.Shape.STRING)
@JsonProperty("createdDate")
private OffsetDateTime createdDate = null;
@JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ssZ", shape = JsonFormat.Shape.STRING)
@JsonProperty("lastModifiedDate")
private OffsetDateTime lastModifiedDate = null;
private String name;
}
| [
"kejeiri@gmail.com"
] | kejeiri@gmail.com |
f00b653273cdcd11e8724b52c862b239ca92dd7a | 2e5ee62c069969f16a79f511470db45d3a631ed6 | /hbkdassistant2/src/main/java/com/tofirst/study/hbkdassistant/view/RevealBackgroundView.java | d9b7d0481802fc69e6019a9522d93ebe0a277f4a | [] | no_license | CFLOVEYR/HBKDAssistant | f3a2487e1609e18fa17e92430434e2f2999738e6 | 31ae4598d9137061ac33e1c4e52cc585ffe93340 | refs/heads/master | 2021-01-19T04:06:33.182293 | 2016-02-01T16:19:19 | 2016-02-01T16:19:19 | 50,093,230 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,674 | java | package com.tofirst.study.hbkdassistant.view;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ObjectAnimator;
import android.annotation.TargetApi;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.os.Build;
import android.util.AttributeSet;
import android.view.View;
import android.view.animation.AccelerateInterpolator;
import android.view.animation.Interpolator;
/**
* Created by Miroslaw Stanek on 18.01.15.
*/
public class RevealBackgroundView extends View {
public static final int STATE_NOT_STARTED = 0;
public static final int STATE_FILL_STARTED = 1;
public static final int STATE_FINISHED = 2;
private static final Interpolator INTERPOLATOR = new AccelerateInterpolator();
private static final int FILL_TIME = 600;
private int state = STATE_NOT_STARTED;
private Paint fillPaint;
private int currentRadius;
ObjectAnimator revealAnimator;
private int startLocationX;
private int startLocationY;
private OnStateChangeListener onStateChangeListener;
public RevealBackgroundView(Context context) {
super(context);
init();
}
public RevealBackgroundView(Context context, AttributeSet attrs) {
super(context, attrs);
init();
}
public RevealBackgroundView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
init();
}
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public RevealBackgroundView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
init();
}
private void init() {
fillPaint = new Paint();
fillPaint.setStyle(Paint.Style.FILL);
fillPaint.setColor(Color.WHITE);
}
public void setFillPaintColor(int color) {
fillPaint.setColor(color);
}
public void startFromLocation(int[] tapLocationOnScreen) {
changeState(STATE_FILL_STARTED);
startLocationX = tapLocationOnScreen[0];
startLocationY = tapLocationOnScreen[1];
revealAnimator = ObjectAnimator.ofInt(this, "currentRadius", 0, getWidth() + getHeight()).setDuration(FILL_TIME);
revealAnimator.setInterpolator(INTERPOLATOR);
revealAnimator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
changeState(STATE_FINISHED);
}
});
revealAnimator.start();
}
public void setToFinishedFrame() {
changeState(STATE_FINISHED);
invalidate();
}
@Override
protected void onDraw(Canvas canvas) {
if (state == STATE_FINISHED) {
canvas.drawRect(0, 0, getWidth(), getHeight(), fillPaint);
} else {
canvas.drawCircle(startLocationX, startLocationY, currentRadius, fillPaint);
}
}
private void changeState(int state) {
if (this.state == state) {
return;
}
this.state = state;
if (onStateChangeListener != null) {
onStateChangeListener.onStateChange(state);
}
}
public void setOnStateChangeListener(OnStateChangeListener onStateChangeListener) {
this.onStateChangeListener = onStateChangeListener;
}
public void setCurrentRadius(int radius) {
this.currentRadius = radius;
invalidate();
}
public static interface OnStateChangeListener {
void onStateChange(int state);
}
}
| [
"1439504683@qq.com"
] | 1439504683@qq.com |
2e3b0fdc9649b43256e7cfde1684382a184e44d9 | a73c8639dc843560494e29cee61591711dc5b1e5 | /app/src/main/java/app/lacourt/globalchat/ui/MainScreenActivity.java | fa8615be2a5d875343f75c876c42bf99bc5bbc78 | [] | no_license | igorlacourt/GlobalChat-v1 | 4bb22c45a27f194a6b11d421b132fb64e4ebb503 | eeee632377dc2409d9f516196ab2abfcff1c6277 | refs/heads/master | 2020-08-03T12:50:50.328606 | 2019-09-30T02:19:58 | 2019-09-30T02:19:58 | 211,758,069 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 17,475 | java | package app.lacourt.globalchat.ui;
import android.Manifest;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.database.Cursor;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.provider.ContactsContract;
import android.util.Base64;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.Query;
import com.google.firebase.database.ValueEventListener;
import java.util.ArrayList;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.SearchView;
import androidx.appcompat.widget.SearchView.OnQueryTextListener;
import androidx.appcompat.widget.Toolbar;
import androidx.core.view.MenuItemCompat;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProviders;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import app.lacourt.globalchat.R;
import app.lacourt.globalchat.adapters.ChatAdapter;
import app.lacourt.globalchat.adapters.ChatItemClick;
import app.lacourt.globalchat.model.Chat;
import app.lacourt.globalchat.utils.ConnectivityHelper;
import app.lacourt.globalchat.utils.DialogHandler;
import app.lacourt.globalchat.viewmodel.MainScreenViewModel;
public class MainScreenActivity extends AppCompatActivity implements ChatItemClick {
public static final int NEW_PICTURE_REQUEST = 72;
private RecyclerView recyclerView;
private FloatingActionButton newChatButton;
private ProgressBar loadingChats;
private TextView noChatTextView;
private ChatAdapter adapter;
DialogHandler dialogHandler = null;
ArrayList<Chat> chatList;
private MainScreenViewModel viewModel;
private Button btnRetry;
private LinearLayout lyNoConnection;
private DatabaseReference dbReference;
private String currentUserId;
private FirebaseUser currentUser;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main_screen);
Toolbar toolbar = (Toolbar) findViewById(R.id.main_screen_toolbar);
setSupportActionBar(toolbar);
dbReference = FirebaseDatabase.getInstance().getReference();
currentUser = FirebaseAuth.getInstance().getCurrentUser();
currentUserId = currentUser.getUid();
ActionBar actionBar = getSupportActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setDisplayShowHomeEnabled(true);
loadingChats = (ProgressBar) findViewById(R.id.loading_chats_progress_bar);
loadingChats.setVisibility(View.VISIBLE);
noChatTextView = (TextView) findViewById(R.id.no_chats_text_view);
noChatTextView.setVisibility(View.INVISIBLE);
lyNoConnection = (LinearLayout) findViewById(R.id.include_main_screen_no_connection);
btnRetry = (Button) findViewById(R.id.btn_retry);
btnRetry.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
recreate();
}
});
lyNoConnection.setVisibility(View.INVISIBLE);
newChatButton = (FloatingActionButton) findViewById(R.id.new_chat_button);
newChatButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivityForResult(new Intent(MainScreenActivity.this,
ChooseContactActivity.class), getResources().getInteger(R.integer.CHOOSE_CONTACT_RESULT));
}
});
dialogHandler = DialogHandler.getInstance();
chatList = new ArrayList<Chat>();
recyclerView = (RecyclerView) findViewById(R.id.channels_recyclerview);
adapter = new ChatAdapter(this, chatList);
recyclerView.setAdapter(adapter);
recyclerView.setLayoutManager(new LinearLayoutManager(this));
viewModel = ViewModelProviders.of(this).get(MainScreenViewModel.class);
viewModel.getAllChats();
viewModel.allChats.observe(this, new Observer<ArrayList<Chat>>() {
@Override
public void onChanged(@Nullable final ArrayList<Chat> chats) {
Log.d("mydelete", "onChanged called.");
if (chats != null && !chats.isEmpty()) {
Log.d("opennoconection", "chats from db NOT EMPTY ");
//TODO insert the uid in the shared pref file.
SharedPreferences sharedPref = MainScreenActivity.this.getPreferences(Context.MODE_PRIVATE);
String userId = sharedPref.getString(getString(R.string.uid_key), currentUserId);
if(!userId.equals(currentUserId)) {
SharedPreferences.Editor editor = sharedPref.edit();
editor.putString(getString(R.string.uid_key), currentUserId);
editor.apply();
viewModel.deleteAllChats();
} else {
chatList.clear();
chatList.addAll(chats);
adapter.notifyDataSetChanged();
loadingChats.setVisibility(View.INVISIBLE);
noChatTextView.setVisibility(View.INVISIBLE);
}
for (Chat dbChat : chats) {
Log.d("opennoconection", "dbChat = " + dbChat.getName());
}
Log.d("opennoconection", "\n");
} else {
Log.d("opennoconection", "chats from db IS EMPTY ");
getPermissionAndFetchChats();
}
}
});
}
private void getPermissionAndFetchChats() {
Log.d("opennoconection", "\n getPermissionAndFetchChats called.");
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M
&& checkSelfPermission(Manifest.permission.READ_CONTACTS) != PackageManager.PERMISSION_GRANTED) {
requestPermissions(new String[]{Manifest.permission.READ_CONTACTS}, getResources().getInteger(R.integer.PERMISSIONS_REQUEST_READ_CONTACTS));
//After this point you wait for callback in onRequestPermissionsResult(int, String[], int[]) overriden method
} else {
fetchChatList();
}
}
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
if (requestCode == getResources().getInteger(R.integer.PERMISSIONS_REQUEST_READ_CONTACTS)) {
if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
// Permission is granted
getPermissionAndFetchChats();
} else {
Toast.makeText(this, "We can't continue without the permission.", Toast.LENGTH_SHORT).show();
}
}
}
private void fetchChatList() {
Log.d("opennoconection", "fetchChatList() called.");
if (ConnectivityHelper.isConnectedToNetwork(this)) {
Log.d("opennoconection", "App IS connected.");
chatList.clear();
DatabaseReference userChatDb = dbReference.child("user")
.child(currentUserId)
.child("chat");
userChatDb.addListenerForSingleValueEvent(new ValueEventListener() {
@Override
public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
if (dataSnapshot.exists()) {
for (DataSnapshot chat : dataSnapshot.getChildren()) {
String chatId = chat.getKey();
String contactId = chat
.child("contact")
.getValue().toString();
Log.d("mycontacts", "chatId = " + chatId + ", contactId = " + contactId);
chatList.add(new Chat(chatId, contactId, "", ""));
}
fetchContactInfo();
} else {
adapter.notifyDataSetChanged();
loadingChats.setVisibility(View.INVISIBLE);
noChatTextView.setVisibility(View.VISIBLE);
Log.d("mycontacts", "loading contacts failed.");
}
}
@Override
public void onCancelled(@NonNull DatabaseError databaseError) {
}
});
} else {
Log.d("opennoconection", "App NOT connected.");
loadingChats.setVisibility(View.INVISIBLE);
lyNoConnection.setVisibility(View.VISIBLE);
}
}
private void fetchContactInfo() {
for (final Chat chat : chatList) {
Log.d("fetchchats", "chatList.size = " + chatList.size());
Query userDb = dbReference.child("user")
.child(chat.getContactId());
userDb.addListenerForSingleValueEvent(new ValueEventListener() {
@Override
public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
if (dataSnapshot.exists()) {
String phone = dataSnapshot.child("phone").getValue().toString();
String name = getContactName(phone);
String picture = "";
Object pictureObject = dataSnapshot.child("picture").getValue();
if (pictureObject != null)
picture = pictureObject.toString();
Log.d("fetchchats", "phone = " + phone + ", picture = " + picture);
chat.setName(name);
chat.setProfilePicture(picture);
adapter.notifyDataSetChanged();
Log.d("opennoconection", "insert called for: " + chat.getName());
viewModel.insert(chat);
} else {
Log.d("fetchchats", "no dataSnapshot for .child(\"user\")\n" +
" .child(chat.getContactId()");
}
}
@Override
public void onCancelled(@NonNull DatabaseError databaseError) {
}
});
}
loadingChats.setVisibility(View.INVISIBLE);
}
//Credit for the answer on this question: https://stackoverflow.com/questions/3079365/android-retrieve-contact-name-from-phone-number
public String getContactName(final String phoneNumber) {
Uri uri = Uri.withAppendedPath(ContactsContract.PhoneLookup.CONTENT_FILTER_URI, Uri.encode(phoneNumber));
String[] projection = new String[]{ContactsContract.PhoneLookup.DISPLAY_NAME};
String contactName = "";
Cursor cursor = this.getContentResolver().query(uri, projection, null, null, null);
if (cursor != null) {
if (cursor.moveToFirst()) {
contactName = cursor.getString(0);
}
cursor.close();
}
return contactName;
}
@Override
public void onChatClick(String name, String chatId) {
Intent intent = new Intent(this, ChatActivity.class);
intent.putExtra(getString(R.string.user_name_intent), name);
intent.putExtra(getString(R.string.chat_id_intent_key), chatId);
startActivity(intent);
}
@Override
public void onChatLongClick(Chat chat) {
dbReference
.child("chat")
.child(chat.getChatId())
.removeValue();
dbReference
.child("user")
.child(currentUserId)
.child("chat")
.child(chat.getChatId())
.removeValue();
dbReference
.child("user")
.child(chat.getContactId())
.child("chat")
.child(chat.getChatId())
.removeValue();
Log.d("mydelete", "chat deleted from Firebase.");
viewModel.deleteChat(chat);
}
@Override
protected void onStop() {
super.onStop();
}
@Override
protected void onPause() {
super.onPause();
}
@Override
protected void onDestroy() {
super.onDestroy();
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.options, menu);
MenuItem menuItem = menu.findItem(R.id.search);
SearchView searchView = (SearchView) MenuItemCompat.getActionView(menuItem);
searchView.setQueryHint("Search chat...");
int searchPlateId = searchView.getContext()
.getResources()
.getIdentifier("android:id/search_plate", null, null);
View searchPlate = searchView.findViewById(searchPlateId);
if (searchPlate != null) {
int searchTextId = searchPlate.getContext()
.getResources()
.getIdentifier("android:id/search_src_text", null, null);
TextView searchText = (TextView) searchPlate.findViewById(searchTextId);
if (searchText != null) {
searchText.setTextColor(Color.WHITE);
searchText.setHintTextColor(Color.WHITE);
}
}
searchView.setIconified(true);
searchView.setOnQueryTextListener(new OnQueryTextListener() {
@Override
public boolean onQueryTextSubmit(String query) {
adapter.filter(query);
return false;
}
@Override
public boolean onQueryTextChange(String newText) {
adapter.filter(newText);
return false;
}
});
return true;
}
@Override
public boolean onSupportNavigateUp() {
onBackPressed();
return super.onSupportNavigateUp();
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
switch (id) {
case R.id.option_logout:
logout();
break;
case R.id.picture:
if (currentUser != null) {
Intent intent = new Intent(this, ProfilePictureActivity.class);
startActivityForResult(intent, getResources().getInteger(R.integer.PICTURE_RESULT));
}
break;
}
return super.onOptionsItemSelected(item);
}
@Override
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == getResources().getInteger(R.integer.PICTURE_RESULT))
viewModel.getAllChats();
//TODO debug
else if (requestCode == getResources().getInteger(R.integer.CHOOSE_CONTACT_RESULT)) {
Log.d("getchats", "Main, requestCode OK");
if (data != null && data.getExtras().getBoolean(getString(R.string.NEW_CHAT_CREATED))) {
Log.d("getchats", "Main, data OK");
viewModel.getAllChats();
}
}
}
private void logout() {
if (currentUser != null) {
FirebaseAuth.getInstance().signOut();
Intent intent = new Intent(this, LoginActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent);
finish();
}
}
@Override
protected void onStart() {
super.onStart();
Log.d("myonstart", "onStart called.");
}
public void testClick(View view) {
final ImageView img = (ImageView) findViewById(R.id.imageView);
viewModel.getPicture(currentUserId);
viewModel.userPicture.observe(this, new Observer<String>() {
@Override
public void onChanged(String s) {
img.setImageBitmap(decodeProfilePicture(s));
}
});
}
private Bitmap decodeProfilePicture(String strBase64) {
byte[] b = Base64.decode(strBase64, Base64.DEFAULT);
Bitmap bitmap = BitmapFactory.decodeByteArray(b, 0, b.length);
b = null;
return bitmap;
}
}
| [
"igorlacourt@gmail.com"
] | igorlacourt@gmail.com |
a4ac682a874f921949f90bfcd63f4c0b6c7aab97 | 7344866370bd60505061fcc7e8c487339a508bb9 | /jOpenCalendar/src/org/jopencalendar/ui/ItemPartViewLayouter.java | 8d9f7fa85820dbca5388ca9d75616d42c8bd5d55 | [] | no_license | sanogotech/openconcerto_ERP_JAVA | ed3276858f945528e96a5ccfdf01a55b58f92c8d | 4d224695be0a7a4527851a06d8b8feddfbdd3d0e | refs/heads/master | 2023-04-11T09:51:29.952287 | 2021-04-21T14:39:18 | 2021-04-21T14:39:18 | 360,197,474 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 898 | java | package org.jopencalendar.ui;
import java.util.List;
public class ItemPartViewLayouter {
public void layout(List<ItemPartView> items) {
final int size = items.size();
int maxX = 0;
for (int i = 0; i < size; i++) {
ItemPartView p = items.get(i);
for (int j = 0; j < i; j++) {
ItemPartView layoutedPart = items.get(j);
if (layoutedPart.conflictWith(p)) {
if (layoutedPart.getX() == p.getX()) {
p.setX(Math.max(p.getX(), layoutedPart.getX() + 1));
if (maxX < p.getX()) {
maxX = p.getX();
}
}
}
}
}
for (int i = 0; i < size; i++) {
ItemPartView p = items.get(i);
p.setMaxColumn(maxX + 1);
}
}
}
| [
"davask.42@gmail.com"
] | davask.42@gmail.com |
e28dd97ad10370546442124139ad1156ecc45b42 | 6171de044048d509b971c5253a3dc3f02c0018e4 | /app/src/main/java/com/arutech/sargam/player/EqualizedExoPlayer.java | f4171e886b6bd6c05c7c66d2be15cbd8b234eda1 | [] | no_license | puru-anshu/sargam | e56fed2b85d95807b2bc23de7951bef561846fb8 | 67912dde6de11e10afffa25397cd61cfbe1ed883 | refs/heads/master | 2020-12-30T11:52:28.634520 | 2019-05-09T09:51:59 | 2019-05-09T09:51:59 | 91,539,009 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,995 | java | package com.arutech.sargam.player;
import android.content.Context;
import android.content.Intent;
import android.media.audiofx.AudioEffect;
import android.media.audiofx.Equalizer;
import com.google.android.exoplayer2.ExoPlayer;
import com.google.android.exoplayer2.Format;
import com.google.android.exoplayer2.SimpleExoPlayer;
import com.google.android.exoplayer2.Timeline;
import com.google.android.exoplayer2.audio.AudioRendererEventListener;
import com.google.android.exoplayer2.decoder.DecoderCounters;
import com.google.android.exoplayer2.source.MediaSource;
import com.google.android.exoplayer2.source.TrackGroupArray;
import com.google.android.exoplayer2.trackselection.TrackSelectionArray;
public class EqualizedExoPlayer implements ExoPlayer {
private static final int NO_AUDIO_SESSION_ID = 0;
private Context mContext;
private SimpleExoPlayer mExoPlayer;
private Equalizer mEqualizer;
private boolean mEqualizerEnabled;
private Equalizer.Settings mEqualizerSettings;
public EqualizedExoPlayer(Context context, SimpleExoPlayer delegate) {
mContext = context;
mExoPlayer = delegate;
mExoPlayer.setAudioDebugListener(new EqualizerEventListener());
}
public void setEqualizerSettings(boolean enabled, Equalizer.Settings settings) {
boolean invalidate = mEqualizerEnabled != enabled || mEqualizerEnabled;
boolean wasSystem = isUsingSystemEqualizer();
mEqualizerEnabled = enabled;
mEqualizerSettings = settings;
if (invalidate) {
updateEqualizerPrefs(enabled, wasSystem);
}
}
private void updateEqualizerPrefs(boolean useCustom, boolean wasSystem) {
int audioSessionId = mExoPlayer.getAudioSessionId();
if (audioSessionId == NO_AUDIO_SESSION_ID) {
// No equalizer is currently bound. Nothing to do.
return;
}
if (useCustom) {
if (wasSystem || mEqualizer == null) {
// System -> custom
unbindSystemEqualizer(audioSessionId);
bindCustomEqualizer(audioSessionId);
} else {
// Custom -> custom
mEqualizer.setProperties(mEqualizerSettings);
}
} else {
if (!wasSystem) {
// Custom -> system
unbindCustomEqualizer();
bindSystemEqualizer(audioSessionId);
}
// Nothing to do for system -> system
}
}
private boolean isUsingSystemEqualizer() {
return mEqualizerSettings == null || !mEqualizerEnabled;
}
private void onBindEqualizer(int newAudioSessionId) {
if (isUsingSystemEqualizer()) {
bindSystemEqualizer(newAudioSessionId);
} else {
bindCustomEqualizer(newAudioSessionId);
}
}
private void bindSystemEqualizer(int audioSessionId) {
Intent intent = new Intent(AudioEffect.ACTION_OPEN_AUDIO_EFFECT_CONTROL_SESSION);
intent.putExtra(AudioEffect.EXTRA_AUDIO_SESSION, audioSessionId);
intent.putExtra(AudioEffect.EXTRA_PACKAGE_NAME, mContext.getPackageName());
mContext.sendBroadcast(intent);
}
private void bindCustomEqualizer(int audioSessionId) {
mEqualizer = new Equalizer(0, audioSessionId);
mEqualizer.setProperties(mEqualizerSettings);
mEqualizer.setEnabled(true);
}
private void onUnbindEqualizer(int oldAudioSessionId) {
if (isUsingSystemEqualizer()) {
unbindSystemEqualizer(oldAudioSessionId);
} else {
unbindCustomEqualizer();
}
}
private void unbindSystemEqualizer(int audioSessionId) {
Intent intent = new Intent(AudioEffect.ACTION_CLOSE_AUDIO_EFFECT_CONTROL_SESSION);
intent.putExtra(AudioEffect.EXTRA_AUDIO_SESSION, audioSessionId);
intent.putExtra(AudioEffect.EXTRA_PACKAGE_NAME, mContext.getPackageName());
mContext.sendBroadcast(intent);
}
private void unbindCustomEqualizer() {
if (mEqualizer != null) {
mEqualizer.setEnabled(false);
mEqualizer.release();
mEqualizer = null;
}
}
private class EqualizerEventListener implements AudioRendererEventListener {
private int lastAudioSessionId = NO_AUDIO_SESSION_ID;
@Override
public void onAudioSessionId(int audioSessionId) {
if (audioSessionId != NO_AUDIO_SESSION_ID) {
onBindEqualizer(audioSessionId);
lastAudioSessionId = audioSessionId;
}
}
@Override
public void onAudioDisabled(DecoderCounters counters) {
if (lastAudioSessionId != NO_AUDIO_SESSION_ID) {
onUnbindEqualizer(lastAudioSessionId);
}
}
@Override
public void onAudioEnabled(DecoderCounters counters) {}
@Override
public void onAudioDecoderInitialized(
String decoderName, long initializedTimestampMs, long initializationDurationMs) {
}
@Override
public void onAudioInputFormatChanged(Format format) {
}
@Override
public void onAudioTrackUnderrun(
int bufferSize, long bufferSizeMs, long elapsedSinceLastFeedMs) {
}
}
// region DELEGATED METHODS
public void setVolume(float volume) {
mExoPlayer.setVolume(volume);
}
@Override
public void addListener(EventListener listener) {
mExoPlayer.addListener(listener);
}
@Override
public void removeListener(EventListener listener) {
mExoPlayer.removeListener(listener);
}
@Override
public int getPlaybackState() {
return mExoPlayer.getPlaybackState();
}
@Override
public void prepare(MediaSource mediaSource) {
mExoPlayer.prepare(mediaSource);
}
@Override
public void prepare(MediaSource mediaSource, boolean resetPosition, boolean resetTimeline) {
mExoPlayer.prepare(mediaSource, resetPosition, resetTimeline);
}
@Override
public void setPlayWhenReady(boolean playWhenReady) {
mExoPlayer.setPlayWhenReady(playWhenReady);
}
@Override
public boolean getPlayWhenReady() {
return mExoPlayer.getPlayWhenReady();
}
@Override
public boolean isLoading() {
return mExoPlayer.isLoading();
}
@Override
public void seekToDefaultPosition() {
mExoPlayer.seekToDefaultPosition();
}
@Override
public void seekToDefaultPosition(int windowIndex) {
mExoPlayer.seekToDefaultPosition(windowIndex);
}
@Override
public void seekTo(long windowPositionMs) {
mExoPlayer.seekTo(windowPositionMs);
}
@Override
public void seekTo(int windowIndex, long windowPositionMs) {
mExoPlayer.seekTo(windowIndex, windowPositionMs);
}
@Override
public void stop() {
mExoPlayer.stop();
}
@Override
public void release() {
mExoPlayer.release();
}
@Override
public void sendMessages(ExoPlayerMessage... messages) {
mExoPlayer.sendMessages(messages);
}
@Override
public void blockingSendMessages(ExoPlayerMessage... messages) {
mExoPlayer.blockingSendMessages(messages);
}
@Override
public int getRendererCount() {
return mExoPlayer.getRendererCount();
}
@Override
public int getRendererType(int index) {
return mExoPlayer.getRendererType(index);
}
@Override
public TrackGroupArray getCurrentTrackGroups() {
return mExoPlayer.getCurrentTrackGroups();
}
@Override
public TrackSelectionArray getCurrentTrackSelections() {
return mExoPlayer.getCurrentTrackSelections();
}
@Override
public Object getCurrentManifest() {
return mExoPlayer.getCurrentManifest();
}
@Override
public Timeline getCurrentTimeline() {
return mExoPlayer.getCurrentTimeline();
}
@Override
public int getCurrentPeriodIndex() {
return mExoPlayer.getCurrentPeriodIndex();
}
@Override
public int getCurrentWindowIndex() {
return mExoPlayer.getCurrentWindowIndex();
}
@Override
public long getDuration() {
return mExoPlayer.getDuration();
}
@Override
public long getCurrentPosition() {
return mExoPlayer.getCurrentPosition();
}
@Override
public long getBufferedPosition() {
return mExoPlayer.getBufferedPosition();
}
@Override
public int getBufferedPercentage() {
return mExoPlayer.getBufferedPercentage();
}
@Override
public boolean isCurrentWindowDynamic() {
return mExoPlayer.isCurrentWindowDynamic();
}
@Override
public boolean isCurrentWindowSeekable() {
return mExoPlayer.isCurrentWindowSeekable();
}
// endregion DELEGATED METHODS
}
| [
"anshu@ubona.com"
] | anshu@ubona.com |
b4faf40f2d37ff118dafde733e38423c008e0934 | bf4968cc89fc742377e3d3b554492c33f645ea4b | /src/java/api/GetUser.java | f331d67833141b9b214b456e0bb9854dfebc4a5c | [] | no_license | TrejoYahir/intercambio-backend | 00311a6875053e5a8c388fc697372967632d093a | 626d3ad0d0f538d90e7b87329c31b9f715b06143 | refs/heads/master | 2020-03-29T08:15:09.565661 | 2018-11-22T05:04:31 | 2018-11-22T05:04:31 | 149,701,550 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,491 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package api;
import com.google.gson.Gson;
import database.Queries;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import models.User;
import org.json.simple.JSONObject;
/**
*
* @author Yahir
*/
public class GetUser extends HttpServlet {
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("application/json");
response.setCharacterEncoding("utf-8");
User result;
Gson gson = new Gson();
int id = Integer.parseInt(request.getParameter("id"));
result = Queries.searchUserById(id);
String ex;
JSONObject resp = new JSONObject();
try (PrintWriter out = response.getWriter();) {
if(result.id > 0) {
ex = gson.toJson(result);
resp.put("success", true);
resp.put("user", ex);
} else {
resp.put("success", false);
resp.put("message", "No se encontró el usuario");
}
out.print(resp);
}
}
}
| [
"yahardy58@gmail.com"
] | yahardy58@gmail.com |
272b2c8eb81b0214b6110ac56fd8657ded1719c2 | bbdb8e42d0be482e6300e04d22eb320907e29b69 | /BookManager/src/test/java/com/bookmanager/services/BookManagerCsvServiceTest.java | df2299ce4ece1142cea2aad1105d1093866d7fee | [] | no_license | Shylendra/BookManager | 7b09ea0620d720b0ad137d459f15fe59ad6bc8bf | d4d462c35e611e8d223c9004d6ccd83727409298 | refs/heads/master | 2022-02-22T11:09:25.472247 | 2022-02-18T21:40:09 | 2022-02-18T21:40:09 | 196,768,640 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,373 | java | package com.bookmanager.services;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import java.io.IOException;
import java.util.List;
import org.junit.Before;
import org.junit.Test;
import com.bookmanager.model.Book;
import com.bookmanager.model.Person;
public class BookManagerCsvServiceTest {
private BookManagerCsvService bookManagerCsvService;
private static final String PEOPLE_CSV = "./people-input.csv";
private static final String BOOKS_CSV = "./books-input.csv";
@Before
public void setUp() throws Exception {
}
@Test
public void testReadPerson() throws IOException {
bookManagerCsvService = new BookManagerCsvServiceImpl<Person>();
List<Person> people = bookManagerCsvService.read(PEOPLE_CSV, new String[]{"name","phoneNumber","emailAddress"}, Person.class);
people.forEach(p -> {
System.out.println(p);
});
assertNotNull(people);
assertEquals(3, people.size());
}
@Test
public void testReadBook() throws IOException {
bookManagerCsvService = new BookManagerCsvServiceImpl<Book>();
List<Book> books = bookManagerCsvService.read(BOOKS_CSV, new String[]{"title","author","isbn"}, Book.class);
books.forEach(p -> {
System.out.println(p);
});
assertNotNull(books);
assertEquals(4, books.size());
}
}
| [
"Shylendra@DESKTOP-9KN98S6"
] | Shylendra@DESKTOP-9KN98S6 |
895fb89bd2571342b1f95eede435277eac220eb3 | c9cdec19f3a5e85fa77e645566e5ce203955c713 | /Board/src/main/java/kr/co/vo/BoardVO.java | 59ec7b8a3dd1f877607890cf882a60a201099b4f | [] | no_license | beeetee/springBoard | 3373a78b7438e63c4aeeb334fae1e6c31154a29b | 8e278104c803b977efe5eb033bead5961e3938ad | refs/heads/master | 2022-12-25T01:22:33.777106 | 2020-01-16T13:43:49 | 2020-01-16T13:43:49 | 233,529,488 | 0 | 0 | null | 2022-12-16T12:13:56 | 2020-01-13T06:45:49 | JavaScript | UTF-8 | Java | false | false | 740 | java | package kr.co.vo;
import java.util.Date;
public class BoardVO {
private int bno;
private String title;
private String content;
private String writer;
private Date regdate;
public int getBno() {
return bno;
}
public void setBno(int bno) {
this.bno = bno;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public String getWriter() {
return writer;
}
public void setWriter(String writer) {
this.writer = writer;
}
public Date getRegdate() {
return regdate;
}
public void setRegdate(Date regdate) {
this.regdate = regdate;
}
}
| [
"beeeting1001@gmail.com"
] | beeeting1001@gmail.com |
3fae20e43a92c044b6f9ea3b63e67a2b6f347d30 | 3b7425757f0138a79d912c7f906525a8cef0b460 | /Assignments/may_22_jsp/SumOfPrimeNumber.java | 831fde45026eb47c1493bd181f04498ff2db3647 | [] | no_license | sundarsharma332/jspider_online_java_programs | 8ca626f1d3e45ea354da198521a6841487b759ae | 7f3c35ceda8f3349dd18acf79f9a25f6a135a9bf | refs/heads/master | 2023-06-14T00:32:11.323030 | 2021-07-08T09:26:55 | 2021-07-08T09:26:55 | 365,501,512 | 6 | 1 | null | null | null | null | UTF-8 | Java | false | false | 743 | java | import java.util.*;
class SumOfPrimeNumber
{
public static void main(String[] args)
{
int arr[] = ReadArray();
int sum = SumOfPrimeNumbersInArray(arr);
System.out.println(sum);
}
public static boolean isNumberPrime(int num) {
if(num == 1) return false;
for(int i = 2; i < num; i++){
if(num % i == 0) return false;
}
return true;
}
public static int SumOfPrimeNumbersInArray(int arr[]){
int sum = 0;
for(int i = 0; i < arr.length ; i++){
if(isNumberPrime(arr[i])){
sum += arr[i];
}
}
return sum;
}
public static int[] ReadArray(){
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int a[] = new int[n];
for(int i = 0; i < n ; i++){
a[i] = sc.nextInt();
}
return a;
}
}
| [
"50244255+sundarsharma332@users.noreply.github.com"
] | 50244255+sundarsharma332@users.noreply.github.com |
6c2f5f7dcc0a7d122a0f32f58698ecfff0097e6e | d88f85533c4b300aa06ed680a8c7ec5c8c16d4fb | /app/src/main/java/com/ineed/senior/ui/tools/ToolsViewModel.java | 86fb9f1ca64e4d824124664fec4518f89e863e02 | [] | no_license | INeedProject/INeedAndroidJava | 106e25d394abf791c049284821db7d89490b6f8f | e15ca4414cb3412984337a2f3acf6d47dd671e3c | refs/heads/master | 2022-09-08T13:33:36.567333 | 2020-05-19T23:12:44 | 2020-05-19T23:12:44 | 265,389,756 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 443 | java | package com.ineed.senior.ui.tools;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;
public class ToolsViewModel extends ViewModel {
private MutableLiveData<String> mText;
public ToolsViewModel() {
mText = new MutableLiveData<>();
mText.setValue("This is tools fragment");
}
public LiveData<String> getText() {
return mText;
}
} | [
"ogulcandelice22@gmail.com"
] | ogulcandelice22@gmail.com |
56799f356b38323added06c83b62ad67d00275e4 | f9b7dcbd841a0b3dd0fcd2f0941d498346f88599 | /chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentHandlerEnableDelegationsTest.java | afae8da54d0fa13972d4622f1b6ee191b7c0e07b | [
"BSD-3-Clause"
] | permissive | browser-auto/chromium | 58bace4173da259625cb3c4725f9d7ec6a4d2e03 | 36d524c252b60b059deaf7849fb6b082bee3018d | refs/heads/master | 2022-11-16T12:38:05.031058 | 2019-11-18T12:28:56 | 2019-11-18T12:28:56 | 222,449,220 | 1 | 0 | BSD-3-Clause | 2019-11-18T12:55:08 | 2019-11-18T12:55:07 | null | UTF-8 | Java | false | false | 6,530 | java | // Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package org.chromium.chrome.browser.payments;
import android.support.test.InstrumentationRegistry;
import android.support.test.filters.MediumTest;
import android.view.View;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.chromium.base.test.util.CallbackHelper;
import org.chromium.base.test.util.CommandLineFlags;
import org.chromium.base.test.util.Feature;
import org.chromium.chrome.browser.ChromeSwitches;
import org.chromium.chrome.test.ChromeJUnit4ClassRunner;
import org.chromium.chrome.test.ui.DisableAnimationsTestRule;
import org.chromium.content_public.browser.test.util.JavaScriptUtils;
import org.chromium.net.test.EmbeddedTestServer;
import org.chromium.net.test.ServerCertificate;
/** An integration test for shipping address and payer's contact information delegation. */
@RunWith(ChromeJUnit4ClassRunner.class)
@CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE,
PaymentRequestTestRule.ENABLE_EXPERIMENTAL_WEB_PLATFORM_FEATURES})
@MediumTest
public class PaymentHandlerEnableDelegationsTest {
// Disable animations to reduce flakiness.
@ClassRule
public static DisableAnimationsTestRule sNoAnimationsRule = new DisableAnimationsTestRule();
// Open a tab on the blank page first to initiate the native bindings required by the test
// server.
@Rule
public PaymentRequestTestRule mRule = new PaymentRequestTestRule("about:blank");
// Host the tests on https://127.0.0.1, because file:// URLs cannot have service workers.
private EmbeddedTestServer mServer;
@Before
public void setUp() throws Throwable {
mServer = EmbeddedTestServer.createAndStartHTTPSServer(
InstrumentationRegistry.getContext(), ServerCertificate.CERT_OK);
mRule.startMainActivityWithURL(
mServer.getURL("/components/test/data/payments/payment_handler.html"));
// Find the web contents where JavaScript will be executed and instrument the browser
// payment sheet.
mRule.openPage();
}
private void installPaymentHandlerWithDelegations(String delegations) throws Throwable {
Assert.assertEquals("\"success\"",
JavaScriptUtils.runJavascriptWithAsyncResult(
mRule.getActivity().getCurrentWebContents(),
"install().then(result => {domAutomationController.send(result);});"));
Assert.assertEquals("\"success\"",
JavaScriptUtils.runJavascriptWithAsyncResult(
mRule.getActivity().getCurrentWebContents(),
"enableDelegations(" + delegations
+ ").then(result => {domAutomationController.send(result);});"));
}
@After
public void tearDown() {
mServer.stopAndDestroyServer();
}
private void createPaymentRequestAndWaitFor(String paymentOptions, CallbackHelper helper)
throws Throwable {
int callCount = helper.getCallCount();
Assert.assertEquals("\"success\"",
mRule.runJavaScriptCodeInCurrentTab(
"paymentRequestWithOptions(" + paymentOptions + ");"));
helper.waitForCallback(callCount);
}
@Test
@Feature({"Payments"})
@MediumTest
public void testShippingDelegation() throws Throwable {
installPaymentHandlerWithDelegations("['shippingAddress']");
// The pay button should be enabled when shipping address is requested and the selected
// payment instrument can provide it.
createPaymentRequestAndWaitFor("{requestShipping: true}", mRule.getReadyToPay());
}
@Test
@Feature({"Payments"})
@MediumTest
public void testContactDelegation() throws Throwable {
installPaymentHandlerWithDelegations("['payerName', 'payerEmail', 'payerPhone']");
// The pay button should be enabled when payer's contact information is requested and the
// selected payment instrument can provide it.
createPaymentRequestAndWaitFor(
"{requestPayerName: true, requestPayerEmail: true, requestPayerPhone: true}",
mRule.getReadyToPay());
}
@Test
@Feature({"Payments"})
@MediumTest
public void testShippingAndContactInfoDelegation() throws Throwable {
installPaymentHandlerWithDelegations(
"['shippingAddress', 'payerName', 'payerEmail', 'payerPhone']");
// The pay button should be enabled when shipping address and payer's contact information
// are requested and the selected payment instrument can provide them.
createPaymentRequestAndWaitFor(
"{requestShipping: true, requestPayerName: true, requestPayerEmail: true,"
+ " requestPayerPhone: true}",
mRule.getReadyToPay());
}
@Test
@Feature({"Payments"})
@MediumTest
public void testPartialDelegationShippingNotSupported() throws Throwable {
installPaymentHandlerWithDelegations("['payerName', 'payerEmail', 'payerPhone']");
createPaymentRequestAndWaitFor(
"{requestShipping: true, requestPayerName: true, requestPayerEmail: true}",
mRule.getReadyForInput());
// Shipping section must exist in payment sheet since shipping address is requested and
// won't be provided by the selected payment handler.
Assert.assertEquals(View.VISIBLE,
mRule.getPaymentRequestUI().getShippingAddressSectionForTest().getVisibility());
}
@Test
@Feature({"Payments"})
@MediumTest
public void testPartialDelegationContactInfoNotSupported() throws Throwable {
installPaymentHandlerWithDelegations("['shippingAddress']");
createPaymentRequestAndWaitFor(
"{requestShipping: true, requestPayerName: true, requestPayerEmail: true}",
mRule.getReadyForInput());
// Contact section must exist in payment sheet since payer's name and email are requested
// and won't be provided by the selected payment handler.
Assert.assertEquals(View.VISIBLE,
mRule.getPaymentRequestUI().getContactDetailsSectionForTest().getVisibility());
}
}
| [
"commit-bot@chromium.org"
] | commit-bot@chromium.org |
a05b02b4172276847ef3f9a9319da9210e89a93b | 99bb007e8b4dcaabb554dd428f83a01a9769ae6a | /src/main/java/com/lariicruz/sistema/vendas/repository/ProdutoRepository.java | 5d8f289994e469050f64262e5e5244cf1e52ad91 | [] | no_license | lariicruz/sistema-vendas | a3dfa7354188d378d433b3595965b9e655b37272 | 3ae86e7c0fa153152147d8311f65473db9f1945b | refs/heads/master | 2023-07-01T09:43:01.611794 | 2021-07-31T21:57:42 | 2021-07-31T21:57:42 | 386,039,983 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 331 | java | package com.lariicruz.sistema.vendas.repository;
import com.lariicruz.sistema.vendas.domain.Produto;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
@Repository
public interface ProdutoRepository extends JpaRepository<Produto,Integer> {
}
| [
"mlp-larissa@hotmail.com"
] | mlp-larissa@hotmail.com |
6354b1e24ebb1922b9bb78d1465fb59a99a521b9 | 200efe3aba2d4aeb84825a0f9f9b0fa8f4927e71 | /test.main/test.web/src/main/java/test/web/UserCtrl.java | 48a4cbff7cf5331764b1c728ef980a278d9b7877 | [] | no_license | deeplyloving/springwebfragment | a65f2ae20f39de245e574d35907282f7c3d59779 | 2a84dda33ae76eee83797f952d7f1a3bb138255d | refs/heads/master | 2021-01-22T09:47:11.856947 | 2014-09-23T09:04:41 | 2014-09-23T09:04:41 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,536 | java | package test.web;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.test.base.service.MenuExpoint;
import org.test.base.service.MenuService;
import org.test.model.User;
import org.test.service.UserService;
import org.test.web.core.BaseCtrl;
@Controller
public class UserCtrl extends BaseCtrl implements MenuExpoint {
@Autowired
private UserService service;
@Autowired
private MenuService menuservice;
@RequestMapping("index")
public String index() {
service.hello();
model.addAttribute("menus", getMenus());
menuservice.test();
return "index";
}
@RequestMapping("save")
public @ResponseBody String save() {
service.saveOrUpdate(new User());
return "保存用户成功!";
}
@RequestMapping("list")
public @ResponseBody String list() {
return service.list().toString();
}
@Override
public List<Map<String, String>> registerMenu(
List<Map<String, String>> menus) {
Map<String,String> menu = new HashMap<String,String>();
menu.put("name", "testweb0 index");
menu.put("url", "/testweb0/index");
menus.add(menu);
menu = new HashMap<String,String>();
menu.put("name", "testweb0 save");
menu.put("url", "/testweb0/save");
menus.add(menu);
return menus;
}
}
| [
"liucf@liucf-pc"
] | liucf@liucf-pc |
23a22eddb79db7a950a2c45c7baa2e4f8ab3f8d0 | c330295c0562629ef82900b03caab570c37b6bba | /app/src/main/java/com/sunil/recyclerviewviewpager/manager/DataManager.java | 948f902003858e2db78361bb9a32c12a9efdcd90 | [] | no_license | v1pu/RecyclerViewViewpager | 82658bafe49ba4e7acbee3673cc85e89a7b70b2f | 450db12647f7b22d360648efc90862d3fed043e6 | refs/heads/master | 2020-03-08T16:39:55.201770 | 2016-11-23T08:03:26 | 2016-11-23T08:03:26 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,512 | java | package com.sunil.recyclerviewviewpager.manager;
import android.content.Context;
import com.sunil.recyclerviewviewpager.MainApplication;
import com.sunil.recyclerviewviewpager.daogen.DaoSession;
import com.sunil.recyclerviewviewpager.daogen.DataWall;
import com.sunil.recyclerviewviewpager.daogen.DataWallDao;
import java.util.List;
/**
* Created by kuliza-195 on 11/22/16.
*/
public class DataManager {
public static DataWall load(Context ctx, long id) {
return getDataDao(ctx).load(id);
}
public static List<DataWall> loadAll(Context ctx) {
return getDataDao(ctx).loadAll();
}
public static List<DataWall> loadByQuery(Context ctx, int nameId) {
List<DataWall> dataModels = getDataDao(ctx).queryBuilder()
.where(DataWallDao.Properties.Name_id.eq(nameId))
.list();
return dataModels;
}
public static long insertOrReplace(Context ctx, DataWall dataWall) {
return getDataDao(ctx).insertOrReplace(dataWall);
}
public static void remove(Context ctx, DataWall datawall) {
getDataDao(ctx).delete(datawall);
}
public static void removeAll(Context ctx) {
getDataDao(ctx).deleteAll();
}
private static DataWallDao getDataDao(Context c) {
// get the data DAO
DaoSession daoSession = ((MainApplication) MainApplication.getAppContext()).getDaoSession();
DataWallDao datawallDao = daoSession.getDataWallDao();
return datawallDao ;
}
}
| [
"sunil.kumar@kuliza.com"
] | sunil.kumar@kuliza.com |
a5f85438782226652f1d813d5c9806dc02696ac7 | a548604eeb2849f8c90fab8d0964e2181c3d8407 | /app/src/main/java/com/example/lhainan/simpleaccount/dummy/DummyContent.java | 5a385e81017235aba695c858265dcfb1b6799ed1 | [] | no_license | linhainan/SimpleAccount | ce53b61831ffe318833c0db680dc3158d0c2d189 | e1d3363e21bc0f22f196338c29a1c3f3f0d6f062 | refs/heads/master | 2021-01-10T08:41:26.082448 | 2015-12-12T14:37:55 | 2015-12-12T14:37:55 | 47,127,717 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,954 | java | package com.example.lhainan.simpleaccount.dummy;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Helper class for providing sample content for user interfaces created by
* Android template wizards.
* <p>
* TODO: Replace all uses of this class before publishing your app.
*/
public class DummyContent {
/**
* An array of sample (dummy) items.
*/
public static final List<DummyItem> ITEMS = new ArrayList<DummyItem>();
/**
* A map of sample (dummy) items, by ID.
*/
public static final Map<String, DummyItem> ITEM_MAP = new HashMap<String, DummyItem>();
private static final int COUNT = 25;
static {
// Add some sample items.
for (int i = 1; i <= COUNT; i++) {
addItem(createDummyItem(i));
}
}
private static void addItem(DummyItem item) {
ITEMS.add(item);
ITEM_MAP.put(item.id, item);
}
private static DummyItem createDummyItem(int position) {
return new DummyItem(String.valueOf(position), "Item " + position, makeDetails(position));
}
private static String makeDetails(int position) {
StringBuilder builder = new StringBuilder();
builder.append("Details about Item: ").append(position);
for (int i = 0; i < position; i++) {
builder.append("\nMore details information here.");
}
return builder.toString();
}
/**
* A dummy item representing a piece of content.
*/
public static class DummyItem {
public final String id;
public final String content;
public final String details;
public DummyItem(String id, String content, String details) {
this.id = id;
this.content = content;
this.details = details;
}
@Override
public String toString() {
return content;
}
}
}
| [
"lhainan09@163.com"
] | lhainan09@163.com |
f2ce97759957082e5e1cfcbeb693e1b37805a028 | 43792f66a0f7d5695eb6dc95d44030bfd663f42e | /src/com/nsn/web/lte/cmcc/anhui/CustomerServiceSystem/controller/DateFromHbase.java | b0cbfa7bb0eb424e08d1201ae45e66cc5bd99407 | [] | no_license | Mr-liukang/com.nsn.web.lte.cmcc.anhui.CustomerServiceSystem | 85aa0ed662706b6c4bd6d8eefc4d4183e6d26412 | 5bafe144120612a21b72836c1017e8e6da181709 | refs/heads/master | 2020-10-01T09:30:15.850602 | 2020-01-14T01:37:08 | 2020-01-14T01:37:08 | 227,509,425 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 15,570 | java | package com.nsn.web.lte.cmcc.anhui.CustomerServiceSystem.controller;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.hadoop.hbase.Cell;
import org.apache.hadoop.hbase.client.Result;
import org.apache.hadoop.hbase.client.ResultScanner;
import org.apache.hadoop.hbase.util.Bytes;
import com.nsn.web.lte.cmcc.anhui.CustomerServiceSystem.enums.BusinessTypeEnum;
import com.nsn.web.lte.cmcc.anhui.CustomerServiceSystem.utils.DateUtil;
import com.nsn.web.lte.cmcc.anhui.CustomerServiceSystem.utils.HBaseUtil;
public class DateFromHbase {
private static List<List<String>> list = new ArrayList();
private static final String tablePreix = "npodo:";
//private static final String tablePreix = "";
private static final String singaTableName = tablePreix+"rpt_cus_ser_problem_delimit_s1mme";
private static List<String> httpSpecKeyList;
private static List<String> S1mmSpecKeyList;
private static List<String> ltehourKeyList;
static {
String[] lte_wxdw_xdrmr_hour = {
"cell_id",
"source_flag",
"procedure_start_time",
"procedure_end_time",
"procedure_end_ms_time",
"procedure_start_ms_time",
"local_province",
"local_city",
"owner_province",
"location_longitude",
"location_latitude",
"ulsinr",
"duration",
"owner_city",
"roaming_type",
"imsi",
"imei",
"phr",
"msisdn",
"rsrp",
"rsrq",
"ltescsinrul",
"flow_firfail_time",
"p_day",
"hs",
"filvetime",
"enb_received_ind",
"poor_coverage_ind",
"dl_interfe_ind",
"ul_poor_sinr_ind",
"overlap_ind",
"cross_ind",
"uepoorphr_ind",
"uephr",
"prb_highusage_ind",
"cellrbpayload_id",
"prach_highusage_ind",
"cellprachpayload_id",
"pdcch_highusage_ind",
"alarm_ind",
"nalarm_ind",
"mod3_interfe_ind",
"neigh_problem_ind",
"ul_interfe_ind",
"cellpdcchpayload_id",
"high_conusers_ind",
"avg_cell_eta",
"ready1",
"ready2",
"ready3",
"ready4",
"ready5",
"ready6",
"ready7"
};
String[] rpt_cus_ser_http_spec_detail = {
"imsi",
"msisdn",
"imei",
"ecgi",
"rat",
"protocol_id",
"service_type",
"start_time",
"end_time",
"duration",
"inputoctets",
"output_octets",
"recordclosecause",
"tcp_ooo_ul_packets",
"tcp_ooo_dl_packets",
"tcp_retrans_ul_packets",
"tcp_retrans_dl_packets",
"tcpsetupresponsedelay",
"tcpsetupackdelay",
"delay_setup_firsttransaction",
"delay_firsttransaction_firstrespackt",
"tcp_syn_number",
"tcp_connetstate",
"sessionstopflag",
"http_action",
"httpstatus",
"resp_delay",
"tcp_syn_time",
"tcp_synack_time",
"tcp_ack_time",
"actiontime",
"firstpackettime",
"pageopentime",
"lastpacktime",
"pagevolume",
"last_ack_time",
"title",
"firstfinacktime",
"dnsquerytime",
"dnsresponsetime",
"dnsflowid",
"firstscreenfintime",
"app_sub_type",
"window_size",
"abnormal_sort",
"page_failure_delimiting",
"first_page_delay_delimiting",
"dns_delay_delimiting",
"tcp_delay_upper_interf_delimiting",
"tcp_delay_lower_interf_delimiting",
"page_throughput_delimiting",
"city",
"cell_name",
"app_name",
"app_sub_name",
"rsrp",
"rsrq",
"ulsinr",
"wireless_postion_result"
};
String[] rpt_cus_ser_signaling_detail = {
"interface",
"imsi",
"imei",
"msisdn",
"home_province",
"procedure_type",
"start_time",
"end_time",
"status",
"request_cause",
"req_cause_group",
"failure_cause",
"fail_cause_group",
"keyword",
"mme_ue_s1ap_id",
"target_enb_id",
"user_ipv4",
"user_ipv6",
"mme_ip",
"enb_ip",
"tai",
"ecgi",
"apn",
"enb_ue_s1ap_id",
"eps_bearer_number",
"bearer_id_1",
"bearer_type_1",
"bearer_qci_1",
"bearer_status_1",
"bearer_id_2",
"bearer_type_2",
"bearer_qci_2",
"bearer_status_2",
"bearer_id_3",
"bearer_type_3",
"bearer_qci_3",
"bearer_status_3",
"problem_delimit",
"city",
"cell_name",
"proc_type_name",
"rsrp",
"rsrq",
"ulsinr",
"wireless_postion_result"
};
httpSpecKeyList=Arrays.asList(rpt_cus_ser_http_spec_detail);
S1mmSpecKeyList=Arrays.asList(rpt_cus_ser_signaling_detail);
ltehourKeyList=Arrays.asList(lte_wxdw_xdrmr_hour);
list.add(ltehourKeyList);
}
/**
* @param map
* @return
*/
public List<Map<String, Object>> getDataFromHbaseDetail(String sdate,String edate,String phone,String table,int index) {
List<Map<String, Object>> allHbaseData = new ArrayList<Map<String, Object>>();
Map<String, Object> map = new HashMap<>();
try {
map = requestParamProcessSecondline(sdate,edate,phone,"0","","");
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
map.put("type", BusinessTypeEnum.DOLOCAL.getCode());
List<String> rowkeyList = DateUtil.getAllDayRowKey(map, "");
System.out.println("开始从"+table+"查询数据 ...");
for (String rowkey : rowkeyList) {
String[] rowkeys=rowkey.split("#");
String[] rowkeys_start=rowkeys[0].split("_");
String startRowkey = rowkeys_start[0]+"_"+rowkeys_start[1];
String[] rowkeys_end=rowkeys[1].split("_");
String endRowkey = rowkeys_end[0]+"_"+rowkeys_end[1];
//分表
String tableName = table + "_" +rowkeys[2];
List<Map<String, Object>> hbaseData = getHbaseData(tablePreix+tableName, startRowkey, endRowkey, list.get(index));
allHbaseData.addAll(hbaseData);
}
System.out.println("从"+table+"查询出的数据 "+allHbaseData);
return allHbaseData;
}
/**
* @param map
* @return
*/
public List<Map<String, Object>> getHttpSpecDetail(String sdate,String edate,String phone,String table) {
List<Map<String, Object>> allHbaseData = new ArrayList<Map<String, Object>>();
Map<String, Object> map = new HashMap<>();
try {
map = requestParamProcessSecondline(sdate,edate,phone,"0","","");
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
map.put("type", BusinessTypeEnum.DOLOCAL.getCode());
List<String> rowkeyList = DateUtil.getAllDayRowKey(map, "");
for (String rowkey : rowkeyList) {
String[] rowkeys=rowkey.split("#");
String[] rowkeys_start=rowkeys[0].split("_");
String startRowkey = rowkeys_start[0]+"_"+rowkeys_start[1];
String[] rowkeys_end=rowkeys[1].split("_");
String endRowkey = rowkeys_end[0]+"_"+rowkeys_end[1];
//分表
String tableName = table + "_" +rowkeys[2];
List<Map<String, Object>> hbaseData = getHbaseData(tablePreix+tableName, startRowkey, endRowkey, httpSpecKeyList);
allHbaseData.addAll(hbaseData);
}
System.out.println("从"+table+"查询出的数据 "+allHbaseData);
return allHbaseData;
}
/**
* @param map
* @return
*/
public List<Map<String, Object>> getS1mmSpecDetail(String sdate,String edate,String phone,String table) {
List<Map<String, Object>> allHbaseData = new ArrayList<Map<String, Object>>();
Map<String, Object> map = new HashMap<>();
try {
map = requestParamProcessSecondline(sdate,edate,phone,"0","","");
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
map.put("type", BusinessTypeEnum.DOLOCAL.getCode());
List<String> rowkeyList = DateUtil.getAllDayRowKey(map, "");
for (String rowkey : rowkeyList) {
String[] rowkeys=rowkey.split("#");
String[] rowkeys_start=rowkeys[0].split("_");
String startRowkey = rowkeys_start[0]+"_"+rowkeys_start[1];
String[] rowkeys_end=rowkeys[1].split("_");
String endRowkey = rowkeys_end[0]+"_"+rowkeys_end[1];
//分表
String tableName = table + "_" +rowkeys[2];
List<Map<String, Object>> hbaseData = getHbaseData(tablePreix+tableName, startRowkey, endRowkey, S1mmSpecKeyList);
allHbaseData.addAll(hbaseData);
}
System.out.println("从"+table+"查询出的数据 "+allHbaseData);
return allHbaseData;
}
/**
* @param tableName
* @param startRowKey
* @param endRowKey
* @param keyList 传入null时候 ,随机生成key
* @return
*/
private List<Map<String, Object>> getHbaseData(String tableName, String startRowKey, String endRowKey,List<String> keyList) {
List<Map<String, Object>> rList = new ArrayList<>();
ResultScanner scanner = HBaseUtil.getScanner(tableName, startRowKey, endRowKey);
// log.info("==================================>1");
try {
for (Result result : scanner) {
// log.info("==================================>1");
List valueList = new ArrayList();
for (Cell cell : result.rawCells()) {
// log.info("value值得:" + Bytes.toString(cell.getValue()));
String[] split = Bytes.toString(cell.getValue()).split(",");
System.out.println("split "+split.toString());
valueList = Arrays.asList(split);
System.out.println("valueList "+valueList);
}
Map<String, Object> data = new HashMap<>();
if (null != keyList && keyList.size() > 0) {
if (valueList.size() > 0) {
/* for (int i = 0; i < valueList.size(); i++) {
for (int j = 0; j < keyList.size(); j++) {
if (i == j) {
data.put(keyList.get(j), valueList.get(i));
continue;
}
}
}*/
for (int i = 0; i < keyList.size(); i++) {
for (int j = 0; j < valueList.size(); j++) {
if (i == j) {
data.put(keyList.get(i), valueList.get(j));
continue;
}
}
if(i>valueList.size()-1) {
data.put(keyList.get(i),"");
}
}
}
} else {
if (valueList.size() > 0) {
for (int i = 0; i < valueList.size(); i++) {
for (int j = 0; j < keyList.size(); j++) {
if (i == j) {
data.put(j + "", valueList.get(i));
continue;
}
}
}
}
}
rList.add(data);
}
System.out.println(
"getHbaseData---> "+rList.size()
+"数据查询表:table=" + tableName
+ " startRowKey=" + startRowKey
+ " endRowKey=" + endRowKey);
return rList;
} catch ( Exception e ) {
System.out.println("没有表头的数据查询异常:table=" + tableName + " startRowKey=" + startRowKey + " endRowKey=" + endRowKey
+"getHbaseData---> "+rList);
} finally {
if (null != scanner)
scanner.close();
}
return rList;
}
/**
* 请求参数处理..
*
* @param sdate
* @param edate
* @param phone
* @param custom 自定义参数
* @param <T>
* @return
* @throws ParseException
*/
private Map<String, Object> requestParamProcessSecondline(String sdate, String edate, String phone, String module, String complaint, String uuidExcel) throws ParseException {
Map<String, Object> map = new HashMap<>();
sdate = sdate.trim()+" 00:00:00";;
edate = edate.trim()+" 23:59:59";
/* sdate = sdate.trim();
edate = edate.trim();*/
map.put("sdate", sdate.replaceAll("-","").replaceAll(" ","").replaceAll(":",""));
map.put("edate", edate.replaceAll("-","").replaceAll(" ","").replaceAll(":",""));
phone = phone.trim();
phone= new StringBuilder(phone).reverse().toString();
map.put("phone", phone);
map.put("complaint", complaint);
map.put("module", module);
map.put("uuidExcel", uuidExcel);
// 计算时间差值 传入控制变量
long limit = 70;//阈值 70小时
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
long diff = (dateFormat.parse(edate).getTime() - dateFormat.parse(sdate).getTime()) / (1000 * 3600);
boolean is_exception = diff > limit ? true : false;//时间间隔大于70小时 启用异常事件筛选逻辑
map.put("is_exception", is_exception);
// 获取时间段内的整点时间
List<String> dates = DateUtil.findDates(sdate, edate);
map.put("dates", dates);
map.put("startRowKey_t", phone + "_" + sdate.replaceAll("-", "").replace(" ", "").replaceAll(":", ""));
map.put("endRowKey_t", phone + "_" + edate.replaceAll("-", "").replace(" ", "").replaceAll(":", ""));
sdate = sdate.substring(0, sdate.lastIndexOf(":")).replaceAll("-", "").replace(" ", "").replaceAll(":", "");
edate = edate.substring(0, edate.lastIndexOf(":")).replaceAll("-", "").replace(" ", "").replaceAll(":", "");
// 分钟类型参数
map.put("startRowKey", phone + "_" + sdate);
map.put("endRowKey", phone + "_" + edate);
// 秒级 类型参数
map.put("startRowKey_sec", phone + "_" + sdate + "00");
map.put("endRowKey_sec", phone + "_" + edate + "00");
// 用户名个性化参数
/* map.put("startRowKey_sec_type_zero", phone + "_" + sdate + "00_0");
map.put("endRowKey_sec_type_zero", phone + "_" + edate + "00_0");
map.put("startRowKey_sec_type_one", phone + "_" + sdate + "00_1");
map.put("endRowKey_sec_type_one", phone + "_" + edate + "00_1");
map.put("startRowKey_sec_type_two", phone + "_" + sdate + "00_2");
map.put("endRowKey_sec_type_two", phone + "_" + edate + "00_2");*/
map.put("startRowKey_sec_type_zero", phone + "_" + sdate + "00");
map.put("endRowKey_sec_type_zero", phone + "_" + edate + "00");
map.put("startRowKey_sec_type_one", phone + "_" + sdate + "00");
map.put("endRowKey_sec_type_one", phone + "_" + edate + "00");
map.put("startRowKey_sec_type_two", phone + "_" + sdate + "00");
map.put("endRowKey_sec_type_two", phone + "_" + edate + "00");
return map;
}
}
| [
"liukang@hydsoft.com"
] | liukang@hydsoft.com |
13334c1de3e98a50106af491926a327c42bc3cbf | 8cb9eb783ddca4e59ee43efc5c41dfc497f0959a | /chameleon-core/src/main/java/fr/antoineaube/chameleon/core/processes/ChameleonProcess.java | 31b668ba91cb3b58a176c0565aa34027237cf29d | [
"MIT"
] | permissive | antoineaube/Chameleon | c7b0cd6db87b6c0f75ff6fa2bed7594e22daf6a4 | 0510a9c742b18dc110ac21399d6c1fcdb6565d14 | refs/heads/master | 2020-03-20T14:20:33.380805 | 2018-06-16T22:14:04 | 2018-06-16T22:14:04 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 441 | java | package fr.antoineaube.chameleon.core.processes;
import fr.antoineaube.chameleon.core.configurations.ChameleonConfiguration;
public abstract class ChameleonProcess {
private final ChameleonConfiguration configuration;
public ChameleonProcess(ChameleonConfiguration configuration) {
this.configuration = configuration;
}
protected ChameleonConfiguration getConfiguration() {
return configuration;
}
}
| [
"aube.antoine@protonmail.com"
] | aube.antoine@protonmail.com |
f4d8fad1a8def1be92802240a44105a6ac74d32d | 4a6dfeb4fd4936c9abea24a7ffc19e25d9e55fab | /app/src/main/java/com/Mezda/SIMAC/Methods/SharedPreference.java | 1888d26289adb78ea94345edbba8ec56ae2b083d | [] | no_license | LuisMorales95/SIMAC | 622ef4e4efcf08b6645650716178ff746da17770 | 38f1f2e2b1783fc9fc647b01ecde129752b15e8c | refs/heads/master | 2020-03-24T02:43:47.607155 | 2019-01-10T11:33:49 | 2019-01-10T11:33:49 | 142,388,187 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 776 | java | package com.Mezda.SIMAC.Methods;
import android.content.Context;
import android.content.SharedPreferences;
import com.Mezda.SIMAC.UserData;
import static com.Mezda.SIMAC.Methods.VolleySingleton.SuperContext;
public class SharedPreference {
public static void SETSharedPreferences(String Tag, String Value) {
SharedPreferences preferences = SuperContext().getSharedPreferences(UserData.Credential, Context.MODE_PRIVATE);
SharedPreferences.Editor editor = preferences.edit();
editor.putString(Tag, Value);
editor.apply();
}
public static String GETSharedPreferences(String Tag, String Value) {
SharedPreferences preferences = SuperContext().getSharedPreferences(UserData.Credential, Context.MODE_PRIVATE);
return preferences.getString(Tag, Value);
}
}
| [
"proyectdeveloper@outlook.com"
] | proyectdeveloper@outlook.com |
10ab56f53dc2fd745d7c0340a53babd7fe9d78e3 | 55afce2400d9e7e438f8691511790fa0dd3b00b0 | /user-service/src/main/java/com/barclays/userservice/config/UserServiceConfig.java | 492a30aa96624bb1c255d2e73fa420ac8434f093 | [] | no_license | ashavkumar/Training-Portal-Assignment-Api | 858246be7b215ea2b3df2dfe7295dc4d995cf65c | 52b0e92a45139ef1298c1d50f4fee2fcd597a955 | refs/heads/master | 2022-11-23T05:45:15.439038 | 2020-07-27T07:42:38 | 2020-07-27T07:42:38 | 279,507,616 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 413 | java | package com.barclays.userservice.config;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;
@Configuration
public class UserServiceConfig {
@Bean
@LoadBalanced
RestTemplate restTemplate() {
return new RestTemplate();
}
}
| [
"ashav21011996@gmail.com"
] | ashav21011996@gmail.com |
94f865815c1eaeb1d507144a4e73fe528a457487 | 3b048f66060d647447d61a23a36931f1da062792 | /JavaWeb/黑马Java培训/demoShoppingMall/src/rainy/utils/UploadUtils.java | df4eec52b74c9563ee6df7a2ca6b32deb11d6d72 | [] | no_license | rainyrun/practice | f5d68b11bb0e7fa870a7f4639851f8d6bd54a185 | f49c3a1cadf04fbdb262c46219a8e276edefb07c | refs/heads/master | 2021-03-01T15:01:13.500907 | 2020-03-08T04:14:22 | 2020-03-08T04:14:22 | 245,794,284 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,513 | java | package rainy.utils;
import java.util.UUID;
public class UploadUtils {
/**
* 获取随机名称
* @param realName 真实名称
* @return uuid
*/
public static String getUUIDName(String realName){
//realname 可能是 1.jpg 也可能是 1
//获取后缀名
int index = realName.lastIndexOf(".");
if(index==-1){
return UUID.randomUUID().toString().replace("-", "").toUpperCase();
}else{
return UUID.randomUUID().toString().replace("-", "").toUpperCase()+realName.substring(index);
}
}
/**
* 获取文件真实名称
* @param name
* @return
*/
public static String getRealName(String name){
// c:/upload/1.jpg 1.jpg
//获取最后一个"/"
int index = name.lastIndexOf("\\");
return name.substring(index+1);
}
/**
* 获取文件目录
* @param name 文件名称
* @return 目录
*/
public static String getDir(String name){
int i = name.hashCode();
String hex = Integer.toHexString(i);
int j=hex.length();
for(int k=0;k<8-j;k++){
hex="0"+hex;
}
return "/"+hex.charAt(0)+"/"+hex.charAt(1);
}
@SuppressWarnings("unused")
public static void main(String[] args) {
//String s="G:\\day17-基础加强\\resource\\1.jpg";
String s="1.jgp";
String realName = getRealName(s);
//System.out.println(realName);
String uuidName = getUUIDName(realName);
//System.out.println(uuidName);
String dir = getDir(realName);
System.out.println(dir);
}
}
| [
"runlei123@126.com"
] | runlei123@126.com |
20a5957a9396ed0de3411be1b2198ba6ba662ad7 | 2e1c3b6a76cb17383421105298f9c5f9aa048ee0 | /SoftUni/Programming Basics/2. Simple Calculations/A11_USDtoBGN.java | 855608d73dc8b991141074330034780a6c7e581c | [] | no_license | viewless/Skillreceiving | e31a0c1e4177eefea3d2288317026fb1777ae4bc | 3a5a5860c4595ca108d531d5b3b1248e60e0f0ae | refs/heads/master | 2020-06-11T14:16:52.386960 | 2019-06-27T13:57:01 | 2019-06-27T13:57:01 | 193,995,531 | 0 | 0 | null | 2019-06-27T00:29:29 | 2019-06-27T00:29:28 | null | UTF-8 | Java | false | false | 280 | java | import java.util.Scanner;
public class L_USDtoBGN {
public static void main(String[] args) {
Scanner Console = new Scanner(System.in);
double USD = Console.nextDouble();
double BGN = USD * 1.79549;
System.out.printf("%.2f", BGN);
}
} | [
"37806520+skilldeliver@users.noreply.github.com"
] | 37806520+skilldeliver@users.noreply.github.com |
fa2da0a360ef3f19d3b48a162af2abd31b5f9ad6 | cf729a7079373dc301d83d6b15e2451c1f105a77 | /adwords_appengine/src/main/java/com/google/api/ads/adwords/jaxws/v201601/cm/BudgetServiceInterfacequeryResponse.java | 60cebb09032c785cf934f4d7dac5b22163f70f56 | [] | no_license | cvsogor/Google-AdWords | 044a5627835b92c6535f807ea1eba60c398e5c38 | fe7bfa2ff3104c77757a13b93c1a22f46e98337a | refs/heads/master | 2023-03-23T05:49:33.827251 | 2021-03-17T14:35:13 | 2021-03-17T14:35:13 | 348,719,387 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,538 | java |
package com.google.api.ads.adwords.jaxws.v201601.cm;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for queryResponse element declaration.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <element name="queryResponse">
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="rval" type="{https://adwords.google.com/api/adwords/cm/v201601}BudgetPage" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </element>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"rval"
})
@XmlRootElement(name = "queryResponse")
public class BudgetServiceInterfacequeryResponse {
protected BudgetPage rval;
/**
* Gets the value of the rval property.
*
* @return
* possible object is
* {@link BudgetPage }
*
*/
public BudgetPage getRval() {
return rval;
}
/**
* Sets the value of the rval property.
*
* @param value
* allowed object is
* {@link BudgetPage }
*
*/
public void setRval(BudgetPage value) {
this.rval = value;
}
}
| [
"vacuum13@gmail.com"
] | vacuum13@gmail.com |
641c1767fd75b79236a96433099f67db6415c738 | 42671940bde623ba50c5ffaea8719f9183f2888e | /admindashboard/src/main/java/com/jenny/admindashboard/models/User.java | 53439e04f0dd3c7db910c8a180cd67b6bd2293fd | [] | no_license | jshin07/Projects | 4559a2dc68e2831699f762c293c053cf3ae0e324 | 408a90ac5b6652997e664bd4852555a89353865b | refs/heads/master | 2021-07-07T21:59:29.691433 | 2017-10-04T21:10:17 | 2017-10-04T21:10:17 | 105,801,809 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,091 | java | package com.jenny.admindashboard.models;
import java.util.Date;
import java.util.List;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.PrePersist;
import javax.persistence.PreUpdate;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.validation.constraints.Size;
import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.NotEmpty;
import org.springframework.format.annotation.DateTimeFormat;
@Entity
@Table(name="users")
public class User {
@Id
@GeneratedValue
private Long id;
@Email
// @NotEmpty(message= "Please enter your email")
private String email;
@Size(min=1)
private String firstName;
@Size(min=1)
private String lastName;
@Size(min=4)
private String password;
@Transient
private String passwordConfirmation;
@DateTimeFormat(pattern="MM/dd/yyyy HH:mm:ss")
private Date createdAt;
@DateTimeFormat(pattern="MM/dd/yyyy HH:mm:ss")
private Date updatedAt;
@PrePersist
protected void onCreated(){
this.createdAt= new Date();
}
@PreUpdate
protected void onUpdated(){
this.updatedAt= new Date();
}
@ManyToMany(fetch = FetchType.EAGER)
@JoinTable(
name = "users_roles",
joinColumns = @JoinColumn(name = "user_id"),
inverseJoinColumns = @JoinColumn(name = "role_id"))
private List<Role> roles;
public boolean isAdmin(){
for (Role role: this.getRoles()){
if (role.getName().equals("ROLE_ADMIN")){
return true;
}
}
return false;
}
public User(){}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getPasswordConfirmation() {
return passwordConfirmation;
}
public void setPasswordConfirmation(String passwordConfirmation) {
this.passwordConfirmation = passwordConfirmation;
}
public Date getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
public Date getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(Date updatedAt) {
this.updatedAt = updatedAt;
}
public List<Role> getRoles() {
return roles;
}
public void setRoles(List<Role> roles) {
this.roles = roles;
}
}
| [
"jshin07@gmail.com"
] | jshin07@gmail.com |
676bf3081f12ac85a6494acdbef01e9aba17f341 | 03076ba8a49b581df0228c0f608d6e4c44599f71 | /MSHClientModule/src/main/java/vo/Promotion_WebVO.java | 2921a2708c34e2e278768b03a3b2e8aa30deadb1 | [] | no_license | tonywang1945yes/MSH | 6bae72b346c622f1ad6a6c71a3e81b5591246cf6 | f2e7213bf3e5450096fb1dc8622e2d89add5e2fa | refs/heads/master | 2021-06-09T20:44:55.480312 | 2017-01-02T08:29:17 | 2017-01-02T08:29:17 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,247 | java | package vo;
import po.PromotionPO;
import util.DateUtil;
import util.Place;
import util.PromotionType;
import static util.EqualJudgeHelper.judgeEqual;
/**
* Created by vivian on 16/11/13.
*/
public class Promotion_WebVO extends PromotionVO{
/**
* 策略执行开始日期
*/
public DateUtil startDate;
/**
* 策略执行结束日期
*/
public DateUtil endDate;
/**
*
* @param promotionName 策略名称
* @param promotionType 策略类型
* @param promotionDiscount 策略折扣
* @param startDate 策略起始日期
* @param endDate 策略截止日期
*/
public Promotion_WebVO(String promotionName, PromotionType promotionType, double promotionDiscount, DateUtil startDate, DateUtil endDate) {
super(promotionName, promotionType, promotionDiscount);
this.startDate = startDate;
this.endDate = endDate;
}
public Promotion_WebVO(String promotionID, String promotionName, PromotionType promotionType, double promotionDiscount, DateUtil startDate, DateUtil endDate) {
super(promotionID, promotionName, promotionType, promotionDiscount);
this.startDate = startDate;
this.endDate = endDate;
}
public Promotion_WebVO(PromotionPO promotionPO){
super(promotionPO);
this.startDate = new DateUtil(promotionPO.getStartDate());
this.endDate = new DateUtil(promotionPO.getEndDate());
}
@Override
public boolean equals(Object o){
if (o instanceof Promotion_WebVO) {
Promotion_WebVO PromotionWebVO = (Promotion_WebVO) o;
return compareData(PromotionWebVO);
}
return false;
}
@Override
public int hashCode() {
return promotionID.hashCode();
}
private boolean compareData(Promotion_WebVO pvo) {
return judgeEqual(pvo.promotionID, this.promotionID)
&& judgeEqual(pvo.promotionName, this.promotionName)
&& judgeEqual(pvo.promotionType, this.promotionType)
&& judgeEqual(pvo.promotionDiscount,this.promotionDiscount)
&& judgeEqual(pvo.startDate,this.startDate)
&& judgeEqual(pvo.endDate,this.endDate);
}
}
| [
"1030518209@qq.com"
] | 1030518209@qq.com |
a33242c56503945dc5bee6492312bde74a13e69a | 0c51eb7dd96d48e637787ab6c62139b8c46d8cf4 | /src/game/ui/screens/LobbyScreen.java | 11155668ae03cef387a12200b9702906e1ae7c40 | [] | no_license | filipdjordjevic/JavaTBG | ef9d7671b4fc2b7d48771ab71f840011107813d6 | aeee9260576d5c7c8b05071422637e50bedcd837 | refs/heads/master | 2020-12-12T22:09:34.122267 | 2020-01-16T21:24:53 | 2020-01-16T21:24:53 | 234,241,707 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,246 | java | package game.ui.screens;
import java.awt.BorderLayout;
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import game.entity.creatures.HeroBase;
import game.ui.components.CharacterInfo;
import java.awt.FlowLayout;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.BoxLayout;
public class LobbyScreen extends JFrame {
private JPanel contentPane;
/**
* Create the frame.
*/
public LobbyScreen(HeroBase hero) {
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 607, 462);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
contentPane.setLayout(new BoxLayout(contentPane, BoxLayout.X_AXIS));
CharacterInfo panelHeroInfo = new CharacterInfo(hero);
contentPane.add(panelHeroInfo);
JButton btnBattle = new JButton("Battle");
contentPane.add(btnBattle);
btnBattle.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
CombatScreen screen = new CombatScreen(hero);
screen.setVisible(true);
LobbyScreen.this.setVisible(false);
}
});
}
}
| [
"filip270798@gmail.com"
] | filip270798@gmail.com |
935ed9497a62e7a2ed2387c6a44b400bf0480728 | b25e847523102664b7c7c9984df67130e6bec697 | /src/com/antoinecronier/pokebattle/entity/PokePokemon.java | 931a6dfea158e1b212f5fada5b139f6e8df69597 | [] | no_license | antoinecronier/pokeAndroid | ebe0e9804f3b8d77b609c7006d9c99adf379ea6e | 8ffe8c777782ba7cb18fc96e789940cda778ad9f | refs/heads/master | 2021-01-17T13:10:40.246374 | 2016-05-25T06:34:07 | 2016-05-25T06:34:07 | 59,842,113 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,661 | java | package com.antoinecronier.pokebattle.entity;
import org.joda.time.format.ISODateTimeFormat;
import android.os.Parcel;
import android.os.Parcelable;
import java.util.List;
import java.util.ArrayList;
import java.io.Serializable;
import org.joda.time.DateTime;
import com.tactfactory.harmony.annotation.Column;
import com.tactfactory.harmony.annotation.Entity;
import com.tactfactory.harmony.annotation.GeneratedValue;
import com.tactfactory.harmony.annotation.Id;
import com.tactfactory.harmony.annotation.Column.Type;
import com.tactfactory.harmony.annotation.GeneratedValue.Strategy;
import com.tactfactory.harmony.annotation.ManyToOne;
import com.tactfactory.harmony.bundles.rest.annotation.Rest;
@Entity
@Rest
public class PokePokemon implements Serializable , Parcelable {
/** Parent parcelable for parcellisation purposes. */
protected List<Parcelable> parcelableParents;
@Id
@Column(type = Type.INTEGER, hidden = true)
@GeneratedValue(strategy = Strategy.MODE_IDENTITY)
private int id;
@Column(type = Type.STRING)
private String surnom;
@Column(type = Type.INTEGER)
private int niveau;
@Column(type = Type.DATETIME, nullable = true)
private DateTime capture;
@ManyToOne
@Column(nullable = true)
private PokeTypePokemon type;
@ManyToOne
@Column(nullable = true)
private PokeAttaque attaque1;
@ManyToOne
@Column(nullable = true)
private PokeAttaque attaque2;
@ManyToOne
@Column(nullable = true)
private PokeAttaque attaque3;
@ManyToOne
@Column(nullable = true)
private PokeAttaque attaque4;
/**
* Default constructor.
*/
public PokePokemon() {
}
/**
* Get the Id.
* @return the id
*/
public int getId() {
return this.id;
}
/**
* Set the Id.
* @param value the id to set
*/
public void setId(final int value) {
this.id = value;
}
/**
* Get the Surnom.
* @return the surnom
*/
public String getSurnom() {
return this.surnom;
}
/**
* Set the Surnom.
* @param value the surnom to set
*/
public void setSurnom(final String value) {
this.surnom = value;
}
/**
* Get the Niveau.
* @return the niveau
*/
public int getNiveau() {
return this.niveau;
}
/**
* Set the Niveau.
* @param value the niveau to set
*/
public void setNiveau(final int value) {
this.niveau = value;
}
/**
* Get the Capture.
* @return the capture
*/
public DateTime getCapture() {
return this.capture;
}
/**
* Set the Capture.
* @param value the capture to set
*/
public void setCapture(final DateTime value) {
this.capture = value;
}
/**
* Get the Type.
* @return the type
*/
public PokeTypePokemon getType() {
return this.type;
}
/**
* Set the Type.
* @param value the type to set
*/
public void setType(final PokeTypePokemon value) {
this.type = value;
}
/**
* Get the Attaque1.
* @return the attaque1
*/
public PokeAttaque getAttaque1() {
return this.attaque1;
}
/**
* Set the Attaque1.
* @param value the attaque1 to set
*/
public void setAttaque1(final PokeAttaque value) {
this.attaque1 = value;
}
/**
* Get the Attaque2.
* @return the attaque2
*/
public PokeAttaque getAttaque2() {
return this.attaque2;
}
/**
* Set the Attaque2.
* @param value the attaque2 to set
*/
public void setAttaque2(final PokeAttaque value) {
this.attaque2 = value;
}
/**
* Get the Attaque3.
* @return the attaque3
*/
public PokeAttaque getAttaque3() {
return this.attaque3;
}
/**
* Set the Attaque3.
* @param value the attaque3 to set
*/
public void setAttaque3(final PokeAttaque value) {
this.attaque3 = value;
}
/**
* Get the Attaque4.
* @return the attaque4
*/
public PokeAttaque getAttaque4() {
return this.attaque4;
}
/**
* Set the Attaque4.
* @param value the attaque4 to set
*/
public void setAttaque4(final PokeAttaque value) {
this.attaque4 = value;
}
/**
* This stub of code is regenerated. DO NOT MODIFY.
*
* @param dest Destination parcel
* @param flags flags
*/
public void writeToParcelRegen(Parcel dest, int flags) {
if (this.parcelableParents == null) {
this.parcelableParents = new ArrayList<Parcelable>();
}
if (!this.parcelableParents.contains(this)) {
this.parcelableParents.add(this);
}
dest.writeInt(this.getId());
if (this.getSurnom() != null) {
dest.writeInt(1);
dest.writeString(this.getSurnom());
} else {
dest.writeInt(0);
}
dest.writeInt(this.getNiveau());
if (this.getCapture() != null) {
dest.writeInt(1);
dest.writeString(ISODateTimeFormat.dateTime().print(
this.getCapture()));
} else {
dest.writeInt(0);
}
if (this.getType() != null
&& !this.parcelableParents.contains(this.getType())) {
this.getType().writeToParcel(this.parcelableParents, dest, flags);
} else {
dest.writeParcelable(null, flags);
}
if (this.getAttaque1() != null
&& !this.parcelableParents.contains(this.getAttaque1())) {
this.getAttaque1().writeToParcel(this.parcelableParents, dest, flags);
} else {
dest.writeParcelable(null, flags);
}
if (this.getAttaque2() != null
&& !this.parcelableParents.contains(this.getAttaque2())) {
this.getAttaque2().writeToParcel(this.parcelableParents, dest, flags);
} else {
dest.writeParcelable(null, flags);
}
if (this.getAttaque3() != null
&& !this.parcelableParents.contains(this.getAttaque3())) {
this.getAttaque3().writeToParcel(this.parcelableParents, dest, flags);
} else {
dest.writeParcelable(null, flags);
}
if (this.getAttaque4() != null
&& !this.parcelableParents.contains(this.getAttaque4())) {
this.getAttaque4().writeToParcel(this.parcelableParents, dest, flags);
} else {
dest.writeParcelable(null, flags);
}
}
/**
* Regenerated Parcel Constructor.
*
* This stub of code is regenerated. DO NOT MODIFY THIS METHOD.
*
* @param parc The parcel to read from
*/
public void readFromParcel(Parcel parc) {
this.setId(parc.readInt());
int surnomBool = parc.readInt();
if (surnomBool == 1) {
this.setSurnom(parc.readString());
}
this.setNiveau(parc.readInt());
if (parc.readInt() == 1) {
this.setCapture(
ISODateTimeFormat.dateTimeParser()
.withOffsetParsed().parseDateTime(
parc.readString()));
}
this.setType((PokeTypePokemon) parc.readParcelable(PokeTypePokemon.class.getClassLoader()));
this.setAttaque1((PokeAttaque) parc.readParcelable(PokeAttaque.class.getClassLoader()));
this.setAttaque2((PokeAttaque) parc.readParcelable(PokeAttaque.class.getClassLoader()));
this.setAttaque3((PokeAttaque) parc.readParcelable(PokeAttaque.class.getClassLoader()));
this.setAttaque4((PokeAttaque) parc.readParcelable(PokeAttaque.class.getClassLoader()));
}
/**
* Parcel Constructor.
*
* @param parc The parcel to read from
*/
public PokePokemon(Parcel parc) {
// You can chose not to use harmony's generated parcel.
// To do this, remove this line.
this.readFromParcel(parc);
// You can implement your own parcel mechanics here.
}
/* This method is not regenerated. You can implement your own parcel mechanics here. */
@Override
public void writeToParcel(Parcel dest, int flags) {
// You can chose not to use harmony's generated parcel.
// To do this, remove this line.
this.writeToParcelRegen(dest, flags);
// You can implement your own parcel mechanics here.
}
/**
* Use this method to write this entity to a parcel from another entity.
* (Useful for relations)
*
* @param parent The entity being parcelled that need to parcel this one
* @param dest The destination parcel
* @param flags The flags
*/
public synchronized void writeToParcel(List<Parcelable> parents, Parcel dest, int flags) {
this.parcelableParents = new ArrayList<Parcelable>(parents);
dest.writeParcelable(this, flags);
this.parcelableParents = null;
}
@Override
public int describeContents() {
// This should return 0
// or CONTENTS_FILE_DESCRIPTOR if your entity is a FileDescriptor.
return 0;
}
/**
* Parcelable creator.
*/
public static final Parcelable.Creator<PokePokemon> CREATOR
= new Parcelable.Creator<PokePokemon>() {
public PokePokemon createFromParcel(Parcel in) {
return new PokePokemon(in);
}
public PokePokemon[] newArray(int size) {
return new PokePokemon[size];
}
};
}
| [
"antoine.cronier@tactfactory.com"
] | antoine.cronier@tactfactory.com |
06a74f827ed57535ddbdd5fe9e73f2850b2191c2 | cbb2b46d2f54f4a8f8909689a5f2dad8dafc41b8 | /app/src/main/java/com/tanmayvij/healthplanner/z110058.java | c7fca1074f93291d3ed62998971c310dbb64894b | [] | no_license | tanmayvij/HealthPlannerJavaAI | 9674b1e68495d7007be8960a91b7b8e7127e4551 | d436e5884fd8c669b407a8641dcdd69efc0345bc | refs/heads/master | 2020-12-29T17:14:50.578032 | 2020-02-06T12:31:14 | 2020-02-06T12:31:14 | 238,680,887 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,655 | java | package com.tanmayvij.healthplanner;
import com.google.appinventor.components.runtime.HandlesEventDispatching;
import com.google.appinventor.components.runtime.EventDispatcher;
import com.google.appinventor.components.runtime.Form;
import com.google.appinventor.components.runtime.Component;
import com.google.appinventor.components.runtime.HorizontalArrangement;
import com.google.appinventor.components.runtime.Button;
import com.google.appinventor.components.runtime.Label;
import android.content.Intent;
public class z110058 extends Form implements HandlesEventDispatching {
private HorizontalArrangement HorizontalArrangement1;
private Button home;
private Label Label1;
private Label Label2;
private Label Label3;
private Label Label4;
private Label Label5;
private Label Label6;
private Label Label7;
protected void $define() {
this.AppName("HealthPlanner");
this.BackgroundImage("bg_scr.png");
this.Scrollable(true);
this.Title("110058");
HorizontalArrangement1 = new HorizontalArrangement(this);
HorizontalArrangement1.AlignHorizontal(2);
HorizontalArrangement1.Width(LENGTH_FILL_PARENT);
home = new Button(HorizontalArrangement1);
home.Image("home-7-64.png");
Label1 = new Label(this);
Label1.FontSize(25);
Label1.Text("Areas Covered:");
Label1.TextColor(0xFFFFFFFF);
Label2 = new Label(this);
Label2.FontSize(20);
Label2.Text("Janakpuri");
Label2.TextColor(0xFFFFFFFF);
Label3 = new Label(this);
Label3.FontSize(25);
Label3.Text("Hospitals:");
Label3.TextColor(0xFFFFFFFF);
Label4 = new Label(this);
Label4.FontSize(20);
Label4.Text("Amar Leela Hospital Pvt Ltd +91-11-39515794");
Label4.TextColor(0xFFFFFFFF);
Label5 = new Label(this);
Label5.FontSize(20);
Label5.Text("Mata Chanan Devi Hospital +91-11-45582000, 25554702");
Label5.TextColor(0xFFFFFFFF);
Label6 = new Label(this);
Label6.FontSize(20);
Label6.Text("Vasan Eye Care Hospital +91-11-39890300, +91-8376802476");
Label6.TextColor(0xFFFFFFFF);
Label7 = new Label(this);
Label7.FontSize(20);
Label7.Text("Orchid Hospital and Heart Centre +91-11-45654565, 45654566");
Label7.TextColor(0xFFFFFFFF);
EventDispatcher.registerEventForDelegation(this, "ClickEvent", "Click" );
}
public boolean dispatchEvent(Component component, String componentName, String eventName, Object[] params){
if( component.equals(home) && eventName.equals("Click") ){
homeClick();
return true;
}
return false;
}
public void homeClick(){
startActivity(new Intent().setClass(this, MainScreen.class));
}
} | [
"tanmayvij047695@gmail.com"
] | tanmayvij047695@gmail.com |
ef1a22d2c730f27c63e5045ea7ab29f9e90a1936 | 5c21ab6e2cbcc4469c9965f720f214a8cccae4b3 | /sso-server/src/main/java/com/xjbg/sso/server/service/application/IDeveloperApplicationService.java | 80a871b62de3f3ccb04905043da2d32bc75d1079 | [
"Apache-2.0"
] | permissive | Kestrong/sso | ff62be1d2bb0947879c936a99a44aaa4d69f5ef8 | 36ebb9d02dc35a1b33955b49aaea6dec896c447e | refs/heads/master | 2023-02-24T00:05:48.974189 | 2021-06-11T02:16:55 | 2021-06-11T02:16:55 | 188,661,393 | 15 | 8 | Apache-2.0 | 2023-02-22T07:28:21 | 2019-05-26T09:04:20 | Java | UTF-8 | Java | false | false | 320 | java | package com.xjbg.sso.server.service.application;
import com.xjbg.sso.server.model.DeveloperApplication;
import com.xjbg.sso.server.service.base.IBaseService;
/**
* @author kesc
* @since 2019/6/13
*/
public interface IDeveloperApplicationService extends IBaseService<DeveloperApplication> {
// TODO: 2019/6/13
}
| [
"492167585@qq.com"
] | 492167585@qq.com |
85e49be035345e5dc7b2067e19e3af87243a55ce | 56acc16a64a563fd64177a9ff62bcd46cff6317d | /src/ru/progwards/pavliggs/N12dot3/ListIteratorForCenter.java | 333468c6c888c504de69149f37bf504054d1e97b | [] | no_license | pavliggs/java1 | 44e8a434d5f438b207137e5b7d08b22ead4c871a | 14dcd69af9a926d503c495e696a002883e2224ed | refs/heads/master | 2020-09-17T07:15:08.570797 | 2020-08-01T20:35:04 | 2020-08-01T20:35:04 | 224,032,012 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 612 | java | package ru.progwards.pavliggs.N12dot3;
import java.util.LinkedList;
import java.util.List;
import java.util.ListIterator;
public class ListIteratorForCenter {
static final int ELEMENTS_COUNT = 250_000;
public static void main(String[] args) {
List<Integer> linkedList = new LinkedList<>();
ListIterator<Integer> listIterator = linkedList.listIterator();
for (int i = 0; linkedList.size() < ELEMENTS_COUNT; i++) {
if (listIterator.previousIndex() >= linkedList.size() / 2)
listIterator.previous();
listIterator.add(i);
}
}
}
| [
"51763058+pavliggs@users.noreply.github.com"
] | 51763058+pavliggs@users.noreply.github.com |
914604585b40b6c216ab4474022dc869dc283ce6 | 26d454599584fd1307770c141112b992430e39bb | /team_management/src/domain/NoteBook.java | a47a22244381307152d4dc1937cf47010fb4461f | [] | no_license | maiyuxiaoge/simple_java | a09c73c0dadc5ccd64dbdd51c210956fccfcaa82 | 134d9c849a388bf50cd9cec029b841c5499f9618 | refs/heads/master | 2022-11-25T08:40:04.739205 | 2020-07-30T02:19:13 | 2020-07-30T02:19:13 | 283,347,379 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 631 | java | package domain;
public class NoteBook implements Equipment{
private String model;
private double price;
public NoteBook(String model, double price) {
this.model = model;
this.price = price;
}
public NoteBook() {
}
public String getModel() {
return model;
}
public void setModel(String model) {
this.model = model;
}
public double getPrice() {
return price;
}
public void setPrice(double price) {
this.price = price;
}
@Override
public String getDescription() {
return model + "(" + price + ")";
}
}
| [
"andy1212@126.com"
] | andy1212@126.com |
46b3302ae4cd1e8acfe84b89f9d3818a6746ea35 | db03971ef7fe9b699df74a0e21635e3012ba79cf | /berkano-user/berkano-user-mgt-webwork/src/main/java/net/incongru/berkano/usermgt/webwork/UserPropertyAction.java | 40755dd65fe3f80e43f4eb387c030fd3e932846c | [] | no_license | codehaus/berkano | b23005abb1c86cd3d18c0a99de0a370f43ad6cbe | 5ac4188b111fc4cab581653477c1198a5091b59a | refs/heads/master | 2023-07-20T01:34:51.669091 | 2007-11-03T01:32:55 | 2007-11-03T01:32:55 | 36,529,417 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,199 | java | package net.incongru.berkano.usermgt.webwork;
import com.opensymphony.xwork.ActionSupport;
import net.incongru.berkano.user.UnknownUserException;
import net.incongru.berkano.user.User;
import net.incongru.berkano.user.UserDAO;
/**
* @author gjoseph
* @author $Author: gj $ (last edit)
* @version $Revision: 1.8 $
*/
public class UserPropertyAction extends ActionSupport {
private UserDAO userDAO;
private Long userId;
private String propertyKey;
private String newPropertyValue;
public UserPropertyAction(UserDAO userDAO) {
this.userDAO = userDAO;
}
public String addProperty() throws UnknownUserException {
userDAO.addProperty(userId, propertyKey, newPropertyValue);
return SUCCESS;
}
public String removeProperty() throws UnknownUserException {
userDAO.removeProperty(userId, propertyKey);
return SUCCESS;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public void setPropertyKey(String propertyKey) {
this.propertyKey = propertyKey;
}
public void setNewPropertyValue(String newPropertyValue) {
this.newPropertyValue = newPropertyValue;
}
}
| [
"gjoseph@5e6c65d6-21f8-0310-a445-fbbf500fbdde"
] | gjoseph@5e6c65d6-21f8-0310-a445-fbbf500fbdde |
b9e5c43e77de9a6231e949bf84226ab18cff584f | 87b8df4bf2fd784a1fcc3f88f2dd1ade72904882 | /src/lesson8/pack4/Main.java | 339d7115bae5a4d16ca4615a2a5c4c77b5259cc0 | [] | no_license | medinskiyd/GlobalIT270116 | 219496acea23e33f8b46210873b2b959bcaa54b8 | ffbd468fc1eb2413d3ded2a9644bebc5e6a68127 | refs/heads/master | 2021-01-21T13:41:22.994910 | 2016-04-25T16:08:02 | 2016-04-25T16:08:02 | 51,031,320 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 265 | java | package lesson8.pack4;
/**
* Created by dmitry on 20.02.16.
*/
public class Main {
public static void main(String[] args) {
Instruments drum = new Drum();
Guitar guitar = new Guitar();
drum.play();
guitar.play();
}
}
| [
"medinskiyd@gmail.com"
] | medinskiyd@gmail.com |
af071e869f2e38db068ff44ce12c2c7e3e5125ff | 4180e7c078c1700dd363d96b83ca10ba0632d44b | /src/lesson_12_generics/Lesson12.java | c31d7b1840ec5f6e61df4c15f7a1d9a42c54afa4 | [] | no_license | mazitovt/SberStudy | 186b695854f22f31c585614468238f3bd7567385 | 98b5f60f01ecc5c01f4c0d11914d06f1734b307b | refs/heads/develop | 2023-06-15T17:10:07.959680 | 2021-07-13T17:07:56 | 2021-07-13T17:07:56 | 357,609,271 | 0 | 0 | null | 2021-05-02T12:23:54 | 2021-04-13T15:52:38 | Java | UTF-8 | Java | false | false | 6,881 | java | package lesson_12_generics;
import java.util.ArrayList;
import java.util.List;
import java.util.function.BinaryOperator;
import java.util.function.Function;
import java.util.function.Predicate;
public class Lesson12 {
static class MyInteger {
public Integer number;
public MyInteger(Integer num){
number = num;
}
public String toString(){
return number.toString();
}
}
public static void main(String[] args) {
List<MyInteger> listMyInteger = new ArrayList<>() {{
add(new MyInteger(1));
add(new MyInteger(2));
add(new MyInteger(3));
add(new MyInteger(4));
}};
List<Integer> listInteger = new ArrayList<>(){{
add(2);
add(1);
add(3);
add(4);
}};
System.out.println("\n1. Демострация метода map.");
demoMap(listInteger);
System.out.println("\n\n2. Демострация метода forEach.");
demoForEach(listMyInteger);
var listWithNegative = new ArrayList<>(listInteger);
listWithNegative.add(-1);
listWithNegative.add(-2);
System.out.println("\n\n3. Демострация метода filter.");
demoFilter(listWithNegative);
System.out.println("\n\n4. Демонстрация метода count.");
demoCount(listWithNegative);
System.out.println("\n\n5. Демонстарция метода foldLeft.");
demoFoldLeft(listInteger);
System.out.println("\n\n6. Демонстарция метода foldRight.");
demoFoldRight(listInteger);
}
private static void demoFoldRight(List<Integer> listInteger) {
listInteger = new ArrayList<>(listInteger);
BinaryOperator<Integer> integerPow = (elem, pow) -> {
if (pow <= 0){
return 1;
}
Integer res = 1;
for (int i = 1; i <= pow; i++){
res *= elem;
}
return res;
};
var resultSum = ListExtensions.foldRight(listInteger, (elem1, elem2) -> elem1 + elem2);
var resultPow = ListExtensions.foldRight(listInteger, integerPow);
System.out.print("\nПравоассоциативная свертка по функции суммирования: ");
System.out.println(resultSum);
System.out.print("\nПравоассоциативная свертка по функции возведения в степень: ");
System.out.println(resultPow);
}
private static void demoFoldLeft(List<Integer> listInteger) {
listInteger = new ArrayList<>(listInteger);
BinaryOperator<Integer> integerPow = (elem, pow) -> {
if (pow <= 0){
return 1;
}
Integer res = 1;
for (int i = 1; i <= pow; i++){
res *= elem;
}
return res;
};
var resultSum = ListExtensions.foldLeft(listInteger, (elem1, elem2) -> elem1 + elem2);
var resultPow = ListExtensions.foldLeft(listInteger, integerPow);
System.out.print("\nЛевоассоциативная свертка по функции суммирования: ");
System.out.println(resultSum);
System.out.print("\nЛевоассоциативная свертка по функции возведения в степень: ");
System.out.println(resultPow);
}
private static void demoCount(List<Integer> listInteger) {
listInteger = new ArrayList<>(listInteger);
var evenIntegers = new Predicate<Integer>() {
@Override
public boolean test(Integer integer) {
return integer % 2 == 0;
}
};
var resultCountLambda = ListExtensions.count(listInteger, (elem) -> elem < 0);
var resultCountFunctionInterface = ListExtensions.count(listInteger, evenIntegers);
System.out.println("\nИсходный список.");
print(listInteger);
System.out.println("\nЧисло отрицательных чисел (лямбда): " + resultCountLambda);
System.out.println("\nЧисло четных чисел (функциональный интерфейс): " + resultCountFunctionInterface);
}
private static void demoFilter(List<Integer> listInteger) {
listInteger = new ArrayList<>(listInteger);
var evenIntegers = new Predicate<Integer>(){
@Override
public boolean test(Integer integer) {
return integer % 2 == 0;
}
};
var resultListLambda = ListExtensions.filter(listInteger, (elem) -> elem > 0);
var resultListFunctionInterface = ListExtensions.filter(listInteger, evenIntegers);
System.out.println("\nИсходный список.");
print(listInteger);
System.out.println("\nПолученный список положительных чисел (лямбда).");
print(resultListLambda);
System.out.println("\nПолученный список четных чисел (функциональный интерфейс).");
print(resultListFunctionInterface);
}
private static void demoMap(List<Integer> listInteger) {
listInteger = new ArrayList<>(listInteger);
var squareInteger = new Function<Integer, Integer>(){
@Override
public Integer apply(Integer integer) {
return integer * integer * integer;
}
};
var resultListLambda = ListExtensions.map(listInteger, (elem) -> elem * elem);
var resultListFunctionInterface = ListExtensions.map(listInteger, squareInteger);
System.out.println("\nИсходный список.");
print(listInteger);
System.out.println("\nПолученный список квадратов чисел (лямбда).");
print(resultListLambda);
System.out.println("\nПолученный список кубов чисел (функциональный интерфейс).");
print(resultListFunctionInterface);
}
private static void demoForEach(List<MyInteger> list) {
list = new ArrayList<>(list);
System.out.println("\nИсходный список.");
print(list);
ListExtensions.forEach(list, (MyInteger elem) -> elem.number = elem.number * elem.number);
System.out.println("\nЭлементы объекта исходного списка изменились.");
print(list);
}
static <T> void print(List<T> list){
System.out.println(String.join(" ",ListExtensions.map(list, Object::toString)));
}
}
| [
"Timur.Mazitov@rtmis.ru"
] | Timur.Mazitov@rtmis.ru |
7efd090c3d0e33592c88bae7ca14c470869f9fc8 | 4025af4d2bacf3568cfdd55d85573ed26d606236 | /mybatis-3.5.2/src/test/java/org/apache/ibatis/submitted/enumtypehandler_on_annotation/EnumTypeHandlerUsingAnnotationTest.java | 00d1285bdcc3ca57523598155d652f07aef5c61e | [
"BSD-3-Clause",
"Apache-2.0"
] | permissive | MooNkirA/mybatis-note | f3e1ede680b0f511346a649895ae1bf71c69d616 | 25e952c13406fd0579750b25089d2cf2b1bdacec | refs/heads/master | 2022-03-04T20:11:26.770175 | 2021-12-18T02:31:10 | 2021-12-18T02:31:10 | 223,528,278 | 0 | 0 | null | 2021-12-18T02:31:13 | 2019-11-23T04:04:03 | Java | UTF-8 | Java | false | false | 5,136 | java | /**
* Copyright 2009-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.ibatis.submitted.enumtypehandler_on_annotation;
import org.apache.ibatis.BaseDataTest;
import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import java.io.Reader;
import static org.assertj.core.api.Assertions.assertThat;
/**
* Tests for type handler of enum using annotations.
*
* @since #444
*
* @author Kazuki Shimizu
*
* @see org.apache.ibatis.annotations.Arg
* @see org.apache.ibatis.annotations.Result
* @see org.apache.ibatis.annotations.TypeDiscriminator
*/
class EnumTypeHandlerUsingAnnotationTest {
private static SqlSessionFactory sqlSessionFactory;
private SqlSession sqlSession;
@BeforeAll
static void initDatabase() throws Exception {
try (Reader reader = Resources.getResourceAsReader("org/apache/ibatis/submitted/enumtypehandler_on_annotation/mybatis-config.xml")) {
sqlSessionFactory = new SqlSessionFactoryBuilder().build(reader);
sqlSessionFactory.getConfiguration().getMapperRegistry().addMapper(PersonMapper.class);
}
BaseDataTest.runScript(sqlSessionFactory.getConfiguration().getEnvironment().getDataSource(),
"org/apache/ibatis/submitted/enumtypehandler_on_annotation/CreateDB.sql");
}
@BeforeEach
void openSqlSession() {
this.sqlSession = sqlSessionFactory.openSession();
}
@AfterEach
void closeSqlSession() {
sqlSession.close();
}
@Test
void testForArg() {
PersonMapper personMapper = sqlSession.getMapper(PersonMapper.class);
{
Person person = personMapper.findOneUsingConstructor(1);
assertThat(person.getId()).isEqualTo(1);
assertThat(person.getFirstName()).isEqualTo("John");
assertThat(person.getLastName()).isEqualTo("Smith");
assertThat(person.getPersonType()).isEqualTo(Person.PersonType.PERSON); // important
}
{
Person employee = personMapper.findOneUsingConstructor(2);
assertThat(employee.getId()).isEqualTo(2);
assertThat(employee.getFirstName()).isEqualTo("Mike");
assertThat(employee.getLastName()).isEqualTo("Jordan");
assertThat(employee.getPersonType()).isEqualTo(Person.PersonType.EMPLOYEE); // important
}
}
@Test
void testForResult() {
PersonMapper personMapper = sqlSession.getMapper(PersonMapper.class);
{
Person person = personMapper.findOneUsingSetter(1);
assertThat(person.getId()).isEqualTo(1);
assertThat(person.getFirstName()).isEqualTo("John");
assertThat(person.getLastName()).isEqualTo("Smith");
assertThat(person.getPersonType()).isEqualTo(Person.PersonType.PERSON); // important
}
{
Person employee = personMapper.findOneUsingSetter(2);
assertThat(employee.getId()).isEqualTo(2);
assertThat(employee.getFirstName()).isEqualTo("Mike");
assertThat(employee.getLastName()).isEqualTo("Jordan");
assertThat(employee.getPersonType()).isEqualTo(Person.PersonType.EMPLOYEE); // important
}
}
@Test
void testForTypeDiscriminator() {
PersonMapper personMapper = sqlSession.getMapper(PersonMapper.class);
{
Person person = personMapper.findOneUsingTypeDiscriminator(1);
assertThat(person.getClass()).isEqualTo(Person.class); // important
assertThat(person.getId()).isEqualTo(1);
assertThat(person.getFirstName()).isEqualTo("John");
assertThat(person.getLastName()).isEqualTo("Smith");
assertThat(person.getPersonType()).isEqualTo(Person.PersonType.PERSON);
}
{
Person employee = personMapper.findOneUsingTypeDiscriminator(2);
assertThat(employee.getClass()).isEqualTo(Employee.class); // important
assertThat(employee.getId()).isEqualTo(2);
assertThat(employee.getFirstName()).isEqualTo("Mike");
assertThat(employee.getLastName()).isEqualTo("Jordan");
assertThat(employee.getPersonType()).isEqualTo(Person.PersonType.EMPLOYEE);
}
}
}
| [
"lje888@126.com"
] | lje888@126.com |
1bd69b0419b535a8ce6bc0189ac688d9bf0762e6 | 6ed68252a4a95d149c676f01ac43529a1174e7f0 | /app/src/main/java/com/example/mintycards/util/GridAdapterSpacingUtils.java | b16a62ad63520f8901a6af637d8e54093d6893ca | [
"Apache-2.0"
] | permissive | belle1306/Minty | c8fc44e9d8ded6110af9bb52edb3252abe7173f3 | a493df7d4465b91d02ba2d67625ca06d3be5b831 | refs/heads/master | 2023-04-01T02:38:50.189472 | 2021-04-08T02:30:16 | 2021-04-08T02:30:16 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 360 | java | package com.example.mintycards.util;
import android.content.Context;
import android.util.TypedValue;
public class GridAdapterSpacingUtils {
public static int convertIntToDP(Context context, int value){
return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, value,
context.getResources().getDisplayMetrics());
}
}
| [
"evan.li789@gmail.com"
] | evan.li789@gmail.com |
6cc59e25c428d2c7b512df66ad7af599e88e2cae | a4b88840d3d30b07aa00e69259a7b1c035441a85 | /espd-edm/src/main/java/oasis/names/specification/ubl/schema/xsd/commonbasiccomponents_2/TaxLevelCodeType.java | 22e446b0b99ed8e4e5065868b471683d19bff706 | [] | no_license | AgID/espd-builder | e342712abc87824d402a90ad87f312a243165970 | 3614d526d574ad979aafa6da429e409debc73dd8 | refs/heads/master | 2022-12-23T20:36:03.500212 | 2020-01-30T16:48:37 | 2020-01-30T16:48:37 | 225,416,148 | 3 | 0 | null | 2022-12-16T09:49:58 | 2019-12-02T16:08:38 | Java | UTF-8 | Java | false | false | 3,596 | java | //
// Questo file è stato generato dall'architettura JavaTM per XML Binding (JAXB) Reference Implementation, v2.2.11
// Vedere <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Qualsiasi modifica a questo file andrà persa durante la ricompilazione dello schema di origine.
// Generato il: 2019.02.25 alle 12:32:23 PM CET
//
package oasis.names.specification.ubl.schema.xsd.commonbasiccomponents_2;
import java.io.Serializable;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
import oasis.names.specification.ubl.schema.xsd.unqualifieddatatypes_2.CodeType;
import org.jvnet.jaxb2_commons.lang.Equals2;
import org.jvnet.jaxb2_commons.lang.EqualsStrategy2;
import org.jvnet.jaxb2_commons.lang.HashCode2;
import org.jvnet.jaxb2_commons.lang.HashCodeStrategy2;
import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy;
import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy;
import org.jvnet.jaxb2_commons.lang.JAXBToStringStrategy;
import org.jvnet.jaxb2_commons.lang.ToString2;
import org.jvnet.jaxb2_commons.lang.ToStringStrategy2;
import org.jvnet.jaxb2_commons.locator.ObjectLocator;
/**
* <p>Classe Java per TaxLevelCodeType complex type.
*
* <p>Il seguente frammento di schema specifica il contenuto previsto contenuto in questa classe.
*
* <pre>
* <complexType name="TaxLevelCodeType">
* <simpleContent>
* <restriction base="<urn:oasis:names:specification:ubl:schema:xsd:UnqualifiedDataTypes-2>CodeType">
* </restriction>
* </simpleContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "TaxLevelCodeType")
public class TaxLevelCodeType
extends CodeType
implements Serializable, Equals2, HashCode2, ToString2
{
private final static long serialVersionUID = 100L;
public String toString() {
final ToStringStrategy2 strategy = JAXBToStringStrategy.INSTANCE;
final StringBuilder buffer = new StringBuilder();
append(null, buffer, strategy);
return buffer.toString();
}
public StringBuilder append(ObjectLocator locator, StringBuilder buffer, ToStringStrategy2 strategy) {
strategy.appendStart(locator, this, buffer);
appendFields(locator, buffer, strategy);
strategy.appendEnd(locator, this, buffer);
return buffer;
}
public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy2 strategy) {
super.appendFields(locator, buffer, strategy);
return buffer;
}
public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy2 strategy) {
if ((object == null)||(this.getClass()!= object.getClass())) {
return false;
}
if (this == object) {
return true;
}
if (!super.equals(thisLocator, thatLocator, object, strategy)) {
return false;
}
return true;
}
public boolean equals(Object object) {
final EqualsStrategy2 strategy = JAXBEqualsStrategy.INSTANCE;
return equals(null, null, object, strategy);
}
public int hashCode(ObjectLocator locator, HashCodeStrategy2 strategy) {
int currentHashCode = super.hashCode(locator, strategy);
return currentHashCode;
}
public int hashCode() {
final HashCodeStrategy2 strategy = JAXBHashCodeStrategy.INSTANCE;
return this.hashCode(null, strategy);
}
}
| [
"mpetruzzi@pccube.com"
] | mpetruzzi@pccube.com |
932e170a8a90c188a2ace060113bd4a7cb77b722 | 51c3050325d2584824915efba70f003dd943ffa6 | /lib-tool/src/main/java/com/views/customedittext/MyKeyboardView.java | 7ec7c920078fa18120c3e6c96e48a7b2f26838e2 | [] | no_license | beyond-snail/xywf | 2fff68e7e47238b8bae2256968adae52261844c2 | 87888ba76d1a8b3d86276a55aff625eeea406042 | refs/heads/master | 2021-05-06T07:04:48.164434 | 2018-10-29T08:23:16 | 2018-10-29T08:23:16 | 113,928,842 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,681 | java | package com.views.customedittext;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.inputmethodservice.Keyboard;
import android.inputmethodservice.KeyboardView;
import android.util.AttributeSet;
import com.tool.R;
import java.util.List;
/**
* Created by zhuanghongji on 2015/12/10.
*/
public class MyKeyboardView extends KeyboardView {
private Drawable mKeyBgDrawable;
private Drawable mOpKeyBgDrawable;
private Drawable mOpkeyBgDrawable1;
private Resources mRes;
public MyKeyboardView(Context context, AttributeSet attrs) {
this(context, attrs, 0);
}
public MyKeyboardView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
initResources(context);
}
private void initResources(Context context) {
mRes = context.getResources();
mKeyBgDrawable = mRes.getDrawable(R.drawable.relay_bg);
mOpKeyBgDrawable = mRes.getDrawable(R.drawable.relay_bg);
mOpkeyBgDrawable1 = mRes.getDrawable(R.drawable.relay_bg);
}
@Override
public void onDraw(Canvas canvas) {
List<Keyboard.Key> keys = getKeyboard().getKeys();
for (Keyboard.Key key : keys) {
canvas.save();
int offsetY = 0;
if (key.y == 0) {
offsetY = 1;
}
int initDrawY = key.y + offsetY;
Rect rect = new Rect(key.x, initDrawY, key.x + key.width, key.y + key.height);
canvas.clipRect(rect);
int primaryCode = -1;
if (null != key.codes && key.codes.length != 0) {
primaryCode = key.codes[0];
}
Drawable drawable = null;
if (primaryCode == -3 ) {
drawable = mOpkeyBgDrawable1;
} else if (primaryCode == -5) {
drawable = mOpKeyBgDrawable;
} else if (primaryCode != -1) {
drawable = mKeyBgDrawable;
}
if (null != drawable) {
int[] state = key.getCurrentDrawableState();
drawable.setState(state);
drawable.setBounds(rect);
drawable.draw(canvas);
}
Paint paint = new Paint();
paint.setAntiAlias(true);
paint.setTextAlign(Paint.Align.CENTER);
paint.setTextSize(30);
// paint.setFakeBoldText(true);
if (primaryCode == -3 || primaryCode == -5){
paint.setColor(mRes.getColor(R.color.white));
} else {
paint.setColor(mRes.getColor(R.color.white));
}
if (key.label != null) {
canvas.drawText(
key.label.toString(),
key.x + (key.width / 2),
initDrawY + (key.height + paint.getTextSize() - paint.descent()) / 2,
paint
);
} else if (key.icon != null) {
int intriWidth = key.icon.getIntrinsicWidth();
int intriHeight = key.icon.getIntrinsicHeight();
final int drawableX = key.x + (key.width - intriWidth) / 2;
final int drawableY = initDrawY + (key.height - intriHeight) / 2;
key.icon.setBounds(drawableX, drawableY,
drawableX + intriWidth, drawableY + intriHeight);
key.icon.draw(canvas);
}
canvas.restore();
}
}
}
| [
"wu15979937502"
] | wu15979937502 |
655de4c0258a3be8ef6694859fe67581af75886b | 9d14de9c04d059f1f37eb64ffa0cceb1d7186a01 | /app/src/main/java/com/example/lotrik/custom_view/MyCustomView.java | 8320215a5d45ae80108a554e63b37eab8f3692aa | [] | no_license | lotrikys/DZ_37 | b6ffeab676992e3763e396f83fce4e287fcdef34 | 2bd295e643405cfe8d62e9eb4842d19c6dc6cb54 | refs/heads/master | 2021-01-10T07:35:20.834906 | 2016-01-29T14:38:37 | 2016-01-29T14:38:37 | 50,667,898 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,763 | java | package com.example.lotrik.custom_view;
import android.annotation.TargetApi;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Rect;
import android.os.Build;
import android.util.AttributeSet;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
/**
* Created by lotrik on 18.01.16.
*/
public class MyCustomView extends View {
Paint paint = new Paint();
float maxX;
int x1;
int x2;
int y1;
int y2;
int moveRoad = 0;
float roadX = 20;
float carX = 30;
int carY1 = 150;
int carYY1 = 200;
int carY2 = 120;
int carYY2 = 150;
int carY3 = 200;
int move;
public MyCustomView(Context context) {
super(context);
}
public MyCustomView(Context context, AttributeSet attrs) {
super(context, attrs);
}
public MyCustomView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public MyCustomView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
}
@Override
public void onDraw (Canvas canvas){
super.onDraw(canvas);
canvas.drawARGB(0, 255, 0, 0);
drawRoad(canvas);
drawCar(canvas);
drawTouchpad(canvas);
invalidate();
}
public void drawRoad (Canvas canvas) {
maxX = canvas.getWidth();
paint.setStyle(Paint.Style.FILL);
paint.setColor(Color.GRAY);
canvas.drawRect(0, 50, maxX, 350, paint);
paint.setColor(Color.WHITE);
for (;;){
canvas.drawRect(roadX, 175, roadX + 150, 225, paint);
roadX += 225;
if (roadX >= canvas.getWidth()){
roadX = moveRoad;
if (moveRoad <= -200){
moveRoad = 20;
} else {
moveRoad -= 5;
}
break;
}
}
}
public void drawCar (Canvas canvas){
paint.setColor(Color.GREEN);
canvas.drawRect(carX, carY1, carX + 190, carYY1, paint);
canvas.drawRect(carX + 50, carY2, carX + 140, carYY2, paint);
paint.setColor(Color.BLACK);
canvas.drawCircle(carX + 50, carY3, 20, paint);
canvas.drawCircle(carX + 140, carY3, 20, paint);
}
public void drawTouchpad (Canvas canvas) {
paint.setColor(Color.BLACK);
x1 = canvas.getWidth()/2-300;
x2 = canvas.getWidth()/2+300;
y1 = canvas.getHeight()/2-300;
y2 = canvas.getHeight()/2+300;
canvas.drawRect(x1, y1, x2, y2, paint);
}
@Override
public boolean onTouchEvent (MotionEvent event){
int xEvent = (int) event.getX();
int yEvent = (int) event.getY();
if (xEvent>x1 && xEvent<x2 && yEvent>y1 && yEvent<y2){
switch (event.getAction()){
case MotionEvent.ACTION_MOVE:
if (yEvent > move && carY3 < 330) {
carY1 += 5;
carY2 += 5;
carY3 += 5;
carYY1 += 5;
carYY2 += 5;
}
if (yEvent < move && carY2 > 50){
carY1 -= 5;
carY2 -= 5;
carY3 -= 5;
carYY1 -= 5;
carYY2 -= 5;
}
move = yEvent;
break;
}
}
return true;
}
}
| [
"lotrik@mail.ru"
] | lotrik@mail.ru |
db72298e4a8c3a22dbb1bdb22696a542ab60109a | 8263e347ddef196e9329b6cd9766b2ee83342bd5 | /app/src/main/java/com/first/yuliang/deal_community/frament/testpic/PublishedActivity.java | 7c85813305f0ad6003e937c8552ac8bce90aa734 | [] | no_license | deal-c/Deal_test_1.0 | 9ffb062eb66129fe4a48718fd48805c5ee195565 | 1e45b6bccba10074e47d661d9d46b3443ec03922 | refs/heads/master | 2021-01-11T01:01:17.176004 | 2016-11-09T01:19:59 | 2016-11-09T01:19:59 | 70,445,607 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 11,909 | java | package com.first.yuliang.deal_community.frament.testpic;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.ColorDrawable;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
import android.os.Handler;
import android.os.Message;
import android.provider.MediaStore;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.Log;
import android.view.Gravity;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.view.animation.AnimationUtils;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.BaseAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.GridView;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.PopupWindow;
import android.widget.TextView;
import android.widget.Toast;
import com.first.yuliang.deal_community.R;
import com.first.yuliang.deal_community.frament.utiles.HttpUtils;
import com.google.gson.Gson;
import org.xutils.common.Callback;
import org.xutils.http.RequestParams;
import org.xutils.x;
public class PublishedActivity extends Activity {
private GridView noScrollgridview;
private GridAdapter adapter;
private TextView activity_selectimg_send;
private EditText et_search;
private String sendCommunityid=null;
String content=null;
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_selectimg);
Intent intent=getIntent();
sendCommunityid=intent.getStringExtra("sendCommunityid");
et_search = (EditText) findViewById(R.id.writen_content);
et_search.addTextChangedListener(textWatcher);
Init();
}
private TextWatcher textWatcher = new TextWatcher() {
@Override
public void onTextChanged(CharSequence s, int start, int before,
int count) {
System.out.println("-1-onTextChanged-->"
+ et_search.getText().toString() + "<--");
}
@Override
public void beforeTextChanged(CharSequence s, int start, int count,
int after) {
System.out.println("-2-beforeTextChanged-->"
+ et_search.getText().toString() + "<--");
}
@Override
public void afterTextChanged(Editable s) {
System.out.println("-3-afterTextChanged-->"
+ et_search.getText().toString() + "<--");
content=et_search.getText().toString();
}
};
public void Init() {
noScrollgridview = (GridView) findViewById(R.id.noScrollgridview);
noScrollgridview.setSelector(new ColorDrawable(Color.TRANSPARENT));
adapter = new GridAdapter(this);
adapter.update();
noScrollgridview.setAdapter(adapter);
noScrollgridview.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
long arg3) {
if (arg2 == Bimp.bmp.size()) {
new PopupWindows(PublishedActivity.this, noScrollgridview);
} else {
Intent intent = new Intent(PublishedActivity.this,
PhotoActivity.class);
intent.putExtra("ID", arg2);
startActivity(intent);
}
}
});
activity_selectimg_send = (TextView) findViewById(R.id.activity_selectimg_send);
activity_selectimg_send.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
List<String> list = new ArrayList<String>();
for (int i = 0; i < Bimp.drr.size(); i++) {
String Str = Bimp.drr.get(i).substring(
Bimp.drr.get(i).lastIndexOf("/") + 1,
Bimp.drr.get(i).lastIndexOf("."));
list.add(Str);
}
// 高清的压缩图片全部就在 list 路径里面了
// 高清的压缩过的 bmp 对象 都在 Bimp.bmp里面
// 完成上传服务器后 .........
sendDynamicToservlt(list,content);
//FileUtils.deleteDir();
File file=new File(list.get(0));
if(file!=null){
sendImgs(file);
}
}
});
}
private void sendImgs(File file) {
RequestParams request=new RequestParams(HttpUtils.hostLuoqingshanSchool+"usys/upload");
request.addBodyParameter("file",file);
request.setMultipart(true);
x.http().post(request, new Callback.CommonCallback<String>() {
@Override
public void onSuccess(String result) {
Log.e("图片上传====","1"+result);
}
@Override
public void onError(Throwable ex, boolean isOnCallback) {
Log.e("我来看上传动态图片的数据====","22"+ex.toString());
}
@Override
public void onCancelled(CancelledException cex) {
}
@Override
public void onFinished() {
}
});
}
private void sendDynamicToservlt(List list,String content) {
Log.e("我来来来来看看评论都的数据====","22"+content);
String imgList=list.get(0).toString();
int userId=this.getSharedPreferences("shared_loginn_info", Context.MODE_PRIVATE).getInt("id",0);
RequestParams request=new RequestParams(HttpUtils.hostLuoqingshanSchool+"usys/recieveDynamic");
request.addBodyParameter("imgList",imgList);
request.addBodyParameter("userId",String.valueOf(userId));
request.addBodyParameter("content",content);
request.addBodyParameter("sendCommunityid",sendCommunityid);
//Log.e("我来看看评论都的数据====",content);
x.http().post(request, new Callback.CommonCallback<String>() {
@Override
public void onSuccess(String result) {
Toast.makeText(PublishedActivity.this,result+"!!!",Toast.LENGTH_LONG).show();
}
@Override
public void onError(Throwable ex, boolean isOnCallback) {
// Log.e("我来看result的数据====","22"+ex.toString());
}
@Override
public void onCancelled(CancelledException cex) {
}
@Override
public void onFinished() {
}
});
}
public void Ibackonclick(View view) {
finish();
}
@SuppressLint("HandlerLeak")
public class GridAdapter extends BaseAdapter {
private LayoutInflater inflater; // 视图容器
private int selectedPosition = -1;// 选中的位置
private boolean shape;
public boolean isShape() {
return shape;
}
public void setShape(boolean shape) {
this.shape = shape;
}
public GridAdapter(Context context) {
inflater = LayoutInflater.from(context);
}
public void update() {
loading();
}
public int getCount() {
return (Bimp.bmp.size() + 1);
}
public Object getItem(int arg0) {
return null;
}
public long getItemId(int arg0) {
return 0;
}
public void setSelectedPosition(int position) {
selectedPosition = position;
}
public int getSelectedPosition() {
return selectedPosition;
}
/**
* ListView Item设置
*/
public View getView(int position, View convertView, ViewGroup parent) {
final int coord = position;
ViewHolder holder = null;
if (convertView == null) {
convertView = inflater.inflate(R.layout.item_published_grida,
parent, false);
holder = new ViewHolder();
holder.image = (ImageView) convertView
.findViewById(R.id.item_grida_image);
convertView.setTag(holder);
} else {
holder = (ViewHolder) convertView.getTag();
}
if (position == Bimp.bmp.size()) {
holder.image.setImageBitmap(BitmapFactory.decodeResource(
getResources(), R.drawable.icon_addpic_unfocused));
if (position == 9) {
holder.image.setVisibility(View.GONE);
}
} else {
holder.image.setImageBitmap(Bimp.bmp.get(position));
}
return convertView;
}
public class ViewHolder {
public ImageView image;
}
Handler handler = new Handler() {
public void handleMessage(Message msg) {
switch (msg.what) {
case 1:
adapter.notifyDataSetChanged();
break;
}
super.handleMessage(msg);
}
};
public void loading() {
new Thread(new Runnable() {
public void run() {
while (true) {
if (Bimp.max == Bimp.drr.size()) {
Message message = new Message();
message.what = 1;
handler.sendMessage(message);
break;
} else {
try {
String path = Bimp.drr.get(Bimp.max);
System.out.println(path);
Bitmap bm = Bimp.revitionImageSize(path);
Bimp.bmp.add(bm);
String newStr = path.substring(
path.lastIndexOf("/") + 1,
path.lastIndexOf("."));
FileUtils.saveBitmap(bm, "" + newStr);
Bimp.max += 1;
Message message = new Message();
message.what = 1;
handler.sendMessage(message);
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
}).start();
}
}
public String getString(String s) {
String path = null;
if (s == null)
return "";
for (int i = s.length() - 1; i > 0; i++) {
s.charAt(i);
}
return path;
}
protected void onRestart() {
adapter.update();
super.onRestart();
}
public class PopupWindows extends PopupWindow {
public PopupWindows(Context mContext, View parent) {
View view = View
.inflate(mContext, R.layout.item_popupwindows, null);
view.startAnimation(AnimationUtils.loadAnimation(mContext,
R.anim.fade_ins));
LinearLayout ll_popup = (LinearLayout) view
.findViewById(R.id.ll_popup);
ll_popup.startAnimation(AnimationUtils.loadAnimation(mContext,
R.anim.push_bottom_in_2));
setWidth(LayoutParams.FILL_PARENT);
setHeight(LayoutParams.FILL_PARENT);
setBackgroundDrawable(new BitmapDrawable());
setFocusable(true);
setOutsideTouchable(true);
setContentView(view);
showAtLocation(parent, Gravity.BOTTOM, 0, 0);
update();
Button bt1 = (Button) view
.findViewById(R.id.item_popupwindows_camera);
Button bt2 = (Button) view
.findViewById(R.id.item_popupwindows_Photo);
Button bt3 = (Button) view
.findViewById(R.id.item_popupwindows_cancel);
bt1.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
photo();
dismiss();
}
});
bt2.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
Intent intent = new Intent(PublishedActivity.this,
TestPicActivity.class);
startActivity(intent);
dismiss();
}
});
bt3.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
dismiss();
}
});
}
}
private static final int TAKE_PICTURE = 0x000000;
private String path = "";
public void photo() {
Intent openCameraIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
File file = new File(Environment.getExternalStorageDirectory()
+ "/myimage/", String.valueOf(System.currentTimeMillis())
+ ".jpg");
path = file.getPath();
Uri imageUri = Uri.fromFile(file);
openCameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, imageUri);
startActivityForResult(openCameraIntent, TAKE_PICTURE);
}
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
switch (requestCode) {
case TAKE_PICTURE:
if (Bimp.drr.size() < 9 && resultCode == -1) {
Bimp.drr.add(path);
}
break;
}
}
}
| [
"1753391114@qq.com"
] | 1753391114@qq.com |
39c529358a1457377018d707f6f28ee672ebe5a2 | 6190973bd44bb1a44e33ac8e5880994a757c1a19 | /app/src/main/java/com/myapplicationdev/android/p10_ndpsongs_clv/CustomAdapter.java | 18ae47ba99b1b9058c1303a49e3cabbd61192bb4 | [] | no_license | winnie-yong/Our_NDP_Songs | 16ab3ba6012c3e935ea0900da4a175e132860482 | 59031a9e4e6bbbdc31070d93567635abd24d9553 | refs/heads/master | 2023-07-02T16:23:25.478306 | 2021-08-03T13:04:39 | 2021-08-03T13:04:39 | 392,252,011 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,210 | java | package com.myapplicationdev.android.p10_ndpsongs_clv;
import android.content.Context;
import android.media.Rating;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.RatingBar;
import android.widget.TextView;
import java.util.ArrayList;
public class CustomAdapter extends ArrayAdapter {
Context parent_context;
int layout_id;
ArrayList<Song> versionList;
public CustomAdapter(Context context, int resource,ArrayList<Song> objects){
super(context, resource,objects);
parent_context = context;
layout_id = resource;
versionList = objects;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
// Obtain the LayoutInflater object
LayoutInflater inflater = (LayoutInflater)
parent_context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
// "Inflate" the View for each row
View rowView = inflater.inflate(layout_id, parent, false);
// Obtain the UI components and do the necessary binding
TextView tvTitle = rowView.findViewById(R.id.textViewTitle);
TextView tvYear = rowView.findViewById(R.id.textViewYear);
TextView tvSinger = rowView.findViewById(R.id.textViewSinger);
ImageView ivNew = rowView.findViewById(R.id.imageViewNew);
RatingBar ratingBar = rowView.findViewById(R.id.ratingBar);
// Obtain the Android Version information based on the position
Song currentVersion = versionList.get(position);
// Set values to the TextView to display the corresponding information
tvTitle.setText(currentVersion.getTitle());
tvYear.setText(currentVersion.theYear());
tvSinger.setText(currentVersion.getSingers());
ivNew.setImageResource(R.drawable.newimg);
ratingBar.setRating(currentVersion.getStars());
if(currentVersion.getYearReleased() >= 2019){
ivNew.setVisibility(View.VISIBLE);
}
else{
ivNew.setVisibility(View.INVISIBLE);
}
return rowView;
}
}
| [
"3@Dogs1kenzp"
] | 3@Dogs1kenzp |
5a61ee56a92e08097dfd2d22026e2402efe10508 | 216a0268198c9a7fa14e9ec6e042e3e327957ce2 | /ssm_student_utill/src/main/java/com/chuyu/utill/TestGiit02.java | 9a80afa71dd07628132cf3a9ceadbd40e40f4bbc | [] | no_license | ChuYuLin/ssm_student | 3c85fede434b6e85cfb98f72568df28a6f81c5ac | bdfadd2653bf3c0b653513835c320c9fd9da09d0 | refs/heads/master | 2022-12-21T08:51:41.992456 | 2019-07-14T08:08:40 | 2019-07-14T08:08:40 | 196,780,566 | 2 | 0 | null | 2022-12-16T04:25:19 | 2019-07-14T01:15:49 | Java | UTF-8 | Java | false | false | 134 | java | package com.chuyu.utill;
public class TestGiit02 {
public void testo2(){
System.out.println("测试git功能2");
}
}
| [
"1473389776@qq.com"
] | 1473389776@qq.com |
60952bec6b24c267e804bf21ac347d9f7d496847 | a97ecf44f6888083626a991362d7ac1d40504852 | /4.JavaCollections/src/com/javarush/task/task34/task3410/model/Box.java | caabafa07fbc75340d4e8938ba6dfef0e7bb8640 | [] | no_license | LLPeterX/JavaRush | 2e8ee9931c0906a9a19bfffd91a011f4f08d846c | 39fe839625e3a4d4734ff50b962dbfa6211d2682 | refs/heads/master | 2022-12-02T22:07:18.308121 | 2019-10-12T10:24:39 | 2019-10-12T10:24:39 | 210,354,536 | 0 | 0 | null | 2022-11-24T09:16:58 | 2019-09-23T12:52:50 | Java | UTF-8 | Java | false | false | 1,079 | java | package com.javarush.task.task34.task3410.model;
import java.awt.*;
public class Box extends CollisionObject implements Movable {
public Box(int x, int y) {
super(x, y);
}
@Override
public void draw(Graphics graphics) {
// коробку рисуем квадратом желтого цвета с диагоналями
graphics.setColor(Color.PINK);
int x0 = this.getX() - getWidth() / 2;
int y0 = this.getY() - getHeight() / 2;
graphics.drawRect(x0, y0, getWidth(), getHeight());
graphics.drawRect(x0+1, y0+1, getWidth()-2, getHeight()-2);
graphics.drawLine(x0,y0,x0+getWidth(), y0+getHeight());
graphics.drawLine(x0,y0+getHeight(),x0+getWidth(), y0);
//graphics.fillRect(x0, y0, getWidth(), getHeight());
}
@Override
public void move(int x, int y) {
// перемещение игрока - смещение тек.координат
int newX = this.getX()+x;
int newY = this.getY()+y;
this.setX(newX);
this.setY(newY);
}
}
| [
"LPeter@mail.ru"
] | LPeter@mail.ru |
45c32ec6c0f6af4551657147f21793ad7326970e | 380799dcefc593103a4406908641895f11310ef2 | /Breakout v.4.1 (final)/src/de/tudarmstadt/informatik/fop/breakout/factories/BorderFactory.java | 6b8d302ba809ffc2fb99f32bb87d59f201baf7b1 | [] | no_license | farooqkhalil/BreakoutFoP | 521ba7f0380f4afa7f3ab28f85ab1c526116d4ff | c602f9b76df7649b9e05cdde0b2179224b2a326a | refs/heads/master | 2020-04-03T01:32:04.812178 | 2018-10-27T06:34:50 | 2018-10-27T06:34:50 | 154,933,631 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,538 | java | package de.tudarmstadt.informatik.fop.breakout.factories;
import org.newdawn.slick.geom.Vector2f;
import de.tudarmstadt.informatik.fop.breakout.constants.GameParameters;
import eea.engine.entity.Entity;
import eea.engine.interfaces.IEntityFactory;
/**
* Factory for creating Borders of the field. Borders are not visible and not
* passable entities for holding the ball in the field.
*
* @author Tobias Otterbein, Benedikt Wartusch
*
*/
public class BorderFactory implements IEntityFactory, GameParameters {
private BorderType type;
/**
* Factory Constructor
*
* @param type
* determines the type of a created border (TOP, LEFT or RIGHT)
*/
public BorderFactory(BorderType type) {
this.type = type;
}
@Override
public Entity createEntity() {
Entity border;
Vector2f size;
Vector2f position;
switch (type) {
case TOP:
border = new Entity(TOP_BORDER_ID);
position = new Vector2f(WINDOW_WIDTH / 2, 0);
size = new Vector2f(WINDOW_WIDTH, BORDER_WIDTH);
break;
case LEFT:
border = new Entity(LEFT_BORDER_ID);
position = new Vector2f(0, WINDOW_HEIGHT / 2);
size = new Vector2f(BORDER_WIDTH, WINDOW_HEIGHT);
break;
case RIGHT:
border = new Entity(RIGHT_BORDER_ID);
position = new Vector2f(WINDOW_WIDTH, WINDOW_HEIGHT / 2);
size = new Vector2f(BORDER_WIDTH, WINDOW_HEIGHT);
break;
default:
return null;
}
border.setPosition(position);
border.setSize(size);
border.setVisible(false);
border.setPassable(false);
return border;
}
}
| [
"farooqkhalil313@gmail.com"
] | farooqkhalil313@gmail.com |
74690bf5ee56bd3851cb84b800a02e6ffb9e5a2f | d41df3b53beb380e236a38f153b9dfb79fa24b6f | /src/main/java/com/ug/EMS/controller/DepartmentController.java | 66e716fd1823963bcd6174e0e5fdcb2bec955438 | [] | no_license | UttiyaGhosh/EmployeeManagementSystem | 263ff566c5a3916dce2729615b24a29013fee85d | 3750aaf3ee281e2763564397efd48865e7cbcff4 | refs/heads/master | 2023-07-18T10:22:14.175149 | 2021-09-01T06:37:36 | 2021-09-01T06:37:36 | 401,955,993 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,423 | java | package com.ug.EMS.controller;
import javax.servlet.http.HttpServletRequest;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;
import com.ug.EMS.entity.Department;
import com.ug.EMS.service.ComplianceService;
import com.ug.EMS.service.DepartmentService;
import com.ug.EMS.service.EmployeeService;
@RestController
public class DepartmentController {
@Autowired
private EmployeeService employeeService;
@Autowired
private DepartmentService departmentService;
@Autowired
private ComplianceService complianceService;
private static Logger logger = Logger.getLogger(DepartmentController.class);
@GetMapping("/alterDepartment")
public ModelAndView alterEmployee(@RequestParam("act") String action, HttpServletRequest request) {
ModelAndView mv = new ModelAndView();
try {
if (action.equals("add")) {
mv.setViewName("editDepartment");
} else if (action.equals("edit")) {
mv.setViewName("editDepartment");
mv.addObject("department",
departmentService.getDepartment(Integer.parseInt(request.getParameter("id"))));
} else {
departmentService.deleteDepartment(Integer.parseInt(request.getParameter("id")));
mv.setViewName("adminHome");
mv.addObject("employeeList", employeeService.getAllEmployees());
mv.addObject("departmentList", departmentService.getAllDepartments());
mv.addObject("complianceList", complianceService.getAllCompliances());
}
} catch (Exception e) {
HttpStatus status = HttpStatus.INTERNAL_SERVER_ERROR;
logger.error("Error occurred. Please check logs.", e);
mv.setStatus(status);
mv.setViewName("error");
mv.addObject("exception", e);
mv.addObject("code", status.value());
mv.addObject("message", status.getReasonPhrase());
}
return mv;
}
@PostMapping("/saveDepartment")
public ModelAndView editEmployee(@RequestParam("departmentid") String departmentidStr,
@RequestParam("departmentName") String departmentName, HttpServletRequest request) {
ModelAndView mv = new ModelAndView();
try {
Department department = new Department();
if (departmentidStr != "")
department.setDepartmentId(Integer.parseInt(departmentidStr));
department.setDepartmentName(departmentName);
if (departmentName == "") {
mv.setViewName("editDepartment");
mv.addObject("message", "Please fill all the details");
mv.addObject("department", department);
} else {
departmentService.saveDepartment(department);
mv.setViewName("adminHome");
mv.addObject("employeeList", employeeService.getAllEmployees());
mv.addObject("departmentList", departmentService.getAllDepartments());
mv.addObject("complianceList", complianceService.getAllCompliances());
}
} catch (Exception e) {
HttpStatus status = HttpStatus.INTERNAL_SERVER_ERROR;
logger.error("Error occurred. Please check logs.", e);
mv.setStatus(status);
mv.setViewName("error");
mv.addObject("exception", e);
mv.addObject("code", status.value());
mv.addObject("message", status.getReasonPhrase());
}
return mv;
}
}
| [
"ughosh@cisco.com"
] | ughosh@cisco.com |
8f54d9c1748e9d851ebe7481c4bba959c405f236 | 886f9d3857e66f81eb459601371beea100bb5fb3 | /ocr-api/src/main/java/com/caspar/ocr/api/controller/WordController.java | 819cacc79c08743bee652f2c1c03bdf0d1fdd9e0 | [] | no_license | CasparLong/ocr | 60ea77f3157a85c226908a60cdad8959e72d2951 | d9c9ad25c3e3364770ac061fdb4ab5efd0540d5a | refs/heads/master | 2020-03-11T08:15:06.095985 | 2018-05-10T06:19:22 | 2018-05-10T06:19:22 | 129,877,912 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,234 | java | package com.caspar.ocr.api.controller;
import com.caspar.ocr.api.form.TextWordForm;
import com.caspar.ocr.api.service.WordService;
import com.caspar.ocr.common.enums.ResponseEnum;
import com.caspar.ocr.common.exception.OcrException;
import com.caspar.ocr.common.response.ResponseBuilder;
import com.caspar.ocr.common.response.dto.Response;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Mono;
import javax.validation.Valid;
/**
* Description:
*
* @author Caspar
* @Date 2018-04-17
*/
@RestController
@RequestMapping("/word")
public class WordController {
@Autowired
private WordService wordService;
@RequestMapping("/add")
public Mono<Response> addWord(@Valid TextWordForm textWordForm,
BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
throw new OcrException(ResponseEnum.PARAM_ERROR);
}
return Mono.fromCallable(() -> ResponseBuilder.buildSuccess(wordService.addTextWord(textWordForm)));
}
}
| [
"heyjun1chi@163.com"
] | heyjun1chi@163.com |
47108720b997fafdac1a00b1646c7e04a95516f9 | 5704196b860b53e3dceb92c56ed35f4b8cf96e87 | /app/src/main/java/com/thnkin/listviewwithbaseadapters/BlogTemplate.java | b95489f674217024c0304ffd74adaa89468cf30a | [] | no_license | saleemkhan08/ListViewWithBaseAdapters | d880719a45193c03e4449ffe64b33b2cc638598f | 8b0ccb46b2e852589dcb3a72085ea7a59c353f8c | refs/heads/master | 2021-01-10T03:55:51.296078 | 2015-10-18T16:37:30 | 2015-10-18T16:37:30 | 44,486,397 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,192 | java | package com.thnkin.listviewwithbaseadapters;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
public class BlogTemplate extends ActionBarActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_blog_template);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_blog_template, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
}
| [
"saleemkhan08@gmail.com"
] | saleemkhan08@gmail.com |
2c812327bf62d92a911cdeb2812bf3d39630d9ff | b04471b102b2285f0b8a94ce6e3dc88fc9c750af | /rest-assert-core/src/test/java/com/github/mjeanroy/restassert/core/data/StrictTransportSecurityBuilderTest.java | 760a502af696fe6bfbd9dec48b8a7bdc2afabfe7 | [] | no_license | mjeanroy/rest-assert | 795f59cbb2e1b6fac59408439a1fae5ee97d88d1 | b9ea9318c1907cc45a6afd42ac200b1ead97f000 | refs/heads/master | 2022-12-25T06:02:07.555504 | 2022-05-21T14:25:43 | 2022-05-21T14:25:43 | 128,626,910 | 0 | 0 | null | 2022-11-16T03:00:14 | 2018-04-08T09:58:49 | Java | UTF-8 | Java | false | false | 2,337 | java | /**
* The MIT License (MIT)
*
* Copyright (c) 2014-2021 Mickael Jeanroy
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.github.mjeanroy.restassert.core.data;
import org.junit.Test;
import static org.assertj.core.api.Assertions.assertThat;
public class StrictTransportSecurityBuilderTest {
@Test
public void it_should_create_strict_transport_security_with_max_age() {
StrictTransportSecurity sts = StrictTransportSecurity.builder(3600).build();
assertThat(sts.getMaxAge()).isEqualTo(3600);
assertThat(sts.isIncludeSubDomains()).isFalse();
assertThat(sts.isPreload()).isFalse();
}
@Test
public void it_should_create_strict_transport_security_with_include_sub_domains() {
StrictTransportSecurity sts = StrictTransportSecurity.builder(3600)
.includeSubDomains()
.build();
assertThat(sts.getMaxAge()).isEqualTo(3600);
assertThat(sts.isIncludeSubDomains()).isTrue();
assertThat(sts.isPreload()).isFalse();
}
@Test
public void it_should_create_strict_transport_security_with_include_preload() {
StrictTransportSecurity sts = StrictTransportSecurity.builder(3600)
.includeSubDomains()
.preload()
.build();
assertThat(sts.getMaxAge()).isEqualTo(3600);
assertThat(sts.isIncludeSubDomains()).isTrue();
assertThat(sts.isPreload()).isTrue();
}
}
| [
"mickael.jeanroy@gmail.com"
] | mickael.jeanroy@gmail.com |
0cdcfdac89726a1c283f5d52c22f319d4db2a4a1 | 85909013a05f19222cd51221543c46d78c59ee44 | /trunk/branches/bevy-v0/src/com/thesunsoft/bevy/EventsActivity.java | 9392834a156b9418cb1cf2c9244b6979d7bc2488 | [] | no_license | BGCX067/f9a1ab62397a0d40be2a21a12154aef8-svn-to-git | 5be3a512cb303e156c806968badf738c8f35753f | fa9641306ab5220f1916373c33683fc6566074b3 | refs/heads/master | 2016-09-01T08:52:17.662197 | 2015-12-28T14:39:31 | 2015-12-28T14:39:31 | 48,836,134 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,992 | java | package com.thesunsoft.bevy;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
import org.json.JSONArray;
import org.json.JSONObject;
import android.content.Context;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.AdapterView;
import android.widget.Button;
import android.widget.ListView;
import android.widget.AdapterView.OnItemClickListener;
import com.facebook.HttpMethod;
import com.facebook.Request;
import com.facebook.RequestAsyncTask;
import com.facebook.Response;
import com.facebook.Session;
import com.facebook.model.GraphObject;
import com.thesunsoft.bevy.R;
import com.thesunsoft.bevy.adapters.LikeAdapter;
import com.thesunsoft.bevy.model.LikeObj;
public class EventsActivity extends FragmentActivity implements OnClickListener, OnItemClickListener{
private static final String TAG= "PeopleActivity";
private static final String MY_LIKES = "me/events";
private static final String ID = "id";
private static final String NAME = "name";
private static final String CATEGORY = "category";
private static final String IMAGE = "picture";
private static final String LINK = "link";
private RequestAsyncTask taskLike=null;
private ListView listView;
private LikeAdapter adapter;
private Context context;
private Button btnCancel;
private ArrayList<LikeObj> lists = new ArrayList<LikeObj>();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_events);
this.context = this;
initCompnent();
setActionListener();
//this.loadData();
}
private void initCompnent(){
listView = (ListView)findViewById(R.id.list_view_like);
btnCancel = (Button)findViewById(R.id.btn_cancel);
adapter = new LikeAdapter(context, lists);
listView.setAdapter(adapter);
}
private void setActionListener(){
listView.setOnItemClickListener(this);
btnCancel.setOnClickListener(this);
}
@Override
protected void onDestroy() {
super.onDestroy();
if(taskLike!=null)
taskLike.cancel(true);
}
public void loadData(){
Session session = Session.getActiveSession();
if(session==null){
session = Session.openActiveSessionFromCache(this);
}else if(session.isOpened()){
Set<String> fields = new HashSet<String>();
Bundle params =new Bundle();
//params.putString("type", "like");
//params.putString("q", "platform");
//params.putString("type", "post");
//params.putString("q", "watermelon");
//params.putString("object", "website");
String[] requiredFields = new String[]{
ID,
NAME,
CATEGORY,
IMAGE,
LINK
};
fields.addAll(Arrays.asList(requiredFields));
params.putString("fields", TextUtils.join(",", fields));
params.putInt("limit", 1000);
Request request = new Request(session, MY_LIKES, params, HttpMethod.GET, new Request.Callback() {
@Override
public void onCompleted(Response response) {
// TODO Auto-generated method stub
try
{
GraphObject go = response.getGraphObject();
JSONObject jso = go.getInnerJSONObject();
JSONArray arr = jso.getJSONArray("data");
for ( int i = 0; i < (arr.length()); i++ )
{
JSONObject json_obj = arr.getJSONObject(i);
LikeObj likeObj = new LikeObj();
likeObj.setId(json_obj.getString("id"));
likeObj.setName(json_obj.getString("name"));
likeObj.setCategory(json_obj.getString("category"));
likeObj.setLink(json_obj.getString("link"));
JSONObject picture_obj = json_obj.getJSONObject("picture");
//Log.e(TAG, "picture_obj=>"+picture_obj.toString());
JSONObject picture_data = picture_obj.getJSONObject("data");
likeObj.setImageUrl(picture_data.getString("url"));
Log.e(TAG, "picture_obj=>"+i+"=>"+picture_data.getString("url"));
lists.add(likeObj);
}
}
catch ( Throwable t )
{
t.printStackTrace();
}
if(lists.size()!=0){
adapter.notifyDataSetChanged();
}
}
});
taskLike = new RequestAsyncTask(request);
taskLike.execute();
}
}
@Override
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
// TODO Auto-generated method stub
}
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
if(v.getId() == R.id.btn_cancel){
finish();
}
}
}
| [
"you@example.com"
] | you@example.com |
d3b0ec45c142b90bee3307d56f92e30d513b962c | 729918b4503dc2dd9b36f4140298f1b067ff9757 | /ru/btconsulting/orm/db2/annotations/User.java | df3d7159aa485671746d41f309e57543b38744c3 | [] | no_license | vexan/LightWeigth-DB2-ORM-Framework | b3d869a3fde3dbbdf481bbc46acd1364a7c3bac8 | 99cf0fd7ecde8cc83ca0ea84be198f9d23ccf2c5 | refs/heads/master | 2016-09-05T16:24:34.957347 | 2014-04-08T10:20:57 | 2014-04-08T10:20:57 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 413 | java | package ru.btconsulting.orm.db2.annotations;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Created by apple on 08.04.14.
*/
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface User {
String name() default "Admin";
String password() default "Admin";
}
| [
"nlazarevdev@gmail.com"
] | nlazarevdev@gmail.com |
be3b195000d97041a660a830599666f582bf3459 | 5d59e5fa4f1e6d246518f3ea6faecb98314c5361 | /tarea_mvc_FormularioRegistro/src/main/java/es/alberto/cursospring/RegistroUsuarioController.java | 5c8484144def89979d7a55fff7135c358c7bf386 | [] | no_license | apecr/projects | b1b20ec98495ff41e35e8db83285355fb8143093 | d6265a1c35405696c98e7dbe9178b361c7dfe5fb | refs/heads/master | 2016-08-12T04:22:34.857584 | 2016-03-07T13:23:16 | 2016-03-07T13:23:16 | 49,601,242 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,627 | java | package es.alberto.cursospring;
import java.util.HashMap;
import java.util.Map;
import javax.validation.Valid;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.ui.ModelMap;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.bind.annotation.InitBinder;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import es.alberto.cursospring.binder.NombreMayusculaEditor;
import es.alberto.cursospring.vo.Usuario;
/**
* Handles requests for the application home page.
*/
@Controller
@RequestMapping("/usuario")
public class RegistroUsuarioController {
public static final String USER_DETAIL = "userDetail";
public static final String REDIRECT_USUARIO = "redirect:/usuario/";
public static final String CREATE_USER = "createUser";
private static final Logger LOG = LoggerFactory.getLogger(RegistroUsuarioController.class);
private Map<Long, Usuario> mapaUsuarios = new HashMap<Long, Usuario>();
@InitBinder
protected void initBinder(WebDataBinder binder) {
binder.registerCustomEditor(String.class, "nombre", new NombreMayusculaEditor());
binder.registerCustomEditor(String.class, "apellido", new NombreMayusculaEditor());
}
// Metodo handler formulario, para crear al estudiante
@RequestMapping(method = RequestMethod.GET)
public String crear(ModelMap model) {
LOG.info("Primer metodo del controlador");
Usuario user = new Usuario();
model.addAttribute("userModel", user);
// retornamos la vista form
return CREATE_USER;
}
@RequestMapping(method = RequestMethod.POST)
public String guardar(@Valid @ModelAttribute("userModel") Usuario user, BindingResult result) {
if (result.hasErrors()) {
return CREATE_USER;
}
this.mapaUsuarios.put(user.asignarId(), user);
return REDIRECT_USUARIO + user.getId();
}
@RequestMapping(value = "{id}", method = RequestMethod.GET)
public String verDetalle(@PathVariable Long id, Model model) {
Usuario user = this.mapaUsuarios.get(id);
if (user == null) {
throw new RecursoNoEncontradoException(id);
}
model.addAttribute("userModel", user);
// return "cuenta/detalle"; // Muestra el detalle de la cuenta en
// formato formulario
return USER_DETAIL; // Muestra el detalle de la cuenta en formato
// tabla html
}
}
| [
"alberto@Asus"
] | alberto@Asus |
2164bca69040ff76d94a2cb91a0efd6546949f56 | f9e49eb19fd3131e7a6644d13bddc818f04acb05 | /src/main/java/domain/Admin.java | 066af8d208e84182cf9eff569337427063b8ee7f | [] | no_license | Azkunaga/SI2 | a0e54732233f1087946fb2f936fbf1d530c43951 | f01e5ea3cd2e1bcbaef80374f26d96b3abbd1da7 | refs/heads/master | 2023-09-03T19:04:35.433307 | 2021-11-14T14:25:44 | 2021-11-14T14:25:44 | 404,651,051 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 485 | java | package domain;
import java.io.Serializable;
import javax.persistence.Entity;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
@Entity
@XmlAccessorType(XmlAccessType.FIELD)
public class Admin extends Pertsona implements Serializable{
/**
*
*/
private static final long serialVersionUID = 1L;
public Admin(String erabiltzailea, String pasahitza) {
super(erabiltzailea, pasahitza);
}
public Admin() {
super();
}
}
| [
"aritzazkunaga@users.noreply.github.com"
] | aritzazkunaga@users.noreply.github.com |
9be42fb34e59c86f0dd9150cd23e6cf1168e2ba1 | 1e17165b3c12f35e1e687155610b35518be50ce7 | /app/src/androidTest/java/com/example/codetribe/parttttty/ExampleInstrumentedTest.java | 07855c44dad371a62f4e9b8d01bd616b0e8bf88f | [] | no_license | EmeldaP/Parttttty | 34a4d641c7ee4d436243ad01adec95fc2b40452f | 271e03485ef58cdc7fdf72ad500d010534063bec | refs/heads/master | 2020-12-02T22:51:26.922815 | 2017-07-04T08:24:35 | 2017-07-04T08:24:35 | 96,193,527 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 766 | java | package com.example.codetribe.parttttty;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumentation test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.example.codetribe.parttttty", appContext.getPackageName());
}
}
| [
"phashae25@gmail.com"
] | phashae25@gmail.com |
6396b51835ca0bbf8f5887fe7c363090466d5991 | d125d66b96996a62a9ca8f7546eb80534fc30cdc | /platform/lang-api/src/com/intellij/psi/codeStyle/arrangement/model/ArrangementSettingsNodeVisitor.java | e217ea55bea612b57b7b488e45d875f35a5201ab | [
"Apache-2.0"
] | permissive | bolinfest/intellij-community | a39664fc138def4db31fdadf658edca2dea40ad7 | c700754a823a50af192fce509e5cb51ffcccbd61 | refs/heads/master | 2020-12-25T17:05:46.117944 | 2012-08-13T14:37:12 | 2012-08-13T15:55:25 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 932 | java | /*
* Copyright 2000-2012 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.intellij.psi.codeStyle.arrangement.model;
import org.jetbrains.annotations.NotNull;
/**
* @author Denis Zhdanov
* @since 8/8/12 1:20 PM
*/
public interface ArrangementSettingsNodeVisitor {
void visit(@NotNull ArrangementSettingsAtomNode node);
void visit(@NotNull ArrangementSettingsCompositeNode node);
}
| [
"Denis.Zhdanov@jetbrains.com"
] | Denis.Zhdanov@jetbrains.com |
aae43de35d476cea61b50470f4d9a94f745aae7b | a0df20ca8ae4c2e98c687753fca46f6b5bea78b5 | /src/module-info.java | cc6c382256aee11441a1fb9942aa1fc80f21d632 | [] | no_license | anthonyrebautista/abauti14-308-2T | 1e2eae0696f719d966824ea02c9222f8a5441deb | b5c7c2afad22f05192804bd5f4b70c92f6066454 | refs/heads/master | 2020-04-21T10:24:13.916163 | 2019-02-06T22:27:05 | 2019-02-06T22:27:05 | 169,485,212 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 70 | java | /**
*
*/
/**
* @author anthonybautista
*
*/
module Multiply2 {
} | [
"34044282+anthonyrebautista@users.noreply.github.com"
] | 34044282+anthonyrebautista@users.noreply.github.com |
429401ec7895bc8427a7901f192cd47bfdf739ef | 44e7adc9a1c5c0a1116097ac99c2a51692d4c986 | /aws-java-sdk-ssm/src/main/java/com/amazonaws/services/simplesystemsmanagement/model/transform/DeregisterTaskFromMaintenanceWindowResultJsonUnmarshaller.java | 20b4d6ca98a23887d202d9568c576574fb18883e | [
"Apache-2.0"
] | permissive | QiAnXinCodeSafe/aws-sdk-java | f93bc97c289984e41527ae5bba97bebd6554ddbe | 8251e0a3d910da4f63f1b102b171a3abf212099e | refs/heads/master | 2023-01-28T14:28:05.239019 | 2020-12-03T22:09:01 | 2020-12-03T22:09:01 | 318,460,751 | 1 | 0 | Apache-2.0 | 2020-12-04T10:06:51 | 2020-12-04T09:05:03 | null | UTF-8 | Java | false | false | 3,397 | java | /*
* Copyright 2015-2020 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.simplesystemsmanagement.model.transform;
import java.math.*;
import javax.annotation.Generated;
import com.amazonaws.services.simplesystemsmanagement.model.*;
import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*;
import com.amazonaws.transform.*;
import com.fasterxml.jackson.core.JsonToken;
import static com.fasterxml.jackson.core.JsonToken.*;
/**
* DeregisterTaskFromMaintenanceWindowResult JSON Unmarshaller
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class DeregisterTaskFromMaintenanceWindowResultJsonUnmarshaller implements
Unmarshaller<DeregisterTaskFromMaintenanceWindowResult, JsonUnmarshallerContext> {
public DeregisterTaskFromMaintenanceWindowResult unmarshall(JsonUnmarshallerContext context) throws Exception {
DeregisterTaskFromMaintenanceWindowResult deregisterTaskFromMaintenanceWindowResult = new DeregisterTaskFromMaintenanceWindowResult();
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 deregisterTaskFromMaintenanceWindowResult;
}
while (true) {
if (token == null)
break;
if (token == FIELD_NAME || token == START_OBJECT) {
if (context.testExpression("WindowId", targetDepth)) {
context.nextToken();
deregisterTaskFromMaintenanceWindowResult.setWindowId(context.getUnmarshaller(String.class).unmarshall(context));
}
if (context.testExpression("WindowTaskId", targetDepth)) {
context.nextToken();
deregisterTaskFromMaintenanceWindowResult.setWindowTaskId(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 deregisterTaskFromMaintenanceWindowResult;
}
private static DeregisterTaskFromMaintenanceWindowResultJsonUnmarshaller instance;
public static DeregisterTaskFromMaintenanceWindowResultJsonUnmarshaller getInstance() {
if (instance == null)
instance = new DeregisterTaskFromMaintenanceWindowResultJsonUnmarshaller();
return instance;
}
}
| [
""
] | |
4f147aff8da1e6b82fefa1a46fdfddf345c1fa16 | a834e2b6524799c01fa5f0b0591011a6303db479 | /src/main/java/com/kattysoft/core/model/RegistrationList.java | 852e134130f9726387695f32dce6358f2b30da35 | [] | no_license | AnatolyR/sokolrm | 1ac947eec70b813d46b910d4db0686f689c71126 | 27361f9afe222eafe7e153efb690d9095f53212a | refs/heads/master | 2022-02-15T19:16:45.932108 | 2019-05-27T10:00:36 | 2019-05-27T10:00:36 | 54,663,494 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,624 | java | /*
* Copyright 2017 Anatolii Rakovskii (rtolik@yandex.ru)
*
* No part of this file can be copied or reproduced without written permission of author.
*
* Software distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
package com.kattysoft.core.model;
import org.hibernate.annotations.Type;
import javax.persistence.*;
import java.util.List;
import java.util.UUID;
/**
* Author: Anatolii Rakovskii (rtolik@yandex.ru)
* Date: 29.03.2017
*/
@Entity
@Table(name = "registrationlists")
public class RegistrationList {
@Id
@Type(type = "pg-uuid")
private UUID id;
private String title;
private String prefix;
private String suffix;
private Integer count;
@Transient
private List<UUID> spaces;
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getPrefix() {
return prefix;
}
public void setPrefix(String prefix) {
this.prefix = prefix;
}
public String getSuffix() {
return suffix;
}
public void setSuffix(String suffix) {
this.suffix = suffix;
}
public Integer getCount() {
return count;
}
public void setCount(Integer count) {
this.count = count;
}
public List<UUID> getSpaces() {
return spaces;
}
public void setSpaces(List<UUID> spaces) {
this.spaces = spaces;
}
}
| [
"rtolik@yandex.ru"
] | rtolik@yandex.ru |
cd70c071c2ae5f5057f6c42727ac291d83e5cdaf | 725e100c4384a479ce1f937da0e8ef51512d76a8 | /src/main/java/com/zyd/core/util/ClasspathResource.java | 0ff96b6b5cd9e54fe2ad7bfa10d7d490d8a29bec | [] | no_license | king-zyd/core | 4652fca2e0e6d40633e96a9fa5ac79095b93e883 | a5ccfa430999c39f0893bf23e8f9f5b6f4b2ec5f | refs/heads/master | 2021-01-01T17:27:26.832917 | 2014-09-01T08:36:14 | 2014-09-01T08:36:14 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,058 | java | package com.zyd.core.util;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.nio.charset.Charset;
/**
* @author neo
*/
public final class ClasspathResource {
private byte[] bytes;
private final String resourcePath;
public ClasspathResource(String resourcePath) {
this.resourcePath = resourcePath;
InputStream stream = null;
try {
stream = ClasspathResource.class.getClassLoader().getResourceAsStream(resourcePath);
if (stream == null) throw new IllegalArgumentException("can not load resource, path=" + resourcePath);
bytes = IOUtils.bytes(stream);
} finally {
IOUtils.close(stream);
}
}
public InputStream getInputStream() {
return new ByteArrayInputStream(bytes);
}
public String getTextContent() {
return new String(bytes, Charset.defaultCharset());
}
public byte[] getBytes() {
return bytes;
}
public String resourcePath() {
return resourcePath;
}
}
| [
"constance.zhuang@suryani.cn"
] | constance.zhuang@suryani.cn |
bd8822049e54f454576a75795c77f89985411339 | e38deb441c806036972868b402713d38440c5fd7 | /day08/Test02.java | 288bf160a3a0fd029fe8f93a48e024807ab9bd31 | [] | no_license | hotaru1619/Java | 2ed4e6cf15644fe19c6c81cdbae8c7f9646c6467 | f769cd2459b3cc129520a22470d974464ca85516 | refs/heads/master | 2020-11-24T20:48:56.573032 | 2019-12-16T08:28:16 | 2019-12-16T08:28:16 | 228,336,460 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 872 | java | package day08;
public class Test02 {
public static void main(String[] args) {
//SingleTone s = null;
SingleTone s = SingleTone.getInstance();
SingleTone s1 = SingleTone.getInstance();
SingleTone s2= SingleTone.getInstance();
SingleTone s3 = SingleTone.getInstance();
System.out.println(s1);
System.out.println(s2);
System.out.println(s3);
//last code(private => private static)
//last code(public => public static)
}
}
class SingleTone{
private static SingleTone s ;
private SingleTone(){}
//생성자 함수의 접근 지정자가 private => (same class)
public static SingleTone getInstance() {
if(s==null) s= new SingleTone();
return s;
//getInstance : instance 만들어주는 메소드
//private SingleTone s; => 주소없이 메소드 호출하려면 static 필요
//static(공유 개념) this자원 사용 불가
}
}
| [
"hotaru1619@naver.com"
] | hotaru1619@naver.com |
e47e5fe0ec72cab4b67077c3307924fa10835932 | f28304495abad9d6e4746e7b1e63e2a978852f7c | /app/src/main/java/com/book/MainActivity.java | ae32a89a99c5edad2f8b869bbaa7b4f0c3a03976 | [] | no_license | hananideen/Book | b966c012cdfd7c957745ea2da9ed234129de6cec | 10c24a8af56fde4a7d9933355a307cc5503ee4df | refs/heads/master | 2021-01-09T21:42:49.243136 | 2015-12-06T16:05:34 | 2015-12-06T16:05:34 | 47,397,517 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,617 | java | package com.book;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.graphics.drawable.Drawable;
import android.support.design.widget.NavigationView;
import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.app.AppCompatActivity;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.support.v4.widget.DrawerLayout;
import android.widget.AdapterView;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
public class MainActivity extends AppCompatActivity {
public static String URL_TAG = "url";
public static String POSITION_TAG = "position";
public static String PAGE_TAG = "page";
private DrawerLayout mDrawer;
private Toolbar toolbar;
private NavigationView nvDrawer;
private ActionBarDrawerToggle drawerToggle;
private TextView tvName;
private ImageView ivIcon;
private ListView lvChapter;
private List<Chapter> ChapterList;
private ChapterAdapter chapAdapter;
private SharedPreferences preferences;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
if (savedInstanceState == null) {
getSupportFragmentManager().beginTransaction().replace(R.id.flContent, new ContentFragment()).commit();
}
toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayShowTitleEnabled(false);
preferences = getSharedPreferences("Preference", Context.MODE_PRIVATE);
mDrawer = (DrawerLayout) findViewById(R.id.drawer_layout);
drawerToggle = setupDrawerToggle();
mDrawer.setDrawerListener(drawerToggle);
nvDrawer = (NavigationView) findViewById(R.id.nvView);
View header = LayoutInflater.from(this).inflate(R.layout.nav_header, null);
nvDrawer.addHeaderView(header);
tvName = (TextView) header.findViewById(R.id.tvName);
ivIcon = (ImageView) header.findViewById(R.id.ivIcon);
nvDrawer.inflateHeaderView(R.layout.nav_header2);
ChapterList = new ArrayList<Chapter>();
chapAdapter = new ChapterAdapter(this, ChapterList);
lvChapter = (ListView) findViewById(R.id.lvChapter);
lvChapter.setAdapter(chapAdapter);
lvChapter.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
selectDrawerItem(i);
}
});
loadData();
loadChapter();
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
String currentPage = preferences.getString(PAGE_TAG, "");
int page = 0;
switch (item.getItemId()) {
case R.id.action_previous:
page = Integer.parseInt(currentPage) - 1;
btnNextPrevious(page);
return true;
case R.id.action_next:
page = Integer.parseInt(currentPage) + 1;
btnNextPrevious(page);
return true;
}
if (drawerToggle.onOptionsItemSelected(item)) {
return true;
}
return super.onOptionsItemSelected(item);
}
@Override
protected void onPostCreate(Bundle savedInstanceState) {
super.onPostCreate(savedInstanceState);
drawerToggle.syncState();
}
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
drawerToggle.onConfigurationChanged(newConfig);
}
private ActionBarDrawerToggle setupDrawerToggle() {
return new ActionBarDrawerToggle(this, mDrawer, toolbar, R.string.drawer_open, R.string.drawer_close);
}
public void selectDrawerItem(int i) {
Fragment fragment = null;
Bundle bundle=new Bundle();
Chapter chapter = chapAdapter.getChapter(i);
fragment = new ContentFragment();
bundle.putInt(POSITION_TAG, i+1);
bundle.putString(URL_TAG, chapter.getUrl());
fragment.setArguments(bundle);
FragmentManager fragmentManager = getSupportFragmentManager();
fragmentManager.beginTransaction().replace(R.id.flContent, fragment).commit();
mDrawer.closeDrawers();
}
public void loadData() {
try {
JSONObject obj = new JSONObject(loadJSONFromAsset());
String appName = obj.getString("title");
String icon = obj.getString("icon");
Log.d("json object: ", appName +", " +icon);
tvName.setText(appName);
try {
InputStream ims = getAssets().open(icon);
Drawable d = Drawable.createFromStream(ims, null);
ivIcon.setImageDrawable(d);
}
catch(IOException ex) {
return;
}
} catch (JSONException e) {
e.printStackTrace();
}
}
public void loadChapter() {
try {
JSONObject obj = new JSONObject(loadJSONFromAsset());
JSONArray jsonArray = obj.getJSONArray("toc");
for (int i = 0; i < jsonArray.length(); i++) {
JSONObject jsonObject = jsonArray.getJSONObject(i);
Chapter chapter = new Chapter(new Json2Chapter(jsonObject));
ChapterList.add(chapter);
chapAdapter.notifyDataSetChanged();
Log.d("json object: ", jsonObject.getString("url"));
}
} catch (JSONException e) {
e.printStackTrace();
}
}
public String loadJSONFromAsset() {
String json = null;
try {
InputStream is = getAssets().open("book.json");
int size = is.available();
byte[] buffer = new byte[size];
is.read(buffer);
is.close();
json = new String(buffer, "UTF-8");
} catch (IOException ex) {
ex.printStackTrace();
return null;
}
return json;
}
public void btnNextPrevious(int page) {
if(page<1) {
//do nothing
} else if(page>3) {
//do nothing
} else {
String url = "chapter" +page +".html";
Fragment fragment = null;
Bundle bundle = new Bundle();
fragment = new ContentFragment();
bundle.putString(URL_TAG, url);
bundle.putInt(POSITION_TAG, page);
fragment.setArguments(bundle);
FragmentManager fragmentManager = getSupportFragmentManager();
fragmentManager.beginTransaction().replace(R.id.flContent, fragment).commit();
}
}
}
| [
"hananee92@gmail.com"
] | hananee92@gmail.com |
31a536f0d2ea92697f0fd75e671fdd665b9243a2 | 74f3ddabc22eb087630921921b644e6c24cc5ec9 | /framework-validator/src/main/java/io/github/wrobezin/framework/common/check/string/StringRegexValidator.java | 66e6b96edcce6d79b65828ae100a8cbb3652e79c | [] | no_license | wrobezin/scaffoldDemo | 0991f3b2de8afd30bd50d6b0d88f224c0a4e0f11 | d5769a573f5735a05f5abcd6ba7dd12fa9804f4c | refs/heads/master | 2020-11-27T19:21:28.261807 | 2020-04-13T16:50:07 | 2020-04-13T16:50:07 | 229,574,919 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 928 | java | package io.github.wrobezin.framework.common.check.string;
import io.github.wrobezin.framework.common.check.AbstractParameterValidator;
import io.github.wrobezin.framework.common.check.VerifyResult;
import io.github.wrobezin.framework.common.check.annotation.ComponentValidator;
import io.github.wrobezin.framework.common.check.annotation.StringRegexSatisfy;
/**
* 字符串正则校验器
*
* @author yuan
* date: 2019/12/16
*/
@ComponentValidator(StringValidatorChain.class)
public class StringRegexValidator extends AbstractParameterValidator<StringRegexSatisfy, String> {
@Override
protected VerifyResult verify(StringRegexSatisfy annotation, String value) {
if (value.matches(annotation.regex())) {
return VerifyResult.VALID;
}
return new VerifyResult(false, annotation.invalidMessage());
}
@Override
public Double getPriority() {
return 20.0;
}
}
| [
"siyuan_liang@sui.com"
] | siyuan_liang@sui.com |
c7427b77b8f49e4cf71f6936432abdd537f61ea6 | b44f3a3ded9fc83edfb959c1fbb25fc1fd5ba9c3 | /src/neuralnetwork/neat/visualizer/Visualizer.java | 9550dc0cdfa713543c7996591e3120cf287d72ba | [] | no_license | tfernands/MyNeuralNetwork | b0d331962262b4a6d7eb2996f84016b626fcfe32 | 472ebb5a9aa8e0333a655ad106ea20350a1506ec | refs/heads/master | 2020-03-12T17:22:12.876654 | 2018-04-25T04:11:09 | 2018-04-25T04:11:09 | 120,779,538 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,198 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package neuralnetwork.neat.visualizer;
import static mylibray.PCanvas.canvas;
import mylibray.PCamera;
import neuralnetwork.neat.Genome;
import java.util.ArrayList;
import mylibray.SBtn;
import functions.F;
import mylibray.Vector2D;
/**
*
* @author Thales
*/
public class Visualizer {
PCamera camera;
public Genome genome;
private ArrayList<DNode> nodes;
float x;
float y;
float sizeY;
float sizeX;
float size;
float spacingY;
public Visualizer(PCamera camera, Genome genome) {
this.genome = genome;
this.camera = camera;
nodes = new ArrayList<>(genome.nodes.size());
for (int i = 0; i < genome.nodes.size(); i++) {
nodes.add(new DNode(genome.nodes.get(i).id));
}
}
public void set(float x, float y, float sizeX, float sizeY, float size) {
this.x = x;
this.y = y;
this.sizeY = sizeY;
this.sizeX = sizeX;
this.size = size;
nodes.get(0).btn.set(x+sizeX/10, y, size);
int maxLayerY = Math.max(genome.sensorsCount, genome.outputsCount);
if (maxLayerY < 2) {
maxLayerY = 2;
}
spacingY = (sizeY - size * maxLayerY) / (maxLayerY - 1);
float posY;
float posX;
//Sensors
posX = x;
posY = y + (sizeY - size * genome.sensorsCount - spacingY * (genome.sensorsCount - 1)) / 2;
for (int s = 1; s <= genome.sensorsCount; s++) {
nodes.get(s).btn.set(posX, posY, size);
posY += spacingY + size;
}
//Outputs
posX = x + sizeX - size;
posY = y + (sizeY - size * genome.outputsCount - spacingY * (genome.outputsCount - 1)) / 2;
for (int o = genome.sensorsCount+1; o <= genome.sensorsCount + genome.outputsCount; o++) {
nodes.get(o).btn.set(posX, posY, size);
posY += spacingY + size;
}
//Hiddens
for (int h = genome.sensorsCount + genome.outputsCount+1; h < genome.nodes.size(); h++) {
nodes.get(h).btn.set(x + size + Math.random() * (sizeX - size * 2), y + Math.random() * sizeY, size);
posY += spacingY + size;
}
}
public void update() {
//update topology
if (genome.nodes.size() != nodes.size()) {
for (int i = nodes.size(); i < genome.nodes.size(); i++) {
DNode node = new DNode(genome.nodes.get(i).id);
for (int j = 0; j < genome.connections.size(); j++) {
if (genome.connections.get(j).out == node.btn.id) {
DNode nodeIn = nodes.get(genome.connections.get(j).in);
node.btn.set(nodeIn.btn.pos.x, nodeIn.btn.pos.y, size);
break;
}
}
nodes.add(node);
}
}
for (DNode node : nodes) {
node.btn.update();
if (node.btn.pressed) {
node.applyForce(mouseDrag(node, 0.5));
if (node.btn.id == 0){
node.btn.pos.set(camera.mouseX()-size/2, camera.mouseY()-size/2);
}
}
}
}
public void relax(float intensity) {
//Spring force
applySpringForce(size * 4, 0.1);
//distance force
applyColisionForce(size * 3, 0.1);
//apply forces
for (DNode node : nodes) {
node.updatePos();
}
}
public void display(float spacing) {
canvas.fill(0);
canvas.stroke(0);
canvas.strokeWeight((float) (0.5f / camera.getZoom()));
spacing = (float) (spacing / camera.getZoom());
float half_size = size / 2;
for (int i = 0; i < genome.connections.size(); i++) {
if (!genome.connections.get(i).getExpression()) {
continue;
}
DNode s1 = nodes.get(genome.connections.get(i).in);
DNode s2 = nodes.get(genome.connections.get(i).out);
Vector2D vec = Vector2D.sub(s2.btn.pos, s1.btn.pos);
Vector2D offset = vec.copy().setMag(spacing+size/2);
Vector2D pos1 = s1.btn.pos.copy().add(half_size, half_size);
Vector2D pos2 = s2.btn.pos.copy().add(half_size, half_size);
if (genome.connections.get(i).isRecurrent()){
canvas.stroke(0,150);
//if circular recurency
offset.rotate(0.3);
Vector2D offset2;
if (s1 == s2) {
offset.set(0,spacing+size/2).rotate(-1);
offset2 = offset.copy().rotate(0.8);
pos1.add(offset);
pos2.add(offset2);
}else{
offset2 = offset.copy().mult(-1);
pos1.add(offset);
pos2.add(offset2);
offset.mult(vec.mag());
offset2.mult(vec.mag());
}
vec.set(offset2);
offset.add(pos1);
offset2.add(pos2);
canvas.noFill();
canvas.bezier((float)pos1.x, (float)pos1.y, (float)(offset.x), (float) (offset.y), (float) (offset2.x), (float) (offset2.y), (float) pos2.x, (float) pos2.y);
canvas.fill(255);
F.drawArrow((float)(vec.angleOrigin()), pos2, spacing);
}else{
canvas.stroke(0);
pos1.add(offset);
F.drawArrow((float)(pos1.x), (float)(pos1.y), (float)vec.mag()-spacing*2-size, (float)(-vec.angleOrigin()+Math.PI/2), (float)spacing);
}
canvas.ellipse((float) pos1.x, (float) pos1.y, spacing / 2, spacing / 2);
}
canvas.textAlign(canvas.CENTER, canvas.CENTER);
for (DNode node : nodes) {
if (node.btn.pressed) {
canvas.fill(180);
} else if (node.btn.mouseOver()) {
canvas.fill(200);
} else {
canvas.fill(255);
}
node.btn.display();
//ID
String id = ""+node.btn.id;
if (node.btn.id == 0) id = "B";
canvas.fill(0);
canvas.pushMatrix();
canvas.resetMatrix();
canvas.textSize((float) (size / 2 * camera.getZoom()));
canvas.text(id, (float) camera.worldXToScreenX(node.btn.pos.x + size / 2), (float) camera.worldYToScreenY(node.btn.pos.y + size / 2));
canvas.popMatrix();
}
}
private void applySpringForce(double length, double k) {
for (int i = 0; i < genome.connections.size(); i++) {
if (!genome.connections.get(i).getExpression() || genome.connections.get(i).isRecurrent()) {
continue;
}
DNode s1 = nodes.get(genome.connections.get(i).in);
DNode s2 = nodes.get(genome.connections.get(i).out);
if (s1 == s2) {
continue;
}
Vector2D force = Vector2D.sub(s2.btn.pos, s1.btn.pos);
double mag = force.mag();
force.normalize();
force.mult(length - mag);
force.mult(k);
s2.applyForce(force);
s1.applyForce(force.mult(-1));
}
}
private void applyColisionForce(double distance, double strength) {
for (int a = 0; a < nodes.size(); a++) {
for (int b = 0; b < nodes.size(); b++) {
if (a != b) {
Vector2D force = Vector2D.sub(nodes.get(b).btn.pos, nodes.get(a).btn.pos);
double mag = force.mag();
force.normalize();
double value = distance - mag;
if (value < 0) {
continue;
}
force.mult(value * value);
force.mult(strength);
nodes.get(b).applyForce(force);
}
}
}
}
private Vector2D mouseDrag(DNode n, double strength) {
Vector2D mouse = new Vector2D(camera.mouseX() - size / 2, camera.mouseY() - size / 2);
Vector2D force = Vector2D.sub(mouse, n.btn.pos);
force.mult(strength);
return force;
}
class DNode {
public final SBtn btn;
private final Vector2D acc;
private final Vector2D vel;
public DNode(int id) {
btn = new SBtn(camera, id);
vel = new Vector2D();
acc = new Vector2D();
}
public void applyForce(Vector2D f) {
acc.add(f);
}
public void updatePos() {
if (btn.id <= genome.sensorsCount + genome.outputsCount) {
return;
}
vel.add(acc);
btn.pos.add(vel);
acc.set(0, 0);
vel.mult(0.7);
}
}
}
| [
"thalesfernandesdasilva@gmail.com"
] | thalesfernandesdasilva@gmail.com |
9b2a08ccdae61deecd632b932e17ce6ba626c0df | d7c65ec7269db62ccc01e1e48244d0ee28852759 | /app/src/main/java/com/maxin/liang/fragment/shopfragment/BrandFragment.java | 97bef98bc3a9180a616b84acfa2d4b0a654ab958 | [] | no_license | atguigumx/Liang | c81b610d0bbe56a8650ab9580db93a7375a4a9c0 | 5298f54ef285592f50cb22435ad87c4737e0543c | refs/heads/master | 2020-12-02T18:12:31.778258 | 2017-07-27T03:44:14 | 2017-07-27T03:44:14 | 96,375,965 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,741 | java | package com.maxin.liang.fragment.shopfragment;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;
import com.alibaba.fastjson.JSON;
import com.bumptech.glide.Glide;
import com.maxin.liang.R;
import com.maxin.liang.activity.BrandInfoActivity;
import com.maxin.liang.bean.shop.BrandBean;
import com.zhy.http.okhttp.OkHttpUtils;
import com.zhy.http.okhttp.callback.StringCallback;
import java.util.List;
import butterknife.Bind;
import butterknife.ButterKnife;
import okhttp3.Call;
/**
* Created by shkstart on 2017/7/6.
* 品牌
*/
public class BrandFragment extends Fragment {
public static final String BRANDID = "brand_id";
@Bind(R.id.listview_brand)
ListView listviewBrand;
private MyAdapter myAdapter;
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = View.inflate(getActivity(), R.layout.brand_fragment, null);
ButterKnife.bind(this, view);
initData();
return view;
}
private void initData() {
getDataFromNet();
}
private void getDataFromNet() {
String url = "http://mobile.iliangcang.com/brand/brandList?app_key=Android&count=20&page=1&sig=430BD99E6C913B8B8C3ED109737ECF15%7C830952120106768&v=1.0";
OkHttpUtils.get().url(url).build().execute(new StringCallback() {
@Override
public void onError(Call call, Exception e, int id) {
Log.e("BrandFragment", "onError" + e.getMessage());
}
@Override
public void onResponse(String response, int id) {
processData(response);
}
});
}
private void processData(String response) {
BrandBean brandBean = JSON.parseObject(response, BrandBean.class);
final List<BrandBean.DataBean.ItemsBean> items = brandBean.getData().getItems();
if (items.size() > 0 && items != null) {
myAdapter = new MyAdapter(getActivity(),items);
listviewBrand.setAdapter(myAdapter);
}
listviewBrand.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
BrandBean.DataBean.ItemsBean itemsBean = items.get(i);
Intent intent = new Intent(getActivity(), BrandInfoActivity.class);
intent.putExtra(BRANDID,itemsBean.getBrand_id());
Log.e("BrandFragment", ""+itemsBean.getBrand_id());
startActivity(intent);
}
});
}
@Override
public void onDestroyView() {
super.onDestroyView();
ButterKnife.unbind(this);
}
class MyAdapter extends BaseAdapter {
private final Context context;
private final List<BrandBean.DataBean.ItemsBean> items;
public MyAdapter(Context context, List<BrandBean.DataBean.ItemsBean> items) {
this.context=context;
this.items=items;
}
@Override
public int getCount() {
return items == null ? 0 : items.size();
}
@Override
public Object getItem(int i) {
return items.get(i);
}
@Override
public long getItemId(int i) {
return items.get(i).getBrand_id();
}
@Override
public View getView(int i, View view, ViewGroup viewGroup) {
ViewHolder viewHolder;
if (view == null) {
view = View.inflate(context, R.layout.brand_item, null);
viewHolder=new ViewHolder(view);
view.setTag(viewHolder);
}else {
viewHolder= (ViewHolder) view.getTag();
}
viewHolder.tvBrandItem.setText(items.get(i).getBrand_name());
Glide.with(context)
.load(items.get(i).getBrand_logo()).into(viewHolder.ivBrandItem);
return view;
}
class ViewHolder {
@Bind(R.id.iv_brand_item)
ImageView ivBrandItem;
@Bind(R.id.tv_brand_item)
TextView tvBrandItem;
ViewHolder(View view) {
ButterKnife.bind(this, view);
}
}
}
}
| [
"475719725@qq.com"
] | 475719725@qq.com |
9b878e2e0bdd4043c7e6df502b9ab364d11b2e78 | 50f93afe635f396029a9ba7c5ba9067bd282f70c | /D09 - Functional testing/Item5/Acme-Rendezvous/src/test/java/services/RequestServiceTest.java | 726e867a7aa5165d5d37f0b2ee770e9ded018aed | [] | no_license | MariaRuizGutierrez/D09 | 6ed9250ce8d00876d32adbf417ff0785848b3242 | 90cdde9c1c2fa661be8392da69edc3c671fdaad3 | refs/heads/master | 2021-04-26T23:19:21.601328 | 2018-03-23T18:05:29 | 2018-03-23T18:05:29 | 123,972,368 | 0 | 0 | null | null | null | null | WINDOWS-1250 | Java | false | false | 11,361 | java |
package services;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.Iterator;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.transaction.Transactional;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import utilities.AbstractTest;
import domain.CreditCard;
import domain.Rendezvouse;
import domain.Request;
import domain.ServiceOffered;
import domain.User;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {
"classpath:spring/junit.xml"
})
@Transactional
public class RequestServiceTest extends AbstractTest {
// Supporting services ----------------------------------------------------
@Autowired
RequestService requestService;
@Autowired
RendezvouseService rendezvouseService;
@Autowired
ServiceOfferedService serviceOfferedService;
@Autowired
UserService userService;
@PersistenceContext
EntityManager entityManager;
// Test CreateAndSave ----------------------------------------------------------------------------------
//final CreditCard creditCardExpirationYearNull;
//final CreditCard creditCardExpirationYearInvalid;
//final CreditCard creditCardCvvInvalid;
// Caso de uso 4.3: Request a service for one of the rendezvouses that he or she's created. He or she must specify a valid credit card in every request for a service. Optionally, he or she can provide some comments in the request.
@Test
public void driverCreateAndSave() {
final Collection<CreditCard> listCreditCards = this.createAllCreditCardsForTesting();
final Iterator<CreditCard> iterator = listCreditCards.iterator();
final CreditCard creditCardOk = iterator.next();
CreditCard creditCardExpirationYearNull;
creditCardExpirationYearNull = new CreditCard();
creditCardExpirationYearNull.setHolderName("Jose Joaquin");
creditCardExpirationYearNull.setBrandName("La caixa");
creditCardExpirationYearNull.setNumber("4388576018410707");
creditCardExpirationYearNull.setExpirationMonth("03");
creditCardExpirationYearNull.setExpirationYear(null);
creditCardExpirationYearNull.setCvv(102);
final Object testingData[][] = {
{
//Se crea una Request correctamente
"user1", creditCardOk, "serviceOffered5", "comentario test5", "2018/03/11 19:40", "rendezvouse1", null
}, {
//Un user crea una request para una rendezvouse que no es suya
"user1", creditCardOk, "serviceOffered5", "comentario test1", "2018/03/11 19:40", "rendezvouse5", IllegalArgumentException.class
}, {
//Un user crea una request con una creditCard no válida || HolderName null
"user1", iterator.next(), "serviceOffered5", "comentario test1", "2018/03/11 19:40", "rendezvouse1", javax.validation.ConstraintViolationException.class
}, {
//Un user crea una request con una creditCard no válida || BrandeName null
"user1", iterator.next(), "serviceOffered5", "comentario test1", "2018/03/11 19:40", "rendezvouse1", javax.validation.ConstraintViolationException.class
}, {
//Un user crea una request con una creditCard no válida || Number null
"user1", iterator.next(), "serviceOffered5", "comentario test1", "2018/03/11 19:40", "rendezvouse1", javax.validation.ConstraintViolationException.class
}, {
//Un user crea una request con una creditCard no válida || ExpirationMonth null
"user1", iterator.next(), "serviceOffered5", "comentario test1", "2018/03/11 19:40", "rendezvouse1", javax.validation.ConstraintViolationException.class
}, {
//Un user crea una request con una creditCard no válida || ExpirationMonth fuera del rango
"user1", iterator.next(), "serviceOffered5", "comentario test1", "2018/03/11 19:40", "rendezvouse1", javax.validation.ConstraintViolationException.class
}, {
//Un user crea una request con una creditCard no válida || Year null
//Salta por el assert => "Assert.isTrue(this.checkCreditCard(request.getCreditCard()), "Invalid credit card");"
"user1", iterator.next(), "serviceOffered5", "comentario test1", "2018/03/11 19:40", "rendezvouse1", IllegalArgumentException.class
}, {
//Un user crea una request con una creditCard no válida ||Year fuera del rango
"user1", iterator.next(), "serviceOffered5", "comentario test1", "2018/03/11 19:40", "rendezvouse1", javax.validation.ConstraintViolationException.class
}, {
//Un user crea una request con una creditCard no válida ||CVV fuera del rango
"user1", iterator.next(), "serviceOffered5", "comentario test1", "2018/03/11 19:40", "rendezvouse1", javax.validation.ConstraintViolationException.class
}, {
//Un user crea una request sin comment para demostrar que es opcional
"user1", creditCardOk, "serviceOffered5", null, "2018/03/11 19:40", "rendezvouse1", null
}, {
//Un user crea una request para una rendezvous que no le pertenece
"user1", creditCardOk, "serviceOffered5", "comentario test1", "2018/03/11 19:40", "rendezvouse5", IllegalArgumentException.class
}
};
for (int i = 0; i < testingData.length; i++)
this.templateCreateAndSave(super.getEntityId((String) testingData[i][0]), (CreditCard) testingData[i][1], super.getEntityId((String) testingData[i][2]), (String) testingData[i][3], (String) testingData[i][4],
super.getEntityId((String) testingData[i][5]), (Class<?>) testingData[i][6]);
}
private void templateCreateAndSave(final int usernameId, final CreditCard creditcard, final int serviceOfferedId, final String comment, final String requestMoment, final int rendezvouseId, final Class<?> expected) {
final Rendezvouse rendezvouseForRequest;
Request request;
Date requestMomentDate;
ServiceOffered serviceOffered;
User user;
Class<?> caught;
caught = null;
try {
serviceOffered = this.serviceOfferedService.findOne(serviceOfferedId);
user = this.userService.findOne(usernameId);
super.authenticate(user.getName());
rendezvouseForRequest = this.rendezvouseService.findOne(rendezvouseId);
request = this.requestService.create(rendezvouseForRequest.getId());
request.setCreditCard(creditcard);
request.setComment(comment);
request.setUser(user);
request.setServiceOffered(serviceOffered);
request.setRendezvousid(rendezvouseId);
if (requestMoment != null)
requestMomentDate = (new SimpleDateFormat("yyyy/MM/dd HH:mm")).parse(requestMoment);
else
requestMomentDate = null;
request.setRequestMoment(requestMomentDate);
request = this.requestService.save(request);
this.requestService.flush();
} catch (final Throwable oops) {
caught = oops.getClass();
//Se borra la cache para que no salte siempre el error del primer objeto que ha fallado en el test
this.entityManager.clear();
}
this.checkExceptions(expected, caught);
this.unauthenticate();
}
// //Other Methods additionals---------------------------------------------------------------------------------------
private Collection<CreditCard> createAllCreditCardsForTesting() {
final Collection<CreditCard> result;
final CreditCard creditCardOK;
final CreditCard creditcardHolderNameNull;
final CreditCard creditCardBrandNameNull;
final CreditCard creditCardNumberNull;
final CreditCard creditCardExpirationMonthNull;
final CreditCard creditCardExpirationMonthInvalid;
final CreditCard creditCardExpirationYearNull;
final CreditCard creditCardExpirationYearInvalid;
final CreditCard creditCardCvvInvalid;
result = new ArrayList<CreditCard>();
creditCardOK = new CreditCard();
creditCardOK.setHolderName("Jose Joaquin");
creditCardOK.setBrandName("La caixa");
creditCardOK.setNumber("4388576018410707");
creditCardOK.setExpirationMonth("03");
creditCardOK.setExpirationYear("20");
creditCardOK.setCvv(102);
result.add(creditCardOK);
creditcardHolderNameNull = new CreditCard();
creditcardHolderNameNull.setHolderName(null);
creditcardHolderNameNull.setBrandName("La caixa");
creditcardHolderNameNull.setNumber("4388576018410707");
creditcardHolderNameNull.setExpirationMonth("03");
creditcardHolderNameNull.setExpirationYear("20");
creditcardHolderNameNull.setCvv(102);
result.add(creditcardHolderNameNull);
creditCardBrandNameNull = new CreditCard();
creditCardBrandNameNull.setHolderName("Jose Joaquin");
creditCardBrandNameNull.setBrandName(null);
creditCardBrandNameNull.setNumber("4388576018410707");
creditCardBrandNameNull.setExpirationMonth("03");
creditCardBrandNameNull.setExpirationYear("20");
creditCardBrandNameNull.setCvv(102);
result.add(creditCardBrandNameNull);
creditCardNumberNull = new CreditCard();
creditCardNumberNull.setHolderName("Jose Joaquin");
creditCardNumberNull.setBrandName("La caixa");
creditCardNumberNull.setNumber(null);
creditCardNumberNull.setExpirationMonth("03");
creditCardNumberNull.setExpirationYear("20");
creditCardNumberNull.setCvv(102);
result.add(creditCardNumberNull);
creditCardExpirationMonthNull = new CreditCard();
creditCardExpirationMonthNull.setHolderName("Jose Joaquin");
creditCardExpirationMonthNull.setBrandName("La caixa");
creditCardExpirationMonthNull.setNumber("4388576018410707");
creditCardExpirationMonthNull.setExpirationMonth(null);
creditCardExpirationMonthNull.setExpirationYear("20");
creditCardExpirationMonthNull.setCvv(102);
result.add(creditCardExpirationMonthNull);
creditCardExpirationMonthInvalid = new CreditCard();
creditCardExpirationMonthInvalid.setHolderName("Jose Joaquin");
creditCardExpirationMonthInvalid.setBrandName("La caixa");
creditCardExpirationMonthInvalid.setNumber("4388576018410707");
creditCardExpirationMonthInvalid.setExpirationMonth("13");
creditCardExpirationMonthInvalid.setExpirationYear("20");
creditCardExpirationMonthInvalid.setCvv(102);
result.add(creditCardExpirationMonthInvalid);
creditCardExpirationYearNull = new CreditCard();
creditCardExpirationYearNull.setHolderName("Jose Joaquin");
creditCardExpirationYearNull.setBrandName("La caixa");
creditCardExpirationYearNull.setNumber("4388576018410707");
creditCardExpirationYearNull.setExpirationMonth("03");
creditCardExpirationYearNull.setExpirationYear(null);
creditCardExpirationYearNull.setCvv(102);
result.add(creditCardExpirationYearNull);
creditCardExpirationYearInvalid = new CreditCard();
creditCardExpirationYearInvalid.setHolderName("Jose Joaquin");
creditCardExpirationYearInvalid.setBrandName("La caixa");
creditCardExpirationYearInvalid.setNumber("4388576018410707");
creditCardExpirationYearInvalid.setExpirationMonth("03");
creditCardExpirationYearInvalid.setExpirationYear("200");
creditCardExpirationYearInvalid.setCvv(102);
result.add(creditCardExpirationYearInvalid);
creditCardCvvInvalid = new CreditCard();
creditCardCvvInvalid.setHolderName("Jose Joaquin");
creditCardCvvInvalid.setBrandName("La caixa");
creditCardCvvInvalid.setNumber("4388576018410707");
creditCardCvvInvalid.setExpirationMonth("03");
creditCardCvvInvalid.setExpirationYear("20");
creditCardCvvInvalid.setCvv(6666);
result.add(creditCardCvvInvalid);
return result;
}
}
| [
"dany15-paradas@hotmail.com"
] | dany15-paradas@hotmail.com |
2c9cc62ab9ebfc38da57d506c9c7020d86abbdb4 | 0bfec2fc1283065dc2f88b9942c47077122f022c | /old-cc-blog/src/main/java/cn/chairc/blog/model/Entertainment.java | 8f0e5d81d0cc9eddaaf35082cc2c2ce63625831f | [
"Apache-2.0"
] | permissive | chairc/cc-blog-springboot | 649950f2727306485e7682759bff9125783a27dc | a6306982994c96530f13928d98e437f7047b3d64 | refs/heads/master | 2023-07-07T09:23:52.986221 | 2023-06-29T06:32:34 | 2023-06-29T06:32:34 | 245,840,111 | 5 | 0 | Apache-2.0 | 2022-11-16T02:18:19 | 2020-03-08T15:34:38 | Java | UTF-8 | Java | false | false | 1,871 | java | package cn.chairc.blog.model;
public class Entertainment {
//Entertainment
private int entertainment_id;
private String entertainment_private_id;
private String entertainment_name;
private String entertainment_update_time;
private String entertainment_image_url;
//wps自动邀请(待更新)
private int wps_id; //wps的id
private String wps_sid; //wps邀请人的sid
public int getEntertainment_id() {
return entertainment_id;
}
public void setEntertainment_id(int entertainment_id) {
this.entertainment_id = entertainment_id;
}
public String getEntertainment_private_id() {
return entertainment_private_id;
}
public void setEntertainment_private_id(String entertainment_private_id) {
this.entertainment_private_id = entertainment_private_id;
}
public String getEntertainment_name() {
return entertainment_name;
}
public void setEntertainment_name(String entertainment_name) {
this.entertainment_name = entertainment_name;
}
public String getEntertainment_update_time() {
return entertainment_update_time;
}
public void setEntertainment_update_time(String entertainment_update_time) {
this.entertainment_update_time = entertainment_update_time;
}
public String getEntertainment_image_url() {
return entertainment_image_url;
}
public void setEntertainment_image_url(String entertainment_image_url) {
this.entertainment_image_url = entertainment_image_url;
}
public int getWps_id() {
return wps_id;
}
public void setWps_id(int wps_id) {
this.wps_id = wps_id;
}
public String getWps_sid() {
return wps_sid;
}
public void setWps_sid(String wps_sid) {
this.wps_sid = wps_sid;
}
}
| [
"974833488@qq.com"
] | 974833488@qq.com |
6678ff087ec1541391e9d2c59b794aceb325fc2a | ac5262099449e387f30b552ab8d5d09161f3ddda | /springcoreprac/src/main/java/com/prac/spring/springcoreprac/App.java | 0085ec7ef597ca07c9542968a35fc333c1fc45e1 | [] | no_license | harshithamagani/java_practise1 | 4934bff72155b3fef071fcb7e021b109f550faf3 | 894892a6b2db7c6ca3daadfaf1af521a02893719 | refs/heads/main | 2023-07-15T14:56:59.742632 | 2021-09-02T22:03:43 | 2021-09-02T22:03:43 | 395,464,517 | 0 | 0 | null | 2021-09-02T22:03:44 | 2021-08-12T23:06:59 | Java | UTF-8 | Java | false | false | 193 | java | package com.prac.spring.springcoreprac;
/**
* Hello world!
*
*/
public class App
{
public static void main( String[] args )
{
System.out.println( "Hello World!" );
}
}
| [
"harshithamagani@gmail.com"
] | harshithamagani@gmail.com |
864abe154c217729bcae9c354a132bfaf776e43b | 5cc1f29f6dae3bdb5811cde2b368695ef26310e3 | /RxJava-Learn/src/main/java/chapter2/FirstExample.java | cfbc8f1d35e2827dac23aad9a0e1ada7e988ed04 | [] | no_license | juyonglee79/RxJava | ccb7240cc996291867a34f1e4ffb0675cc41dafa | 9aefdc0be499530b3b2b0adf257c5d27f2e7eb73 | refs/heads/master | 2022-11-20T20:22:43.378329 | 2020-07-21T08:14:42 | 2020-07-21T08:14:42 | 257,243,745 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 285 | java | package chapter2;
import io.reactivex.Observable;
public class FirstExample {
public void emit() {
Observable.just(1, 2, 3, 4, 5, 6)
.subscribe(System.out::println);
}
public static void main(String[] args) {
FirstExample demo = new FirstExample();
demo.emit();
}
}
| [
"37585586+juyonglee79@users.noreply.github.com"
] | 37585586+juyonglee79@users.noreply.github.com |
3b0d186eb88d3b9527f5166154b37659f5b777a0 | d40ea45c10babfef3f4017e1d4f72787bedc1294 | /Engine/src/br/com/engine/component/IComponent.java | 36d5722280d3eaefcca260b1b6a11d9fb757dd96 | [] | no_license | grmaciel/component-based-2d-game-architecture | bcde5286335b46a46f1f4527e08736cb3dc7ee0f | dc70433892c58c3b0970161103b07953bea60cb1 | refs/heads/master | 2021-01-21T12:35:52.965131 | 2015-08-12T02:20:50 | 2015-08-12T02:20:50 | 40,575,185 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 410 | java | package br.com.engine.component;
import br.com.engine.system.message.MessageWrapper;
import br.com.engine.system.render.RenderWrapper;
import android.view.MotionEvent;
public interface IComponent {
public void onUpdate();
public void onTouchListener(MotionEvent event);
public void onRender(RenderWrapper render);
public void receiveMessage(MessageWrapper wrapper);
public boolean isActive();
}
| [
"gmaciel@gmail.com"
] | gmaciel@gmail.com |
c455c0e39fccd760c7a25faa133aea9bedff4491 | 89cb1d8e23dd8571688ef212364e181c534b1e03 | /src/main/java/abstractFactoryFurniture/LeaderFurniture/LeaderFotel.java | f88d32da598d4b5fa921ac6694700c1bb1f3081f | [] | no_license | Mcgregor400/wzorce_projektowe | cefb64e8b38a2441a07dbcc27a02e25441b2016b | 9e0f9bafbce6e485a257470e13b89de0cde40b54 | refs/heads/master | 2022-12-25T22:10:23.107233 | 2020-09-20T06:50:07 | 2020-09-20T06:50:07 | 291,416,507 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 270 | java | package abstractFactoryFurniture.LeaderFurniture;
import abstractFactoryFurniture.Interfaces.Fotel;
public class LeaderFotel implements Fotel {
@Override
public void utworzFotel() {
System.out.println("Należy uszyć ładny fotel ze skóry");
}
}
| [
"ghys@wp.pl"
] | ghys@wp.pl |
a9446be94cbf68c34b6e7e2812d542697487059d | 3b6cd806c78e244efd9bee1a6c56538071018492 | /MDVS/src/action/material/service/serviceAction.java | af04c9cdf3ac4c4d3d6bf16910422d068814ca3e | [] | no_license | DreamBoatOve/MDVS | f671e2957acc136ef5a6c9f93108e58920a2f470 | 8dfd4ccc47d4c79950af44972db18f8c42d5f932 | refs/heads/master | 2021-09-15T19:53:08.519003 | 2018-06-09T12:51:01 | 2018-06-09T12:51:01 | 106,379,653 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 67 | java | package action.material.service;
public class serviceAction
{
} | [
"2199474541@qq.com"
] | 2199474541@qq.com |
e55ea5b4efd71a38179c571dbee3cb5bd357e5a5 | 3ed9ede19271d4242214afefd5b464830bd3e412 | /src/main/java/com/angrytest/ptp/service/impl/BundleServiceImpl.java | 9b575ef465244146f0a156aa70a729c13a22f723 | [] | no_license | ligho/ptp-backend | e68afcdd9b5b3c708f2396a6f06fd26f57d9ea5c | 684d317f3805962ed14fcdbcac69bc45fa9498af | refs/heads/master | 2020-05-17T00:59:01.545336 | 2018-08-17T01:42:07 | 2018-08-17T01:42:07 | 183,413,410 | 1 | 0 | null | 2019-04-25T10:38:15 | 2019-04-25T10:38:14 | null | UTF-8 | Java | false | false | 1,137 | java | package com.angrytest.ptp.service.impl;
import com.angrytest.ptp.dao.BundleDao;
import com.angrytest.ptp.model.Bundle;
import com.angrytest.ptp.service.IBundleService;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class BundleServiceImpl implements IBundleService {
@Autowired
BundleDao bundleDao;
@Override
public int saveBundle(Bundle bundle) {
return bundleDao.saveBundle(bundle);
}
@Override
public List<Bundle> queryBundle(Bundle bundle) {
return bundleDao.queryBundle(bundle);
}
@Override
public PageInfo<Bundle> queryBundleByPage(Bundle bundle, Integer pageNo, Integer pageSize) {
return bundleDao.queryBundleByPage(bundle, pageNo, pageSize);
}
@Override
public Integer getSum(String column, int coverageId) {
return bundleDao.getSum(column, coverageId);
}
@Override
public Integer getMax(String column, int coverageId) {
return bundleDao.getMax(column, coverageId);
}
}
| [
"thx_phila@yahoo.com"
] | thx_phila@yahoo.com |
4078d3fb2324206e1d262fb73f030bd7ef329ebd | 16b86461cea5644827ad5ccf1d868b358a717dc9 | /src/main/java/sh/main/PizzaMain.java | 213e08867be81cc61d351746ea75a397660fd077 | [] | no_license | sunmishra/OnlinePizzaMiniProject | 4f6659ee821e8c59a1549311d360a0c9afb6959d | 5c9c338ee03f476a826e41fd9ff930118789545d | refs/heads/master | 2023-01-13T20:07:51.032979 | 2020-11-21T15:50:29 | 2020-11-21T15:50:29 | 314,846,396 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,194 | java | package sh.main;
import java.util.List;
import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import sh.entities.Items;
import sh.services.MenuService;
public class PizzaMain {
public static void main(String[] args) {
AbstractApplicationContext ctx = new ClassPathXmlApplicationContext("bean.xml");
// LoginService service = ctx.getBean(LoginService.class);
// Customers c = service.fetchCustomer("sun@gmail.com");
// System.out.println(c);
// Customers c1 = new Customers(12, "Star", "star", "777777", "xyz", "star@gmail.com");
// service.addCustomer(c1);
MenuService service = ctx.getBean(MenuService.class);
// List<Items> list = service.fetchByTypeAndCat();
List<Items> list = service.fetchByNonVegItems();
// List<Items> list = service.fetchByCat();
System.out.println(list);
System.out.println(service.fetchById(32));
// System.out.println(service.fetchByItemPrice(20));
// OrderService service = ctx.getBean(OrderService.class);
// System.out.println(service.fetchOrderById(1005));
// System.out.println(service.fetchOrderByTime());
ctx.close();
}
}
| [
"shubhamm464@gmail.com"
] | shubhamm464@gmail.com |
30e5f339a1f704137dd52e83bac117a9b4f121a3 | e706df65dc8ccf6aaf7b453fff8f542048d73b37 | /JavaTableBooking/src/com/dhtmlx/booking/controller/Table.java | 90edc50c5f48e65eb69fc37340ca9c32701e0e48 | [] | no_license | MarcelloSSsa/Website | 5945daf47b6c77fde885b164b4c246651923b976 | 7757210f5bcf464090c02cbef35d25dd9fc45d14 | refs/heads/master | 2020-03-22T23:01:02.255944 | 2018-10-18T01:55:55 | 2018-10-18T01:55:55 | 140,784,695 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,622 | java | package com.dhtmlx.booking.controller;
import java.util.ArrayList;
import com.dhtmlx.planner.data.DHXCollection;
public class Table extends DHXCollection {
public String name;
public String key;
public Integer persons = 5;
public Boolean smoking = false;
public Boolean open = true;
public ArrayList<DHXCollection> children = null;
public Table(String value, String label, Integer persons, Boolean smoking) {
super(value, label);
setKey(value);
setName(label);
setPersons(persons);
setSmoking(smoking);
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
render();
}
public void setPersons(Integer persons) {
this.persons = persons;
render();
}
public Integer getPersons() {
return this.persons;
}
public void setSmoking(Boolean smoking) {
this.smoking = smoking;
render();
}
public Boolean getSmoking() {
return this.smoking;
}
protected void render() {
setLabel(this.name + " (" + this.persons.toString() + " people, " + (smoking ? "smoking" : "no smoking") + ")");
}
public Iterable<DHXCollection> getChildren() {
return children;
}
public void setChildren(ArrayList<DHXCollection> children) {
this.children = children;
}
public void addChild(DHXCollection child) {
if (children == null)
children = new ArrayList<DHXCollection>();
children.add(child);
}
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public Boolean getOpen() {
return open;
}
public void setOpen(Boolean open) {
this.open = open;
}
}
| [
"marcello_cte@hotmail.com"
] | marcello_cte@hotmail.com |
8ed173800df6aa14442b1c113fa846b18814b02f | ed3cb95dcc590e98d09117ea0b4768df18e8f99e | /project_1_3/src/b/b/i/c/Calc_1_3_11820.java | bb7132f5a437236de6aeba03df77743b8dbe2c11 | [] | no_license | chalstrick/bigRepo1 | ac7fd5785d475b3c38f1328e370ba9a85a751cff | dad1852eef66fcec200df10083959c674fdcc55d | refs/heads/master | 2016-08-11T17:59:16.079541 | 2015-12-18T14:26:49 | 2015-12-18T14:26:49 | 48,244,030 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 134 | java | package b.b.i.c;
public class Calc_1_3_11820 {
/** @return the sum of a and b */
public int add(int a, int b) {
return a+b;
}
}
| [
"christian.halstrick@sap.com"
] | christian.halstrick@sap.com |
dd5882fe0f7e998d9c209cc01d419598530fa580 | 138b547ab89ae40022a9215c842a248b70ed7321 | /src/main/java/com/example/config/CassandraConfig.java | 9eb9f53fa750bc9e84a046ade4aef8bac3c6e375 | [] | no_license | Jyoothisree/spring-data-cassandra | 547a03c778d0d8bb1298f52b132c7a3d8d8654c6 | 83da9d62c626e84afb65450ee108ae214d829c6b | refs/heads/master | 2021-01-20T02:54:59.461707 | 2017-04-24T14:17:03 | 2017-04-24T14:17:03 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,435 | java | package com.example.config;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.core.env.Environment;
import org.springframework.data.cassandra.config.CassandraClusterFactoryBean;
import org.springframework.data.cassandra.config.CassandraSessionFactoryBean;
import org.springframework.data.cassandra.config.SchemaAction;
import org.springframework.data.cassandra.convert.CassandraConverter;
import org.springframework.data.cassandra.convert.MappingCassandraConverter;
import org.springframework.data.cassandra.core.CassandraOperations;
import org.springframework.data.cassandra.core.CassandraTemplate;
import org.springframework.data.cassandra.mapping.BasicCassandraMappingContext;
import org.springframework.data.cassandra.mapping.CassandraMappingContext;
// FOR REFERENCE
///@Configuration
//@PropertySource(value = {"classpath:META-INF/cassandra.properties"})
//@EnableCassandraRepositories(basePackages = {"com.example.repository"})
public class CassandraConfig {
@Autowired
private Environment environment;
private static final Logger LOGGER = LoggerFactory.getLogger(CassandraConfig.class);
@Bean
public CassandraClusterFactoryBean cluster() {
CassandraClusterFactoryBean cluster = new CassandraClusterFactoryBean();
cluster.setContactPoints(environment.getProperty("cassandra.contactpoints"));
cluster.setPort(Integer.parseInt(environment.getProperty("cassandra.port")));
return cluster;
}
@Bean
public CassandraMappingContext mappingContext() {
return new BasicCassandraMappingContext();
}
@Bean
public CassandraConverter converter() {
return new MappingCassandraConverter(mappingContext());
}
@Bean
public CassandraSessionFactoryBean session() throws Exception {
CassandraSessionFactoryBean session = new CassandraSessionFactoryBean();
session.setCluster(cluster().getObject());
session.setKeyspaceName(environment.getProperty("cassandra.keyspace"));
session.setConverter(converter());
session.setSchemaAction(SchemaAction.NONE);
return session;
}
@Bean
public CassandraOperations cassandraTemplate() throws Exception {
return new CassandraTemplate(session().getObject());
}
} | [
"pushkar.murkute@ekapital.co.uk"
] | pushkar.murkute@ekapital.co.uk |
6c2fd91fad9055f68303fd0877c6c4760ddbdd37 | b68a7a188a3c209aede324dd079f77b4d6a357f2 | /org.xworker.plugin/src/org/xworker/plugin/actions/ThingFlowAction.java | e6ee332e777f3c720d3edba1a3d0a2815e7f25e9 | [] | no_license | x-meta/xworker_eclipse_plugin | dcbc2673cd1c69a153e828da4474e67a3f35a015 | 884e51002490a366ef05003ee3f9435ee7fe3b8b | refs/heads/master | 2020-08-27T16:57:32.510836 | 2019-10-25T03:34:16 | 2019-10-25T03:34:16 | 217,439,021 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,716 | java | package org.xworker.plugin.actions;
import java.util.HashMap;
import java.util.Map;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.IWorkbenchWindowActionDelegate;
import org.xmeta.Thing;
import org.xmeta.World;
import org.xworker.plugin.Activator;
public class ThingFlowAction implements IWorkbenchWindowActionDelegate {
Shell shell = null;
@Override
public void dispose() {
}
@Override
public void init(IWorkbenchWindow window) {
shell = window.getShell();
//ExplorerContext必须有shell变量,以便打开事物等时使用
//
if(Activator.explorerActionContext.get("shell") == null){
Activator.explorerActionContext.getScope(0).put("shell", shell);
}
}
@Override
public void run(IAction action) {
if(Activator.explorerActionContext.get("shell") == null){
return;
}
World world = World.getInstance();
Thing scriptThing = world.getThing("xworker.ide.worldExplorer.eclipse.Scripts");
Map<String, Object> context = new HashMap<String, Object>();
Thing thingFlowComposite = world.getThing("xworker.ide.worldExplorer.swt.flows.ThingFlowManager/@shell/@mainComposite");
context.put("compositeThing", thingFlowComposite);
context.put("title", thingFlowComposite.getMetadata().getLabel());
context.put("path", thingFlowComposite.getMetadata().getPath());
scriptThing.doAction("openThingComposite", Activator.explorerActionContext, context);
}
@Override
public void selectionChanged(IAction action, ISelection selection) {
}
}
| [
"zhangyuxiang@tom.com"
] | zhangyuxiang@tom.com |
f8105111f5064fd186844e4c5d8aa05baae1d801 | 39ac450698e68c44862fc8fdac9efc0ee9c6994d | /Week_04/id_51/LeetCode_714_51.java | 7206ee8272ab7b2d21c253de36fe1068a91d4c88 | [] | no_license | algorithm003/algorithm | 70d0f6a292c480e017e90ab5996772becbc7113c | 06b1a12411c22c3f24fd58b24f17a923dca380d5 | refs/heads/master | 2022-02-02T11:59:01.917835 | 2019-06-26T14:33:22 | 2019-08-05T15:55:03 | 189,704,070 | 18 | 65 | null | 2019-08-05T04:35:13 | 2019-06-01T07:31:23 | C++ | UTF-8 | Java | false | false | 600 | java | class Solution {
public int maxProfit(int[] prices, int fee) {
if (prices == null || prices.length == 0) {
return 0;
}
int nDays = prices.length;
int[] flat = new int[nDays];
int[] hold = new int[nDays];
flat[0] = 0;
hold[0] = -prices[0] - fee;
for (int i = 1; i< nDays; i++) {
flat[i] = Math.max(flat[i - 1], hold[i - 1] + prices[i]);
hold[i] = Math.max(hold[i - 1], flat[i - 1] - prices[i] - fee);
}
return Math.max(flat[nDays - 1], hold[nDays - 1]);
}
}
| [
"che.kai@rea-group.com"
] | che.kai@rea-group.com |
192236a70164445c44946bd681d5218c99f2057b | 308297e6347afc16baa6aec4bb2b7294d8a5b4b7 | /java/com/dbzwcg/model/match/phase/combat/CombatPhase.java | 689113227bd3434117637a38809407ec89654066 | [] | no_license | csiqueirasilva/dbzccg | 2ad545c463e7d2437d209e68ae1bf44d6a562458 | d28bd968a3133ba5afb182bc434f0c866594aa6b | refs/heads/master | 2020-12-24T16:07:53.452040 | 2014-10-13T10:15:58 | 2014-10-13T10:15:58 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,877 | java | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.dbzwcg.model.match.phase.combat;
import com.dbzwcg.model.match.phase.Phase;
import com.dbzwcg.model.match.phase.combat.internal.InternalCombatPhase;
import com.dbzwcg.model.match.players.MatchPlayer;
import com.dbzwcg.types.PhaseType;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;
/**
*
* @author csiqueira
*/
@PrimaryKeyJoinColumn
@Entity
@Table
public class CombatPhase extends Phase {
@OneToMany(cascade = CascadeType.ALL, orphanRemoval = true)
private List<InternalCombatPhase> phases;
@JoinColumn
@OneToOne( optional = false, cascade = CascadeType.ALL)
private MatchPlayer declaringPlayer;
@JoinColumn
@OneToOne( optional = false, cascade = CascadeType.ALL)
private MatchPlayer declaredPlayer;
public CombatPhase() {
super.type = PhaseType.COMBAT;
}
public List<InternalCombatPhase> getPhases() {
return phases;
}
public void setPhases(List<InternalCombatPhase> phases) {
this.phases = phases;
}
public MatchPlayer getDeclaringPlayer() {
return declaringPlayer;
}
public void setDeclaringPlayer(MatchPlayer declaringPlayer) {
this.declaringPlayer = declaringPlayer;
}
public MatchPlayer getDeclaredPlayer() {
return declaredPlayer;
}
public void setDeclaredPlayer(MatchPlayer declaredPlayer) {
this.declaredPlayer = declaredPlayer;
}
@Override
public String getName() {
return "COMBAT PHASE";
}
}
| [
"csiqueirasilva@gmail.com"
] | csiqueirasilva@gmail.com |
ba86d41d41b1308ca8bf32739307ea9da453a6c7 | fc48d88dac0740b2d30e3125c97b42103103872f | /src/main/java/grondag/canvas/buffer/packing/BufferPacker.java | 9cd3c71ae681bc4d2b83250216c8b4c70428205d | [
"Apache-2.0"
] | permissive | Dobby233Liu/canvas | b543c652e6cc4cd07416033057bb5af46f5c12d4 | 11f3bd588ba8445505dd59b7e244b31cf6c102ee | refs/heads/master | 2021-05-22T14:14:47.056742 | 2020-04-04T10:06:48 | 2020-04-04T10:06:48 | 252,958,870 | 0 | 0 | Apache-2.0 | 2020-04-22T08:40:07 | 2020-04-04T09:41:13 | Java | UTF-8 | Java | false | false | 2,760 | java | /*******************************************************************************
* Copyright 2019 grondag
*
* 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 grondag.canvas.buffer.packing;
import java.nio.IntBuffer;
import it.unimi.dsi.fastutil.objects.ObjectArrayList;
import grondag.canvas.buffer.allocation.AllocationProvider;
import grondag.canvas.draw.DelegateLists;
import grondag.canvas.draw.DrawableDelegate;
import grondag.canvas.material.MaterialState;
import grondag.canvas.material.MaterialVertexFormat;
public class BufferPacker {
private static final ThreadLocal<BufferPacker> THREADLOCAL = ThreadLocal.withInitial(BufferPacker::new);
ObjectArrayList<DrawableDelegate> delegates;
VertexCollectorList collectorList;
AllocationProvider allocator;
private BufferPacker() {
//private
}
/** Does not retain packing list reference */
public static ObjectArrayList<DrawableDelegate> pack(BufferPackingList packingList, VertexCollectorList collectorList, AllocationProvider allocator) {
final BufferPacker packer = THREADLOCAL.get();
final ObjectArrayList<DrawableDelegate> result = DelegateLists.getReadyDelegateList();
packer.delegates = result;
packer.collectorList = collectorList;
packer.allocator = allocator;
packingList.forEach(packer);
packer.delegates = null;
packer.collectorList = null;
packer.allocator = null;
return result;
}
public void accept(MaterialState materialState, int vertexStart, int vertexCount) {
final VertexCollector collector = collectorList.get(materialState);
final MaterialVertexFormat format = collector.format();
final int stride = format.vertexStrideBytes;
allocator.claimAllocation(vertexCount * stride, ref -> {
final int byteOffset = ref.byteOffset();
final int byteCount = ref.byteCount();
final int intLength = byteCount / 4;
ref.buffer().lockForWrite();
final IntBuffer intBuffer = ref.intBuffer();
intBuffer.position(byteOffset / 4);
intBuffer.put(collector.rawData(), vertexStart * stride / 4, intLength);
ref.buffer().unlockForWrite();
delegates.add(DrawableDelegate.claim(ref, materialState, byteCount / stride, format));
});
}
}
| [
"grondag@gmail.com"
] | grondag@gmail.com |
0f34cbd247c0ed183a38cdab90540dd284febb28 | 1e0ed23d3fc2275b4fa60be315bf8efb4b4f5722 | /src/LFSR.java | 11f85c3867e979b1b87c7159d6dc9e46054c99de | [] | no_license | kevin12686/LFSR_Encryption | 456c3f8197909cc7b01bce46997a9f190ef79f8b | 3f45fc6f312ec173c1207398a24bf1da4dccf2b1 | refs/heads/master | 2020-06-18T17:56:18.706204 | 2016-11-28T09:06:25 | 2016-11-28T09:06:25 | 74,751,010 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,355 | java | import java.util.Scanner;
public class LFSR {
private String FB_mask;
private String Init;
public LFSR(String Init, String FB_mask){
this.Init = new String(Init);
this.FB_mask = new String(FB_mask);
}
public String getKey(){
String temp = "";
for(int i = 0; i < this.FB_mask.length(); i++){
if(this.FB_mask.charAt(i) == '1' || i == this.FB_mask.length() - 1) temp += temp.equals("") ? this.Init.charAt(i) : "," + this.Init.charAt(i);
}
String[] xor = temp.split(",");
temp = xor[0];
for(int i = 1; i < xor.length; i++){
temp = LFSR.XOR_cal(temp, xor[i]);
}
this.Init = temp + this.Init;
return remove_return_last();
}
private String remove_return_last(){
String temp = this.Init.substring(this.Init.length() - 1);
this.Init = this.Init.substring(0, this.Init.length() - 1);
return temp;
}
public static String XOR_cal(String a, String b){
return a.equals(b) ? "0" : "1";
}
public static void main(String Arge[]){
String s = "";
Scanner keyboard = new Scanner(System.in);
LFSR lfsr = new LFSR("0001", "0011");
for(int i = 0; i < 20; i++){
s += lfsr.getKey();
}
System.out.println("Program : " + s);
System.out.print("Please key in your answer : ");
if(s.equals(keyboard.nextLine())) System.out.println("Correct.");
else System.out.println("Wrong.");
keyboard.close();
}
}
| [
"kevin860612@gmail.com"
] | kevin860612@gmail.com |
e8364c405ad15f6fbb4765e54f02083fc5f3c400 | 69c8c382057e5a4f3996809e4807b5164efb78b7 | /src/test/java/in/zapr/druid/druidry/extensions/datasketches/postAggregator/TupleSketchToStringPostAggregatorTest.java | b75f355e90d473821ab96feb198180f86b6575b0 | [
"Apache-2.0"
] | permissive | zapr-oss/druidry | 2cfb9ab82c2450116b0f065ad790f9149f3b33de | 9879ce8da55a90e952fbf1906dee7b1e8fd87fc0 | refs/heads/develop | 2023-09-05T20:04:44.056415 | 2020-04-25T13:42:30 | 2020-04-25T13:42:30 | 90,364,793 | 203 | 93 | Apache-2.0 | 2023-08-06T20:28:34 | 2017-05-05T10:25:55 | Java | UTF-8 | Java | false | false | 3,391 | java | /*
* Copyright 2018-present Red Brick Lane Marketing Solutions Pvt. 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 in.zapr.druid.druidry.extensions.datasketches.postAggregator;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.json.JSONException;
import org.json.JSONObject;
import org.skyscreamer.jsonassert.JSONAssert;
import org.skyscreamer.jsonassert.JSONCompareMode;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import in.zapr.druid.druidry.postAggregator.FieldAccessPostAggregator;
public class TupleSketchToStringPostAggregatorTest {
private static ObjectMapper objectMapper;
private FieldAccessPostAggregator milkyWay;
@BeforeClass
public void init() {
objectMapper = new ObjectMapper();
milkyWay = new FieldAccessPostAggregator("MilkyWay");
}
private JSONObject getTupleSketchToStringPostAggregatorJSON() throws JSONException {
JSONObject jsonObject = new JSONObject();
jsonObject.put("type", "arrayOfDoublesSketchToString");
jsonObject.put("name", "milky_way_info");
return jsonObject;
}
private JSONObject getFieldAccessPostAggregatorJSON(String fieldName) throws JSONException {
JSONObject fieldAccess = new JSONObject();
fieldAccess.put("type", "fieldAccess");
fieldAccess.put("fieldName", fieldName);
return fieldAccess;
}
@Test
public void testAllFields() throws JsonProcessingException, JSONException {
TupleSketchToStringPostAggregator tupleSketchToStringPostAggregator =
TupleSketchToStringPostAggregator.builder()
.name("milky_way_info")
.field(milkyWay)
.build();
JSONObject jsonObject = getTupleSketchToStringPostAggregatorJSON();
jsonObject.put("field", getFieldAccessPostAggregatorJSON("MilkyWay"));
String actualJSON = objectMapper.writeValueAsString(tupleSketchToStringPostAggregator);
String expectedJSON = jsonObject.toString();
JSONAssert.assertEquals(expectedJSON, actualJSON, JSONCompareMode.NON_EXTENSIBLE);
}
@Test(expectedExceptions = NullPointerException.class)
public void testNullName() {
TupleSketchToStringPostAggregator tupleSketchToStringPostAggregator =
TupleSketchToStringPostAggregator.builder()
.field(milkyWay)
.build();
}
@Test(expectedExceptions = NullPointerException.class)
public void testNullField() {
TupleSketchToStringPostAggregator tupleSketchToStringPostAggregator =
TupleSketchToStringPostAggregator.builder()
.name("milky_way_info")
.build();
}
} | [
"abhi@zapr.in"
] | abhi@zapr.in |
e2881a21f572b7e4befd4e6b9d2e9aad7bd39d2d | c6a2ffe94a1a8da4405d907c9ea68648d1e2172d | /C/src/com/org/Nnn.java | b25e4839c5fe349f8bf7e34fdcb27709f09d449d | [] | no_license | thangamurugan1/Pilaga | 2419f2570c5251f8e3cc10ab2573c3af3ba8e525 | 8fc8b367707a78618fc5aa7742baf70bec4b6623 | refs/heads/master | 2023-08-23T04:40:57.098817 | 2021-10-08T05:47:56 | 2021-10-08T05:47:56 | 414,853,803 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,351 | java | package com.org;
import java.awt.AWTException;
import java.awt.Robot;
import java.awt.event.KeyEvent;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
public class Nnn {
//CNTRL+A,CNTRL+C,CNTRL+V
public static void main(String[] args) throws AWTException, InterruptedException {
// TODO Auto-generated method stub
System.setProperty("webdriver.chrome.driver","C:\\Users\\Thanga\\eclipse-workspace\\C\\driver\\chromedriver.exe");
WebDriver driver = new ChromeDriver();
driver.manage().window().maximize();
driver.navigate().to("https://en-gb.facebook.com/");
WebElement txt = driver.findElement(By.xpath("//input[@id='email']"));
txt.sendKeys("Thangamurugan");
Robot r = new Robot();
r.keyPress(KeyEvent.VK_CONTROL);
r.keyPress(KeyEvent.VK_A);
r.keyRelease(KeyEvent.VK_CONTROL);
r.keyRelease(KeyEvent.VK_A);
r.keyPress(KeyEvent.VK_CONTROL);
r.keyPress(KeyEvent.VK_C);
r.keyRelease(KeyEvent.VK_CONTROL);
r.keyRelease(KeyEvent.VK_C);
Thread.sleep(4000);
WebElement pwd = driver.findElement(By.xpath("//input[@name='pass']"));
pwd.click();
Robot a = new Robot();
a.keyPress(KeyEvent.VK_CONTROL);
a.keyPress(KeyEvent.VK_V);
a.keyRelease(KeyEvent.VK_CONTROL);
a.keyRelease(KeyEvent.VK_V);
}
}
| [
"thangasadha5@gmail.com"
] | thangasadha5@gmail.com |
7bd9b4c13728c28768e5a928a65aadd433560e1b | 45c794ba14aa5fec49f14a8411d8376f6c04f2e8 | /src/de/jonas/menu/ImageLoader.java | bc7630d0ddaf66f5117bdb06bba967ff137bf509 | [] | no_license | GemueseHasser/Pong | 9458cf93ea98aeb555725d90f15043445e441589 | 87a0713686e57e0582e93c3fe367795113430a8e | refs/heads/master | 2023-03-07T23:46:48.060036 | 2021-02-23T12:26:19 | 2021-02-23T12:26:19 | 334,746,801 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 491 | java | package de.jonas.menu;
import javax.imageio.ImageIO;
import java.awt.Image;
import java.io.IOException;
public class ImageLoader {
static Image speakerOn, speakerOff;
public ImageLoader() {
try {
speakerOn = ImageIO.read(getClass().getResource("/de/jonas/res/speakerOn.png"));
speakerOff = ImageIO.read(getClass().getResource("/de/jonas/res/speakerOff.png"));
} catch (IOException e) {
e.printStackTrace();
}
}
}
| [
"jonas.lobe.2006@outlook.com"
] | jonas.lobe.2006@outlook.com |
d4825d7ee8857226a278b13a7a246c71162dad75 | c81975d41ab82056923510493d3989bbadd9f9d9 | /app/src/test/java/com/example/android/praguetourguide/ExampleUnitTest.java | 9f162a1515cd70ebf95d764cc98d15033ab189ec | [] | no_license | AnetaBiederman/PragueTourGuide-master | 6a4872df0002d717b042838252fc7e9e07764430 | 027747b771b833e8a04b9e08ee8a6e8013ba8025 | refs/heads/master | 2020-03-27T05:08:45.525099 | 2018-08-24T13:47:38 | 2018-08-24T13:47:38 | 145,997,017 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 413 | java | package com.example.android.praguetourguide;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
} | [
"aneta.biedermanova@seznam.cz"
] | aneta.biedermanova@seznam.cz |
9a8dfbeb286c80de5f1b80f71e4c13ed1f804f85 | 0a5cd2336a0b41b348ae396818ef0b6cce3b8a20 | /app/src/main/java/com/github/tifezh/kchart/widget/YStarView.java | 5c7c420f7beb9910d9009d29b169747bf65e7c5a | [
"Apache-2.0"
] | permissive | 1067899750/kAndroid | dc608192d4d8402a1cc8822f6786f713553d153b | 68fd95d38ca22e9d2afa81640f02ec6dcf777667 | refs/heads/master | 2022-02-12T04:38:25.507720 | 2022-01-26T10:02:37 | 2022-01-26T10:02:37 | 154,624,591 | 73 | 18 | null | null | null | null | UTF-8 | Java | false | false | 5,367 | java | package com.github.tifezh.kchart.widget;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.VectorDrawable;
import android.util.AttributeSet;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import com.github.tifezh.kchart.R;
/**
* @author puyantao
* @description 自定义评分控件
* @date 2021/1/5 14:19
*/
public class YStarView extends View {
private int starCount; //星星个数
private int rating; //亮星星的个数,默认为0
private int ratingH; //星星的余数,控制半星
private boolean change; //是否可以滑动
private boolean half; //是否开启半星
private int starSize; //星星高度大小,星星一般正方形,宽度等于高度
private Bitmap starT; //亮星星
private Bitmap starF; //暗星星
private Bitmap starH; //暗星星
private Drawable fillStar; //亮星星设置图
private Drawable halfStar; //半星星设置图
private Drawable emptyStar; //暗星星设置图
private Paint mPaint;//画笔
public YStarView(Context context) {
super(context);
}
public YStarView(Context context, AttributeSet attrs) {
super(context, attrs);
init();
}
public YStarView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
init();
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
//这个是获取宽跟高,给下面计算星星大小用
calculationSize(MeasureSpec.getSize(widthMeasureSpec), MeasureSpec.getSize(heightMeasureSpec));
}
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
//画图
for (int i = 0; i < starCount; i++) {//画多少颗星星
if (rating > i) canvas.drawBitmap(starT, starSize * i, 0, mPaint);//画亮的星星
else if (half && ratingH < 40 && ratingH > 5 && rating == i)
canvas.drawBitmap(starH, starSize * i, 0, mPaint);//画半的星星
else canvas.drawBitmap(starF, starSize * i, 0, mPaint);//画暗的的星星
}
}
/**
* 滑动和点击选择星星
*/
@Override
public boolean onTouchEvent(MotionEvent event) {
if (change) {//是否可以点击或者滑动
int x = (int) event.getX();
if (x < 0) x = 0;
if (x > getMeasuredWidth()) x = getMeasuredWidth();
rating = x / starSize;
ratingH = x % starSize;
if (ratingH > 40) rating++;
invalidate();//重新绘制
return true;
} else return false;
}
/**
* 初始化参数
*/
private void init() {
mPaint = new Paint();
mPaint.setAntiAlias(true); // 打开抗锯齿
half = false;//默认关闭半星
change = false;//默认关闭点击滑动
rating = 0;//默认评分为0
starCount = 5;//默认五颗星星
//这两个自行改成自己的图标
fillStar = this.getResources().getDrawable(R.drawable.ic_full);//亮星星的图标
emptyStar = this.getResources().getDrawable(R.drawable.ic_empty);//暗星星的图标
halfStar = this.getResources().getDrawable(R.drawable.ic_half);//半星星的图标
}
/**
* 计算星星大小
*/
private void calculationSize(int width, int height) {
//计算星星大小
if (width > height * starCount) {
starSize = height;
} else starSize = width / starCount;
//初始化图片
starT = drawableToBitmap(fillStar, starSize);
starF = drawableToBitmap(emptyStar, starSize);
starH = drawableToBitmap(halfStar, starSize);
}
/**
* drawable转bitmap
*
* @param drawable
* @return bitmap
*/
private Bitmap drawableToBitmap(Drawable drawable, int size) {
if (drawable == null) return null;
Bitmap bitmap = Bitmap.createBitmap(size, size, Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(bitmap);
drawable.setBounds(0, 0, size, size);
drawable.draw(canvas);
return bitmap;
}
/**
* 设置星星总数
*/
public void setStarCount(int count) {
starCount = count;
}
/**
* 设置星星亮的颗数
*/
public void setRating(int rating) {
this.rating = rating;
}
/**
* 设置星星是否可以点击和滑动改变
*/
public void setChange(boolean change) {
this.change = change;
}
/**
* 设置星星是否可以点击和滑动改变
*/
public void setHalf(boolean half) {
this.half = half;
}
/**
* 设置星星的样式
*/
public void setStar(int fillStar, int emptyStar) {
this.fillStar = this.getResources().getDrawable(fillStar);
this.emptyStar = this.getResources().getDrawable(emptyStar);
}
/**
* 获取亮星星的颗数
*/
public int getRating() {
return rating;
}
} | [
"puyantao123759"
] | puyantao123759 |
42dbe71d107acc02bee93339d9d9118d78007fb7 | f5bc4fb562272abec47484c7541a2bcfff481de9 | /src/main/java/uk/gov/hmcts/reform/em/npa/service/dto/external/annotation/CommentDTO.java | 4a9782416bc4f3e3656295a52f1b2b42785fe1b0 | [
"MIT"
] | permissive | ssian2/em-native-pdf-annotator-app | 95a5234f1436449d7da7dffeff12c5232d660971 | abcd750c798c714dd6080f0ab9c5190b0f686b5b | refs/heads/master | 2023-08-22T21:57:26.604386 | 2021-09-22T09:04:33 | 2021-09-22T09:04:33 | 409,140,598 | 0 | 0 | MIT | 2021-09-22T09:25:05 | 2021-09-22T09:25:05 | null | UTF-8 | Java | false | false | 1,588 | java | package uk.gov.hmcts.reform.em.npa.service.dto.external.annotation;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.Objects;
import java.util.UUID;
/**
* A DTO for the Comment entity.
*/
public class CommentDTO extends AbstractAuditingDTO implements Serializable {
private UUID id;
@Size(max = 5000)
private String content;
private UUID annotationId;
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public UUID getAnnotationId() {
return annotationId;
}
public void setAnnotationId(UUID annotationId) {
this.annotationId = annotationId;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
CommentDTO commentDTO = (CommentDTO) o;
if (commentDTO.getId() == null || getId() == null) {
return false;
}
return Objects.equals(getId(), commentDTO.getId());
}
@Override
public int hashCode() {
return Objects.hashCode(getId());
}
@Override
public String toString() {
return "CommentDTO{" +
"id=" + getId() +
", content='" + getContent() + "'" +
", annotation=" + getAnnotationId() +
"}";
}
}
| [
"pawel.kaczmarek@gmail.com"
] | pawel.kaczmarek@gmail.com |
f84e9f96b88dd13d0655ded25dc43b04c6f28a86 | c93b23bd80148ffecf6701e633811d18f5bda63a | /ssm/src/main/java/ssm/dao/IAccountDao.java | 89a2489f02b85b90b27326bffed3add7ec7a9bc2 | [] | no_license | kingxuanmeng/mytest | 94d453ad958c23a0969dc4a96dc91e65af078728 | 8815899c6867041b15905f3dfe4c0be728f50e73 | refs/heads/master | 2020-05-24T07:44:30.268601 | 2019-05-19T10:15:29 | 2019-05-19T10:16:29 | 187,167,696 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 189 | java | package ssm.dao;
import java.util.List;
import ssm.entity.Account;
public interface IAccountDao {
public void saveAccount(Account account);
public List<Account> findAll();
}
| [
"1010591751@qq.com"
] | 1010591751@qq.com |
c06b08e080633c1c337c7128eb7010214133850a | 56cf34c40c5048b7b5f9a257288bba1c34b1d5e2 | /src/org/xpup/hafmis/sysloan/specialbiz/bailenrol/action/BailenRolTaSaveAC.java | dcf67971ca3ee8d3d6f02e44d6d76b2160144fd8 | [] | no_license | witnesslq/zhengxin | 0a62d951dc69d8d6b1b8bcdca883ee11531fbb83 | 0ea9ad67aa917bd1911c917334b6b5f9ebfd563a | refs/heads/master | 2020-12-30T11:16:04.359466 | 2012-06-27T13:43:40 | 2012-06-27T13:43:40 | null | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 4,055 | java | package org.xpup.hafmis.sysloan.specialbiz.bailenrol.action;
import java.math.BigDecimal;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;
import org.apache.struts.action.ActionMessages;
import org.xpup.common.exception.BusinessException;
import org.xpup.common.util.BSUtils;
import org.xpup.hafmis.orgstrct.dto.SecurityInfo;
import org.xpup.hafmis.sysloan.specialbiz.bailenrol.bsinterface.IBailenRolBS;
import org.xpup.hafmis.sysloan.specialbiz.bailenrol.dto.BailenRolTaDTO;
import org.xpup.hafmis.sysloan.specialbiz.bailenrol.dto.BailenRolTaPrintDTO;
import org.xpup.hafmis.sysloan.specialbiz.bailenrol.form.BailenRolTaAF;
/**
* @author 王野 2007-10-02
*/
public class BailenRolTaSaveAC extends Action {
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
ActionMessages messages = null;
BailenRolTaPrintDTO bailenRolTaPrintDTO = new BailenRolTaPrintDTO();
BailenRolTaDTO bailenRolTaDTO = new BailenRolTaDTO();
BailenRolTaAF bailenRolTaAF = (BailenRolTaAF) form;
IBailenRolBS bailenRolBS = (IBailenRolBS) BSUtils.getBusinessService(
"bailenRolBS", this, mapping.getModuleConfig());
try {
messages = new ActionMessages();
if (!isTokenValid(request)) {
messages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(
"请不要重复提交!", false));
saveErrors(request, messages);
} else {
resetToken(request);
SecurityInfo securityInfo = (SecurityInfo) request.getSession()
.getAttribute("SecurityInfo");
String contractId = bailenRolTaAF.getContractId().trim();
String borrowerName = bailenRolTaAF.getBorrowerName().trim();
String cardKind = bailenRolTaAF.getCardKind().trim();
String cardNum = bailenRolTaAF.getCardNum().trim();
String loanBankName = bailenRolTaAF.getLoanBankName().trim();// 从页面获取的收款银行ID
String loanBankId = bailenRolTaAF.getLoanBankId().trim();// 从页面获取的收款银行ID 2007-11-12修改
String loanKouAcc = bailenRolTaAF.getLoanKouAcc().trim();
String loanKouAccHidden = bailenRolTaAF.getLoanKouAccHidden().trim();// 从页面隐藏域获取的贷款账号 2007-11-12修改
String bizDate = bailenRolTaAF.getBizDate().trim();
String occurMoney = bailenRolTaAF.getOccurMoney().toString();// 保证金金额
// form to dto
bailenRolTaDTO.setContractId(contractId);
bailenRolTaDTO.setBorrowerName(borrowerName);
bailenRolTaDTO.setCardKind(cardKind);
bailenRolTaDTO.setCardNum(cardNum);
bailenRolTaDTO.setLoanBankName(loanBankName);
bailenRolTaDTO.setLoanBankId(loanBankId);// 2007-11-12修改
bailenRolTaDTO.setLoanKouAcc(loanKouAcc);
bailenRolTaDTO.setLoanKouAccHidden(loanKouAccHidden);// 2007-11-12修改
bailenRolTaDTO.setBizDate(bizDate);
bailenRolTaDTO.setOccurMoney(new BigDecimal(occurMoney));
// 添加保证金登记信息,并返回PL202头表ID
bailenRolTaPrintDTO = bailenRolBS.saveBailenRol(bailenRolTaDTO, securityInfo);
bailenRolTaAF.reset(mapping, request);
request.setAttribute("printInfo", "print");
}
} catch (BusinessException bex) {
messages = new ActionMessages();
messages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(bex
.getMessage(), false));
saveErrors(request, messages);
} catch (Exception e) {
e.printStackTrace();
}
request.getSession().setAttribute("bailenRolTaPrintDTO", bailenRolTaPrintDTO);
return mapping.findForward("bailenRolTaShowAC");
}
}
| [
"yuelaotou@gmail.com"
] | yuelaotou@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.