blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 4 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 689M ⌀ | 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 131 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 32 values | content stringlengths 3 9.45M | authors listlengths 1 1 | author_id stringlengths 0 313 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6d880006a36403f1908993c3e9be69f40ba02edc | 7040205cc27dd56deea7c75551764bbc583651b6 | /src/test/java/edu/westga/cs/temp001/model/WorldWhenGetGreeting.java | 5c8855e292d387e23306ea624a44a1c119c4f4af | [] | no_license | anicho11/temp001 | 00a0b932a9ef8bba5a031b7f31c3c332f8e0f925 | 3392c4dac1c6bafc793dd1cd91b913ad1abcb8a1 | refs/heads/master | 2020-03-19T05:34:18.708285 | 2018-06-05T18:03:08 | 2018-06-05T18:03:08 | 135,944,610 | 0 | 0 | null | 2018-06-05T18:03:10 | 2018-06-03T22:10:54 | Java | UTF-8 | Java | false | false | 1,070 | java | /**
*
*/
package edu.westga.cs.temp001.model;
import static org.junit.Assert.*;
import org.junit.Test;
/**
* Test for {@link World#getGreeting(String)}
*
* @author Adam Nicholson
* @version 06/04/2018
*/
public class WorldWhenGetGreeting {
/**
* Confirm that passing "English" to {@link World#getGreeting(String)}
* returns "Hello World!"
*/
@Test
public void shouldGetHelloWorld() {
World world = new World();
assertEquals("Hello World!", world.getGreeting("English"));
}
/**
* Confirm that passing "Spanish" to {@link World#getGreeting(String)}
* returns "Hola Mundo!"
*/
@Test
public void shouldGetHolaMundo() {
World world = new World();
assertEquals("Hola Mundo!", world.getGreeting("Spanish"));
}
/**
* Confirm that passing "Greek" to {@link World#getGreeting(String)}
* returns "Invalid language."
*/
@Test
public void shouldGetInvalidLanguage() {
World world = new World();
assertEquals("Invalid language.", world.getGreeting("Greek"));
}
}
| [
"anicho11@my.westga.edu"
] | anicho11@my.westga.edu |
f27eb0888f1684cae5e2cd336d2794da831c3ee1 | bb7a319b931177b2ad03fe777a9d7a6280bedcd1 | /post/notepad/java/javanote/java-basic-study/src/main/java/basic/DesignPattern/behavior/ChainResponsibilityPattern/Client.java | 16f2622c148b973c02021d16e6d88528748ac920 | [] | no_license | Fierygit/Fierygit.github.io | 19aa2898e39a8d2a0dc0a7ff070c9a284ef13a9d | df8c54a14dfefaa4a8f0da40da63a781958258b6 | refs/heads/master | 2022-07-28T10:49:02.691758 | 2021-01-09T09:05:14 | 2021-01-09T09:05:14 | 196,905,690 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 688 | java | package basic.DesignPattern.behavior.ChainResponsibilityPattern;
/**
* @author Firefly
* @version 1.0
* @date 2019/12/11 17:23
*
* 职责链, 只处理自己的职责, 如果自己没有权限, 将自己
*
*/
public class Client {
public static void main(String[] args) {
Handler handler1 = new ConcreteHandlerA();
Handler handler2 = new ConcreteHandlerD();
Handler handler3 = new ConcreteHandlerF();
handler1.setSuccessor(handler2);
handler2.setSuccessor(handler3);
handler1.handleRequest("ABC");
handler1.handleRequest("D");
handler1.handleRequest("F");
handler1.handleRequest("G");
}
}
| [
"531109985@qq.com"
] | 531109985@qq.com |
c498d0e5d21a3507cd377272438edaff1e1dc773 | 1cb9d51961a3cf65259997f8140185d3cf2a25d2 | /src/main/java/com/lk/deploy/DeployApplication.java | 4cfbb9b260005a626f84888fc5b4e52cb97349d1 | [] | no_license | HelloJavaWorld123/deploy | 212d8dd5a625af7716148e9ba26684baf65c6128 | 1d255a12bbbcf4be4c0cb51b7a3f5bdc1396568a | refs/heads/master | 2022-09-06T06:00:13.367991 | 2020-06-02T12:12:30 | 2020-06-02T12:12:30 | 268,697,347 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 318 | java | package com.lk.deploy;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class DeployApplication {
public static void main(String[] args) {
SpringApplication.run(DeployApplication.class, args);
}
}
| [
"renxiaokuan9428@duia.com"
] | renxiaokuan9428@duia.com |
a8ec143ebdedfde26df405397b5c17f4a6cf49c0 | 534847fbc557285a202f333099a03f49bde479ed | /target/tomcat/work/Tomcat/localhost/_/org/apache/jsp/WEB_002dINF/commons/footer_jsp.java | 3ba7327119b8daec0cd48b62e61b50bad964a5fb | [] | no_license | caoweilin/B2C-sanqi-search | efd20e6918953bee87bc4b1a7df60f2e87001e93 | 3cbdcc233396bc6bfdf3f2af0c9a67bae720deaf | refs/heads/master | 2020-07-03T01:48:32.533416 | 2019-08-11T11:25:56 | 2019-08-11T11:25:56 | 201,746,855 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 12,574 | java | /*
* Generated by the Jasper component of Apache Tomcat
* Version: Apache Tomcat/7.0.47
* Generated at: 2019-07-10 12:59:08 UTC
* Note: The last modified time of this file was set to
* the last modified time of the source file after
* generation to assist with modification tracking.
*/
package org.apache.jsp.WEB_002dINF.commons;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
public final class footer_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent {
private static final javax.servlet.jsp.JspFactory _jspxFactory =
javax.servlet.jsp.JspFactory.getDefaultFactory();
private static java.util.Map<java.lang.String,java.lang.Long> _jspx_dependants;
private javax.el.ExpressionFactory _el_expressionfactory;
private org.apache.tomcat.InstanceManager _jsp_instancemanager;
public java.util.Map<java.lang.String,java.lang.Long> getDependants() {
return _jspx_dependants;
}
public void _jspInit() {
_el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory();
_jsp_instancemanager = org.apache.jasper.runtime.InstanceManagerFactory.getInstanceManager(getServletConfig());
}
public void _jspDestroy() {
}
public void _jspService(final javax.servlet.http.HttpServletRequest request, final javax.servlet.http.HttpServletResponse response)
throws java.io.IOException, javax.servlet.ServletException {
final javax.servlet.jsp.PageContext pageContext;
javax.servlet.http.HttpSession session = null;
final javax.servlet.ServletContext application;
final javax.servlet.ServletConfig config;
javax.servlet.jsp.JspWriter out = null;
final java.lang.Object page = this;
javax.servlet.jsp.JspWriter _jspx_out = null;
javax.servlet.jsp.PageContext _jspx_page_context = null;
try {
response.setContentType("text/html; charset=UTF-8");
pageContext = _jspxFactory.getPageContext(this, request, response,
null, true, 8192, true);
_jspx_page_context = pageContext;
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out = out;
out.write("\r\n");
out.write(" ");
String staticUrl = "http://static.sanqi.com";
request.setAttribute("staticUrl", staticUrl);
out.write("\r\n");
out.write("<div class=\"w\" clstag=\"homepage|keycount|home2013|37a\">\r\n");
out.write("\t<div id=\"service-2013\">\r\n");
out.write("\t\t<dl class=\"fore1\">\r\n");
out.write("\t\t\t<dt><b></b><strong>购物指南</strong></dt>\r\n");
out.write("\t\t\t<dd>\r\n");
out.write("\t\t\t\t<div><a href=\"http://help.jd.com/help/question-56.html\" target=\"_blank\" rel=\"nofollow\">购物流程</a></div>\r\n");
out.write("\t\t\t\t<div><a href=\"http://help.jd.com/help/question-57.html\" target=\"_blank\" rel=\"nofollow\">会员介绍</a></div>\r\n");
out.write("\t\t\t\t<div><a href=\"http://help.jd.com/help/question-181.html\" target=\"_blank\" rel=\"nofollow\">团购/机票</a></div>\r\n");
out.write("\t\t\t\t<div><a href=\"http://help.jd.com/help/question-61.html\" target=\"_blank\" rel=\"nofollow\">常见问题</a></div>\r\n");
out.write("\t\t\t\t<div><a href=\"http://help.jd.com/help/question-63.html\" target=\"_blank\" rel=\"nofollow\">大家电</a></div>\r\n");
out.write("\t\t\t\t<div><a href=\"http://help.jd.com/index.html\" target=\"_blank\" rel=\"nofollow\">联系客服</a></div>\r\n");
out.write("\t\t\t</dd>\r\n");
out.write("\t\t</dl>\r\n");
out.write("\t\t<dl class=\"fore2\">\t\t\r\n");
out.write("\t\t\t<dt><b></b><strong>配送方式</strong></dt>\r\n");
out.write("\t\t\t<dd>\r\n");
out.write("\t\t\t\t<div><a href=\"http://help.jd.com/help/question-64.html\" target=\"_blank\" rel=\"nofollow\">上门自提</a></div>\r\n");
out.write("\t\t\t\t<div><a href=\"http://help.jd.com/help/question-360.html\" target=\"_blank\" rel=\"nofollow\">211限时达</a></div>\r\n");
out.write("\t\t\t\t<div><a href=\"http://help.jd.com/help/distribution-768.html\" target=\"_blank\" rel=\"nofollow\">配送服务查询</a></div>\r\n");
out.write("\t\t\t\t<div><a href=\"http://help.jd.com/help/question-892.html#help2215\" target=\"_blank\" rel=\"nofollow\">配送费收取标准</a></div>\r\n");
out.write("\t\t\t\t<div><a href=\"http://market.jd.com/giftcard/index.html#one5\" target=\"_blank\" rel=\"nofollow\">如何送礼</a></div>\r\n");
out.write("\t\t\t\t<div><a href=\"http://en.jd.com/chinese.html\" target=\"_blank\">海外配送</a></div>\r\n");
out.write("\t\t\t</dd>\r\n");
out.write("\t\t</dl>\r\n");
out.write("\t\t<dl class=\"fore3\">\r\n");
out.write("\t\t\t<dt><b></b><strong>支付方式</strong></dt>\r\n");
out.write("\t\t\t<dd>\r\n");
out.write("\t\t\t\t<div><a href=\"http://help.jd.com/help/question-67.html\" target=\"_blank\" rel=\"nofollow\">货到付款</a></div>\r\n");
out.write("\t\t\t\t<div><a href=\"http://help.jd.com/help/question-68.html\" target=\"_blank\" rel=\"nofollow\">在线支付</a></div>\r\n");
out.write("\t\t\t\t<div><a href=\"http://help.jd.com/help/question-71.html\" target=\"_blank\" rel=\"nofollow\">分期付款</a></div>\r\n");
out.write("\t\t\t\t<div><a href=\"http://help.jd.com/help/question-69.html\" target=\"_blank\" rel=\"nofollow\">邮局汇款</a></div>\r\n");
out.write("\t\t\t\t<div><a href=\"http://help.jd.com/help/question-70.html\" target=\"_blank\" rel=\"nofollow\">公司转账</a></div>\r\n");
out.write("\t\t\t</dd>\r\n");
out.write("\t\t</dl>\r\n");
out.write("\t\t<dl class=\"fore4\">\t\t\r\n");
out.write("\t\t\t<dt><b></b><strong>售后服务</strong></dt>\r\n");
out.write("\t\t\t<dd>\r\n");
out.write("\t\t\t\t<div><a href=\"http://myjd.jd.com/afs/help/afshelp.action\" target=\"_blank\" rel=\"nofollow\">售后政策</a></div>\r\n");
out.write("\t\t\t\t<div><a href=\"http://help.jd.com/help/question-99.html\" target=\"_blank\" rel=\"nofollow\">价格保护</a></div>\r\n");
out.write("\t\t\t\t<div><a href=\"http://help.jd.com/help/question-100.html\" target=\"_blank\" rel=\"nofollow\">退款说明</a></div>\r\n");
out.write("\t\t\t\t<div><a href=\"http://myjd.jd.com/repair/repairs.action\" target=\"_blank\" rel=\"nofollow\">返修/退换货</a></div>\r\n");
out.write("\t\t\t\t<div><a href=\"http://help.jd.com/help/question-881.html\" target=\"_blank\" rel=\"nofollow\">取消订单</a></div>\r\n");
out.write("\t\t\t</dd>\r\n");
out.write("\t\t</dl>\r\n");
out.write("\t\t<dl class=\"fore5\">\r\n");
out.write("\t\t\t<dt><b></b><strong>特色服务</strong></dt>\r\n");
out.write("\t\t\t<dd>\t\t\r\n");
out.write("\t\t\t\t<div><a href=\"http://help.jd.com/help/question-79.html\" target=\"_blank\">夺宝岛</a></div>\r\n");
out.write("\t\t\t\t<div><a href=\"http://help.jd.com/help/question-86.html\" target=\"_blank\">DIY装机</a></div>\r\n");
out.write("\t\t\t\t<div><a href=\"http://fuwu.jd.com/\" target=\"_blank\" rel=\"nofollow\">延保服务</a></div>\r\n");
out.write("\t\t\t\t<div><a href=\"http://giftcard.jd.com/market/index.action\" target=\"_blank\" rel=\"nofollow\">淘淘E卡</a></div>\r\n");
out.write("\t\t\t\t<div><a href=\"http://help.jd.com/help/question-91.html\" target=\"_blank\" rel=\"nofollow\">节能补贴</a></div>\r\n");
out.write("\t\t\t\t<div><a href=\"http://mobile.jd.com/\" target=\"_blank\" rel=\"nofollow\">淘淘通信</a></div>\r\n");
out.write("\t\t\t</dd>\r\n");
out.write("\t\t</dl>\r\n");
out.write("\t\t<div class=\"fr\">\r\n");
out.write("\t\t\t<div class=\"sm\" id=\"branch-office\">\r\n");
out.write("\t\t\t\t<div class=\"smt\">\r\n");
out.write("\t\t\t\t\t<h3>淘淘自营覆盖区县</h3>\r\n");
out.write("\t\t\t\t</div>\r\n");
out.write("\t\t\t\t<div class=\"smc\">\r\n");
out.write("\t\t\t\t\t<p>淘淘已向全国1859个区县提供自营配送服务,支持货到付款、POS机刷卡和售后上门服务。</p>\r\n");
out.write("\t\t\t\t\t<p class=\"ar\"><a href=\"http://help.jd.com/help/distribution-768.html\" target=\"_blank\">查看详情 ></a></p>\r\n");
out.write("\t\t\t\t</div>\r\n");
out.write("\t\t\t</div>\r\n");
out.write("\t\t</div>\r\n");
out.write("\t\t<span class=\"clr\"></span>\r\n");
out.write("\t</div>\r\n");
out.write("</div>\r\n");
out.write("<div class=\"w\" clstag=\"homepage|keycount|home2013|38a\">\r\n");
out.write("\t");
org.apache.jasper.runtime.JspRuntimeLibrary.include(request, response, "footer-links.jsp", out, false);
out.write("\r\n");
out.write("</div>\r\n");
out.write("<script type=\"text/javascript\" src=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${staticUrl}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null, false));
out.write("/js/jquery-1.2.6.min.js\"></script>\r\n");
out.write("<script type=\"text/javascript\" src=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${staticUrl}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null, false));
out.write("/js/jquery-extend.js\"></script>\r\n");
out.write("<script type=\"text/javascript\" src=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${staticUrl}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null, false));
out.write("/js/lib-v1.js\" charset=\"utf-8\"></script>\r\n");
out.write("<script type=\"text/javascript\" src=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${staticUrl}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null, false));
out.write("/js/taotao.js\" charset=\"utf-8\"></script>\r\n");
out.write("<script type=\"text/javascript\"> (function(){\r\n");
out.write("var A=\"<strong>热门搜索:</strong><a href='http://sale.jd.com/act/OfHQzJ2GLoYlmTIu.html' target='_blank' style='color:#ff0000' clstag='homepage|keycount|home2013|03b1'>校园之星</a><a href='http://sale.jd.com/act/aEBHqLFMfVzDZUvu.html' target='_blank'>办公打印</a><a href='http://www.jd.com/pinpai/878-12516.html' target='_blank'>美菱冰箱</a><a href='http://sale.jd.com/act/nuzKb6ZiYL.html' target='_blank'>无肉不欢</a><a href='http://sale.jd.com/act/ESvhtcAJNbaj.html' target='_blank'>万件好货</a><a href='http://sale.jd.com/act/nAqiWgU34frQolt.html' target='_blank'>iPhone6</a><a href='http://sale.jd.com/act/p0CmUlEFPHLX.html' target='_blank'>哈利波特</a><a href='http://sale.jd.com/act/FstSdb2vCOLa8BRi.html' target='_blank'>美模接驾</a>\";\r\n");
out.write("var B=[\"java\",\"apple\",\"LG G3\",\"天梭\",\"保温杯\",\"三个爸爸\"];\r\n");
out.write("B=pageConfig.FN_GetRandomData(B);\r\n");
out.write("$(\"#hotwords\").html(A);\r\n");
out.write("var _searchValue = \"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${query}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null, false));
out.write("\";\r\n");
out.write("if(_searchValue.length == 0){\r\n");
out.write("\t_searchValue = B;\r\n");
out.write("}\r\n");
out.write("$(\"#key\").val(_searchValue).bind(\"focus\",function(){if (this.value==B){this.value=\"\";this.style.color=\"#333\"}}).bind(\"blur\",function(){if (!this.value){this.value=B;this.style.color=\"#999\"}});\r\n");
out.write("})();\r\n");
out.write("</script>");
} catch (java.lang.Throwable t) {
if (!(t instanceof javax.servlet.jsp.SkipPageException)){
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
try { out.clearBuffer(); } catch (java.io.IOException e) {}
if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
else throw new ServletException(t);
}
} finally {
_jspxFactory.releasePageContext(_jspx_page_context);
}
}
}
| [
"17770541032@163.com"
] | 17770541032@163.com |
a21e702baf911cd7bb4676ca604b7c75b9b066c4 | 4f391befee100482072da40cef5dbcdb39c3c09d | /src/main/java/co/uk/recipe/group/service/ImageService.java | 00cc239cf61e44a5f6e1805a3ef1e1e8f8260040 | [] | no_license | muttbag/recipe-service | f450caf70a6f9f32c6b4b41865813b37831ec2f7 | 2e9666355f14aedf692fa5dc873c184fe5d61d54 | refs/heads/master | 2022-11-13T00:59:50.329516 | 2020-07-01T14:23:29 | 2020-07-01T14:23:29 | 259,909,551 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 335 | java | package co.uk.recipe.group.service;
import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;
public interface ImageService {
String uploadImageToBucket(MultipartFile multipartFile) throws IOException;
//TODO: Should be URI/URL instead of String?
Boolean removeImageFromBucket(String url);
}
| [
"mrmartyn05@hotmail.co.uk"
] | mrmartyn05@hotmail.co.uk |
b61a7cc2dcae3c6a2402ddbe234ac6227e013866 | ecf2d9473022781e53b19e5d6b848baf45bc3f65 | /src/main/java/com/cloudmeters/haccp/domain/User.java | 1020a214bb56e2d9d1383ee940f79a86d5a385c0 | [] | no_license | carraroFamily/haccp | d4751d5e7491600c0cd957f1f9abef356b3c53c4 | 754ac7c82250b919cc4e5bf52c8179c8f0770842 | refs/heads/master | 2022-12-22T10:11:49.508683 | 2020-02-17T21:34:55 | 2020-02-17T21:34:55 | 241,212,705 | 1 | 0 | null | 2022-12-16T05:12:58 | 2020-02-17T21:34:40 | Java | UTF-8 | Java | false | false | 5,368 | java | package com.cloudmeters.haccp.domain;
import com.cloudmeters.haccp.config.Constants;
import com.fasterxml.jackson.annotation.JsonIgnore;
import org.apache.commons.lang3.StringUtils;
import org.hibernate.annotations.BatchSize;
import javax.persistence.*;
import javax.validation.constraints.Email;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.time.Instant;
import java.util.HashSet;
import java.util.Locale;
import java.util.Set;
/**
* A user.
*/
@Entity
@Table(name = "jhi_user")
public class User extends AbstractAuditingEntity implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sequenceGenerator")
@SequenceGenerator(name = "sequenceGenerator")
private Long id;
@NotNull
@Pattern(regexp = Constants.LOGIN_REGEX)
@Size(min = 1, max = 50)
@Column(length = 50, unique = true, nullable = false)
private String login;
@JsonIgnore
@NotNull
@Size(min = 60, max = 60)
@Column(name = "password_hash", length = 60, nullable = false)
private String password;
@Size(max = 50)
@Column(name = "first_name", length = 50)
private String firstName;
@Size(max = 50)
@Column(name = "last_name", length = 50)
private String lastName;
@Email
@Size(min = 5, max = 254)
@Column(length = 254, unique = true)
private String email;
@NotNull
@Column(nullable = false)
private boolean activated = false;
@Size(min = 2, max = 10)
@Column(name = "lang_key", length = 10)
private String langKey;
@Size(max = 256)
@Column(name = "image_url", length = 256)
private String imageUrl;
@Size(max = 20)
@Column(name = "activation_key", length = 20)
@JsonIgnore
private String activationKey;
@Size(max = 20)
@Column(name = "reset_key", length = 20)
@JsonIgnore
private String resetKey;
@Column(name = "reset_date")
private Instant resetDate = null;
@JsonIgnore
@ManyToMany
@JoinTable(
name = "jhi_user_authority",
joinColumns = {@JoinColumn(name = "user_id", referencedColumnName = "id")},
inverseJoinColumns = {@JoinColumn(name = "authority_name", referencedColumnName = "name")})
@BatchSize(size = 20)
private Set<Authority> authorities = new HashSet<>();
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getLogin() {
return login;
}
// Lowercase the login before saving it in database
public void setLogin(String login) {
this.login = StringUtils.lowerCase(login, Locale.ENGLISH);
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
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 getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getImageUrl() {
return imageUrl;
}
public void setImageUrl(String imageUrl) {
this.imageUrl = imageUrl;
}
public boolean getActivated() {
return activated;
}
public void setActivated(boolean activated) {
this.activated = activated;
}
public String getActivationKey() {
return activationKey;
}
public void setActivationKey(String activationKey) {
this.activationKey = activationKey;
}
public String getResetKey() {
return resetKey;
}
public void setResetKey(String resetKey) {
this.resetKey = resetKey;
}
public Instant getResetDate() {
return resetDate;
}
public void setResetDate(Instant resetDate) {
this.resetDate = resetDate;
}
public String getLangKey() {
return langKey;
}
public void setLangKey(String langKey) {
this.langKey = langKey;
}
public Set<Authority> getAuthorities() {
return authorities;
}
public void setAuthorities(Set<Authority> authorities) {
this.authorities = authorities;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof User)) {
return false;
}
return id != null && id.equals(((User) o).id);
}
@Override
public int hashCode() {
return 31;
}
@Override
public String toString() {
return "User{" +
"login='" + login + '\'' +
", firstName='" + firstName + '\'' +
", lastName='" + lastName + '\'' +
", email='" + email + '\'' +
", imageUrl='" + imageUrl + '\'' +
", activated='" + activated + '\'' +
", langKey='" + langKey + '\'' +
", activationKey='" + activationKey + '\'' +
"}";
}
}
| [
"jhipster-bot@jhipster.tech"
] | jhipster-bot@jhipster.tech |
f4827797e5cc51f2310e87d72b69504d48d0b8af | 638543680b3e435993484dcee6a6b6a9c1c696f1 | /src/honeyspoon/driver/HSDatabaseMetaData.java | a87575c1f740f37deba31207093524e12fbef7b2 | [
"Apache-2.0"
] | permissive | waveaccounting/honeyspoon | f45aff9336b749b5ee77f80fd598227e89cc7e39 | ccba5427bb19268eccb129edbc9cd22810c8698d | refs/heads/master | 2020-07-08T09:34:04.369062 | 2013-08-02T19:36:36 | 2013-08-02T19:36:36 | 11,816,825 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 24,142 | java | package honeyspoon.driver;
import java.sql.*;
public class HSDatabaseMetaData implements DatabaseMetaData {
private DatabaseMetaData metadata;
public HSDatabaseMetaData(DatabaseMetaData metadata) {
this.metadata = metadata;
}
public boolean allProceduresAreCallable() throws SQLException {
return metadata.allProceduresAreCallable();
}
public boolean allTablesAreSelectable() throws SQLException {
return metadata.allTablesAreSelectable();
}
public String getURL() throws SQLException {
return metadata.getURL();
}
public String getUserName() throws SQLException {
return metadata.getUserName();
}
public boolean isReadOnly() throws SQLException {
return metadata.isReadOnly();
}
public boolean nullsAreSortedHigh() throws SQLException {
return metadata.nullsAreSortedHigh();
}
public boolean nullsAreSortedLow() throws SQLException {
return metadata.nullsAreSortedLow();
}
public boolean nullsAreSortedAtStart() throws SQLException {
return metadata.nullsAreSortedAtStart();
}
public boolean nullsAreSortedAtEnd() throws SQLException {
return metadata.nullsAreSortedAtEnd();
}
public String getDatabaseProductName() throws SQLException {
return metadata.getDatabaseProductName();
}
public String getDatabaseProductVersion() throws SQLException {
return metadata.getDatabaseProductVersion();
}
public String getDriverName() throws SQLException {
return "HoneySpoon";
}
public String getDriverVersion() throws SQLException {
return metadata.getDriverVersion();
}
public int getDriverMajorVersion() {
return metadata.getDriverMajorVersion();
}
public int getDriverMinorVersion() {
return metadata.getDriverMinorVersion();
}
public boolean usesLocalFiles() throws SQLException {
return metadata.usesLocalFiles();
}
public boolean usesLocalFilePerTable() throws SQLException {
return metadata.usesLocalFilePerTable();
}
public boolean supportsMixedCaseIdentifiers() throws SQLException {
return metadata.supportsMixedCaseIdentifiers();
}
public boolean storesUpperCaseIdentifiers() throws SQLException {
return metadata.storesUpperCaseIdentifiers();
}
public boolean storesLowerCaseIdentifiers() throws SQLException {
return metadata.storesLowerCaseIdentifiers();
}
public boolean storesMixedCaseIdentifiers() throws SQLException {
return metadata.storesMixedCaseIdentifiers();
}
public boolean supportsMixedCaseQuotedIdentifiers() throws SQLException {
return metadata.supportsMixedCaseQuotedIdentifiers();
}
public boolean storesUpperCaseQuotedIdentifiers() throws SQLException {
return metadata.storesUpperCaseQuotedIdentifiers();
}
public boolean storesLowerCaseQuotedIdentifiers() throws SQLException {
return metadata.storesLowerCaseQuotedIdentifiers();
}
public boolean storesMixedCaseQuotedIdentifiers() throws SQLException {
return metadata.storesMixedCaseQuotedIdentifiers();
}
public String getIdentifierQuoteString() throws SQLException {
return metadata.getIdentifierQuoteString();
}
public String getSQLKeywords() throws SQLException {
return metadata.getSQLKeywords();
}
public String getNumericFunctions() throws SQLException {
return metadata.getNumericFunctions();
}
public String getStringFunctions() throws SQLException {
return metadata.getStringFunctions();
}
public String getSystemFunctions() throws SQLException {
return metadata.getSystemFunctions();
}
public String getTimeDateFunctions() throws SQLException {
return metadata.getTimeDateFunctions();
}
public String getSearchStringEscape() throws SQLException {
return metadata.getSearchStringEscape();
}
public String getExtraNameCharacters() throws SQLException {
return metadata.getExtraNameCharacters();
}
public boolean supportsAlterTableWithAddColumn() throws SQLException {
return metadata.supportsAlterTableWithAddColumn();
}
public boolean supportsAlterTableWithDropColumn() throws SQLException {
return metadata.supportsAlterTableWithDropColumn();
}
public boolean supportsColumnAliasing() throws SQLException {
return metadata.supportsColumnAliasing();
}
public boolean nullPlusNonNullIsNull() throws SQLException {
return metadata.nullPlusNonNullIsNull();
}
public boolean supportsConvert() throws SQLException {
return metadata.supportsConvert();
}
public boolean supportsConvert(int fromType, int toType) throws SQLException {
return metadata.supportsConvert(fromType, toType);
}
public boolean supportsTableCorrelationNames() throws SQLException {
return metadata.supportsTableCorrelationNames();
}
public boolean supportsDifferentTableCorrelationNames() throws SQLException {
return metadata.supportsDifferentTableCorrelationNames();
}
public boolean supportsExpressionsInOrderBy() throws SQLException {
return metadata.supportsExpressionsInOrderBy();
}
public boolean supportsOrderByUnrelated() throws SQLException {
return metadata.supportsOrderByUnrelated();
}
public boolean supportsGroupBy() throws SQLException {
return metadata.supportsGroupBy();
}
public boolean supportsGroupByUnrelated() throws SQLException {
return metadata.supportsGroupByUnrelated();
}
public boolean supportsGroupByBeyondSelect() throws SQLException {
return metadata.supportsGroupByBeyondSelect();
}
public boolean supportsLikeEscapeClause() throws SQLException {
return metadata.supportsLikeEscapeClause();
}
public boolean supportsMultipleResultSets() throws SQLException {
return metadata.supportsMultipleResultSets();
}
public boolean supportsMultipleTransactions() throws SQLException {
return metadata.supportsMultipleTransactions();
}
public boolean supportsNonNullableColumns() throws SQLException {
return metadata.supportsNonNullableColumns();
}
public boolean supportsMinimumSQLGrammar() throws SQLException {
return metadata.supportsMinimumSQLGrammar();
}
public boolean supportsCoreSQLGrammar() throws SQLException {
return metadata.supportsCoreSQLGrammar();
}
public boolean supportsExtendedSQLGrammar() throws SQLException {
return metadata.supportsExtendedSQLGrammar();
}
public boolean supportsANSI92EntryLevelSQL() throws SQLException {
return metadata.supportsANSI92EntryLevelSQL();
}
public boolean supportsANSI92IntermediateSQL() throws SQLException {
return metadata.supportsANSI92IntermediateSQL();
}
public boolean supportsANSI92FullSQL() throws SQLException {
return metadata.supportsANSI92FullSQL();
}
public boolean supportsIntegrityEnhancementFacility() throws SQLException {
return metadata.supportsIntegrityEnhancementFacility();
}
public boolean supportsOuterJoins() throws SQLException {
return metadata.supportsOuterJoins();
}
public boolean supportsFullOuterJoins() throws SQLException {
return metadata.supportsFullOuterJoins();
}
public boolean supportsLimitedOuterJoins() throws SQLException {
return metadata.supportsLimitedOuterJoins();
}
public String getSchemaTerm() throws SQLException {
return metadata.getSchemaTerm();
}
public String getProcedureTerm() throws SQLException {
return metadata.getProcedureTerm();
}
public String getCatalogTerm() throws SQLException {
return metadata.getCatalogTerm();
}
public boolean isCatalogAtStart() throws SQLException {
return metadata.isCatalogAtStart();
}
public String getCatalogSeparator() throws SQLException {
return metadata.getCatalogSeparator();
}
public boolean supportsSchemasInDataManipulation() throws SQLException {
return metadata.supportsSchemasInDataManipulation();
}
public boolean supportsSchemasInProcedureCalls() throws SQLException {
return metadata.supportsSchemasInProcedureCalls();
}
public boolean supportsSchemasInTableDefinitions() throws SQLException {
return metadata.supportsSchemasInTableDefinitions();
}
public boolean supportsSchemasInIndexDefinitions() throws SQLException {
return metadata.supportsSchemasInIndexDefinitions();
}
public boolean supportsSchemasInPrivilegeDefinitions() throws SQLException {
return metadata.supportsSchemasInPrivilegeDefinitions();
}
public boolean supportsCatalogsInDataManipulation() throws SQLException {
return metadata.supportsCatalogsInDataManipulation();
}
public boolean supportsCatalogsInProcedureCalls() throws SQLException {
return metadata.supportsCatalogsInProcedureCalls();
}
public boolean supportsCatalogsInTableDefinitions() throws SQLException {
return metadata.supportsCatalogsInTableDefinitions();
}
public boolean supportsCatalogsInIndexDefinitions() throws SQLException {
return metadata.supportsCatalogsInIndexDefinitions();
}
public boolean supportsCatalogsInPrivilegeDefinitions() throws SQLException {
return metadata.supportsCatalogsInPrivilegeDefinitions();
}
public boolean supportsPositionedDelete() throws SQLException {
return metadata.supportsPositionedDelete();
}
public boolean supportsPositionedUpdate() throws SQLException {
return metadata.supportsPositionedUpdate();
}
public boolean supportsSelectForUpdate() throws SQLException {
return metadata.supportsSelectForUpdate();
}
public boolean supportsStoredProcedures() throws SQLException {
return metadata.supportsStoredProcedures();
}
public boolean supportsSubqueriesInComparisons() throws SQLException {
return metadata.supportsSubqueriesInComparisons();
}
public boolean supportsSubqueriesInExists() throws SQLException {
return metadata.supportsSubqueriesInExists();
}
public boolean supportsSubqueriesInIns() throws SQLException {
return metadata.supportsSubqueriesInIns();
}
public boolean supportsSubqueriesInQuantifieds() throws SQLException {
return metadata.supportsSubqueriesInQuantifieds();
}
public boolean supportsCorrelatedSubqueries() throws SQLException {
return metadata.supportsCorrelatedSubqueries();
}
public boolean supportsUnion() throws SQLException {
return metadata.supportsUnion();
}
public boolean supportsUnionAll() throws SQLException {
return metadata.supportsUnionAll();
}
public boolean supportsOpenCursorsAcrossCommit() throws SQLException {
return metadata.supportsOpenCursorsAcrossCommit();
}
public boolean supportsOpenCursorsAcrossRollback() throws SQLException {
return metadata.supportsOpenCursorsAcrossRollback();
}
public boolean supportsOpenStatementsAcrossCommit() throws SQLException {
return metadata.supportsOpenStatementsAcrossCommit();
}
public boolean supportsOpenStatementsAcrossRollback() throws SQLException {
return metadata.supportsOpenStatementsAcrossRollback();
}
public int getMaxBinaryLiteralLength() throws SQLException {
return metadata.getMaxBinaryLiteralLength();
}
public int getMaxCharLiteralLength() throws SQLException {
return metadata.getMaxCharLiteralLength();
}
public int getMaxColumnNameLength() throws SQLException {
return metadata.getMaxColumnNameLength();
}
public int getMaxColumnsInGroupBy() throws SQLException {
return metadata.getMaxColumnsInGroupBy();
}
public int getMaxColumnsInIndex() throws SQLException {
return metadata.getMaxColumnsInIndex();
}
public int getMaxColumnsInOrderBy() throws SQLException {
return metadata.getMaxColumnsInOrderBy();
}
public int getMaxColumnsInSelect() throws SQLException {
return metadata.getMaxColumnsInSelect();
}
public int getMaxColumnsInTable() throws SQLException {
return metadata.getMaxColumnsInTable();
}
public int getMaxConnections() throws SQLException {
return metadata.getMaxConnections();
}
public int getMaxCursorNameLength() throws SQLException {
return metadata.getMaxCursorNameLength();
}
public int getMaxIndexLength() throws SQLException {
return metadata.getMaxIndexLength();
}
public int getMaxSchemaNameLength() throws SQLException {
return metadata.getMaxSchemaNameLength();
}
public int getMaxProcedureNameLength() throws SQLException {
return metadata.getMaxProcedureNameLength();
}
public int getMaxCatalogNameLength() throws SQLException {
return metadata.getMaxCatalogNameLength();
}
public int getMaxRowSize() throws SQLException {
return metadata.getMaxRowSize();
}
public boolean doesMaxRowSizeIncludeBlobs() throws SQLException {
return metadata.doesMaxRowSizeIncludeBlobs();
}
public int getMaxStatementLength() throws SQLException {
return metadata.getMaxStatementLength();
}
public int getMaxStatements() throws SQLException {
return metadata.getMaxStatements();
}
public int getMaxTableNameLength() throws SQLException {
return metadata.getMaxTableNameLength();
}
public int getMaxTablesInSelect() throws SQLException {
return metadata.getMaxTablesInSelect();
}
public int getMaxUserNameLength() throws SQLException {
return metadata.getMaxUserNameLength();
}
public int getDefaultTransactionIsolation() throws SQLException {
return metadata.getDefaultTransactionIsolation();
}
public boolean supportsTransactions() throws SQLException {
return metadata.supportsTransactions();
}
public boolean supportsTransactionIsolationLevel(int level) throws SQLException {
return metadata.supportsTransactionIsolationLevel(level);
}
public boolean supportsDataDefinitionAndDataManipulationTransactions() throws SQLException {
return metadata.supportsDataDefinitionAndDataManipulationTransactions();
}
public boolean supportsDataManipulationTransactionsOnly() throws SQLException {
return metadata.supportsDataManipulationTransactionsOnly();
}
public boolean dataDefinitionCausesTransactionCommit() throws SQLException {
return metadata.dataDefinitionCausesTransactionCommit();
}
public boolean dataDefinitionIgnoredInTransactions() throws SQLException {
return metadata.dataDefinitionIgnoredInTransactions();
}
public ResultSet getProcedures(String catalog, String schemaPattern, String procedureNamePattern) throws SQLException {
return metadata.getProcedures(catalog, schemaPattern, procedureNamePattern);
}
public ResultSet getProcedureColumns(String catalog, String schemaPattern, String procedureNamePattern, String columnNamePattern) throws SQLException {
return metadata.getProcedureColumns(catalog, schemaPattern, procedureNamePattern, columnNamePattern);
}
public ResultSet getTables(String catalog, String schemaPattern, String tableNamePattern, String[] types) throws SQLException {
return metadata.getTables(catalog, schemaPattern, tableNamePattern, types);
}
public ResultSet getSchemas() throws SQLException {
return metadata.getSchemas();
}
public ResultSet getCatalogs() throws SQLException {
return metadata.getCatalogs();
}
public ResultSet getTableTypes() throws SQLException {
return metadata.getTableTypes();
}
public ResultSet getColumns(String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern) throws SQLException {
return metadata.getColumns(catalog, schemaPattern, tableNamePattern, columnNamePattern);
}
public ResultSet getColumnPrivileges(String catalog, String schema, String table, String columnNamePattern) throws SQLException {
return metadata.getColumnPrivileges(catalog, schema, table, columnNamePattern);
}
public ResultSet getTablePrivileges(String catalog, String schemaPattern, String tableNamePattern) throws SQLException {
return metadata.getTablePrivileges(catalog, schemaPattern, tableNamePattern);
}
public ResultSet getBestRowIdentifier(String catalog, String schema, String table, int scope, boolean nullable) throws SQLException {
return metadata.getBestRowIdentifier(catalog, schema, table, scope, nullable);
}
public ResultSet getVersionColumns(String catalog, String schema, String table) throws SQLException {
return metadata.getVersionColumns(catalog, schema, table);
}
public ResultSet getPrimaryKeys(String catalog, String schema, String table) throws SQLException {
return metadata.getPrimaryKeys(catalog, schema, table);
}
public ResultSet getImportedKeys(String catalog, String schema, String table) throws SQLException {
return metadata.getImportedKeys(catalog, schema, table);
}
public ResultSet getExportedKeys(String catalog, String schema, String table) throws SQLException {
return metadata.getExportedKeys(catalog, schema, table);
}
public ResultSet getCrossReference(String parentCatalog, String parentSchema, String parentTable, String foreignCatalog, String foreignSchema, String foreignTable) throws SQLException {
return metadata.getCrossReference(parentCatalog, parentSchema, parentTable, foreignCatalog, foreignSchema, foreignTable);
}
public ResultSet getTypeInfo() throws SQLException {
return metadata.getTypeInfo();
}
public ResultSet getIndexInfo(String catalog, String schema, String table, boolean unique, boolean approximate) throws SQLException {
return metadata.getIndexInfo(catalog, schema, table, unique, approximate);
}
public boolean supportsResultSetType(int type) throws SQLException {
return metadata.supportsResultSetType(type);
}
public boolean supportsResultSetConcurrency(int type, int concurrency) throws SQLException {
return metadata.supportsResultSetConcurrency(type, concurrency);
}
public boolean ownUpdatesAreVisible(int type) throws SQLException {
return metadata.ownUpdatesAreVisible(type);
}
public boolean ownDeletesAreVisible(int type) throws SQLException {
return metadata.ownDeletesAreVisible(type);
}
public boolean ownInsertsAreVisible(int type) throws SQLException {
return metadata.ownInsertsAreVisible(type);
}
public boolean othersUpdatesAreVisible(int type) throws SQLException {
return metadata.othersUpdatesAreVisible(type);
}
public boolean othersDeletesAreVisible(int type) throws SQLException {
return metadata.othersDeletesAreVisible(type);
}
public boolean othersInsertsAreVisible(int type) throws SQLException {
return metadata.othersInsertsAreVisible(type);
}
public boolean updatesAreDetected(int type) throws SQLException {
return metadata.updatesAreDetected(type);
}
public boolean deletesAreDetected(int type) throws SQLException {
return metadata.deletesAreDetected(type);
}
public boolean insertsAreDetected(int type) throws SQLException {
return metadata.insertsAreDetected(type);
}
public boolean supportsBatchUpdates() throws SQLException {
return metadata.supportsBatchUpdates();
}
public ResultSet getUDTs(String catalog, String schemaPattern, String typeNamePattern, int[] types) throws SQLException {
return metadata.getUDTs(catalog, schemaPattern, typeNamePattern, types);
}
public Connection getConnection() throws SQLException {
return metadata.getConnection();
}
public boolean supportsSavepoints() throws SQLException {
return metadata.supportsSavepoints();
}
public boolean supportsNamedParameters() throws SQLException {
return metadata.supportsNamedParameters();
}
public boolean supportsMultipleOpenResults() throws SQLException {
return metadata.supportsMultipleOpenResults();
}
public boolean supportsGetGeneratedKeys() throws SQLException {
return metadata.supportsGetGeneratedKeys();
}
public ResultSet getSuperTypes(String catalog, String schemaPattern, String typeNamePattern) throws SQLException {
return metadata.getSuperTypes(catalog, schemaPattern, typeNamePattern);
}
public ResultSet getSuperTables(String catalog, String schemaPattern, String tableNamePattern) throws SQLException {
return metadata.getSuperTables(catalog, schemaPattern, tableNamePattern);
}
public ResultSet getAttributes(String catalog, String schemaPattern, String typeNamePattern, String attributeNamePattern) throws SQLException {
return metadata.getAttributes(catalog, schemaPattern, typeNamePattern, attributeNamePattern);
}
public boolean supportsResultSetHoldability(int holdability) throws SQLException {
return metadata.supportsResultSetHoldability(holdability);
}
public int getResultSetHoldability() throws SQLException {
return metadata.getResultSetHoldability();
}
public int getDatabaseMajorVersion() throws SQLException {
return metadata.getDatabaseMajorVersion();
}
public int getDatabaseMinorVersion() throws SQLException {
return metadata.getDatabaseMinorVersion();
}
public int getJDBCMajorVersion() throws SQLException {
return metadata.getJDBCMajorVersion();
}
public int getJDBCMinorVersion() throws SQLException {
return metadata.getJDBCMinorVersion();
}
public int getSQLStateType() throws SQLException {
return metadata.getSQLStateType();
}
public boolean locatorsUpdateCopy() throws SQLException {
return metadata.locatorsUpdateCopy();
}
public boolean supportsStatementPooling() throws SQLException {
return metadata.supportsStatementPooling();
}
public RowIdLifetime getRowIdLifetime() throws SQLException {
return metadata.getRowIdLifetime();
}
public ResultSet getSchemas(String catalog, String schemaPattern) throws SQLException {
return metadata.getSchemas(catalog, schemaPattern);
}
public boolean supportsStoredFunctionsUsingCallSyntax() throws SQLException {
return metadata.supportsStoredFunctionsUsingCallSyntax();
}
public boolean autoCommitFailureClosesAllResultSets() throws SQLException {
return metadata.autoCommitFailureClosesAllResultSets();
}
public ResultSet getClientInfoProperties() throws SQLException {
return metadata.getClientInfoProperties();
}
public ResultSet getFunctions(String catalog, String schemaPattern, String functionNamePattern) throws SQLException {
return metadata.getFunctions(catalog, schemaPattern, functionNamePattern);
}
public ResultSet getFunctionColumns(String catalog, String schemaPattern, String functionNamePattern, String columnNamePattern) throws SQLException {
return metadata.getFunctionColumns(catalog, schemaPattern, functionNamePattern, columnNamePattern);
}
public <T> T unwrap(Class<T> iface) throws SQLException {
return metadata.unwrap(iface);
}
public boolean isWrapperFor(Class<?> iface) throws SQLException {
return metadata.isWrapperFor(iface);
}
}
| [
"me@mikeivanov.com"
] | me@mikeivanov.com |
909025fb0bbb7d2c55ac86aeaf4fc16ef82f1dd0 | 90fa463b5b2d71a49e79ec78b1ba3000149c3f60 | /src/com/neftxx/interpreter/ast/statement/native_function/statistic/MedianFunction.java | 0ab286cff6c43f9175624a0f871f39fc5c025722 | [] | no_license | neftdev/arit-software | 3a40060919f37454c70eddd97ed9e33a919f05ee | 963e9c11d7ef425f60cad9a795e51be115f8f3c9 | refs/heads/master | 2022-11-25T09:04:49.469401 | 2020-04-02T03:50:07 | 2020-04-02T03:50:07 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,082 | java | package com.neftxx.interpreter.ast.statement.native_function.statistic;
import com.neftxx.interpreter.AritLanguage;
import com.neftxx.interpreter.ast.expression.Expression;
import com.neftxx.interpreter.ast.expression.structure.AritVector;
import com.neftxx.interpreter.ast.expression.structure.DataNode;
import com.neftxx.interpreter.ast.scope.Scope;
import com.neftxx.interpreter.ast.statement.native_function.NativeFunction;
import com.neftxx.interpreter.ast.statement.native_function.structure.ArrayFunction;
import com.neftxx.util.NodeInfo;
import org.jetbrains.annotations.NotNull;
import java.util.ArrayList;
public class MedianFunction extends NativeFunction {
private MedianFunction() {
super("median");
}
@Override
public Object interpret(NodeInfo info, AritLanguage aritLanguage, ArrayList<Expression> arguments, Scope scope) {
int argumentsSize = arguments.size();
this.type = TYPE_FACADE.getUndefinedType();
if (argumentsSize == 1) {
Expression expression = arguments.get(0);
Object resultExp = expression.interpret(aritLanguage, scope);
if (resultExp instanceof AritVector) {
AritVector vector = (AritVector) resultExp;
if (isNumeric(vector)) {
int i;
int size = vector.size();
double[] values = new double[size];
for (i = 0; i < size; i++) {
values[i] = toNumeric(vector.getDataNodes().get(i).value);
}
this.type = TYPE_FACADE.getVectorType();
double median = StatisticalOperations.calculateMedian(values);
return new AritVector(new DataNode(TYPE_FACADE.getNumericType(), median));
} else {
aritLanguage.addSemanticError("Error : se esperaba un vector de tipo numerico en la función `median()`.", info);
}
} else {
aritLanguage.addSemanticError("Error : se esperaba un vector de tipo numerico en la función `median()`.", info);
}
} else if (argumentsSize == 2) {
Expression expression = arguments.get(0);
Expression trimExpression = arguments.get(1);
Object resultExp = expression.interpret(aritLanguage, scope);
if (resultExp instanceof AritVector) {
AritVector vector = (AritVector) resultExp;
if (isNumeric(vector)) {
Object resultTrim = trimExpression.interpret(aritLanguage, scope);
if (resultTrim instanceof AritVector) {
AritVector vectorTrim = (AritVector) resultTrim;
if (isNumeric(vectorTrim)) {
double trim = toNumeric(vectorTrim.getDataNodes().get(0).value);
int i;
int size = vector.size();
double[] values = new double[size];
for (i = 0; i < size; i++) {
values[i] = toNumeric(vector.getDataNodes().get(i).value);
}
this.type = TYPE_FACADE.getVectorType();
double median = StatisticalOperations.calculateMedian(values, trim);
return new AritVector(new DataNode(TYPE_FACADE.getNumericType(), median));
} else {
aritLanguage.addSemanticError("Error en trim : se esperaba un vector de tipo numerico en la función `median()`.", info);
}
} else {
aritLanguage.addSemanticError("Error en trim : se esperaba un vector de tipo numerico en la función `median()`.", info);
}
} else {
aritLanguage.addSemanticError("Error : se esperaba un vector de tipo numerico en la función `median()`.", info);
}
} else{
aritLanguage.addSemanticError("Error : se esperaba un vector de tipo numerico en la función `median()`.", info);
}
} else {
aritLanguage.addSemanticError("Error : no se encontró la funcion median con la cantidad de parametros `" +
argumentsSize + "`.", info);
}
return null;
}
private boolean isNumeric(@NotNull AritVector vector) {
return TYPE_FACADE.isIntegerType(vector.baseType) || TYPE_FACADE.isNumericType(vector.baseType);
}
private double toNumeric(Object value) {
if (value instanceof Double) return (Double) value;
if (value instanceof Integer) return ((Integer) value).doubleValue();
return 0.0;
}
public static MedianFunction getInstance() {
return INSTANCE;
}
private static final MedianFunction INSTANCE = new MedianFunction();
@Override
public String toString() {
return super.toString();
}
}
| [
"ronaldnef1996@gmail.com"
] | ronaldnef1996@gmail.com |
12283a1af20bbba72b32145015defd5a03388428 | 0483c074e810e83aa41026b1ed79196b6144f904 | /app/src/androidTest/java/edu/quinnipiac/ser210/triviaapp/ExampleInstrumentedTest.java | 40a31f9895833967b4e31424a163adc8eb8ff258 | [] | no_license | KevinCouillard/SER_210_Assignment_2 | 19fb4b17619df88b6804ce6880f5790df741e76c | 023a8eb695493600542fa27ed86d9db4c2d36377 | refs/heads/master | 2023-03-29T10:41:00.224714 | 2021-04-01T04:10:45 | 2021-04-01T04:10:45 | 342,354,229 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 776 | java | package edu.quinnipiac.ser210.triviaapp;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented 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() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("edu.quinnipiac.ser210.triviaapp", appContext.getPackageName());
}
} | [
"rajanhephzibah@gmail.com"
] | rajanhephzibah@gmail.com |
647447656dca4b50bb6387a873d5be9e547e1da7 | 60aca39e5cd416199ed311eb03bb790279d3e9d1 | /src/main/java/org/biblioteca/controllers/HomeController.java | eece46accfc0533ccd7db932c875027c098b275f | [] | no_license | carloscubas/controlebiblioteca | bf1411a21182b396b7c8f7bc54ba3f326a8f9a2a | 793ee890012b883536617b66075f6040198a73af | refs/heads/master | 2021-01-25T00:56:36.755487 | 2017-06-18T21:38:10 | 2017-06-18T21:38:10 | 94,702,633 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 265 | java | package org.biblioteca.controllers;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
public class HomeController {
@RequestMapping("/")
public String index(){
return "index";
}
}
| [
"carlos.cubas@gmail.com"
] | carlos.cubas@gmail.com |
406b764b3a66ff17623df333d64caa35e55497a3 | e530abce738c2c9e6d9a25de4986b2a48691a3ec | /ChocolateBar.java | 9264dac643eed54f4b1134a607ab7ff3c45d3c83 | [] | no_license | HumairaTauqeer/java | 0dbe8226cc2f971f23d3093757e0e54efb76211a | 33adc6161de14b626d944277cd746e10ff1bc708 | refs/heads/main | 2023-07-16T09:17:14.633806 | 2021-08-30T15:01:51 | 2021-08-30T15:01:51 | 400,855,225 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,347 | java |
/**
* @ author - Humaira Tauqeer
* This programs asks user to input age, weight,
* height and sex, and calculates how many calories
* that user need to maintain their weight, and how many
* chocolate bars they can consume.
*/
//import scanner
import java.util.Scanner;
public class ChocolateBar {
public static void main(String[] args) throws Exception {
final int ChocBarCalories = 230;
// create scanner
Scanner Input = new Scanner(System.in);
System.out.printf("%s\n%s\n", "I am here to tell you how many chocolate bars", // welcome message
"you can consume in a day.");
System.out.println("Please provide some info below: ");
System.out.println("Enter your age in years: "); // user Input
// reading age
int age = Input.nextInt();
System.out.println("Enter your height in inches: "); // asking height
double height = Input.nextDouble(); // reading height
System.out.println("Enter your weight in pounds: "); // asking weight
double weight = Input.nextDouble(); // reading weight
System.out.println("spicify if you are a male or a female: "); // asking gender
String askSex = Input.next().toUpperCase(); // reading gender and converting it to upper case
// Creating enum
enum Sex {
MALE, FEMALE, OTHER
}
// creating if else statement for passing value to OTHER in enum
Sex sex = null;
if (askSex.equals("MALE") || askSex.equals("FEMALE")) {
sex = Sex.valueOf(askSex);
} else {
sex = Sex.OTHER;
// closing scanner
Input.close();
}
switch (sex) {
case FEMALE:
double WBMR = BMR1(height, weight, age); // passing argument to function BMR1
// output message
System.out.printf("You are a %d years old female with\n%.2f pounds weight, and %.2f inches height.\n"
+ "You need %.2f calories to maintain your weight.\n", age, weight, height, WBMR);
int recommendedChocolateBar1 = ChocBar1(WBMR, ChocBarCalories); // calculating number of chocolate bars
System.out.printf("You can consume %d chocolate bars in a day to maintain your weight. ",
recommendedChocolateBar1);
break;
case MALE:
double MBMR = BMR2(height, weight, age); // passing argument to function BMR2
System.out.printf("You are a %d years old male with\n%.2f pounds weight, and %.2f inches height.\n"
+ "You need %.2f calories to maintain your weight.\n", age, weight, height, MBMR);
int recommendedChocolateBar2 = ChocBar2(MBMR, ChocBarCalories); // calculating number of chocolate bars
// output message
System.out.printf("You can consume %d chocolate bars in a day to maintain your weight. ",
recommendedChocolateBar2);
break;
default: // output if anything other than male or female selected
System.out.println("Sorry, this program is designed for a Male or a Female.");
}
}
/**
* method for calculating woman BMI
* @param height
* @param weight
* @param age
* @return
*/
static double BMR1(double height, double weight, int age) {
return 655 + (4.3 * weight) + (4.7 * height) - (4.7 * age);
}
/**
* method for calculation chocolate bars for women
* @param WBMR
* @param ChocBarCalories
* @return
*/
static int ChocBar1(double WBMR, int ChocBarCalories) {
return (int) WBMR / ChocBarCalories;
}
/**
* method for calculating man BMI
* @param height
* @param weight
* @param age
* @return
*/
static double BMR2(double height, double weight, int age) {
return 66 + (6.3 * weight) + (12.9 * height) - (6.8 * age);
}
/**
* method for calculation chocolate bars for man
* @param MBMR
* @param ChocBarCalories
* @return
*/
static int ChocBar2(double MBMR, int ChocBarCalories) {
return (int) MBMR / ChocBarCalories;
}
}
| [
"noreply@github.com"
] | HumairaTauqeer.noreply@github.com |
d99c00b08f177ea277fd6fdcc82267698e1130fb | 8d11443fae7204bf7bbb1125b01ec67b25d09110 | /src/main/java/cn/gltzj/gc/FinalizeGC.java | 573ea404e4c7e2b47eac2f400ef1d339e185d11d | [] | no_license | guoleitao/java-core | f370293de2cd8bd16d112cb04dfc73a9f04c6718 | e729e90b3cffa67cba296e749be8af229c9ba068 | refs/heads/master | 2020-08-25T02:49:04.479087 | 2019-11-07T09:05:36 | 2019-11-07T09:05:36 | 216,950,581 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,254 | java | package cn.gltzj.gc;
/**
* finalize()测试点:
* 1.对象可以在GC时自我拯救
* 2.这种自救机会只有一次,因为一个对象的finalize()方法最多只会被系统调用一次
*/
public class FinalizeGC {
public static FinalizeGC inst = null;
public void isAlive() {
System.out.println("this is alive");
}
@Override
protected void finalize() throws Throwable {
super.finalize();
System.out.println("finalize is exe! ");
inst = this;
}
public static void main(String[] args) throws Exception {
inst = new FinalizeGC();
inst = null;
System.gc();
//finalize优先级低,此处等待0.5秒
Thread.sleep(500);
//此处inst不为null,并且finalize方法执行了
if(inst != null){
inst.isAlive();
}else{
System.out.println(" this is dead");
}
inst = null;
System.gc();
//finalize优先级低,此处等待0.5秒
Thread.sleep(500);
//此处inst为null,并且finalize方法未执行
if(inst != null){
inst.isAlive();
}else{
System.out.println(" this is dead");
}
}
}
| [
"guoleitao"
] | guoleitao |
2c3391267ef0388455d39db76641055688aa9d97 | ccbe67be171faddc75a628c612046f94697c63c0 | /euhusky-common/src/main/java/com/euhusky/common/util/ReferenceCache.java | ad3b2c04285b34a45968aa4976e8c50863c285d3 | [] | no_license | jinligen/euhusky | 8d36078946c4c99a00ed32475dad1b73753542ec | 073edda836ef0fe2ad77d485b91a2a39d3ce7580 | refs/heads/master | 2020-06-29T16:37:30.182520 | 2019-03-12T10:40:58 | 2019-03-12T10:40:58 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 469 | java | package com.euhusky.common.util;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
import com.euhusky.common.URL;
public class ReferenceCache {
private static final ConcurrentHashMap<String,List<URL>> serviceMap=new ConcurrentHashMap<String,List<URL>>();
public static List<URL> getReferences(String clss){
return serviceMap.get(clss);
}
public static void setReferences(String clss,List<URL> urls){
serviceMap.put(clss,urls);
}
}
| [
"2114517411@qq.com"
] | 2114517411@qq.com |
56b87fb0d3470c16c1c5d91c81095d4db05c54b5 | 5b2c309c903625b14991568c442eb3a889762c71 | /classes/com/sleepycat/b/i/e/j.java | f63fc95066866b2b50510ef5148b59a1f6304510 | [] | no_license | iidioter/xueqiu | c71eb4bcc53480770b9abe20c180da693b2d7946 | a7d8d7dfbaf9e603f72890cf861ed494099f5a80 | refs/heads/master | 2020-12-14T23:55:07.246659 | 2016-10-08T08:56:27 | 2016-10-08T08:56:27 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 904 | java | package com.sleepycat.b.i.e;
import com.sleepycat.b.i.f.b;
import java.util.concurrent.CountDownLatch;
public final class j
{
public final CountDownLatch a;
public final b b;
static
{
if (!i.class.desiredAssertionStatus()) {}
for (boolean bool = true;; bool = false)
{
c = bool;
return;
}
}
private j(i parami, b paramb)
{
if ((!c) && (paramb == null)) {
throw new AssertionError();
}
int i = paramb.b;
if (i == 0) {}
for (parami = null;; parami = new CountDownLatch(i))
{
this.a = parami;
this.b = paramb;
return;
}
}
public final int a()
{
if (this.a == null) {
return 0;
}
return (int)this.a.getCount();
}
}
/* Location: E:\apk\xueqiu2\classes-dex2jar.jar!\com\sleepycat\b\i\e\j.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | [
"1776098770@qq.com"
] | 1776098770@qq.com |
3acd99c3f10ebfb44eb95674d65186b9e822b957 | f2a0cc07ce0fe4befae5672c424f9fe500a45c92 | /src/main/java/ste/crypto/methods/hash/MD5.java | 0b6daa3553be4acbc9869f3995b13848ed427855 | [] | no_license | marklabenski/ste-java | 280172c7ca9243152e67d9654dddc09d0d47bf4c | 9616ecc3dce471f1808a6492d66f2eae10f01231 | refs/heads/master | 2020-12-30T11:52:57.484599 | 2017-08-23T17:41:36 | 2017-08-23T17:41:36 | 91,437,222 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,537 | java | package ste.crypto.methods.hash;
import ste.crypto.methods.AlgoMethodDescription;
import ste.crypto.methods.CryptoMethod;
import ste.crypto.methods.MethodOptionDescription;
import ste.crypto.settings.CryptoSettings;
import ste.crypto.transfer.TransferableCryptoDetails;
import java.security.MessageDigest;
import java.util.Arrays;
import java.util.HashMap;
/**
* MD5 implementation
*
* @author Mark Labenski
*/
public class MD5 extends AbstractMessageDigestMethod {
static {
CryptoMethod.requiredCryptoSettings = new HashMap<String, MethodOptionDescription>()
{
{
put("iterationCount", new MethodOptionDescription("Int"));
}
};
CryptoMethod.availableCryptoMethods = new HashMap<String, AlgoMethodDescription>()
{
{
put("hash", new AlgoMethodDescription(Arrays.asList("input"), "hashValue"));
}
};
}
@Override
public TransferableCryptoDetails hash(CryptoSettings cryptoSettings, String input) throws Exception {
MessageDigest md = MessageDigest.getInstance("MD5");
Integer iterationCount = Integer.parseInt(cryptoSettings.getStringOption("iterationCount"));
// hash the input as often as given in "iterationCount" option
for(Integer i = 0; i < iterationCount; i++) {
md.update(input.getBytes());
}
return new TransferableCryptoDetails("hashValue", this.convertDigestBytesToBase64String(md.digest()), cryptoSettings);
}
}
| [
"mark.labenski@gmail.com"
] | mark.labenski@gmail.com |
5ce99a17c3c2f0371a17e534597d1176aec28c93 | 73e1d9d6bdfff162150554222ec3d09b6c49a6ec | /app/src/main/java/ua/com/qbee/smscrypt/Message.java | f692903889ae0a8bfee9eafec3386ade7c7bb1ad | [] | no_license | wepp/SMSMessenger | e9e147c84ec5953fe8827ce0384ff657d3619575 | 9eb2397f5312ec86315235d6c6d8f5e0d1163a40 | refs/heads/master | 2021-01-21T10:19:45.059938 | 2017-04-04T06:27:13 | 2017-04-04T06:27:13 | 83,410,183 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,157 | java | package ua.com.qbee.smscrypt;
public class Message implements Comparable<Message> {
/**
* The content of the message
*/
String message;
long data;
/**
* boolean to determine, who is sender of this message
*/
boolean isMine;
/**
* boolean to determine, whether the message is a status message or not.
* it reflects the changes/updates about the sender is writing, have entered text etc
*/
boolean isStatusMessage;
/**
* Constructor to make a Message object
*/
private String id;
public Message(String message, boolean isMine, long data, String id) {
super();
this.data = data;
this.message = message;
this.isMine = isMine;
this.isStatusMessage = false;
this.setId(id);
}
/**
* Constructor to make a status Message object
* consider the parameters are swaped from default Message constructor,
* not a good approach but have to go with it.
*/
public Message(boolean status, String message, long data, String id) {
super();
this.data = data;
this.message = message;
this.isMine = false;
this.isStatusMessage = status;
this.setId(id);
}
public String getMessage() {
return message;
}
public long getData() {
return data;
}
public void setMessage(String message) {
this.message = message;
}
public boolean isMine() {
return isMine;
}
public void setMine(boolean isMine) {
this.isMine = isMine;
}
public boolean isStatusMessage() {
return isStatusMessage;
}
public void setStatusMessage(boolean isStatusMessage) {
this.isStatusMessage = isStatusMessage;
}
@Override
public int compareTo(Message m) {
if (data > m.data) return +1;
if (data < m.data) return -1;
return 0;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
}
| [
"noreply@github.com"
] | wepp.noreply@github.com |
caf2a38f1ef178eede0b4035cf131f3670468904 | b048b48937f5dbea33279d333f3ba43c1cbb2399 | /dubbo/provider/src/test/java/com/stude/provider/ProviderApplicationTests.java | 61bb7009dbb1571733d1b167e5236cc8528f5853 | [] | no_license | grakCat/myObject | a0a93a6fa6eaf0aa8168bcaba2ca3ec1921db79b | 0cd0ec446297219748b0a479226a42e8cf585d4a | refs/heads/master | 2020-05-04T06:05:15.836901 | 2019-04-16T23:49:38 | 2019-04-16T23:49:38 | 178,998,352 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 346 | java | package com.stude.provider;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest
public class ProviderApplicationTests {
@Test
public void contextLoads() {
}
}
| [
"591471019@qq.com"
] | 591471019@qq.com |
0b092908fb1a038dfbf8de93e3d575202e56d1fe | bb735f1b83981a95690962776486f87b68279f26 | /src/pattern/decorator/FourthGradeSchoolReport.java | acd28dd2ecf7397e04bee5e8bf72530cb79f29d7 | [] | no_license | Qionglou001/java-design-patterns | 8303e7f5a6c1f5ea4c594e2319ff3c9ecfcbc157 | 144c383680ddbe019f8cfec5b74da16a46a10953 | refs/heads/master | 2020-03-26T21:15:17.094657 | 2018-08-22T01:26:18 | 2018-08-22T01:26:18 | 145,377,260 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 348 | java | package pattern.decorator;
public class FourthGradeSchoolReport implements SchoolReport{
@Override
public void report() {
System.out.println("wangjianlou的成绩:语文60 数学60 自然60");
}
@Override
public void sign(String name) {
System.out.println("家长签名为:" + name);
}
}
| [
"Qionglou001@users.noreply.github.com"
] | Qionglou001@users.noreply.github.com |
8c5208e2b84b1343e7830c4214eefea70b1d9dd9 | 941036de2bf374c875434d5730480624d8ee7f99 | /src/main/java/com/styros/esales/controller/HomeController.java | 340fc43bb2c78397bf7b31c51514906a2d873e83 | [] | no_license | atsh111/esales | 04c8313f95e3e7af3419b5bf02b5996cb58a5e2f | 87f7ec0868e70c0129ef7a56e69b758039926934 | refs/heads/master | 2021-05-04T22:10:38.180157 | 2018-02-02T17:36:08 | 2018-02-02T17:36:08 | 120,010,293 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,749 | java | package com.styros.esales.controller;
import com.styros.esales.DataMapper;
import com.styros.esales.ViewModel.VMSalesLocation;
import com.styros.esales.entity.SaleslocationEntity;
import com.styros.esales.model.User;
import com.styros.esales.repository.RoutesRepository;
import com.styros.esales.repository.UsersRepository;
import com.styros.esales.service.SalesLocationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import javax.servlet.ServletRequest;
import java.util.ArrayList;
import java.util.List;
/**
* Created by atul on 11/30/2017.
*/
@Controller
public class HomeController {
@Autowired
UsersRepository usersRepository;
@Autowired
RoutesRepository routesRepository;
@Autowired
SalesLocationService salesLocationService;
@RequestMapping(value = "/login", method = RequestMethod.POST)
public String processLogin(ModelMap map, ServletRequest request, @RequestParam(name = "username") String username,
@RequestParam(name = "password") String password) {
UsernamePasswordAuthenticationToken authToken = new UsernamePasswordAuthenticationToken(username, password);
SecurityContextHolder.getContext().setAuthentication(authToken);
map.put("routes", routesRepository.findAll());
return "home";
}
@RequestMapping(value="/login",method = RequestMethod.GET)
public String login(){
return "index";
}
@RequestMapping(value="/login?error",method = RequestMethod.GET)
public String loginerror(ModelMap map){
map.put("error","invalid username or password.please try again");
return "index";
}
@RequestMapping(value = "/", method = RequestMethod.GET)
public String getDefault() {
return "index";
}
@RequestMapping("/home")
public String home(ModelMap modelMap) {
List<VMSalesLocation> locations =salesLocationService.get();
modelMap.put("locations",locations);
modelMap.put("routes", routesRepository.findAll());
return "home";
}
@RequestMapping("/assign")
public String assign(ModelMap modelMap) {
modelMap.put("routes", routesRepository.findAll());
return "assign";
}
} | [
"atshhonor5@gmail.com"
] | atshhonor5@gmail.com |
6a3b97e9bbeb3a7c49a0ad01094eec1301addfec | c2745516073be0e243c2dff24b4bb4d1d94d18b8 | /sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphWorkbookChartGridlines.java | 9a5f3ba6db4e9bad22a2217b893dca23c5074f62 | [
"MIT",
"LicenseRef-scancode-generic-cla",
"LicenseRef-scancode-warranty-disclaimer",
"BSD-3-Clause",
"CC0-1.0",
"Apache-2.0",
"LicenseRef-scancode-public-domain",
"BSD-2-Clause",
"LicenseRef-scancode-unknown-license-reference",
"LGPL-2.1-or-later"
] | permissive | milismsft/azure-sdk-for-java | 84b48d35e3fca8611933b3f86929788e5e8bceed | f4827811c870d09855417271369c592412986861 | refs/heads/master | 2022-09-25T19:29:44.973618 | 2022-08-17T14:43:22 | 2022-08-17T14:43:22 | 90,779,733 | 1 | 0 | MIT | 2021-12-21T21:11:58 | 2017-05-09T18:37:49 | Java | UTF-8 | Java | false | false | 3,662 | java | // Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.authorization.fluent.models;
import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.HashMap;
import java.util.Map;
/** workbookChartGridlines. */
@Fluent
public final class MicrosoftGraphWorkbookChartGridlines extends MicrosoftGraphEntity {
/*
* Boolean value representing if the axis gridlines are visible or not.
*/
@JsonProperty(value = "visible")
private Boolean visible;
/*
* workbookChartGridlinesFormat
*/
@JsonProperty(value = "format")
private MicrosoftGraphWorkbookChartGridlinesFormat format;
/*
* workbookChartGridlines
*/
@JsonIgnore private Map<String, Object> additionalProperties;
/**
* Get the visible property: Boolean value representing if the axis gridlines are visible or not.
*
* @return the visible value.
*/
public Boolean visible() {
return this.visible;
}
/**
* Set the visible property: Boolean value representing if the axis gridlines are visible or not.
*
* @param visible the visible value to set.
* @return the MicrosoftGraphWorkbookChartGridlines object itself.
*/
public MicrosoftGraphWorkbookChartGridlines withVisible(Boolean visible) {
this.visible = visible;
return this;
}
/**
* Get the format property: workbookChartGridlinesFormat.
*
* @return the format value.
*/
public MicrosoftGraphWorkbookChartGridlinesFormat format() {
return this.format;
}
/**
* Set the format property: workbookChartGridlinesFormat.
*
* @param format the format value to set.
* @return the MicrosoftGraphWorkbookChartGridlines object itself.
*/
public MicrosoftGraphWorkbookChartGridlines withFormat(MicrosoftGraphWorkbookChartGridlinesFormat format) {
this.format = format;
return this;
}
/**
* Get the additionalProperties property: workbookChartGridlines.
*
* @return the additionalProperties value.
*/
@JsonAnyGetter
public Map<String, Object> additionalProperties() {
return this.additionalProperties;
}
/**
* Set the additionalProperties property: workbookChartGridlines.
*
* @param additionalProperties the additionalProperties value to set.
* @return the MicrosoftGraphWorkbookChartGridlines object itself.
*/
public MicrosoftGraphWorkbookChartGridlines withAdditionalProperties(Map<String, Object> additionalProperties) {
this.additionalProperties = additionalProperties;
return this;
}
@JsonAnySetter
void withAdditionalProperties(String key, Object value) {
if (additionalProperties == null) {
additionalProperties = new HashMap<>();
}
additionalProperties.put(key, value);
}
/** {@inheritDoc} */
@Override
public MicrosoftGraphWorkbookChartGridlines withId(String id) {
super.withId(id);
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
@Override
public void validate() {
super.validate();
if (format() != null) {
format().validate();
}
}
}
| [
"noreply@github.com"
] | milismsft.noreply@github.com |
67c9c9819e22f4f3a54a7283653518b7118c82c1 | 394c3b1e13a12b07ce577d5de4dc629fd2fec549 | /mariotti-project/src/bdd/java/com/mariotti/project/bdd/steps/WhenICreateNewEmployee.java | 2ba06004185d9f05840d1a46c2e78d497460678d | [] | no_license | FrancescoMariotti/ATTSW-mariotti-project | 1f96837602c3c4b13d9105c165bc54f3ad9017a9 | 1213ab16d8ca4291f24ffbafd626f4e37adfa175 | refs/heads/master | 2022-12-04T07:54:13.023295 | 2020-08-19T14:50:06 | 2020-08-19T14:50:06 | 280,659,203 | 0 | 0 | null | 2020-08-19T14:50:08 | 2020-07-18T13:11:57 | Java | UTF-8 | Java | false | false | 701 | java | package com.mariotti.project.bdd.steps;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import com.tngtech.jgiven.Stage;
import com.tngtech.jgiven.annotation.ScenarioState;
public class WhenICreateNewEmployee extends Stage<WhenICreateNewEmployee> {
@ScenarioState
WebDriver driver;
@ScenarioState
String officeId;
public WhenICreateNewEmployee iCreateNewEmployee() {
driver.findElement(By.cssSelector("a[href*='/employees_office/" + officeId + "/new_employee")).click();
driver.findElement(By.name("name")).sendKeys("new employee");
driver.findElement(By.name("salary")).sendKeys("1000");
driver.findElement(By.name("btn_submit")).click();
return self();
}
}
| [
"mariotti.fra96@gmail.com"
] | mariotti.fra96@gmail.com |
bf55de0fa2b1e1abdf76e479967724cc88e0e8b9 | 04020b4f89cadc14ba2e5947b04e277b909159d7 | /src/fontRendering/FontRenderer.java | 1e57312b5f30e9c5150d7db91d0f0f375a6be579 | [] | no_license | kchow2/gameEngine | a8b2232ced6fc53bfbd0c44c794893d167eb6b40 | 8a9c7c5590c83014f87b36337b800d491e0b9bb3 | refs/heads/master | 2021-01-23T20:18:18.999844 | 2017-01-09T10:27:38 | 2017-01-09T10:27:38 | 51,228,144 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,898 | java | package fontRendering;
import java.util.List;
import java.util.Map;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL13;
import org.lwjgl.opengl.GL20;
import org.lwjgl.opengl.GL30;
import fontMeshCreator.FontType;
import fontMeshCreator.GuiText;
public class FontRenderer {
private FontShader shader;
public FontRenderer() {
shader = new FontShader();
}
/**
*
* @param fontType The font to render the text with. Will ignore the font type of each individual GuiText.
* @param texts a list of texts to render.
*/
public void renderTextBatch(FontType fontType, List<GuiText> texts){
prepare();
GL13.glActiveTexture(GL13.GL_TEXTURE0);
GL11.glBindTexture(GL11.GL_TEXTURE_2D, fontType.getTextureAtlas());
for(GuiText text:texts){
renderText(text);
}
endRendering();
}
public void render(Map<FontType, List<GuiText>> texts){
prepare();
for(FontType font : texts.keySet()){
GL13.glActiveTexture(GL13.GL_TEXTURE0);
GL11.glBindTexture(GL11.GL_TEXTURE_2D, font.getTextureAtlas());
for(GuiText text:texts.get(font)){
renderText(text);
}
}
endRendering();
}
public void cleanUp(){
shader.cleanUp();
}
private void prepare(){
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glDisable(GL11.GL_DEPTH_TEST);
shader.start();
}
private void renderText(GuiText text){
GL30.glBindVertexArray(text.getMesh());
GL20.glEnableVertexAttribArray(0);
GL20.glEnableVertexAttribArray(1);
shader.loadColour(text.getColour());
shader.loadTranslation(text.getPosition());
GL11.glDrawArrays(GL11.GL_TRIANGLES, 0, text.getVertexCount());
GL20.glDisableVertexAttribArray(0);
GL20.glDisableVertexAttribArray(1);
GL30.glBindVertexArray(0);
}
private void endRendering(){
shader.stop();
GL11.glDisable(GL11.GL_BLEND);
GL11.glEnable(GL11.GL_DEPTH_TEST);
}
}
| [
"kevinchow_23708@hotmail.com"
] | kevinchow_23708@hotmail.com |
ffeeebadc38d4d3d722d2e751455b262bf6df808 | 17be167566130b3a48f6832a7ae6446dd5d5085b | /src/main/java/com/example/blog/util/SpringUtils.java | 0263639d593d76ccf90a5c00b751ac67295b9987 | [] | no_license | Vowkin/SSMBlogPlus | 77359e4d52667d723f7266dfec9272dfa5707e91 | f79e69373e9b73a249b9debc5ce02c436bac1008 | refs/heads/master | 2023-04-30T20:02:09.015754 | 2021-05-09T10:12:58 | 2021-05-09T10:12:58 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,138 | java | package com.example.blog.util;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;
@Component
public class SpringUtils implements ApplicationContextAware {
private static ApplicationContext applicationContext;
@Override
public void setApplicationContext(ApplicationContext applicationContext)
throws BeansException {
if (SpringUtils.applicationContext == null) {
SpringUtils.applicationContext = applicationContext;
}
}
public static ApplicationContext getApplicationContext() {
return applicationContext;
}
//根据name
public static Object getBean(String name) {
return getApplicationContext().getBean(name);
}
//根据类型
public static <T> T getBean(Class<T> clazz) {
return getApplicationContext().getBean(clazz);
}
public static <T> T getBean(String name, Class<T> clazz) {
return getApplicationContext().getBean(name, clazz);
}
}
| [
"847064370@qq.com"
] | 847064370@qq.com |
e7b98f83c70fe1220355334d7cc2df440d7e1fb0 | 4ed16a99b12ee5a98a80518acb4df95d87f78c17 | /ui-tests/src/test/java/ee/netgroup/hm/helpers/Arrays.java | 7631d6b71b9d8b01e5d9e2ff306889139bb5ecb8 | [] | no_license | KatarinaNeff/Java-E2E-Page-Object-Model | 92337520d3c54896e082ebbe6482e0ae0b51bc0a | ba764cbc8f88c417f42f80a89cf6a04feb23526f | refs/heads/master | 2022-01-26T11:37:01.154400 | 2019-07-25T09:49:15 | 2019-07-25T09:49:15 | 83,555,437 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 17,509 | java | package ee.netgroup.hm.helpers;
import ee.netgroup.hm.tests.SeleniumUser;
public class Arrays extends SeleniumUser{
public static String[] portfolioTitlesArray = {"Language Arts", "Mathematics", "Science", "Health", "Handwriting", "Personal Organization",
"Physical Education (P.E.)", "Social Skills", "Career Planning", "Instrumental Music and specific instrument", "Movement or Eurythmy",
"Handwork or handcrafts", "Life Lab or gardening", "Dramatics", "Art", "Greek and Roman History", "Martial Arts", "Ice Skating",
"Music", "Dance", "Personal Finance and Investing", "Aerobics", "Yoga", "Figure skating", "Spanish or other foreign language", "Leadership",
"Special Education Day Class", "Driver�s Education", "Resource Program", "Statistics", "World Religions", "Cycling", "Bowling", "Keyboarding",
"Computer Repair", "Speech", "Adaptive P.E.", "Trigonometry", "Economics", "Physical Fitness", "Computer Graphics", "Occupational Therapy",
"Astronomy", "Political Science", "Digital Arts", "Photoshop", "Programming", "Reading", "Meteorology", "Equine Science", "Gymnastics",
"Outdoor Survival Skills", "Speech and Debate", "Animal Science", "Ecology", "Golf", "Rock Climbing", "Desktop Publishing", "English",
"Oceanography", "Veterinary Science", "Environmental Science", "Web Design", "Basic Math", "Botany", "Geology", "Forensic Science",
"Critical Thinking", "Rhetoric", "Pre-algebra", "Physics", "Chemistry", "Organic Chemistry", "Biology", "Zoology", "Basic Yard Care",
"Financial Management", "Consumer Math", "Small Engine Mechanics", "Auto Mechanics", "Marine Biology", "Algebra", "Geometry", "Gardening",
"Japanese", "German", "Latin", "Culinary Arts", "Life Science", "Earth Science", "Food Science", "Anthropology", "Home Management",
"Physical Science", "Computer Aided Design (Digital Media)", "Photography", "Home Organization", "Social Studies", "Performing Arts",
"Theatre Arts", "Genealogy", "Geography", "Ancient Civilizations", "Leather Working", "Philosophy", "Logic", "Medieval and Renaissance",
"Sports", "Sculpture", "Ceramics", "Pottery", "Music History", "Music Theory", "Music Fundamentals", "U.S. History and Government",
"French / Spanish / Latin", "Photojournalism", "Yearbook", "Art History", "Drawing", "Painting", "Computer Science or Lab", "Home Economics",
"Instrumental Music", "Band", "Choir", "Drama", "Physical Education", "Woodshop", "Metal Shop", "Business Technology", "English as second language",
"World Literature", "Ancient Literature", "Medieval Literature", "Renaissance Literature", "Modern Literature", "British Literature",
"American Literature", "Composition", "Creative Writing", "Poetry", "Grammar", "Vocabulary", "Debate", "Journalism", "Publishing Skills"};
public static String[] descriptionArray = {"The road to feminism is simple: it’s about awareness.",
"You know, fear is a funny thing on an investigation. There seems to be a difference between imagination running away from you, what you call “true fear”, and what I think could be the change in the environment from a spirit presence.",
"Her stories touch a raw nerve every woman will resonate with—about how hard it is for us to be taken seriously.",
"You learn to be inspired by challenges, not afraid of them.",
"When you get an adrenaline rush from cleaning your apartment.",
"The greatest gift is getting to be yourself day in and day out.", "More information within.",
"What matters now is who you are in this moment and what you’re doing right now.",
"Whenever I follow this rule, my life gets exponentially better very quickly.",
"Remind yourself that Churchill lead a country while battling depression.",
"A record number of murders have occurred in Anchorage this year, with over half of them unsolved.",
"When all else fails, just breathe. You are surviving. And sometimes, that is all you can do. And that’s ok.",
"In a Romeo and Juliet-esque situation, there was some kind of apparent feud between the family of the bride and groom.",
"When you have a lot to juggle, the most valuable thing in the world is energy.",
"Dreams are an aspiration of who we truly are. ", "It’s the least I can do. Keep the conversation going.",
"Perfection, the ultimate goal. We all want it. We chase it. And we’re disappointed when we don’t get there. ",
"This is not a political post. Or a revolutionary one. Or a socialist one. Or a whatever. It’s just facts. ",
"I am Bipolar, and I am capable – but this does not mean I want to be Bipolar. My disorder isn’t a means to an end, a method of manipulation, or a way to demand the attention of those around me.",
"School starts tomorrow, which means it’s time to say goodbye",
"The quality of your rest. This is the main determinant of your long-term productivity and efficiency of your work. Good rest is a concrete foundation and prerequisite for exceptional performance.",
"Here’s an unpopular truth: people who post less are actually those who lead amazing lives. And guess what? They don’t need to prove it.",
"Entry Level means years of experience. When you read the title “entry level” for a position, you automatically assume that this may be an option for you.",
"Music note: You know how to play at least one instrument, and you always have your earbuds in.",
"Nothing is worth it if you aren’t happy", "I woke up to the sound of knocking on glass. I assumed it was the window, but as I checked, I heard it again, from the mirror.",
"I think you should stop worrying about reasons why it won’t work and only focus on the reasons why it will.",
"New iPhones. Each new model is basically the same as the previous one", "Delete your time-wasting apps. The ones you always get stuck playing when you should be working.",
"New York City isn’t a magical place where you instantaneously find yourself.",
"Class of 2020, no matter where you are, stay focused and enjoy every moment. This isn’t just a phase. It’s your future, your dreams and your life.",
"How can you be sure that your red isn’t someone else’s blue?",
"There are plenty of fish in the sea, and as long as you keep focusing on you and your own growth, the right ones will come to you.",
"It’s okay to be scared. Being scared means we’re concerned enough to realize that there might be something wrong, that there might be something worth fixing.",
"Most people are not strategic. They are reactive."};
public static String[] materialTitlesArray = {"ALTERNATE UNIVERSE", "ALIEN RACE OF COLORED WAX", "TRENDING PURPLE", "AFRICAN CONGLOMERATE", "AFRAID OF THE FUTURE",
"AGE OF AQUARIUS", "AGORAPHOBIA", "ABANDON IN PLACE", "ABSOLUTE PANIC", "ACCORDING TO HINDU MYTH", "AKEELAH AND THE BEE", "ALIENS ARE COMING",
"ALL ABOUT THE OWLS", "ALL NIGHT LONG", "ALL THINGS CONSIDERED", "THE ALLEGORY OF THE TRILOBITE", "ALTERNATIVE ENERGY SOURCES", "ALWAYS DELICIOUS",
"AN APPLE A DAY", "ANAGRAMS", "ANCIENT CHINESE SECRET", "ANTI STAR TREK", "APOLLO 1", "ARCHITECTURAL STRUCTURE", "BACK IN TIME", "BALLROOM DANCING",
"BAPHOMET", "BE LIKE NEWTON", "BERSERKERS", "BEYOND THE MECHANICAL UNIVERSE", "BOILING WATER", "CAN-DO ATTITUDE", "CANADIAN EDEN", "CATALYST",
"CIVIL PROTECTION", "COLD SALVATION", "COMPARE AND CONTRAST", "COSMIC RAYS", "COSTUMES FROM CATS", "THE CRISIS ON INFINITE EARTHS", "DAYLIGHT SAVINGS TIME",
"DEEP IMPACT", "DEEP SPACE AMBASSADOR", "DEFINITELY YES", "DEFORMITY", "DEFYING PHYSICAL LAW", "DIAGONALIZATION", "DNA DOESN'T LIE", "DNA EVIDENCE",
"DRAWING THE LINE", "DREAM BLENDER", "EGYPTIAN STORK", "ENOUGH WITH THE ZOMBIES", "ERGONOMIC KEYBOARD", "EVERY SNOWFLAKE IS DIFFERENT", "FALLOUT SHELTER",
"FREEDOM ISN'T FREE", "FROM THE MIND OF MINOLTA", "FROSTY THE SNOWMAN", "GENDER ROLES", "GENERIC NAMES", "GLOBAL GEOPOLITICS IN THE THERMONUCLEAR AGE",
"GLOBAL WARMING", "GRAPES OF WRATH", "GREAT THINGS ABOUT BEING", "HEAVY METAL POISONING", "HINDU LABYRINTH", "HOLIDAY DECORATIONS", "HOME INVASION",
"IDEAS WORTH", "THE IMPACT ON JUPITER", "IMAGINE THE POSSIBILITIES", "INSIDE MACINTOSH", "INTELLIGENT DESIGN", "JIGSAW PUZZLE", "LIKE A FOUNTAIN",
"LILITH FAIR", "THE LION IN WINTER", "LOCKED BOX", "LOCKER ROOM", "LOGIC GATES", "LONDON KEYS", "LORD ALIVE", "LORD OF THE RINGS GOES COMMERCIAL",
"LUNAR ECLIPSE", "LYING ABOUT AT LEAST ONE OF THESE THINGS", "MAGNETIC NORTH", "MAKE IT END", "MAN IN THE MOON", "MASS EFFECT CONCLUSION", "MATH IS HARD",
"MAY DAY", "A MAZE OF TWISTY LITTLE PASSAGES", "MAZE TIME","MEDITATION RETREAT", "MENTAL HEALTH BREAK", "MERCURY ORBITZ", "MILLION MAN MARCH",
"MISSED HALLOWEEN", "MORE THAN YOU COULD POSSIBLY BELIEVE", "MOST DISTURBING UNIVERSE", "MOUNTAIN DEW PYRAMID", "THE NASA UNICORN", "NATURE'S GOLD",
"NEED TO KNOW BASIS","NEPTUNE SPEAKS", "NEURODIVERSE CULTURE", "A NEW BARYON HAS BEEN DISCOVERED", "NIGHT LANDING", "NOT A FIGHTER", "NUCLEAR SECRETS",
"OCEAN SOUNDS", "OLD SCHOOL", "ONE OF THESE DAYS", "OPENING STATEMENT", "OPEN WINDOWS", "OPTICAL ILLUSION", "OUT OF THE CELLAR", "PART OF THE SOLUTION",
"PERSONAL TIME MACHINE", "PHONE BOOTH", "PLUTO SYMBOL", "POLAR VORTEX", "POSSIBLE RADIATION HAZARD", "PROTESTER CHANT", "PROTESTING THE WAR",
"RADIO TELESCOPE", "THE RAINDROP REVOLUTION", "READING RAINBOW", "RELIGIOUS TOLERANCE", "RIGHT THING, WRONG NAME", "ROOT CAUSES", "SAMURAI'S PRIDE",
"SCIENTIFIC METHOD", "SEARCHING NEAR AND FAR", "SELF-INVOKING GODWIN'S LAW", "SEMANTIC ARGUMENTS", "SET IT FREE", "SEWING MACHINE", "SKEPTICAL ACTIVIST",
"SOCIAL NETWORKS", "STAIRWAY TO HEAVEN", "STAY GREEN", "STILL LIFE", "STOPPING TRAFFIC", "TACTICAL INTERVENTION", "TEMPORAL PRIME DIRECTIVE",
"TEST DRIVE", "THIRD ROCK FROM THE SUN", "THOSE BEES", "TIGER WOODS","TIME ZONES", "TO THE LIONS", "TORTURE DEVICE", "TRUE FORM", "UNBELIEVABLE TOOL",
"VISITING JAPAN", "WE ARE COLOR BLIND", "WE MUST BELIEVE IN MAGIC", "WHAT BUGS IS HOLDING", "WHAT TO DO IN THE EVENT OF A BIOLOGICAL ATTACK",
"WILD THING", "WORDS ARE HARD", "WRATH OF THE KING", "WRONG DIRECTION", "YODA REMINISCES"};
public static String[] firstNamesArray = {"Amina", "Alfred", "Alma", "Almond", "Alvin", "Amanda", "Anastasia", "Ash", "Ashley", "Audrey", "Bailey", "Ballard",
"Barbara", "Barclay", "Bartley", "Beatrice", "Beverly", "Aisha", "Akela", "Blossom", "Boston", "Bradley", "Brandon", "Byron", "Camellia", "Camilla",
"Cannon", "Cassandra", "Abbigail", "Adelle", "Agatha", "Aliah", "Alison", "Alix", "Anna", "Belynda", "Djamila", "Beth", "Bridget", "Briony", "Brianna",
"Cara", "Cedar'", "Charis", "Charleen", "Chloe", "Chris", "Cilla", "Clara", "Cornelia", "Cressida", "Dakota", "Danielle", "Daphne", "Darian", "Deborah",
"Denice", "Gamila", "Diana", "Dina", "Donna", "Dorean", "Ebony", "Eda", "Eden", "Edith", "Eireen", "Eleanor", "Hala", "Elba", "Hana", "Elfrida", "Ella",
"Eliza", "Elly", "Elmira", "Eloise", "Elvina", "Emelie", "Emerald", "Emmy", "Erica", "Erin", "Eve", "Fay", "Ismat", "Flor", "Frea", "Jamila", "Gabi",
"Gabriella", "Gaila", "Geena", "Gemma", "Gwendolen", "Harper", "Haven", "Hazel", "Kismat", "Laila", "Helga", "Lamia", "Latifa", "Ida", "Layla", "Leena",
"Lina", "Idelle", "Ilean", "India", "Malika", "Irma", "Irmagard", "Irene", "Iris", "Irma", "Isabel", "Isadora", "Isolde", "Iva", "Ivy", "Jade", "Jane",
"Jasmin", "Jemma", "Jennifer", "Jinny", "Nora", "Julia", "June", "Karly", "Kelly", "Kenzie", "Keisha", "Kiara", "Kim", "Ranya", "Kimberly", "Klara",
"Ladonna", "Lacy", "Lana", "Lara", "Laura", "Laureen", "Laura", "Lea", "Leanna", "Lee", "Lenora", "Leona", "Lilian", "Lilith", "Linda", "Sameera",
"Lindsay", "Lora", "Loreen", "Sana", "Lyda", "Mabella", "Lyssa", "Madalyn", "Maddie", "Madge", "Shakira", "Maddison", "Mae", "Marcie", "Marian", "Tahira",
"Mariel", "Marta", "Thalulah", "Melicent", "Thamina", "Meredith", "Milla", "Mira", "Miriam", "Mona", "Mya", "Nadia", "Natalie", "Nelle", "Nicole", "Yasmin",
"Nina", "Noah", "Olive", "Ophelia", "Paula", "Retha", "Rhonda", "Zara", "Riona", "Rosa", "Rosheen", "Roxane", "Amal", "Amber", "Rubie", "Sabina", "Elham",
"Sabrina", "Salome", "Iesha", "Samantha", "Ishtar", "Saranna", "Lila", "Scarlet", "Selina", "Shania", "Shannon", "Oma", "Sheree", "Sofia", "Rihanna",
"Saffron", "Stepfanie", "Sybilla", "Tara", "Thea", "Tiana", "Tiara", "Trish", "Uma", "Valarie", "Vanessa", "Vianne", "Virginia", "Yolanda", "Zoe", "Aaron",
"Adam", "Aleena", "Alika", "Alma", "Alvina", "Adrian", "Alban", "Alen", "Amelia", "Alex", "Alfie", "Allan", "Allister", "Aston", "Barret", "Bart", "Bennet",
"Bradley", "Brennan", "Brian", "Anousha", "Brooke", "Bruno", "Ariana", "Aribah", "Cedric", "Chad", "Chandler", "Clifton", "Arya", "Colin", "Dallas", "Dan",
"Dalton", "Daniel", "Dave", "David", "Dean", "Deon", "Earl", "Eamon", "Eber", "Edwin", "Elbie", "Elden", "Eliah", "Eliot", "Chandi", "Elvin", "Emil",
"Emmet", "Esmond", "Evan", "Fabian", "Fred", "Gabriel", "Gail", "Gareth", "George", "Gerry", "Eliza", "Gilbert", "Glen", "Gordon", "Ermina", "Graham",
"Griffin", "Hank", "Hardy", "Harry", "Harvey", "Hartley", "Haward", "Hecktor", "Herman", "Holden", "Humbert", "Imanuel", "Ingram", "Isador", "Jack",
"James", "Jared", "Jason", "Jeff", "Joel", "John", "Joseph", "Julian", "Kay", "Keith", "Kendall", "Kenneth", "Kent", "Kevin", "Kian", "Kimberley",
"Lambart", "Lanford", "Lark", "Larry", "Lenard", "Lennie", "Leon", "Leroi", "Lester", "Lewis", "Lionel", "Lucas", "Malone", "Mark", "Marlon", "Marvin",
"Mason", "Matthias", "Max", "Mayson", "Melvin", "Merlin", "Milton", "Monty", "Morrissey", "Murphy", "Nash", "Ned", "Neil", "Neo", "Nevil", "Nick", "Noel",
"Nolan", "Norman", "Norton", "Oberon", "Oliver", "Patrick", "Paul", "Percy", "Peter", "Maysa", "Phil", "Ralph", "Randy", "Raymond", "Redd", "Mishel",
"Richard", "Mona", "Rocky", "Rolland", "Roman", "Ronald", "Ross", "Nadia", "Ryan", "Samuel", "Sander", "Sean", "Simon", "Nargis", "Stan", "Stephen",
"Steve", "Taylor", "Thomas", "Tim", "Tommie", "Travis", "Troy", "Tyron", "Vergil", "Victor", "Vincent", "Walter", "William", "Wilmot", "Sonia"};
public static String[] surnamesArray = {"Smith", "Hall", "Stewart", "Johnson", "Allen", "Bennett", "Morris", "Wood", "Brown", "King", "Ross", "Davis", "Miller",
"Morgan", "Coleman", "Hill", "Bell", "Moore", "Murphy", "Taylor", "Green", "Bailey", "Powell", "Adams", "Long", "River", "Baker", "White", "Nelson",
"Carter", "Howard", "Martin", "Mitchell", "Simmons", "Gray", "Foster", "Lewis", "Collins", "Hayes", "Kelly", "Evans", "Ryan", "Graham", "Gibbs", "Hoffman",
"Shelton", "Griffin", "York", "Berry", "Blair", "Lyon", "Russo", "Finch", "Maxwell", "Fanning", "Clifford", "Black", "Underwood", "Pearson", "Craig",
"Lane", "Norris", "Donnelly", "May", "Finn", "Dalton", "Garrett", "Newman", "Chandler", "Melton", "Baxter", "Hill", "Carter", "Leblanc", "Larsen", "Snow",
"Lloyd", "Day", "Lamont", "Flores", "Zion", "Woody", "Wolf", "Winston", "Wilton", "Topher", "Trafford", "Vortigern", "Walker", "Wayne", "Weston", "Shannon",
"Shelby", "Shelton", "Sherwood", "Sky", "Storm", "Taffy", "Tyrrell", "Thomas", "Ray", "Rigby", "Ronald", "Ross", "Ruby"};
public static String[] tagsArray = {"life", "school", "followback", "art", "fashion", "sky", "beauty", "noir", "ink", "design", "craft", "beatles", "antique",
"monoart", "architect", "linedesign", "style", "classical", "vintage", "vector", "focus", "exposure", "usa", "sport", "brand", "fancy", "france", "bag",
"free", "musthave", "look", "foundation", "lookbook", "december", "every", "can", "people", "movingforward", "decoration", "cold", "morning", "sleepy",
"plot", "story", "readinglist", "imagine", "trip", "festival", "instrument", "musicnotes", "key", "rock", "mozart", "green", "summer", "reflection",
"sand", "seaside", "landscape", "bloom", "mountains", "ocean", "skyfall", "cloud9", "outside", "worldwide", "winter", "forest", "fall", "foliage", "orange",
"crowd", "team", "workout", "yoga", "geometry", "composition", "urban", "grammar", "home", "music", "done", "friends", "reality", "algebra", "workshop",
"more", "unknown", "future", "contest", "famous", "addict", "memories", "road", "motivation", "plants", "textbook", "abstract", "acorn", "acronym",
"ad lib", "adept", "adobe", "aeon", "aerostat", "africa", "agenda", "agile", "aircraft", "alpha"};
public static String[] mediaTitlesArray = {"Game of as rest time eyes with of this it.", "Add was music merry any truth since going.",
"Happiness she ham but instantly put departure propriety.", "She amiable all without say spirits shy clothes morning.",
"Frankness in extensive to belonging improving so certainty.", "Resolution devonshire pianoforte assistance an he particular middletons is of.",
"Explain ten man uncivil engaged conduct.", "Am likewise betrayed as declared absolute do.", "Taste oh spoke about no solid of hills up shade.",
"Occasion so bachelor humoured striking by attended doubtful be it.", "Unpacked now declared put you confined daughter improved.",
"Celebrated imprudence few interested especially reasonable off one.", "Wonder bed elinor family secure met.",
"It want gave west into high no in.", "Depend repair met before man admire see and.", "An he observe be it covered delight hastily message.",
"Margaret no ladyship endeavor ye to settling."};
}
| [
"katarina.neff@netgroup.ee"
] | katarina.neff@netgroup.ee |
f576421b3b8837dd05013e5e343accda57f10acb | 30b26a2af1214a30c1bd111b3a48cab5e4fc4fd4 | /src/ImageListener.java | 7cc274c8ec22b4f19d48f3bf0b358771632908e3 | [] | no_license | chouney/data_collection | 0d0bac54f6d5db980bc130023912819d00b44f35 | a3b12f7c9fd400a039070502a8762ff2662f442e | refs/heads/master | 2021-01-20T08:06:48.360140 | 2017-07-15T04:44:24 | 2017-07-15T04:44:24 | 90,098,173 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,536 | java | import com.jhlabs.image.ImageUtils;
import com.jhlabs.image.InvertFilter;
import com.jhlabs.image.PixelUtils;
import com.leapmotion.leap.*;
import com.leapmotion.leap.Frame;
import com.leapmotion.leap.Image;
import javax.imageio.ImageIO;
import javax.imageio.stream.FileImageOutputStream;
import javax.swing.*;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.awt.image.ImageObserver;
import java.awt.image.ImageProducer;
import java.io.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.ThreadLocalRandom;
import com.jhlabs.*;
import draw.LeapPanel;
/**
* Created by manatea on 2016/10/27.
*/
public class ImageListener extends Listener {
LeapPanel leapPanel;
JFrame jf;
public static int count = 0;
public void onConnect(Controller controller) {
System.out.println("Connected ");
jf = new JFrame();
leapPanel = new LeapPanel();
jf.setSize(640, 240);
jf.add(leapPanel);
jf.setVisible(true);
jf.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
super.onConnect(controller);
}
public void onImages(Controller controller) {
Frame frame = controller.frame();
if (frame.isValid()) {
ImageList images = frame.images();
Image image = images.get(0);
// for (Image image : images) {
byte[] data = image.data();
int[] rgb = new int[data.length];
for (int i = 0; i < image.width() * image.height(); i++) {
int r = (data[i] & 0xFF) << 16; //convert to unsigned and shift into place
int g = (data[i] & 0xFF) << 8;
int b = data[i] & 0xFF;
rgb[i] = r | g | b;
}
BufferedImage bufferedImage = (BufferedImage) leapPanel.createImage(image.width(), image.height());
bufferedImage.setRGB(0, 0, image.width(), image.height(), rgb, 0, image.width());
try {
ImageIO.write(bufferedImage,"jpg",new File("picture"+count+++".jpg"));
if(count == 100){
count = 0;
}
} catch (IOException e) {
e.printStackTrace();
}
// System.out.println(image.width());
// System.out.println(image.height());
leapPanel.repaint(bufferedImage);
// }
}
}
}
| [
"manatea.bupt.edu.cn"
] | manatea.bupt.edu.cn |
d2f5ef17b49ed3b81deaa95e74c00b2c24a760c8 | ae98e07377e0dc838e46b69f9317499d8f3cdc6e | /jdbc-study2/src/test/TestMemberDAO3.java | 96f8dfe68dd2e4dcb1a2e4cd42af205eb50d340b | [] | no_license | prisml/jdbc-kosta | 98195be06ad09511bd3a2ed131af9d77bbe7352c | 3eaa5ddcdc05d9205d7302a304a04341a5341bbf | refs/heads/master | 2021-01-11T13:29:19.219903 | 2017-02-16T00:40:36 | 2017-02-16T00:40:36 | 81,508,523 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 450 | java | package test;
import java.sql.SQLException;
import java.util.ArrayList;
import model.MemberDAO;
import model.MemberVO;
public class TestMemberDAO3 {
public static void main(String[] args) {
try {
MemberDAO dao = new MemberDAO();
ArrayList<MemberVO> list = dao.getAllMemberList();
for(int i=0;i<list.size();i++)
System.out.println(list.get(i));
} catch (ClassNotFoundException | SQLException e) {
e.printStackTrace();
}
}
}
| [
"prisml@nate.com"
] | prisml@nate.com |
4986d3f1144286f14a65dbfc55c888bdbe06829e | c7d4097945e3cfd3ef5f19d34ced4764d22d845b | /src/main/java/tk/ainiyue/danyuan/application/user/userrole/dao/SysUserRolesDao.java | 57bfa06ca147ef9208cbb9d863feeae0b6538e6b | [
"Apache-2.0"
] | permissive | mengpengfei/danyuan-application | 721fd9fa26d731476b92f0a9988f2bc6d44945ac | 18fc4380e13ca6a6dc15e79df7da8ab48268357c | refs/heads/master | 2021-05-15T06:14:37.300072 | 2017-11-28T09:28:21 | 2017-11-28T09:28:21 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 640 | java | package tk.ainiyue.danyuan.application.user.userrole.dao;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;
import tk.ainiyue.danyuan.application.user.userrole.po.SysUserRolesInfo;
/**
* 文件名 : SysUserRolesDao.java
* 包 名 : tk.ainiyue.admin.userrole.dao
* 描 述 : TODO(用一句话描述该文件做什么)
* 机能名称:
* 技能ID :
* 作 者 : Tenghui.Wang
* 时 间 : 2016年7月17日 下午3:58:31
* 版 本 : V1.0
*/
@Repository("sysUserRolesDao")
public interface SysUserRolesDao extends CrudRepository<SysUserRolesInfo, String> {
}
| [
"514840279@qq.com"
] | 514840279@qq.com |
d59d223d9e4046358af4bbd86cd39539fb0254ae | 608f19e0377b4dfd1fdc26b46681171ad9401603 | /helloWorld/src/main/java/com/example/helloWorld/config/ApplicationContextConfig.java | f3fd2e8deea0b967ddc5102c8b67f46721aec2d6 | [] | no_license | dodovelo96/Java-Spring | ef21c6afaced2f6e730db4a4a4da115a61f67aa4 | 8fe7bec3310e781452b0c1c925923014393b901e | refs/heads/master | 2023-07-18T13:48:25.718050 | 2021-09-01T10:31:01 | 2021-09-01T10:31:01 | 402,020,399 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 737 | java | /**
*
*/
package com.example.helloWorld.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.view.InternalResourceViewResolver;
/**
* @author anhmi
*
*/
@Configuration
@ComponentScan("com.example.helloWorld.*")
public class ApplicationContextConfig {
@Bean(name = "viewResolver")
public InternalResourceViewResolver getViewResolver() {
InternalResourceViewResolver viewResolver = new InternalResourceViewResolver();
viewResolver.setPrefix("/WEB-INF/pages/");
viewResolver.setSuffix(".jsp");
return viewResolver;
}
} | [
"anhnm@d2t.vn"
] | anhnm@d2t.vn |
a6d1f5dd21523242202abe60a9f87000a91f8742 | 4c1cab1459d66d04bcd613ee0ad0481a0650f521 | /app/src/main/java/com/zhuandian/trade/business/ReleaseMessageActivity.java | f7233ff18df1083ce4c3f4e69f6706dca463d09e | [] | no_license | xiedong11/school-trade | fbb6deacdcec48545e86dd5967794eabf3ccd5d6 | 35e310b72e50a5b00ee18361eac23d8fee1763da | refs/heads/master | 2021-12-21T15:56:09.784245 | 2020-05-12T06:00:45 | 2020-05-12T06:00:45 | 247,271,879 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,140 | java | package com.zhuandian.trade.business;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.RadioButton;
import android.widget.TextView;
import android.widget.Toast;
import com.zhuandian.base.BaseActivity;
import com.zhuandian.trade.R;
import com.zhuandian.trade.entity.MessageEntity;
import com.zhuandian.trade.entity.UserEntity;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import cn.bmob.v3.BmobUser;
import cn.bmob.v3.exception.BmobException;
import cn.bmob.v3.listener.SaveListener;
public class ReleaseMessageActivity extends BaseActivity {
@BindView(R.id.iv_back)
ImageView ivBack;
@BindView(R.id.tv_title)
TextView tvTitle;
@BindView(R.id.tv_right)
TextView tvRight;
@BindView(R.id.et_message_title)
EditText etMessageTitle;
@BindView(R.id.et_message_content)
EditText etMessageContent;
@BindView(R.id.rb_type_1)
RadioButton rbType1;
@BindView(R.id.rb_type_2)
RadioButton rbType2;
@BindView(R.id.rb_type_3)
RadioButton rbType3;
@BindView(R.id.tv_release)
TextView tvRelease;
private int messageType = 1; //1.失误招领 2.寻物启事,3,系统消息
@Override
protected int getLayoutId() {
return R.layout.activity_release_message;
}
@Override
protected void setUpView() {
}
@OnClick({R.id.iv_back, R.id.rb_type_1, R.id.rb_type_2, R.id.rb_type_3, R.id.tv_release})
public void onViewClicked(View view) {
switch (view.getId()) {
case R.id.iv_back:
finish();
break;
case R.id.rb_type_1:
messageType = 1;
break;
case R.id.rb_type_2:
messageType = 2;
break;
case R.id.rb_type_3:
messageType = 3;
break;
case R.id.tv_release:
addNewMessage();
break;
}
}
private void addNewMessage() {
String messageTitle = etMessageTitle.getText().toString();
String messageContent = etMessageContent.getText().toString();
if (TextUtils.isEmpty(messageContent) || TextUtils.isEmpty(messageTitle)) {
Toast.makeText(this, "发布内容不允许为空...", Toast.LENGTH_SHORT).show();
return;
}
MessageEntity messageEntity = new MessageEntity();
messageEntity.setTitle(messageTitle);
messageEntity.setContent(messageContent);
messageEntity.setType(messageType);
messageEntity.setUserEntity(BmobUser.getCurrentUser(UserEntity.class));
messageEntity.save(new SaveListener<String>() {
@Override
public void done(String s, BmobException e) {
if (e == null) {
Toast.makeText(ReleaseMessageActivity.this, "发布成功", Toast.LENGTH_SHORT).show();
ReleaseMessageActivity.this.finish();
}
}
});
}
}
| [
"xiedong11@aliyun.com"
] | xiedong11@aliyun.com |
f5f2a99a1d3d220fd797e921a321ff6e052e0801 | a42e75f4f7ebb1984af84bb1c0fd9dd68d16495a | /app/src/androidTest/java/www/nabil/tugasmobile2/ExampleInstrumentedTest.java | b3116d9ed1a2076e3f747c4994335e0e3543f92b | [] | no_license | nabilfitrah/tpm-pertemuan-2 | 9aa415a928a23ba75b8dd94e0eb420ba2a5c14a0 | 01c656ab0ebc7c8a42fe235b346dde19c64d1f22 | refs/heads/master | 2021-01-03T18:17:02.387074 | 2020-02-13T05:29:19 | 2020-02-13T05:29:19 | 240,183,382 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 760 | java | package www.nabil.tugasmobile2;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented 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() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("www.nabil.tugasmobile2", appContext.getPackageName());
}
}
| [
"mnabilf310@gmail.com"
] | mnabilf310@gmail.com |
2d9a1f21b0ff59825d72104b0f6b83e1b5039d24 | ed9a746556f7816f916c2ff7490b882231949a71 | /app/src/main/java/com/jason/experiment/somecoinapp/model/global/GlobalResponse.java | 8d2e0ebdf23cbf79863263361995b9ac00121f36 | [] | no_license | JasonKSLoh/SomeCoinApp | e852c1cf592b1a47517ad0acf1646084256d0a28 | bc84a2d97ab2875c1039ca2705d90748cfe2493a | refs/heads/master | 2020-03-18T08:56:33.523417 | 2018-05-23T09:02:54 | 2018-05-23T09:02:54 | 134,536,176 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,079 | java | package com.jason.experiment.somecoinapp.model.global;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
/**
* GlobalResponse
* Created by jason.
*/
public class GlobalResponse {
@SerializedName("globalStatus")
@Expose
private GlobalStatus globalStatus;
@SerializedName("globalDatum")
@Expose
private GlobalDatum globalDatum;
@SerializedName("globalMetadata")
@Expose
private GlobalMetadata globalMetadata;
public GlobalStatus getGlobalStatus() {
return globalStatus;
}
public void setGlobalStatus(GlobalStatus globalStatus) {
this.globalStatus = globalStatus;
}
public GlobalDatum getGlobalDatum() {
return globalDatum;
}
public void setGlobalDatum(GlobalDatum globalDatum) {
this.globalDatum = globalDatum;
}
public GlobalMetadata getGlobalMetadata() {
return globalMetadata;
}
public void setGlobalMetadata(GlobalMetadata globalMetadata) {
this.globalMetadata = globalMetadata;
}
}
| [
"jasonloh@nets.com.sg"
] | jasonloh@nets.com.sg |
a59d4da5c302928985a56da0127e196bf8085524 | 2b554c46349d636018fa72dfe96fb99454fbc3c7 | /spring-system/src/main/java/com/longer/service/organization/impl/MoveOrganization.java | 2db64a099fede93d9349624e5e0c32d2b4508a08 | [] | no_license | liuxiaolonger/spring-demo | 8ac8a56014c4df6a5e077b27a0e1e5d36ba1cf0c | 434c004c4abdc6f3e3834987f8b67cd15986b197 | refs/heads/master | 2022-07-12T18:15:42.337307 | 2019-12-01T05:36:51 | 2019-12-01T05:36:51 | 178,666,430 | 0 | 0 | null | 2022-06-29T17:48:51 | 2019-03-31T09:18:01 | Java | UTF-8 | Java | false | false | 2,247 | java | package com.longer.service.organization.impl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;
import com.etoc.exception.ChannelException;
import com.etoc.util.StringUtil;
import com.longer.base.SysMoveService;
import com.longer.dao.model.SysOrganization;
import com.longer.service.organization.AbsOrganizationService;
import com.longer.service.organization.vo.Organization;
/**
*
* .修改组织机构
* <功能详细描述>
*
* @author chuyh
* @version [版本号, 2019年1月7日]
* @see [相关类/方法]
* @since [产品/模块版本]
*/
@Service("moveOrganization")
@Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE)
public class MoveOrganization extends AbsOrganizationService implements SysMoveService
{
private final Logger logger = LoggerFactory.getLogger(getClass());
/*
* 待修改的对象
*/
private Organization organization;
/*
* 主键
*/
private String id;
protected MoveOrganization setObject(Organization organization)
{
this.organization = organization;
return this;
}
protected MoveOrganization addQueryId(String id)
{
this.id = id;
return this;
}
@Override
public void execute()
throws Exception
{
logger.info("进入修改执行器");
//修改组织机构
if (organization==null || StringUtil.isEmpty(id))
{
throw new ChannelException("参数异常!!!");
}
//给对象主键赋值
organization.setOrganizationId(id);
SysOrganization model = transferObjectFields(organization, SysOrganization.class, null);
int result = sysOrganizationMapper.updateByPrimaryKeySelective(model);
logger.info("修改组织机构影响的条数为: {}",result);
if (result == 0)
{
logger.error("修改组织机构时操作数据库异常!");
throw new ChannelException("修改组织机构时操作数据库异常!");
}
}
}
| [
"896846152@qq.com"
] | 896846152@qq.com |
4f8859459ff1c5e89db19d6c537ba125813190a3 | d2eee6e9a3ad0b3fd2899c3d1cf94778615b10cb | /PROMISE/archives/ant/1.5/org/apache/tools/ant/taskdefs/Untar.java | afcc3af5e4ff9cf86f145c28b2b9c666a5a439ec | [] | no_license | hvdthong/DEFECT_PREDICTION | 78b8e98c0be3db86ffaed432722b0b8c61523ab2 | 76a61c69be0e2082faa3f19efd76a99f56a32858 | refs/heads/master | 2021-01-20T05:19:00.927723 | 2018-07-10T03:38:14 | 2018-07-10T03:38:14 | 89,766,606 | 5 | 1 | null | null | null | null | UTF-8 | Java | false | false | 5,038 | java | package org.apache.tools.ant.taskdefs;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Project;
import org.apache.tools.tar.TarInputStream;
import org.apache.tools.tar.TarEntry;
import org.apache.tools.ant.util.FileUtils;
import java.io.File;
import java.io.FileInputStream;
import java.io.BufferedInputStream;
import java.io.InputStream;
import java.io.IOException;
import java.util.zip.GZIPInputStream;
import org.apache.tools.bzip2.CBZip2InputStream;
import org.apache.tools.ant.types.EnumeratedAttribute;
/**
* Untar a file.
* <p>For JDK 1.1 "last modified time" field is set to current time instead of being
* carried from the archive file.</p>
* <p>PatternSets are used to select files to extract
* <I>from</I> the archive. If no patternset is used, all files are extracted.
* </p>
* <p>FileSet>s may be used used to select archived files
* to perform unarchival upon.
* </p>
* <p>File permissions will not be restored on extracted files.</p>
* <p>The untar task recognizes the long pathname entries used by GNU tar.<p>
*
* @author <a href="mailto:stefan.bodewig@epost.de">Stefan Bodewig</a>
* @author Magesh Umasankar
*
* @since Ant 1.1
*
* @ant.task category="packaging"
*/
public class Untar extends Expand {
/**
* compression method
*/
private UntarCompressionMethod compression = new UntarCompressionMethod();
/**
* Set decompression algorithm to use; default=none.
*
* Allowable values are
* <ul>
* <li>none - no compression
* <li>gzip - Gzip compression
* <li>bzip2 - Bzip2 compression
* </ul>
*
* @param method compression method
*/
public void setCompression(UntarCompressionMethod method) {
compression = method;
}
protected void expandFile(FileUtils fileUtils, File srcF, File dir) {
TarInputStream tis = null;
try {
log("Expanding: " + srcF + " into " + dir, Project.MSG_INFO);
tis = new TarInputStream(
compression.decompress(srcF,
new BufferedInputStream(
new FileInputStream(srcF))));
TarEntry te = null;
while ((te = tis.getNextEntry()) != null) {
extractFile(fileUtils, srcF, dir, tis,
te.getName(), te.getModTime(), te.isDirectory());
}
log("expand complete", Project.MSG_VERBOSE);
} catch (IOException ioe) {
throw new BuildException("Error while expanding " + srcF.getPath(),
ioe, location);
} finally {
if (tis != null) {
try {
tis.close();
} catch (IOException e) {}
}
}
}
/**
* Valid Modes for Compression attribute to Untar Task
*
*/
public static final class UntarCompressionMethod
extends EnumeratedAttribute {
/**
* No compression
*/
private static final String NONE = "none";
/**
* GZIP compression
*/
private static final String GZIP = "gzip";
/**
* BZIP2 compression
*/
private static final String BZIP2 = "bzip2";
/**
* Constructor
*/
public UntarCompressionMethod() {
super();
setValue(NONE);
}
/**
* Get valid enumeration values
*
* @return valid values
*/
public String[] getValues() {
return new String[] { NONE, GZIP, BZIP2 };
}
/**
* This method wraps the input stream with the
* corresponding decompression method
*
* @param file provides location information for BuildException
* @param istream input stream
* @return input stream with on-the-fly decompression
* @exception IOException thrown by GZIPInputStream constructor
* @exception BuildException thrown if bzip stream does not
* start with expected magic values
*/
private InputStream decompress(final File file,
final InputStream istream)
throws IOException, BuildException {
final String value = getValue();
if (GZIP.equals(value)) {
return new GZIPInputStream(istream);
} else {
if (BZIP2.equals(value)) {
final char[] magic = new char[] { 'B', 'Z' };
for (int i = 0; i < magic.length; i++) {
if (istream.read() != magic[i]) {
throw new BuildException(
"Invalid bz2 file." + file.toString());
}
}
return new CBZip2InputStream(istream);
}
}
return istream;
}
}
}
| [
"hvdthong@github.com"
] | hvdthong@github.com |
713c94ae44c02161c66ad1813339ba00744856ed | 20591524b55c1ce671fd325cbe41bd9958fc6bbd | /service-consumer/src/main/java/com/rongdu/loans/loan/option/SLL/Applydetail.java | fcb98de1571f2d74b5b6524563a50394f64e8d92 | [] | no_license | ybak/loans-suniu | 7659387eab42612fce7c0fa80181f2a2106db6e1 | b8ab9bfa5ad8be38dc42c0e02b73179b11a491d5 | refs/heads/master | 2021-03-24T01:00:17.702884 | 2019-09-25T15:28:35 | 2019-09-25T15:28:35 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,586 | java | package com.rongdu.loans.loan.option.SLL;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import java.io.Serializable;
/**
* Auto-generated: 2018-12-06 17:2:2
*
* @author www.jsons.cn
* @website http://www.jsons.cn/json2java/
*/
@Data
public class Applydetail implements Serializable {
private static final long serialVersionUID = -5470564217952763499L;
@JsonProperty("application_amount")
private String applicationAmount;
@JsonProperty("loan_apply_term")
private int loanApplyTerm;
@JsonProperty("user_id")
private String userId;
@JsonProperty("bureau_user_name")
private String bureauUserName;
@JsonProperty("user_name")
private String userName;
@JsonProperty("user_education")
private String userEducation;
@JsonProperty("is_op_type")
private String isOpType;
@JsonProperty("corporate_flow")
private String corporateFlow;
@JsonProperty("operating_year")
private String operatingYear;
@JsonProperty("user_social_security")
private String userSocialSecurity;
@JsonProperty("work_period")
private String workPeriod;
@JsonProperty("user_income_by_card")
private String userIncomeByCard;
@JsonProperty("time_enrollment")
private String timeEnrollment;
@JsonProperty("school_name")
private String schoolName;
@JsonProperty("monthly_average_income")
private String monthlyAverageIncome;
@JsonProperty("phone_number_house")
private String phoneNumberHouse;
@JsonProperty("ip_address")
private String ipAddress;
} | [
"tiramisuy18@163.com"
] | tiramisuy18@163.com |
f330da2d9e0da3e80359d710b929b997e2ca38f9 | 61c6164c22142c4369d525a0997b695875865e29 | /middleware/src/main/java/com/spirit/general/session/TipoEmpleadoSessionRemote.java | 5948a46137d041dd0bb0eb624c07b693b3031a59 | [] | no_license | xruiz81/spirit-creacional | e5a6398df65ac8afa42be65886b283007d190eae | 382ee7b1a6f63924b8eb895d4781576627dbb3e5 | refs/heads/master | 2016-09-05T14:19:24.440871 | 2014-11-10T17:12:34 | 2014-11-10T17:12:34 | 26,328,756 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 210 | java | package com.spirit.general.session;
import javax.ejb.Remote;
/**
*
* @author www.versality.com.ec
*
*/
@Remote
public interface TipoEmpleadoSessionRemote extends TipoEmpleadoSessionService {
}
| [
"xruiz@creacional.com"
] | xruiz@creacional.com |
61abfe3fc7158a981fd158f4107a5da7c7c6071e | 24f19db45903546996cda7d736e42ef7f3addeba | /DISEASEANALYTICS/app/src/main/java/com/example/sravani164/diseaseanalytics/Asthma.java | 2dd207a08c218598c7306e4b37e6e31d57194532 | [] | no_license | chandrasravani/Mini-Project | 0385927eb4bbd7a6855aa9f8aa5792966063f414 | 653a7e6c4eebc8580889c095ee4d1089b6f8d820 | refs/heads/master | 2021-01-13T05:36:05.881318 | 2017-06-22T10:19:34 | 2017-06-22T10:19:34 | 95,102,996 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 543 | java | package com.example.sravani164.diseaseanalytics;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
public class Asthma extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_asthma);
}
public void Mast(View v){
Intent i=new Intent(this,Asthma_Medicine.class);
startActivity(i);
}
}
| [
"sravaninamala164@gmail.com"
] | sravaninamala164@gmail.com |
672beb778fd26c4824a9960725b113ea19752591 | 583389fd306a587618d4f9710470143f3a905a24 | /src/sort/QuickSort.java | 1c29e2cc681472d981264ecc144c9bea09406153 | [] | no_license | dream-cool/algorithm | c2fe1797037f4d4ff8c9ebbcb4d470785d0e7463 | ba32e35bbb220e96626e0e7ffed9b913b927e47e | refs/heads/master | 2021-06-24T12:00:30.591864 | 2021-01-05T03:47:15 | 2021-01-05T03:47:15 | 193,831,869 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,087 | java | package sort;
import java.util.Arrays;
/**
* @ Author :clt.
* @ Date :Created in 19:11 2019/7/2
*/
public class QuickSort {
public static void main(String[] args) {
int[] arr1 = {165, 6, 23, 798, 15, 649, 13, 496};
int[] arr = {10, 78, 0, 23, -567, 0};
int[] arr2 = new int[100];
for (int i = 0; i < 100; i++) {
arr2[i] = (int) (Math.random() * 100);
}
System.out.println(Arrays.toString(arr2));
quickSort2(arr, 0, arr.length - 1);
System.out.println(Arrays.toString(arr2));
}
public static void quickSort2(int[] arr,int left, int right) {
int l = left; //左下标
int r = right; //右下标
//pivot 中轴值
int pivot = arr[(left + right) / 2];
int temp = 0; //临时变量,作为交换时使用
//while循环的目的是让比pivot 值小放到左边
//比pivot 值大放到右边
while( l < r) {
//在pivot的左边一直找,找到大于等于pivot值,才退出
while( arr[l] < pivot) {
l += 1;
}
//在pivot的右边一直找,找到小于等于pivot值,才退出
while(arr[r] > pivot) {
r -= 1;
}
//如果l >= r说明pivot 的左右两的值,已经按照左边全部是
//小于等于pivot值,右边全部是大于等于pivot值
if( l >= r) {
break;
}
//交换
temp = arr[l];
arr[l] = arr[r];
arr[r] = temp;
//如果交换完后,发现这个arr[l] == pivot值 后移
if(arr[l] == pivot) {
r -= 1;
}
//如果交换完后,发现这个arr[r] == pivot值 前移
if(arr[r] == pivot) {
l += 1;
}
}
// 如果 l == r, 必须l++, r--, 否则为出现栈溢出
if (l == r) {
l += 1;
r -= 1;
}
//向左递归
if(left < r) {
quickSort(arr, left, r);
}
//向右递归
if(right > l) {
quickSort(arr, l, right);
}
}
public static void quickSort(int[] arr, int left, int right) {
int l = left;
int r = right;
int middle = arr[(right + left)/2];
int m = (right+left)/2;
int temp = 0;
while (left < right) {
while (arr[left] <= middle && left < m){
left++;
}
while (arr[right] >= middle && right > m){
right--;
}
if (left >= right){
break;
}
temp = arr[right];
arr[right] = arr[left];
arr[left] = temp;
}
if (left == right){
left++;
right--;
}
if (l < right){
quickSort(arr, l, right);
}
if (r > left){
quickSort(arr, left, r);
}
System.out.println(Arrays.toString(arr));
}
public static void quickSort1(int[] arr, int left, int right) {
int l = left;
int r = right;
int base = arr[l];
int temp = 0;
while (left < right) {
while (arr[left] < base){
left++;
}
while (arr[right] > base){
right--;
}
if (left == right){
if (base > arr[left]){
temp = arr[right];
arr[right] = arr[left];
arr[left] = temp;
}
left++;
right--;
} else {
temp = arr[right];
arr[right] = arr[left];
arr[left] = temp;
}
}
if (l < right){
quickSort1(arr, l, right);
}
if (r > left){
quickSort1(arr, left, r);
}
System.out.println(Arrays.toString(arr));
}
}
| [
"1142170725@qq.com"
] | 1142170725@qq.com |
999fd80d25e8f059989987f5bb6806bd79ef4c3a | 7cfbcbc0b47722b535a94785826032abc8ca011f | /application.db.modules/address.book/src/test/java/address/book/service/CountriesBusinessServiceTest.java | 237214ccf13a5da5fc928441b39fa41b03196cb5 | [] | no_license | jimmyMaci/turbo-sansa | 2838ebb021d319a7c4e3ac7ae2bcdeb69ba8f274 | 23416d1d267edd847247f7213f2f7583e1b990f1 | refs/heads/master | 2022-07-14T00:14:31.628055 | 2022-06-30T11:25:20 | 2022-06-30T11:25:20 | 26,208,979 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 16,640 | java | package address.book.service;
import java.io.File;
import java.io.IOException;
import java.net.MalformedURLException;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import net.sourceforge.jaulp.file.read.ReadFileUtils;
import net.sourceforge.jaulp.file.search.PathFinder;
import net.sourceforge.jaulp.file.write.WriteFileUtils;
import net.sourceforge.jaulp.random.RandomUtils;
import net.sourceforge.jaulp.xml.XmlUtils;
import org.jgeohash.GeoHashPoint;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.testng.AbstractTestNGSpringContextTests;
import org.testng.annotations.Test;
import address.book.application.geocoding.Geocoder;
import address.book.application.model.GeoPointZipcode;
import address.book.factories.AddressBookFactory;
import address.book.init.GermanZipcodeBean;
import address.book.model.Addresses;
import address.book.model.Countries;
import address.book.model.Federalstates;
import address.book.model.Zipcodes;
import address.book.service.api.AddressesService;
import address.book.service.api.CountriesService;
import address.book.service.api.FederalstatesService;
import address.book.service.api.ZipcodesService;
@ContextConfiguration(locations = "classpath:test-applicationContext.xml")
public class CountriesBusinessServiceTest extends
AbstractTestNGSpringContextTests {
@Autowired
private CountriesService countriesService;
@Autowired
private ZipcodesService zipcodesService;
@Autowired
private AddressesService addressesService;
@Autowired
private FederalstatesService federalstatesService;
@Test(enabled = false)
public void testFindUsers() {
Map<String, List<String>> map = countriesService
.getCountriesToZipcodesAsStringMap();
for (Entry<String, List<String>> entry : map.entrySet()) {
String country = entry.getKey();
if (0 < entry.getValue().size()) {
System.out.println(country);
for (String zipcode : entry.getValue()) {
System.out.println(zipcode);
}
System.out
.println("=====================================================");
System.out
.println("=====================================================");
System.out
.println("=====================================================");
}
}
System.out.println(map);
}
@Test(enabled = false)
public void testNotProcessed() throws MalformedURLException, IOException {
File processedDir = getProcessedDir();
List<Zipcodes> notProcessed = new ArrayList<Zipcodes>();
File npZipcodesFile = new File(processedDir, "npZipcodes.xml");
String notPrZipcodes = ReadFileUtils.readFromFile(npZipcodesFile);
notProcessed = XmlUtils.toObjectWithXStream(notPrZipcodes);
System.out.println("Not processed zipcodes:" + notProcessed.size());
for (Zipcodes zc : notProcessed) {
System.out.println(zc.getZipcode() + " " + zc.getCity());
}
}
@SuppressWarnings("static-access")
@Test(enabled = false)
public void getGeoHashCodesWithGermanZipcodes()
throws MalformedURLException, IOException {
File processedDir = getProcessedDir();
List<Zipcodes> processed = new ArrayList<Zipcodes>(
findExistingZipcodesFromAddresses());
System.out.println("Already processed:" + processed.size());
List<Zipcodes> notProcessed = new ArrayList<Zipcodes>();
File npZipcodesFile = new File(processedDir, "npZipcodes.xml");
processed = new ArrayList<Zipcodes>(findExistingZipcodesFromAddresses());
Countries germany = countriesService.find("SK");
List<Zipcodes> germanZipcodes = zipcodesService.find(germany);
germanZipcodes.removeAll(processed);
String notPrZipcodes = ReadFileUtils.readFromFile(npZipcodesFile);
notProcessed = XmlUtils.toObjectWithXStream(notPrZipcodes);
System.out.println("Not processed:" + notProcessed.size());
germanZipcodes.removeAll(notProcessed);
int count = 1;
System.out.println("Left to process:" + germanZipcodes.size());
for (int i = 0; i < 2800; i++) {
Zipcodes zc = germanZipcodes.get(i);
Addresses address;
address = addressesService.contains(zc);
GeoHashPoint point = null;
if (address == null) {
point = Geocoder.getGeocodingData(zc);
if (point == null) {
notProcessed.add(zc);
continue;
}
} else {
continue;
}
try {
address = addressesService.contains(point.getLat().toString()
.trim(), point.getLng().toString().trim());
} catch (Exception e1) {
notProcessed.add(zc);
continue;
}
if (address == null) {
address = AddressBookFactory.getInstance().newAddresses(null,
null, point.getGeohash(), point.getLat(),
point.getLng(), null, null, zc);
addressesService.merge(address);
System.out.println((count++) + "). " + zc.getZipcode() + " "
+ zc.getCity());
}
try {
Thread.currentThread().sleep(
RandomUtils.randomIntBetween(1000, 1500));
} catch (InterruptedException e) {
e.printStackTrace();
}
}
String xmlNP = XmlUtils.toXmlWithXStream(notProcessed);
WriteFileUtils.string2File(npZipcodesFile, xmlNP);
}
public Set<Zipcodes> findExistingZipcodesFromAddresses() {
List<Addresses> addresses = addressesService.findAll();
Set<Zipcodes> processed = new HashSet<Zipcodes>();
for (Addresses address : addresses) {
Zipcodes zc = address.getZipcode();
if (zc != null) {
processed.add(address.getZipcode());
}
}
return processed;
}
@SuppressWarnings("static-access")
@Test(enabled = false)
public void saveGeoZipcodesToFile() throws IOException {
File processedDir = getProcessedDir();
File geoZipcodesFile = new File(processedDir, "geoZipcodes.xml");
List<Zipcodes> processed = new ArrayList<Zipcodes>(
findExistingZipcodesFromAddresses());
System.out.println("Already processed:" + processed.size());
List<Zipcodes> notProcessed = getNotProcessedList();
List<Zipcodes> countryZipcodes = zipcodesService.findAll();
countryZipcodes.removeAll(processed);
System.out.println("Not processed:" + notProcessed.size());
List<GeoPointZipcode> geopoints = new ArrayList<GeoPointZipcode>();
countryZipcodes.removeAll(notProcessed);
int iterations = 2600;
if(countryZipcodes.size() < iterations){
iterations = countryZipcodes.size();
} int count = 1;
try {
for (int i = 0; i < iterations; i++) {
int c = i + 1;
System.out.println(c + ").loop");
Zipcodes zc = countryZipcodes.get(i);
Addresses address;
address = addressesService.contains(zc);
GeoHashPoint point = null;
GeoPointZipcode geopoint = null;
if (address == null) {
point = Geocoder.getGeocodingData(zc);
if (point == null) {
notProcessed.add(zc);
continue;
}
geopoint = new GeoPointZipcode(zc, point);
System.out.println((count++) + "). " + zc.getZipcode()
+ " " + zc.getCity());
} else {
continue;
}
try {
address = addressesService.contains(point.getLat()
.toString().trim(), point.getLng().toString()
.trim());
} catch (Exception e1) {
continue;
}
if (geopoint != null) {
geopoints.add(geopoint);
}
try {
Thread.currentThread().sleep(
RandomUtils.randomIntBetween(1000, 1500));
} catch (InterruptedException e) {
e.printStackTrace();
}
}
} catch (Exception e) {
e.printStackTrace();
}
String xmlNP = XmlUtils.toXmlWithXStream(notProcessed);
WriteFileUtils.string2File(getNotProcessedFile(), xmlNP);
String xmlGeoPoints = XmlUtils.toXmlWithXStream(geopoints);
WriteFileUtils.string2File(geoZipcodesFile, xmlGeoPoints);
System.out.println("Finished at:"
+ new Date(System.currentTimeMillis()));
}
private File getProcessedDir() {
File smr = PathFinder.getSrcMainResourcesDir();
File processedDir = PathFinder.getRelativePath(smr, "zipcodes",
"processed");
return processedDir;
}
@Test(enabled = false)
public void loadFromGeoZipcodesFileAndSaveToDb() throws IOException {
File processedDir = getProcessedDir();
File zipcodesFile = new File(processedDir, "zipcodes.xml");
List<Zipcodes> processed = new ArrayList<Zipcodes>(
findExistingZipcodesFromAddresses());
File geoZipcodesFile = new File(processedDir, "geoZipcodes.xml");
List<GeoPointZipcode> geoPointZipcodes = getGeoPointZipcodesList();
int count = 1;
System.out.println("geoPointZipcodes size is:"
+ geoPointZipcodes.size());
for (int i = 0; i < geoPointZipcodes.size(); i++) {
GeoPointZipcode geoPointZipcode = geoPointZipcodes.get(i);
Zipcodes zc = geoPointZipcode.getZipcode();
GeoHashPoint point = geoPointZipcode.getGeoHashPoint();
Addresses address;
address = addressesService.contains(zc);
if (address == null) {
address = AddressBookFactory.getInstance().newAddresses(null,
null, point.getGeohash(), point.getLat(),
point.getLng(), null, null, zc);
System.out.println((count++) + "). " + zc.getZipcode() + " "
+ zc.getCity());
addressesService.merge(address);
}
processed.add(zc);
}
String xml = XmlUtils.toXmlWithXStream(processed);
WriteFileUtils.string2File(zipcodesFile, xml);
String xmlGeo = XmlUtils.toXmlWithXStream(geoPointZipcodes);
WriteFileUtils.string2File(geoZipcodesFile, xmlGeo);
System.out.println("Finished at:"
+ new Date(System.currentTimeMillis()));
}
@Test(enabled = false)
public void testDeleteDuplicateEntries() {
List<Zipcodes> allZipcodes = zipcodesService.findAll();
int size = allZipcodes.size();
System.out.println(size);
for (int i = 0; i < size; i++) {
Zipcodes zc = allZipcodes.get(i);
List<Addresses> addresses = addressesService.find(zc);
for (int j = 1; j < addresses.size(); j++) {
System.out.println(zc.getZipcode() + " " + zc.getCity());
Addresses addr = addressesService.get(addresses.get(j).getId());
addr.setZipcode(null);
addr.setFederalstate(null);
addressesService.merge(addr);
addressesService.delete(addr);
}
}
}
@Test(enabled = true)
public void getLatestNotProcessedZipcodes(){
List<Zipcodes> processed = new ArrayList<Zipcodes>(
findExistingZipcodesFromAddresses());
Countries germany = countriesService.find("SK");
List<Zipcodes> allGermanZipcodes = zipcodesService.findAll(germany,
null, null);
allGermanZipcodes.removeAll(processed);
String xmlNP = XmlUtils.toXmlWithXStream(allGermanZipcodes);
WriteFileUtils.string2File(getNotProcessedFile(), xmlNP);
}
private List<GermanZipcodeBean> getGermanZipcodeBeanList()
throws IOException {
File smr = PathFinder.getSrcMainResourcesDir();
File deDir = PathFinder.getRelativePath(smr, "zipcodes",
"de");
File germanZipcodesXmlFile = new File(deDir, "GermanZipcodes.xml");
String notPrZipcodes = ReadFileUtils.readFromFile(germanZipcodesXmlFile);
List<GermanZipcodeBean> list = XmlUtils.toObjectWithXStream(notPrZipcodes);
return list;
}
private List<Zipcodes> getNotProcessedList()
throws IOException {
File npZipcodesFile = getNotProcessedFile();
String notPrZipcodes = ReadFileUtils.readFromFile(npZipcodesFile);
List<Zipcodes> notProcessed = XmlUtils.toObjectWithXStream(notPrZipcodes);
return notProcessed;
}
private File getNotProcessedFile() {
File processedDir = getProcessedDir();
File npZipcodesFile = new File(processedDir, "npZipcodes.xml");
return npZipcodesFile;
}
private List<GeoPointZipcode> getGeoPointZipcodesList() throws IOException {
File processedDir = getProcessedDir();
File geoZipcodesFile = new File(processedDir, "geoZipcodes.xml");
String geoZipcodes = ReadFileUtils.readFromFile(geoZipcodesFile);
List<GeoPointZipcode> geoPointZipcodes = XmlUtils
.toObjectWithXStream(geoZipcodes);
return geoPointZipcodes;
}
@Test(enabled = false)
protected void verifyZipcodes() throws IOException {
// alien id, native id
Map<String, String> federalStateMap = new HashMap<String, String>();
federalStateMap.put("08", "2631");// Baden-Württemberg
federalStateMap.put("09", "2632");// Bayern
federalStateMap.put("11", "2633");// Berlin
federalStateMap.put("12", "2634");// Brandenburg
federalStateMap.put("04", "2635");// Bremen
federalStateMap.put("02", "2636");// Hamburg
federalStateMap.put("06", "2637");// Hessen
federalStateMap.put("13", "2638");// Mecklenburg-Vorpommern
federalStateMap.put("03", "2639");// Niedersachsen
federalStateMap.put("05", "2640");// Nordrhein-Westfalen
federalStateMap.put("07", "2641");// Rheinland-Pfalz
federalStateMap.put("10", "2642");// Saarland
federalStateMap.put("14", "2643");// Sachsen
federalStateMap.put("15", "2644");// Sachsen-Anhalt
federalStateMap.put("01", "2645");// Schleswig-Holstein
federalStateMap.put("16", "2646");// Thüringen
List<GermanZipcodeBean> list = getGermanZipcodeBeanList();
Countries germany = countriesService.find("DE");
for (GermanZipcodeBean bean : list) {
String zipcode = bean.getZipcode();
String federalStateKey = bean.getFederalStateKey();
Addresses address = addressesService.findFirst(germany, zipcode);
if(address != null) {
Integer id = Integer.valueOf(federalStateMap.get(federalStateKey));
Federalstates federalstate = federalstatesService.get(id);
address = addressesService.get(address.getId());
System.out.println(id);
address.setFederalstate(federalstate);
addressesService.merge(address);
}
}
}
@Test(enabled = false)
public void verifyNotProcessed() throws IOException {
List<GermanZipcodeBean> list = getGermanZipcodeBeanList();
Map<String, GermanZipcodeBean> zipcodeToBeanMap = new HashMap<String, GermanZipcodeBean>();
for (GermanZipcodeBean germanZipcodeBean : list) {
zipcodeToBeanMap.put(germanZipcodeBean.getZipcode(), germanZipcodeBean);
}
List<Zipcodes> npZipcodes = getNotProcessedList();
System.out.println("Not processed:" + npZipcodes.size());
int count = 0;
for (Zipcodes zipcode : npZipcodes) {
if(zipcodeToBeanMap.containsKey(zipcode.getZipcode())){
count++;
System.out.println(zipcode.getZipcode()+ " "+ zipcode.getCity());
}
}
System.out.println("count:"+count);
}
@Test(enabled = false)
public void fillNotProcessedZipcodesWithGeocodeData() throws IOException {
List<Zipcodes> npZipcodes = getNotProcessedList();
System.out.println("Not processed:" + npZipcodes.size());
List<Zipcodes> newNpZipcodes = new ArrayList<Zipcodes>();
int count = 1;
for (Zipcodes zipcode : npZipcodes) {
if(addressesService.contains(zipcode)!= null){
System.out.println("np"+(count++) + "). " + zipcode.getZipcode() + " "
+ zipcode.getCity());
continue;
}
Addresses found = findNextAddressToZipcode(zipcode);
if(found == null){
newNpZipcodes.add(zipcode);
continue;
}
Addresses address;
zipcode = zipcodesService.get(zipcode.getId());
address = AddressBookFactory.getInstance().newAddresses(null,
null, found.getGeohash(), null, found.getLatitude(),
found.getLongitude(), null, null, zipcode);
System.out.println((count++) + "). " + zipcode.getZipcode() + " "
+ zipcode.getCity());
addressesService.merge(address);
if(found.getFederalstate() != null){
Federalstates fs = federalstatesService.get(found.getFederalstate().getId());
address.setFederalstate(fs);
}
addressesService.merge(address);
}
String xmlNP = XmlUtils.toXmlWithXStream(newNpZipcodes);
WriteFileUtils.string2File(getNotProcessedFile(), xmlNP);
}
public Addresses findNextAddressToZipcode(Zipcodes zipcode) {
String zcString = zipcode.getZipcode();
List<Addresses> addresses = addressesService.find(zipcode.getCountry(), zipcode.getZipcode());
Addresses found = null;
if(addresses != null && !addresses.isEmpty()) {
found = addresses.get(0);
}
if(found != null){
return found;
}
int zcInt = Integer.valueOf(zcString)-1;
Countries country = countriesService.get(zipcode.getCountry().getId());
int count = 0;
while(found == null) {
count++;
if(count == 3){
break;
}
List<Zipcodes> zcs = zipcodesService.findAll(country, zcInt+"", null);
if(zcs != null && !zcs.isEmpty()){
Zipcodes zc = zcs.get(0);
addresses = addressesService.find(zc);
if(addresses != null && !addresses.isEmpty()) {
found = addresses.get(0);
}
if(found != null){
break;
}
if(found == null){
System.out.println(zcInt);
zcInt--;
}
}
}
return found;
}
}
| [
"asterios.raptis@gmx.net"
] | asterios.raptis@gmx.net |
e3aecacfdb866f34d64c0e6d196a7c09a057b801 | 31d3906e977102e6f54570a941df0a16363a4f4b | /Tutorial07Consumer/src/main/java/com/example/dao/StudentDAO.java | 8dfe77be493aa0d945c4556abdb88eaa5cbf9bf4 | [] | no_license | apap-2017/tutorial7_1506735175 | a6e26b95cb51d0fd8e8a24f3251bdce1a1cb847b | 5d52bd90f513e12f08af46b88d5aefbe35d75650 | refs/heads/master | 2021-07-24T16:14:12.134184 | 2017-11-04T08:01:54 | 2017-11-04T08:01:54 | 109,086,461 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 207 | java | package com.example.dao;
import java.util.List;
import com.example.model.StudentModel;
public interface StudentDAO {
StudentModel selectStudent(String npm);
List<StudentModel> selectAllStudents();
}
| [
"aritri12@gmail.com"
] | aritri12@gmail.com |
36c9f7feef9697ce5b2a4ceef5a5a754f9ec7d12 | 538dee9f662471e22e1d069f27f2f9f56f8cc6b5 | /app/src/main/java/com/Fachhochschulebib/fhb/pruefungsplaner/CheckGoogleCalendar.java | f2e1fc183ed4908edc03a2955acaa454dd182067 | [] | no_license | MarcelGabFH/Pruefungsplaner | 0cb6cf2a969074747b34fe494e6ca9e03669e216 | 1005744212d65fe8b8c455a2f676e6b53f9814f4 | refs/heads/master | 2020-04-18T02:14:20.887829 | 2020-03-22T15:53:36 | 2020-03-22T15:53:36 | 167,154,165 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 12,138 | java | //////////////////////////////
// CheckGoogleCalendar
//
//
//
// autor:
// inhalt: Hinzufügen, Löschen, Aktualisieren von Prüfobjekten in den Google Calendar
// zugriffsdatum: 11.12.19
//
//
//
//
//
//
//////////////////////////////
package com.Fachhochschulebib.fhb.pruefungsplaner;
import android.annotation.SuppressLint;
import android.content.ContentResolver;
import android.content.ContentUris;
import android.content.ContentValues;
import android.content.Context;
import android.content.SharedPreferences;
import android.net.Uri;
import android.os.Build;
import android.provider.CalendarContract;
import android.util.Log;
import com.Fachhochschulebib.fhb.pruefungsplaner.data.AppDatabase;
import com.Fachhochschulebib.fhb.pruefungsplaner.data.Pruefplan;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.GregorianCalendar;
import java.util.List;
public class CheckGoogleCalendar {
private int pruefID;
private int googleID;
private Context context;
private List<String> ids = new ArrayList<String>();
//private String[] ids = new String[100];
public void setCtx (Context cx){
context = cx;
}
//Mehtode um Prüfid und Google Kalender Id zu speichern
public void insertCal(int pruefid, int googleid){
//Variablen
pruefID = pruefid;
googleID = googleid;
//Creating editor to store uebergebeneModule to shared preferences
SharedPreferences mSharedPreferences = context.getSharedPreferences("GoogleID-und-PruefID13", 0);
SharedPreferences.Editor mEditor = mSharedPreferences.edit();
String stringids = mSharedPreferences.getString("IDs","");
// step one : converting comma separate String to array of String
String[] elements = null;
try {
elements = stringids.split("/");
}catch (Exception e){
Log.d("Fehler CheckGoogleCal","Fehler beim aufteilen der String elemente");
}
// step two : convert String array to list of String
List<String> fixedLenghtList = Arrays.asList(elements);
// Log.i("test", String.valueOf(elements.length));
// step three : copy fixed list to an ArrayList
ArrayList<String> listOfString = new ArrayList<String>(fixedLenghtList);
//step four : check size and add new element
listOfString.add("-" + String.valueOf(pruefid) + "," + String.valueOf(googleid));
//step fifth : change Stringarray to String type
String idsTOstring = "/";
for(int i = 0; i < listOfString.size();i++)
{
idsTOstring = idsTOstring + listOfString.get(i);
}
//Log.i("test", String.valueOf(idsTOstring));
//step six : add to database
mEditor.putString("IDs",String.valueOf(idsTOstring));
mEditor.apply();
}
//Methode zum überprüfen ob der eintrag im Googlekalender vorhanden ist
public boolean checkCal(int pruefid) {
//Variablen
pruefID = pruefid;
//Creating editor to store uebergebeneModule to shared preferences
SharedPreferences mSharedPreferences = context.getSharedPreferences("GoogleID-und-PruefID13", 0);
SharedPreferences.Editor mEditor = mSharedPreferences.edit();
String stringids = mSharedPreferences.getString("IDs", "");
// step one : converting comma separate String to array of String
String[] elements = stringids.split("-");
// step two : convert String array to list of String
List<String> fixedLenghtList = Arrays.asList(elements);
// step three : copy fixed list to an ArrayList
ArrayList<String> listOfString = new ArrayList<String>(fixedLenghtList);
//step fifth : change Stringarray to String type
Log.i("check_Googlekalender", String.valueOf(listOfString.size()));
String idsTOstring = null;
for (int i = 1; i < listOfString.size(); i++) {
// step six : split Prüfid und GoogleID
String[] element = listOfString.get(i).split(",");
Log.i("check_Checkbool", element[0].toString());
if (element[0].equals(String.valueOf(pruefID))) {
//wenn prüfid vorhanden return false
Log.i("check_Checkbool", "Pid stimmt überein");
return false;
}
}
//wenn prüfid nicht vorhanden return true
return true;
}
//alle bisherigen Google Kalender einträge löschen
public void clearCal()
{
//Creating editor to store uebergebeneModule to shared preferences
SharedPreferences mSharedPreferences = context.getSharedPreferences("GoogleID-und-PruefID13", 0);
SharedPreferences.Editor mEditor = mSharedPreferences.edit();
String stringids = mSharedPreferences.getString("IDs", "");
// step one : converting comma separate String to array of String
String[] elements = stringids.split("-");
// step two : convert String array to list of String
List<String> fixedLenghtList = Arrays.asList(elements);
// step three : copy fixed list to an ArrayList
ArrayList<String> listOfString = new ArrayList<String>(fixedLenghtList);
//hier werden die einträge aus dem google Kalender gelöscht
for (int i = 1; i < listOfString.size(); i++) {
// step six : split Prüfid und GoogleID
String[] element = listOfString.get(i).split(",");
//Google Calendar einträge löschen
//output tag
String DEBUG_TAG = "MyActivity";
//element[1] enthält die googleid
long eventID = Long.valueOf(element[1]);
//getContentResolver wird benötigt zum zugriff auf die Kalender API
ContentResolver cr = context.getContentResolver();
Uri deleteUri = null;
//delete eintrag mit eventID
Uri baseUri;
if (Build.VERSION.SDK_INT >= 8) {
baseUri = Uri.parse("content://com.android.calendar/events");
} else {
baseUri = Uri.parse("content://calendar/events");
}
deleteUri = ContentUris.withAppendedId(baseUri, eventID);
int rows = cr.delete(deleteUri, null, null);
//outputlog for Debug
Log.i(DEBUG_TAG, "Rows deleted: " + rows);
}
//step six : reset Database
mEditor.putString("IDs","");
mEditor.apply();
}
//Google Kalender Checkverbindung Methode
public void updateCal()
{
//Creating editor to store uebergebeneModule to shared preferences
SharedPreferences Googleeintrag = context.getSharedPreferences("GoogleID-und-PruefID13", 0);
String stringids = Googleeintrag.getString("IDs", "");
// step one : converting comma separate String to array of String
String[] elements = stringids.split("-");
Log.i("userID", String.valueOf(elements.length));
// step two : convert String array to list of String
List<String> fixedLenghtList = Arrays.asList(elements);
// step three : copy fixed list to an ArrayList
ArrayList<String> listOfString = new ArrayList<String>(fixedLenghtList);
//step four: Database connect
List<Pruefplan> pruefplan = databaseConnect();
//step fifth: Schleifen zum vergleichen
Log.i("userID", String.valueOf(listOfString.size()));
for (int i = 1; i < listOfString.size(); i++) {
//Variable mit Element[0] prüfplanID und element[1] Google Calendar id
String[] element = listOfString.get(i).split(",");
Log.i("userID", element.toString());
Log.i("elemnt[0}", String.valueOf(element[0]));
for (int j = 0; j< pruefplan.size(); j++) {
// wenn id gleich id vom google Calendar dann get element[1] dieser id, element[1]
// ist die GoogleCalendar Id für den gespeicherten eintrag
Log.i("userID2", pruefplan.get(j).getID());
if(pruefplan.get(j).getID().equals(element[0])) {
//output tag
String DEBUG_TAG = "MyActivity";
//eventID ist die Google calendar Id
long eventID = Long.valueOf(element[1]);
//Klasse für das updaten von werten
ContentResolver cr = context.getContentResolver();
ContentValues values = new ContentValues();
Uri updateUri = null;
//Datum und Uhrzeit aufteilen.
// Sieht so aus wie 22-01-2019 10:00 Uhr
// es wird nach dem Leerzeichen getrennt
//trennen von datum und Uhrzeit
String[] s = pruefplan.get(j).getDatum().split(" ");
//print Datum
System.out.println(s[0]);
//aufteilen von tag, monat und jahr.
//sieht aus wie 22-01-2019 aufgeteilt in ss[0] = 22 ,ss[1] = 01, ss[2] = 2019
String[] ss = s[0].split("-");
//aufteilen von der Uhrzeit Stunden der prüfung und Minuten der prüfung
int uhrzeit1 = Integer.valueOf(s[1].substring(0, 2));
int uhrzeit2 = Integer.valueOf(s[1].substring(4, 5));
// The new title for the updatet event
values.put(CalendarContract.Events.TITLE, pruefplan.get(j).getModul());
values.put(CalendarContract.Events.EVENT_LOCATION, "Fachhochschule BielefeldUpdate");
values.put(CalendarContract.Events.DESCRIPTION, "");
//umwandeln von Datum und uhrzeit in GregorianCalender für eine leichtere weiterverarbeitung
GregorianCalendar calDate = new GregorianCalendar(Integer.valueOf(ss[0]), (Integer.valueOf(ss[1]) - 1), Integer.valueOf(ss[2]), uhrzeit1, uhrzeit2);
values.put(CalendarContract.EXTRA_EVENT_ALL_DAY, false);
values.put(CalendarContract.Events.DTSTART, calDate.getTimeInMillis());
values.put(CalendarContract.Events.DTEND, calDate.getTimeInMillis() + (90 * 60000));
//uebergebeneModule.put(CalendarContract.Events.);
//Checkverbindung Eintrag
Uri baseUri;
if (Build.VERSION.SDK_INT >= 8) {
baseUri = Uri.parse("content://com.android.calendar/events");
} else {
baseUri = Uri.parse("content://calendar/events");
}
updateUri = ContentUris.withAppendedId(baseUri, eventID);
//variable zum anzeigen der geänderten werte
int rows = cr.update(updateUri, values, null, null);
//testausgabe
Log.i(DEBUG_TAG, "Rows updated: 240 " + rows);
}
}
}
}
public List<Pruefplan> databaseConnect(){
AppDatabase database2 = AppDatabase.getAppDatabase(context);
List<Pruefplan> userdaten2 = database2.userDao().getAll2();
return(userdaten2);
}
@SuppressLint("InlinedApi")
public int UpdateCalendarEntry(int entryID) {
int iNumRowsUpdated = 0;
Uri eventUri;
if (android.os.Build.VERSION.SDK_INT <= 7) {
// the old way
eventUri = Uri.parse("content://calendar/events");
} else {
// the new way
eventUri = Uri.parse("content://com.android.calendar/events");
}
ContentValues values = new ContentValues();
values.put(CalendarContract.Events.TITLE, "test");
values.put(CalendarContract.Events.EVENT_LOCATION, "Chennai");
Uri updateUri = ContentUris.withAppendedId(eventUri, entryID);
iNumRowsUpdated = context.getContentResolver().update(updateUri, values, null,
null);
return iNumRowsUpdated;
}
}
| [
"asdsda@gmail.com"
] | asdsda@gmail.com |
971430a5df09174a7ef2684ec38d6ff4e701157f | 695303ac1907e4ed15b544583765ee2ae07bf65b | /platforms/android/src/com/juankmilo/teledos/MainActivity.java | 774c02eba4f5b6f3022bc59f6fafec56183372d6 | [] | no_license | juankmiloh/app_tele_dos | d082a7e3dfab49f9b946f216d32b0964f6fd3f00 | 1eab2564462fe23e1726ef0a0ec5f38a45ed5ee8 | refs/heads/master | 2020-12-03T08:16:12.301756 | 2017-06-28T14:34:05 | 2017-06-28T14:34:05 | 95,678,229 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,454 | java | /*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
*/
package com.juankmilo.teledos;
import android.os.Bundle;
import org.apache.cordova.*;
public class MainActivity extends CordovaActivity
{
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
// enable Cordova apps to be started in the background
Bundle extras = getIntent().getExtras();
if (extras != null && extras.getBoolean("cdvStartInBackground", false)) {
moveTaskToBack(true);
}
// Set by <content src="index.html" /> in config.xml
loadUrl(launchUrl);
}
}
| [
"Home@MacBook-Air-de-Administrador.local"
] | Home@MacBook-Air-de-Administrador.local |
1d70ef90c9a0d55b2c2fbff8ad900b19611911c4 | a35145241ea4777a0f9ece804d494f66f971eb3b | /src/game/Player2.java | 45d1c3e73e1943bdf142408715f58d119ce216a5 | [] | no_license | cncplyr/project-game | 2e70d78a716f6c5d99b70388ca5a86b674b621b6 | 9a4d36e8b7b10d36db49a938f8db6f47fd7902ae | refs/heads/master | 2021-01-18T15:14:43.794380 | 2011-05-05T08:36:46 | 2011-05-05T08:36:46 | 38,980,794 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,823 | java | package game;
import java.awt.Image;
import java.awt.event.KeyEvent;
import java.awt.image.BufferedImage;
import java.io.File;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import fileHandling.FileHandler;
/**
*
* @author Richard Jenkin
* @version 0.5
*
*/
public class Player2 {
// Animations and images
private FileHandler fh = new FileHandler();
private List<BufferedImage> imageList;
private Image image;
private List<List<Integer>> animations;
private List<Integer> animationsRequested;
private boolean animationPlaying;
private int animationFrame;
private volatile PlayerState state;
private boolean thistime;
// Position
private int x, y;
private int dx, dy;
private int playerWidth, playerHeight;
private int screenWidth, screenHeight;
private int FLOOR;
/**
* Constructor.
*
* @param width
* @param height
* @param FLOOR
*/
public Player2(int width, int height, int FLOOR) {
fh.setInputFolder("images" + File.separator + "animation" + File.separator + "p2");
try {
imageList = fh.loadMatchingImages("frame", 1, 900);
} catch (Exception e) {
e.printStackTrace();
}
image = imageList.get(0);
playerWidth = image.getWidth(null);
playerHeight = image.getHeight(null);
screenWidth = width;
screenHeight = height;
this.FLOOR = FLOOR;
animations = new ArrayList<List<Integer>>();
animationsRequested = new LinkedList<Integer>();
animationPlaying = false;
animationFrame = -1;
thistime = true;
state = PlayerState.STAND;
dummyAnimations();
x = screenWidth - 100 - playerWidth;
y = screenHeight - 100;
}
public void move() {
x += dx;
y += dy;
if (x < 1) {
x = 1;
}
if (y < 1) {
y = 1;
}
if (x + playerWidth > screenWidth) {
x = screenWidth - playerWidth;
}
if (y > 300) {
y = 300;
}
}
public int getX() {
return x;
}
public int getY() {
return FLOOR - playerHeight;
}
public Image getImage() {
return image;
}
public void keyPressed(KeyEvent e) {
switch (e.getKeyCode()) {
case KeyEvent.VK_NUMPAD4:
requestAnimation(PlayerState.STAND_FORWARD);
// chooseImage(50);
// dx = -2;
break;
case KeyEvent.VK_NUMPAD6:
requestAnimation(PlayerState.STAND_BACK);
// chooseImage(50);
// dx = 2;
break;
case KeyEvent.VK_NUMPAD8:
break;
case KeyEvent.VK_NUMPAD2:
requestAnimation(PlayerState.CROUCH);
break;
case KeyEvent.VK_NUMPAD0:
chooseImage(50);
break;
}
}
public void keyReleased(KeyEvent e) {
switch (e.getKeyCode()) {
case KeyEvent.VK_NUMPAD4:
// chooseImage(0);
// dx = 0;
break;
case KeyEvent.VK_NUMPAD6:
// chooseImage(0);
// dx = 0;
break;
case KeyEvent.VK_NUMPAD8:
// dy = 0;
break;
case KeyEvent.VK_NUMPAD2:
requestAnimation(PlayerState.STAND);
break;
case KeyEvent.VK_NUMPAD0:
chooseImage(0);
break;
}
}
public void update() {
// Delay animations by 1
// thistime = !thistime;
if (animationPlaying) {
/* In an animation */
if (animationFrame == animations.get(animationsRequested.get(0)).size() - 1) {
/* Animation over */
System.out.println("!!!ANIMATION FINISHED!!!");
// Update the image
chooseImage(animations.get(animationsRequested.get(0)).get(animationFrame));
// Set the final resting state
switch (state) {
case STAND_FORWARD:
state = PlayerState.STAND;
break;
case STAND_BACK:
state = PlayerState.STAND;
break;
case CROUCH_DOWN:
state = PlayerState.CROUCH;
break;
case CROUCH_UP:
state = PlayerState.STAND;
break;
}
// Reset the start frame
animationFrame = -1;
// Remove from animations requested list
animationsRequested.remove(0);
// Stop movement
dx = 0;
// TODO: SOME KIND OF CHECK HERE?
// Stop the animation
animationPlaying = false;
} else if (thistime) {
/* Continue Animation */
// System.out.println("In animation");
// Update the image
chooseImage(animations.get(animationsRequested.get(0)).get(animationFrame));
// Update player position
switch (state) {
case STAND_FORWARD:
dx = -3;
break;
case STAND_BACK:
dx = 3;
break;
}
move();
// Increment frame for next pass.
animationFrame++;
}
} else if (animationsRequested.size() > 0) {
/* A new animation! */
// System.out.println("!!!NEW ANIMATION!!!");
switch (animationsRequested.get(0)) {
case 0:
state = PlayerState.STAND_FORWARD;
break;
case 1:
state = PlayerState.STAND_BACK;
break;
case 2: // Crouch down
state = PlayerState.CROUCH_DOWN;
break;
case 3: // Crouch up
state = PlayerState.CROUCH_UP;
break;
}
// Update Start frame
animationFrame = 0;
// Update the image
chooseImage(animations.get(animationsRequested.get(0)).get(animationFrame));
// Increment frame for next pass.
animationFrame++;
/* Start an animation */
animationPlaying = true;
} else {
// move();
}
}
private void chooseImage(int index) {
image = imageList.get(index);
playerWidth = image.getWidth(null);
playerHeight = image.getHeight(null);
}
private void requestAnimation(PlayerState animationID) {
switch (animationID) {
case STAND:
if (animationPlaying) {
int prev = animationsRequested.get(animationsRequested.size() - 1);
if (prev != 3) { // not about to crouch
// Add crouch to animation queue
animationsRequested.add(3);
}
} else {
// TODO:Replace this with a switch?
if (state == PlayerState.STAND) {
} else {
animationsRequested.add(3);
}
}
break;
case STAND_PUNCH:
break;
case STAND_KICK:
break;
case STAND_FORWARD:
if (animationPlaying) {
int prev = animationsRequested.get(animationsRequested.size() - 1);
if (prev != 0) { // not about to crouch
// Add crouch to animation queue
animationsRequested.add(0);
}
} else {
// TODO:Replace this with a switch?
if (state == PlayerState.STAND_FORWARD) {
} else {
animationsRequested.add(0);
}
}
break;
case STAND_BACK:
if (animationPlaying) {
int prev = animationsRequested.get(animationsRequested.size() - 1);
if (prev != 1) { // not about to crouch
// Add crouch to animation queue
animationsRequested.add(1);
}
} else {
// TODO:Replace this with a switch?
if (state == PlayerState.STAND_FORWARD) {
} else {
animationsRequested.add(1);
}
}
break;
case STAND_JUMP:
break;
case CROUCH: // Want to crouch
if (animationPlaying) {
int prev = animationsRequested.get(animationsRequested.size() - 1);
if (prev != 2) { // not about to crouch
// Add crouch to animation queue
animationsRequested.add(2);
}
} else {
// TODO:Replace this with a switch?
if (state == PlayerState.CROUCH) {
} else {
animationsRequested.add(2);
}
}
break;
case CROUCH_PUNCH:
break;
case CROUCH_KICK:
break;
case CROUCH_DOWN:
break;
case CROUCH_UP:
break;
}
}
public enum PlayerState {
STAND, STAND_PUNCH, STAND_KICK, STAND_FORWARD, STAND_BACK, STAND_JUMP, CROUCH, CROUCH_PUNCH, CROUCH_KICK, CROUCH_DOWN, CROUCH_UP
}
// TODO: Remove this after loading animations has been implemented.
private void dummyAnimations() {
List<Integer> animation1 = new ArrayList<Integer>();
animation1.add(23);
animation1.add(24);
animation1.add(25);
animation1.add(26);
animation1.add(27);
animation1.add(28);
animation1.add(29);
animation1.add(30);
animation1.add(31);
animation1.add(32);
animation1.add(33);
animation1.add(34);
animation1.add(35);
animation1.add(36);
animation1.add(37);
animation1.add(38);
animation1.add(39);
animation1.add(40);
animation1.add(41);
animation1.add(42);
animation1.add(43);
animation1.add(44);
animations.add(animation1);
List<Integer> animation2 = new ArrayList<Integer>();
animation2.add(44);
animation2.add(43);
animation2.add(42);
animation2.add(41);
animation2.add(40);
animation2.add(39);
animation2.add(38);
animation2.add(37);
animation2.add(36);
animation2.add(35);
animation2.add(34);
animation2.add(33);
animation2.add(32);
animation2.add(31);
animation2.add(30);
animation2.add(29);
animation2.add(28);
animation2.add(27);
animation2.add(26);
animation2.add(25);
animation2.add(24);
animation2.add(23);
animations.add(animation2);
List<Integer> animation3 = new ArrayList<Integer>();
animation3.add(850);
animation3.add(851);
animation3.add(852);
animation3.add(853);
animation3.add(854);
animation3.add(855);
animation3.add(856);
animation3.add(857);
animation3.add(858);
animation3.add(859);
animation3.add(860);
animation3.add(861);
animation3.add(862);
animation3.add(863);
animations.add(animation3);
List<Integer> animation4 = new ArrayList<Integer>();
animation4.add(864);
animation4.add(865);
animation4.add(866);
animation4.add(867);
animation4.add(868);
animation4.add(869);
animation4.add(870);
animation4.add(871);
animation4.add(872);
animation4.add(873);
animation4.add(874);
animation4.add(875);
animation4.add(876);
animation4.add(877);
animation4.add(878);
animation4.add(879);
animation4.add(880);
animation4.add(881);
animations.add(animation4);
}
}
| [
"cncplyr@413c26c7-57fe-aca8-f4f5-ae2a0b4c8f8f"
] | cncplyr@413c26c7-57fe-aca8-f4f5-ae2a0b4c8f8f |
66b6d0825d02ccfc4e3ba558aab4fb6939cf183c | 1fb2eb88e7205e8889b6e72be38b0715a09cec3f | /src/com/source/leetcode/Sum3.java | 67910fece0859562cbfe294ca194588f733443bd | [] | no_license | harcy/Java-Learn | 7518f78da6ce8ff3a568b1fd80f4c653986a498b | 1478f8f265adfadf7636991323621d016a399fd5 | refs/heads/master | 2021-01-01T05:46:30.679688 | 2017-02-10T10:04:19 | 2017-02-10T10:04:19 | 58,431,891 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 263 | java | package com.source.leetcode;
import java.util.Arrays;
import java.util.List;
public class Sum3 {
public List<List<Integer>> threeSum(int[] nums){
Arrays.sort(nums);
return null;
}
public static void main(String[] args) {
}
}
| [
"liangchen.shu@gmail.com"
] | liangchen.shu@gmail.com |
60d39fe81ae064a28c83d02fbe73267bca22060f | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/17/17_3105c6b48f88b5096592c136a650bdd1950d81ce/JoystickView/17_3105c6b48f88b5096592c136a650bdd1950d81ce_JoystickView_s.java | 5ea0f8bda4ffc607118eec65099bcc4cbb3467e4 | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 15,208 | java | /**
* Copied from https://code.google.com/p/mobile-anarchy-widgets/
*/
package com.droidplanner.widgets.joystick;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.util.AttributeSet;
import android.util.Log;
import android.view.HapticFeedbackConstants;
import android.view.MotionEvent;
import android.view.View;
public class JoystickView extends View {
public static final int INVALID_POINTER_ID = -1;
// =========================================
// Private Members
// =========================================
private final boolean D = false;
String TAG = "JoystickView";
private Paint dbgPaint1;
private Paint dbgPaint2;
private Paint bgPaint;
private Paint handlePaint;
private int innerPadding;
private int bgRadius;
private int handleRadius;
private int movementRadius;
private int handleInnerBoundaries;
private JoystickMovedListener moveListener;
private JoystickClickedListener clickListener;
//# of pixels movement required between reporting to the listener
private float moveResolution;
private boolean yAxisInverted;
private boolean autoReturnToCenter;
//Max range of movement in user coordinate system
public final static int CONSTRAIN_BOX = 0;
public final static int CONSTRAIN_CIRCLE = 1;
private final static float MOVEMENT_RANGE = 1;
private int movementConstraint;
public final static int COORDINATE_CARTESIAN = 0; //Regular cartesian coordinates
public final static int COORDINATE_DIFFERENTIAL = 1; //Uses polar rotation of 45 degrees to calc differential drive paramaters
private int userCoordinateSystem;
//Records touch pressure for click handling
private float touchPressure;
private boolean clicked;
private float clickThreshold;
//Last touch point in view coordinates
private int pointerId = INVALID_POINTER_ID;
private float touchX, touchY;
//Last reported position in view coordinates (allows different reporting sensitivities)
private float reportX, reportY;
//Handle center in view coordinates
private float handleX, handleY;
//Center of the view in view coordinates
private int cX, cY;
//Size of the view in view coordinates
private int dimSide;
//Cartesian coordinates of last touch point - joystick center is (0,0)
private double cartX, cartY;
//Polar coordinates of the touch point from joystick center
private double radial;
private double angle;
//User coordinates of last touch point
private double userX, userY;
//Offset co-ordinates (used when touch events are received from parent's coordinate origin)
private int offsetX;
private int offsetY;
// =========================================
// Constructors
// =========================================
public JoystickView(Context context) {
super(context);
initJoystickView();
}
public JoystickView(Context context, AttributeSet attrs) {
super(context, attrs);
initJoystickView();
}
public JoystickView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
initJoystickView();
}
// =========================================
// Initialization
// =========================================
private void initJoystickView() {
setFocusable(true);
dbgPaint1 = new Paint(Paint.ANTI_ALIAS_FLAG);
dbgPaint1.setColor(Color.RED);
dbgPaint1.setStrokeWidth(1);
dbgPaint1.setStyle(Paint.Style.STROKE);
dbgPaint2 = new Paint(Paint.ANTI_ALIAS_FLAG);
dbgPaint2.setColor(Color.GREEN);
dbgPaint2.setStrokeWidth(1);
dbgPaint2.setStyle(Paint.Style.STROKE);
bgPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
bgPaint.setColor(Color.GRAY);
bgPaint.setStrokeWidth(1);
bgPaint.setStyle(Paint.Style.FILL_AND_STROKE);
handlePaint = new Paint(Paint.ANTI_ALIAS_FLAG);
handlePaint.setColor(Color.DKGRAY);
handlePaint.setStrokeWidth(1);
handlePaint.setStyle(Paint.Style.FILL_AND_STROKE);
innerPadding = 10;
setMoveResolution(1.0f);
setClickThreshold(0.4f);
setYAxisInverted(false);
setUserCoordinateSystem(COORDINATE_CARTESIAN);
setAutoReturnToCenter(true);
}
public void setAutoReturnToCenter(boolean autoReturnToCenter) {
this.autoReturnToCenter = autoReturnToCenter;
}
public boolean isAutoReturnToCenter() {
return autoReturnToCenter;
}
public void setUserCoordinateSystem(int userCoordinateSystem) {
if (userCoordinateSystem < COORDINATE_CARTESIAN || movementConstraint > COORDINATE_DIFFERENTIAL)
Log.e(TAG, "invalid value for userCoordinateSystem");
else
this.userCoordinateSystem = userCoordinateSystem;
}
public int getUserCoordinateSystem() {
return userCoordinateSystem;
}
public void setMovementConstraint(int movementConstraint) {
if (movementConstraint < CONSTRAIN_BOX || movementConstraint > CONSTRAIN_CIRCLE)
Log.e(TAG, "invalid value for movementConstraint");
else
this.movementConstraint = movementConstraint;
}
public int getMovementConstraint() {
return movementConstraint;
}
public boolean isYAxisInverted() {
return yAxisInverted;
}
public void setYAxisInverted(boolean yAxisInverted) {
this.yAxisInverted = yAxisInverted;
}
/**
* Set the pressure sensitivity for registering a click
* @param clickThreshold threshold 0...1.0f inclusive. 0 will cause clicks to never be reported, 1.0 is a very hard click
*/
public void setClickThreshold(float clickThreshold) {
if (clickThreshold < 0 || clickThreshold > 1.0f)
Log.e(TAG, "clickThreshold must range from 0...1.0f inclusive");
else
this.clickThreshold = clickThreshold;
}
public float getClickThreshold() {
return clickThreshold;
}
public void setMoveResolution(float moveResolution) {
this.moveResolution = moveResolution;
}
public float getMoveResolution() {
return moveResolution;
}
// =========================================
// Public Methods
// =========================================
public void setOnJostickMovedListener(JoystickMovedListener listener) {
this.moveListener = listener;
}
public void setOnJostickClickedListener(JoystickClickedListener listener) {
this.clickListener = listener;
}
// =========================================
// Drawing Functionality
// =========================================
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
// Here we make sure that we have a perfect circle
int measuredWidth = measure(widthMeasureSpec);
int measuredHeight = measure(heightMeasureSpec);
setMeasuredDimension(measuredWidth, measuredHeight);
}
@Override
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
super.onLayout(changed, left, top, right, bottom);
int d = Math.min(getMeasuredWidth(), getMeasuredHeight());
dimSide = d;
cX = d / 2;
cY = d / 2;
bgRadius = dimSide/2 - innerPadding;
handleRadius = (int)(d * 0.25);
handleInnerBoundaries = handleRadius;
movementRadius = Math.min(cX, cY) - handleInnerBoundaries;
}
private int measure(int measureSpec) {
int result = 0;
// Decode the measurement specifications.
int specMode = MeasureSpec.getMode(measureSpec);
int specSize = MeasureSpec.getSize(measureSpec);
if (specMode == MeasureSpec.UNSPECIFIED) {
// Return a default size of 200 if no bounds are specified.
result = 200;
} else {
// As you want to fill the available space
// always return the full available bounds.
result = specSize;
}
return result;
}
@Override
protected void onDraw(Canvas canvas) {
canvas.save();
// Draw the background
canvas.drawCircle(cX, cY, bgRadius, bgPaint);
// Draw the handle
handleX = touchX + cX;
handleY = touchY + cY;
canvas.drawCircle(handleX, handleY, handleRadius, handlePaint);
if (D) {
canvas.drawRect(1, 1, getMeasuredWidth()-1, getMeasuredHeight()-1, dbgPaint1);
canvas.drawCircle(handleX, handleY, 3, dbgPaint1);
if ( movementConstraint == CONSTRAIN_CIRCLE ) {
canvas.drawCircle(cX, cY, this.movementRadius, dbgPaint1);
}
else {
canvas.drawRect(cX-movementRadius, cY-movementRadius, cX+movementRadius, cY+movementRadius, dbgPaint1);
}
//Origin to touch point
canvas.drawLine(cX, cY, handleX, handleY, dbgPaint2);
int baseY = (int) (touchY < 0 ? cY + handleRadius : cY - handleRadius);
canvas.drawText(String.format("%s (%.0f,%.0f)", TAG, touchX, touchY), handleX-20, baseY-7, dbgPaint2);
canvas.drawText("("+ String.format("%.0f, %.1f", radial, angle * 57.2957795) + (char) 0x00B0 + ")", handleX-20, baseY+15, dbgPaint2);
}
// Log.d(TAG, String.format("touch(%f,%f)", touchX, touchY));
// Log.d(TAG, String.format("onDraw(%.1f,%.1f)\n\n", handleX, handleY));
canvas.restore();
}
// Constrain touch within a box
private void constrainBox() {
touchX = Math.max(Math.min(touchX, movementRadius), -movementRadius);
touchY = Math.max(Math.min(touchY, movementRadius), -movementRadius);
}
// Constrain touch within a circle
private void constrainCircle() {
float diffX = touchX;
float diffY = touchY;
double radial = Math.sqrt((diffX*diffX) + (diffY*diffY));
if ( radial > movementRadius ) {
touchX = (int)((diffX / radial) * movementRadius);
touchY = (int)((diffY / radial) * movementRadius);
}
}
public void setPointerId(int id) {
this.pointerId = id;
}
public int getPointerId() {
return pointerId;
}
@Override
public boolean onTouchEvent(MotionEvent ev) {
final int action = ev.getAction();
switch (action & MotionEvent.ACTION_MASK) {
case MotionEvent.ACTION_MOVE: {
return processMoveEvent(ev);
}
case MotionEvent.ACTION_CANCEL:
case MotionEvent.ACTION_UP: {
if ( pointerId != INVALID_POINTER_ID ) {
// Log.d(TAG, "ACTION_UP");
returnHandleToCenter();
setPointerId(INVALID_POINTER_ID);
}
break;
}
case MotionEvent.ACTION_POINTER_UP: {
if ( pointerId != INVALID_POINTER_ID ) {
final int pointerIndex = (action & MotionEvent.ACTION_POINTER_INDEX_MASK) >> MotionEvent.ACTION_POINTER_INDEX_SHIFT;
final int pointerId = ev.getPointerId(pointerIndex);
if ( pointerId == this.pointerId ) {
// Log.d(TAG, "ACTION_POINTER_UP: " + pointerId);
returnHandleToCenter();
setPointerId(INVALID_POINTER_ID);
return true;
}
}
break;
}
case MotionEvent.ACTION_DOWN: {
if ( pointerId == INVALID_POINTER_ID ) {
int x = (int) ev.getX();
if ( x >= offsetX && x < offsetX + dimSide ) {
setPointerId(ev.getPointerId(0));
// Log.d(TAG, "ACTION_DOWN: " + getPointerId());
return true;
}
}
break;
}
case MotionEvent.ACTION_POINTER_DOWN: {
if ( pointerId == INVALID_POINTER_ID ) {
final int pointerIndex = (action & MotionEvent.ACTION_POINTER_INDEX_MASK) >> MotionEvent.ACTION_POINTER_INDEX_SHIFT;
final int pointerId = ev.getPointerId(pointerIndex);
int x = (int) ev.getX(pointerId);
if ( x >= offsetX && x < offsetX + dimSide ) {
// Log.d(TAG, "ACTION_POINTER_DOWN: " + pointerId);
setPointerId(pointerId);
return true;
}
}
break;
}
}
return false;
}
private boolean processMoveEvent(MotionEvent ev) {
if ( pointerId != INVALID_POINTER_ID ) {
final int pointerIndex = ev.findPointerIndex(pointerId);
// Translate touch position to center of view
float x = ev.getX(pointerIndex);
touchX = x - cX - offsetX;
float y = ev.getY(pointerIndex);
touchY = y - cY - offsetY;
// Log.d(TAG, String.format("ACTION_MOVE: (%03.0f, %03.0f) => (%03.0f, %03.0f)", x, y, touchX, touchY));
reportOnMoved();
invalidate();
touchPressure = ev.getPressure(pointerIndex);
reportOnPressure();
return true;
}
return false;
}
private void reportOnMoved() {
if ( movementConstraint == CONSTRAIN_CIRCLE )
constrainCircle();
else
constrainBox();
calcUserCoordinates();
if (moveListener != null) {
boolean rx = Math.abs(touchX - reportX) >= moveResolution;
boolean ry = Math.abs(touchY - reportY) >= moveResolution;
if (rx || ry) {
this.reportX = touchX;
this.reportY = touchY;
// Log.d(TAG, String.format("moveListener.OnMoved(%d,%d)", (int)userX, (int)userY));
moveListener.OnMoved(userX, userY);
}
}
}
private void calcUserCoordinates() {
//First convert to cartesian coordinates
cartX = (touchX / movementRadius * MOVEMENT_RANGE);
cartY = (touchY / movementRadius * MOVEMENT_RANGE);
radial = Math.sqrt((cartX*cartX) + (cartY*cartY));
angle = Math.atan2(cartY, cartX);
//Invert Y axis if requested
if ( !yAxisInverted )
cartY *= -1;
if ( userCoordinateSystem == COORDINATE_CARTESIAN ) {
userX = cartX;
userY = cartY;
}
else if ( userCoordinateSystem == COORDINATE_DIFFERENTIAL ) {
userX = cartY + cartX / 4;
userY = cartY - cartX / 4;
if ( userX < -MOVEMENT_RANGE )
userX = -MOVEMENT_RANGE;
if ( userX > MOVEMENT_RANGE )
userX = MOVEMENT_RANGE;
if ( userY < -MOVEMENT_RANGE )
userY = -MOVEMENT_RANGE;
if ( userY > MOVEMENT_RANGE )
userY = MOVEMENT_RANGE;
}
}
//Simple pressure click
private void reportOnPressure() {
// Log.d(TAG, String.format("touchPressure=%.2f", this.touchPressure));
if ( clickListener != null ) {
if ( clicked && touchPressure < clickThreshold ) {
clickListener.OnReleased();
this.clicked = false;
// Log.d(TAG, "reset click");
invalidate();
}
else if ( !clicked && touchPressure >= clickThreshold ) {
clicked = true;
clickListener.OnClicked();
// Log.d(TAG, "click");
invalidate();
performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY);
}
}
}
private void returnHandleToCenter() {
if ( autoReturnToCenter ) {
final int numberOfFrames = 5;
final double intervalsX = (0 - touchX) / numberOfFrames;
final double intervalsY = (0 - touchY) / numberOfFrames;
for (int i = 0; i < numberOfFrames; i++) {
final int j = i;
postDelayed(new Runnable() {
@Override
public void run() {
touchX += intervalsX;
touchY += intervalsY;
reportOnMoved();
invalidate();
if (moveListener != null && j == numberOfFrames - 1) {
moveListener.OnReturnedToCenter();
}
}
}, i * 40);
}
if (moveListener != null) {
moveListener.OnReleased();
}
}
}
public void setTouchOffset(int x, int y) {
offsetX = x;
offsetY = y;
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
10643497d0a150b570b10781b75e6d3a749c5dca | c5afee1b2ce427c28167dc93265f68e141848dc7 | /src/main/java/ui/usages/UsageViewTreeCellRenderer.java | 6c408272ed534e15d996bc21a16f3af4f0a120e3 | [
"MIT"
] | permissive | baocatsamac/MisCatcher | f939e31891b1e8069e7e3508db0367db5c26c7ab | 37bc90266ddad38189b456f668c1864769b69773 | refs/heads/master | 2022-09-26T21:10:01.308870 | 2020-05-26T05:29:37 | 2020-05-26T05:29:37 | 266,950,247 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 18,277 | java | package ui.usages;
import com.intellij.icons.AllIcons;
import com.intellij.navigation.ItemPresentation;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.editor.colors.EditorColorsScheme;
import com.intellij.openapi.util.TextRange;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vcs.FileStatus;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiMethodCallExpression;
import com.intellij.psi.xml.XmlTag;
import com.intellij.ui.ColoredTreeCellRenderer;
import com.intellij.ui.DarculaColors;
import com.intellij.ui.SimpleTextAttributes;
import com.intellij.ui.speedSearch.SpeedSearchUtil;
import com.intellij.usageView.UsageTreeColors;
import com.intellij.usageView.UsageTreeColorsScheme;
import com.intellij.usageView.UsageViewBundle;
import com.intellij.usages.*;
import com.intellij.util.FontUtil;
import com.intellij.util.ui.UIUtil;
import helper.PermissionHelper;
import object.Method;
import object.UIElement;
import org.jetbrains.annotations.NotNull;
import service.Holder;
import javax.swing.*;
import javax.swing.tree.DefaultMutableTreeNode;
import java.awt.*;
import java.util.ArrayList;
import java.util.Map;
public class UsageViewTreeCellRenderer extends ColoredTreeCellRenderer {
private static final Logger LOG = Logger.getInstance("#ui.usages.UsageViewTreeCellRenderer");
private static final EditorColorsScheme ourColorsScheme = UsageTreeColorsScheme.getInstance().getScheme();
private static final SimpleTextAttributes ourInvalidAttributes = SimpleTextAttributes.fromTextAttributes(ourColorsScheme.getAttributes(UsageTreeColors.INVALID_PREFIX));
private static final SimpleTextAttributes ourReadOnlyAttributes = SimpleTextAttributes.fromTextAttributes(ourColorsScheme.getAttributes(UsageTreeColors.READONLY_PREFIX));
private static final SimpleTextAttributes ourNumberOfUsagesAttribute = SimpleTextAttributes.fromTextAttributes(ourColorsScheme.getAttributes(UsageTreeColors.NUMBER_OF_USAGES));
private static final SimpleTextAttributes ourInvalidAttributesDarcula = new SimpleTextAttributes(null, DarculaColors.RED, null, ourInvalidAttributes.getStyle());
private static final Insets STANDARD_IPAD_NOWIFI = new Insets(1, 2, 1, 2);
private boolean myRowBoundsCalled;
private final UsageViewPresentation myPresentation;
private final UsageView myView;
private boolean myCalculated;
private int myRowHeight = AllIcons.Nodes.AbstractClass.getIconHeight() + 2;
UsageViewTreeCellRenderer(@NotNull UsageView view) {
myView = view;
myPresentation = view.getPresentation();
}
private Dimension cachedPreferredSize;
@NotNull
@Override
public Dimension getPreferredSize() {
return myCalculated ? super.getPreferredSize() : new Dimension(10, myRowHeight);
}
@Override
public void customizeCellRenderer(@NotNull JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) {
boolean showAsReadOnly = false;
if (value instanceof Node && value != tree.getModel().getRoot()) {
Node node = (Node) value;
if (!node.isValid()) {
append(UsageViewBundle.message("node.invalid") + " ", UIUtil.isUnderDarcula() ? ourInvalidAttributesDarcula : ourInvalidAttributes);
}
if (myPresentation.isShowReadOnlyStatusAsRed() && node.isReadOnly()) {
showAsReadOnly = true;
}
}
myCalculated = false;
if (value instanceof DefaultMutableTreeNode) {
DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode) value;
Object userObject = treeNode.getUserObject();
Rectangle visibleRect = ((JViewport) tree.getParent()).getViewRect();
if (!visibleRect.isEmpty()) {
//Protection against SOE on some OSes and JDKs IDEA-120631
UsageViewTreeCellRenderer.RowLocation visible = myRowBoundsCalled ? UsageViewTreeCellRenderer.RowLocation.INSIDE_VISIBLE_RECT : isRowVisible(row, visibleRect);
myRowBoundsCalled = false;
if (visible != UsageViewTreeCellRenderer.RowLocation.INSIDE_VISIBLE_RECT) {
// for the node outside visible rect do not compute (expensive) presentation
return;
}
if (!getIpad().equals(STANDARD_IPAD_NOWIFI)) {
// for the visible node, return its ipad to the standard value
setIpad(STANDARD_IPAD_NOWIFI);
}
}
// we can be called recursively via isRowVisible()
if (myCalculated) return;
myCalculated = true;
if (userObject instanceof UsageTarget) {
UsageTarget usageTarget = (UsageTarget) userObject;
if (!usageTarget.isValid()) {
if (!getCharSequence(false).toString().contains(UsageViewBundle.message("node.invalid"))) {
append(UsageViewBundle.message("node.invalid"), ourInvalidAttributes);
}
return;
}
final ItemPresentation presentation = usageTarget.getPresentation();
LOG.assertTrue(presentation != null);
if (showAsReadOnly) {
append(UsageViewBundle.message("node.readonly") + " ", ourReadOnlyAttributes);
}
final String text = presentation.getPresentableText();
append(text == null ? "" : text, SimpleTextAttributes.REGULAR_ATTRIBUTES);
setIcon(presentation.getIcon(expanded));
} else if (treeNode instanceof GroupNode) {
GroupNode node = (GroupNode) treeNode;
if (node.isRoot()) {
append(StringUtil.capitalize(myPresentation.getUsagesWord()), patchAttrs(node, SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES));
} else {
append(node.getGroup().getText(myView),
patchAttrs(node, showAsReadOnly ? ourReadOnlyAttributes : SimpleTextAttributes.REGULAR_ATTRIBUTES));
setIcon(node.getGroup().getIcon(expanded));
}
int count = node.getRecursiveUsageCount();
SimpleTextAttributes attributes = patchAttrs(node, ourNumberOfUsagesAttribute);
append(FontUtil.spaceAndThinSpace() + StringUtil.pluralize(count + " " + myPresentation.getUsagesWord(), count),
SimpleTextAttributes.GRAYED_ATTRIBUTES.derive(attributes.getStyle(), null, null, null));
} else if (treeNode instanceof UsageNode) {
UsageNode node = (UsageNode) treeNode;
setIcon(node.getUsage().getPresentation().getIcon());
if (showAsReadOnly) {
append(UsageViewBundle.message("node.readonly") + " ", patchAttrs(node, ourReadOnlyAttributes));
}
if (node.isValid()) {
TextChunk[] text = node.getUsage().getPresentation().getText();
PsiElement psiElement = node.getPsiElement();
String signature = null;
// boolean isCryptoMisuse = false;
for (int i = 0; i < text.length; i++) {
TextChunk textChunk = text[i];
SimpleTextAttributes simples = textChunk.getSimpleAttributesIgnoreBackground();
// if (isCryptoMisuse) {
// simples = new SimpleTextAttributes(SimpleTextAttributes.STYLE_BOLD, JBColor.RED);
// }
append(textChunk.getText() + (i == 0 ? " " : ""), patchAttrs(node, simples), true);
}
if (psiElement instanceof PsiMethodCallExpression) {
ArrayList<String> usedPermissons = getUsedPermissions(psiElement);
if (usedPermissons != null) {
append(" > use permission: ");
for (String perm : usedPermissons) {
append(perm.split("\\.")[2] + " ");
}
}
} else if (psiElement instanceof XmlTag) {
ArrayList<String> advertisedPermissons = getAdvertisedPermissions(psiElement);
if (advertisedPermissons != null) {
String textMessage = getMessage(psiElement);
if (textMessage.isEmpty()) {
append(String.format(" > this %s and its associated layout can infer permissions: ", ((XmlTag) psiElement).getName().toLowerCase()));
} else {
append(String.format(" > this %s with %s can infer permissions: ", ((XmlTag) psiElement).getName().toLowerCase(), textMessage));
}
for (String perm : advertisedPermissons) {
append(perm.split("\\.")[2] + " ");
}
}
}
}
} else if (userObject instanceof String) {
append((String) userObject, SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES);
} else {
append(userObject == null ? "" : userObject.toString(), SimpleTextAttributes.REGULAR_ATTRIBUTES);
}
} else {
append(value.toString(), SimpleTextAttributes.REGULAR_ATTRIBUTES);
}
SpeedSearchUtil.applySpeedSearchHighlighting(tree, this, true, mySelected);
}
private String getMessage(PsiElement psiElement) {
StringBuilder stringBuilder = new StringBuilder();
ArrayList<String> textData = null;
for (Map.Entry<XmlTag, ArrayList<String>> map : Holder.getTagKeywordsMapping().entrySet()) {
if (map.getKey().equals(psiElement)) {
textData = map.getValue();
break;
}
}
if (textData != null) {
stringBuilder.append("text as ");
for (int i = 0; i < textData.size(); i++) {
if (i != textData.size() - 1) {
stringBuilder.append(textData.get(i) + " and ");
} else {
stringBuilder.append(textData.get(i));
}
}
}
return stringBuilder.toString();
}
private ArrayList<String> getUsedPermissions(PsiElement psiElement) {
for (UIElement uiElement : Holder.getUiElements()) {
if (uiElement.getCodeFile().equals(psiElement.getContainingFile())) {
for (Method method : uiElement.getUiInteractiveMethods()) {
if (method.getCodeLinePermissionMappings().keySet().contains(psiElement)) {
return method.getCodeLinePermissionMappings().get(psiElement);
}
}
}
}
return null;
}
private ArrayList<String> getAdvertisedPermissions(PsiElement psiElement) {
if (Holder.getTagKeywordsMapping().containsKey(psiElement)) {
return PermissionHelper.inferPermissionsFromText(Holder.getTagKeywordsMapping().get(psiElement));
}
return null;
}
// computes the node text regardless of the node visibility
@NotNull
String getPlainTextForNode(Object value) {
boolean showAsReadOnly = false;
StringBuilder result = new StringBuilder();
if (value instanceof Node) {
Node node = (Node) value;
if (!node.isValid()) {
result.append(UsageViewBundle.message("node.invalid")).append(" ");
}
if (myPresentation.isShowReadOnlyStatusAsRed() && node.isReadOnly()) {
showAsReadOnly = true;
}
}
if (value instanceof DefaultMutableTreeNode) {
DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode) value;
Object userObject = treeNode.getUserObject();
if (userObject instanceof UsageTarget) {
UsageTarget usageTarget = (UsageTarget) userObject;
if (usageTarget.isValid()) {
final ItemPresentation presentation = usageTarget.getPresentation();
LOG.assertTrue(presentation != null);
if (showAsReadOnly) {
result.append(UsageViewBundle.message("node.readonly")).append(" ");
}
final String text = presentation.getPresentableText();
result.append(text == null ? "" : text);
} else {
result.append(UsageViewBundle.message("node.invalid"));
}
} else if (treeNode instanceof GroupNode) {
GroupNode node = (GroupNode) treeNode;
if (node.isRoot()) {
result.append(StringUtil.capitalize(myPresentation.getUsagesWord()));
} else {
result.append(node.getGroup().getText(myView));
}
int count = node.getRecursiveUsageCount();
result.append(" (").append(StringUtil.pluralize(count + " " + myPresentation.getUsagesWord(), count)).append(")");
} else if (treeNode instanceof UsageNode) {
UsageNode node = (UsageNode) treeNode;
if (showAsReadOnly) {
result.append(UsageViewBundle.message("node.readonly")).append(" ");
}
if (node.isValid()) {
TextChunk[] text = node.getUsage().getPresentation().getText();
for (TextChunk textChunk : text) {
result.append(textChunk.getText());
}
}
} else if (userObject instanceof String) {
result.append((String) userObject);
} else {
result.append(userObject == null ? "" : userObject.toString());
}
} else {
result.append(value);
}
return result.toString();
}
enum RowLocation {
BEFORE_VISIBLE_RECT, INSIDE_VISIBLE_RECT, AFTER_VISIBLE_RECT
}
@NotNull
RowLocation isRowVisible(int row, @NotNull Rectangle visibleRect) {
Dimension pref;
if (cachedPreferredSize == null) {
cachedPreferredSize = pref = getPreferredSize();
} else {
pref = cachedPreferredSize;
}
pref.width = Math.max(visibleRect.width, pref.width);
myRowBoundsCalled = true;
JTree tree = getTree();
final Rectangle bounds = tree == null ? null : tree.getRowBounds(row);
myRowBoundsCalled = false;
if (bounds != null) {
myRowHeight = bounds.height;
}
int y = bounds == null ? 0 : bounds.y;
TextRange vis = TextRange.from(Math.max(0, visibleRect.y - pref.height), visibleRect.height + pref.height * 2);
boolean inside = vis.contains(y);
if (inside) {
return UsageViewTreeCellRenderer.RowLocation.INSIDE_VISIBLE_RECT;
}
return y < vis.getStartOffset() ? UsageViewTreeCellRenderer.RowLocation.BEFORE_VISIBLE_RECT : UsageViewTreeCellRenderer.RowLocation.AFTER_VISIBLE_RECT;
}
private static SimpleTextAttributes patchAttrs(@NotNull Node node, @NotNull SimpleTextAttributes original) {
if (node.isExcluded()) {
original = new SimpleTextAttributes(original.getStyle() | SimpleTextAttributes.STYLE_STRIKEOUT, original.getFgColor(), original.getWaveColor());
}
if (node instanceof GroupNode) {
UsageGroup group = ((GroupNode) node).getGroup();
FileStatus fileStatus = group != null ? group.getFileStatus() : null;
if (fileStatus != null && fileStatus != FileStatus.NOT_CHANGED) {
original = new SimpleTextAttributes(original.getStyle(), fileStatus.getColor(), original.getWaveColor());
}
DefaultMutableTreeNode parent = (DefaultMutableTreeNode) node.getParent();
if (parent != null && parent.isRoot()) {
original = new SimpleTextAttributes(original.getStyle() | SimpleTextAttributes.STYLE_BOLD, original.getFgColor(), original.getWaveColor());
}
}
return original;
}
static String getTooltipFromPresentation(final Object value) {
String tooltip = null;
if (value instanceof DefaultMutableTreeNode) {
DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode) value;
if (treeNode instanceof UsageNode) {
UsageNode node = (UsageNode) treeNode;
PsiElement psiElement = node.getPsiElement();
tooltip = node.getUsage().getPresentation().getTooltipText();
// if (psiElement != null) {
// String signature = LibraryDependenciesBuilder.getMethodSignature(psiElement);
// if (signature != null) {
// LibraryDependenciesBuilder dependenciesBuilder = LibraryDependenciesBuilder.getInstance(psiElement.getProject());
//
// HashMap<String, CryptoIssue> usedAPIs = dependenciesBuilder.getUsedAPIs();
// CryptoIssue issue = usedAPIs.get(signature);
// if (issue != null) {
// tooltip = "Location: " + issue.getMethod() +
// "\nBroken Rule:" + issue.getRuleName() +
// "\nDetails: " + issue.getDetails();
// }
//
// } else {
//
// tooltip = node.getUsage().getPresentation().getTooltipText();
// }
// } else {
// tooltip = node.getUsage().getPresentation().getTooltipText();
// }
}
}
return tooltip;
}
}
| [
"bao.nguyen@cispa.saarland"
] | bao.nguyen@cispa.saarland |
ff3949df3b2a84f6cff78856683992ab8a473ffc | 69cf6aca894aa98df793b7ad90ff12eb62793427 | /facetime-spring/src/main/java/com/facetime/spring/logic/LogicImpl.java | 38449884ad13578814602595491b4a815d5bae3f | [
"MIT"
] | permissive | luckyufei/facetime | 4bec8a729f42942d189b550b489714799775a087 | f8301b4a0f3b633a417ea24456a4caaee9e6793f | refs/heads/master | 2022-03-28T10:37:37.919416 | 2016-03-11T11:07:37 | 2016-03-11T11:07:37 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 527 | java | package com.facetime.spring.logic;
import com.facetime.spring.dao.Dao;
import com.facetime.spring.dao.DaoImpl;
import com.facetime.spring.support.Locator;
/**
* 默认的业务层接口实现类
*
* @author YUFEI
*/
public class LogicImpl extends DaoImpl implements Logic {
private Locator locator;
public Locator getLocator() {
return locator;
}
public <T extends Dao> T locate(Class<T> clazz) {
return getLocator().locate(clazz);
}
public void setLocator(Locator locator) {
this.locator = locator;
}
}
| [
"googleyufei@qq.com"
] | googleyufei@qq.com |
9c76ec55e54d1bf0eba4fd00de7fc570b525dc6e | 14a5e563a279c8345ebcb9ed44eecaa6fc973c1d | /src/main/java/com/emit/resume/domain/CvInfo.java | cb1c24663461b5773c544ae92b38c285561ccb25 | [] | no_license | wanggang1906/resume-resolver-background | 1c58a83f9c37e42409dbf5628801379fe91b4cc7 | dc1bbc44c148b0e64a884586ec9c695430982883 | refs/heads/master | 2022-09-12T22:01:45.029761 | 2020-06-03T07:03:52 | 2020-06-03T07:03:52 | 218,706,370 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 485 | java | package com.emit.resume.domain;
import lombok.Data;
import java.util.List;
@Data
public class CvInfo {
//简历信息表
//简历的存储文件名
private String cvName;
//简历的原始文件名
private String originalName;
private String ruleId;
private String uploadId; //uuid3
private String uploadDate;
private String workYears; //简历摘要---工作时间
private String post; //职位
private List<BasicInfo> baseInfo;
}
| [
"1294901911@qq.com"
] | 1294901911@qq.com |
7dcf51b83cc2363a9cd93efd60edf8b1c01cb31a | 8463a173eb869ed0fd4278fe0d071f6ac6990c27 | /src/test/java/com/recommender/RecommendationApplicationIntegrationTest.java | 08aca1983b551c1ffd1e594b41a52fafce1c48f3 | [] | no_license | dboegershausen/recommendation | b99f471f23c355e1e6efc35bd47b4333684d915b | 3783c4f7cac909d89b1e2f1659dc9d89a2c45660 | refs/heads/master | 2022-12-12T03:28:33.027380 | 2020-09-08T19:25:56 | 2020-09-08T19:25:56 | 293,755,315 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 237 | java | package com.recommender;
import org.junit.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
public class RecommendationApplicationIntegrationTest {
@Test
public void contextLoads() {
}
}
| [
"diogo.boegershausen@fluig.com"
] | diogo.boegershausen@fluig.com |
9b2a995ed9239fd3e000d4c86c99ddd7250a2a5a | 9482592bb33fea5961eee8237a8644f25e0321a6 | /job/job-po/src/main/java/com/tsh/job/po/ApplyJobLogPo.java | 8e54b990baeae847717ac3626eb4d40e0edb822d | [] | no_license | zengzw/LLD-JOB | 9a6cba9e21c7f68db29908f79b81fb20205bf119 | 3ba7ebc4d7851ed6675d68a40e3fb7c691061bba | refs/heads/master | 2020-12-24T10:39:50.849659 | 2016-11-08T02:38:59 | 2016-11-08T02:38:59 | 73,141,619 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,527 | java | package com.tsh.job.po;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;
@Entity
@Table(name = "apply_job_log")
public class ApplyJobLogPo implements Serializable{
private static final long serialVersionUID = 1L;
/** 自增ID*/
private Long id;
/** 推送参数*/
private String params;
/** 推送时间*/
private Date createTime;
/** 推送状态。
0:失败,1:成功*/
private Long state;
/** 用户ID*/
private Long appJobId;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "id")
public Long getId() {
return id;
}
public void setId(Long id) {
this.id =id;
}
@Column(name = "params")
public String getParams() {
return params;
}
public void setParams(String params) {
this.params =params;
}
@Column(name = "create_time")
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime =createTime;
}
@Column(name = "state")
public Long getState() {
return state;
}
public void setState(Long state) {
this.state =state;
}
@Column(name = "app_job_id")
public Long getAppJobId() {
return appJobId;
}
public void setAppJobId(Long appJobId) {
this.appJobId =appJobId;
}
}
| [
"zengzw@dtds.com.cn"
] | zengzw@dtds.com.cn |
770a0330a9d861a71b8092f5b0ce2f87ad95034e | e60866a9d4ef7e7494a9adf57ad948775f50a724 | /src/com/bvan/oop/lesson5/format/oop/JsonFormatterTest.java | 388c8f92cb409355d2dc53263c7c71327dde84e7 | [] | no_license | bohdanvan/javaoop-group69 | c157235733542a57a5d7baf87958b205a3ad702c | b9289c7e67a732f38737414309ecec727c221e3f | refs/heads/master | 2021-09-05T10:11:50.585505 | 2018-01-26T09:23:04 | 2018-01-26T09:23:04 | 112,673,348 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 363 | java | package com.bvan.oop.lesson5.format.oop;
import com.bvan.oop.lesson5.format.Product;
/**
* @author bvanchuhov
*/
public class JsonFormatterTest {
public static void main(String[] args) {
JsonFormatter jsonFormatter = new JsonFormatter();
String s = jsonFormatter.format(new Product("iPhone", 999));
System.out.println(s);
}
}
| [
"bodya.van@gmail.com"
] | bodya.van@gmail.com |
10179b7aea7943fa529412e3e3b938cb897b21be | 27b31978795716d17fcb481611f026e5f1a95efe | /code/src/game/world/World.java | 8b17b9bc5b1065f7b903d490e94e862a547b3b2d | [] | no_license | LordMonoxide/malachiteserver-old | fc37ea6c130629a57931f25dd059c74d61099d38 | 51a02a310d0c9825fec48a5c05de0fe3a819fff6 | refs/heads/master | 2021-01-22T11:10:45.875318 | 2013-09-25T15:47:46 | 2013-09-25T15:47:46 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,687 | java | package game.world;
import game.data.Map;
import game.data.util.Time;
import game.network.Connection;
import game.network.packet.EntityAttack;
import game.network.packet.EntityCreate;
import game.network.packet.EntityDestroy;
import game.network.packet.EntityVitals;
import game.pathfinding.AStar;
import game.settings.Settings;
import java.io.File;
import java.util.HashMap;
import java.util.Iterator;
import java.util.concurrent.ConcurrentLinkedDeque;
import network.packet.Packet;
import physics.Sandbox;
public class World implements Runnable {
public String toString() {
return "world '" + _name + "'";
}
private boolean _running;
private Thread _thread;
private Sandbox _sandbox;
private AStar _pathfinder;
private HashMap<String, Region> _region = new HashMap<>();
private HashMap<String, Map> _map = new HashMap<>();
private ConcurrentLinkedDeque<Entity> _entity = new ConcurrentLinkedDeque<>();
private ConcurrentLinkedDeque<EntitySpawn> _entitySpawn = new ConcurrentLinkedDeque<>();
private ConcurrentLinkedDeque<Connection> _connection = new ConcurrentLinkedDeque<>();
private String _name;
public World(String name) {
_name = name;
File d = new File("../data/worlds/" + _name + "/");
d.mkdirs();
_sandbox = new Sandbox();
_sandbox.startSandbox();
_running = true;
_thread = new Thread(this);
_thread.start();
_pathfinder = new AStar();
}
public void destroy() {
_running = false;
_sandbox.stopSandbox();
}
public String getName() {
return _name;
}
public boolean isBlocked(float x, float y, int z) {
int rx = (int)(x % Settings.Map.Size());
int ry = (int)(y % Settings.Map.Size());
if(rx < 0) rx += Settings.Map.Size();
if(ry < 0) ry += Settings.Map.Size();
int mx = (int)x / Settings.Map.Size();
int my = (int)y / Settings.Map.Size();
if(x < 0) mx -= 1;
if(y < 0) my -= 1;
return getRegion(mx, my).isBlocked(rx / Settings.Map.Attrib.Size(), ry / Settings.Map.Attrib.Size(), z);
}
public Region getRegion(int x, int y) {
String name = x + "x" + y;
Region r = _region.get(name);
if(r == null) {
Map m = _map.get(name);
if(m == null) {
m = new Map(_name, x, y);
if(m.load()) {
//System.out.println("Map " + name + " loaded.");
} else {
//System.out.println("Map " + name + " created.");
}
_map.put(name, m);
}
r = new Region(this);
r.setMap(m);
_region.put(name, r);
r.spawn();
}
return r;
}
private void loadRegions(int x, int y, int radius) {
for(int x1 = x - radius; x1 <= x + radius; x1++) {
for(int y1 = y - radius; y1 <= y + radius; y1++) {
getRegion(x1, y1);
}
}
}
public void addEntity(Entity[] e) {
for(Entity entity : e) {
addEntity(entity);
}
}
public void addEntity(Entity e) {
e.world(this);
e.region(getRegion(e.mx(), e.my()));
if(e instanceof EntityPlayer) {
loadRegions(e.mx(), e.my(), 6);
}
_entity.add(e);
e.create();
if(e instanceof EntityLiving) {
if(e instanceof EntityPlayer) {
_connection.add(((EntityPlayer)e).connection);
}
_sandbox.addToSandbox((EntityLiving)e);
}
}
public void removeEntity(Entity[] e) {
for(Entity entity : e) {
removeEntity(entity);
}
}
public void removeEntity(Entity e) {
if(e instanceof EntityPlayer) {
_connection.remove(((EntityPlayer)e).connection);
}
sendEntityDestroyToAll(e);
if(e instanceof EntityLiving) {
_sandbox.removeFromSandbox((EntityLiving)e);
}
_entity.remove(e);
e.world(null);
}
public Entity getEntity(int id) {
for(Entity e : _entity) {
if(e.id == id) return e;
}
return null;
}
public Entity findEntity(String name) {
for(Entity e : _entity) {
if(e.name() != null && e.name().equalsIgnoreCase(name)) {
return e;
}
}
return null;
}
public void send(Packet packet) {
for(Connection c : _connection) {
c.send(packet);
}
}
public void entityAttack(EntityLiving attacker, double angle) {
int damage = attacker.calculateDamage();
boolean attacked = false;
for(Entity e : _entity) {
if(e instanceof EntityLiving) {
EntityLiving defender = (EntityLiving)e;
if(defender.stats != null && defender != attacker) {
//TODO: range needs to depend on item stat
if(attacker.isCloseTo(defender, 60)) {
double x = attacker.x() - defender.x();
double y = attacker.y() - defender.y();
double entityAngle = Math.atan2(y, x);
//TODO: min/max angle needs to depend on item stat
double lowerAngle = angle - Math.PI / 6;
double upperAngle = angle + Math.PI / 6;
if(entityAngle > lowerAngle && entityAngle < upperAngle) {
defender.stats.HP.hurt(damage);
send(new EntityAttack(attacker, defender, damage));
if(defender.stats.HP.val() > 0) {
send(new EntityVitals(defender));
} else {
defender.respawn();
}
attacked = true;
}
}
}
}
}
if(!attacked) {
send(new EntityAttack(attacker, null, 0));
}
}
public void sendEntityDestroyToAll(Entity e) {
send(new EntityDestroy(e));
}
public void sendEntitiesTo(Connection c) {
for(Entity e : _entity) {
c.send(new EntityCreate(e));
}
}
public AStar.Node[] findPath(Entity e, float x, float y) {
return _pathfinder.find(e, x, y);
}
public void scheduleRespawn(Entity e) {
_entitySpawn.add(new EntitySpawn(e, e.spawnTime() + Time.getTime()));
}
public void run() {
while(_running) {
for(Entity e : _entity) {
if(e.spawned()) {
if(e instanceof EntityAI) {
((EntityAI)e).checkMovement();
}
}
}
for(Iterator<EntitySpawn> it = _entitySpawn.iterator(); it.hasNext();) {
EntitySpawn e = it.next();
if(e.time <= Time.getTime()) {
it.remove();
e.entity.spawn();
}
}
}
}
private class EntitySpawn {
private Entity entity;
private double time;
private EntitySpawn(Entity e, double t) {
entity = e;
time = t;
}
}
} | [
"corey@narwhunderful.com"
] | corey@narwhunderful.com |
4dbb9435a0739a4ade8ba6363158e055eff43d76 | 96feca0102a2316e1ff3fbf48c377f4dfe553ef9 | /src/main/java/com/torrens/musicshop/config/MailConfig.java | de31547384df90d1a92e7c0a1192b9ab59c6e9cd | [] | no_license | sergeykorolov/MusicShop | f8d8ad1794325b167bbbff6cb0ecba52c9c51727 | fd58ebcbdf1df0e312ccc475b147e749741f6e70 | refs/heads/master | 2020-04-08T16:59:36.461460 | 2019-09-04T08:44:20 | 2019-09-04T08:44:20 | 159,545,360 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,578 | java | package com.torrens.musicshop.config;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.mail.javamail.JavaMailSenderImpl;
import java.util.Properties;
@Configuration
public class MailConfig {
@Value("${spring.mail.host}")
private String host;
@Value("${spring.mail.username}")
private String username;
@Value("${spring.mail.password}")
private String password;
@Value("${spring.mail.port}")
private int port;
@Value("${spring.mail.protocol}")
private String protocol;
@Value("${mail.debug}")
private String debug;
@Value("${spring.mail.properties.mail.smtp.auth}")
private String auth;
@Value("${spring.mail.properties.mail.smtp.starttls.enable}")
private String enable;
@Bean
public JavaMailSender getMailSender(){
JavaMailSenderImpl mailSender = new JavaMailSenderImpl();
mailSender.setHost(host);
mailSender.setPort(port);
mailSender.setUsername(username);
mailSender.setPassword(password);
Properties properties = mailSender.getJavaMailProperties();
properties.setProperty("mail.transport.protocol", protocol);
properties.setProperty("mail.debug", debug);
properties.setProperty("mail.smtp.auth", auth);
properties.setProperty("mail.smtp.starttls.enable", enable);
return mailSender;
}
}
| [
"korolovsergio@mail.ru"
] | korolovsergio@mail.ru |
455712c28328172d3acda485ee3fc3effc7ba090 | 2c2fe927fc7d2401801e8868b8b904f0d533be51 | /src/main/java/io/daonomic/jackson/visitor/JacksonVisitor.java | 5f1bc675c353cb258356b37d84059fc50b5d2cb2 | [
"Apache-2.0"
] | permissive | daonomic/json-schema | 9c3d0173c5183c93588b889a4c3c9282c639faba | 6323ae85d38b221ca6ea05b3e4ef4aac82d7e80b | refs/heads/master | 2022-11-23T15:39:29.148342 | 2019-07-02T14:16:13 | 2019-07-02T14:16:13 | 131,380,433 | 0 | 0 | Apache-2.0 | 2022-11-16T11:38:04 | 2018-04-28T06:33:35 | Java | UTF-8 | Java | false | false | 2,579 | java | package io.daonomic.jackson.visitor;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.jsonFormatVisitors.*;
import io.daonomic.jackson.domain.JacksonType;
/**
* Common visitor for transforming jackson meta-model to some other form
*/
public class JacksonVisitor extends AbstractVisitor implements JsonFormatVisitorWrapper {
private final ObjectMapper objectMapper;
private JacksonTypeVisitor current;
public JacksonVisitor(ObjectMapper objectMapper) {
this.objectMapper = objectMapper;
}
public JacksonType getJacksonType() {
return current.getType();
}
@Override
public JsonObjectFormatVisitor expectObjectFormat(JavaType type) {
return setCurrent(new ObjectFormatVisitor(type, objectMapper));
}
@Override
public JsonArrayFormatVisitor expectArrayFormat(JavaType type) {
return setCurrent(new ArrayFormatVisitor(objectMapper));
}
@Override
public JsonStringFormatVisitor expectStringFormat(JavaType type) {
return setCurrent(new StringFormatVisitor(objectMapper));
}
@Override
public JsonNumberFormatVisitor expectNumberFormat(JavaType type) {
return setCurrent(new NumberFormatVisitor(objectMapper));
}
@Override
public JsonIntegerFormatVisitor expectIntegerFormat(JavaType type) {
return setCurrent(new IntegerFormatVisitor(objectMapper));
}
@Override
public JsonBooleanFormatVisitor expectBooleanFormat(JavaType type) {
return setCurrent(new BooleanFormatVisitor(objectMapper));
}
@Override
public JsonNullFormatVisitor expectNullFormat(JavaType type) {
return null;
}
@Override
public JsonAnyFormatVisitor expectAnyFormat(JavaType type) {
return null;
}
@Override
public JsonMapFormatVisitor expectMapFormat(JavaType type) {
return null;
}
private <T extends JacksonTypeVisitor> T setCurrent(T current) {
if (this.current != null) {
throw new IllegalStateException("current visitor is already set");
}
this.current = current;
return current;
}
public static JacksonType inspectType(JavaType type, ObjectMapper objectMapper) throws JsonMappingException {
JacksonVisitor visitor = new JacksonVisitor(objectMapper);
objectMapper.acceptJsonFormatVisitor(type, visitor);
return visitor.getJacksonType();
}
}
| [
"dev@0v1se.com"
] | dev@0v1se.com |
91bc929df1e27faaf78408ba4268751d86233319 | 475f598437f3f989b56782a1c06206f54374fd75 | /KonquestLudvin/JuegoObjetos/src/main/java/Jugador/Jugador.java | 4f3524c86e4c09e96011c878bae9275f29f30938 | [] | no_license | LudvinBaquiax56/Konquest_Ludvin | 9e5f26afc8769fd9df5336e1b94a1b8f2758a1a2 | c873015a98bbe536a280de3dd1d98a3aef8a4ca3 | refs/heads/master | 2021-05-21T04:43:23.301714 | 2020-04-02T19:48:02 | 2020-04-02T19:48:02 | 252,547,852 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,980 | 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 Jugador;
import Planeta.Planeta;
/**
*
* @author baquiax
*/
public class Jugador {
private final String nombre;
private int puntos;
private int dineroGalactus;
private Planeta[] planetas;
private final String numeroJugador;
public Jugador(String nombre, int puntos, int dineroGalactus,
Planeta[] planetas, String numeroJugador) {
this.nombre = nombre;
this.puntos = puntos;
this.dineroGalactus = dineroGalactus;
this.planetas = planetas;
this.numeroJugador = numeroJugador;
}
public String getNombre() {
return nombre;
}
public int getPuntos() {
return puntos;
}
public int getDineroGalactus() {
return dineroGalactus;
}
public void setPuntos(int puntos) {
this.puntos = puntos;
}
public void setDineroGalactus(int dineroGalactus) {
this.dineroGalactus = dineroGalactus;
}
public Planeta[] getPlanetas() {
return planetas;
}
public void setPlanetas(Planeta[] planetas) {
this.planetas = planetas;
}
@Override
public String toString() {
return "Jugador" + nombre + ", puntos: " + puntos + ", Galactus." + dineroGalactus;
}
public String getNumeroJugador() {
return numeroJugador;
}
public void agregarPlaneta(Planeta planetaAgregar) {
if (this.planetas[0] == null) {
this.planetas[0] = planetaAgregar;
} else {
Planeta aux[] = new Planeta[(this.planetas).length + 1];
for (int i = 0; i < (this.planetas).length; i++) {
aux[i] = (this.planetas)[i];
}
aux[(this.planetas).length] = planetaAgregar;
this.planetas = aux;
}
}
}
| [
"noreply@github.com"
] | LudvinBaquiax56.noreply@github.com |
43bdc7c1b601c7980d03d7b2a09ed28240f90448 | ef07beca2c3f1686cd3f7a7d62ef87e4fd91c256 | /Hotel Management System/src/hotel/management/system/UpdateCheck.java | c3d117e97434c0f4ebed2f67b49045311b10c6ef | [] | no_license | PradumnaBajoria/hotel-room-booking-application | 9301bfa9d92716958bf73f83100410882f1dac66 | eafd189a4637c2a99af69316c22ebffd985c0617 | refs/heads/master | 2023-06-12T09:24:36.643924 | 2021-07-05T06:12:39 | 2021-07-05T06:12:39 | 381,310,954 | 0 | 0 | null | 2021-06-29T09:32:30 | 2021-06-29T09:32:29 | null | UTF-8 | Java | false | false | 5,520 | java |
package hotel.management.system;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.sql.*;
public class UpdateCheck extends JFrame implements ActionListener{
JButton b1, b2, b3;
Choice c1;
JTextField t1, t2, t3, t4, t5;
UpdateCheck(){
//setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JLabel l1 = new JLabel("Check-in Details");
l1.setFont(new Font("Tahoma", Font.PLAIN, 20));
l1.setForeground(Color.blue);
l1.setBounds(90, 30, 200, 30);
add(l1);
JLabel l2 = new JLabel("Customer ID");
l2.setBounds(30, 80, 100, 20);
add(l2);
c1 = new Choice();
try{
conn c = new conn();
ResultSet rs = c.s.executeQuery("select * from customer");
while(rs.next()){
c1.add(rs.getString("number"));
}
}catch(Exception e){
}
c1.setBounds(200, 80, 150, 25);
add(c1);
JLabel l3 = new JLabel("Room Number");
l3.setBounds(30, 120, 100, 20);
add(l3);
t1 = new JTextField();
t1.setBounds(200, 120, 150, 25);
add(t1);
JLabel l4 = new JLabel("Name");
l4.setBounds(30, 160, 100, 20);
add(l4);
t2 = new JTextField();
t2.setBounds(200, 160, 150, 25);
add(t2);
JLabel l5 = new JLabel("Check-In");
l5.setBounds(30, 200, 100, 20);
add(l5);
t3 = new JTextField();
t3.setBounds(200, 200, 150, 25);
add(t3);
JLabel l6 = new JLabel("Amount Paid");
l6.setBounds(30, 240, 100, 20);
add(l6);
t4 = new JTextField();
t4.setBounds(200, 240, 150, 25);
add(t4);
JLabel l7 = new JLabel("Pending Amount");
l7.setBounds(30, 280, 100, 20);
add(l7);
t5 = new JTextField();
t5.setBounds(200, 280, 150, 25);
add(t5);
b1 = new JButton("Check");
b1.setBackground(Color.black);
b1.setForeground(Color.white);
b1.setBounds(30, 340, 100, 30);
b1.addActionListener(this);
add(b1);
b2 = new JButton("Update");
b2.setBackground(Color.black);
b2.setForeground(Color.white);
b2.setBounds(150, 340, 100, 30);
b2.addActionListener(this);
add(b2);
b3 = new JButton("Back");
b3.setBackground(Color.black);
b3.setForeground(Color.white);
b3.setBounds(270, 340, 100, 30);
b3.addActionListener(this);
add(b3);
ImageIcon i1 = new ImageIcon(ClassLoader.getSystemResource("Hotel/Management/System/icons/nine.jpg"));
JLabel l9 = new JLabel(i1);
l9.setBounds(400, 50, 500, 300);
add(l9);
getContentPane().setBackground(Color.white);
setLayout(null);
setBounds(300, 200, 980, 500);
setVisible(true);
}
public static void main(String[] args) {
new UpdateCheck()
; }
@Override
public void actionPerformed(ActionEvent ae) {
if(ae.getSource()==b1){
try{
String room = null;
String deposit = null;
int amountPaid;
String price = null;
conn c = new conn();
String id = c1.getSelectedItem();
String str = "select * from customer where number = '"+id+"'";
ResultSet rs = c.s.executeQuery(str);
while(rs.next()){
t1.setText(rs.getString("room"));
t2.setText(rs.getString("name"));
t3.setText(rs.getString("status"));
t4.setText(rs.getString("deposit"));
room = rs.getString("room");
deposit = rs.getString("deposit");
}
ResultSet rs2 = c.s.executeQuery("select * from room where room_number = '"+room+"'");
while(rs2.next()){
price = rs2.getString("price");
amountPaid = Integer.parseInt(price) - Integer.parseInt(deposit);
t5.setText(Integer.toString(amountPaid));
}
}catch(Exception e){
}
}else if(ae.getSource()==b2){
try{
conn c = new conn();
String amount = t4.getText();
String check = t3.getText();
String str = "update customer set deposit = '"+amount+"', status = '"+check+"'";
c.s.executeUpdate(str);
JOptionPane.showMessageDialog(null, "Status Updated Successfully");
new Reception().setVisible(true);
this.setVisible(false);
}catch(Exception e){
System.out.println(e);
}
}else if(ae.getSource()==b3){
new Reception().setVisible(true);
this.setVisible(false);
}
//throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
}
| [
"pradumnabajoria@gmail.com"
] | pradumnabajoria@gmail.com |
65b3481ad9609fa3f0e50473ff4dddf675e5db56 | 7dbc40ea98d17fdc2180563c2ffd8b25504714b3 | /javassist/bytecode/InterfaceMethodrefInfo.java | 4dc93300061d12193ff6feefb9754c514183254b | [] | no_license | WarriorCrystal/Zenith-0.7-src | c144e3548f7ae1542df2ce6a29de864aec25b87d | 34fd7a76d0e1b59518c813da6f5dd339a0425d58 | refs/heads/main | 2023-01-21T04:42:58.249921 | 2020-11-29T21:37:31 | 2020-11-29T21:37:31 | 317,043,706 | 1 | 2 | null | null | null | null | UTF-8 | Java | false | false | 839 | java | //
// Decompiled by Procyon v0.5.36
//
package javassist.bytecode;
import java.io.IOException;
import java.io.DataInputStream;
class InterfaceMethodrefInfo extends MemberrefInfo
{
static final int tag = 11;
public InterfaceMethodrefInfo(final int cindex, final int ntindex, final int thisIndex) {
super(cindex, ntindex, thisIndex);
}
public InterfaceMethodrefInfo(final DataInputStream in, final int thisIndex) throws IOException {
super(in, thisIndex);
}
@Override
public int getTag() {
return 11;
}
@Override
public String getTagName() {
return "Interface";
}
@Override
protected int copy2(final ConstPool dest, final int cindex, final int ntindex) {
return dest.addInterfaceMethodrefInfo(cindex, ntindex);
}
}
| [
"68621329+Warrior80@users.noreply.github.com"
] | 68621329+Warrior80@users.noreply.github.com |
40c2ae0ae827f3bda7fd5af46b9846f76e267302 | 655744e94811794f09004d40c3c7cc4761621d33 | /src/main/java/com/greenism/patent/service/impl/TestServiceImpl.java | 80a08a50d4272f2437d793af1c9e27150f14fbd7 | [] | no_license | heng-gezhizou/patent-management-system | 07d2a1bd6a34cddd30c49dcfb8cba9af31579798 | c5a1edbe6258638fb850f26d825008a7524f6a7e | refs/heads/master | 2022-07-01T08:57:49.290172 | 2019-12-20T10:32:31 | 2019-12-20T10:32:31 | 229,027,461 | 0 | 0 | null | 2022-06-21T02:28:47 | 2019-12-19T10:07:59 | Java | UTF-8 | Java | false | false | 133 | java | package com.greenism.patent.service.impl;
import org.springframework.stereotype.Service;
@Service
public class TestServiceImpl {
}
| [
"1873477865@qq.com"
] | 1873477865@qq.com |
971374448094bb6d2a3cc9a39185409848e3dc7b | acde69c5842cd6a31dab86944bb6c71cea1cd88d | /AdminPortal/src/main/java/com/sudin/Service/UserService.java | 225abb18c61e23ce892e73d2554f8a79e1bd5d80 | [] | no_license | sudeen/Bookstore | ac3eb41ea5cedc5111753162f3b3202b2c64de83 | 886d0aca62d1ea5766d2cf3b1bb43ff8fcd8791e | refs/heads/master | 2021-01-20T21:09:04.159451 | 2018-01-26T07:25:19 | 2018-01-26T07:25:19 | 101,753,772 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 307 | java | package com.sudin.Service;
import com.sudin.Domain.Security.UserRole;
import com.sudin.Domain.User;
import java.util.Set;
/**
* Created by s-k-ii-p-s on 8/25/17.
*/
public interface UserService {
User createUser(User user, Set<UserRole> userRoles) throws Exception;
User save(User user);
}
| [
"ranjitkarsudeen14@gmail.com"
] | ranjitkarsudeen14@gmail.com |
b5d6fb79828f2da211efe820300a2abecabe0976 | 1ef9d02af8e1536f2d3ae4523ac0cc9e1ad3eef0 | /Tweetin/src/io/github/mthli/Tweetin/Fragment/FavoriteFragment.java | 56e20b24fcb0fd1e915dd53095b7f915675b58fa | [
"Apache-2.0"
] | permissive | manithnuon/Tweetin | bce1a2e10054753e9f0eeb7e3482075ada3a0418 | 37896f4538123bbcebfe022a3c9f9c33ccb6c1f7 | refs/heads/master | 2020-12-31T02:32:37.763891 | 2014-11-28T16:33:10 | 2014-11-28T16:33:10 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,675 | java | package io.github.mthli.Tweetin.Fragment;
import android.content.*;
import android.graphics.Point;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v4.widget.SwipeRefreshLayout;
import android.view.Display;
import android.view.View;
import android.widget.*;
import com.devspark.progressfragment.ProgressFragment;
import io.github.mthli.Tweetin.R;
import io.github.mthli.Tweetin.Task.Favorite.*;
import io.github.mthli.Tweetin.Task.Unit.CancelTask;
import io.github.mthli.Tweetin.Task.Unit.DeleteTask;
import io.github.mthli.Tweetin.Task.Unit.RetweetTask;
import io.github.mthli.Tweetin.Unit.Flag.Flag;
import io.github.mthli.Tweetin.Unit.Tweet.Tweet;
import io.github.mthli.Tweetin.Unit.Tweet.TweetAdapter;
import io.github.mthli.Tweetin.Unit.Tweet.TweetUnit;
import twitter4j.Twitter;
import java.util.ArrayList;
import java.util.List;
public class FavoriteFragment extends ProgressFragment {
private int refreshFlag = Flag.FAVORITE_TASK_IDLE;
private boolean moveToBottom = false;
private SwipeRefreshLayout swipeRefreshLayout;
public int getRefreshFlag() {
return refreshFlag;
}
public void setRefreshFlag(int refreshFlag) {
this.refreshFlag = refreshFlag;
}
public SwipeRefreshLayout getSwipeRefreshLayout() {
return swipeRefreshLayout;
}
private boolean tweetWithDetail;
private TweetAdapter tweetAdapter;
private List<Tweet> tweetList = new ArrayList<Tweet>();
public boolean isTweetWithDetail() {
return tweetWithDetail;
}
public TweetAdapter getTweetAdapter() {
return tweetAdapter;
}
public List<Tweet> getTweetList() {
return tweetList;
}
private Twitter twitter;
private long useId;
public Twitter getTwitter() {
return twitter;
}
public long getUseId() {
return useId;
}
private FavoriteInitTask favoriteInitTask;
private FavoriteMoreTask favoriteMoreTask;
private DeleteTask deleteTask;
private RetweetTask retweetTask;
private CancelTask cancelTask;
public void setDeleteTask(DeleteTask deleteTask) {
if (this.deleteTask != null && this.deleteTask.getStatus() == AsyncTask.Status.RUNNING) {
this.deleteTask.cancel(true);
}
this.deleteTask = deleteTask;
}
public void setRetweetTask(RetweetTask retweetTask) {
if (this.retweetTask != null && this.retweetTask.getStatus() == AsyncTask.Status.RUNNING) {
this.retweetTask.cancel(true);
}
this.retweetTask = retweetTask;
}
public void setCancelTask(CancelTask cancelTask) {
if (this.cancelTask != null && this.cancelTask.getStatus() == AsyncTask.Status.RUNNING) {
this.cancelTask.cancel(true);
}
this.cancelTask = cancelTask;
}
public boolean isSomeTaskRunning() {
if (
(favoriteInitTask != null && favoriteInitTask.getStatus() == AsyncTask.Status.RUNNING)
|| (favoriteMoreTask != null && favoriteMoreTask.getStatus() == AsyncTask.Status.RUNNING)
) {
return true;
}
return false;
}
public void cancelAllTask() {
if (favoriteInitTask != null && favoriteInitTask.getStatus() == AsyncTask.Status.RUNNING) {
favoriteInitTask.cancel(true);
}
if (favoriteMoreTask != null && favoriteMoreTask.getStatus() == AsyncTask.Status.RUNNING) {
favoriteMoreTask.cancel(true);
}
if (deleteTask != null && deleteTask.getStatus() == AsyncTask.Status.RUNNING) {
deleteTask.cancel(true);
}
if (retweetTask != null && retweetTask.getStatus() == AsyncTask.Status.RUNNING) {
retweetTask.cancel(true);
}
if (cancelTask != null && cancelTask.getStatus() == AsyncTask.Status.RUNNING) {
cancelTask.cancel(true);
}
}
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
setContentView(R.layout.favorite_fragment);
View view = getContentView();
setContentEmpty(false);
setContentShown(true);
twitter = TweetUnit.getTwitterFromSharedPreferences(getActivity());
useId = TweetUnit.getUseIdFromeSharedPreferences(getActivity());
SharedPreferences sharedPreferences = getActivity().getSharedPreferences(
getString(R.string.sp_name),
Context.MODE_PRIVATE
);
tweetWithDetail = sharedPreferences.getBoolean(
getString(R.string.sp_is_tweet_with_detail),
false
);
ListView listView = (ListView) view
.findViewById(R.id.favorite_fragment_listview);
tweetAdapter = new TweetAdapter(
getActivity(),
R.layout.tweet,
tweetList,
tweetWithDetail
);
listView.setAdapter(tweetAdapter);
tweetAdapter.notifyDataSetChanged();
swipeRefreshLayout = (SwipeRefreshLayout) view
.findViewById(R.id.favorite_swipe_container);
swipeRefreshLayout.setColorSchemeResources(
R.color.text,
R.color.secondary_text,
R.color.text,
R.color.secondary_text
);
Display display = getActivity()
.getWindowManager()
.getDefaultDisplay();
Point size = new Point();
display.getSize(size);
int height = size.y;
swipeRefreshLayout.setProgressViewOffset(
false,
0,
height / 10
);
swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
favoriteInitTask = new FavoriteInitTask(
FavoriteFragment.this,
true
);
favoriteInitTask.execute();
}
});
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
TweetUnit.tweetToDetailActivity(
getActivity(),
tweetList,
position
);
}
});
listView.setOnScrollListener(new AbsListView.OnScrollListener() {
private int previous = 0;
@Override
public void onScrollStateChanged(AbsListView view, int scrollState) {
/* Do nothing */
}
@Override
public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
if (previous < firstVisibleItem) {
moveToBottom = true;
}
if (previous > firstVisibleItem) {
moveToBottom = false;
}
previous = firstVisibleItem;
if (totalItemCount == firstVisibleItem + visibleItemCount) {
if (!isSomeTaskRunning() && moveToBottom) {
favoriteMoreTask = new FavoriteMoreTask(FavoriteFragment.this);
favoriteMoreTask.execute();
}
}
}
});
favoriteInitTask = new FavoriteInitTask(
FavoriteFragment.this,
false
);
favoriteInitTask.execute();
}
}
| [
"matthewlee0725@gmail.com"
] | matthewlee0725@gmail.com |
a1b5acfcdb56b5c4a9efec4a561adbcacf89b810 | 42aa4c4d1232f94d4257bd32b93fa1aa241ad720 | /src/web/servlet/LoginServlet.java | 797193c6d66eeb41957a3685ca1d900179d86750 | [] | no_license | sqmwin/MySQLTest | c1099b45827c870563514c1756543ef1f48ce1ef | 0c89053ea0feacd36ed3cb4958a1156926105fa4 | refs/heads/master | 2021-05-06T20:34:16.622291 | 2017-11-30T12:26:31 | 2017-11-30T12:26:31 | 112,320,823 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,602 | java | package web.servlet;
import domain.User;
import exception.LoginException;
import service.UserService;
import java.io.IOException;
/**
* <p>
* 登陆验证
* </p>
*
* @author sqm
* @version 1.0
*/
@javax.servlet.annotation.WebServlet(name = "LoginServlet", urlPatterns = "/loginservlet")
public class LoginServlet extends javax.servlet.http.HttpServlet {
@Override
protected void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException {
request.setCharacterEncoding("utf-8");
response.setContentType("text/html;charset=utf-8");
/*
验证登陆用户名和密码是否正确
正确则重定向至登陆成功页面
错误则转发回登陆页面
*/
//取得输入的验证码
String code = request.getParameter("code");
//取得保存在session中的实际验证码字符串
String trueCode = (String) request.getSession().getAttribute("verificationCode");
//对比验证码是否正确(将输入的验证码转换成小写后对比)
if (code.toLowerCase().equals(trueCode)) {
//验证码正确则比较user的用户名和密码
//封装属性至TO对象
User user = new User();
String username = request.getParameter("username");
String password = request.getParameter("password");
user.setUsername(username);
user.setPassword(password);
//调用service中的登陆方法
UserService userService = new UserService();
try {
User existUser = userService.login(user);
//判断existUser是否为null
if (existUser == null) {
//登陆失败,用户名和密码错误
request.setAttribute("login.message", "用户名或密码错误");
//转发回原登陆页面,地址是服务器内地址
request.getRequestDispatcher("/jsp/login.jsp").forward(request, response);
} else {
//登陆成功,带着existUser对象重定向至登陆成功页面
request.getSession().setAttribute("user", existUser);
response.sendRedirect(request.getContextPath() + "/jsp/success.jsp");
}
} catch (LoginException e) {
//登陆产生异常
request.setAttribute("login.message", e.getMessage());
//带着异常转发回原登陆页面
request.getRequestDispatcher("/jsp/login.jsp").forward(request, response);
e.printStackTrace();
}
} else {
//验证码输入错误
//如果输入的验证码错误或者为null,则转发回原页面并提示"验证码输入错误"
//为什么用转发不用重定向?因为转发是一次请求一次响应可以携带信息回原页面
request.setAttribute("login.message", "验证码输入错误");
//转发的路径是服务器内的路径
request.getRequestDispatcher("/jsp/login.jsp").forward(request, response);
}
}
@Override
protected void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException {
//doGet方法和doPost方法相同时使用
this.doGet(request, response);
}
}
| [
"sqmwin@Hotmail.com"
] | sqmwin@Hotmail.com |
27c945a07246dbfc71d3e571abbbd55faeadd394 | 1249f91d6ffc3570ece012107d8ef2639a72cbec | /HashTable/575.DistributeCandies/distributeCandies.java | da490d063af278db692ba0566f70527dd02184af | [
"Apache-2.0"
] | permissive | AllenInWood/LeetcodeProblemSet | 4f34e649d84322fd91964eb403260e8bff81150b | b14aebbdcb4e993418d3da2fc8181a330804298b | refs/heads/master | 2020-03-09T07:15:32.051675 | 2018-08-16T03:36:05 | 2018-08-16T03:36:05 | 128,660,558 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 319 | java | class Solution {
public int distributeCandies(int[] candies) {
Set<Integer> hash = new HashSet<>();
for (int candy : candies) {
hash.add(candy);
}
if (hash.size() > candies.length / 2) {
return candies.length / 2;
}
return hash.size();
}
} | [
"alleninwood@gmail.com"
] | alleninwood@gmail.com |
aee55cb193505b87c270e976531c268000046a8f | 2afc52f58a95710740f58d1d36518bef8e6129a1 | /NewWorkSpace/chapter14/src/exercise14_9/StringReversal.java | dd8e07d6c883bedd3ed46625db8e40ed372e1092 | [] | no_license | tboydv1/java_projects | dc6b2621d0be5e816b8dda98216dbc4159a9646e | 0b98c37fc6a265fc1c0c76ed40d9ca33d655fb44 | refs/heads/master | 2021-07-17T14:00:44.826192 | 2020-09-25T11:30:36 | 2020-09-25T11:30:36 | 215,282,069 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 559 | java | package exercise14_9;
public class StringReversal {
String[] tokens;
public String[] getTokens() {
return tokens;
}
public void setTokens(String[] tokens) {
this.tokens = tokens;
}
public void tokenizeString(String sentence) {
tokens = sentence.split(" ");
}
public String reverseTokens() {
StringBuilder reversedTokens = new StringBuilder();
for(int i = 0; i < tokens.length; i++) {
reversedTokens.insert(0, tokens[i])
.insert(0, " ");
}
return String.format("%s", reversedTokens.toString());
}
}
| [
"tboydv1@gmail.com"
] | tboydv1@gmail.com |
9747c7287315f2cc2e16541b56d81e967d3d3344 | b6d484cc6bbff19b6f2f1752edcdb071f40f296c | /TestesUnitarios/src/ExercicioQ2/TesteGoogleAgenda.java | 9ee2243aceaad789b809b35e0048e1eea7c1c279 | [] | no_license | joserobertobbezerrajnr/ListasProgramcao2Unifacisa | 7d50e26b58b97a75a1ea0278ab9b20ddce4880e0 | 3962148a314bb1c230f25011cbcfa04e5f7b4e5c | refs/heads/master | 2022-11-05T04:48:29.507547 | 2020-06-16T01:25:16 | 2020-06-16T01:25:16 | null | 0 | 0 | null | null | null | null | MacCentralEurope | Java | false | false | 4,146 | java | package ExercicioQ2;
import static org.junit.jupiter.api.Assertions.*;
import org.junit.jupiter.api.Test;
import static org.junit.Assert.*;
import java.util.ArrayList;
import java.util.Arrays;
import org.junit.Before;
public class TesteGoogleAgenda {
private Reuniao a;
private Reuniao b;
private Reuniao c;
private Reuniao d;
private GoogleAgenda google;
@Before
public void setUp() {
google = new GoogleAgenda();
a = new Reuniao (new Data ((short) 10, (short) 11, (short) 2020, (short) 12, (short) 13), new ArrayList <String> (Arrays.asList ("Josť", "Roberto")));
b = new Reuniao (new Data ((short) 9, (short) 11, (short) 2020, (short) 12, (short) 15), new ArrayList <String> (Arrays.asList ("Josť", "Roberto")));
c = new Reuniao (new Data ((short) 11, (short) 11, (short) 2020, (short) 12, (short) 16), new ArrayList <String> (Arrays.asList ("Josť ", "Roberto")));
d = new Reuniao (new Data ((short) 12, (short) 11, (short) 2020, (short) 12, (short) 17), new ArrayList <String> (Arrays.asList ("Josť", "Roberto")));
}
@Test
public void testToStringReuniao() {
}
@Test
public void testAdicionaReuniao() {
google.adicionarReuniao(a);
assertEquals(1, google.getQuantidadeReunioes());
google.adicionarReuniao(b);
google.adicionarReuniao(c);
google.adicionarReuniao(d);
google.adicionarReuniao(b);
google.adicionarReuniao(c);
google.adicionarReuniao(d);
google.adicionarReuniao(b);
google.adicionarReuniao(c);
google.adicionarReuniao(d);
assertEquals(10, google.getQuantidadeReunioes());
google.adicionarReuniao(d);
assertEquals(20, google.getTamanhoReunioes());
assertEquals(11, google.getQuantidadeReunioes());
google.adicionarReuniao(d);
google.adicionarReuniao(d);
google.adicionarReuniao(d);
assertEquals(14, google.getQuantidadeReunioes());
google.adicionarReuniao(a);
google.adicionarReuniao(b);
google.adicionarReuniao(c);
google.adicionarReuniao(d);
google.adicionarReuniao(b);
google.adicionarReuniao(c);
google.adicionarReuniao(d);
google.adicionarReuniao(b);
google.adicionarReuniao(c);
google.adicionarReuniao(d);
assertEquals(24, google.getQuantidadeReunioes());
assertEquals(40, google.getTamanhoReunioes());
}
@Test
public void testDuplica(){
google.adicionarReuniao(a);
google.adicionarReuniao(a);
google.adicionarReuniao(a);
google.adicionarReuniao(a);
google.adicionarReuniao(a);
google.adicionarReuniao(a);
google.adicionarReuniao(a);
google.adicionarReuniao(a);
google.adicionarReuniao(a);
google.adicionarReuniao(a);
assertEquals(10, google.getTamanhoReunioes());
google.adicionarReuniao(a);
assertEquals(20, google.getTamanhoReunioes());
}
@Test
public void testGetReunioesDia() {
google.adicionarReuniao(a);
google.adicionarReuniao(a);
google.adicionarReuniao(c);
google.adicionarReuniao(d);
google.adicionarReuniao(a);
google.adicionarReuniao(b);
google.adicionarReuniao(c);
google.adicionarReuniao(d);
google.adicionarReuniao(c);
google.adicionarReuniao(d);
for(Reuniao r: google.getReunioesDia(new Data ((short) 12, (short) 11, (short) 2020, (short) 12, (short) 17))) {
assertEquals(12, r.getData().getDia());
};
}
@Test
public void testGetReuniaoMaisLonga() {
google.adicionarReuniao(a);
google.adicionarReuniao(b);
google.adicionarReuniao(c);
google.adicionarReuniao(d);
google.adicionarReuniao(a);
google.adicionarReuniao(a);
google.adicionarReuniao(a);
google.adicionarReuniao(a);
google.adicionarReuniao(a);
google.adicionarReuniao(a);
}
@Test
public void TesteRemoverParticipante() {
google.adicionarReuniao(a);
google.adicionarReuniao(b);
google.adicionarReuniao(c);
google.adicionarReuniao(d);
google.adicionarReuniao(a);
google.adicionarReuniao(a);
google.adicionarReuniao(a);
google.adicionarReuniao(a);
google.adicionarReuniao(a);
google.adicionarReuniao(a);
google.removerParticipante("Josť");
assertEquals(1,a.getParticipantes().size());
}
}
| [
"noreply@github.com"
] | joserobertobbezerrajnr.noreply@github.com |
78d1204040af613b5df06db7d8336c4441adc7fd | 107ec89ec5cd1e26155a07ca5c828913938cc9f1 | /appengine-spring-boot-starter/src/test/java/zlavallee/appengine/AppEngineApplication.java | fc1bf26ef338fe9b547227b9d66b2a63f70974df | [
"Apache-2.0"
] | permissive | zlavallee/appengine-spring-boot | ec8a100747ed9231bb2a170b65c5e8e28f4b0a50 | d3db270971e074acab19c27ddabb48fd9c7f749a | refs/heads/main | 2023-08-13T12:21:59.724439 | 2021-10-11T23:53:48 | 2021-10-11T23:53:48 | 415,704,777 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 322 | java | package zlavallee.appengine;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class AppEngineApplication {
public static void main(String[] args) {
SpringApplication.run(AppEngineApplication.class, args);
}
}
| [
"zlavallee@gmail.com"
] | zlavallee@gmail.com |
f168eb72f7ffa5a870873884bc20e6bba9f091d3 | fef5251dbb4f37ef642283c1b38cbab18c613171 | /app/src/main/java/com/shopnobuilder/digitalrailway/AddTrackingActivity.java | d9cf4d09c6c0fd32446ba6cfcc13125666bcf7b6 | [] | no_license | shaponpal6/Digital-Railway-Android-App | bdaead434aa149d75447a69bf9ec9d8d5a0c8e4f | 5bd8085ea9f4a668b90d42930f8dfed16dd5eda5 | refs/heads/master | 2022-12-08T12:53:51.225058 | 2020-09-06T08:05:03 | 2020-09-06T08:05:03 | 291,622,644 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,623 | java | package com.shopnobuilder.digitalrailway;
import android.content.Context;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.AutoCompleteTextView;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.Toast;
import com.shopnobuilder.digitalrailway.httpRequest.Constant;
import com.shopnobuilder.digitalrailway.httpRequest.HttpRequestHandler;
import com.shopnobuilder.digitalrailway.tracking.addTracking.AutocompleteTrainAdapter;
import com.shopnobuilder.digitalrailway.tracking.addTracking.AutocompleteTrains;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
public class AddTrackingActivity extends AppCompatActivity {
// Custom
private List<AutocompleteTrains> trains;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_add_tracking);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
// Drop Down
final AutoCompleteTextView trNameFilter = (AutoCompleteTextView) findViewById(R.id.tracking_tr_name);
ImageView trImg1 = (ImageView) findViewById(R.id.aro2);
final AutoCompleteTextView actv1 = (AutoCompleteTextView) findViewById(R.id.tracking_tr_name);
ImageView aro = (ImageView) findViewById(R.id.aro1);
Button submit = (Button) findViewById(R.id.tracking_submit_btn);
// Train Name filter
fillTrains();
AutoCompleteTextView actv_tr_name = (AutoCompleteTextView)findViewById(R.id.tracking_tr_name);
AutocompleteTrainAdapter autoCompleteCountryAdapter = new AutocompleteTrainAdapter(this, trains);
actv_tr_name.setAdapter(autoCompleteCountryAdapter);
//---------------old------------ ok --------------
// ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,R.layout.support_simple_spinner_dropdown_item,colors);
// actv1.setAdapter(adapter);
//Expend Dropdown
aro.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
actv1.showDropDown();
}
});
// Submit
submit.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
String color = actv1.getText().toString();
Toast.makeText(getApplicationContext(), "Color: "+ color, Toast.LENGTH_LONG).show();
// Create Tracking
createTracking(view);
}
});
//--------------------------- ok ---------------
}
private static final String[] colors = new String[]{"Red","white","green","Blue"};
// Create
public void createTracking(View view){
// Initialize EditText View
EditText mTrName = (EditText) findViewById(R.id.tracking_tr_name);
EditText mTrForm = (EditText) findViewById(R.id.tracking_tr_from);
EditText mTrTo = (EditText) findViewById(R.id.tracking_tr_to);
EditText mTrCurrentStation = (EditText) findViewById(R.id.tracking_tr_current_station);
EditText mTrStatus = (EditText) findViewById(R.id.tracking_tr_status);
EditText mTrDelay = (EditText) findViewById(R.id.tracking_tr_delay);
Button mTracking_submit_btn = (Button) findViewById(R.id.tracking_submit_btn);
String trName = mTrName.getText().toString();
String trForm = mTrForm.getText().toString();
String trTo = mTrTo.getText().toString();
String trCurrentStation = mTrCurrentStation.getText().toString();
String trStatus = mTrStatus.getText().toString();
String trDelay = mTrDelay.getText().toString();
HashMap<String, String> trParams = new HashMap<>();
trParams.put("tr_name", trName);
trParams.put("tr_form", trForm);
trParams.put("tr_to", trTo);
trParams.put("current_station", trCurrentStation);
trParams.put("tracking_status", trStatus);
trParams.put("delay_time", trDelay);
//Log.d("HashMap", requestedParams.get("tr_name"));
//Toast.makeText(getApplicationContext(), "Success!!! Employee Added Name: " + trParams.get("tr_name"), Toast.LENGTH_LONG).show();
//HttpPostRequest httpPostRequest = new HttpPostRequest(Constant.CREATE_URL, requestedParams);
//httpPostRequest.execute();
HttpPostRequest httpPostRequest = new HttpPostRequest(this, Constant.CREATE_URL, trParams);
httpPostRequest.execute();
//HttpPostRequest postRequestHandler = new HttpPostRequest(Constant.CREATE_URL, requestedParams);
//postRequestHandler.execute();
}
// Demo Data
private void fillTrains() {
trains = new ArrayList<>();
trains.add(new AutocompleteTrains("Bromopotro", "Dhaka", "Daugong"));
trains.add(new AutocompleteTrains("Breujs", "Dhaka", "Daugong"));
trains.add(new AutocompleteTrains("Bare", "Dhaka", "Daugong"));
trains.add(new AutocompleteTrains("Chotla", "Chittagong", "Daugong"));
trains.add(new AutocompleteTrains("Abu", "Dhaka", "Daugong"));
trains.add(new AutocompleteTrains("Bromopotro", "Dhaka", "Daugong"));
trains.add(new AutocompleteTrains("Bromopotro", "Dhaka", "Daugong"));
trains.add(new AutocompleteTrains("Bromopotro", "Dhaka", "Daugong"));
trains.add(new AutocompleteTrains("Bromopotro", "Dhaka", "Daugong"));
trains.add(new AutocompleteTrains("Bromopotro", "Dhaka", "Daugong"));
trains.add(new AutocompleteTrains("Bromopotro", "Dhaka", "Daugong"));
trains.add(new AutocompleteTrains("Bromopotro", "Dhaka", "Daugong"));
trains.add(new AutocompleteTrains("Bromopotro", "Dhaka", "Daugong"));
trains.add(new AutocompleteTrains("Bromopotro", "Dhaka", "Daugong"));
trains.add(new AutocompleteTrains("Bromopotro", "Dhaka", "Daugong"));
trains.add(new AutocompleteTrains("Bromopotro", "Dhaka", "Daugong"));
trains.add(new AutocompleteTrains("Bromopotro", "Dhaka", "Daugong"));
trains.add(new AutocompleteTrains("Bromopotro", "Dhaka", "Daugong"));
trains.add(new AutocompleteTrains("Bromopotro", "Dhaka", "Daugong"));
trains.add(new AutocompleteTrains("Bromopotro", "Dhaka", "Daugong"));
}
// Send Post Request
public class HttpPostRequest extends AsyncTask<Void, Void, String> {
Context context;
// Request URL
String url;
// Key, Value pair
HashMap<String, String> requestedParams;
public HttpPostRequest(Context c, String url, HashMap<String, String> params){
this.context = c;
this.url = url;
this.requestedParams = params;
// Log.d("Input Box", designation);
}
@Override
protected void onPreExecute() {
super.onPreExecute();
//progressBar.setVisibility(View.VISIBLE);
}
@Override
protected String doInBackground(Void... voids) {
// Now Send a post request
HttpRequestHandler backgroundWorker = new HttpRequestHandler();
try {
String s = backgroundWorker.postRequestHandler(url, requestedParams);
// Log.d("HashMap--------", requestedParams.get("salary"));
// Log.d("Results------", s.toString());
// Toast.makeText(getApplicationContext(), s.toString(), Toast.LENGTH_LONG).show();
return s.toString();
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
return null;
}
@Override
protected void onPostExecute(String s) {
super.onPostExecute(s);
//progressBar.setVisibility(GONE);
//Toast.makeText(getApplicationContext, "Result : " + s, Toast.LENGTH_LONG).show();
if (s != null){
startActivity(new Intent(AddTrackingActivity.this, ViewTrackingActivity.class));
Toast.makeText(context, "Return Result: "+s, Toast.LENGTH_LONG).show();
}else {
Toast.makeText(context, "Sorry Not Added Tracking !! Return Result: "+s, Toast.LENGTH_LONG).show();
}
}
}
}
| [
"shaponpal4@gmail.com"
] | shaponpal4@gmail.com |
df59bf7f7c204adb325bdae71b666a470fe8c522 | 2da67a63e7dd9effdf4661decb1fcec04a99c9d9 | /src/main/java/com/xie/leetcode/binarySearchFirstAndLast34/Solution1.java | c2d469da1d1f4a0b9fa5638116a060c69159a585 | [] | no_license | xieyfei/leetcode | 819694209e903268d6af2dde34976c486426ee6e | 27af66910f55f45444af17b03e53c1489a251d75 | refs/heads/master | 2023-02-14T18:13:38.481997 | 2021-01-09T09:23:17 | 2021-01-09T09:23:17 | 263,654,553 | 0 | 0 | null | 2020-10-13T21:57:57 | 2020-05-13T14:31:46 | Java | UTF-8 | Java | false | false | 2,654 | java | package com.xie.leetcode.binarySearchFirstAndLast34;
import java.util.Arrays;
/**
* 给定一个按照升序排列的整数数组 nums,和一个目标值 target。找出给定目标值在数组中的开始位置和结束位置。
*
* 你的算法时间复杂度必须是 O(log n) 级别。
*
* 如果数组中不存在目标值,返回 [-1, -1]。
*
* 来源:力扣(LeetCode)
* 链接:https://leetcode-cn.com/problems/find-first-and-last-position-of-element-in-sorted-array
* 著作权归领扣网络所有。商业转载请联系官方授权,非商业转载请注明出处。
*/
public class Solution1 {
public static void main(String[] args) {
Solution1 s = new Solution1();
int[] nums = {5,7,7,8,8,8,10};
System.out.println(Arrays.toString(s.searchRange(nums, 8)));
System.out.println(Arrays.toString(s.searchRange(nums, 6)));
System.out.println(Arrays.toString(s.searchRange(nums, 5)));
System.out.println(Arrays.toString(s.searchRange(nums, 10)));
System.out.println(Arrays.toString(s.searchRange(nums, 11)));
System.out.println(Arrays.toString(s.searchRange(new int[]{}, 0)));
}
public int[] searchRange(int[] nums, int target) {
int first = searchFirst(nums, target);
int last = searchLast(nums, target);
return new int[]{first, last};
}
public int searchFirst(int[] nums, int target) {
if (nums == null || nums.length == 0) return -1;
int left = 0;
int right = nums.length - 1;
while (left < right) {
int mid = left + (right - left) / 2;
// 取大于等于target的第一个数
// [left, mid] [mid+1, right]
// 不可能存在区间 可能存在区间
if (nums[mid] < target) {
left = mid + 1;
} else {
right = mid;
}
}
return nums[left] == target ? left : -1;
}
public int searchLast(int[] nums, int target) {
if (nums == null || nums.length == 0) return -1;
int left = 0;
int right = nums.length - 1;
while (left < right) {
// 当出现left = mid时,需要上中位数
int mid = left + (right - left + 1) / 2;
// 取小于等于的最后一个数
// [left, mid+1] [mid, right]
// 可能存在区间 不可能存在区间
if (nums[mid] <= target) {
left = mid;
} else {
right = mid - 1;
}
}
return nums[left] == target ? left : -1;
}
}
| [
"yinping.xie@renren-inc.com"
] | yinping.xie@renren-inc.com |
73331855f081ca267aadc1dc2b9390e5869e46c7 | a1838eda71d4f600f7985944274c68567cefedc8 | /BaseTest/src/main/java/config/AES.java | a82c9455ec520659e265bb734a99e8eeb4f80a43 | [] | no_license | kobe-leonardoalmeida/BaseTestJava | 6e6b8a164e7e3f283378a931956840a1b7a6b609 | 5a58713f71b6e3a820533add373b5e22fb066b0d | refs/heads/master | 2023-08-06T08:47:39.257610 | 2021-09-24T17:31:16 | 2021-09-24T17:31:16 | 410,048,771 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,907 | java | package config;
import javax.crypto.Cipher;
import javax.crypto.spec.SecretKeySpec;
import java.io.UnsupportedEncodingException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Arrays;
import java.util.Base64;
public class AES {
private static SecretKeySpec secretKey;
private static byte[] key;
public static void setKey(String myKey)
{
MessageDigest sha = null;
try {
key = myKey.getBytes("UTF-8");
sha = MessageDigest.getInstance("SHA-1");
key = sha.digest(key);
key = Arrays.copyOf(key, 16);
secretKey = new SecretKeySpec(key, "AES");
}
catch (NoSuchAlgorithmException e) {
e.printStackTrace();
}
catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
}
public static String encrypt(String strToEncrypt, String secret)
{
try
{
setKey(secret);
Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");
cipher.init(Cipher.ENCRYPT_MODE, secretKey);
return Base64.getEncoder().encodeToString(cipher.doFinal(strToEncrypt.getBytes("UTF-8")));
}
catch (Exception e)
{
System.out.println("Error while encrypting: " + e.toString());
}
return null;
}
public static String decrypt(String strToDecrypt, String secret)
{
try
{
setKey(secret);
Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5PADDING");
cipher.init(Cipher.DECRYPT_MODE, secretKey);
return new String(cipher.doFinal(Base64.getDecoder().decode(strToDecrypt)));
}
catch (Exception e)
{
System.out.println("Error while decrypting: " + e.toString());
}
return null;
}
}
| [
"leonardo.almeida@kobe.io"
] | leonardo.almeida@kobe.io |
067fb90c3392a50f2eb7bbfcc3914d368fc7ef91 | 7c7d2b54b3dd1f348cceb5f09d626688981a7d1e | /oop_2/interfaces/Fluorescent.java | d44c381dbb3c47d50c8af79a85c93782bef069c8 | [] | no_license | HedgehogInTheMist/it-academy | f1a9140966f23ac960ef32575bf5306b39e95d72 | 2c95b33e2c4ffb84df28970b30029db243267b48 | refs/heads/master | 2021-01-10T17:47:55.538903 | 2016-01-14T13:59:24 | 2016-01-14T13:59:24 | 43,610,849 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 101 | java | package oop_2.interfaces;
public interface Fluorescent {
boolean glow(); //Append action to glow
}
| [
"edovin.sergey@gmail.com"
] | edovin.sergey@gmail.com |
1617f717af256619908851ea533cc52ce5e22987 | dde6a2b1b149d340a4cb9d539c50b124690529d4 | /nifi-pebble-faker-extension/src/main/java/org/apache/nifi/datageneration/templates/faker/functions/FoodSpiceFunction.java | 3e3566bfcac4d00918c957302e5cb87824775d71 | [
"AGPL-3.0-only",
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] | permissive | MikeThomsen/nifi-datageneration-bundle | 911531107073904e9c6fca2b38ba718504b4d05c | 4e3eea691c3d84040860f132d48f03bf5fecde9a | refs/heads/main | 2023-08-17T00:11:52.398851 | 2023-08-06T15:04:33 | 2023-08-06T15:04:33 | 141,813,839 | 14 | 1 | Apache-2.0 | 2023-08-06T15:05:30 | 2018-07-21T13:11:38 | Java | UTF-8 | Java | false | false | 545 | java |
package org.apache.nifi.datageneration.templates.faker.functions;
import com.github.javafaker.Faker;
import com.mitchellbosecke.pebble.template.EvaluationContext;
import com.mitchellbosecke.pebble.template.PebbleTemplate;
import java.util.Map;
public class FoodSpiceFunction extends AbstractFakerFunction {
public FoodSpiceFunction(Faker faker) {
super(faker);
}
public Object execute(Map<String, Object> args, PebbleTemplate self, EvaluationContext context, int lineNumber) {
return faker.food().spice();
}
}
| [
"mikerthomsen@gmail.com"
] | mikerthomsen@gmail.com |
af4faf12bf0b07ba083ed723348d8b8e784069ea | 05bcd0982b665ac945e190cb14b8b25f57ca7315 | /MVVMDemo/app/src/test/java/com/example/volansys/mvvmdemo/ExampleUnitTest.java | 061d48b00363f82dc98bf788dc664cda5493a7a8 | [] | no_license | urvishjarvis1/AndrodiAdvance | a1690b28c45ce8c3f71812436df9ac9dae402eaf | b2e94370f5d7d124c77fe179ce46560c2d56bbb7 | refs/heads/master | 2020-04-15T20:46:29.736612 | 2019-01-10T06:55:57 | 2019-01-10T06:55:57 | 165,006,982 | 3 | 2 | null | null | null | null | UTF-8 | Java | false | false | 390 | java | package com.example.volansys.mvvmdemo;
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() {
assertEquals(4, 2 + 2);
}
} | [
"urvish.rana@volansystech.com"
] | urvish.rana@volansystech.com |
78e5b5b4566da4e401f5fb79d3605b2cd7991c0d | 79472a131f0718ccd2988ac29381b3946b082a60 | /dont-study-java/src/main/java/InnerClass_17/LocalClassTest.java | 1bfd84f9cc82fa6e83e6515dac9124cfd1776846 | [] | no_license | mina455/dont-study-java | 99145f85096e8bc6b58ec0add32f0da022fff67d | 34f31244d6adccfc0b4dd9258685afc2c3751cd6 | refs/heads/master | 2021-05-04T17:10:17.559571 | 2018-02-21T10:17:59 | 2018-02-21T10:17:59 | 120,266,360 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 923 | java | package InnerClass_17;
interface Readable {
public void read();
}
class OuterClass02 {
private String myName;
OuterClass02(String name) {
myName = name;
}
public Readable createLocalClassInst() {
class LocalClass implements Readable {
public void read() {
System.out.println("Outer inst name : " + myName);
}
}
return new LocalClass();
}
}
class LocalClassTest {
public static void main(String[] args) {
OuterClass02 out1 = new OuterClass02("First");
Readable localInst1 = out1.createLocalClassInst();
localInst1.read();
OuterClass02 out2 = new OuterClass02("Second");
Readable localInst2 = out2.createLocalClassInst();
localInst2.read();
}
}
/**
* Local 클래스는 Inner 클래스와 유사
* 다만 메소드 내에 정의가 되고, 정의된 메소드 내에서만 인스턴스의 생성과 참조변수 선언이 가능
*
*/ | [
"mina11027@hanmail.net"
] | mina11027@hanmail.net |
d1396acba216f300b0fd76bc4fcebba2fbfe65d1 | 90fa29227c6d96f3185d4c70c60474a254718e79 | /cnam.nsy209.selServices/src/main/java/server/dao/entity/CategoryEntity.java | 8546537b411f986d8248f37e67df2a2bdcb8f981 | [] | no_license | lavive/cnam.nsy209.selServices | bd773ffb11c7ee3bfc85ab42caa414e6fb929b8f | 57d131ef583ae1f229d994e8a84a45de93b52a88 | refs/heads/master | 2021-01-19T21:33:29.389933 | 2017-04-18T20:11:53 | 2017-04-18T20:11:53 | 88,666,520 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 768 | java | package server.dao.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import server.dao.interfaces.MarkerEntity;
@Entity
@Table(name = "category")
public class CategoryEntity implements MarkerEntity {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "id")
private Integer id;
@Column(name = "name", nullable = false)
private String name;
/* getter and setter */
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
| [
"vivien.sere@gmail.com"
] | vivien.sere@gmail.com |
3001cf8ec7cd1e210646e832b9365a0d5deafd90 | 458efd8dce92fd62db0c17755defe6503b8b5b4c | /app/src/main/java/com/lenovo/album/ui/adapter/LabelTitleProvider.java | 6d4bfe609eeeb0b136542ade11509907452dc182 | [] | no_license | tenny1225/labelablum | 4de5885be2a28ffb54042afa84f38bba99416a04 | 5ddc7bf8f349a895124d7d47004bb88ba1118205 | refs/heads/master | 2021-01-25T09:32:03.861613 | 2017-06-19T06:14:53 | 2017-06-19T06:14:53 | 93,847,477 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 884 | java | package com.lenovo.album.ui.adapter;
import android.support.annotation.NonNull;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import android.widget.TextView;
import com.lenovo.album.R;
import com.lenovo.album.base.BaseRecyclerAdapter;
import me.drakeet.multitype.ItemViewBinder;
/**
* Created by noahkong on 17-6-12.
*/
public class LabelTitleProvider extends ItemViewBinder<String, BaseRecyclerAdapter.VH> {
@NonNull
@Override
protected BaseRecyclerAdapter.VH onCreateViewHolder(@NonNull LayoutInflater inflater, @NonNull ViewGroup parent) {
return new BaseRecyclerAdapter.VH(inflater.inflate(R.layout.list_item_label_title, parent, false));
}
@Override
protected void onBindViewHolder(@NonNull BaseRecyclerAdapter.VH holder, @NonNull String item) {
holder.<TextView>$(R.id.tv_lable_title).setText(item);
}
}
| [
"kongwh1@lenovo.com"
] | kongwh1@lenovo.com |
01962177300a63f04d82d334a450b94b7caf4cb0 | 36c8b96a3c1ed9723d8f35d01322b16992697f3b | /src/main/java/com/ausi/expensemanager/dao/db/FileDBConnector.java | 522c86e2915c4400738146c91e5cea8fb02f602f | [] | no_license | surelyausi/expensemanager | e16de79a5011c042137694653e63a5a4ceed0515 | 98c93b142cb05d589c0912d4dbf65aa91a8827e6 | refs/heads/master | 2020-04-02T12:52:05.147242 | 2016-08-03T16:11:34 | 2016-08-03T16:11:34 | 64,591,846 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,847 | java | package com.ausi.expensemanager.dao.db;
import java.io.*;
/**
* Created by Schurl on 31.07.2016.
*/
public class FileDBConnector {
private static final String EXPENSES_FILE_PATH = "expenses";
private static final String CATEGORIES_FILE_PATH = "categories";
private static final FileDBConnector instance = new FileDBConnector();
public void writeExpenses(String jsonString){
write(jsonString, EXPENSES_FILE_PATH);
}
public String readExpenses(){
return read(EXPENSES_FILE_PATH);
}
public void writeCategories(String jsonString){
write(jsonString, CATEGORIES_FILE_PATH);
}
public String readCategories(){
return read(CATEGORIES_FILE_PATH);
}
private void write(String stringToWrite, String path){
try {
File targetFile = new File(path);
if(!targetFile.exists()){
targetFile.createNewFile();
}
PrintWriter printWriter = new PrintWriter(path);
printWriter.print(stringToWrite);
printWriter.close();
} catch (IOException e) {
e.printStackTrace();
}
}
private String read(String path){
try {
BufferedReader bufferedReader = new BufferedReader(new FileReader(path));
StringBuffer stringBuffer = new StringBuffer();
String line;
while((line = bufferedReader.readLine()) != null){
stringBuffer.append(line);
}
return stringBuffer.toString();
} catch (FileNotFoundException e) {
System.err.println("No Category File Found.");
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
public static FileDBConnector getInstance() {
return instance;
}
}
| [
"g.auswoeger@gmail.com"
] | g.auswoeger@gmail.com |
0601fbe7def90a95a3e26df26b43788c6802a824 | 7c0e6d0c5daa28805906d07c02a2b28c80818e68 | /fourthhomework/app/src/main/java/com/example/fourthhomework/LoginForgetActivity.java | 96c496a92456789fae3cfda3df013ca0351aabcd | [] | no_license | chenyida-jisoo/chenyida11 | f074912958031f64dbe3d72e3d9c0dc9da128ec9 | 377b4f913572bad51e41acc20ea26295e4e36098 | refs/heads/main | 2023-02-01T06:21:20.098545 | 2020-12-19T01:18:20 | 2020-12-19T01:18:20 | 305,678,158 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,104 | java | package com.example.fourthhomework;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.EditText;
public class LoginForgetActivity extends AppCompatActivity{
private EditText et_password_first; // 声明一个编辑框对象
private EditText et_password_second; // 声明一个编辑框对象
private EditText et_verifycode; // 声明一个编辑框对象
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login_forget);
// 从布局文件中获取名叫et_password_first的编辑框
et_password_first = findViewById(R.id.et_password_first);
// 从布局文件中获取名叫et_password_second的编辑框
et_password_second = findViewById(R.id.et_password_second);
// 从布局文件中获取名叫et_verifycode的编辑框
et_verifycode = findViewById(R.id.et_verifycode);
}
} | [
"1837665262@qq.com"
] | 1837665262@qq.com |
e8393836c470cebe96e46fc4499d7be8a6fac581 | 825f66d8033aedaab9b6a5d2f2df6a678a3032cb | /spring-cloud/consumer-movie-ribbon-with-hystrix2/src/main/java/com/qxj/configuration/MySelfRule.java | 3a9b4d51c7692aa3bf47dd0aa857dc8f17237f0f | [] | no_license | shenghdx/SpringCloudDemo | b984695940107eeec599abeca418fe04d8e4637e | 9551d564e82daaf892face77b7959d1c4eb3a7e2 | refs/heads/master | 2022-11-07T08:27:20.696604 | 2020-06-18T14:24:22 | 2020-06-18T14:24:22 | 255,345,005 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 295 | java | package com.qxj.configuration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import com.netflix.loadbalancer.IRule;
@Configuration
public class MySelfRule {
@Bean
public IRule MyRule() {
return new RandomRule_QXJ();
}
}
| [
"342115774@qq.com"
] | 342115774@qq.com |
b8167d5a9001bbc3d2b7d4087b5c4bb6b822fa02 | 4d361cd1287745e1ba82a051b73ec693b022fb04 | /jOOQ/src/main/java/org/jooq/impl/Substring.java | 66a1d86c8b5aeece445e23efd2ee2da6a0d84499 | [
"Apache-2.0"
] | permissive | Vertabelo/jOOQ | db8619efea4b982983201c7d0e1d223421a4d715 | e65f62d833286ea0689748e3be47dabe94a9f511 | refs/heads/master | 2021-01-18T09:34:29.600129 | 2014-11-07T15:32:33 | 2014-11-21T11:08:43 | 26,956,264 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,457 | java | /**
* Copyright (c) 2009-2014, Data Geekery GmbH (http://www.datageekery.com)
* All rights reserved.
*
* This work is dual-licensed
* - under the Apache Software License 2.0 (the "ASL")
* - under the jOOQ License and Maintenance Agreement (the "jOOQ License")
* =============================================================================
* You may choose which license applies to you:
*
* - If you're using this work with Open Source databases, you may choose
* either ASL or jOOQ License.
* - If you're using this work with at least one commercial database, you must
* choose jOOQ License
*
* For more information, please visit http://www.jooq.org/licenses
*
* Apache Software License 2.0:
* -----------------------------------------------------------------------------
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* jOOQ License and Maintenance Agreement:
* -----------------------------------------------------------------------------
* Data Geekery grants the Customer the non-exclusive, timely limited and
* non-transferable license to install and use the Software under the terms of
* the jOOQ License and Maintenance Agreement.
*
* This library is distributed with a LIMITED WARRANTY. See the jOOQ License
* and Maintenance Agreement for more details: http://www.jooq.org/licensing
*/
package org.jooq.impl;
import static org.jooq.impl.DSL.field;
import static org.jooq.impl.DSL.function;
import static org.jooq.impl.DSL.inline;
import org.jooq.Configuration;
import org.jooq.Field;
/**
* @author Lukas Eder
*/
class Substring extends AbstractFunction<String> {
/**
* Generated UID
*/
private static final long serialVersionUID = -7273879239726265322L;
Substring(Field<?>... arguments) {
super("substring", SQLDataType.VARCHAR, arguments);
}
@Override
final Field<String> getFunction0(Configuration configuration) {
String functionName = "substring";
switch (configuration.dialect().family()) {
// [#430] Firebird has its own syntax
case FIREBIRD: {
if (getArguments().length == 2) {
return field("{substring}({0} {from} {1})", SQLDataType.VARCHAR, getArguments());
}
else {
return field("{substring}({0} {from} {1} {for} {2})", SQLDataType.VARCHAR, getArguments());
}
}
/* [pro] xx
xx xxxxxx xxx xxx xxx xxxxxx xxxxxxxx x xxxxxxxxx
xxxx xxxx
xxxx xxxxxxxxxx x
xx xxxxxxxxxxxxxxxxxxxxxx xx xx x
xxxxxx xxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxx
x
xx xxxxxxx xxxxxxxxx
xxxx x
xxxxxx
x
x
xx xxxxxx xxx xxxxxxxxxxxx xxxxxxxx xxxxxx xxxxx xxxxxxxx xxxxxxx
xxxx xxxxxxx x
xx xxxxxxxxxxxxxxxxxxxxxx xx xx x
xxxxxx xxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxx xxx xxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxx
x
xxxx x
xxxxxx xxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxx xxx xxxxxxxxxx xxxxxxxxxx xxx xxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxx
x
x
xxxx xxxxxxx
xxxxxxxxxxxx x xxxxxx
xxxxxx
xxxx xxxx
xxxx xxxxxxxxx
xxxx xxxxxxx
xx [/pro] */
case DERBY:
case SQLITE:
functionName = "substr";
break;
}
return function(functionName, SQLDataType.VARCHAR, getArguments());
}
}
| [
"lukas.eder@gmail.com"
] | lukas.eder@gmail.com |
d90221575066966322a587f54cf2819e8f280863 | 14c8a49e80635b39e1a2654ba719d47d6399a0b1 | /modules-1.0.2/com.zmj.microservice.Common.Model_1.0.1/src/main/java/com/zmj/microservice/common/history/util/Code64.java | 63a1376e5dd2b1c859cf17bb3851a1ba615df7b7 | [] | no_license | T3World/zmj | 439d45390cba260220d5f3136e2b96b119aef9bb | 44c48ba0b83c970a582bfd6f4270b0350a67f0c0 | refs/heads/master | 2022-11-18T00:38:21.785670 | 2019-08-21T02:35:20 | 2019-08-21T02:35:20 | 170,814,710 | 0 | 0 | null | 2022-11-16T11:46:54 | 2019-02-15T06:40:47 | TSQL | UTF-8 | Java | false | false | 1,140 | java | package com.zmj.microservice.common.history.util;
/**
* 将long类型数字转换成64进制字符串,
* long类型数字大小不能超过64的八次方(即281,474,976,710,656)
* 64进制表示法参考Base64
* */
public class Code64 {
private static final long L1 = 64L;
/**
* 4,096
*/
private static final long L2 = L1*64L;
/**
* 262,144
*/
private static final long L3 = L2*64L;
/**
* 16,777,216
*/
private static final long L4 = L3*64L;
/**
* 1,073,741,824
*/
private static final long L5 = L4*64L;
/**
* 68,719,476,736
*/
private static final long L6 = L5*64L;
/**
* 4,398,046,511,104
*/
private static final long L7 = L6*64L;
/**
* 281,474,976,710,656
*/
private static final long L8 = L7*64L;
private static final char[] base64= new char[]{'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','0','1','2','3','4','5','6','7','8','9'};
}
| [
"kawaii3057@gmail.com"
] | kawaii3057@gmail.com |
6669bb3b2403f89ae2c9997e55202ca937f7c6f4 | 3d70f6c9ae3c26a364d3b556bd5e650293bccacc | /backend/ideafork_idea-service/src/main/java/at/irian/cdiatwork/ideafork/idea/domain/BaseEntity.java | a15a73cc3e40e31863c8c2c63c27b020f3f1b012 | [] | no_license | CDIatWork/IdeaForkMicro | d8b7de0bc47817e618d3686bfb421188ef19cb82 | 8242e659dd890888a9203e49a730a2f8d6b4878c | refs/heads/master | 2021-09-10T19:29:39.196483 | 2017-07-07T23:59:41 | 2018-03-31T19:41:28 | 115,764,048 | 2 | 2 | null | null | null | null | UTF-8 | Java | false | false | 1,728 | java | package at.irian.cdiatwork.ideafork.idea.domain;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;
import javax.persistence.Transient;
import javax.persistence.Version;
import javax.xml.bind.annotation.XmlTransient;
import java.io.Serializable;
import java.util.UUID;
@MappedSuperclass
public abstract class BaseEntity implements Serializable {
private static final long serialVersionUID = -7764878761692675990L;
@Id
protected String id;
@Version
protected Long version;
public BaseEntity() {
this.id = UUID.randomUUID().toString().replace("-", "");
}
@XmlTransient
@Transient
public boolean isTransient() {
return version == null;
}
/*
* generated
*/
public String getId() {
return id;
}
public Long getVersion() {
return version;
}
/*
* needed for data-import
*/
protected void setId(String id) {
this.id = id;
}
protected void setVersion(Long version) {
this.version = version;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
BaseEntity that = (BaseEntity) o;
//only compare the id if the entity is persistent
if (!isTransient()) {
if (!id.equals(that.id)) return false;
}
if (version != null ? !version.equals(that.version) : that.version != null) return false;
return true;
}
@Override
public int hashCode() {
int result = id.hashCode();
result = 31 * result + (version != null ? version.hashCode() : 0);
return result;
}
}
| [
"gerhard.petracek@irian.at"
] | gerhard.petracek@irian.at |
86ef176abe4784ea0461169453aa6aeb79d04191 | 3d90f192abc07abb145bd336a0be83db11386aca | /src/main/java/lab/model/Drink.java | a1a4c0fafc84c35cf750e06112b1cb58b29bdb56 | [] | no_license | Vyacheslav-Lapin/spring5-labs | cd2fc696cdf52b3c9ee0677ba281213cf741b853 | 68edca083f0d5b52cccd42c0c996c08d7a41035e | refs/heads/master | 2021-09-05T05:40:46.570890 | 2018-01-24T14:02:00 | 2018-01-24T14:02:00 | 110,840,593 | 0 | 15 | null | 2018-01-20T10:46:13 | 2017-11-15T14:00:29 | Java | UTF-8 | Java | false | false | 79 | java | package lab.model;
public interface Drink {
String getName();
//...
}
| [
"Vyachesl@vLapin.ru"
] | Vyachesl@vLapin.ru |
892bc9e7113fdb1c603625cf2dff0e0dc3202ec4 | 95d20c83d8aff34e314c56a3ecb2b87c9fa9fc86 | /Ghidra/Features/Base/src/main/java/ghidra/graph/CallGraphType.java | 5385acef9d2d99a33ecf7658d70adc30e98fdde4 | [
"GPL-1.0-or-later",
"GPL-3.0-only",
"Apache-2.0",
"LicenseRef-scancode-public-domain",
"LGPL-2.1-only",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | NationalSecurityAgency/ghidra | 969fe0d2ca25cb8ac72f66f0f90fc7fb2dbfa68d | 7cc135eb6bfabd166cbc23f7951dae09a7e03c39 | refs/heads/master | 2023-08-31T21:20:23.376055 | 2023-08-29T23:08:54 | 2023-08-29T23:08:54 | 173,228,436 | 45,212 | 6,204 | Apache-2.0 | 2023-09-14T18:00:39 | 2019-03-01T03:27:48 | Java | UTF-8 | Java | false | false | 760 | java | /* ###
* IP: GHIDRA
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package ghidra.graph;
public class CallGraphType extends ProgramGraphType {
public CallGraphType() {
super("Call Graph", "Shows relationships between functions");
}
}
| [
"ghidravore@users.noreply.github.com"
] | ghidravore@users.noreply.github.com |
40cd86c4f1b8726721fe6605b87d7bc68146abac | 5c7ae76970934e05e005e4547cd3ea6287bafd32 | /src/com/grocery/buyers/Customer.java | dcb1be6180a4d2bc49a018dba55e4a5cff7c90bf | [
"Apache-2.0"
] | permissive | maruthamuthu/GroceryStore | 03db43d4c736e830c862b191f059640d7d8cd1e4 | 4afe3d18773bb29ea08d81d3cafdfa29e1fbb596 | refs/heads/master | 2021-06-14T20:44:23.880008 | 2021-03-19T14:34:07 | 2021-03-19T14:34:07 | 168,979,273 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 135 | java | package com.grocery.buyers;
public class Customer extends Buyer
{
public Customer(String name)
{
super(name);
}
}
| [
"maruthamuthu.g@zohocorp.com"
] | maruthamuthu.g@zohocorp.com |
1f500b14f9e351f4cd38d48863e29ab5e9db96c2 | 1f873710e48ba1ec49906cee45771a7fb45e5db7 | /spring-webflux-project-trial/src/main/java/com/springwebfluxproject/springwebfluxproject/security/User.java | 67c9121b5cdc16434c61c6ec219bfdd58b190f3b | [] | no_license | nikita9604/Pharmacy-Benefit-Management-Portal | b68ea03e26f676d6581fc2869e74203939b096b5 | 3e112c5c3fbad6cc10c5dbdd19a8fa2a60fc9e60 | refs/heads/main | 2023-08-22T18:31:27.448844 | 2021-09-27T11:17:24 | 2021-09-27T11:17:24 | 392,290,092 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 951 | java | package com.springwebfluxproject.springwebfluxproject.security;
import io.swagger.models.auth.In;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.relational.core.mapping.Table;
import org.springframework.security.crypto.factory.PasswordEncoderFactories;
import org.springframework.security.crypto.password.PasswordEncoder;
import java.util.Collection;
import java.util.UUID;
import java.util.function.Function;
@Data
@NoArgsConstructor
@AllArgsConstructor
@Table(value="NewUser")
public class User {
@Id
private Integer uid;
private String username;
private String password;
// private Collection<String> roles;
private String role;
User(User user) {
this.uid = user.uid;
this.username = user.username;
this.password = user.password;
this.role = user.role;
}
} | [
"b18068@students.iitmandi.ac.in"
] | b18068@students.iitmandi.ac.in |
6d91e8ae5edfc5dc4891b0119f28def7b2b5446c | bf2966abae57885c29e70852243a22abc8ba8eb0 | /aws-java-sdk-chime/src/main/java/com/amazonaws/services/chime/model/DeleteAppInstanceStreamingConfigurationsRequest.java | d7f547bd83dfacec8b25d67e288d609bd2a8bfaa | [
"Apache-2.0"
] | permissive | kmbotts/aws-sdk-java | ae20b3244131d52b9687eb026b9c620da8b49935 | 388f6427e00fb1c2f211abda5bad3a75d29eef62 | refs/heads/master | 2021-12-23T14:39:26.369661 | 2021-07-26T20:09:07 | 2021-07-26T20:09:07 | 246,296,939 | 0 | 0 | Apache-2.0 | 2020-03-10T12:37:34 | 2020-03-10T12:37:33 | null | UTF-8 | Java | false | false | 3,984 | java | /*
* Copyright 2016-2021 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.chime.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.AmazonWebServiceRequest;
/**
*
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/chime-2018-05-01/DeleteAppInstanceStreamingConfigurations"
* target="_top">AWS API Documentation</a>
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class DeleteAppInstanceStreamingConfigurationsRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
* <p>
* The ARN of the streaming configurations being deleted.
* </p>
*/
private String appInstanceArn;
/**
* <p>
* The ARN of the streaming configurations being deleted.
* </p>
*
* @param appInstanceArn
* The ARN of the streaming configurations being deleted.
*/
public void setAppInstanceArn(String appInstanceArn) {
this.appInstanceArn = appInstanceArn;
}
/**
* <p>
* The ARN of the streaming configurations being deleted.
* </p>
*
* @return The ARN of the streaming configurations being deleted.
*/
public String getAppInstanceArn() {
return this.appInstanceArn;
}
/**
* <p>
* The ARN of the streaming configurations being deleted.
* </p>
*
* @param appInstanceArn
* The ARN of the streaming configurations being deleted.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DeleteAppInstanceStreamingConfigurationsRequest withAppInstanceArn(String appInstanceArn) {
setAppInstanceArn(appInstanceArn);
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getAppInstanceArn() != null)
sb.append("AppInstanceArn: ").append(getAppInstanceArn());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof DeleteAppInstanceStreamingConfigurationsRequest == false)
return false;
DeleteAppInstanceStreamingConfigurationsRequest other = (DeleteAppInstanceStreamingConfigurationsRequest) obj;
if (other.getAppInstanceArn() == null ^ this.getAppInstanceArn() == null)
return false;
if (other.getAppInstanceArn() != null && other.getAppInstanceArn().equals(this.getAppInstanceArn()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getAppInstanceArn() == null) ? 0 : getAppInstanceArn().hashCode());
return hashCode;
}
@Override
public DeleteAppInstanceStreamingConfigurationsRequest clone() {
return (DeleteAppInstanceStreamingConfigurationsRequest) super.clone();
}
}
| [
""
] | |
364aad1e82a7c79a6936a372fa0232634e16ff6e | c3f05471b159033c7ba66fd555e1f43c7eb6b03c | /src/com/layso/quizmanager/gui/SeeResultsMenuController.java | 920b0b9960c51e9b7eba8ebbc13e99968a0fc3f8 | [] | no_license | Layso/QuizManager | c1058befc4848932e1294202e5638c2dafccd4cd | d1b15e4f7ece42c7cf184416c5dc14aa616bf3e3 | refs/heads/master | 2020-04-13T09:44:33.891340 | 2019-02-20T22:46:06 | 2019-02-20T22:46:06 | 163,119,638 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,009 | java | package com.layso.quizmanager.gui;
import com.layso.logger.datamodel.Logger;
import com.layso.quizmanager.datamodel.AnswerTable;
import com.layso.quizmanager.services.DatabaseManager;
import com.layso.quizmanager.services.QuizManager;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.*;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import java.util.ResourceBundle;
public class SeeResultsMenuController extends Controller implements Initializable {
// GUI elements
@FXML
TableColumn nameColumn, questionCountColumn, trueAnswersColumn, falseAnswersColumn, uncheckedAnswersColumn, percentageColumn, quizSolverColumn;
@FXML
TableView resultsTable;
@FXML
ChoiceBox searchCriteriaChoice;
@FXML
TextField searchCriteriaText;
/**
* Overriding initialize method to setup stage
* @param url
* @param rb
*/
@Override
public void initialize(URL url, ResourceBundle rb) {
// Associating search functionality with GUI elements and table with class
AssociateSearchCriteriaWithTable(searchCriteriaChoice, resultsTable);
AssociateTableWithClass(AnswerTable.GetPropertyValueFactory(), nameColumn, questionCountColumn, trueAnswersColumn, falseAnswersColumn, uncheckedAnswersColumn, percentageColumn, quizSolverColumn);
SearchButton(null);
Logger.Log("See Results Menu initialized", Logger.LogType.INFO);
}
/**
* Method to start SeeResultsMenu on console
*/
public static void SeeResultsMenu() {
List<AnswerTable> answers = DatabaseManager.getInstance().GetAllAnswersByUserID(QuizManager.getInstance().GetUser().GetID());
boolean run = true;
boolean correctInput;
// Run until user selects main menu
while (run) {
// Print results
System.out.println(AnswerTable.ConsoleTableTitle());
PrintArrayAsTable(answers);
// Print menu, get input and process input
System.out.println();
PrintMenu("Search Result", "Back");
do {
switch (GetMenuInput()) {
case 1: correctInput = true; answers = Search(); break;
case 2: correctInput = true; run = false; break;
default: correctInput = false;
}
} while (!correctInput);
}
}
/**
* Console search helper method
* @return Filtered list of AnswerTables
*/
public static List<AnswerTable> Search() {
// Get Search criteria
String searchCriteria = GetInput("Search criteria", true);
AnswerTable.AnswerTableSearchTerms termEnum;
int searchTerm;
// Get SearchTerm
do {
System.out.println("[1] Quiz Title\n[2] QuestionCount\n[3] Difficulty\n[4] TrueDifficulty");
searchTerm = GetMenuInput();
} while (searchTerm < 1 || searchTerm > 4);
// Create filtered list and return
termEnum = searchTerm == 1 ? AnswerTable.AnswerTableSearchTerms.Name :
(searchTerm == 2 ? AnswerTable.AnswerTableSearchTerms.QuestionCount :
(searchTerm == 3 ? AnswerTable.AnswerTableSearchTerms.UncheckedAnswers :
(searchTerm == 4 ? AnswerTable.AnswerTableSearchTerms.TrueAnswers :
(searchTerm == 5 ? AnswerTable.AnswerTableSearchTerms.FalseAnswers : AnswerTable.AnswerTableSearchTerms.Percentage))));
return new ArrayList(Controller.SearchHelper(DatabaseManager.getInstance().GetAllAnswersByUserID(QuizManager.getInstance().GetUser().GetID()), searchCriteria, termEnum.name()));
}
/**
* GUI search button action
* @param event ActionEvent created by GUI
*/
public void SearchButton(ActionEvent event) {
// Get filtered list and set it in table
List<AnswerTable> answers = DatabaseManager.getInstance().GetAllAnswersByUserID(QuizManager.getInstance().GetUser().GetID());
resultsTable.setItems(SearchHelper(answers, searchCriteriaText.getText(), searchCriteriaChoice.getSelectionModel().getSelectedItem().toString()));
}
/**
* Back to main menu button action
* @param event ActionEvent created by GUI
*/
public void BackButton(ActionEvent event) {
ChangeScene(event, WindowStage.MainMenu);
}
}
| [
"canyilmaz1997@gmail.com"
] | canyilmaz1997@gmail.com |
89a6548e111e7c397694e792e0b5407ca805e0ed | d672d461b4bedfceb5f2a8119963ccc12a5b6bec | /message/src/main/java/com/ixilink/banknote_box/message/callback/CaptureCompareDataReceived.java | 9640c0cf5cbc506a836c3ae9f99808f590341efa | [] | no_license | HowenCloud/banknote_box | 473954eddace0adac7a0ff62408d5920034c2ecb | 6b6aa7985b7ef136171fe04a80649e8ba7589446 | refs/heads/master | 2022-07-11T02:40:43.726432 | 2020-01-17T11:20:05 | 2020-01-17T11:20:05 | 234,528,946 | 0 | 0 | null | 2022-06-29T17:54:51 | 2020-01-17T10:47:08 | Java | UTF-8 | Java | false | false | 5,934 | java | package com.ixilink.banknote_box.message.callback;
import com.ha.facecamera.configserver.events.CaptureCompareDataReceivedEventHandler;
import com.ha.facecamera.configserver.pojo.CaptureCompareData;
import com.ixilink.banknote_box.common.dao.EquipmentMapper;
import com.ixilink.banknote_box.common.dao.SystemSettingMapper;
import com.ixilink.banknote_box.common.dao.UserMapper;
import com.ixilink.banknote_box.common.pojo.*;
import com.ixilink.banknote_box.common.spring.SpringUtils;
import com.ixilink.banknote_box.common.util.FileUtil;
import com.ixilink.banknote_box.common.util.IpAddressUtils;
import com.ixilink.banknote_box.common.util.JsonUtil;
import com.ixilink.banknote_box.common.util.ObjectOrMapUtil;
import com.ixilink.banknote_box.message.common.FacePublicData;
import com.ixilink.banknote_box.message.config.CustomConfig;
import com.ixilink.banknote_box.message.websocket.FaceSocket;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.ApplicationContext;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @description: 视频流数据处理
* @author: 张皓峰
* @date: 2019-12-11 15:28
*/
@Slf4j
public class CaptureCompareDataReceived implements CaptureCompareDataReceivedEventHandler {
@Value("${server.port}")
private String port;
private ApplicationContext applicationContext = SpringUtils.getApplicationContext();
private UserMapper userMapper = applicationContext.getBean(UserMapper.class);
private EquipmentMapper equipmentMapper = applicationContext.getBean(EquipmentMapper.class);
private SystemSettingMapper systemSettingMapper = applicationContext.getBean(SystemSettingMapper.class);
private FaceSocket faceSocket = applicationContext.getBean(FaceSocket.class);
private CustomConfig customConfig = applicationContext.getBean(CustomConfig.class);
private static CaptureCompareDataReceived captureCompareDataReceived;
private CaptureCompareDataReceived(){}
public static CaptureCompareDataReceived getInstance(){
if (captureCompareDataReceived == null ){
synchronized (CaptureCompareDataReceived.class){
if (captureCompareDataReceived == null){
captureCompareDataReceived = new CaptureCompareDataReceived();
}
}
}
return captureCompareDataReceived;
}
@Override
public void onCaptureCompareDataReceived(CaptureCompareData captureCompareData) {
if (captureCompareData.isPersonMatched()) {
if (FacePublicData.userId.get(captureCompareData.getCameraID()) != null) {
//发送识别到人脸
if (!FacePublicData.userId.get(captureCompareData.getCameraID()).contains(Integer.valueOf(captureCompareData.getPersonID()))) {
//将图片数据转存到本地
String path = FileUtil.getPath();
File packages = new File(path, "\\temp\\face\\" + captureCompareData.getCameraID());
if (!packages.exists()) {
boolean mkdirs = packages.mkdirs();
}
String name = FileUtil.createName() + ".jpg";
String filePath = packages.getPath() + File.separator + name;
FileUtil.byte2image(captureCompareData.getFeatureImageData(), filePath);
FacePublicData.userId.get(captureCompareData.getCameraID()).add(Integer.valueOf(captureCompareData.getPersonID()));
//被识别用户
User user = userMapper.userInfoById(Integer.valueOf(captureCompareData.getPersonID()));
Map<String, Object> data = new HashMap<>();
try {
data = ObjectOrMapUtil.objectToMap(user);
} catch (Exception e) {
log.error("数据转换出错");
}
data.put("face", "http://"+IpAddressUtils.getIp() + ":"+customConfig.getPort()+"/message/temp/face/" + captureCompareData.getCameraID() + "/" + name);
// data.put("face", "/message/temp/face/" + captureCompareData.getCameraID() + "/" + name);
//查询设备
EquipmentExample equipmentExample = new EquipmentExample();
equipmentExample.createCriteria().andStateEqualTo(1).andNumberEqualTo(captureCompareData.getCameraID());
List<Equipment> equipment = equipmentMapper.selectByExample(equipmentExample);
if (equipment.size() > 0) {
SystemSettingExample systemSettingExample = new SystemSettingExample();
systemSettingExample.createCriteria().andHandoverAmeraIpEqualTo(equipment.get(0).getIp());
systemSettingExample.or().andAssignmentsAmeraIpEqualTo(equipment.get(0).getIp());
//查询摄像头所属区域
List<SystemSetting> systemSettings = systemSettingMapper.selectByExample(systemSettingExample);
if (systemSettings.size() > 0) {
//发送数据
if (systemSettings.get(0).getAssignmentsAmeraIp().equals(equipment.get(0).getIp())) {
faceSocket.sendMessage(user.getLibraryId().toString(), "1", JsonUtil.obj2str(data));
}
if (systemSettings.get(0).getHandoverAmeraIp().equals(equipment.get(0).getIp())) {
faceSocket.sendMessage(user.getLibraryId().toString(), "2", JsonUtil.obj2str(data));
}
}
}
}
}
}
}
}
| [
"cloud_haofeng@163.com"
] | cloud_haofeng@163.com |
5fa1d04c578c25d5d33a0ccaed826e95231c25c8 | 573fd56572f3f46315f771be89afc7a691697331 | /mall-product/src/main/java/com/example/mall/product/entity/AttrEntity.java | 78871dbc96f16270cbb51c81a345ef0ce3130003 | [] | no_license | n1kobaby77/mallTest | be84e138675116764ce7f2de2c7ba3f662429cea | 18feba6b299b172d82ba35da7f489600a41e72b6 | refs/heads/master | 2023-08-19T03:28:04.097352 | 2021-03-03T08:26:55 | 2021-03-03T08:26:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,157 | java | package com.example.mall.product.entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 商品属性
*
* @author zhangzy
* @email zhangzy@gmail.com
* @date 2021-01-27 19:17:03
*/
@Data
@TableName("pms_attr")
public class AttrEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 属性id
*/
@TableId
private Long attrId;
/**
* 属性名
*/
private String attrName;
/**
* 是否需要检索[0-不需要,1-需要]
*/
private Integer searchType;
/**
* 属性图标
*/
private String icon;
/**
* 可选值列表[用逗号分隔]
*/
private String valueSelect;
/**
* 属性类型[0-销售属性,1-基本属性,2-既是销售属性又是基本属性]
*/
private Integer attrType;
/**
* 启用状态[0 - 禁用,1 - 启用]
*/
private Long enable;
/**
* 所属分类
*/
private Long catelogId;
/**
* 快速展示【是否展示在介绍上;0-否 1-是】,在sku中仍然可以调整
*/
private Integer showDesc;
}
| [
"75025477@qq.com"
] | 75025477@qq.com |
245c57bd7b843a73ccf76353513e0fe3fb75e059 | aa9932966adff99b269b1c7521b0c5a5b20b09b6 | /src/main/java/com/emc/codec/compression/deflate/DeflateInputStream.java | 7a71ce707d881227c5fba6dc8db350faf6ae71d7 | [
"BSD-3-Clause"
] | permissive | EMCECS/ecs-object-transform-java | 955cba21a0999abf20a0ee3e99a2ab94f3e99d5d | c55ecfba2d4b5b55ad239d340bcf2201ab15fbce | refs/heads/master | 2020-04-09T08:34:00.164183 | 2016-07-08T19:28:52 | 2016-07-08T19:28:52 | 30,972,579 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,171 | java | /*
* Copyright (c) 2015, EMC Corporation.
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* + Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* + Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* + The name of EMC Corporation may not be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
package com.emc.codec.compression.deflate;
import com.emc.codec.compression.CompressionInputStream;
import java.io.InputStream;
import java.util.zip.Deflater;
import java.util.zip.DeflaterInputStream;
public class DeflateInputStream extends CompressionInputStream {
private int compressionLevel;
public DeflateInputStream(InputStream in, String encodeSpec, int compressionLevel) {
super(in, encodeSpec);
this.compressionLevel = compressionLevel;
initStreams(in);
}
@Override
protected InputStream getCompressionStream(InputStream input) {
return new DeflaterInputStream(input, new Deflater(compressionLevel));
}
} | [
"stu.arnett@emc.com"
] | stu.arnett@emc.com |
5fac62d365791742dfc4731e5ceb0238451af1b6 | b146f6b539aaa82905c09a3e48201bafe509db3a | /src/action/buyer/Buyer_Apply_Purchase_Action.java | 6c09160f6f9cb02e0df9331e424a156809f41eaa | [] | no_license | dhgkswhd/public | 9c8c664124094ea584ce97e1cb9c9995fb543cb2 | bcaac4cf5778df262013e25e402633fafeea4106 | refs/heads/master | 2020-04-22T09:24:09.840523 | 2019-02-12T07:03:13 | 2019-02-12T07:03:13 | 170,267,454 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,404 | java | package action.buyer;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import dao.BuyerDAO;
import dao.TradingDAO;
import vo.TradingVO;
@WebServlet("/apply_purchase.do")
public class Buyer_Apply_Purchase_Action extends HttpServlet {
private static final long serialVersionUID = 1L;
/* 사업자회원 매입신청하기 */
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
request.setCharacterEncoding("utf-8");
int p_idx = Integer.parseInt( request.getParameter("p_idx") ); // 제품고유번호
String p_image_s = request.getParameter("p_image_s"); // 미리보기이미지
String p_name = request.getParameter("p_name"); // 제품명
String seller_id = request.getParameter("seller_id"); // 판매자
int seller_hopeprice = Integer.parseInt(request.getParameter("seller_hopeprice")); // 판매희망가
String buyer_id = request.getParameter("buyer_id"); // 구매자
int buyer_hopeprice = Integer.parseInt(request.getParameter("buyer_hopeprice")); // 구매희망가
System.out.println("제품고유번호 : " + p_idx);
System.out.println("판매자 : " + seller_id);
System.out.println("판매자 판매희망가격 : " + seller_hopeprice);
System.out.println("구매자 : " + buyer_id);
System.out.println("구매희망가 : " + buyer_hopeprice);
System.out.println("상품매입신청자 : " + buyer_id);
System.out.println("이미지명 : " + p_image_s);
System.out.println("상품명 : " + p_name);
TradingVO vo = new TradingVO();
vo.setP_idx( p_idx );
vo.setP_image_s( p_image_s );
vo.setP_name( p_name );
vo.setSeller_id( seller_id );
vo.setSeller_hopeprice( seller_hopeprice );
vo.setBuyer_id( buyer_id );
vo.setBuyer_hopeprice( buyer_hopeprice );
// Trading 테이블에 인서트
TradingDAO.getInstance().insertTrading( vo );
RequestDispatcher disp = request.getRequestDispatcher("product_list_input.do");
disp.forward(request, response);
}
}
| [
"dhgkswhdz@naver.com"
] | dhgkswhdz@naver.com |
4b14ebe8db1130c2201d298895a9cff98cef01e8 | 18b1b220fe30fd5a81d12bc7c73a854871cf9006 | /app/src/main/java/com/binh/qrcode/history/HistoryManager.java | cfeb1d20a50115b4d77049f386e0c39ae35920b1 | [] | no_license | binhdk/BarCode-Scanner | 9858099ca32ac15b44e31117a340f0603c1ced9d | 984ecf9beeccb02d6d3faf12bb5fa6a7748d99bd | refs/heads/master | 2021-09-11T21:52:55.906355 | 2018-04-12T16:54:58 | 2018-04-12T16:54:58 | 117,088,580 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,744 | java | package com.binh.qrcode.history;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;
import com.google.zxing.BarcodeFormat;
import com.google.zxing.Result;
import java.util.ArrayList;
import java.util.List;
/**
* Created by binh on 11/11/2017.
* handle scanned item in local database
*/
public class HistoryManager {
private Context context;
public HistoryManager(Context context) {
this.context = context;
}
public void clearHistory() {
SQLiteOpenHelper helper = new DBHelper(context);
SQLiteDatabase db = null;
try {
db = helper.getWritableDatabase();
db.delete(DBHelper.TABLE_NAME, null, null);
} catch (Exception e) {
Log.e(HistoryManager.class.getSimpleName(), "error ", e);
} finally {
close(null, db);
}
}
public void addItem(HistoryItem item) {
if (getItem(item.getResult().getText()) != null)
return;
SQLiteOpenHelper helper = new DBHelper(context);
SQLiteDatabase db = null;
try {
db = helper.getWritableDatabase();
ContentValues values = new ContentValues();
values.put(DBHelper.TEXT_COL, item.getResult().getText());
values.put(DBHelper.FORMAT_COL, item.getResult().getBarcodeFormat().name());
values.put(DBHelper.DISPLAY_COL, item.getDisplayAndDetails());
values.put(DBHelper.TIMESTAMP_COL, System.currentTimeMillis());
db.insert(DBHelper.TABLE_NAME, null, values);
} catch (Exception e) {
Log.e(HistoryManager.class.getSimpleName(), "error ", e);
} finally {
close(null, db);
}
}
public HistoryItem getItem(int id) {
SQLiteOpenHelper helper = new DBHelper(context);
SQLiteDatabase db = null;
Cursor cursor = null;
HistoryItem historyItem = null;
try {
db = helper.getReadableDatabase();
cursor = db.query(DBHelper.TABLE_NAME, null, DBHelper.ID_COL + "=?", new String[]{String.valueOf(id)}, null, null, null);
while (cursor.moveToNext()) {
int itemId = cursor.getInt(0);
String text = cursor.getString(1);
String format = cursor.getString(2);
String display = cursor.getString(3);
long timestamp = cursor.getLong(4);
Result result = new Result(text, null, null, BarcodeFormat.valueOf(format), timestamp);
historyItem = new HistoryItem(itemId, result, display);
}
} catch (Exception e) {
Log.e(HistoryManager.class.getSimpleName(), "error ", e);
} finally {
close(cursor, db);
}
return historyItem;
}
public void deleteItem(int id) {
SQLiteOpenHelper helper = new DBHelper(context);
SQLiteDatabase db = null;
try {
db = helper.getWritableDatabase();
db.delete(DBHelper.TABLE_NAME, DBHelper.ID_COL + '=' + id, null);
} catch (Exception e) {
Log.e(HistoryManager.class.getSimpleName(), "error ", e);
} finally {
close(null, db);
}
}
public HistoryItem getItem(String content) {
SQLiteOpenHelper helper = new DBHelper(context);
SQLiteDatabase db = null;
Cursor cursor = null;
HistoryItem historyItem = null;
try {
db = helper.getReadableDatabase();
cursor = db.query(DBHelper.TABLE_NAME, null, DBHelper.TEXT_COL + "=?", new String[]{content}, null, null, null);
while (cursor.moveToNext()) {
int itemId = cursor.getInt(0);
String text = cursor.getString(1);
String format = cursor.getString(2);
String display = cursor.getString(3);
long timestamp = cursor.getLong(4);
Result result = new Result(text, null, null, BarcodeFormat.valueOf(format), timestamp);
historyItem = new HistoryItem(itemId, result, display);
}
} catch (Exception e) {
Log.e(HistoryManager.class.getSimpleName(), "error ", e);
} finally {
close(cursor, db);
}
return historyItem;
}
public List<HistoryItem> getAll() {
List<HistoryItem> list = new ArrayList<>();
SQLiteOpenHelper helper = new DBHelper(context);
SQLiteDatabase db = null;
Cursor cursor = null;
try {
db = helper.getReadableDatabase();
cursor = db.query(DBHelper.TABLE_NAME, null, null, null, null, null, null);
while (cursor.moveToNext()) {
int id = cursor.getInt(0);
String text = cursor.getString(1);
String format = cursor.getString(2);
String display = cursor.getString(3);
long timestamp = cursor.getLong(4);
Result result = new Result(text, null, null, BarcodeFormat.valueOf(format), timestamp);
list.add(new HistoryItem(id, result, display));
}
} catch (Exception e) {
Log.e(HistoryManager.class.getSimpleName(), e.getMessage());
} finally {
close(cursor, db);
}
return list;
}
private static void close(Cursor cursor, SQLiteDatabase database) {
if (cursor != null) {
cursor.close();
}
if (database != null) {
database.close();
}
}
}
| [
"binhnv96@gmail.com"
] | binhnv96@gmail.com |
9b056543f832e177530869969f4161e29519dbfc | 5c3f9e09f69069896d382bee3edef36bb2229129 | /app/src/main/java/mawashi/alex/simplefragm/MySecondFragment.java | f6b15983b1c93b93b64327caa53a371365409520 | [] | no_license | alessandroargentieri/SimpleFragm | 7aa2a102d5251be08e845136480ea563b57e3348 | 956486aa9083cfcd7f2dd28405193cb1fd985f10 | refs/heads/master | 2021-01-09T06:26:56.900503 | 2016-07-01T12:45:35 | 2016-07-01T12:45:35 | 62,392,371 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 487 | java | package mawashi.alex.simplefragm;
import android.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
public class MySecondFragment extends Fragment {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup parentViewGroup, Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_due_my, parentViewGroup, false);
return rootView;
}
}
| [
"alessandro.argentieri@cetma.local"
] | alessandro.argentieri@cetma.local |
823d95df355e37882db7a5770f2b044e8d0a3937 | 4d7dbf51b0263f7a9ebe9dd0fc1ecfbdee110b68 | /app/src/main/java/com/developerdesk9/ecommerce/Payment_final_Activity.java | 09fac41be7138d76c56709ef2b2d68112091ff5f | [
"MIT"
] | permissive | densuz/Odd-Jobs | 3728d7818814fd7d456d233d13a15c5156a2f176 | abbfb3a1320cc180f3833636b7abb24a3a33e97a | refs/heads/master | 2022-12-28T18:00:24.722119 | 2020-10-05T19:40:27 | 2020-10-05T19:40:27 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 15,090 | java | package com.developerdesk9.ecommerce;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import android.app.ProgressDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.RadioGroup;
import android.widget.TextView;
import android.widget.Toast;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
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.ValueEventListener;
import com.shreyaspatil.EasyUpiPayment.EasyUpiPayment;
import com.shreyaspatil.EasyUpiPayment.listener.PaymentStatusListener;
import com.shreyaspatil.EasyUpiPayment.model.TransactionDetails;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
public class Payment_final_Activity extends AppCompatActivity {
private Toolbar toolbar;
private DatabaseReference mDatabase;
private FirebaseUser currentUser;
private FirebaseAuth mAuth;
private String user_id;
private String name;
private String address;
private String total_price;
private String total_product_count;
private String Orderid="Cancelled";
//This one is extra from cart
private String ordertypeflag;
private String product_image;
private String product_name;
private String product_description;
private String company_name;
private TextView tv_itemcount;
private TextView tv_price1;
private TextView tv_totalamount;
private TextView tv_orderID;
private Button button;
private String radioflag=null;
private String order_status;
private EasyUpiPayment easyUpiPayment;
private LinearLayout linearLayout;
private ProgressDialog progressDialog;
private String currentDateTimeString;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_payment_final_);
currentDateTimeString = java.text.DateFormat.getDateTimeInstance().format(new Date());
progressDialog=new ProgressDialog(this);
progressDialog.setTitle("Please Wait");
progressDialog.setMessage("Please don't close App or press the back button");
progressDialog.setCanceledOnTouchOutside(false);
mDatabase = FirebaseDatabase.getInstance().getReference();
mAuth = FirebaseAuth.getInstance();
currentUser = mAuth.getCurrentUser();
toolbar=findViewById(R.id.toolbar_final_payment);
toolbar.setTitle("Payments");
toolbar.setTitleTextColor(Color.WHITE);
toolbar.setNavigationIcon(getResources().getDrawable(R.drawable.ic_arrow_back));
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
back_cancel_press_btn_response();
}
});
Bundle bundle = getIntent().getExtras();
name = bundle.get("name").toString();
address = bundle.get("address").toString();
total_price = bundle.get("total_price").toString();
total_product_count = bundle.get("total_product_count").toString();
Orderid=bundle.get("order_id").toString();
ordertypeflag=bundle.get("order_typeflag").toString();
product_image=bundle.get("product_image").toString();
product_name=bundle.get("product_name").toString();
product_description=bundle.get("product_description").toString();
company_name=bundle.get("company_name").toString();
if (currentUser==null){
sendToLogin();
}
else if (bundle.isEmpty()){
onBackPressed();
}
else {
user_id=currentUser.getUid();
}
tv_itemcount=findViewById(R.id.final_payment_item_count);
tv_price1=findViewById(R.id.final_payment_price);
tv_totalamount=findViewById(R.id.final_payment_amount_payable); // these both are same as delivery charges case is not
tv_orderID=findViewById(R.id.final_payment_order_id);
tv_itemcount.setText(total_product_count);
String newNumber = CommaSeperate.getFormatedNumber(total_price);
tv_price1.setText("₹"+newNumber);
tv_totalamount.setText("₹"+newNumber);
tv_orderID.setText("TID"+Orderid);
//over showoff
button=findViewById(R.id.payment_btn);
RadioGroup rb = findViewById(R.id.myRadioGroup);
rb.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
public void onCheckedChanged(RadioGroup group, int checkedId) {
switch (checkedId) {
case R.id.radiobtn1:
button.setText("Place Order");
button.setVisibility(View.VISIBLE);
radioflag="COD";
break;
case R.id.radiobtn2:
button.setText("Pay");
button.setVisibility(View.VISIBLE);
radioflag="UPI";
break;
default:
radioflag="Nothing Selected";
}
}
});
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
progressDialog.show();
orderprocessing();
}
});
}
private void orderprocessing(){
if (radioflag.equals("COD")){
order_status="COD";
callcode();
}
else if (radioflag.equals("UPI")){
upipayment();
}
}
private void callcode(){
// When you will usse COD then this function will revoke
if (ordertypeflag.equals("single")){
Map<String ,Object> data=new HashMap<>();
data.put("order_status",order_status);
mDatabase.child("TransactionDetails").child(Orderid).updateChildren(data);
singleproductorder();
}
else if (ordertypeflag.equals("cart")){
Map<String ,Object> data=new HashMap<>();
data.put("order_status",order_status);
mDatabase.child("TransactionDetails").child(Orderid).updateChildren(data);
orderbycart();
}
}
// This method will invoke in case of success/ failure of upi payment
private void callpayment(){
if (ordertypeflag.equals("single")){
singleproductorder();
}
else if (ordertypeflag.equals("cart")){
orderbycart();
}
}
private void singleproductorder(){
HashMap<String, Object> dataMap = new HashMap<>();
dataMap.put("product_image", product_image);
dataMap.put("product_name", product_name);
dataMap.put("product_price", total_price);
dataMap.put("product_description", product_description);
dataMap.put("company_name", company_name);
dataMap.put("name", name);
dataMap.put("address", address);
dataMap.put("user_id", user_id);
dataMap.put("order_status",order_status);
dataMap.put("order_id",Orderid);
dataMap.put("order_date",currentDateTimeString);
Map<String ,Object> data=new HashMap<>();
data.put("order_status",order_status);
data.put("tr_date",currentDateTimeString);
mDatabase.child("TransactionDetails").child(Orderid).updateChildren(data);
// here orderID is unique key and acting as transaction ID too
mDatabase.child("orders").child(user_id).child(Orderid).setValue(dataMap).addOnCompleteListener(new OnCompleteListener<Void>() {
@Override
public void onComplete(@NonNull Task<Void> task) {
Toast.makeText(getApplicationContext(), "Order Placed successfully", Toast.LENGTH_LONG).show();
progressDialog.dismiss();
Intent mainIntent = new Intent(Payment_final_Activity.this, TransactionActivity.class);
startActivity(mainIntent);
finish();
}
});
}
private void orderbycart(){
Map<String ,Object> data=new HashMap<>();
data.put("order_status",order_status);
data.put("tr_date",currentDateTimeString);
mDatabase.child("TransactionDetails").child(Orderid).updateChildren(data);
mDatabase.child("cart").child(user_id).addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
for (DataSnapshot ds : dataSnapshot.getChildren()) {
Map<String, Object> map = (Map<String, Object>) ds.getValue();
Object producut_name = map.get("product_name");
Object product_image = map.get("product_image");
Object seller_name = map.get("company_name");
Object cart_key = map.get("cart_key");
Object product_description = map.get("product_description");
Object product_price = map.get("product_price");
map.put("order_status",order_status);
map.put("address",address);
map.put("name",name);
map.put("order_id",Orderid);
map.put("order_date",currentDateTimeString);
mDatabase.child("orders").child(user_id).push().setValue(map);
}
}
@Override
public void onCancelled(@NonNull DatabaseError databaseError) {
}
});
mDatabase.child("cart").child(user_id).setValue(null).addOnCompleteListener(new OnCompleteListener<Void>() {
@Override
public void onComplete(@NonNull Task<Void> task) {
}
});
progressDialog.dismiss();
Toast.makeText(getApplicationContext(), "Order Placed successfully", Toast.LENGTH_LONG).show();
Intent orderIntent = new Intent(Payment_final_Activity.this, TransactionActivity.class);
startActivity(orderIntent);
finish();
}
@Override
public void onBackPressed() {
order_status="Cancelled";
back_cancel_press_btn_response();
}
private void upipayment(){
easyUpiPayment = new EasyUpiPayment.Builder()
.with(Payment_final_Activity.this)
.setPayeeVpa("helpdesk@barodampay")
.setPayeeName("Saurabh Pandey")
.setTransactionId("TI"+Orderid)
.setTransactionRefId("TRI"+Orderid)
.setDescription("Paying to Odd Jobs Pvt Ltd")
.setAmount((total_price+".00").trim())
.build();
easyUpiPayment.startPayment();
progressDialog.show();
easyUpiPayment.setPaymentStatusListener(new PaymentStatusListener() {
@Override
public void onTransactionCompleted(TransactionDetails transactionDetails) {
}
@Override
public void onTransactionSuccess() {
order_status="SUCCESS";
easyUpiPayment.detachListener();
callpayment();
}
@Override
public void onTransactionSubmitted() {
Toast.makeText(getApplicationContext(),"Transaction Started",Toast.LENGTH_LONG).show();
}
@Override
public void onTransactionFailed() {
order_status="FAILED";
easyUpiPayment.detachListener();
transaction_fail_cancel_case();
Toast.makeText(getApplicationContext(),"Transaction Failed",Toast.LENGTH_LONG).show();
}
@Override
public void onTransactionCancelled() {
progressDialog.dismiss();
easyUpiPayment.detachListener();
Toast.makeText(getApplicationContext(),"Payment Cancelled",Toast.LENGTH_LONG).show();
}
@Override
public void onAppNotFound() {
progressDialog.dismiss();
Toast.makeText(getApplicationContext(),"App not found Please Try another option",Toast.LENGTH_LONG).show();
}
});
}
private void transaction_fail_cancel_case(){
progressDialog.show();
Map<String ,Object> data=new HashMap<>();
data.put("order_status",order_status);
data.put("tr_date",currentDateTimeString);
mDatabase.child("TransactionDetails").child(Orderid).updateChildren(data).addOnCompleteListener(new OnCompleteListener<Void>() {
@Override
public void onComplete(@NonNull Task<Void> task) {
if (task.isSuccessful()){
Toast.makeText(getApplicationContext(),"Transaction Failed..",Toast.LENGTH_LONG).show();
progressDialog.dismiss();
startActivity(new Intent(getApplicationContext(),TransactionActivity.class));
finish();
}
else {
progressDialog.dismiss();
Toast.makeText(getApplicationContext(),"Something went wrong",Toast.LENGTH_LONG).show();
}
}
});
}
public void back_cancel_press_btn_response(){
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle("Cancel Transaction!");
builder.setMessage("Are you sure you want cancel transaction");
builder.setCancelable(false);
builder.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which)
{
order_status="Cancelled";
transaction_fail_cancel_case();
}
});
builder.setNegativeButton("No", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which)
{
dialog.cancel();
}
});
AlertDialog alertDialog = builder.create();
alertDialog.show(); // Show the Alert Dialog box
}
private void sendToLogin() {
Intent loginIntent = new Intent(Payment_final_Activity.this, login.class);
startActivity(loginIntent);
finishAffinity();
}
}
| [
"saurabh17100@gmail.com"
] | saurabh17100@gmail.com |
f1acf864e9f5e25e96773f3d94e2079c68eb71a3 | 88e468ed062971b2ea3177c6c84799327095c6c8 | /app/src/main/java/org/aplas/animaltour/ItemMoveCallback.java | b4cb99ca4a2e378bbb8c8583bf20a7d1e993216d | [] | no_license | genadidharma/AnimalTour | 628c39488195ad866029f83433f303cdd05de0d6 | 4cdc56c583269e661532fff53810ae86ea4e6a0c | refs/heads/master | 2023-08-31T16:08:47.417267 | 2021-10-06T02:29:19 | 2021-10-06T02:29:19 | 413,641,747 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,317 | java | package org.aplas.animaltour;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.ItemTouchHelper;
import androidx.recyclerview.widget.RecyclerView;
public class ItemMoveCallback extends ItemTouchHelper.Callback {
private final ItemTouchHelperContract mAdapter;
public ItemMoveCallback(ItemTouchHelperContract adapter) {
mAdapter = adapter;
}
@Override
public boolean isLongPressDragEnabled() { return true; }
@Override
public boolean isItemViewSwipeEnabled() { return false; }
@Override
public void onSwiped(@NonNull RecyclerView.ViewHolder viewHolder, int i) { }
@Override
public int getMovementFlags(RecyclerView recyclerView,
RecyclerView.ViewHolder viewHolder) {
int dragFlags = ItemTouchHelper.UP | ItemTouchHelper.DOWN;
return makeMovementFlags(dragFlags, 0);
}
@Override
public boolean onMove(RecyclerView recyclerView,
RecyclerView.ViewHolder viewHolder, RecyclerView.ViewHolder target) {
mAdapter.onRowMoved(viewHolder.getAdapterPosition(), target.getAdapterPosition());
return true;
}
@Override
public void onSelectedChanged(RecyclerView.ViewHolder viewHolder,int actionState) {
if (actionState != ItemTouchHelper.ACTION_STATE_IDLE) {
if (viewHolder instanceof DataAdapter.ViewHolder) {
DataAdapter.ViewHolder myViewHolder=(DataAdapter.ViewHolder) viewHolder;
mAdapter.onRowSelected(myViewHolder);
}
}
super.onSelectedChanged(viewHolder, actionState);
}
@Override
public void clearView(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder) {
super.clearView(recyclerView, viewHolder);
if (viewHolder instanceof DataAdapter.ViewHolder) {
DataAdapter.ViewHolder myViewHolder =(DataAdapter.ViewHolder) viewHolder;
mAdapter.onRowClear(myViewHolder);
}
}
public interface ItemTouchHelperContract {
void onBindViewHolder(DataAdapter.ViewHolder holder, int position);
void onRowMoved(int fromPosition, int toPosition);
void onRowSelected(DataAdapter.ViewHolder myViewHolder);
void onRowClear(DataAdapter.ViewHolder myViewHolder);
}
} | [
"genadislawa@gmail.com"
] | genadislawa@gmail.com |
6b5485c2807fc0e52bcb6fd5c3d9e41d498c624a | ef847d3500babd0b2d881a3d176fe13de2295ae5 | /gmall-pms-interface/src/main/java/com/atguigu/gmall/pms/entity/SkuImagesEntity.java | 48e2fccaefc17b802013e462ebe1964a9c1ed0be | [
"Apache-2.0"
] | permissive | zxc-cll/gmall | 056278170c95abfb27f57ab5f3bd59250bc22ed6 | 6f6bba68b199b46e33ce28044d76327b1a6945e7 | refs/heads/main | 2023-08-13T08:30:33.855062 | 2021-10-03T12:59:49 | 2021-10-03T12:59:49 | 400,727,299 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 733 | java | package com.atguigu.gmall.pms.entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* sku图片
*
* @author zxc
* @email zxc_cll@163.com
* @date 2021-08-28 19:19:37
*/
@Data
@TableName("pms_sku_images")
public class SkuImagesEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
@TableId
private Long id;
/**
* sku_id
*/
private Long skuId;
/**
* 图片地址
*/
private String url;
/**
* 排序
*/
private Integer sort;
/**
* 默认图[0 - 不是默认图,1 - 是默认图]
*/
private Integer defaultStatus;
}
| [
"9453179+zxccl@user.noreply.gitee.com"
] | 9453179+zxccl@user.noreply.gitee.com |
0082412f399010633c33ff25cc56bd64a8e1ba28 | a2141c782439849c71a25414ce0e510d3fbfba05 | /src/com/abc/factory1/SearchBar.java | 256500d2793a7663b2f7b0cc9ad5f116cafffaa9 | [] | no_license | SofiyaL/Learning-factory | cc7035d1c1f3765ad2cfa08a36b39258eaa75659 | 02a554638dd12b9637507d186a96b96c34efb0ba | refs/heads/master | 2021-03-06T15:27:57.746488 | 2020-03-10T04:45:26 | 2020-03-10T04:45:26 | 246,207,533 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,631 | java | package com.abc.factory1;
import java.io.IOException;
import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@WebServlet("/SearchBar")
public class SearchBar extends HttpServlet {
private static final long serialVersionUID = 1L;
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.setContentType("text/html");
PrintWriter out =response.getWriter();
String name =request.getParameter("name");
String url="jdbc:mysql://Localhost:3306/student";
String user="root";
String pwd="root";
Connection con=null;
PreparedStatement pstmt=null;
ResultSet rst = null;
String firstname=request.getParameter("fname").trim();
String lastname = request.getParameter("lname").trim();
String gender= request.getParameter("gender").trim();
String dob= request.getParameter("birthday");
String we= request.getParameter("message");
String qry1="insert into registrations1 values (?,?,?,?,?)";
if(firstname==null || firstname=="" || lastname==null || lastname==""
|| gender==null || gender=="" || dob==null || dob=="" || we=="" || we==null) {
out.println("<h2>ALL FEILD ARE MANDATORY</h2>");
RequestDispatcher dispatcher = request.getRequestDispatcher("KYC.html");
dispatcher.include(request, response);
}
else {
try {
Class.forName("com.mysql.jdbc.Driver");
con=DriverManager.getConnection(url,user,pwd);
pstmt=con.prepareStatement(qry1);
pstmt.setString(1, firstname );
pstmt.setString(2,lastname );
pstmt.setString(3, gender );
pstmt.setString(4, dob );
pstmt.setString(5, we );
pstmt.executeUpdate();
RequestDispatcher dispatcher = request.getRequestDispatcher("/KYC3.html");
dispatcher.forward(request, response);
}
catch(ClassNotFoundException | SQLException e) {
e.printStackTrace();
}
finally {
try {
if(rst!=null) {
rst.close();
}
if(pstmt!=null) {
pstmt.close();
}
if(con!=null) {
con.close();
}
}
catch(SQLException e) {
e.printStackTrace();
}
}
}
}
}
| [
"sofu.817@gmail.com"
] | sofu.817@gmail.com |
d98a5872815672c15be04fc2c94767c3d13cb2a5 | 07f0af82fe5a106b74bc6d1aeff30dfe4b0d6e73 | /app/src/main/java/personal/wl/jspos/pos/PmtDmRel.java | 748d4a9d74e090f0aba346106114e77b8278abe1 | [] | no_license | gongfranksh/jsPos | d397dbd56258bbc54c199c35c69215c96d40fedb | 5fdc3b0d71b602f825ce1fa2812702cb7a94254c | refs/heads/master | 2020-03-28T11:43:58.174752 | 2019-11-01T09:03:41 | 2019-11-01T09:03:41 | 148,083,386 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,747 | java | package personal.wl.jspos.pos;
import org.greenrobot.greendao.annotation.*;
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. Enable "keep" sections if you want to edit.
/**
* Entity mapped to table "PMT_DM_REL".
*/
@Entity
public class PmtDmRel {
@Id(autoincrement = true)
private Long id;
private String Braid;
private String DMId;
private java.util.Date DMBeginDate;
private java.util.Date DMEndDate;
private String SupId;
private String Proid;
private Double OrigSalePrice;
private Double SalePrice;
private Long TimeStamp;
@Generated
public PmtDmRel() {
}
public PmtDmRel(Long id) {
this.id = id;
}
@Generated
public PmtDmRel(Long id, String Braid, String DMId, java.util.Date DMBeginDate, java.util.Date DMEndDate, String SupId, String Proid, Double OrigSalePrice, Double SalePrice, Long TimeStamp) {
this.id = id;
this.Braid = Braid;
this.DMId = DMId;
this.DMBeginDate = DMBeginDate;
this.DMEndDate = DMEndDate;
this.SupId = SupId;
this.Proid = Proid;
this.OrigSalePrice = OrigSalePrice;
this.SalePrice = SalePrice;
this.TimeStamp = TimeStamp;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getBraid() {
return Braid;
}
public void setBraid(String Braid) {
this.Braid = Braid;
}
public String getDMId() {
return DMId;
}
public void setDMId(String DMId) {
this.DMId = DMId;
}
public java.util.Date getDMBeginDate() {
return DMBeginDate;
}
public void setDMBeginDate(java.util.Date DMBeginDate) {
this.DMBeginDate = DMBeginDate;
}
public java.util.Date getDMEndDate() {
return DMEndDate;
}
public void setDMEndDate(java.util.Date DMEndDate) {
this.DMEndDate = DMEndDate;
}
public String getSupId() {
return SupId;
}
public void setSupId(String SupId) {
this.SupId = SupId;
}
public String getProid() {
return Proid;
}
public void setProid(String Proid) {
this.Proid = Proid;
}
public Double getOrigSalePrice() {
return OrigSalePrice;
}
public void setOrigSalePrice(Double OrigSalePrice) {
this.OrigSalePrice = OrigSalePrice;
}
public Double getSalePrice() {
return SalePrice;
}
public void setSalePrice(Double SalePrice) {
this.SalePrice = SalePrice;
}
public Long getTimeStamp() {
return TimeStamp;
}
public void setTimeStamp(Long TimeStamp) {
this.TimeStamp = TimeStamp;
}
}
| [
"gongfranksh@qq.com"
] | gongfranksh@qq.com |
a9bbb18f038ed90fd25cfcc213cd1373a96c7740 | 068a690ae653e289321dfe34a6f14321249624ee | /app/src/main/java/com/example/administrator/tommusic/AudioRecordDemo.java | 48235e4a8f305315c8c91db9d024ef96b6ac57fc | [] | no_license | Arialena/TomMusic | f5209087da4130bb806cf2186add55aa7b1df00e | b0e60ed0afb8f0d0d4ccf6b06c396d60ae49c9d3 | refs/heads/master | 2021-01-12T01:25:09.582746 | 2017-01-09T01:27:26 | 2017-01-09T01:27:26 | 78,382,981 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,521 | java | package com.example.administrator.tommusic;
import android.media.AudioFormat;
import android.media.AudioRecord;
import android.media.MediaRecorder;
import android.util.Log;
/**
* Created by Administrator on 2017/1/6.
*/
public class AudioRecordDemo {
private static final String TAG = "AudioRecord";
static final int SAMPLE_RATE_IN_HZ = 8000;
static final int BUFFER_SIZE = AudioRecord.getMinBufferSize(SAMPLE_RATE_IN_HZ,
AudioFormat.CHANNEL_IN_DEFAULT, AudioFormat.ENCODING_PCM_16BIT);
AudioRecord mAudioRecord;
boolean isGetVoiceRun;
Object mLock;
public AudioRecordDemo() {
mLock = new Object();
getNoiseLevel();
}
public void getNoiseLevel() {
if (isGetVoiceRun) {
Log.e(TAG, "还在录着呢");
return;
}
mAudioRecord = new AudioRecord(MediaRecorder.AudioSource.MIC,
SAMPLE_RATE_IN_HZ, AudioFormat.CHANNEL_IN_DEFAULT,
AudioFormat.ENCODING_PCM_16BIT, BUFFER_SIZE);
if (mAudioRecord == null) {
Log.e("sound", "mAudioRecord初始化失败");
}
isGetVoiceRun = true;
new Thread(new Runnable() {
@Override
public void run() {
mAudioRecord.startRecording();
short[] buffer = new short[BUFFER_SIZE];
while (isGetVoiceRun) {
//r是实际读取的数据长度,一般而言r会小于buffersize
int r = mAudioRecord.read(buffer, 0, BUFFER_SIZE);
long v = 0;
// 将 buffer 内容取出,进行平方和运算
for (int i = 0; i < buffer.length; i++) {
v += buffer[i] * buffer[i];
}
// 平方和除以数据总长度,得到音量大小。
double mean = v / (double) r;
double volume = 10 * Math.log10(mean);
Log.d(TAG, "分贝值:" + volume);
// 大概一秒十次
synchronized (mLock) {
try {
mLock.wait(100);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
mAudioRecord.stop();
mAudioRecord.release();
mAudioRecord = null;
}
}).start();
}
}
| [
"1257503765@qq.com"
] | 1257503765@qq.com |
2589ffbc720b3ccbf7a2655354806229873570ae | 789a76748fb8a7079c50b3ad059015163bcbc5e5 | /upa/src/main/java/com/upa/web/model/entity/AlertMessage.java | e13fe5fb9d31b8b09d646ac5e9110d2f3db57ba3 | [] | no_license | ecoliteracy/upa | c2599afcc709df60613d268a3828db99a152cd3a | bff270baab1f989c1deb14d5904571248541a318 | refs/heads/master | 2021-07-25T07:39:13.404710 | 2019-03-07T22:09:31 | 2019-03-07T22:09:31 | 98,909,514 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,826 | java | package com.upa.web.model.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table(schema = "upa", name="upa_alert_message")
public class AlertMessage extends BaseEntity{
@Id
@Column(name="MESSAGE_SEQ", unique = true, nullable = false)
@GeneratedValue(strategy=GenerationType.IDENTITY)
Integer messageSeq;
@Column(name="MESSAGE_CODE")
String messageCode;
@Column(name="MESSAGE_TYPE")
String messageType;
@Column(name="LANGUAGE_CODE")
String languageCode;
@Column(name="MESSAGE_VALUE")
String messageValue;
public AlertMessage(){};
public AlertMessage(Integer messageSeq, String messageCode, String messageType, String languageCode, String messageValue){
this.messageSeq = messageSeq;
this.messageCode = messageCode;
this.messageType = messageType;
this.messageValue = messageValue;
}
public Integer getMessageSeq() {
return messageSeq;
}
public void setMessageSeq(Integer messageSeq) {
this.messageSeq = messageSeq;
}
public String getMessageCode() {
return messageCode;
}
public void setMessageCode(String messageCode) {
this.messageCode = messageCode;
}
public String getMessageType() {
return messageType;
}
public void setMessageType(String messageType) {
this.messageType = messageType;
}
public String getLanguageCode() {
return languageCode;
}
public void setLanguageCode(String languageCode) {
this.languageCode = languageCode;
}
public String getMessageValue() {
return messageValue;
}
public void setMessageValue(String messageValue) {
this.messageValue = messageValue;
}
} | [
"kiwasaki@LAPTOP-Q3S2H8H7.kgit.kwe.com"
] | kiwasaki@LAPTOP-Q3S2H8H7.kgit.kwe.com |
b100aaea2211edd80bd922638c83d3cce6b70768 | 38774905269d5922a675ad3cf57af3bc0672a856 | /PlayingCat/src/com/kenny/Main.java | 04f324c5f1be9766cfcc391727c3fefba14a4592 | [] | no_license | LarKinKeNny/java-masterclass | 91dc36ab039da4ceed4b515efde2f69c9424cae3 | 26380fad81f137e3c3a13af408d8eaf6b0651b9e | refs/heads/master | 2020-03-27T20:33:47.274402 | 2018-09-11T16:47:34 | 2018-09-11T16:47:34 | 147,077,879 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 402 | java | package com.kenny;
public class Main {
public static void main(String[] args) {
// write your code here
}
public static boolean isCatPlaying(boolean summer,int temperature){
if(temperature>=25 && temperature<=35 && !summer){
return true;
}else if(temperature>=25 && temperature<=45 && summer){
return true;
}
return false;
}
}
| [
"lsmits.mail@gmail.com"
] | lsmits.mail@gmail.com |
bafa908abba0610a98dc410653a8c285ecff3ad9 | b177e84cf4aad8263230122e5136dd9b68a6df54 | /app/src/main/java/com/luis_santiago/receta/AddRecetaActivity.java | 4def7269827a72edfb11a9c1ec8e66e4aed5b265 | [] | no_license | luissantiagodev/Receta-App | 294247c6180666266c3281093769041dc4648196 | fc31cf464f3682a8140754d229b6f645ed8562fe | refs/heads/master | 2020-03-22T04:41:46.813198 | 2018-07-09T22:01:58 | 2018-07-09T22:01:58 | 139,514,640 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,639 | java | package com.luis_santiago.receta;
import android.Manifest;
import android.app.Activity;
import android.content.ContentResolver;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Build;
import android.os.Environment;
import android.provider.MediaStore;
import android.support.annotation.NonNull;
import android.support.design.widget.TextInputEditText;
import android.support.v4.app.ActivityCompat;
import android.support.v4.content.ContextCompat;
import android.support.v4.content.FileProvider;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.RatingBar;
import android.widget.Toast;
import com.luis_santiago.receta.POJOS.Receta;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.net.URI;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.UUID;
public class AddRecetaActivity extends AppCompatActivity {
private static final String TAG = AddRecetaActivity.class.getSimpleName();
private Button addButton , takePhoto;
private TextInputEditText id,name,personas,description,preparacion;
private RatingBar ratingBar;
private Data data;
private Boolean isPhototaken = false;
private static final int TAKE_PICTURE = 1;
private final int REQUEST_CODE_PERMISSION = 2;
private Uri imageUri;
private String absolutePath;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_add_receta);
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);
init();
data = new Data(this);
addButton.setOnClickListener(View->{
//Add
if(isPhototaken){
data.open();
Receta receta = new Receta(
UUID.randomUUID().toString(),
name.getText().toString().trim(),
Integer.valueOf(personas.getText().toString().trim()),
description.getText().toString().trim(),
preparacion.getText().toString().trim(),
absolutePath,
ratingBar.getNumStars()
);
data.insertReceta(receta);
data.close();
Toast.makeText(getApplicationContext() , "Registro agregado" , Toast.LENGTH_LONG).show();
finish();
}else {
Toast.makeText(getApplicationContext() , "Toma una foto" , Toast.LENGTH_LONG).show();
}
});
takePhoto.setOnClickListener(View->{
if(checkPermissionToStore()) {
File pictureFile = getOutputMediaFile();
if(pictureFile !=null){
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
intent.putExtra(MediaStore.EXTRA_OUTPUT , FileProvider.getUriForFile(this , "com.luis_santiago.receta.provider" , pictureFile));
intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
imageUri = FileProvider.getUriForFile(this , "com.luis_santiago.receta.provider" , pictureFile);
absolutePath = pictureFile.getAbsolutePath();
startActivityForResult(intent , TAKE_PICTURE);
}
}else{
requestPermission();
}
});
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
switch (requestCode){
case TAKE_PICTURE : {
if (checkPermissionToStore()) {
Log.e("LOCATION IMAGE", imageUri.getPath());
isPhototaken = true;
// }
} else {
requestPermission();
}
}
}
}
private File getOutputMediaFile() {
File mediaStorageDir = new File(Environment.getExternalStorageDirectory()
+ "/Android/data/"
+ getApplicationContext().getPackageName()
+ "/Files");
if (! mediaStorageDir.exists()){
if (! mediaStorageDir.mkdirs()){
return null;
}
}
String timeStamp = new SimpleDateFormat("ddMMyyyy_HHmm").format(new Date());
File mediaFile;
String mImageName="MI_"+ timeStamp +".jpg";
mediaFile = new File(mediaStorageDir.getPath() + File.separator + mImageName);
return mediaFile;
}
private boolean checkPermissionToStore() {
int result = ContextCompat.checkSelfPermission(this , Manifest.permission.WRITE_EXTERNAL_STORAGE);
return result == PackageManager.PERMISSION_GRANTED;
}
private void requestPermission(){
if(ActivityCompat.shouldShowRequestPermissionRationale(this , Manifest.permission.WRITE_EXTERNAL_STORAGE)){
Toast.makeText(this, "Write External Storage permission allows us to do store images. Please allow this permission in App Settings.", Toast.LENGTH_LONG).show();
}else{
ActivityCompat.requestPermissions(this , new String[] {Manifest.permission.WRITE_EXTERNAL_STORAGE} , REQUEST_CODE_PERMISSION);
}
}
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
switch (requestCode){
case REQUEST_CODE_PERMISSION:{
if(grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED){
Log.e("value", "Permission Granted, Now you can use local drive .");
}else{
Log.e("value", "Permission Denied, You cannot use local drive .");
}
break;
}
}
}
private void init() {
addButton = findViewById(R.id.add);
name = findViewById(R.id.nombre);
personas = findViewById(R.id.personas);
description = findViewById(R.id.description);
preparacion = findViewById(R.id.preparacion);
ratingBar = findViewById(R.id.favoritos);
takePhoto = findViewById(R.id.photo);
}
}
| [
"luissantiagodev@gmail.com"
] | luissantiagodev@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.